diff --git a/.travis.yml b/.travis.yml index fb2865022..4ee4417b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: generic -dist: trusty +dist: xenial sudo: required compiler: clang @@ -38,21 +38,22 @@ env: - TRAVIS_ENV="--exhaustive --folder=strings" before_install: - - sudo rm -rf /usr/local/clang-3.5.0 - - sudo add-apt-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main" + - sudo rm -rf /usr/local/clang-7.0.0 + - sudo add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main" - wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF - sudo apt-get install -y apt-transport-https - - echo "deb https://download.mono-project.com/repo/ubuntu stable-trusty main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list + - echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list - sudo apt-get update install: - - sudo apt-get install -y clang-3.9 llvm-3.9 mono-complete - - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 20 - - sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.9 20 - - sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-3.9 20 - - sudo update-alternatives --install /usr/bin/llvm-link llvm-link /usr/bin/llvm-link-3.9 20 - - sudo update-alternatives --install /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-3.9 20 + - sudo apt-get install -y clang-4.0 clang-format-4.0 llvm-4.0-dev mono-complete ninja-build + - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-4.0 20 + - sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-4.0 20 + - sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-4.0 20 + - sudo update-alternatives --install /usr/bin/llvm-link llvm-link /usr/bin/llvm-link-4.0 20 + - sudo update-alternatives --install /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-4.0 20 + - sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-4.0 20 - sudo pip install pyyaml psutil script: @@ -61,4 +62,7 @@ script: - $CC --version - clang --version - clang++ --version + - llvm-link --version + - llvm-config --version + - ./format/run-clang-format.py -e test/basic/transform-out.c -r lib/smack include/smack share/smack/include share/smack/lib test examples - ./bin/build.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 731dc3251..9c39d3fce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 2.8) project(smack) if (NOT WIN32 OR MSYS OR CYGWIN) - find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-3.9 llvm-config PATHS ${LLVM_CONFIG} DOC "llvm-config") + find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-4.0 llvm-config PATHS ${LLVM_CONFIG} DOC "llvm-config") if (LLVM_CONFIG_EXECUTABLE STREQUAL "LLVM_CONFIG_EXECUTABLE-NOTFOUND") message(FATAL_ERROR "llvm-config could not be found!") @@ -179,6 +179,8 @@ add_library(smackTranslator STATIC include/smack/IntegerOverflowChecker.h include/smack/NormalizeLoops.h include/smack/SplitAggregateValue.h + include/smack/Prelude.h + include/smack/SmackWarnings.h lib/smack/AddTiming.cpp lib/smack/BoogieAst.cpp lib/smack/BplFilePrinter.cpp @@ -201,6 +203,8 @@ add_library(smackTranslator STATIC lib/smack/IntegerOverflowChecker.cpp lib/smack/NormalizeLoops.cpp lib/smack/SplitAggregateValue.cpp + lib/smack/Prelude.cpp + lib/smack/SmackWarnings.cpp ) add_executable(llvm2bpl diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c112d2155..5bee11e92 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,5 +12,7 @@ items before you start contributing: * We follow guidelines for [good git commit practice](https://wiki.openstack.org/wiki/GitCommitMessages) * We follow the [LLVM Coding - Standards](http://llvm.org/docs/CodingStandards.html) + Standards](http://llvm.org/docs/CodingStandards.html). We check the LLVM code + formatting rules during continuous integration using + [clang-format](https://clang.llvm.org/docs/ClangFormat.html). diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..a419042bb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM ubuntu:16.04 +MAINTAINER Shaobo He + +ENV SMACKDIR /home/user/smack + +RUN apt-get update && \ + apt-get -y install \ + software-properties-common \ + wget \ + sudo + +# Borrowed from JFS +# Create `user` user for container with password `user`. and give it +# password-less sudo access +RUN useradd -m user && \ + echo user:user | chpasswd && \ + cp /etc/sudoers /etc/sudoers.bak && \ + echo 'user ALL=(root) NOPASSWD: ALL' >> /etc/sudoers + +USER user + +# Add the current directory to `/home/user/smack` +ADD --chown=user . $SMACKDIR + +# Set the work directory +WORKDIR $SMACKDIR + +# Build SMACK +RUN sudo bin/build.sh + +# Add envinronment +RUN echo "source /home/user/smack.environment" >> ~/.bashrc diff --git a/Doxyfile b/Doxyfile index 146d3bd1c..22256367a 100644 --- a/Doxyfile +++ b/Doxyfile @@ -5,7 +5,7 @@ #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = smack -PROJECT_NUMBER = 1.9.3 +PROJECT_NUMBER = 2.0.0 PROJECT_BRIEF = "A bounded software verifier." PROJECT_LOGO = OUTPUT_DIRECTORY = docs diff --git a/LICENSE b/LICENSE index cdc39c560..833aa4e1d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,12 +1,15 @@ The MIT License -Copyright (c) 2008-2018 Zvonimir Rakamaric (zvonimir@cs.utah.edu), +Copyright (c) 2008-2019 Zvonimir Rakamaric (zvonimir@cs.utah.edu), Michael Emmi (michael.emmi@gmail.com) -Modified work Copyright (c) 2013-2018 Montgomery Carter, +Modified work Copyright (c) 2013-2019 Marek Baranowski, + Montgomery Carter, Pantazis Deligiannis, + Jack J. Garzella, Dietrich Geisler, Arvind Haran, Shaobo He, + Liam Machado, Jiten Thakkar, Jonathan Whitaker @@ -32,25 +35,26 @@ THE SOFTWARE. Copyrights and Licenses for Third Party Software Distributed with SMACK: ============================================================================== SMACK contains code written by third parties. Such software will have its own -individual LICENSE.TXT file in the directory in which it appears. This file +individual LICENSE file in the directory in which it appears. This file will describe the copyrights, license, and restrictions which apply to that code. The following pieces of software have additional or alternate copyrights, licenses, and/or restrictions: -Program Directories -------- ----------- -poolalloc include/assistDS +Program Directories License +------- ----------- ------- +poolalloc include/assistDS lib/DSA/LICENSE include/dsa lib/AssistDS lib/DSA +run-clang-format format format/LICENSE In addition, a binary distribution of SMACK contains at least the following tools and packages, which come with their own licenses: -- LLVM, clang, LLVM runtime (http://llvm.org/) -- mono (http://www.mono-project.com/) -- Boogie (https://github.com/boogie-org/boogie/) -- Corral (https://github.com/boogie-org/corral/) -- Z3 (https://github.com/Z3Prover/z3/) +- LLVM, clang, LLVM runtime (http://llvm.org) +- Boogie (https://github.com/boogie-org/boogie) +- Corral (https://github.com/boogie-org/corral) +- lockpwn (https://github.com/smackers/lockpwn) +- Z3 (https://github.com/Z3Prover/z3) diff --git a/astyle.conf b/astyle.conf deleted file mode 100644 index 80e53ee71..000000000 --- a/astyle.conf +++ /dev/null @@ -1,33 +0,0 @@ -# Our settings for the astyle code formatter -# run `astyle --options= ' - -# Display only the files that have been formatted. -formatted - -# Preserve the original file's date and time modified. -preserve-date - -# Indent using 2 spaces -indent=spaces=2 - -# Align the pointer type asterisk either { type, middle, name} -# type: int* x -# middle: int * x -# name: int *x -align-pointer=type - -# Align the reference type ampersand either {type, middle, name} -#align-reference=type - -# Insert space padding around operators -pad-oper - -# Insert space padding after paren headers only (e.g., 'if', 'for'...) -pad-header - -# Remove extra space padding around parenthesis on the inside and outside -unpad-paren - -# Converts tabs into spaces in the non-indentation part of the line -convert-tabs - diff --git a/bin/build.sh b/bin/build.sh index 3ccb41f46..1d905b443 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -58,7 +58,7 @@ CONFIGURE_INSTALL_PREFIX= CMAKE_INSTALL_PREFIX= # Partial list of dependencies; the rest are added depending on the platform -DEPENDENCIES="git cmake python-yaml python-psutil unzip wget" +DEPENDENCIES="git cmake python-yaml python-psutil unzip wget ninja-build" shopt -s extglob @@ -181,23 +181,28 @@ puts "Detected distribution: $distro" # Set platform-dependent flags case "$distro" in linux-opensuse*) - Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-debian-8.10.zip" + Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/Z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-debian-8.10.zip" DEPENDENCIES+=" llvm-clang llvm-devel gcc-c++ mono-complete make" DEPENDENCIES+=" ncurses-devel zlib-devel" ;; linux-@(ubuntu|neon)-14*) - Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-ubuntu-14.04.zip" - DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION} mono-complete libz-dev libedit-dev" + Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/Z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-ubuntu-14.04.zip" + DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev mono-complete libz-dev libedit-dev" ;; linux-@(ubuntu|neon)-16*) - Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-ubuntu-16.04.zip" - DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION} mono-complete libz-dev libedit-dev" + Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/Z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-ubuntu-16.04.zip" + DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev mono-complete libz-dev libedit-dev" + ;; + +linux-@(ubuntu|neon)-18*) + Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/Z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-ubuntu-16.04.zip" + DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev mono-complete libz-dev libedit-dev" ;; linux-ubuntu-12*) - Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-ubuntu-14.04.zip" + Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/Z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-ubuntu-14.04.zip" DEPENDENCIES+=" g++-4.8 autoconf automake bison flex libtool gettext gdb" DEPENDENCIES+=" libglib2.0-dev libfontconfig1-dev libfreetype6-dev libxrender-dev" DEPENDENCIES+=" libtiff-dev libjpeg-dev libgif-dev libpng-dev libcairo2-dev" @@ -251,7 +256,7 @@ if [ ${INSTALL_DEPENDENCIES} -eq 1 ] && [ "$TRAVIS" != "true" ] ; then sudo zypper --non-interactive install ${DEPENDENCIES} ;; - linux-@(ubuntu|neon)-1[46]*) + linux-@(ubuntu|neon)-1[468]*) RELEASE_VERSION=$(get-platform-trim "$(lsb_release -r)" | awk -F: '{print $2;}') case "$RELEASE_VERSION" in 14*) @@ -260,6 +265,9 @@ if [ ${INSTALL_DEPENDENCIES} -eq 1 ] && [ "$TRAVIS" != "true" ] ; then 16*) UBUNTU_CODENAME="xenial" ;; + 18*) + UBUNTU_CODENAME="bionic" + ;; *) puts "Release ${RELEASE_VERSION} for ${distro} not supported. Dependencies must be installed manually." exit 1 @@ -478,9 +486,9 @@ if [ ${BUILD_SMACK} -eq 1 ] ; then mkdir -p ${SMACK_DIR}/build cd ${SMACK_DIR}/build - cmake ${CMAKE_INSTALL_PREFIX} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug .. - make - sudo make install + cmake ${CMAKE_INSTALL_PREFIX} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug .. -G Ninja + ninja + sudo ninja install puts "Configuring shell environment" echo export BOOGIE=\"mono ${BOOGIE_DIR}/Binaries/Boogie.exe\" >> ${SMACKENV} diff --git a/bin/versions b/bin/versions index 8fa4712cd..c447c59c7 100644 --- a/bin/versions +++ b/bin/versions @@ -1,10 +1,10 @@ MONO_VERSION=5.0.0.100 -Z3_SHORT_VERSION=4.8.1 -Z3_FULL_VERSION=4.8.1.016872a5e0f6 -BOOGIE_COMMIT=cd0609f660 -CORRAL_COMMIT=d7d389f22d +Z3_SHORT_VERSION=4.8.5 +Z3_FULL_VERSION=4.8.5 +BOOGIE_COMMIT=5c829b6340 +CORRAL_COMMIT=c446f5e827 SYMBOOGLIX_COMMIT=7210e5d09b LOCKPWN_COMMIT=73eddf97bd -LLVM_SHORT_VERSION=3.9 -LLVM_FULL_VERSION=3.9.1 +LLVM_SHORT_VERSION=4.0 +LLVM_FULL_VERSION=4.0.1 RUST_VERSION=2016-12-16 diff --git a/docs/boogie-code.md b/docs/boogie-code.md index 68be92614..f9b5fb0f7 100644 --- a/docs/boogie-code.md +++ b/docs/boogie-code.md @@ -38,6 +38,33 @@ void assume(bool v) { } ```` SMACK interprets the `@` symbol by inserting the value of the C variable `v`. +Since the arguments of variadic functions may be promoted, SMACK allows users +to append a format character to the `@` symbol as an indicator that the argument, +rather than its promoted form, should be used in the format string. We allow the +following format characters (inspired by Python and C) for the respective C types: +`c` (`char`), `b` (`signed char`), `B` (`unsigned char`), `h` (`signed short`), +`H` (`unsigned short`), `i` (`signed int`), `I` (`unsigned int`) and `f` +(`float`). + +For example, without using such annotations, the definition of the `floorf` +function is: +```C +float floorf(float x) { + double ret = __VERIFIER_nondet_double(); + __SMACK_code("@ := ftd($rmode, $round.bvfloat(RTN, dtf($rmode, @)));", ret, x); + return ret; + } +``` +where the `ftd` and `dtf` functions are conversions between `float` and `double` +variables that are needed to deal with the promotion of the arguments. +Whereas a better definition using these annotations is: +```C +float floorf(float x) { + float ret = __VERIFIER_nondet_float(); + __SMACK_code("@f := $round.bvfloat(RTN, @f);", ret, x); + return ret; + } + ``` One application of this functionality which has been valuable to the authors of SMACK is in encoding concurrency primitives into the generated Boogie code. The diff --git a/docs/demos.md b/docs/demos.md index a0365d1a9..2cbfa3bad 100644 --- a/docs/demos.md +++ b/docs/demos.md @@ -2,5 +2,6 @@ A narrated introduction and demonstration of SMACK can be seen at -https://youtu.be/SPPSC1KdRzs +https://youtu.be/SPPSC1KdRzs. Note that the demo is somewhat outdated; for +example, Duality is no longer supported. diff --git a/docs/installation.md b/docs/installation.md index 282819486..0c26b62ea 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -27,7 +27,7 @@ wget https://raw.githubusercontent.com/smackers/smack/develop/test/basic/simple. vsmack simple.c ```` -### Quick Setup: Vagrant Development Environment +### Quick Setup 1: Vagrant Development Environment SMACK can be run in a preconfigured virtual environment using [Vagrant][] and [VirtualBox][]. Both are available for a wide range of systems, with great @@ -55,13 +55,35 @@ session, and halt, suspend, or destroy the virtual machine: vagrant destroy ```` +### Quick Setup 2: Docker +SMACK can also be run in a [Docker][] container. We tested the Dockerfile on +the following configurations: + +* Ubuntu 16.04, docker-ce version 18.09.7 +* OS X 10.14.5, Docker Desktop with Docker engine version 18.09.2 +* Windows 10, Docker Desktop with Docker engine version 18.09.2 + +Once Docker is successfully installed, build the Docker image by running the +following command in SMACK's root directory that contains `Dockerfile`: +```Shell +docker build . -t smack +``` +After the image is successfully built, invoke a Docker container by running the +following command: +```Shell +docker run -it smack +``` +For more advanced usages of Docker (e.g., to mount host directories), please refer +to Docker's official documentation. + ### General System Requirements SMACK depends on the following projects: -* [LLVM][] version [3.9.1][LLVM-3.9.1] -* [Clang][] version [3.9.1][Clang-3.9.1] +* [LLVM][] version [4.0.1][LLVM-4.0.1] +* [Clang][] version [4.0.1][Clang-4.0.1] * [Python][] version 2.7 or greater +* [Ninja][] version 1.5.1 or greater * [Mono][] version 5.0.0 or greater (except on Windows) * [Z3][] or compatible SMT-format theorem prover * [Boogie][] or [Corral][] or compatible Boogie-format verifier @@ -108,7 +130,8 @@ requires the Command Line Tools for [Xcode][]. Generally speaking, apart from the [Homebrew][] package manager. [Mono][] can be installed from binaries either from the [Mono][] download page, or via [Homebrew Cask][]. -### Installation on Windows/Cygwin +### Installation on Windows +#### Cygwin (Deprecated) The general instructions for installation on Windows using [Cygwin][] mainly follow those above for Linux, and are outlined in our automated [build.sh][] @@ -121,6 +144,13 @@ installers rather than built from source. and [Clang][] is problematic on some [Cygwin][] configurations. Please consult [LLVM][] documentation in case of any issues. +#### Windows Subsystem for Linux (Recommended) + +SMACK can be installed on the Windows Subsystem for Linux (WSL) by following the +same procedure as the Linux installation (i.e., via the build script [build.sh][]). +We tested the WSL installation on Windows 10 (Build 18362) with Ubuntu 16.04 +installed via the Microsoft Store. + ### Installing SMACK Itself SMACK is built using [CMake][] via the following sequence of shell commands @@ -128,8 +158,8 @@ from SMACK's root directory: ````Shell mkdir build cd build -cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug .. -make install +cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug .. -G Ninja +ninja install ```` Note that the `llvm-config` binary must be in your executable `PATH`. To specify an install location `PREFIX` other than the default installation @@ -173,9 +203,9 @@ shell in the `test` directory by executing [CMake]: http://www.cmake.org [Python]: http://www.python.org [LLVM]: http://llvm.org -[LLVM-3.9.1]: http://llvm.org/releases/download.html#3.9.1 +[LLVM-4.0.1]: http://llvm.org/releases/download.html#4.0.1 [Clang]: http://clang.llvm.org -[Clang-3.9.1]: http://llvm.org/releases/download.html#3.9.1 +[Clang-4.0.1]: http://llvm.org/releases/download.html#4.0.1 [Boogie]: https://github.com/boogie-org/boogie [Corral]: https://github.com/boogie-org/corral [Z3]: https://github.com/Z3Prover/z3/ @@ -186,3 +216,5 @@ shell in the `test` directory by executing [Xcode]: https://developer.apple.com/xcode/ [Homebrew]: http://brew.sh/ [Homebrew Cask]: http://caskroom.io +[Docker]: https://www.docker.com +[Ninja]: https://ninja-build.org diff --git a/docs/people.md b/docs/people.md index d61d828bd..ebaf02682 100644 --- a/docs/people.md +++ b/docs/people.md @@ -9,11 +9,17 @@ ### Contributors +* [Marek Baranowski](https://github.com/keram88) ([SOAR Lab](http://soarlab.org), University of Utah) +* [Jack J. Garzella](https://www.linkedin.com/in/jack-j-garzella-7140a716) ([SOAR Lab](http://soarlab.org), University of Utah) +* [Shaobo He](http://www.cs.utah.edu/~shaobo) ([SOAR Lab](http://soarlab.org), University of Utah) +* [Liam Machado](https://github.com/liammachado) ([SOAR Lab](http://soarlab.org), University of Utah) + +### Former Contributors + * [Montgomery Carter](http://www.linkedin.com/pub/montgomery-carter/12/a89/512) ([SOAR Lab](http://soarlab.org), University of Utah) * [Pantazis Deligiannis](http://pdeligia.github.io) (Microsoft Research) * [Dietrich Geisler](https://github.com/Checkmate50) ([SOAR Lab](http://soarlab.org), University of Utah) * [Arvind Haran](http://www.cs.utah.edu/~haran) ([SOAR Lab](http://soarlab.org), University of Utah) -* [Shaobo He](http://www.cs.utah.edu/~shaobo) ([SOAR Lab](http://soarlab.org), University of Utah) * [Jiten Thakkar](http://jiten-thakkar.com) ([SOAR Lab](http://soarlab.org), University of Utah) * [Jonathan Whitaker](https://www.linkedin.com/in/jonathan-whitaker-5a8b2484) ([SOAR Lab](http://soarlab.org/), University of Utah) diff --git a/docs/publications.md b/docs/publications.md index 81b2d3e69..4a229f951 100644 --- a/docs/publications.md +++ b/docs/publications.md @@ -14,6 +14,14 @@ Zvonimir Rakamaric, Michael Emmi, This is an incomplete list of publications that use, leverage, or extend SMACK. If you have a publication for this list, please email [Zvonimir](mailto:zvonimir@cs.utah.edu). +1. [CANAL: A Cache Timing Analysis Framework via LLVM Transformation](https://dl.acm.org/citation.cfm?id=3240485), +Chungha Sung, Brandon Paulsen, Chao Wang, +33rd ACM/IEEE International Conference on Automated Software Engineering (ASE 2018) + +1. [Formal Security Verification of Concurrent Firmware in SoCs using Instruction-Level Abstraction for Hardware](https://dl.acm.org/citation.cfm?id=3196055), +Bo-Yuan Huang, Sayak Ray, Aarti Gupta, Jason M. Fung, Sharad Malik, +55th Annual Design Automation Conference (DAC 2018) + 1. [Reducer-Based Construction of Conditional Verifiers](https://dl.acm.org/citation.cfm?id=3180259), Dirk Beyer, Marie-Christine Jakobs, Thomas Lemberger, Heike Wehrheim, 40th International Conference on Software Engineering (ICSE 2018) diff --git a/docs/running.md b/docs/running.md index f10b62873..48d845603 100644 --- a/docs/running.md +++ b/docs/running.md @@ -114,3 +114,5 @@ verifier leverages to generate more informative error traces. Then, the generate file is translated into Boogie code, which is in turn passed to the chosen back-end verifier. +For mode advanced usage scenarios, please refer to our [usage notes](usage-notes.md). + diff --git a/docs/usage-notes.md b/docs/usage-notes.md new file mode 100644 index 000000000..de6825971 --- /dev/null +++ b/docs/usage-notes.md @@ -0,0 +1,105 @@ +This document shows several usage scenarios of SMACK that require special flags. + +## Loops and Recusive Functions +First of all, please keep in mind that SMACK is a *bounded* verifier, which +means that in the presense of loops and recursive functions, the verification +process unrolls them up to the bound `N` specified by the flag `--unroll `. +Conceptually, unrolling a loop means transforming a loop into a sequence (length +`N`) of if-else statements, the inner most of which halts the program. Recursive +functions are handled by inlining the function `N` times and the inner most +recursive call halts the program. Therefore, not unrolling a loop or a recursive +function to a sufficient bound can lead to missed bugs. In other words, when +SMACK reports that there are no bugs in a program, it actually means that the +program is safe within the bound specified by the user. + +### Example +```C +#include "smack.h" + +int main (void) { + long x = __VERIFIER_nondet_long(); + long y, z = 0; + assume(x > 2); + for (y = 0; y < x; ++ y) z++; + assert(z != x); + return 0; +} +``` +The assertion in this program should fail. However, if SMACK is invoked with the +default unrolling bound `1`, it reports no errors. This is because the loop has +to be unrolled at least 4 times (i.e., after `y` gets value 3, the minimum value +of `x`, in the 3rd iteration) for the assertion to be reachable. + +## Bitwise Operations and Integer Casts +If the program to verify contains bitwise operations or integer casts, then the +flag `--bit-precise` may be required. The reason is that SMACK uses the SMT +theory of integers to encode machine integers by default, where bitwise +operations are encoded using uninterpreted functions returning arbitrary values. +Furthermore, precise encoding is required to handle integer signedness casts, +which is not also enabled automatically. + +The following program demonstrate the problems in the presence of bitwise +operations. + +### Example +```C +#include "smack.h" + +int main (void) { + unsigned y = __VERIFIER_nondet_unsigned_int(); + assume (y < 4U); + y >>= 2U; + assert (!y); +} +``` +This program should verify. However, if the we run SMACK in its default mode, it +reports an assertion violation. + +``` +$ smack a.c +SMACK program verifier version 1.9.0 +/home/shaobo/project/smack/install/share/smack/lib/smack.c(40,1): This assertion can fail +Execution trace: + ... + a.c(4,16): Trace: Thread=1 (y = -669) + ... + a.c(6,5): Trace: Thread=1 (y = 17) + ... +SMACK found an error. +``` + +Some steps in the error trace are omitted. As you can see, the concrete values +of `y` in the error trace before and after the bitwise right shift operation do +not follow its semantics because it is modeled as an uninterpreted function. + +In this case, we need the `--bit-precise` flag that, as its name indicates, +enables bit-precise modeling of machine integers. + +``` +$ smack a.c --bit-precise +SMACK program verifier version 1.9.0 +SMACK found no errors with unroll bound 1. +``` + +If the program that you would like to verify contains such patterns, try +enabling this flag. However, note that enabling bit-precise reasoning often +degrades the performance of SMACK, and causes for it to take much longer to +perform the verification. + +## Floating-Point Arithmetic +Similar to machine integers, floating-point numbers and arithmetic are modeled +using the theory of integers and uninterpreted functions, respectively. +Therefore, if the assertions to verify depend on precise modeling of +floating-point representations, the flag `--float` is needed. Note that +occasionally `--bit-precise` has to be used in addition to `--float`, in +particular when casts between floating-point numbers and integers are present. +Moreover, reasoning about floating-point numbers is often very slow. Please let +us know if you encounter any performance issues. We can share some experiences +that may ease the situation. + +## Concurrency +Reasoning about pthreads is supported by SMACK with the flag `--pthread`. Please +use this flag when you would like to verify a multi-threaded program with +pthreads. One important flag for reasoning about concurrent programs is +`--context-bound` which is 1 by default. Try increasing this value if you would +like more thorough exploration of the concurrent programs. diff --git a/examples/simple-project/incr.c b/examples/simple-project/incr.c index 20cd75f50..f5671dff6 100644 --- a/examples/simple-project/incr.c +++ b/examples/simple-project/incr.c @@ -8,4 +8,3 @@ int incr(int x) { assume(y > 0 && y < 10000); // prevents overflow when bit-precise return x + y; } - diff --git a/examples/simple-project/simple.c b/examples/simple-project/simple.c index c05fbdbd7..ace707426 100644 --- a/examples/simple-project/simple.c +++ b/examples/simple-project/simple.c @@ -16,4 +16,3 @@ int main(void) { test(a); return 0; } - diff --git a/examples/simple-project/simple.h b/examples/simple-project/simple.h index 2c5141ef7..7e4568157 100644 --- a/examples/simple-project/simple.h +++ b/examples/simple-project/simple.h @@ -4,8 +4,8 @@ #ifndef SIMPLE_H #define SIMPLE_H -#include "smack.h" #include "incr.h" +#include "smack.h" void test(int); diff --git a/examples/simple/simple.c b/examples/simple/simple.c index dbc02ae15..ff5b7c5bc 100644 --- a/examples/simple/simple.c +++ b/examples/simple/simple.c @@ -16,21 +16,21 @@ typedef struct { // Create and initialize account PACCOUNT create(int limit) { - if (limit <= 0 || limit > MAX_LIMIT) return 0; - PACCOUNT acc = (PACCOUNT) malloc(sizeof(ACCOUNT)); + if (limit <= 0 || limit > MAX_LIMIT) + return 0; + PACCOUNT acc = (PACCOUNT)malloc(sizeof(ACCOUNT)); acc->balance = 0; acc->limit = limit; return acc; } // Get account balance -int get_balance(PACCOUNT acc) { - return acc->balance; -} +int get_balance(PACCOUNT acc) { return acc->balance; } // Deposit funds if not exceeding the account limit int deposit(PACCOUNT acc, int n) { - if (n <= 0) return FALSE; + if (n <= 0) + return FALSE; if (acc->balance > acc->limit - n) { return FALSE; } @@ -40,7 +40,8 @@ int deposit(PACCOUNT acc, int n) { // Withdraw if there is enough funds in the account int withdraw(PACCOUNT acc, int n) { - if (n <= 0) return FALSE; + if (n <= 0) + return FALSE; if (acc->balance >= n) { acc->balance = acc->balance - n; return TRUE; @@ -59,11 +60,11 @@ void test_account(int x, int y, int z) { return; } ops += deposit(acc, y); - assert(get_balance(acc) >=0 && get_balance(acc) <= MAX_LIMIT); + assert(get_balance(acc) >= 0 && get_balance(acc) <= MAX_LIMIT); ops += deposit(acc, z); - assert(get_balance(acc) >=0 && get_balance(acc) <= MAX_LIMIT); + assert(get_balance(acc) >= 0 && get_balance(acc) <= MAX_LIMIT); ops += withdraw(acc, z); - assert(get_balance(acc) >=0 && get_balance(acc) <= MAX_LIMIT); + assert(get_balance(acc) >= 0 && get_balance(acc) <= MAX_LIMIT); assert(ops < 3 || get_balance(acc) == y); free(acc); return; @@ -78,4 +79,3 @@ int main(void) { test_account(x, y, z); return 0; } - diff --git a/format/LICENSE b/format/LICENSE new file mode 100644 index 000000000..e728f2488 --- /dev/null +++ b/format/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Guillaume Papin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/format/run-clang-format.py b/format/run-clang-format.py new file mode 100755 index 000000000..3d0cca0a9 --- /dev/null +++ b/format/run-clang-format.py @@ -0,0 +1,325 @@ +#!/usr/bin/env python +"""A wrapper script around clang-format, suitable for linting multiple files +and to use for continuous integration. + +This is an alternative API for the clang-format command line. +It runs over multiple files and directories in parallel. +A diff output is produced and a sensible exit code is returned. + +""" + +from __future__ import print_function, unicode_literals + +import argparse +import codecs +import difflib +import fnmatch +import io +import multiprocessing +import os +import signal +import subprocess +import sys +import traceback + +from functools import partial + +DEFAULT_EXTENSIONS = 'c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx' + + +class ExitStatus: + SUCCESS = 0 + DIFF = 1 + TROUBLE = 2 + + +def list_files(files, recursive=False, extensions=None, exclude=None): + if extensions is None: + extensions = [] + if exclude is None: + exclude = [] + + out = [] + for file in files: + if recursive and os.path.isdir(file): + for dirpath, dnames, fnames in os.walk(file): + fpaths = [os.path.join(dirpath, fname) for fname in fnames] + for pattern in exclude: + # os.walk() supports trimming down the dnames list + # by modifying it in-place, + # to avoid unnecessary directory listings. + dnames[:] = [ + x for x in dnames + if + not fnmatch.fnmatch(os.path.join(dirpath, x), pattern) + ] + fpaths = [ + x for x in fpaths if not fnmatch.fnmatch(x, pattern) + ] + for f in fpaths: + ext = os.path.splitext(f)[1][1:] + if ext in extensions: + out.append(f) + else: + out.append(file) + return out + + +def make_diff(file, original, reformatted): + return list( + difflib.unified_diff( + original, + reformatted, + fromfile='{}\t(original)'.format(file), + tofile='{}\t(reformatted)'.format(file), + n=3)) + + +class DiffError(Exception): + def __init__(self, message, errs=None): + super(DiffError, self).__init__(message) + self.errs = errs or [] + + +class UnexpectedError(Exception): + def __init__(self, message, exc=None): + super(UnexpectedError, self).__init__(message) + self.formatted_traceback = traceback.format_exc() + self.exc = exc + + +def run_clang_format_diff_wrapper(args, file): + try: + ret = run_clang_format_diff(args, file) + return ret + except DiffError: + raise + except Exception as e: + raise UnexpectedError('{}: {}: {}'.format(file, e.__class__.__name__, + e), e) + + +def run_clang_format_diff(args, file): + try: + with io.open(file, 'r', encoding='utf-8') as f: + original = f.readlines() + except IOError as exc: + raise DiffError(str(exc)) + invocation = [args.clang_format_executable, file] + + # Use of utf-8 to decode the process output. + # + # Hopefully, this is the correct thing to do. + # + # It's done due to the following assumptions (which may be incorrect): + # - clang-format will returns the bytes read from the files as-is, + # without conversion, and it is already assumed that the files use utf-8. + # - if the diagnostics were internationalized, they would use utf-8: + # > Adding Translations to Clang + # > + # > Not possible yet! + # > Diagnostic strings should be written in UTF-8, + # > the client can translate to the relevant code page if needed. + # > Each translation completely replaces the format string + # > for the diagnostic. + # > -- http://clang.llvm.org/docs/InternalsManual.html#internals-diag-translation + # + # It's not pretty, due to Python 2 & 3 compatibility. + encoding_py3 = {} + if sys.version_info[0] >= 3: + encoding_py3['encoding'] = 'utf-8' + + try: + proc = subprocess.Popen( + invocation, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True, + **encoding_py3) + except OSError as exc: + raise DiffError(str(exc)) + proc_stdout = proc.stdout + proc_stderr = proc.stderr + if sys.version_info[0] < 3: + # make the pipes compatible with Python 3, + # reading lines should output unicode + encoding = 'utf-8' + proc_stdout = codecs.getreader(encoding)(proc_stdout) + proc_stderr = codecs.getreader(encoding)(proc_stderr) + # hopefully the stderr pipe won't get full and block the process + outs = list(proc_stdout.readlines()) + errs = list(proc_stderr.readlines()) + proc.wait() + if proc.returncode: + raise DiffError("clang-format exited with status {}: '{}'".format( + proc.returncode, file), errs) + return make_diff(file, original, outs), errs + + +def bold_red(s): + return '\x1b[1m\x1b[31m' + s + '\x1b[0m' + + +def colorize(diff_lines): + def bold(s): + return '\x1b[1m' + s + '\x1b[0m' + + def cyan(s): + return '\x1b[36m' + s + '\x1b[0m' + + def green(s): + return '\x1b[32m' + s + '\x1b[0m' + + def red(s): + return '\x1b[31m' + s + '\x1b[0m' + + for line in diff_lines: + if line[:4] in ['--- ', '+++ ']: + yield bold(line) + elif line.startswith('@@ '): + yield cyan(line) + elif line.startswith('+'): + yield green(line) + elif line.startswith('-'): + yield red(line) + else: + yield line + + +def print_diff(diff_lines, use_color): + if use_color: + diff_lines = colorize(diff_lines) + if sys.version_info[0] < 3: + sys.stdout.writelines((l.encode('utf-8') for l in diff_lines)) + else: + sys.stdout.writelines(diff_lines) + + +def print_trouble(prog, message, use_colors): + error_text = 'error:' + if use_colors: + error_text = bold_red(error_text) + print("{}: {} {}".format(prog, error_text, message), file=sys.stderr) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + '--clang-format-executable', + metavar='EXECUTABLE', + help='path to the clang-format executable', + default='clang-format') + parser.add_argument( + '--extensions', + help='comma separated list of file extensions (default: {})'.format( + DEFAULT_EXTENSIONS), + default=DEFAULT_EXTENSIONS) + parser.add_argument( + '-r', + '--recursive', + action='store_true', + help='run recursively over directories') + parser.add_argument('files', metavar='file', nargs='+') + parser.add_argument( + '-q', + '--quiet', + action='store_true') + parser.add_argument( + '-j', + metavar='N', + type=int, + default=0, + help='run N clang-format jobs in parallel' + ' (default number of cpus + 1)') + parser.add_argument( + '--color', + default='auto', + choices=['auto', 'always', 'never'], + help='show colored diff (default: auto)') + parser.add_argument( + '-e', + '--exclude', + metavar='PATTERN', + action='append', + default=[], + help='exclude paths matching the given glob-like pattern(s)' + ' from recursive search') + + args = parser.parse_args() + + # use default signal handling, like diff return SIGINT value on ^C + # https://bugs.python.org/issue14229#msg156446 + signal.signal(signal.SIGINT, signal.SIG_DFL) + try: + signal.SIGPIPE + except AttributeError: + # compatibility, SIGPIPE does not exist on Windows + pass + else: + signal.signal(signal.SIGPIPE, signal.SIG_DFL) + + colored_stdout = False + colored_stderr = False + if args.color == 'always': + colored_stdout = True + colored_stderr = True + elif args.color == 'auto': + colored_stdout = sys.stdout.isatty() + colored_stderr = sys.stderr.isatty() + + retcode = ExitStatus.SUCCESS + files = list_files( + args.files, + recursive=args.recursive, + exclude=args.exclude, + extensions=args.extensions.split(',')) + + if not files: + return + + njobs = args.j + if njobs == 0: + njobs = multiprocessing.cpu_count() + 1 + njobs = min(len(files), njobs) + + if njobs == 1: + # execute directly instead of in a pool, + # less overhead, simpler stacktraces + it = (run_clang_format_diff_wrapper(args, file) for file in files) + pool = None + else: + pool = multiprocessing.Pool(njobs) + it = pool.imap_unordered( + partial(run_clang_format_diff_wrapper, args), files) + while True: + try: + outs, errs = next(it) + except StopIteration: + break + except DiffError as e: + print_trouble(parser.prog, str(e), use_colors=colored_stderr) + retcode = ExitStatus.TROUBLE + sys.stderr.writelines(e.errs) + except UnexpectedError as e: + print_trouble(parser.prog, str(e), use_colors=colored_stderr) + sys.stderr.write(e.formatted_traceback) + retcode = ExitStatus.TROUBLE + # stop at the first unexpected error, + # something could be very wrong, + # don't process all files unnecessarily + if pool: + pool.terminate() + break + else: + sys.stderr.writelines(errs) + if outs == []: + continue + if not args.quiet: + print_diff(outs, use_color=colored_stdout) + if retcode == ExitStatus.SUCCESS: + retcode = ExitStatus.DIFF + return retcode + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/include/dsa/AllocatorIdentification.h b/include/dsa/AllocatorIdentification.h index 1ac36b6e6..2a35c00c9 100644 --- a/include/dsa/AllocatorIdentification.h +++ b/include/dsa/AllocatorIdentification.h @@ -45,7 +45,7 @@ namespace llvm { virtual ~AllocIdentify(); bool runOnModule(llvm::Module&); virtual void getAnalysisUsage(llvm::AnalysisUsage &Info) const; - virtual const char * getPassName() const { + virtual StringRef getPassName() const { return "Allocator Identification Analysis (find malloc/free wrappers)"; } }; diff --git a/include/dsa/DSGraphTraits.h b/include/dsa/DSGraphTraits.h index e744c27e0..050284a73 100644 --- a/include/dsa/DSGraphTraits.h +++ b/include/dsa/DSGraphTraits.h @@ -24,6 +24,32 @@ namespace llvm { +namespace bugfix { + +// XXX: There's a bug in llvm::pointer_iterator. The iterator_category +// parameter to iterator_adaptor_base is omitted. We can remove this once it is fixed. +// http://llvm.org/doxygen/iterator_8h_source.html#l00311 +template ())> +class pointer_iterator + : public iterator_adaptor_base, + WrappedIteratorT, + typename std::iterator_traits::iterator_category, + T> { + mutable T Ptr; + +public: + pointer_iterator() = default; + + explicit pointer_iterator(WrappedIteratorT u) + : pointer_iterator::iterator_adaptor_base(std::move(u)) {} + + T &operator*() { return Ptr = &*this->I; } + const T &operator*() const { return Ptr = &*this->I; } +}; + +} // End bugfix namespace + template class DSNodeIterator : public std::iterator { friend class DSNode; @@ -80,38 +106,38 @@ inline DSNode::const_iterator DSNode::end() const { } template <> struct GraphTraits { - typedef DSNode NodeType; + typedef DSNode* NodeRef; typedef DSNode::iterator ChildIteratorType; - static NodeType *getEntryNode(NodeType *N) { return N; } - static ChildIteratorType child_begin(NodeType *N) { return N->begin(); } - static ChildIteratorType child_end(NodeType *N) { return N->end(); } + static NodeRef getEntryNode(NodeRef N) { return N; } + static ChildIteratorType child_begin(NodeRef N) { return N->begin(); } + static ChildIteratorType child_end(NodeRef N) { return N->end(); } }; template <> struct GraphTraits { - typedef const DSNode NodeType; + typedef const DSNode* NodeRef; typedef DSNode::const_iterator ChildIteratorType; - static NodeType *getEntryNode(NodeType *N) { return N; } - static ChildIteratorType child_begin(NodeType *N) { return N->begin(); } - static ChildIteratorType child_end(NodeType *N) { return N->end(); } + static NodeRef getEntryNode(NodeRef N) { return N; } + static ChildIteratorType child_begin(NodeRef N) { return N->begin(); } + static ChildIteratorType child_end(NodeRef N) { return N->end(); } }; template <> struct GraphTraits { - typedef const DSNode NodeType; + typedef const DSNode* NodeRef; typedef DSNode::const_iterator ChildIteratorType; // nodes_iterator/begin/end - Allow iteration over all nodes in the graph - typedef DSGraph::node_const_iterator nodes_iterator; + typedef bugfix::pointer_iterator nodes_iterator; static nodes_iterator nodes_begin(const DSGraph *G) { - return G->node_begin(); + return nodes_iterator(G->node_begin()); } static nodes_iterator nodes_end(const DSGraph *G) { - return G->node_end(); + return nodes_iterator(G->node_end()); } - static ChildIteratorType child_begin(const NodeType *N) { return N->begin(); } - static ChildIteratorType child_end(const NodeType *N) { return N->end(); } + static ChildIteratorType child_begin(NodeRef N) { return N->begin(); } + static ChildIteratorType child_end(NodeRef N) { return N->end(); } }; } // End llvm namespace diff --git a/include/dsa/DSNode.h b/include/dsa/DSNode.h index 26a3138f9..180cd1c20 100644 --- a/include/dsa/DSNode.h +++ b/include/dsa/DSNode.h @@ -44,7 +44,6 @@ class DSNode : public ilist_node { typedef std::map LinkMapTy; private: - friend struct ilist_sentinel_traits; //Sentinel DSNode() : NumReferrers(0), Size(0), NodeType(0) {} diff --git a/include/dsa/TypeSafety.h b/include/dsa/TypeSafety.h index f018cf9f3..b003434d2 100644 --- a/include/dsa/TypeSafety.h +++ b/include/dsa/TypeSafety.h @@ -65,7 +65,7 @@ struct TypeSafety : public ModulePass { TypeSafety() : ModulePass(ID) {} virtual bool runOnModule (Module & M); - const char *getPassName() const { + virtual StringRef getPassName() const { return "DSA Type-Safety Analysis"; } diff --git a/include/smack/AddTiming.h b/include/smack/AddTiming.h index 87984bdec..06871a32a 100644 --- a/include/smack/AddTiming.h +++ b/include/smack/AddTiming.h @@ -4,49 +4,51 @@ #ifndef ADDTIMING_H #define ADDTIMING_H -#include "llvm/Pass.h" #include "llvm/IR/Instructions.h" +#include "llvm/Pass.h" namespace llvm { class TargetTransformInfo; } namespace smack { - using namespace llvm; - - class AddTiming : public FunctionPass { - - enum Flags { NO_TIMING_INFO = -1}; - static const std::string INT_TIMING_COST_METADATA; - static const std::string INSTRUCTION_NAME_METADATA; - - public: - static char ID; // Class identification, replacement for typeinfo - AddTiming() : FunctionPass(ID), F(nullptr), TTI(nullptr) {} - - /// Returns the expected cost of the instruction. - /// Returns -1 if the cost is unknown. - /// Note, this method does not cache the cost calculation and it - /// can be expensive in some cases. - unsigned getInstructionCost(const Instruction *I) const; - - private: - void addMetadata(Instruction *Inst, const std::string &name, const std::string& value) const; - void addMetadata(Instruction *Inst, const std::string &name, unsigned cost) const; - void addNamingMetadata(Instruction *Inst) const; - void addTimingMetadata(Instruction* Inst) const; - - void getAnalysisUsage(AnalysisUsage &AU) const override; - bool runOnFunction(Function &F) override; - void print(raw_ostream &OS, const Module*) const override; - std::string nameInstruction(Instruction *Inst) const; - - /// The function that we analyze. - Function *F; - /// Target information. - const TargetTransformInfo *TTI; - }; - -}//namespace smack - -#endif //ADDTIMING_H +using namespace llvm; + +class AddTiming : public FunctionPass { + + enum Flags { NO_TIMING_INFO = -1 }; + static const std::string INT_TIMING_COST_METADATA; + static const std::string INSTRUCTION_NAME_METADATA; + +public: + static char ID; // Class identification, replacement for typeinfo + AddTiming() : FunctionPass(ID), F(nullptr), TTI(nullptr) {} + + /// Returns the expected cost of the instruction. + /// Returns -1 if the cost is unknown. + /// Note, this method does not cache the cost calculation and it + /// can be expensive in some cases. + unsigned getInstructionCost(const Instruction *I) const; + +private: + void addMetadata(Instruction *Inst, const std::string &name, + const std::string &value) const; + void addMetadata(Instruction *Inst, const std::string &name, + unsigned cost) const; + void addNamingMetadata(Instruction *Inst) const; + void addTimingMetadata(Instruction *Inst) const; + + void getAnalysisUsage(AnalysisUsage &AU) const override; + bool runOnFunction(Function &F) override; + void print(raw_ostream &OS, const Module *) const override; + std::string nameInstruction(Instruction *Inst) const; + + /// The function that we analyze. + Function *F; + /// Target information. + const TargetTransformInfo *TTI; +}; + +} // namespace smack + +#endif // ADDTIMING_H diff --git a/include/smack/BoogieAst.h b/include/smack/BoogieAst.h index 9c96c79ba..34ff1230b 100644 --- a/include/smack/BoogieAst.h +++ b/include/smack/BoogieAst.h @@ -4,9 +4,9 @@ #ifndef BOOGIEAST_H #define BOOGIEAST_H +#include #include #include -#include namespace smack { @@ -17,279 +17,366 @@ enum class RModeKind { RNE, RNA, RTP, RTN, RTZ }; class Expr { public: virtual ~Expr() {} - virtual void print(std::ostream& os) const = 0; - static const Expr* exists(std::list, const Expr* e); - static const Expr* forall(std::list, const Expr* e); - static const Expr* and_(const Expr* l, const Expr* r); - static const Expr* cond(const Expr* c, const Expr* t, const Expr* e); - static const Expr* eq(const Expr* l, const Expr* r); - static const Expr* lt(const Expr* l, const Expr* r); - static const Expr* fn(std::string f, const Expr* x); - static const Expr* fn(std::string f, const Expr* x, const Expr* y); - static const Expr* fn(std::string f, const Expr* x, const Expr* y, const Expr* z); - static const Expr* fn(std::string f, std::list args); - static const Expr* id(std::string x); - static const Expr* impl(const Expr* l, const Expr* r); - static const Expr* lit(bool b); - static const Expr* lit(std::string v); - static const Expr* lit(unsigned v) { return lit((unsigned long) v); } - static const Expr* lit(unsigned long v); - static const Expr* lit(long v); - static const Expr* lit(std::string v, unsigned w); - static const Expr* lit(unsigned long v, unsigned w); - static const Expr* lit(bool n, std::string s, std::string e, unsigned ss, unsigned es); - static const Expr* lit(RModeKind v); - static const Expr* neq(const Expr* l, const Expr* r); - static const Expr* not_(const Expr* e); - static const Expr* sel(const Expr* b, const Expr* i); - static const Expr* sel(std::string b, std::string i); - static const Expr* upd(const Expr* b, const Expr* i, const Expr* v); - static const Expr* if_then_else(const Expr* c, const Expr* t, const Expr* e); + virtual void print(std::ostream &os) const = 0; + static const Expr *exists(std::list, const Expr *e); + static const Expr *forall(std::list, const Expr *e); + static const Expr *and_(const Expr *l, const Expr *r); + static const Expr *or_(const Expr *l, const Expr *r); + static const Expr *cond(const Expr *c, const Expr *t, const Expr *e); + static const Expr *eq(const Expr *l, const Expr *r); + static const Expr *lt(const Expr *l, const Expr *r); + static const Expr *fn(std::string f, const Expr *x); + static const Expr *fn(std::string f, const Expr *x, const Expr *y); + static const Expr *fn(std::string f, const Expr *x, const Expr *y, + const Expr *z); + static const Expr *fn(std::string f, std::list args); + static const Expr *id(std::string x); + static const Expr *impl(const Expr *l, const Expr *r); + static const Expr *lit(bool b); + static const Expr *lit(std::string v); + static const Expr *lit(unsigned v) { return lit((unsigned long long)v); } + static const Expr *lit(unsigned long long v); + static const Expr *lit(long long v); + static const Expr *lit(std::string v, unsigned w); + static const Expr *lit(unsigned long long v, unsigned w); + static const Expr *lit(bool n, std::string s, std::string e, unsigned ss, + unsigned es); + static const Expr *lit(std::string v, unsigned ss, unsigned es); + static const Expr *lit(RModeKind v); + static const Expr *neq(const Expr *l, const Expr *r); + static const Expr *not_(const Expr *e); + static const Expr *sel(const Expr *b, const Expr *i); + static const Expr *sel(std::string b, std::string i); + static const Expr *upd(const Expr *b, const Expr *i, const Expr *v); + static const Expr *if_then_else(const Expr *c, const Expr *t, const Expr *e); + static const Expr *bvExtract(const Expr *v, const Expr *upper, + const Expr *lower); + static const Expr *bvExtract(std::string v, unsigned upper, unsigned lower); + static const Expr *bvExtract(const Expr *v, unsigned upper, unsigned lower); + static const Expr *bvConcat(const Expr *left, const Expr *right); }; class BinExpr : public Expr { public: - enum Binary { Iff, Imp, Or, And, Eq, Neq, Lt, Gt, Lte, Gte, Sub, Conc, - Plus, Minus, Times, Div, Mod - }; + enum Binary { + Iff, + Imp, + Or, + And, + Eq, + Neq, + Lt, + Gt, + Lte, + Gte, + Sub, + Conc, + Plus, + Minus, + Times, + Div, + Mod + }; + private: const Binary op; - const Expr* lhs; - const Expr* rhs; + const Expr *lhs; + const Expr *rhs; + public: - BinExpr(const Binary b, const Expr* l, const Expr* r) : op(b), lhs(l), rhs(r) {} - void print(std::ostream& os) const; + BinExpr(const Binary b, const Expr *l, const Expr *r) + : op(b), lhs(l), rhs(r) {} + void print(std::ostream &os) const; }; class CondExpr : public Expr { - const Expr* cond; - const Expr* then; - const Expr* else_; + const Expr *cond; + const Expr *then; + const Expr *else_; + public: - CondExpr(const Expr* c, const Expr* t, const Expr* e) - : cond(c), then(t), else_(e) {} - void print(std::ostream& os) const; + CondExpr(const Expr *c, const Expr *t, const Expr *e) + : cond(c), then(t), else_(e) {} + void print(std::ostream &os) const; }; class FunExpr : public Expr { std::string fun; - std::list args; + std::list args; + public: - FunExpr(std::string f, std::list xs) : fun(f), args(xs) {} - void print(std::ostream& os) const; + FunExpr(std::string f, std::list xs) : fun(f), args(xs) {} + void print(std::ostream &os) const; }; class BoolLit : public Expr { bool val; + public: BoolLit(bool b) : val(b) {} - void print(std::ostream& os) const; + void print(std::ostream &os) const; }; class RModeLit : public Expr { RModeKind val; + public: RModeLit(RModeKind v) : val(v) {} - void print(std::ostream& os) const; + void print(std::ostream &os) const; }; class IntLit : public Expr { std::string val; + public: IntLit(std::string v) : val(v) {} - IntLit(unsigned long v) { + IntLit(unsigned long long v) { std::stringstream s; s << v; val = s.str(); } - IntLit(long v) { + IntLit(long long v) { std::stringstream s; s << v; val = s.str(); } - void print(std::ostream& os) const; + void print(std::ostream &os) const; }; class BvLit : public Expr { std::string val; unsigned width; + public: BvLit(std::string v, unsigned w) : val(v), width(w) {} - BvLit(unsigned long v, unsigned w) : width(w) { + BvLit(unsigned long long v, unsigned w) : width(w) { std::stringstream s; s << v; val = s.str(); } - void print(std::ostream& os) const; + void print(std::ostream &os) const; }; class FPLit : public Expr { bool neg; std::string sig; std::string expo; + std::string specialValue; unsigned sigSize; unsigned expSize; + public: - FPLit(bool n, std::string s, std::string e, unsigned ss, unsigned es) : neg(n), sig(s), expo(e), sigSize(ss), expSize(es) {} - void print(std::ostream& os) const; + FPLit(bool n, std::string s, std::string e, unsigned ss, unsigned es) + : neg(n), sig(s), expo(e), sigSize(ss), expSize(es) {} + FPLit(std::string v, unsigned ss, unsigned es) + : specialValue(v), sigSize(ss), expSize(es) {} + void print(std::ostream &os) const; }; class StringLit : public Expr { std::string val; + public: StringLit(std::string v) : val(v) {} - void print(std::ostream& os) const; + void print(std::ostream &os) const; }; class NegExpr : public Expr { - const Expr* expr; + const Expr *expr; + public: - NegExpr(const Expr* e) : expr(e) {} - void print(std::ostream& os) const; + NegExpr(const Expr *e) : expr(e) {} + void print(std::ostream &os) const; }; class NotExpr : public Expr { - const Expr* expr; + const Expr *expr; + public: - NotExpr(const Expr* e) : expr(e) {} - void print(std::ostream& os) const; + NotExpr(const Expr *e) : expr(e) {} + void print(std::ostream &os) const; }; class QuantExpr : public Expr { public: enum Quantifier { Exists, Forall }; + private: Quantifier quant; std::list vars; - const Expr* expr; + const Expr *expr; + public: - QuantExpr(Quantifier q, std::list vs, const Expr* e) : quant(q), vars(vs), expr(e) {} - void print(std::ostream& os) const; + QuantExpr(Quantifier q, std::list vs, const Expr *e) + : quant(q), vars(vs), expr(e) {} + void print(std::ostream &os) const; }; class SelExpr : public Expr { - const Expr* base; - std::list idxs; + const Expr *base; + std::list idxs; + public: - SelExpr(const Expr* a, std::list i) : base(a), idxs(i) {} - SelExpr(const Expr* a, const Expr* i) : base(a), idxs(std::list(1, i)) {} - void print(std::ostream& os) const; + SelExpr(const Expr *a, std::list i) : base(a), idxs(i) {} + SelExpr(const Expr *a, const Expr *i) + : base(a), idxs(std::list(1, i)) {} + void print(std::ostream &os) const; }; class UpdExpr : public Expr { - const Expr* base; - std::list idxs; - const Expr* val; + const Expr *base; + std::list idxs; + const Expr *val; + public: - UpdExpr(const Expr* a, std::list i, const Expr* v) - : base(a), idxs(i), val(v) {} - UpdExpr(const Expr* a, const Expr* i, const Expr* v) - : base(a), idxs(std::list(1, i)), val(v) {} - void print(std::ostream& os) const; + UpdExpr(const Expr *a, std::list i, const Expr *v) + : base(a), idxs(i), val(v) {} + UpdExpr(const Expr *a, const Expr *i, const Expr *v) + : base(a), idxs(std::list(1, i)), val(v) {} + void print(std::ostream &os) const; }; class VarExpr : public Expr { std::string var; + public: VarExpr(std::string v) : var(v) {} std::string name() const { return var; } - void print(std::ostream& os) const; + void print(std::ostream &os) const; }; class IfThenElseExpr : public Expr { - const Expr* cond; - const Expr* true_value; - const Expr* false_value; + const Expr *cond; + const Expr *true_value; + const Expr *false_value; + +public: + IfThenElseExpr(const Expr *c, const Expr *t, const Expr *e) + : cond(c), true_value(t), false_value(e) {} + void print(std::ostream &os) const; +}; + +class BvExtract : public Expr { + const Expr *var; + const Expr *upper; + const Expr *lower; + public: - IfThenElseExpr(const Expr* c, const Expr* t, const Expr* e) - : cond(c), true_value(t), false_value(e) {} - void print(std::ostream& os) const; + BvExtract(const Expr *var, const Expr *upper, const Expr *lower) + : var(var), upper(upper), lower(lower) {} + void print(std::ostream &os) const; +}; + +class BvConcat : public Expr { + const Expr *left; + const Expr *right; + +public: + BvConcat(const Expr *left, const Expr *right) : left(left), right(right) {} + void print(std::ostream &os) const; }; class Attr { protected: std::string name; - std::list vals; + std::list vals; + public: - Attr(std::string n, std::initializer_list vs) : name(n), vals(vs) {} - Attr(std::string n, std::list vs) : name(n), vals(vs) {} - void print(std::ostream& os) const; + Attr(std::string n, std::initializer_list vs) + : name(n), vals(vs) {} + Attr(std::string n, std::list vs) : name(n), vals(vs) {} + void print(std::ostream &os) const; std::string getName() const { return name; } - static const Attr* attr(std::string s); - static const Attr* attr(std::string s, std::string v); - static const Attr* attr(std::string s, int v); - static const Attr* attr(std::string s, std::string v, int i); - static const Attr* attr(std::string s, std::string v, int i, int j); - static const Attr* attr(std::string s, std::initializer_list vs); - static const Attr* attr(std::string s, std::list vs); + static const Attr *attr(std::string s); + static const Attr *attr(std::string s, std::string v); + static const Attr *attr(std::string s, int v); + static const Attr *attr(std::string s, std::string v, int i); + static const Attr *attr(std::string s, std::string v, int i, int j); + static const Attr *attr(std::string s, + std::initializer_list vs); + static const Attr *attr(std::string s, std::list vs); }; class Stmt { public: enum Kind { - ASSERT, ASSUME, ASSIGN, HAVOC, GOTO, CALL, RETURN, CODE, COMMENT + ASSERT, + ASSUME, + ASSIGN, + HAVOC, + GOTO, + CALL, + RETURN, + CODE, + COMMENT }; + private: const Kind kind; + protected: Stmt(Kind k) : kind(k) {} + public: Kind getKind() const { return kind; } - public: +public: virtual ~Stmt() {} - static const Stmt* annot(std::list attrs); - static const Stmt* annot(const Attr* a); - static const Stmt* assert_(const Expr* e, - std::list attrs = std::list()); - static const Stmt* assign(const Expr* e, const Expr* f); - static const Stmt* assign(std::list lhs, std::list rhs); - static const Stmt* assume(const Expr* e); - static const Stmt* assume(const Expr* e, const Attr* attr); - static const Stmt* call( - std::string p, - std::list args = std::list(), - std::list rets = std::list(), - std::list attrs = std::list()); - static const Stmt* comment(std::string c); - static const Stmt* goto_(std::list ts); - static const Stmt* havoc(std::string x); - static const Stmt* return_(); - static const Stmt* return_(const Expr* e); - static const Stmt* skip(); - static const Stmt* code(std::string s); - virtual void print(std::ostream& os) const = 0; + static const Stmt *annot(std::list attrs); + static const Stmt *annot(const Attr *a); + static const Stmt * + assert_(const Expr *e, + std::list attrs = std::list()); + static const Stmt *assign(const Expr *e, const Expr *f); + static const Stmt *assign(std::list lhs, + std::list rhs); + static const Stmt *assume(const Expr *e); + static const Stmt *assume(const Expr *e, const Attr *attr); + static const Stmt * + call(std::string p, std::list args = std::list(), + std::list rets = std::list(), + std::list attrs = std::list()); + static const Stmt *comment(std::string c); + static const Stmt *goto_(std::list ts); + static const Stmt *havoc(std::string x); + static const Stmt *havoc(const Expr *x); + static const Stmt *return_(); + static const Stmt *return_(const Expr *e); + static const Stmt *skip(); + static const Stmt *code(std::string s); + virtual void print(std::ostream &os) const = 0; }; class AssertStmt : public Stmt { - const Expr* expr; - std::list attrs; + const Expr *expr; + std::list attrs; + public: - AssertStmt(const Expr* e, std::list ax) - : Stmt(ASSERT), expr(e), attrs(ax) {} - void print(std::ostream& os) const; - static bool classof(const Stmt* S) { return S->getKind() == ASSERT; } + AssertStmt(const Expr *e, std::list ax) + : Stmt(ASSERT), expr(e), attrs(ax) {} + void print(std::ostream &os) const; + static bool classof(const Stmt *S) { return S->getKind() == ASSERT; } }; class AssignStmt : public Stmt { - std::list lhs; - std::list rhs; + std::list lhs; + std::list rhs; + public: - AssignStmt(std::list lhs, std::list rhs) - : Stmt(ASSIGN), lhs(lhs), rhs(rhs) {} - void print(std::ostream& os) const; - static bool classof(const Stmt* S) { return S->getKind() == ASSIGN; } + AssignStmt(std::list lhs, std::list rhs) + : Stmt(ASSIGN), lhs(lhs), rhs(rhs) {} + void print(std::ostream &os) const; + static bool classof(const Stmt *S) { return S->getKind() == ASSIGN; } }; class AssumeStmt : public Stmt { - const Expr* expr; - std::list attrs; + const Expr *expr; + std::list attrs; + public: - AssumeStmt(const Expr* e) : Stmt(ASSUME), expr(e) {} - void add(const Attr* a) { - attrs.push_back(a); - } + AssumeStmt(const Expr *e) : Stmt(ASSUME), expr(e) {} + void add(const Attr *a) { attrs.push_back(a); } bool hasAttr(std::string name) const { for (auto a = attrs.begin(); a != attrs.end(); ++a) { if ((*a)->getName() == name) @@ -297,64 +384,68 @@ class AssumeStmt : public Stmt { } return false; } - void print(std::ostream& os) const; - static bool classof(const Stmt* S) { return S->getKind() == ASSUME; } + void print(std::ostream &os) const; + static bool classof(const Stmt *S) { return S->getKind() == ASSUME; } }; class CallStmt : public Stmt { std::string proc; - std::list attrs; - std::list params; + std::list attrs; + std::list params; std::list returns; + public: - CallStmt(std::string p, - std::list attrs, - std::list args, - std::list rets) - : Stmt(CALL), proc(p), attrs(attrs), params(args), returns(rets) {} + CallStmt(std::string p, std::list attrs, + std::list args, std::list rets) + : Stmt(CALL), proc(p), attrs(attrs), params(args), returns(rets) {} - void print(std::ostream& os) const; - static bool classof(const Stmt* S) { return S->getKind() == CALL; } + void print(std::ostream &os) const; + static bool classof(const Stmt *S) { return S->getKind() == CALL; } }; class Comment : public Stmt { std::string str; + public: Comment(std::string s) : Stmt(COMMENT), str(s) {} - void print(std::ostream& os) const; - static bool classof(const Stmt* S) { return S->getKind() == COMMENT; } + void print(std::ostream &os) const; + static bool classof(const Stmt *S) { return S->getKind() == COMMENT; } }; class GotoStmt : public Stmt { std::list targets; + public: GotoStmt(std::list ts) : Stmt(GOTO), targets(ts) {} - void print(std::ostream& os) const; - static bool classof(const Stmt* S) { return S->getKind() == GOTO; } + void print(std::ostream &os) const; + static bool classof(const Stmt *S) { return S->getKind() == GOTO; } }; class HavocStmt : public Stmt { std::list vars; + public: HavocStmt(std::list vs) : Stmt(HAVOC), vars(vs) {} - void print(std::ostream& os) const; - static bool classof(const Stmt* S) { return S->getKind() == HAVOC; } + void print(std::ostream &os) const; + static bool classof(const Stmt *S) { return S->getKind() == HAVOC; } }; class ReturnStmt : public Stmt { - const Expr* expr; + const Expr *expr; + public: - ReturnStmt(const Expr* e = nullptr) : Stmt(RETURN), expr(e) {} - void print(std::ostream& os) const; - static bool classof(const Stmt* S) { return S->getKind() == RETURN; } + ReturnStmt(const Expr *e = nullptr) : Stmt(RETURN), expr(e) {} + void print(std::ostream &os) const; + static bool classof(const Stmt *S) { return S->getKind() == RETURN; } }; class CodeStmt : public Stmt { std::string code; + public: CodeStmt(std::string s) : Stmt(CODE), code(s) {} - void print(std::ostream& os) const; - static bool classof(const Stmt* S) { return S->getKind() == CODE; } + void print(std::ostream &os) const; + static bool classof(const Stmt *S) { return S->getKind() == CODE; } }; class Block; @@ -363,172 +454,176 @@ class FuncDecl; class Decl { public: - enum Kind { - CONSTANT, VARIABLE, PROCEDURE, FUNCTION, TYPE, AXIOM, CODE - }; + enum Kind { CONSTANT, VARIABLE, PROCEDURE, FUNCTION, TYPE, AXIOM, CODE }; + private: const Kind kind; + public: Kind getKind() const { return kind; } + private: static unsigned uniqueId; + protected: unsigned id; std::string name; - std::list attrs; - Decl(Kind k, std::string n, std::list ax) - : kind(k), id(uniqueId++), name(n), attrs(ax) { } + std::list attrs; + Decl(Kind k, std::string n, std::list ax) + : kind(k), id(uniqueId++), name(n), attrs(ax) {} + public: virtual ~Decl() {} - virtual void print(std::ostream& os) const = 0; + virtual void print(std::ostream &os) const = 0; unsigned getId() const { return id; } std::string getName() const { return name; } - void addAttr(const Attr* a) { attrs.push_back(a); } - - static Decl* typee(std::string name, std::string type, - std::list attrs = std::list()); - static Decl* axiom(const Expr* e, std::string name = ""); - static FuncDecl* function( - std::string name, - std::list args, - std::string type, - const Expr* e = NULL, - std::list attrs = std::list()); - static Decl* constant(std::string name, std::string type); - static Decl* constant(std::string name, std::string type, bool unique); - static Decl* constant(std::string name, std::string type, std::list ax, bool unique); - static Decl* variable(std::string name, std::string type); - static ProcDecl* procedure(std::string name, - std::list params = std::list(), - std::list rets = std::list(), - std::list decls = std::list(), - std::list blocks = std::list()); - static Decl* code(std::string name, std::string s); - static FuncDecl* code(ProcDecl* P); + void addAttr(const Attr *a) { attrs.push_back(a); } + + static Decl *typee(std::string name, std::string type, + std::list attrs = std::list()); + static Decl *axiom(const Expr *e, std::string name = ""); + static FuncDecl * + function(std::string name, std::list args, std::string type, + const Expr *e = NULL, + std::list attrs = std::list()); + static Decl *constant(std::string name, std::string type); + static Decl *constant(std::string name, std::string type, bool unique); + static Decl *constant(std::string name, std::string type, + std::list ax, bool unique); + static Decl *variable(std::string name, std::string type); + static ProcDecl *procedure(std::string name, + std::list params = std::list(), + std::list rets = std::list(), + std::list decls = std::list(), + std::list blocks = std::list()); + static Decl *code(std::string name, std::string s); + static FuncDecl *code(ProcDecl *P); }; class TypeDecl : public Decl { std::string alias; + public: - TypeDecl(std::string n, std::string t, std::list ax) - : Decl(TYPE, n, ax), alias(t) {} - void print(std::ostream& os) const; - static bool classof(const Decl* D) { return D->getKind() == TYPE; } + TypeDecl(std::string n, std::string t, std::list ax) + : Decl(TYPE, n, ax), alias(t) {} + void print(std::ostream &os) const; + static bool classof(const Decl *D) { return D->getKind() == TYPE; } }; class AxiomDecl : public Decl { - const Expr* expr; + const Expr *expr; static int uniqueId; + public: - AxiomDecl(std::string n, const Expr* e) : Decl(AXIOM, n, {}), expr(e) {} - void print(std::ostream& os) const; - static bool classof(const Decl* D) { return D->getKind() == AXIOM; } + AxiomDecl(std::string n, const Expr *e) : Decl(AXIOM, n, {}), expr(e) {} + void print(std::ostream &os) const; + static bool classof(const Decl *D) { return D->getKind() == AXIOM; } }; class ConstDecl : public Decl { std::string type; bool unique; + public: - ConstDecl(std::string n, std::string t, std::list ax, bool u) - : Decl(CONSTANT, n, ax), type(t), unique(u) {} - void print(std::ostream& os) const; - static bool classof(const Decl* D) { return D->getKind() == CONSTANT; } + ConstDecl(std::string n, std::string t, std::list ax, bool u) + : Decl(CONSTANT, n, ax), type(t), unique(u) {} + void print(std::ostream &os) const; + static bool classof(const Decl *D) { return D->getKind() == CONSTANT; } }; class FuncDecl : public Decl { std::list params; std::string type; - const Expr* body; + const Expr *body; + public: - FuncDecl(std::string n, std::list ax, std::list ps, - std::string t, const Expr* b) - : Decl(FUNCTION, n, ax), params(ps), type(t), body(b) {} - void print(std::ostream& os) const; - static bool classof(const Decl* D) { return D->getKind() == FUNCTION; } + FuncDecl(std::string n, std::list ax, std::list ps, + std::string t, const Expr *b) + : Decl(FUNCTION, n, ax), params(ps), type(t), body(b) {} + void print(std::ostream &os) const; + static bool classof(const Decl *D) { return D->getKind() == FUNCTION; } }; class VarDecl : public Decl { std::string type; + public: VarDecl(std::string n, std::string t) : Decl(VARIABLE, n, {}), type(t) {} - void print(std::ostream& os) const; - static bool classof(const Decl* D) { return D->getKind() == VARIABLE; } + void print(std::ostream &os) const; + static bool classof(const Decl *D) { return D->getKind() == VARIABLE; } }; class Block { std::string name; - typedef std::list StatementList; + typedef std::list StatementList; StatementList stmts; + public: - static Block* block(std::string n = "", std::list stmts = std::list()) { - return new Block(n,stmts); + static Block * + block(std::string n = "", + std::list stmts = std::list()) { + return new Block(n, stmts); } - Block(std::string n, std::list stmts) : name(n), stmts(stmts) {} - void print(std::ostream& os) const; + Block(std::string n, std::list stmts) : name(n), stmts(stmts) {} + void print(std::ostream &os) const; typedef StatementList::iterator iterator; iterator begin() { return stmts.begin(); } iterator end() { return stmts.end(); } StatementList &getStatements() { return stmts; } - void insert(const Stmt* s) { - stmts.insert(stmts.begin(), s); - } - void addStmt(const Stmt* s) { - stmts.push_back(s); - } - std::string getName() { - return name; - } + void insert(const Stmt *s) { stmts.insert(stmts.begin(), s); } + void addStmt(const Stmt *s) { stmts.push_back(s); } + std::string getName() { return name; } }; class CodeContainer { protected: - typedef std::list DeclarationList; - typedef std::list BlockList; + typedef std::list DeclarationList; + typedef std::list BlockList; typedef std::list ModifiesList; DeclarationList decls; BlockList blocks; ModifiesList mods; CodeContainer(DeclarationList ds, BlockList bs) : decls(ds), blocks(bs) {} + public: typedef DeclarationList::iterator decl_iterator; decl_iterator decl_begin() { return decls.begin(); } decl_iterator decl_end() { return decls.end(); } - DeclarationList& getDeclarations() { return decls; } + DeclarationList &getDeclarations() { return decls; } typedef BlockList::iterator iterator; iterator begin() { return blocks.begin(); } iterator end() { return blocks.end(); } - BlockList& getBlocks() { return blocks; } + BlockList &getBlocks() { return blocks; } typedef ModifiesList::iterator mod_iterator; mod_iterator mod_begin() { return mods.begin(); } mod_iterator mod_end() { return mods.end(); } - ModifiesList& getModifies() { return mods; } + ModifiesList &getModifies() { return mods; } - void insert(const Stmt* s) { - blocks.front()->insert(s); - } + void insert(const Stmt *s) { blocks.front()->insert(s); } }; class CodeExpr : public Expr, public CodeContainer { public: CodeExpr(DeclarationList ds, BlockList bs) : CodeContainer(ds, bs) {} - void print(std::ostream& os) const; + void print(std::ostream &os) const; }; class ProcDecl : public Decl, public CodeContainer { typedef Binding Parameter; typedef std::list ParameterList; - typedef std::list SpecificationList; + typedef std::list SpecificationList; ParameterList params; ParameterList rets; SpecificationList requires; SpecificationList ensures; + public: ProcDecl(std::string n, ParameterList ps, ParameterList rs, - DeclarationList ds, BlockList bs) - : Decl(PROCEDURE, n, {}), CodeContainer(ds, bs), params(ps), rets(rs) {} + DeclarationList ds, BlockList bs) + : Decl(PROCEDURE, n, {}), CodeContainer(ds, bs), params(ps), rets(rs) {} typedef ParameterList::iterator param_iterator; param_iterator param_begin() { return params.begin(); } param_iterator param_end() { return params.end(); } @@ -547,16 +642,17 @@ class ProcDecl : public Decl, public CodeContainer { spec_iterator ensures_end() { return ensures.end(); } SpecificationList &getEnsures() { return ensures; } - void print(std::ostream& os) const; - static bool classof(const Decl* D) { return D->getKind() == PROCEDURE; } + void print(std::ostream &os) const; + static bool classof(const Decl *D) { return D->getKind() == PROCEDURE; } }; class CodeDecl : public Decl { std::string code; + public: CodeDecl(std::string name, std::string s) : Decl(CODE, name, {}), code(s) {} - void print(std::ostream& os) const; - static bool classof(const Decl* D) { return D->getKind() == CODE; } + void print(std::ostream &os) const; + static bool classof(const Decl *D) { return D->getKind() == CODE; } }; class Program { @@ -564,26 +660,26 @@ class Program { // declarations, putting the Prelude in a CodeDeclaration does not work, // and I do not yet understand why; see below. --mje std::string prelude; - typedef std::list DeclarationList; + typedef std::list DeclarationList; DeclarationList decls; + public: Program() {} - void print(std::ostream& os) const; + void print(std::ostream &os) const; typedef DeclarationList::iterator iterator; iterator begin() { return decls.begin(); } iterator end() { return decls.end(); } unsigned size() { return decls.size(); } bool empty() { return decls.empty(); } - DeclarationList& getDeclarations() { return decls; } + DeclarationList &getDeclarations() { return decls; } void appendPrelude(std::string s) { prelude += s; } }; -std::ostream& operator<<(std::ostream& os, const Expr& e); -std::ostream& operator<<(std::ostream& os, const Expr* e); - -std::ostream& operator<<(std::ostream& os, Decl& e); -std::ostream& operator<<(std::ostream& os, Decl* e); +std::ostream &operator<<(std::ostream &os, const Expr &e); +std::ostream &operator<<(std::ostream &os, const Expr *e); +std::ostream &operator<<(std::ostream &os, Decl &e); +std::ostream &operator<<(std::ostream &os, Decl *e); } #endif // BOOGIEAST_H diff --git a/include/smack/BplFilePrinter.h b/include/smack/BplFilePrinter.h index 6cc22212d..abb9e46a1 100644 --- a/include/smack/BplFilePrinter.h +++ b/include/smack/BplFilePrinter.h @@ -17,13 +17,11 @@ class BplFilePrinter : public llvm::ModulePass { BplFilePrinter(llvm::raw_ostream &out) : llvm::ModulePass(ID), out(out) {} - virtual bool runOnModule(llvm::Module& m); + virtual bool runOnModule(llvm::Module &m); - virtual const char *getPassName() const { - return "Boogie file printing"; - } + virtual llvm::StringRef getPassName() const { return "Boogie file printing"; } - virtual void getAnalysisUsage(llvm::AnalysisUsage& AU) const; + virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const; }; } diff --git a/include/smack/BplPrinter.h b/include/smack/BplPrinter.h index 554e01af7..0f41ce40e 100644 --- a/include/smack/BplPrinter.h +++ b/include/smack/BplPrinter.h @@ -14,8 +14,8 @@ class BplPrinter : public llvm::ModulePass { static char ID; // Pass identification, replacement for typeid BplPrinter() : llvm::ModulePass(ID) {} - virtual bool runOnModule(llvm::Module& m); - virtual void getAnalysisUsage(llvm::AnalysisUsage& AU) const; + virtual bool runOnModule(llvm::Module &m); + virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const; }; } diff --git a/include/smack/CodifyStaticInits.h b/include/smack/CodifyStaticInits.h index 871c20b37..36fb1307b 100644 --- a/include/smack/CodifyStaticInits.h +++ b/include/smack/CodifyStaticInits.h @@ -11,12 +11,13 @@ namespace smack { class CodifyStaticInits : public llvm::ModulePass { private: - const llvm::DataLayout * TD; + const llvm::DataLayout *TD; + public: static char ID; CodifyStaticInits() : llvm::ModulePass(ID) {} - virtual bool runOnModule(llvm::Module& M); - virtual void getAnalysisUsage(llvm::AnalysisUsage& AU) const; + virtual bool runOnModule(llvm::Module &M); + virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const; }; } diff --git a/include/smack/Contracts.h b/include/smack/Contracts.h index bb4760dd7..7a8365163 100644 --- a/include/smack/Contracts.h +++ b/include/smack/Contracts.h @@ -2,8 +2,8 @@ // This file is distributed under the MIT License. See LICENSE for details. // -#include "llvm/IR/InstVisitor.h" #include "llvm/IR/CFG.h" +#include "llvm/IR/InstVisitor.h" namespace smack { using namespace llvm; @@ -14,24 +14,23 @@ class Slices; class ContractsExtractor : public InstVisitor { private: - SmackRep* rep; - ProcDecl* proc; - Naming* naming; - Slices* slices; + SmackRep *rep; + ProcDecl *proc; + Naming *naming; + Slices *slices; static unsigned uniqueSliceId; public: - ContractsExtractor(SmackRep* R, ProcDecl* P, Naming* N, Slices* S) - : rep(R), proc(P), naming(N), slices(S) {} + ContractsExtractor(SmackRep *R, ProcDecl *P, Naming *N, Slices *S) + : rep(R), proc(P), naming(N), slices(S) {} - void visitCallInst(CallInst& ci); + void visitCallInst(CallInst &ci); private: - Slice* extractSlice(Value* v); + Slice *extractSlice(Value *v); - Value* sliceIdx(LLVMContext& ctx) { - return ConstantInt::get(Type::getInt32Ty(ctx),slices.size()); + Value *sliceIdx(LLVMContext &ctx) { + return ConstantInt::get(Type::getInt32Ty(ctx), slices.size()); } }; - } diff --git a/include/smack/DSAWrapper.h b/include/smack/DSAWrapper.h index c0ca61519..954e3328d 100644 --- a/include/smack/DSAWrapper.h +++ b/include/smack/DSAWrapper.h @@ -20,24 +20,20 @@ class DSNodeEquivs; } namespace dsa { -template -struct TypeSafety; +template struct TypeSafety; } namespace smack { - class MemcpyCollector : public llvm::InstVisitor { private: llvm::DSNodeEquivs *nodeEqs; - std::vector memcpys; + std::vector memcpys; public: - MemcpyCollector(llvm::DSNodeEquivs *neqs) : nodeEqs(neqs) { } - void visitMemCpyInst(llvm::MemCpyInst& mci); - std::vector getMemcpys() { - return memcpys; - } + MemcpyCollector(llvm::DSNodeEquivs *neqs) : nodeEqs(neqs) {} + void visitMemCpyInst(llvm::MemCpyInst &mci); + std::vector getMemcpys() { return memcpys; } }; class DSAWrapper : public llvm::ModulePass { @@ -47,15 +43,16 @@ class DSAWrapper : public llvm::ModulePass { llvm::BUDataStructures *BU; llvm::DSNodeEquivs *nodeEqs; dsa::TypeSafety *TS; - std::vector staticInits; - std::vector memcpys; - std::unordered_set intConversions; - const llvm::DataLayout* dataLayout; + std::vector staticInits; + std::vector memcpys; + std::unordered_set intConversions; + const llvm::DataLayout *dataLayout; - std::vector collectMemcpys(llvm::Module &M, MemcpyCollector* mcc); - std::vector collectStaticInits(llvm::Module &M); + std::vector collectMemcpys(llvm::Module &M, + MemcpyCollector *mcc); + std::vector collectStaticInits(llvm::Module &M); llvm::DSGraph *getGraphForValue(const llvm::Value *V); - int getOffset(const llvm::MemoryLocation* l); + int getOffset(const llvm::MemoryLocation *l); public: static char ID; @@ -64,18 +61,18 @@ class DSAWrapper : public llvm::ModulePass { virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const; virtual bool runOnModule(llvm::Module &M); - bool isMemcpyd(const llvm::DSNode* n); - bool isStaticInitd(const llvm::DSNode* n); - bool isFieldDisjoint(const llvm::Value* V, const llvm::Function* F); - bool isFieldDisjoint(const llvm::GlobalValue* V, unsigned offset); - bool isRead(const llvm::Value* V); - bool isAlloced(const llvm::Value* v); - bool isExternal(const llvm::Value* v); + bool isMemcpyd(const llvm::DSNode *n); + bool isStaticInitd(const llvm::DSNode *n); + bool isFieldDisjoint(const llvm::Value *V, const llvm::Function *F); + bool isFieldDisjoint(const llvm::GlobalValue *V, unsigned offset); + bool isRead(const llvm::Value *V); + bool isAlloced(const llvm::Value *v); + bool isExternal(const llvm::Value *v); bool isSingletonGlobal(const llvm::Value *V); - unsigned getPointedTypeSize(const llvm::Value* v); - int getOffset(const llvm::Value* v); - const llvm::DSNode *getNode(const llvm::Value* v); - void printDSAGraphs(const char* Filename); + unsigned getPointedTypeSize(const llvm::Value *v); + int getOffset(const llvm::Value *v); + const llvm::DSNode *getNode(const llvm::Value *v); + void printDSAGraphs(const char *Filename); }; } diff --git a/include/smack/Debug.h b/include/smack/Debug.h index ce7fe770b..533e3e441 100644 --- a/include/smack/Debug.h +++ b/include/smack/Debug.h @@ -15,24 +15,27 @@ bool isCurrentDebugType(const char *Type); void setCurrentDebugType(const char *Type); void setCurrentDebugTypes(const char **Types, unsigned Count); -#define SMACK_DEBUG_WITH_TYPE(TYPE, X) \ - do { if (::smack::DebugFlag && ::smack::isCurrentDebugType(TYPE)) { X; } \ +#define SMACK_DEBUG_WITH_TYPE(TYPE, X) \ + do { \ + if (::smack::DebugFlag && ::smack::isCurrentDebugType(TYPE)) { \ + X; \ + } \ } while (false) #else #define isCurrentDebugType(X) (false) #define setCurrentDebugType(X) #define setCurrentDebugTypes(X, N) -#define SMACK_DEBUG_WITH_TYPE(TYPE, X) do { } while (false) +#define SMACK_DEBUG_WITH_TYPE(TYPE, X) \ + do { \ + } while (false) #endif extern bool DebugFlag; llvm::raw_ostream &dbgs(); -#undef DEBUG -#define DEBUG(X) SMACK_DEBUG_WITH_TYPE(DEBUG_TYPE, X) - +#define SDEBUG(X) SMACK_DEBUG_WITH_TYPE(DEBUG_TYPE, X) } #endif diff --git a/include/smack/ExtractContracts.h b/include/smack/ExtractContracts.h index dbf35cc9b..4fbcf6d95 100644 --- a/include/smack/ExtractContracts.h +++ b/include/smack/ExtractContracts.h @@ -13,7 +13,7 @@ class ExtractContracts : public ModulePass { public: static char ID; ExtractContracts() : ModulePass(ID) {} - virtual bool runOnModule(Module& M); + virtual bool runOnModule(Module &M); virtual void getAnalysisUsage(AnalysisUsage &AU) const; }; } diff --git a/include/smack/IntegerOverflowChecker.h b/include/smack/IntegerOverflowChecker.h index 6fe8dc3e8..ebace5fcc 100644 --- a/include/smack/IntegerOverflowChecker.h +++ b/include/smack/IntegerOverflowChecker.h @@ -4,29 +4,34 @@ #ifndef INTEGEROVERFLOWCHECKER_H #define INTEGEROVERFLOWCHECKER_H -#include "llvm/Pass.h" -#include "llvm/IR/Module.h" #include "llvm/IR/Instructions.h" +#include "llvm/IR/Module.h" +#include "llvm/Pass.h" #include namespace smack { - -class IntegerOverflowChecker: public llvm::ModulePass { + +class IntegerOverflowChecker : public llvm::ModulePass { public: static char ID; // Pass identification, replacement for typeid IntegerOverflowChecker() : llvm::ModulePass(ID) {} - const char* getPassName() const; - virtual bool runOnModule(llvm::Module& m); + virtual llvm::StringRef getPassName() const; + virtual bool runOnModule(llvm::Module &m); + private: - static const std::map INSTRUCTION_TABLE; + static const std::map + INSTRUCTION_TABLE; std::string getMax(unsigned bits, bool isSigned); std::string getMin(unsigned bits, bool isSigned); - llvm::Value* extendBitWidth(llvm::Value* v, int bits, bool isSigned, llvm::Instruction* i); - llvm::BinaryOperator* createFlag(llvm::Value* v, int bits, bool isSigned, llvm::Instruction* i); - llvm::Value* createResult(llvm::Value* v, int bits, llvm::Instruction* i); - void addCheck(llvm::Function* co, llvm::Value* flag, llvm::Instruction* i); - void addBlockingAssume(llvm::Function* va, llvm::Value* flag, llvm::Instruction* i); + llvm::Value *extendBitWidth(llvm::Value *v, int bits, bool isSigned, + llvm::Instruction *i); + llvm::BinaryOperator *createFlag(llvm::Value *v, int bits, bool isSigned, + llvm::Instruction *i); + llvm::Value *createResult(llvm::Value *v, int bits, llvm::Instruction *i); + void addCheck(llvm::Function *co, llvm::Value *flag, llvm::Instruction *i); + void addBlockingAssume(llvm::Function *va, llvm::Value *flag, + llvm::Instruction *i); }; } -#endif //INTEGEROVERFLOWCHECKER_H +#endif // INTEGEROVERFLOWCHECKER_H diff --git a/include/smack/MemorySafetyChecker.h b/include/smack/MemorySafetyChecker.h index a5007606d..e8d76be5b 100644 --- a/include/smack/MemorySafetyChecker.h +++ b/include/smack/MemorySafetyChecker.h @@ -4,36 +4,37 @@ #ifndef MEMORYSAFETYCHECKER_H #define MEMORYSAFETYCHECKER_H -#include "llvm/Pass.h" -#include "llvm/IR/Module.h" #include "llvm/IR/InstVisitor.h" +#include "llvm/IR/Module.h" +#include "llvm/Pass.h" #include namespace smack { -class MemorySafetyChecker: public llvm::FunctionPass, public llvm::InstVisitor { +class MemorySafetyChecker : public llvm::FunctionPass, + public llvm::InstVisitor { private: - std::map leakCheckFunction; - std::map safetyCheckFunction; + std::map leakCheckFunction; + std::map safetyCheckFunction; - llvm::Function* getLeakCheckFunction(llvm::Module& M); - llvm::Function* getSafetyCheckFunction(llvm::Module& M); + llvm::Function *getLeakCheckFunction(llvm::Module &M); + llvm::Function *getSafetyCheckFunction(llvm::Module &M); - void insertMemoryLeakCheck(llvm::Instruction* I); - void insertMemoryAccessCheck(llvm::Value* addr, llvm::Value* size, llvm::Instruction* I); + void insertMemoryLeakCheck(llvm::Instruction *I); + void insertMemoryAccessCheck(llvm::Value *addr, llvm::Value *size, + llvm::Instruction *I); public: static char ID; // Pass identification, replacement for typeid MemorySafetyChecker() : llvm::FunctionPass(ID) {} - virtual bool runOnFunction(llvm::Function& F); + virtual bool runOnFunction(llvm::Function &F); - void visitReturnInst(llvm::ReturnInst& I); - void visitLoadInst(llvm::LoadInst& I); - void visitStoreInst(llvm::StoreInst& I); - void visitMemSetInst(llvm::MemSetInst& I); - void visitMemTransferInst(llvm::MemTransferInst& I); + void visitReturnInst(llvm::ReturnInst &I); + void visitLoadInst(llvm::LoadInst &I); + void visitStoreInst(llvm::StoreInst &I); + void visitMemSetInst(llvm::MemSetInst &I); + void visitMemTransferInst(llvm::MemTransferInst &I); }; - } -#endif //MEMORYSAFETYCHECKER_H +#endif // MEMORYSAFETYCHECKER_H diff --git a/include/smack/Naming.h b/include/smack/Naming.h index 65f1ccf01..cd7437c01 100644 --- a/include/smack/Naming.h +++ b/include/smack/Naming.h @@ -5,8 +5,8 @@ #ifndef NAMING_H #define NAMING_H -#include "llvm/Support/Regex.h" #include "llvm/IR/Value.h" +#include "llvm/Support/Regex.h" #include namespace smack { @@ -18,7 +18,7 @@ class Naming { static Regex BPL_KW; static Regex SMACK_NAME; - std::map names; + std::map names; unsigned blockNum; unsigned varNum; unsigned undefNum; @@ -96,27 +96,26 @@ class Naming { static const std::string RUST_PANIC2; static const std::string RUST_PANIC_ANNOTATION; - static const std::map INSTRUCTION_TABLE; - static const std::map CMPINST_TABLE; - static const std::map ATOMICRMWINST_TABLE; + static const std::map INSTRUCTION_TABLE; + static const std::map CMPINST_TABLE; + static const std::map ATOMICRMWINST_TABLE; - Naming() : blockNum(0), varNum(0), undefNum(0), globalNum(0) { } - Naming(Naming& n) : blockNum(n.blockNum), varNum(n.varNum) { } + Naming() : blockNum(0), varNum(0), undefNum(0), globalNum(0) {} + Naming(Naming &n) : blockNum(n.blockNum), varNum(n.varNum) {} void reset(); - std::string get(const Value& V); + std::string get(const Value &V); std::string freshGlobalName(); std::string freshBlockName(); std::string freshUndefName(); - std::string freshVarName(const Value& V); + std::string freshVarName(const Value &V); static bool isBplKeyword(std::string s); static bool isSmackName(std::string s); static bool isSmackGeneratedName(std::string s); static std::string escape(std::string s); }; - } #endif diff --git a/include/smack/NormalizeLoops.h b/include/smack/NormalizeLoops.h index 9ba13c7f5..c1594d37e 100644 --- a/include/smack/NormalizeLoops.h +++ b/include/smack/NormalizeLoops.h @@ -4,21 +4,21 @@ #ifndef NORMALIZELOOPS_H #define NORMALIZELOOPS_H -#include "llvm/Pass.h" -#include "llvm/IR/Module.h" #include "llvm/IR/Instructions.h" +#include "llvm/IR/Module.h" +#include "llvm/Pass.h" #include namespace smack { -class NormalizeLoops: public llvm::ModulePass { +class NormalizeLoops : public llvm::ModulePass { public: static char ID; // Pass identification, replacement for typeid NormalizeLoops() : llvm::ModulePass(ID) {} - const char* getPassName() const override; - virtual bool runOnModule(llvm::Module& m) override; - virtual void getAnalysisUsage(llvm::AnalysisUsage&) const override; + virtual llvm::StringRef getPassName() const override; + virtual bool runOnModule(llvm::Module &m) override; + virtual void getAnalysisUsage(llvm::AnalysisUsage &) const override; }; } -#endif //NORMALIZELOOPS_H +#endif // NORMALIZELOOPS_H diff --git a/include/smack/Prelude.h b/include/smack/Prelude.h new file mode 100644 index 000000000..de4fb313d --- /dev/null +++ b/include/smack/Prelude.h @@ -0,0 +1,220 @@ +// +// This file is distributed under the MIT License. See LICENSE for details. +// + +#ifndef PRELUDE_H +#define PRELUDE_H + +#include "smack/BoogieAst.h" +#include "smack/SmackRep.h" + +#include + +namespace smack { +typedef std::list FuncsT; + +// function declaration type +struct Op { + enum OpType { Builtin, Inlined, Uninterpreted }; + +private: + const OpType type; + +public: + OpType getOpType() const { return type; } + Op(OpType type) : type(type) {} +}; + +// represent a set of integer operations such as $add., +// where `T` is an integer type parameterized by integer bit-width +// the virtual method `getFuncs` therefore generates a set of +// function declarations for <$opName>.. +struct IntOp { + typedef const Attr *(*attrT)(std::string); + typedef const Expr *(*exprT)(unsigned); + + std::string opName; + unsigned arity; + Op *intOp; + Op *bvOp; + bool alsoUsedByPtr; + + IntOp(std::string opName, unsigned arity, Op *intOp, Op *bvOp, + bool alsoUsedByPtr) + : opName(opName), arity(arity), intOp(intOp), bvOp(bvOp), + alsoUsedByPtr(alsoUsedByPtr) {} + // virtual FuncsT getIntFuncs(unsigned) const = 0; + // virtual FuncsT getBvFuncs(unsigned) const = 0; + virtual FuncsT getFuncs(unsigned) const = 0; + static const Attr *bvAttrFunc(std::string opName); + static const Attr *intAttrFunc(std::string opName); + virtual ~IntOp(){}; +}; + +// represent a set of integer operations such as $fadd. +struct FpOp { + typedef const Attr *(*attrT)(std::string); + + std::string opName; + unsigned arity; + Op *op; + + FpOp(std::string opName, unsigned arity, Op *op) + : opName(opName), arity(arity), op(op) {} + virtual Decl *getModeledFpFunc(unsigned) const = 0; + virtual Decl *getUninterpretedFpFunc() const = 0; + static const Attr *fpAttrFunc(std::string opName); + virtual ~FpOp(){}; +}; + +// builtin functions templated by a function type. A function +// of such type, when applied, returns an attribute +template struct BuiltinOp : public Op { + typedef const Attr *(*attrT)(); + attrT func; + BuiltinOp(ATTRT func) : Op(Builtin), func((attrT)func) {} + static bool classof(const Op *op) { return op->getOpType() == Builtin; } +}; + +// inlined functions templated by a function type. A function +// of such type, when applied, returns an expression as the function body +template struct InlinedOp : public Op { + typedef const Expr *(*exprT)(); + exprT func; + InlinedOp(EXPRT func) : Op(Inlined), func((exprT)func) {} + static bool classof(const Op *op) { return op->getOpType() == Inlined; } +}; + +// uninterpreted functions +struct UninterpretedOp : public Op { + UninterpretedOp() : Op(Uninterpreted) {} + static bool classof(const Op *op) { return op->getOpType() == Uninterpreted; } +}; + +class Prelude; +// generic generator class that produces relevant declarations +struct Gen { + Prelude &prelude; + + Gen(Prelude &prelude) : prelude(prelude) {} + virtual void generate(std::stringstream &s) const = 0; + virtual ~Gen(){}; +}; + +// generator class for integer, pointer, and floating-point types +struct TypeGen : public Gen { + TypeGen(Prelude &prelude) : Gen(prelude) {} + virtual void generateArithOps(std::stringstream &s) const = 0; + virtual void generatePreds(std::stringstream &s) const = 0; + virtual void generateMemOps(std::stringstream &s) const = 0; + virtual void generateConvOps(std::stringstream &s) const = 0; + virtual void generateExtractValueFuncs(std::stringstream &s) const = 0; + virtual ~TypeGen(){}; +}; + +// generator class for integers +struct IntOpGen : public TypeGen { + struct IntArithOp; + struct IntPred; + struct IntConv; + + IntOpGen(Prelude &prelude) : TypeGen(prelude) {} + + static const std::vector INTEGER_SIZES; + + void generateArithOps(std::stringstream &s) const; + void generatePreds(std::stringstream &s) const; + void generateMemOps(std::stringstream &s) const; + void generateConvOps(std::stringstream &s) const; + void generateExtractValueFuncs(std::stringstream &s) const; + void generateBvIntConvs(std::stringstream &s) const; + void generate(std::stringstream &s) const; +}; + +// generator class for pointers +struct PtrOpGen : public TypeGen { + PtrOpGen(Prelude &prelude) : TypeGen(prelude) {} + + void generateArithOps(std::stringstream &s) const; + void generatePreds(std::stringstream &s) const; + void generateMemOps(std::stringstream &s) const; + void generateConvOps(std::stringstream &s) const; + void generateExtractValueFuncs(std::stringstream &s) const; + void generatePtrNumConvs(std::stringstream &s) const; + void generate(std::stringstream &s) const; +}; + +// generator class for floats +struct FpOpGen : public TypeGen { + struct FpArithOp; + struct FpPred; + struct FpIntConv; + + FpOpGen(Prelude &prelude) : TypeGen(prelude) {} + + static const std::map> FP_LAYOUT; + static const std::vector FP_BIT_WIDTHS; + + void generateArithOps(std::stringstream &s) const; + void generatePreds(std::stringstream &s) const; + void generateMemOps(std::stringstream &s) const; + void generateConvOps(std::stringstream &s) const; + void generateExtractValueFuncs(std::stringstream &s) const; + void generateFpIntConv(std::stringstream &s) const; + void generate(std::stringstream &s) const; +}; + +struct TypeDeclGen : public Gen { + TypeDeclGen(Prelude &prelude) : Gen(prelude) {} + void generate(std::stringstream &s) const; +}; + +struct ConstDeclGen : public Gen { + ConstDeclGen(Prelude &prelude) : Gen(prelude) {} + void generatePtrConstant(unsigned val, std::stringstream &s) const; + void generateIntConstant(unsigned val, std::stringstream &s) const; + void generate(std::stringstream &s) const; +}; + +struct MemDeclGen : public Gen { + MemDeclGen(Prelude &prelude) : Gen(prelude) {} + void generateMemoryMaps(std::stringstream &s) const; + void generateAddrBoundsAndPred(std::stringstream &s) const; + void generateGlobalAllocations(std::stringstream &s) const; + void generate(std::stringstream &s) const; +}; + +class Prelude { + TypeDeclGen *typeDeclGen; + ConstDeclGen *constDeclGen; + MemDeclGen *memDeclGen; + IntOpGen *intOpGen; + PtrOpGen *ptrOpGen; + FpOpGen *fpOpGen; + +public: + SmackRep &rep; + + Prelude(SmackRep &rep) : rep(rep) { + typeDeclGen = new TypeDeclGen(*this); + constDeclGen = new ConstDeclGen(*this); + memDeclGen = new MemDeclGen(*this); + intOpGen = new IntOpGen(*this); + ptrOpGen = new PtrOpGen(*this); + fpOpGen = new FpOpGen(*this); + } + + std::string getPrelude(); + const Expr *mapSelExpr(unsigned idx); + const Expr *mapUpdExpr(unsigned idx, const Expr *val, + const Expr *map = nullptr); + FuncDecl *safeLoad(std::string elemType); + FuncDecl *unsafeLoad(std::string elemType, const Expr *body, + bool bytes = true); + FuncDecl *safeStore(Binding elemBinding); + FuncDecl *unsafeStore(Binding elemBinding, const Expr *body, + bool bytes = true); +}; +} + +#endif // PRELUDE_H diff --git a/include/smack/Regions.h b/include/smack/Regions.h index b0ee5a985..0f89aef4d 100644 --- a/include/smack/Regions.h +++ b/include/smack/Regions.h @@ -9,7 +9,7 @@ using namespace llvm; namespace llvm { - class DSNode; +class DSNode; } namespace smack { @@ -18,9 +18,9 @@ class DSAWrapper; class Region { private: - LLVMContext* context; - const DSNode* representative; - const Type* type; + LLVMContext *context; + const DSNode *representative; + const Type *type; unsigned offset; unsigned length; @@ -31,51 +31,50 @@ class Region { bool complicated; bool collapsed; - static const DataLayout* DL; - static DSAWrapper* DSA; + static const DataLayout *DL; + static DSAWrapper *DSA; // static DSNodeEquivs* NEQS; - static bool isSingleton(const DSNode* N, unsigned offset, unsigned length); - static bool isAllocated(const DSNode* N); - static bool bytewiseAccess(const DSNode* N); - static bool isComplicated(const DSNode* N); + static bool isSingleton(const DSNode *N, unsigned offset, unsigned length); + static bool isAllocated(const DSNode *N); + static bool bytewiseAccess(const DSNode *N); + static bool isComplicated(const DSNode *N); - void init(const Value* V, unsigned length); + void init(const Value *V, unsigned length); bool isDisjoint(unsigned offset, unsigned length); public: - Region(const Value* V); - Region(const Value* V, unsigned length); + Region(const Value *V); + Region(const Value *V, unsigned length); - static void init(Module& M, Pass& P); + static void init(Module &M, Pass &P); - void merge(Region& R); - bool overlaps(Region& R); + void merge(Region &R); + bool overlaps(Region &R); bool isSingleton() const { return singleton; }; bool isAllocated() const { return allocated; }; bool bytewiseAccess() const { return bytewise; } - const Type* getType() const { return type; } - - void print(raw_ostream&); + const Type *getType() const { return type; } + void print(raw_ostream &); }; class Regions : public ModulePass, public InstVisitor { private: std::vector regions; - unsigned idx(Region& R); + unsigned idx(Region &R); public: static char ID; - Regions() : ModulePass(ID) { } - virtual void getAnalysisUsage(llvm::AnalysisUsage& AU) const; - virtual bool runOnModule(llvm::Module& M); + Regions() : ModulePass(ID) {} + virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const; + virtual bool runOnModule(llvm::Module &M); unsigned size() const; - unsigned idx(const llvm::Value* v); - unsigned idx(const llvm::Value* v, unsigned length); - Region& get(unsigned R); + unsigned idx(const llvm::Value *v); + unsigned idx(const llvm::Value *v, unsigned length); + Region &get(unsigned R); // void visitModule(Module& M) { // for (const GlobalValue& G : M.globals()) @@ -83,18 +82,16 @@ class Regions : public ModulePass, public InstVisitor { // } // void visitAllocaInst(AllocaInst& I) { - // getRegion(&I); + // getRegion(&I); // } - void visitLoadInst(LoadInst&); - void visitStoreInst(StoreInst&); - void visitAtomicCmpXchgInst(AtomicCmpXchgInst&); - void visitAtomicRMWInst(AtomicRMWInst&); - void visitMemIntrinsic(MemIntrinsic&); - void visitCallInst(CallInst&); - + void visitLoadInst(LoadInst &); + void visitStoreInst(StoreInst &); + void visitAtomicCmpXchgInst(AtomicCmpXchgInst &); + void visitAtomicRMWInst(AtomicRMWInst &); + void visitMemIntrinsic(MemIntrinsic &); + void visitCallInst(CallInst &); }; - } #endif // REGIONS_H diff --git a/include/smack/RemoveDeadDefs.h b/include/smack/RemoveDeadDefs.h index b6ad56456..eb18c5fdb 100644 --- a/include/smack/RemoveDeadDefs.h +++ b/include/smack/RemoveDeadDefs.h @@ -11,11 +11,11 @@ namespace smack { class RemoveDeadDefs : public llvm::ModulePass { private: - const llvm::DataLayout * TD; + const llvm::DataLayout *TD; + public: static char ID; RemoveDeadDefs() : llvm::ModulePass(ID) {} - virtual bool runOnModule(llvm::Module& M); + virtual bool runOnModule(llvm::Module &M); }; } - diff --git a/include/smack/SimplifyLibCalls.h b/include/smack/SimplifyLibCalls.h index bce869c2c..05f72d394 100644 --- a/include/smack/SimplifyLibCalls.h +++ b/include/smack/SimplifyLibCalls.h @@ -2,8 +2,8 @@ // This file is distributed under the MIT License. See LICENSE for details. // -#include "llvm/IR/Instructions.h" #include "llvm/IR/InstVisitor.h" +#include "llvm/IR/Instructions.h" #include "llvm/IR/Module.h" #include "llvm/Pass.h" #include "llvm/Transforms/Utils/SimplifyLibCalls.h" @@ -12,15 +12,17 @@ namespace smack { using namespace llvm; -class SimplifyLibCalls : public ModulePass, public InstVisitor { +class SimplifyLibCalls : public ModulePass, + public InstVisitor { private: bool modified; - LibCallSimplifier* simplifier; + LibCallSimplifier *simplifier; + public: static char ID; SimplifyLibCalls() : ModulePass(ID) {} - virtual void getAnalysisUsage(AnalysisUsage& AU) const; - virtual bool runOnModule(Module& M); - void visitCallInst(CallInst&); + virtual void getAnalysisUsage(AnalysisUsage &AU) const; + virtual bool runOnModule(Module &M); + void visitCallInst(CallInst &); }; } diff --git a/include/smack/Slicing.h b/include/smack/Slicing.h index d82f09e7d..de9016e60 100644 --- a/include/smack/Slicing.h +++ b/include/smack/Slicing.h @@ -5,8 +5,8 @@ #ifndef SLICING_H #define SLICING_H -#include "llvm/IR/InstVisitor.h" #include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/IR/InstVisitor.h" #include using namespace llvm; @@ -17,30 +17,29 @@ class Naming; class SmackRep; class Slice; -typedef vector Slices; +typedef vector Slices; class Slice { - Value& value; - BasicBlock& block; - Function& function; - LLVMContext& context; - Slices& slices; + Value &value; + BasicBlock █ + Function &function; + LLVMContext &context; + Slices &slices; string name; - unordered_set inputs; - unordered_set values; + unordered_set inputs; + unordered_set values; public: - Slice(Instruction& I, Slices& S, string name = ""); + Slice(Instruction &I, Slices &S, string name = ""); void remove(); string getName(); - const Expr* getCode(Naming* naming, SmackRep* rep); - const Decl* getBoogieDecl(Naming* naming, SmackRep* rep); - const Expr* getBoogieExpression(Naming* naming, SmackRep* rep); + const Expr *getCode(Naming *naming, SmackRep *rep); + const Decl *getBoogieDecl(Naming *naming, SmackRep *rep); + const Expr *getBoogieExpression(Naming *naming, SmackRep *rep); }; - } #endif diff --git a/include/smack/SmackInstGenerator.h b/include/smack/SmackInstGenerator.h index 627d88572..604b9ed49 100644 --- a/include/smack/SmackInstGenerator.h +++ b/include/smack/SmackInstGenerator.h @@ -4,10 +4,10 @@ #ifndef SMACKINSTVISITOR_H #define SMACKINSTVISITOR_H -#include "llvm/IR/InstVisitor.h" #include "llvm/Analysis/LoopInfo.h" -#include +#include "llvm/IR/InstVisitor.h" #include +#include namespace smack { @@ -23,76 +23,80 @@ class SmackRep; class SmackInstGenerator : public llvm::InstVisitor { private: - llvm::LoopInfo& loops; - SmackRep* rep; - ProcDecl* proc; - Naming* naming; + llvm::LoopInfo &loops; + SmackRep *rep; + ProcDecl *proc; + Naming *naming; - Block* currBlock; + Block *currBlock; llvm::BasicBlock::const_iterator nextInst; - std::map blockMap; - std::map sourceNames; + std::map blockMap; + std::map sourceNames; - Block* createBlock(); - Block* getBlock(llvm::BasicBlock* bb); + Block *createBlock(); + Block *getBlock(llvm::BasicBlock *bb); - void generatePhiAssigns(llvm::TerminatorInst& i); - void generateGotoStmts(llvm::Instruction& i, - std::vector > target); - void processInstruction(llvm::Instruction& i); - void nameInstruction(llvm::Instruction& i); - void annotate(llvm::Instruction& i, Block* b); + void generatePhiAssigns(llvm::TerminatorInst &i); + void generateGotoStmts( + llvm::Instruction &i, + std::vector> target); + void processInstruction(llvm::Instruction &i); + void nameInstruction(llvm::Instruction &i); + void annotate(llvm::Instruction &i, Block *b); - const Stmt* recordProcedureCall(const llvm::Value* V, std::list attrs); + const Stmt *recordProcedureCall(const llvm::Value *V, + std::list attrs); -public: - void emit(const Stmt* s); + void generateUnModeledCall(llvm::CallInst *ci); public: - SmackInstGenerator(llvm::LoopInfo& LI, SmackRep* R, ProcDecl* P, Naming* N) - : loops(LI), rep(R), proc(P), naming(N) {} + void emit(const Stmt *s); +public: + SmackInstGenerator(llvm::LoopInfo &LI, SmackRep *R, ProcDecl *P, Naming *N) + : loops(LI), rep(R), proc(P), naming(N) {} - void visitBasicBlock(llvm::BasicBlock& bb); - void visitInstruction(llvm::Instruction& i); + void visitBasicBlock(llvm::BasicBlock &bb); + void visitInstruction(llvm::Instruction &i); - void visitReturnInst(llvm::ReturnInst& i); - void visitBranchInst(llvm::BranchInst& i); - void visitSwitchInst(llvm::SwitchInst& i); + void visitReturnInst(llvm::ReturnInst &i); + void visitBranchInst(llvm::BranchInst &i); + void visitSwitchInst(llvm::SwitchInst &i); // TODO implement indirectbr - void visitInvokeInst(llvm::InvokeInst& i); - void visitResumeInst(llvm::ResumeInst& i); - void visitUnreachableInst(llvm::UnreachableInst& i); + void visitInvokeInst(llvm::InvokeInst &i); + void visitResumeInst(llvm::ResumeInst &i); + void visitUnreachableInst(llvm::UnreachableInst &i); - void visitBinaryOperator(llvm::BinaryOperator& I); + void visitBinaryOperator(llvm::BinaryOperator &I); void visitExtractElementInst(llvm::ExtractElementInst &I); void visitInsertElementInst(llvm::InsertElementInst &I); void visitShuffleVectorInst(llvm::ShuffleVectorInst &I); - void visitExtractValueInst(llvm::ExtractValueInst& i); - void visitInsertValueInst(llvm::InsertValueInst& i); + void visitExtractValueInst(llvm::ExtractValueInst &i); + void visitInsertValueInst(llvm::InsertValueInst &i); - void visitAllocaInst(llvm::AllocaInst& i); - void visitLoadInst(llvm::LoadInst& i); - void visitStoreInst(llvm::StoreInst& i); + void visitAllocaInst(llvm::AllocaInst &i); + void visitLoadInst(llvm::LoadInst &i); + void visitStoreInst(llvm::StoreInst &i); // TODO implement fence - void visitAtomicCmpXchgInst(llvm::AtomicCmpXchgInst& i); - void visitAtomicRMWInst(llvm::AtomicRMWInst& i); - void visitGetElementPtrInst(llvm::GetElementPtrInst& i); + void visitAtomicCmpXchgInst(llvm::AtomicCmpXchgInst &i); + void visitAtomicRMWInst(llvm::AtomicRMWInst &i); + void visitGetElementPtrInst(llvm::GetElementPtrInst &i); - void visitCastInst(llvm::CastInst& I); - void visitCmpInst(llvm::CmpInst& I); + void visitCastInst(llvm::CastInst &I); + void visitCmpInst(llvm::CmpInst &I); - void visitPHINode(llvm::PHINode& i); - void visitSelectInst(llvm::SelectInst& i); - void visitCallInst(llvm::CallInst& i); - void visitDbgValueInst(llvm::DbgValueInst& i); + void visitPHINode(llvm::PHINode &i); + void visitSelectInst(llvm::SelectInst &i); + void visitCallInst(llvm::CallInst &i); + void visitDbgValueInst(llvm::DbgValueInst &i); // TODO implement va_arg - void visitLandingPadInst(llvm::LandingPadInst& i); + void visitLandingPadInst(llvm::LandingPadInst &i); - void visitMemCpyInst(llvm::MemCpyInst& i); - void visitMemSetInst(llvm::MemSetInst& i); + void visitMemCpyInst(llvm::MemCpyInst &i); + void visitMemSetInst(llvm::MemSetInst &i); + void visitIntrinsicInst(llvm::IntrinsicInst &i); }; } diff --git a/include/smack/SmackModuleGenerator.h b/include/smack/SmackModuleGenerator.h index a3156e112..3735fd88e 100644 --- a/include/smack/SmackModuleGenerator.h +++ b/include/smack/SmackModuleGenerator.h @@ -12,18 +12,16 @@ class Program; class SmackModuleGenerator : public llvm::ModulePass { private: - Program* program; + Program *program; public: static char ID; // Pass identification, replacement for typeid SmackModuleGenerator(); - virtual void getAnalysisUsage(llvm::AnalysisUsage& AU) const; - virtual bool runOnModule(llvm::Module& m); - void generateProgram(llvm::Module& m); - Program* getProgram() { - return program; - } + virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const; + virtual bool runOnModule(llvm::Module &m); + void generateProgram(llvm::Module &m); + Program *getProgram() { return program; } }; } diff --git a/include/smack/SmackOptions.h b/include/smack/SmackOptions.h index c19cc9b9a..3c27642d8 100644 --- a/include/smack/SmackOptions.h +++ b/include/smack/SmackOptions.h @@ -7,18 +7,21 @@ #include "llvm/Support/CommandLine.h" +#include "smack/SmackWarnings.h" + namespace smack { class SmackOptions { public: static const llvm::cl::list EntryPoints; - static const llvm::cl::opt Warnings; + static const llvm::cl::opt WarningLevel; + static const llvm::cl::opt ColoredWarnings; static const llvm::cl::opt MemoryModelDebug; static const llvm::cl::opt MemoryModelImpls; static const llvm::cl::opt SourceLocSymbols; - static const llvm::cl::opt BitPrecise; + static llvm::cl::opt BitPrecise; static const llvm::cl::opt BitPrecisePointers; static const llvm::cl::opt NoMemoryRegionSplitting; static const llvm::cl::opt NoByteAccessInference; diff --git a/include/smack/SmackRep.h b/include/smack/SmackRep.h index d1d31f264..ed3ca92a6 100644 --- a/include/smack/SmackRep.h +++ b/include/smack/SmackRep.h @@ -4,14 +4,14 @@ #ifndef SMACKREP_H #define SMACKREP_H -#include "llvm/IR/InstVisitor.h" #include "llvm/IR/DataLayout.h" -#include "llvm/IR/InstrTypes.h" #include "llvm/IR/GetElementPtrTypeIterator.h" +#include "llvm/IR/InstVisitor.h" +#include "llvm/IR/InstrTypes.h" #include "llvm/Support/GraphWriter.h" #include "llvm/Support/Regex.h" -#include #include +#include namespace smack { @@ -27,150 +27,176 @@ using llvm::Regex; using llvm::SmallVector; using llvm::StringRef; +std::string indexedName(std::string name, + std::initializer_list idxs); +std::string indexedName(std::string name, std::initializer_list idxs); + class SmackRep { friend class VectorOperations; + friend class Prelude; + friend struct PtrOpGen; + friend struct IntOpGen; + friend struct TypeDeclGen; + friend struct ConstDeclGen; + friend struct MemDeclGen; protected: - const llvm::DataLayout* targetData; - Naming* naming; - Program* program; - Regions* regions; + const llvm::DataLayout *targetData; + Naming *naming; + Program *program; + Regions *regions; std::vector bplGlobals; - std::map globalAllocations; + std::map globalAllocations; - long globalsBottom; - long externsBottom; + long long globalsOffset; + long long externsOffset; unsigned uniqueFpNum; unsigned ptrSizeInBits; std::vector initFuncs; - std::map auxDecls; + std::map auxDecls; public: - SmackRep(const llvm::DataLayout* L, Naming* N, Program* P, Regions* R); - Program* getProgram() { return program; } + SmackRep(const llvm::DataLayout *L, Naming *N, Program *P, Regions *R); + Program *getProgram() { return program; } private: + unsigned storageSize(llvm::Type *T); + unsigned offset(llvm::ArrayType *T, unsigned idx); + unsigned offset(llvm::StructType *T, unsigned idx); - unsigned storageSize(llvm::Type* T); - unsigned offset(llvm::ArrayType* T, unsigned idx); - unsigned offset(llvm::StructType* T, unsigned idx); - - const Expr* pa(const Expr* base, long long index, unsigned long size); - const Expr* pa(const Expr* base, const Expr* index, unsigned long size); - const Expr* pa(const Expr* base, unsigned long offset); - const Expr* pa(const Expr* base, const Expr* index, const Expr* size); - const Expr* pa(const Expr* base, const Expr* offset); + const Expr *pa(const Expr *base, long long index, unsigned size); + const Expr *pa(const Expr *base, const Expr *index, unsigned size); + const Expr *pa(const Expr *base, unsigned long long offset); + const Expr *pa(const Expr *base, const Expr *index, const Expr *size); + const Expr *pa(const Expr *base, const Expr *offset); - const Expr* bitConversion(const Expr* e, bool src, bool dst); - const Expr* pointerToInteger(const Expr* e, unsigned width); - const Expr* integerToPointer(const Expr* e, unsigned width); + const Expr *bitConversion(const Expr *e, bool src, bool dst); + const Expr *pointerToInteger(const Expr *e, unsigned width); + const Expr *integerToPointer(const Expr *e, unsigned width); - std::string opName(const std::string& operation, std::list types); - std::string opName(const std::string& operation, std::initializer_list types); + std::string opName(const std::string &operation, + std::initializer_list types); - const Stmt* store(unsigned R, const llvm::Type* T, const Expr* P, const Expr* V); + const Stmt *store(unsigned R, const llvm::Type *T, const Expr *P, + const Expr *V); - const Expr* cast(unsigned opcode, const llvm::Value* v, const llvm::Type* t); - const Expr* bop(unsigned opcode, const llvm::Value* lhs, const llvm::Value* rhs, const llvm::Type* t); - const Expr* cmp(unsigned predicate, const llvm::Value* lhs, const llvm::Value* rhs, bool isUnsigned); + const Expr *cast(unsigned opcode, const llvm::Value *v, const llvm::Type *t); + bool isFpArithOp(unsigned opcode); + const Expr *bop(unsigned opcode, const llvm::Value *lhs, + const llvm::Value *rhs, const llvm::Type *t); + const Expr *cmp(unsigned predicate, const llvm::Value *lhs, + const llvm::Value *rhs, bool isUnsigned); - std::string procName(const llvm::User& U); - std::string procName(llvm::Function* F, const llvm::User& U); - std::string procName(llvm::Function* F, std::list types); + std::string procName(const llvm::User &U); + std::string procName(llvm::Function *F, const llvm::User &U); + std::string procName(llvm::Function *F, std::list types); - unsigned getIntSize(const llvm::Value* v); - unsigned getIntSize(const llvm::Type* t); - unsigned getSize(llvm::Type* t); + unsigned getIntSize(const llvm::Value *v); + unsigned getIntSize(const llvm::Type *t); + unsigned getSize(llvm::Type *t); std::string pointerType(); std::string intType(unsigned width); std::string vectorType(int n, llvm::Type *T); - unsigned numElements(const llvm::Constant* v); + unsigned numElements(const llvm::Constant *v); - Decl* memcpyProc(std::string type, - unsigned length = std::numeric_limits::max()); - Decl* memsetProc(std::string type, - unsigned length = std::numeric_limits::max()); + Decl *memcpyProc(std::string type, + unsigned length = std::numeric_limits::max()); + Decl *memsetProc(std::string type, + unsigned length = std::numeric_limits::max()); - bool isUnsafeFloatAccess(const llvm::Type* elemTy, const llvm::Type* resultTy); + bool isUnsafeFloatAccess(const llvm::Type *elemTy, + const llvm::Type *resultTy); public: - const Expr* pointerLit(unsigned v) { return pointerLit((unsigned long) v); } - const Expr* pointerLit(unsigned long v); - const Expr* pointerLit(long v); - const Expr* integerLit(unsigned v, unsigned width) { return integerLit((unsigned long) v, width); } - const Expr* integerLit(unsigned long v, unsigned width); - const Expr* integerLit(long v, unsigned width); + const Expr *pointerLit(unsigned v) { + return pointerLit((unsigned long long)v); + } + const Expr *pointerLit(unsigned long long v); + const Expr *pointerLit(long long v); + const Expr *integerLit(unsigned v, unsigned width) { + return integerLit((unsigned long long)v, width); + } + const Expr *integerLit(unsigned long long v, unsigned width); + const Expr *integerLit(long long v, unsigned width); - std::string type(const llvm::Type* t); - std::string type(const llvm::Value* v); + std::string type(const llvm::Type *t); + std::string type(const llvm::Value *v); - const Expr* lit(const llvm::Value* v, bool isUnsigned=false); - const Expr* lit(const llvm::Value* v, unsigned flag); + const Expr *lit(const llvm::Value *v, bool isUnsigned = false); + const Expr *lit(const llvm::Value *v, unsigned flag); - const Expr* ptrArith(const llvm::GetElementPtrInst* I); - const Expr* ptrArith(const llvm::ConstantExpr* CE); - const Expr* ptrArith(const llvm::Value* p, std::vector< std::pair > args); + const Expr *ptrArith(const llvm::GetElementPtrInst *I); + const Expr *ptrArith(const llvm::ConstantExpr *CE); + const Expr * + ptrArith(const llvm::Value *p, + std::vector> args); - const Expr* expr(const llvm::Value* v, bool isConstIntUnsigned=false); + const Expr *expr(const llvm::Value *v, bool isConstIntUnsigned = false); - const Expr* cast(const llvm::Instruction* I); - const Expr* cast(const llvm::ConstantExpr* CE); + const Expr *cast(const llvm::Instruction *I); + const Expr *cast(const llvm::ConstantExpr *CE); - const Expr* bop(const llvm::BinaryOperator* BO); - const Expr* bop(const llvm::ConstantExpr* CE); + bool isBitwiseOp(llvm::Instruction *I); + bool isFpArithOp(llvm::Instruction *I); - const Expr* cmp(const llvm::CmpInst* I); - const Expr* cmp(const llvm::ConstantExpr* CE); + const Expr *bop(const llvm::BinaryOperator *BO); + const Expr *bop(const llvm::ConstantExpr *CE); - const Expr* arg(llvm::Function* f, unsigned pos, llvm::Value* v); - const Stmt* call(llvm::Function* f, const llvm::User& u); - std::string code(llvm::CallInst& ci); + const Expr *cmp(const llvm::CmpInst *I); + const Expr *cmp(const llvm::ConstantExpr *CE); - const Stmt* alloca(llvm::AllocaInst& i); - const Stmt* memcpy(const llvm::MemCpyInst& msi); - const Stmt* memset(const llvm::MemSetInst& msi); - const Expr* load(const llvm::Value* P); - const Stmt* store(const llvm::Value* P, const llvm::Value* V); - const Stmt* store(const llvm::Value* P, const Expr* V); + const Expr *arg(llvm::Function *f, unsigned pos, llvm::Value *v); + const Stmt *call(llvm::Function *f, const llvm::User &u); + std::string code(llvm::CallInst &ci); - const Stmt* valueAnnotation(const llvm::CallInst& CI); - const Stmt* returnValueAnnotation(const llvm::CallInst& CI); + const Stmt *alloca(llvm::AllocaInst &i); + const Stmt *memcpy(const llvm::MemCpyInst &msi); + const Stmt *memset(const llvm::MemSetInst &msi); + const Expr *load(const llvm::Value *P); + const Stmt *store(const llvm::Value *P, const llvm::Value *V); + const Stmt *store(const llvm::Value *P, const Expr *V); - std::list procedure(llvm::Function* F); - ProcDecl* procedure(llvm::Function* F, llvm::CallInst* C); + const Stmt *valueAnnotation(const llvm::CallInst &CI); + const Stmt *returnValueAnnotation(const llvm::CallInst &CI); + + std::list procedure(llvm::Function *F); + ProcDecl *procedure(llvm::Function *F, llvm::CallInst *C); // used in Slicing - unsigned getElementSize(const llvm::Value* v); + unsigned getElementSize(const llvm::Value *v); std::string memReg(unsigned i); std::string memType(unsigned region); std::string memPath(unsigned region); - std::string memPath(const llvm::Value* v); + std::string memPath(const llvm::Value *v); - std::list< std::pair< std::string, std::string > > memoryMaps(); + std::list> memoryMaps(); // used in SmackInstGenerator - std::string getString(const llvm::Value* v); - bool isExternal(const llvm::Value* v); + std::string getString(const llvm::Value *v); + bool isExternal(const llvm::Value *v); void addBplGlobal(std::string name); + const Stmt *inverseFPCastAssume(const llvm::Value *src, + const llvm::Type *destType); + const Stmt *inverseFPCastAssume(const llvm::StoreInst *si); // used in SmackModuleGenerator - std::list globalDecl(const llvm::GlobalValue* g); - void addInitFunc(const llvm::Function* f); - Decl* getInitFuncs(); - std::string getPrelude(); - const Expr* declareIsExternal(const Expr* e); + std::list globalDecl(const llvm::GlobalValue *g); + void addInitFunc(const llvm::Function *f); + Decl *getInitFuncs(); + const Expr *declareIsExternal(const Expr *e); - bool isContractExpr(const llvm::Value* V) const; + bool isContractExpr(const llvm::Value *V) const; bool isContractExpr(const std::string S) const; - void addAuxiliaryDeclaration(Decl* D); - std::list auxiliaryDeclarations(); + void addAuxiliaryDeclaration(Decl *D); + std::list auxiliaryDeclarations(); + std::string opName(const std::string &operation, + std::list types); }; - } #endif // SMACKREP_H diff --git a/include/smack/SmackWarnings.h b/include/smack/SmackWarnings.h new file mode 100644 index 000000000..f271759e1 --- /dev/null +++ b/include/smack/SmackWarnings.h @@ -0,0 +1,55 @@ +// +// This file is distributed under the MIT License. See LICENSE for details. +// + +#ifndef SMACKWARNINGS_H +#define SMACKWARNINGS_H + +#include "smack/BoogieAst.h" +#include "llvm/IR/Instruction.h" +#include "llvm/Support/CommandLine.h" + +#include +#include + +namespace smack { + +class SmackWarnings { + typedef const llvm::cl::opt FlagT; + typedef std::initializer_list RequiredFlagsT; + typedef std::list UnsetFlagsT; + +public: + enum class WarningLevel : unsigned { + Silent = 0, + Unsound = 10, // Unhandled intrinsics, asm, etc + Info = 20 // Memory length, etc. + }; + + static UnsetFlagsT getUnsetFlags(RequiredFlagsT flags); + + // generate warnings about unsoundness + static void warnUnsound(std::string unmodeledOpName, Block *currBlock, + const llvm::Instruction *i, bool ignore = false); + static void warnUnsound(std::string name, UnsetFlagsT unsetFlags, + Block *currBlock, const llvm::Instruction *i, + bool ignore = false); + static void warnIfUnsound(std::string name, RequiredFlagsT requiredFlags, + Block *currBlock, const llvm::Instruction *i, + bool ignore = false); + static void warnIfUnsound(std::string name, FlagT &requiredFlag, + Block *currBlock, const llvm::Instruction *i); + static void warnIfUnsound(std::string name, FlagT &requiredFlag1, + FlagT &requiredFlag2, Block *currBlock, + const llvm::Instruction *i); + + // generate warnings about memcpy/memset length/DSA + static void warnInfo(std::string info); + +private: + static bool isSufficientWarningLevel(WarningLevel level); + static std::string getFlagStr(UnsetFlagsT flags); +}; +} + +#endif // SMACKWARNINGS_H diff --git a/include/smack/SplitAggregateValue.h b/include/smack/SplitAggregateValue.h index ea39f51a0..ccaccb1fe 100644 --- a/include/smack/SplitAggregateValue.h +++ b/include/smack/SplitAggregateValue.h @@ -2,33 +2,38 @@ // This file is distributed under the MIT License. See LICENSE for details. // +#include "llvm/IR/Constants.h" #include "llvm/IR/DataLayout.h" +#include "llvm/IR/IRBuilder.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Module.h" #include "llvm/Pass.h" -#include "llvm/IR/IRBuilder.h" -#include "llvm/IR/Constants.h" -#include #include +#include namespace smack { class SplitAggregateValue : public llvm::BasicBlockPass { public: - typedef std::vector> IndexT; - typedef std::pair InfoT; + typedef std::vector> IndexT; + typedef std::pair InfoT; static char ID; SplitAggregateValue() : llvm::BasicBlockPass(ID) {} - virtual bool runOnBasicBlock(llvm::BasicBlock& BB); + virtual bool runOnBasicBlock(llvm::BasicBlock &BB); private: - llvm::Value* splitAggregateLoad(llvm::LoadInst* li, std::vector& info, llvm::IRBuilder<>& irb); - void splitAggregateStore(llvm::StoreInst* si, std::vector& info, llvm::IRBuilder<>& irb); - void splitConstantReturn(llvm::ReturnInst* ri, std::vector& info); - void splitConstantArg(llvm::CallInst* ci, unsigned i, std::vector& info); - void visitAggregateValue(llvm::Constant* baseVal, llvm::Type* T, IndexT idxs, std::vector& info, llvm::LLVMContext& C); - llvm::Value* createInsertedValue(llvm::IRBuilder<>& irb, llvm::Type* T, std::vector& info, llvm::Value* V); - bool isConstantAggregate(llvm::Value* V); + llvm::Value *splitAggregateLoad(llvm::LoadInst *li, std::vector &info, + llvm::IRBuilder<> &irb); + void splitAggregateStore(llvm::StoreInst *si, std::vector &info, + llvm::IRBuilder<> &irb); + void splitConstantReturn(llvm::ReturnInst *ri, std::vector &info); + void splitConstantArg(llvm::CallInst *ci, unsigned i, + std::vector &info); + void visitAggregateValue(llvm::Constant *baseVal, llvm::Type *T, IndexT idxs, + std::vector &info, llvm::LLVMContext &C); + llvm::Value *createInsertedValue(llvm::IRBuilder<> &irb, llvm::Type *T, + std::vector &info, llvm::Value *V); + bool isConstantAggregate(llvm::Value *V); }; } diff --git a/include/smack/VectorOperations.h b/include/smack/VectorOperations.h index 1cb3a04f7..740cc87c5 100644 --- a/include/smack/VectorOperations.h +++ b/include/smack/VectorOperations.h @@ -4,42 +4,43 @@ #ifndef VECTOROPERATIONS_H #define VECTOROPERATIONS_H +#include "smack/BoogieAst.h" +#include "smack/SmackRep.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/InstrTypes.h" #include "llvm/IR/Type.h" #include -class SmackRep; -class Decl; -class FuncDecl; - using namespace llvm; namespace smack { - class VectorOperations { - SmackRep *rep; - std::string constructor(Type *T); - std::string field(Type *T, unsigned idx); - std::string selector(Type *T, unsigned idx); - - FuncDecl *cast(unsigned OpCode, Type *SrcTy, Type *DstTy); - Decl *inverseAxiom(unsigned OpCode, Type *SrcTy, Type *DstTy); - FuncDecl *binary(unsigned OpCode, VectorType *T); - FuncDecl *cmp(CmpInst::Predicate P, VectorType *T); - - public: - VectorOperations(SmackRep *rep) : rep(rep) {} - std::list type(Type *T); - const Expr *constant(const ConstantDataVector *C); - const Expr *constant(const ConstantAggregateZero *C); - - FuncDecl *cast(CastInst *I); - FuncDecl *binary(BinaryOperator *I); - FuncDecl *cmp(CmpInst *I); - FuncDecl *shuffle(Type *T, Type *U, std::vector mask); - FuncDecl *insert(Type *T, Type *IT); - FuncDecl *extract(Type *T, Type *IT); - FuncDecl *load(const Value *V); - FuncDecl *store(const Value *V); - }; +class VectorOperations { + SmackRep *rep; + std::string constructor(Type *T); + std::string field(Type *T, unsigned idx); + std::string selector(Type *T, unsigned idx); + + FuncDecl *cast(unsigned OpCode, Type *SrcTy, Type *DstTy); + Decl *inverseAxiom(unsigned OpCode, Type *SrcTy, Type *DstTy); + FuncDecl *binary(unsigned OpCode, VectorType *T); + FuncDecl *cmp(CmpInst::Predicate P, VectorType *T); + +public: + VectorOperations(SmackRep *rep) : rep(rep) {} + std::list type(Type *T); + const Expr *constant(const ConstantDataVector *C); + const Expr *constant(const ConstantAggregateZero *C); + + FuncDecl *cast(CastInst *I); + FuncDecl *binary(BinaryOperator *I); + FuncDecl *cmp(CmpInst *I); + FuncDecl *shuffle(Type *T, Type *U, std::vector mask); + FuncDecl *insert(Type *T, Type *IT); + FuncDecl *extract(Type *T, Type *IT); + FuncDecl *load(const Value *V); + FuncDecl *store(const Value *V); +}; } #endif // VECTOROPERATIONS_H diff --git a/include/smack/VerifierCodeMetadata.h b/include/smack/VerifierCodeMetadata.h index 4e41c7008..59352fb5f 100644 --- a/include/smack/VerifierCodeMetadata.h +++ b/include/smack/VerifierCodeMetadata.h @@ -2,8 +2,8 @@ // This file is distributed under the MIT License. See LICENSE for details. // -#include "llvm/IR/Instructions.h" #include "llvm/IR/InstVisitor.h" +#include "llvm/IR/Instructions.h" #include "llvm/IR/Module.h" #include "llvm/Pass.h" #include @@ -12,17 +12,18 @@ namespace smack { using namespace llvm; -class VerifierCodeMetadata : public ModulePass, public InstVisitor { +class VerifierCodeMetadata : public ModulePass, + public InstVisitor { private: - std::queue workList; + std::queue workList; public: static char ID; VerifierCodeMetadata() : ModulePass(ID) {} - virtual bool runOnModule(Module& M); + virtual bool runOnModule(Module &M); virtual void getAnalysisUsage(AnalysisUsage &AU) const; - void visitCallInst(CallInst&); - void visitInstruction(Instruction&); - static bool isMarked(const Instruction& I); + void visitCallInst(CallInst &); + void visitInstruction(Instruction &); + static bool isMarked(const Instruction &I); }; } diff --git a/lib/AssistDS/ArgCast.cpp b/lib/AssistDS/ArgCast.cpp index 418914e8a..cc6813f43 100644 --- a/lib/AssistDS/ArgCast.cpp +++ b/lib/AssistDS/ArgCast.cpp @@ -153,8 +153,8 @@ bool ArgCast::runOnModule(Module& M) { } } } else { - DEBUG(ArgType->dump()); - DEBUG(FormalType->dump()); + SDEBUG(ArgType->dump()); + SDEBUG(FormalType->dump()); break; } } @@ -197,12 +197,12 @@ bool ArgCast::runOnModule(Module& M) { } // Debug printing - DEBUG(errs() << "ARGCAST:"); - DEBUG(errs() << "ERASE:"); - DEBUG(CI->dump()); - DEBUG(errs() << "ARGCAST:"); - DEBUG(errs() << "ADDED:"); - DEBUG(CINew->dump()); + SDEBUG(errs() << "ARGCAST:"); + SDEBUG(errs() << "ERASE:"); + SDEBUG(CI->dump()); + SDEBUG(errs() << "ARGCAST:"); + SDEBUG(errs() << "ADDED:"); + SDEBUG(CINew->dump()); CI->eraseFromParent(); numChanged++; diff --git a/lib/AssistDS/DSNodeEquivs.cpp b/lib/AssistDS/DSNodeEquivs.cpp index 68ac8e352..318ab46da 100644 --- a/lib/AssistDS/DSNodeEquivs.cpp +++ b/lib/AssistDS/DSNodeEquivs.cpp @@ -113,7 +113,7 @@ FunctionList DSNodeEquivs::getCallees(CallSite &CS) { } // For debugging, dump out the callsites we are unable to get callees for. - DEBUG( + SDEBUG( if (Callees.empty()) { errs() << "Failed to get callees for callsite:\n"; CS.getInstruction()->dump(); diff --git a/lib/AssistDS/DynCount.cpp b/lib/AssistDS/DynCount.cpp index da1b8ba5f..a033f7e2a 100644 --- a/lib/AssistDS/DynCount.cpp +++ b/lib/AssistDS/DynCount.cpp @@ -29,7 +29,7 @@ class Dyncount : public ModulePass { public: static char ID; Dyncount () : ModulePass (ID) { } - const char *getPassName() const { + virtual StringRef getPassName() const { return "Count safe/unsafe load/store"; } virtual bool runOnModule (Module & M); diff --git a/lib/AssistDS/FuncSpec.cpp b/lib/AssistDS/FuncSpec.cpp index 9b969e44b..3cbaa91ef 100644 --- a/lib/AssistDS/FuncSpec.cpp +++ b/lib/AssistDS/FuncSpec.cpp @@ -59,12 +59,12 @@ bool FuncSpec::runOnModule(Module& M) { if (isa(Ty->getElementType())) { // Store the index of such an argument FPArgs.push_back(Arg.getArgNo()); - DEBUG(errs() << "Eligible: " << F.getName().str() << "\n"); + SDEBUG(errs() << "Eligible: " << F.getName().str() << "\n"); } } else if (isa(Arg.getType())) { // Store the index of such an argument FPArgs.push_back(Arg.getArgNo()); - DEBUG(errs() << "Eligible: " << F.getName().str() << "\n"); + SDEBUG(errs() << "Eligible: " << F.getName().str() << "\n"); } } // Now find all call sites that it is called from diff --git a/lib/AssistDS/MergeGEP.cpp b/lib/AssistDS/MergeGEP.cpp index 173900959..9d9e7cdf9 100644 --- a/lib/AssistDS/MergeGEP.cpp +++ b/lib/AssistDS/MergeGEP.cpp @@ -94,7 +94,7 @@ static void simplifyGEP(GetElementPtrInst *GEP) { bool EndsWithSequential = false; for (gep_type_iterator I = gep_type_begin(*Src), E = gep_type_end(*Src); I != E; ++I) - EndsWithSequential = !(*I)->isStructTy(); + EndsWithSequential = !I.isStruct(); // Can we combine the two pointer arithmetics offsets? if (EndsWithSequential) { diff --git a/lib/AssistDS/SimplifyExtractValue.cpp b/lib/AssistDS/SimplifyExtractValue.cpp index 5edfece09..bdbabc897 100644 --- a/lib/AssistDS/SimplifyExtractValue.cpp +++ b/lib/AssistDS/SimplifyExtractValue.cpp @@ -63,9 +63,9 @@ bool SimplifyEV::runOnModule(Module& M) { Value *Agg = EV->getAggregateOperand(); if (!EV->hasIndices()) { EV->replaceAllUsesWith(Agg); - DEBUG(errs() << "EV:"); - DEBUG(errs() << "ERASE:"); - DEBUG(EV->dump()); + SDEBUG(errs() << "EV:"); + SDEBUG(errs() << "ERASE:"); + SDEBUG(EV->dump()); EV->eraseFromParent(); numErased++; changed = true; @@ -74,9 +74,9 @@ bool SimplifyEV::runOnModule(Module& M) { if (Constant *C = dyn_cast(Agg)) { if (isa(C)) { EV->replaceAllUsesWith(UndefValue::get(EV->getType())); - DEBUG(errs() << "EV:"); - DEBUG(errs() << "ERASE:"); - DEBUG(EV->dump()); + SDEBUG(errs() << "EV:"); + SDEBUG(errs() << "ERASE:"); + SDEBUG(EV->dump()); EV->eraseFromParent(); numErased++; changed = true; @@ -84,9 +84,9 @@ bool SimplifyEV::runOnModule(Module& M) { } if (isa(C)) { EV->replaceAllUsesWith(Constant::getNullValue(EV->getType())); - DEBUG(errs() << "EV:"); - DEBUG(errs() << "ERASE:"); - DEBUG(EV->dump()); + SDEBUG(errs() << "EV:"); + SDEBUG(errs() << "ERASE:"); + SDEBUG(EV->dump()); EV->eraseFromParent(); numErased++; changed = true; @@ -102,18 +102,18 @@ bool SimplifyEV::runOnModule(Module& M) { EV->getIndices().slice(1), "", EV); EV->replaceAllUsesWith(EV_new); - DEBUG(errs() << "EV:"); - DEBUG(errs() << "ERASE:"); - DEBUG(EV->dump()); + SDEBUG(errs() << "EV:"); + SDEBUG(errs() << "ERASE:"); + SDEBUG(EV->dump()); EV->eraseFromParent(); numErased++; changed = true; continue; } else { EV->replaceAllUsesWith(V); - DEBUG(errs() << "EV:"); - DEBUG(errs() << "ERASE:"); - DEBUG(EV->dump()); + SDEBUG(errs() << "EV:"); + SDEBUG(errs() << "ERASE:"); + SDEBUG(EV->dump()); EV->eraseFromParent(); numErased++; changed = true; @@ -163,9 +163,9 @@ bool SimplifyEV::runOnModule(Module& M) { ExtractValueInst *EV_new = ExtractValueInst::Create(IV->getAggregateOperand(), EV->getIndices(), "", EV); EV->replaceAllUsesWith(EV_new); - DEBUG(errs() << "EV:"); - DEBUG(errs() << "ERASE:"); - DEBUG(EV->dump()); + SDEBUG(errs() << "EV:"); + SDEBUG(errs() << "ERASE:"); + SDEBUG(EV->dump()); EV->eraseFromParent(); numErased++; done = true; @@ -181,9 +181,9 @@ bool SimplifyEV::runOnModule(Module& M) { // %C = extractvalue { i32, { i32 } } %B, 1, 0 // with "i32 42" EV->replaceAllUsesWith(IV->getInsertedValueOperand()); - DEBUG(errs() << "EV:"); - DEBUG(errs() << "ERASE:"); - DEBUG(EV->dump()); + SDEBUG(errs() << "EV:"); + SDEBUG(errs() << "ERASE:"); + SDEBUG(EV->dump()); EV->eraseFromParent(); numErased++; changed = true; @@ -203,9 +203,9 @@ bool SimplifyEV::runOnModule(Module& M) { Value *NewIV = InsertValueInst::Create(NewEV, IV->getInsertedValueOperand(), makeArrayRef(insi, inse), "", EV); EV->replaceAllUsesWith(NewIV); - DEBUG(errs() << "EV:"); - DEBUG(errs() << "ERASE:"); - DEBUG(EV->dump()); + SDEBUG(errs() << "EV:"); + SDEBUG(errs() << "ERASE:"); + SDEBUG(EV->dump()); EV->eraseFromParent(); numErased++; changed = true; @@ -223,9 +223,9 @@ bool SimplifyEV::runOnModule(Module& M) { ExtractValueInst *EV_new = ExtractValueInst::Create(IV->getInsertedValueOperand(), makeArrayRef(exti, exte), "", EV); EV->replaceAllUsesWith(EV_new); - DEBUG(errs() << "EV:"); - DEBUG(errs() << "ERASE:"); - DEBUG(EV->dump()); + SDEBUG(errs() << "EV:"); + SDEBUG(errs() << "ERASE:"); + SDEBUG(EV->dump()); EV->eraseFromParent(); numErased++; changed = true; diff --git a/lib/DSA/AllocatorIdentification.cpp b/lib/DSA/AllocatorIdentification.cpp index 9a12792fc..220b8fc51 100644 --- a/lib/DSA/AllocatorIdentification.cpp +++ b/lib/DSA/AllocatorIdentification.cpp @@ -144,7 +144,7 @@ bool AllocIdentify::runOnModule(Module& M) { if(changed) { ++numAllocators; allocators.emplace(WrapperF->getName()); - DEBUG(errs() << WrapperF->getName().str() << "\n"); + SDEBUG(errs() << WrapperF->getName().str() << "\n"); } } } @@ -179,7 +179,7 @@ bool AllocIdentify::runOnModule(Module& M) { if(changed) { ++numDeallocators; deallocators.emplace(WrapperF->getName()); - DEBUG(errs() << WrapperF->getName().str() << "\n"); + SDEBUG(errs() << WrapperF->getName().str() << "\n"); } } } diff --git a/lib/DSA/BottomUpClosure.cpp b/lib/DSA/BottomUpClosure.cpp index 3dd8b64f4..7f1281c25 100644 --- a/lib/DSA/BottomUpClosure.cpp +++ b/lib/DSA/BottomUpClosure.cpp @@ -128,7 +128,7 @@ bool BUDataStructures::runOnModuleInternal(Module& M) { callgraph.buildSCCs(); callgraph.buildRoots(); - DEBUG(print(errs(), &M)); + SDEBUG(print(errs(), &M)); return false; } @@ -310,7 +310,7 @@ BUDataStructures::postOrderInline (Module & M) { for (Function &F : M) if (!F.isDeclaration() && !ValMap.count(&F)) { if (MainFunc) - DEBUG(errs() << debugname << ": Function unreachable from main: " + SDEBUG(errs() << debugname << ": Function unreachable from main: " << F.getName() << "\n"); calculateGraphs(&F, Stack, NextID, ValMap); // Calculate all graphs. CloneAuxIntoGlobal(getDSGraph(F)); @@ -434,13 +434,13 @@ BUDataStructures::calculateGraphs (const Function *F, // If this is a new SCC, process it now. // if (Stack.back() == F) { // Special case the single "SCC" case here. - DEBUG(errs() << "Visiting single node SCC #: " << MyID << " fn: " + SDEBUG(errs() << "Visiting single node SCC #: " << MyID << " fn: " << F->getName() << "\n"); Stack.pop_back(); - DEBUG(errs() << " [BU] Calculating graph for: " << F->getName()<< "\n"); + SDEBUG(errs() << " [BU] Calculating graph for: " << F->getName()<< "\n"); DSGraph* G = getOrCreateGraph(F); calculateGraph(G); - DEBUG(errs() << " [BU] Done inlining: " << F->getName() << " [" + SDEBUG(errs() << " [BU] Done inlining: " << F->getName() << " [" << G->getGraphSize() << "+" << G->getAuxFunctionCalls().size() << "]\n"); @@ -453,7 +453,7 @@ BUDataStructures::calculateGraphs (const Function *F, getAllAuxCallees(G, NewCallees); if (!NewCallees.empty()) { if (hasNewCallees(NewCallees, CalleeFunctions)) { - DEBUG(errs() << "Recalculating " << F->getName() << " due to new knowledge\n"); + SDEBUG(errs() << "Recalculating " << F->getName() << " due to new knowledge\n"); ValMap.erase(F); ++NumRecalculations; return calculateGraphs(F, Stack, NextID, ValMap); @@ -495,7 +495,7 @@ BUDataStructures::calculateGraphs (const Function *F, } Stack.pop_back(); - DEBUG(errs() << "Calculating graph for SCC #: " << MyID << " of size: " + SDEBUG(errs() << "Calculating graph for SCC #: " << MyID << " of size: " << SCCSize << "\n"); // Compute the Max SCC Size. @@ -508,14 +508,14 @@ BUDataStructures::calculateGraphs (const Function *F, // Now that we have one big happy family, resolve all of the call sites in // the graph... calculateGraph(SCCGraph); - DEBUG(errs() << " [BU] Done inlining SCC [" << SCCGraph->getGraphSize() + SDEBUG(errs() << " [BU] Done inlining SCC [" << SCCGraph->getGraphSize() << "+" << SCCGraph->getAuxFunctionCalls().size() << "]\n" << "DONE with SCC #: " << MyID << "\n"); FuncSet NewCallees; getAllAuxCallees(SCCGraph, NewCallees); if (!NewCallees.empty()) { if (hasNewCallees(NewCallees, CalleeFunctions)) { - DEBUG(errs() << "Recalculating SCC Graph " << F->getName() << " due to new knowledge\n"); + SDEBUG(errs() << "Recalculating SCC Graph " << F->getName() << " due to new knowledge\n"); ValMap.erase(F); ++NumRecalculations; return calculateGraphs(F, Stack, NextID, ValMap); @@ -624,7 +624,7 @@ void BUDataStructures::CloneAuxIntoGlobal(DSGraph* G) { // dealt with // void BUDataStructures::calculateGraph(DSGraph* Graph) { - DEBUG(Graph->AssertGraphOK(); Graph->getGlobalsGraph()->AssertGraphOK()); + SDEBUG(Graph->AssertGraphOK(); Graph->getGlobalsGraph()->AssertGraphOK()); Graph->buildCallGraph(callgraph, GlobalFunctionList, filterCallees); // Move our call site list into TempFCs so that inline call sites go into the @@ -635,7 +635,7 @@ void BUDataStructures::calculateGraph(DSGraph* Graph) { for(DSGraph::FunctionListTy::iterator I = TempFCs.begin(), E = TempFCs.end(); I != E; ++I) { - DEBUG(Graph->AssertGraphOK(); Graph->getGlobalsGraph()->AssertGraphOK()); + SDEBUG(Graph->AssertGraphOK(); Graph->getGlobalsGraph()->AssertGraphOK()); DSCallSite &CS = *I; @@ -684,8 +684,8 @@ void BUDataStructures::calculateGraph(DSGraph* Graph) { // Get the data structure graph for the called function. GI = getDSGraph(*Callee); // Graph to inline - DEBUG(GI->AssertGraphOK(); GI->getGlobalsGraph()->AssertGraphOK()); - DEBUG(errs() << " Inlining graph for " << Callee->getName() + SDEBUG(GI->AssertGraphOK(); GI->getGlobalsGraph()->AssertGraphOK()); + SDEBUG(errs() << " Inlining graph for " << Callee->getName() << "[" << GI->getGraphSize() << "+" << GI->getAuxFunctionCalls().size() << "] into '" << Graph->getFunctionNames() << "' [" << Graph->getGraphSize() <<"+" @@ -703,7 +703,7 @@ void BUDataStructures::calculateGraph(DSGraph* Graph) { Graph->mergeInGraph(CS, *Callee, *GI, DSGraph::StripAllocaBit|DSGraph::DontCloneCallNodes); ++NumInlines; - DEBUG(Graph->AssertGraphOK();); + SDEBUG(Graph->AssertGraphOK();); } } TempFCs.clear(); diff --git a/lib/DSA/CallTargets.cpp b/lib/DSA/CallTargets.cpp index c7f37d9b4..55e8dd784 100644 --- a/lib/DSA/CallTargets.cpp +++ b/lib/DSA/CallTargets.cpp @@ -116,7 +116,7 @@ void CallTargetFinder::findIndTargets(Module &M) } if (!N->isIncompleteNode() && !N->isExternalNode() && !IndMap[cs].size()) { ++CompleteEmpty; - DEBUG(errs() << "Call site empty: '" + SDEBUG(errs() << "Call site empty: '" << cs.getInstruction()->getName() << "' In '" << cs.getInstruction()->getParent()->getParent()->getName() diff --git a/lib/DSA/DSGraph.cpp b/lib/DSA/DSGraph.cpp index 9ef2d7924..f1d34fd25 100644 --- a/lib/DSA/DSGraph.cpp +++ b/lib/DSA/DSGraph.cpp @@ -866,7 +866,7 @@ static void removeIdenticalCalls(DSGraph::FunctionListTy &Calls) { DSNode *Callee = CS.getCalleeNode(); if (Callee->getNumReferrers() == 1 && Callee->isCompleteNode() && Callee->isEmptyGlobals()) { // No useful info? - DEBUG(errs() << "WARNING: Useless call site found.\n"); + SDEBUG(errs() << "WARNING: Useless call site found.\n"); I = Calls.erase(I); E = Calls.end(); ++NumDeleted; @@ -902,7 +902,7 @@ static void removeIdenticalCalls(DSGraph::FunctionListTy &Calls) { NumCallNodesMerged += NumDeleted; if (NumDeleted) - DEBUG(errs() << "Merged " << NumDeleted << " call nodes.\n"); + SDEBUG(errs() << "Merged " << NumDeleted << " call nodes.\n"); } // removeTriviallyDeadNodes - After the graph has been constructed, this method // removes all unreachable nodes that are created because they got merged with @@ -1047,7 +1047,7 @@ static bool CallSiteUsesAliveArgs(const DSCallSite &CS, // This function also clones information about globals back into the globals // graph before it deletes the nodes. void DSGraph::removeDeadNodes(unsigned Flags) { - DEBUG(AssertGraphOK(); if (GlobalsGraph) GlobalsGraph->AssertGraphOK()); + SDEBUG(AssertGraphOK(); if (GlobalsGraph) GlobalsGraph->AssertGraphOK()); // Reduce the amount of work we have to do... remove dummy nodes left over by // merging... @@ -1193,7 +1193,7 @@ void DSGraph::removeDeadNodes(unsigned Flags) { for (unsigned i = 0, e = DeadNodes.size(); i != e; ++i) delete DeadNodes[i]; - DEBUG(AssertGraphOK(); GlobalsGraph->AssertGraphOK()); + SDEBUG(AssertGraphOK(); GlobalsGraph->AssertGraphOK()); } void DSGraph::AssertNodeContainsGlobal(const DSNode *N, const GlobalValue *GV) const { @@ -1207,7 +1207,7 @@ void DSGraph::AssertCallSiteInGraph(const DSCallSite &CS) const { #if 0 if (CS.getNumPtrArgs() && CS.getCalleeNode() == CS.getPtrArg(0).getNode() && CS.getCalleeNode() && CS.getCalleeNode()->getGlobals().empty()) - DEBUG(errs() << "WARNING: WEIRD CALL SITE FOUND!\n"); + SDEBUG(errs() << "WARNING: WEIRD CALL SITE FOUND!\n"); #endif } AssertNodeInGraph(CS.getRetVal().getNode()); diff --git a/lib/DSA/DSMonitor.cpp b/lib/DSA/DSMonitor.cpp index e961cb27e..733d68db3 100644 --- a/lib/DSA/DSMonitor.cpp +++ b/lib/DSA/DSMonitor.cpp @@ -2,7 +2,8 @@ #include "dsa/DSMonitor.h" #include "dsa/DSGraph.h" #include "llvm/IR/DebugInfo.h" -#include "smack/SmackOptions.h" +#include "llvm/Support/raw_ostream.h" +#include "smack/SmackWarnings.h" #include @@ -156,40 +157,42 @@ void DSMonitor::watch(DSNodeHandle N, std::vector VS, std::string M) { } void DSMonitor::warn() { - if (!smack::SmackOptions::Warnings) - return; + std::string msg; + raw_string_ostream ss(msg); if (location != "") - errs() << location << ": "; + ss << location << ": "; - errs() << "warning: collapsing DSA node\n"; + ss << "warning: collapsing DSA node\n"; if (message != "") - errs() << message << "\n"; + ss << message << "\n"; if (VS.empty()) { - errs() << "(unknown value)" << "\n"; + ss << "(unknown value)" << "\n"; } else { if (Instruction *I = getInstruction(VS[0])) { if (BasicBlock *B = I->getParent()) { if (Function *F = B->getParent()) { if (F->hasName()) - errs() << "in function:\n " << F->getName() << "\n"; + ss << "in function:\n " << F->getName() << "\n"; } if (B->hasName()) - errs() << "in block:\n " << I->getParent()->getName() << "\n"; + ss << "in block:\n " << I->getParent()->getName() << "\n"; } - errs() << "at instruction:\n" << *I << "\n"; + ss << "at instruction:\n" << *I << "\n"; } for (auto V : VS) - errs() << "at value:\n" << *V << "\n"; + ss << "at value:\n" << *V << "\n"; if (caption != "") - errs() << "node:\n " << caption << "\n"; + ss << "node:\n " << caption << "\n"; } - errs() << "\n"; + ss << "\n"; + + smack::SmackWarnings::warnInfo(ss.str()); } void DSMonitor::witness(DSNodeHandle N, std::vector VS, std::string M) { diff --git a/lib/DSA/DSTest.cpp b/lib/DSA/DSTest.cpp index f991bddf5..a969fbd2e 100644 --- a/lib/DSA/DSTest.cpp +++ b/lib/DSA/DSTest.cpp @@ -199,7 +199,7 @@ class NodeValue { // Now we try to find the value... // FIXME: This only works for named values, things like "%1" don't work. // That might not be a deal breaker, but should be clear. - V = F->getValueSymbolTable().lookup(value); + V = F->getValueSymbolTable()->lookup(value); assert(V && "Unable to find value in specified function!"); diff --git a/lib/DSA/DataStructure.cpp b/lib/DSA/DataStructure.cpp index b94f65e30..fbed5ad76 100644 --- a/lib/DSA/DataStructure.cpp +++ b/lib/DSA/DataStructure.cpp @@ -52,7 +52,7 @@ bool DSNodeHandle::isForwarding() const { DSNode *DSNodeHandle::HandleForwarding() const { assert(N->isForwarding() && "Can only be invoked if forwarding!"); - DEBUG( + SDEBUG( { //assert not looping DSNode* NH = N; svset seen; @@ -674,7 +674,7 @@ void DSNode::mergeWith(const DSNodeHandle &NH, unsigned Offset) { if (N == this) { // We cannot merge two pieces of the same node together, collapse the node // completely. - DEBUG(errs() << "Attempting to merge two chunks of the same node together!\n"); + SDEBUG(errs() << "Attempting to merge two chunks of the same node together!\n"); foldNodeCompletely(); return; } @@ -1368,7 +1368,7 @@ void DataStructures::formGlobalECs() { svset ECGlobals; buildGlobalECs(ECGlobals); if (!ECGlobals.empty()) { - DEBUG(errs() << "Eliminating " << ECGlobals.size() << " EC Globals!\n"); + SDEBUG(errs() << "Eliminating " << ECGlobals.size() << " EC Globals!\n"); for (DSInfoTy::iterator I = DSInfo.begin(), E = DSInfo.end(); I != E; ++I) eliminateUsesOfECGlobals(*I->second, ECGlobals); @@ -1412,7 +1412,7 @@ void DataStructures::buildGlobalECs(svset &ECGlobals) { I->addGlobal(First); } - DEBUG(GlobalsGraph->AssertGraphOK()); + SDEBUG(GlobalsGraph->AssertGraphOK()); } /// EliminateUsesOfECGlobals - Once we have determined that some globals are in @@ -1463,7 +1463,7 @@ void DataStructures::eliminateUsesOfECGlobals(DSGraph &G, #endif } - DEBUG(if(MadeChange) G.AssertGraphOK()); + SDEBUG(if(MadeChange) G.AssertGraphOK()); } //For Entry Points diff --git a/lib/DSA/DataStructureStats.cpp b/lib/DSA/DataStructureStats.cpp index 6992f5997..997f24b5d 100644 --- a/lib/DSA/DataStructureStats.cpp +++ b/lib/DSA/DataStructureStats.cpp @@ -133,7 +133,7 @@ void DSGraphStats::countCallees(const Function& F) { totalNumCallees += Callees.size(); ++numIndirectCalls; } else { - DEBUG(errs() << "WARNING: No callee in Function '" + SDEBUG(errs() << "WARNING: No callee in Function '" << F.getName().str() << " at call: \n" << *I->getCallSite().getInstruction()); } @@ -143,7 +143,7 @@ void DSGraphStats::countCallees(const Function& F) { NumIndirectCalls += numIndirectCalls; if (numIndirectCalls) { - DEBUG(errs() << " In function " << F.getName() << ": " + SDEBUG(errs() << " In function " << F.getName() << ": " << (totalNumCallees / (double) numIndirectCalls) << " average callees per indirect call\n"); } @@ -213,7 +213,7 @@ bool DSGraphStats::isNodeForValueUntyped(Value *V, unsigned Offset, const Functi ++NumTypeCount3Accesses; else ++NumTypeCount4Accesses; - DEBUG(assert(TS->isTypeSafe(V,F))); + SDEBUG(assert(TS->isTypeSafe(V,F))); } return false; } diff --git a/lib/DSA/EquivClassGraphs.cpp b/lib/DSA/EquivClassGraphs.cpp index 3df33c6c1..dcc9dcdba 100644 --- a/lib/DSA/EquivClassGraphs.cpp +++ b/lib/DSA/EquivClassGraphs.cpp @@ -66,7 +66,7 @@ bool EquivBUDataStructures::runOnModule(Module &M) { i!=e;i++) { delete (*i); } - DEBUG(verifyMerging()); + SDEBUG(verifyMerging()); formGlobalECs(); diff --git a/lib/DSA/GraphChecker.cpp b/lib/DSA/GraphChecker.cpp index bdd935deb..0dafbadba 100644 --- a/lib/DSA/GraphChecker.cpp +++ b/lib/DSA/GraphChecker.cpp @@ -35,11 +35,11 @@ namespace { enum DSPass { local, bu, td }; cl::opt DSPass("dsgc-dspass", cl::Hidden, - cl::desc("Specify which DSA pass the -datastructure-gc pass should use"), + cl::desc("Specify which DSA pass the -datastructure-gc pass should use"), cl::values(clEnumVal(local, "Local pass"), clEnumVal(bu, "Bottom-up pass"), - clEnumVal(td, "Top-down pass"), - clEnumValEnd), cl::init(local)); + clEnumVal(td, "Top-down pass")), + cl::init(local)); cl::opt AbortIfAnyCollapsed("dsgc-abort-if-any-collapsed", cl::Hidden, diff --git a/lib/DSA/LICENSE.TXT b/lib/DSA/LICENSE similarity index 100% rename from lib/DSA/LICENSE.TXT rename to lib/DSA/LICENSE diff --git a/lib/DSA/Local.cpp b/lib/DSA/Local.cpp index ff6a21eb1..06f372e16 100644 --- a/lib/DSA/Local.cpp +++ b/lib/DSA/Local.cpp @@ -150,7 +150,7 @@ namespace { GraphBuilder(Function &f, DSGraph &g, LocalDataStructures& DSi) : G(g), FB(&f), DS(&DSi), TD(g.getDataLayout()), VAArray(0) { - DEBUG(errs() << "[local] Building graph for function: " + SDEBUG(errs() << "[local] Building graph for function: " << f.getName() << "\n"); // Create scalar nodes for all pointer arguments... @@ -368,7 +368,7 @@ void GraphBuilder::setDestTo(Value &V, const DSNodeHandle &NH) { // incoming values point to... which effectively causes them to be merged. // void GraphBuilder::visitPHINode(PHINode &PN) { - DEBUG(errs() << "[local] visiting phi node: " << PN.getName() << "\n"); + SDEBUG(errs() << "[local] visiting phi node: " << PN.getName() << "\n"); if (!isa(PN.getType())) return; // Only pointer PHIs @@ -389,7 +389,7 @@ void GraphBuilder::visitSelectInst(SelectInst &SI) { } void GraphBuilder::visitLoadInst(LoadInst &LI) { - DEBUG(errs() << "[local] visiting load: " << LI << "\n"); + SDEBUG(errs() << "[local] visiting load: " << LI << "\n"); // // Create a DSNode for the pointer dereferenced by the load. If the DSNode // is NULL, do nothing more (this can occur if the load is loading from a @@ -419,7 +419,7 @@ void GraphBuilder::visitLoadInst(LoadInst &LI) { } void GraphBuilder::visitStoreInst(StoreInst &SI) { - DEBUG(errs() << "[local] visiting store: " << SI << "\n"); + SDEBUG(errs() << "[local] visiting store: " << SI << "\n"); Type *StoredTy = SI.getOperand(0)->getType(); DSNodeHandle Dest = getValueDest(SI.getOperand(1)); if (Dest.isNull()) return; @@ -444,7 +444,7 @@ void GraphBuilder::visitStoreInst(StoreInst &SI) { } void GraphBuilder::visitAtomicCmpXchgInst(AtomicCmpXchgInst &I) { - DEBUG(errs() << "[local] visiting atomic cmpxchg: " << I << "\n"); + SDEBUG(errs() << "[local] visiting atomic cmpxchg: " << I << "\n"); if (isa(I.getType())) { visitInstruction (I); return; @@ -496,7 +496,7 @@ void GraphBuilder::visitAtomicCmpXchgInst(AtomicCmpXchgInst &I) { } void GraphBuilder::visitAtomicRMWInst(AtomicRMWInst &I) { - DEBUG(errs() << "[local] visiting atomic RMW: " << I << "\n"); + SDEBUG(errs() << "[local] visiting atomic RMW: " << I << "\n"); // // Create a DSNode for the dereferenced pointer . If the DSNode is NULL, do // nothing more (this can occur if the pointer is a NULL constant; bugpoint @@ -521,13 +521,13 @@ void GraphBuilder::visitAtomicRMWInst(AtomicRMWInst &I) { } void GraphBuilder::visitReturnInst(ReturnInst &RI) { - DEBUG(errs() << "[local] visiting return: " << RI << "\n"); + SDEBUG(errs() << "[local] visiting return: " << RI << "\n"); if (RI.getNumOperands() && isa(RI.getOperand(0)->getType())) G.getOrCreateReturnNodeFor(*FB).mergeWith(getValueDest(RI.getOperand(0))); } void GraphBuilder::visitVAArgInst(VAArgInst &I) { - DEBUG(errs() << "[local] visiting vaarg: " << I << "\n"); + SDEBUG(errs() << "[local] visiting vaarg: " << I << "\n"); Module *M = FB->getParent(); Triple TargetTriple(M->getTargetTriple()); Triple::ArchType Arch = TargetTriple.getArch(); @@ -573,7 +573,7 @@ void GraphBuilder::visitVAArgInst(VAArgInst &I) { } void GraphBuilder::visitIntToPtrInst(IntToPtrInst &I) { - DEBUG(errs() << "[local] visiting inttoptr: " << I << "\n"); + SDEBUG(errs() << "[local] visiting inttoptr: " << I << "\n"); DSNode *N = createNode(); if(I.hasOneUse()) { if(isa(*(I.use_begin()))) { @@ -587,7 +587,7 @@ void GraphBuilder::visitIntToPtrInst(IntToPtrInst &I) { } void GraphBuilder::visitPtrToIntInst(PtrToIntInst& I) { - DEBUG(errs() << "[local] visiting ptrtoint: " << I << "\n"); + SDEBUG(errs() << "[local] visiting ptrtoint: " << I << "\n"); DSNode* N = getValueDest(I.getOperand(0)).getNode(); if(I.hasOneUse()) { if(isa(*(I.use_begin()))) { @@ -619,7 +619,7 @@ void GraphBuilder::visitPtrToIntInst(PtrToIntInst& I) { void GraphBuilder::visitBitCastInst(BitCastInst &I) { - DEBUG(errs() << "[local] visiting bitcast: " << I << "\n"); + SDEBUG(errs() << "[local] visiting bitcast: " << I << "\n"); if (!isa(I.getType())) return; // Only pointers DSNodeHandle Ptr = getValueDest(I.getOperand(0)); if (Ptr.isNull()) return; @@ -627,7 +627,7 @@ void GraphBuilder::visitBitCastInst(BitCastInst &I) { } void GraphBuilder::visitCmpInst(CmpInst &I) { - DEBUG(errs() << "[local] visiting compare: " << I << "\n"); + SDEBUG(errs() << "[local] visiting compare: " << I << "\n"); //Address can escape through cmps } @@ -662,7 +662,7 @@ unsigned getValueOffset(Type *Ty, ArrayRef Idxs, } void GraphBuilder::visitInsertValueInst(InsertValueInst& I) { - DEBUG(errs() << "[local] visiting insertvalue: " << I << "\n"); + SDEBUG(errs() << "[local] visiting insertvalue: " << I << "\n"); setDestTo(I, createNode()->setAllocaMarker()); Type *StoredTy = I.getInsertedValueOperand()->getType(); @@ -684,7 +684,7 @@ void GraphBuilder::visitInsertValueInst(InsertValueInst& I) { } void GraphBuilder::visitExtractValueInst(ExtractValueInst& I) { - DEBUG(errs() << "[local] visiting extractvalue: " << I << "\n"); + SDEBUG(errs() << "[local] visiting extractvalue: " << I << "\n"); DSNodeHandle Ptr = getValueDest(I.getAggregateOperand()); // Make that the node is read from... @@ -701,7 +701,7 @@ void GraphBuilder::visitExtractValueInst(ExtractValueInst& I) { } void GraphBuilder::visitGetElementPtrInst(User &GEP) { - DEBUG(errs() << "[local] visiting GEP: " << GEP << "\n"); + SDEBUG(errs() << "[local] visiting GEP: " << GEP << "\n"); // // Ensure that the indexed pointer has a DSNode. // @@ -748,8 +748,9 @@ void GraphBuilder::visitGetElementPtrInst(User &GEP) { // conservative type-folding. // for (gep_type_iterator I = gep_type_begin(GEP), E = gep_type_end(GEP); - I != E; ++I) - if (StructType *STy = dyn_cast(*I)) { + I != E; ++I) { + + if (StructType *STy = I.getStructTypeOrNull()) { // indexing into a structure // next index must be a constant const ConstantInt* CUI = cast(I.getOperand()); @@ -780,7 +781,7 @@ void GraphBuilder::visitGetElementPtrInst(User &GEP) { // J is the type of the next index. // Uncomment the line below to get all the nested types. gep_type_iterator J = I; - while (isa(*(++J))) { + while ((++J).isSequential()) { // NodeH.getNode()->mergeTypeInfo(AT1, NodeH.getOffset() + Offset); if((++I) == E) { break; @@ -792,136 +793,38 @@ void GraphBuilder::visitGetElementPtrInst(User &GEP) { } } } - } else if (ArrayType *ATy = dyn_cast(*I)) { - // indexing into an array. - NodeH.getNode()->setArrayMarker(); - Type *CurTy = ATy->getElementType(); - - // - // Ensure that the DSNode's size is large enough to contain one - // element of the type to which the pointer points. - // - if (!isa(CurTy) && NodeH.getNode()->getSize() <= 0) { - NodeH.getNode()->growSize(TD.getTypeAllocSize(CurTy)); - } else if(isa(CurTy) && NodeH.getNode()->getSize() <= 0){ - Type *ETy = (cast(CurTy))->getElementType(); - while(isa(ETy)) { - ETy = (cast(ETy))->getElementType(); - } - NodeH.getNode()->growSize(TD.getTypeAllocSize(ETy)); - } - - // Find if the DSNode belongs to the array - // If not fold. - if((NodeH.getOffset() || Offset != 0) - || (!isa(CurTy) - && (NodeH.getNode()->getSize() != TD.getTypeAllocSize(CurTy)))) { - - M.witness(NodeH, {&GEP, I.getOperand()}, - "node does not belong to array" - ); - - DEBUG( - errs() << "[local] FOLDING FOR ARRAY ACCESS" << "\n"; - errs() << "[local] type: " << *CurTy << "\n"; - errs() << "[local] offset: " << Offset - << " (" << NodeH.getOffset() << ")\n"; - errs() << "[local] size: " << TD.getTypeAllocSize(CurTy) - << " (" << NodeH.getNode()->getSize() << ")\n"; - errs() << "[local] value: " << GEP << "\n"; - errs() << "[local] index: " << *I.getOperand() << "\n"; - ); - NodeH.getNode()->foldNodeCompletely(); - NodeH.getNode(); - Offset = 0; - break; - } - } else if (const PointerType *PtrTy = dyn_cast(*I)) { - // Get the type pointed to by the pointer - Type *CurTy = PtrTy->getElementType(); - - // - // Some LLVM transforms lower structure indexing into byte-level - // indexing. Try to recognize forms of that here. - // - Type * Int8Type = Type::getInt8Ty(CurTy->getContext()); - ConstantInt * IS = dyn_cast(I.getOperand()); - if (IS && - (NodeH.getOffset() == 0) && - (!(NodeH.getNode()->isArrayNode())) && - (CurTy == Int8Type)) { - // Calculate the offset of the field - Offset += IS->getSExtValue() * TD.getTypeAllocSize (Int8Type); - - // - // Grow the DSNode size as needed. - // - unsigned requiredSize = Offset + TD.getTypeAllocSize (Int8Type); - if (NodeH.getNode()->getSize() <= requiredSize){ - NodeH.getNode()->growSize (requiredSize); - } - - // Add in the offset calculated... - NodeH.setOffset(NodeH.getOffset()+Offset); - - // Check the offset - DSNode *N = NodeH.getNode(); - if (N) N->checkOffsetFoldIfNeeded(NodeH.getOffset()); - - // NodeH is now the pointer we want to GEP to be... - setDestTo(GEP, NodeH); - return; - } - - // - // Unless we're advancing the pointer by zero bytes via array indexing, - // fold the node (i.e., mark it type-unknown) and indicate that we're - // indexing zero bytes into the object (because all fields are aliased). - // - // Note that we break out of the loop if we fold the node. Once - // something is folded, all values within it are considered to alias. - // - if (!isa(I.getOperand()) || - !cast(I.getOperand())->isNullValue()) { - - // - // Treat the memory object (DSNode) as an array. - // + } else { + Type *CurTy = I.getIndexedType(); + if (I.isBoundedSequential()) { + // indexing into an array. NodeH.getNode()->setArrayMarker(); // // Ensure that the DSNode's size is large enough to contain one // element of the type to which the pointer points. // - if (!isa(CurTy) && NodeH.getNode()->getSize() <= 0){ + if (!isa(CurTy) && NodeH.getNode()->getSize() <= 0) { NodeH.getNode()->growSize(TD.getTypeAllocSize(CurTy)); - } else if (isa(CurTy) && NodeH.getNode()->getSize() <= 0){ + } else if(isa(CurTy) && NodeH.getNode()->getSize() <= 0){ Type *ETy = (cast(CurTy))->getElementType(); - while (isa(ETy)) { + while(isa(ETy)) { ETy = (cast(ETy))->getElementType(); } NodeH.getNode()->growSize(TD.getTypeAllocSize(ETy)); } - // - // Fold the DSNode if we're indexing into it in a type-incompatible - // manner. That can occur if: - // 1) The DSNode represents a pointer into the object at a non-zero - // offset. - // 2) The offset of the pointer is already non-zero. - // 3) The size of the array element does not match the size into which - // the pointer indexing is indexing. - // - if (NodeH.getOffset() || Offset != 0 || - (!isa(CurTy) && - (NodeH.getNode()->getSize() != TD.getTypeAllocSize(CurTy)))) { + // Find if the DSNode belongs to the array + // If not fold. + if((NodeH.getOffset() || Offset != 0) + || (!isa(CurTy) + && (NodeH.getNode()->getSize() != TD.getTypeAllocSize(CurTy)))) { M.witness(NodeH, {&GEP, I.getOperand()}, - "type-incompatible access into node" + "node does not belong to array" ); - DEBUG( - errs() << "[local] FOLDING FOR POINTER ACCESS" << "\n"; + SDEBUG( + errs() << "[local] FOLDING FOR ARRAY ACCESS" << "\n"; errs() << "[local] type: " << *CurTy << "\n"; errs() << "[local] offset: " << Offset << " (" << NodeH.getOffset() << ")\n"; @@ -935,8 +838,108 @@ void GraphBuilder::visitGetElementPtrInst(User &GEP) { Offset = 0; break; } + } else { + // Pointer type + + // + // Some LLVM transforms lower structure indexing into byte-level + // indexing. Try to recognize forms of that here. + // + Type * Int8Type = Type::getInt8Ty(CurTy->getContext()); + ConstantInt * IS = dyn_cast(I.getOperand()); + if (IS && + (NodeH.getOffset() == 0) && + (!(NodeH.getNode()->isArrayNode())) && + (CurTy == Int8Type)) { + // Calculate the offset of the field + Offset += IS->getSExtValue() * TD.getTypeAllocSize (Int8Type); + + // + // Grow the DSNode size as needed. + // + unsigned requiredSize = Offset + TD.getTypeAllocSize (Int8Type); + if (NodeH.getNode()->getSize() <= requiredSize){ + NodeH.getNode()->growSize (requiredSize); + } + + // Add in the offset calculated... + NodeH.setOffset(NodeH.getOffset()+Offset); + + // Check the offset + DSNode *N = NodeH.getNode(); + if (N) N->checkOffsetFoldIfNeeded(NodeH.getOffset()); + + // NodeH is now the pointer we want to GEP to be... + setDestTo(GEP, NodeH); + return; + } + + // + // Unless we're advancing the pointer by zero bytes via array indexing, + // fold the node (i.e., mark it type-unknown) and indicate that we're + // indexing zero bytes into the object (because all fields are aliased). + // + // Note that we break out of the loop if we fold the node. Once + // something is folded, all values within it are considered to alias. + // + if (!isa(I.getOperand()) || + !cast(I.getOperand())->isNullValue()) { + + // + // Treat the memory object (DSNode) as an array. + // + NodeH.getNode()->setArrayMarker(); + + // + // Ensure that the DSNode's size is large enough to contain one + // element of the type to which the pointer points. + // + if (!isa(CurTy) && NodeH.getNode()->getSize() <= 0){ + NodeH.getNode()->growSize(TD.getTypeAllocSize(CurTy)); + } else if (isa(CurTy) && NodeH.getNode()->getSize() <= 0){ + Type *ETy = (cast(CurTy))->getElementType(); + while (isa(ETy)) { + ETy = (cast(ETy))->getElementType(); + } + NodeH.getNode()->growSize(TD.getTypeAllocSize(ETy)); + } + + // + // Fold the DSNode if we're indexing into it in a type-incompatible + // manner. That can occur if: + // 1) The DSNode represents a pointer into the object at a non-zero + // offset. + // 2) The offset of the pointer is already non-zero. + // 3) The size of the array element does not match the size into which + // the pointer indexing is indexing. + // + if (NodeH.getOffset() || Offset != 0 || + (!isa(CurTy) && + (NodeH.getNode()->getSize() != TD.getTypeAllocSize(CurTy)))) { + + M.witness(NodeH, {&GEP, I.getOperand()}, + "type-incompatible access into node" + ); + + SDEBUG( + errs() << "[local] FOLDING FOR POINTER ACCESS" << "\n"; + errs() << "[local] type: " << *CurTy << "\n"; + errs() << "[local] offset: " << Offset + << " (" << NodeH.getOffset() << ")\n"; + errs() << "[local] size: " << TD.getTypeAllocSize(CurTy) + << " (" << NodeH.getNode()->getSize() << ")\n"; + errs() << "[local] value: " << GEP << "\n"; + errs() << "[local] index: " << *I.getOperand() << "\n"; + ); + NodeH.getNode()->foldNodeCompletely(); + NodeH.getNode(); + Offset = 0; + break; + } + } } } + } // Add in the offset calculated... NodeH.setOffset(NodeH.getOffset()+Offset); @@ -951,17 +954,17 @@ void GraphBuilder::visitGetElementPtrInst(User &GEP) { void GraphBuilder::visitCallInst(CallInst &CI) { - DEBUG(errs() << "[local] visiting call: " << CI << "\n"); + SDEBUG(errs() << "[local] visiting call: " << CI << "\n"); visitCallSite(&CI); } void GraphBuilder::visitInvokeInst(InvokeInst &II) { - DEBUG(errs() << "[local] visiting invoke: " << II << "\n"); + SDEBUG(errs() << "[local] visiting invoke: " << II << "\n"); visitCallSite(&II); } void GraphBuilder::visitVAStart(CallSite CS) { - DEBUG(errs() << "[local] visiting VA start: " + SDEBUG(errs() << "[local] visiting VA start: " << CS.getCalledValue()->getName() << "\n"); // Build out DSNodes for the va_list depending on the target arch @@ -1052,7 +1055,7 @@ void GraphBuilder::visitVAStartNode(DSNode* N) { /// false - This intrinsic is not recognized by DSA. /// bool GraphBuilder::visitIntrinsic(CallSite CS, Function *F) { - DEBUG(errs() << "[local] visiting intrinsic: " << F->getName() << "\n"); + SDEBUG(errs() << "[local] visiting intrinsic: " << F->getName() << "\n"); ++NumIntrinsicCall; @@ -1181,7 +1184,7 @@ bool GraphBuilder::visitIntrinsic(CallSite CS, Function *F) { return true; } - DEBUG(errs() << "[dsa:local] Unhandled intrinsic: " << F->getName() << "\n"); + SDEBUG(errs() << "[dsa:local] Unhandled intrinsic: " << F->getName() << "\n"); llvm_unreachable("Unhandled intrinsic"); return false; } @@ -1232,7 +1235,7 @@ void GraphBuilder::visitCallSite(CallSite CS) { if (!isa(Callee)) { CalleeNode = getValueDest(Callee).getNode(); if (CalleeNode == 0) { - DEBUG(errs() << "WARNING: Program is calling through a null pointer?\n" << *I); + SDEBUG(errs() << "WARNING: Program is calling through a null pointer?\n" << *I); return; // Calling a null pointer? } } @@ -1289,7 +1292,7 @@ void GraphBuilder::visitCallSite(CallSite CS) { // that are of pointer type, make them have unknown composition bits, and merge // the nodes together. void GraphBuilder::visitInstruction(Instruction &Inst) { - DEBUG(errs() << "[local] visiting instruction: " << Inst << "\n"); + SDEBUG(errs() << "[local] visiting instruction: " << Inst << "\n"); DSNodeHandle CurNode; if (isa(Inst.getType())) CurNode = getValueDest(&Inst); @@ -1399,7 +1402,7 @@ GraphBuilder::MergeConstantInitIntoNode(DSNodeHandle &NH, // If this is one of those cute structures that ends with a zero-length // array, just fold the DSNode now and get it over with. // - DEBUG(errs() << "Zero size element at end of struct\n" ); + SDEBUG(errs() << "Zero size element at end of struct\n" ); M.witness(NHN, {CS}, "zero size element at end of struct" @@ -1489,7 +1492,7 @@ void handleMagicSections(DSGraph* GlobalsGraph, Module& M) { DSNodeHandle& DHV = GlobalsGraph->getNodeForValue(V); for (svset::iterator SI = inSection.begin(), SE = inSection.end(); SI != SE; ++SI) { - DEBUG(errs() << "Merging " << V->getName().str() << " with " + SDEBUG(errs() << "Merging " << V->getName().str() << " with " << (*SI)->getName().str() << "\n"); GlobalsGraph->getNodeForValue(*SI).mergeWith(DHV); } @@ -1559,7 +1562,7 @@ bool LocalDataStructures::runOnModule(Module &M) { DSGraph::DontCloneAuxCallNodes | DSGraph::StripAllocaBit); formGlobalECs(); - DEBUG(G->AssertGraphOK()); + SDEBUG(G->AssertGraphOK()); } //GlobalsGraph->removeTriviallyDeadNodes(); @@ -1584,6 +1587,6 @@ bool LocalDataStructures::runOnModule(Module &M) { |DSGraph::IgnoreGlobals); } - DEBUG(print(errs(), &M)); + SDEBUG(print(errs(), &M)); return false; } diff --git a/lib/DSA/Printer.cpp b/lib/DSA/Printer.cpp index 57bf504d9..1220888e9 100644 --- a/lib/DSA/Printer.cpp +++ b/lib/DSA/Printer.cpp @@ -296,7 +296,7 @@ void DSNode::print(llvm::raw_ostream &O, const DSGraph *G) const { } void DSGraph::print(llvm::raw_ostream &O) const { - WriteGraph(O, this, "DataStructures"); + WriteGraph(O, this); } void DSGraph::writeGraphToFile(llvm::raw_ostream &O, @@ -325,7 +325,7 @@ void DSGraph::writeGraphToFile(llvm::raw_ostream &O, /// then cleanup. For use from the debugger. /// void DSGraph::viewGraph() const { - ViewGraph(this, "ds.tempgraph", "DataStructures"); + ViewGraph(this, "ds.tempgraph"); } diff --git a/lib/DSA/StdLibPass.cpp b/lib/DSA/StdLibPass.cpp index 2f95503a1..f5b7726c3 100644 --- a/lib/DSA/StdLibPass.cpp +++ b/lib/DSA/StdLibPass.cpp @@ -458,7 +458,7 @@ StdLibDataStructures::eraseCallsTo(Function* F) { if (CI->getCalledValue() == F) { DSGraph* Graph = getDSGraph(*CI->getParent()->getParent()); //delete the call - DEBUG(errs() << "Removing " << F->getName().str() << " from " + SDEBUG(errs() << "Removing " << F->getName().str() << " from " << CI->getParent()->getParent()->getName().str() << "\n"); ToRemove.insert(std::make_pair(Graph, F)); } @@ -466,7 +466,7 @@ StdLibDataStructures::eraseCallsTo(Function* F) { if (CI->getCalledValue() == F) { DSGraph* Graph = getDSGraph(*CI->getParent()->getParent()); //delete the call - DEBUG(errs() << "Removing " << F->getName().str() << " from " + SDEBUG(errs() << "Removing " << F->getName().str() << " from " << CI->getParent()->getParent()->getName().str() << "\n"); ToRemove.insert(std::make_pair(Graph, F)); } @@ -478,7 +478,7 @@ StdLibDataStructures::eraseCallsTo(Function* F) { if(CI->getCalledValue() == CE) { DSGraph* Graph = getDSGraph(*CI->getParent()->getParent()); //delete the call - DEBUG(errs() << "Removing " << F->getName().str() << " from " + SDEBUG(errs() << "Removing " << F->getName().str() << " from " << CI->getParent()->getParent()->getName().str() << "\n"); ToRemove.insert(std::make_pair(Graph, F)); } @@ -655,12 +655,12 @@ StdLibDataStructures::runOnModule (Module &M) { G->markIncompleteNodes(DSGraph::MarkFormalArgs |DSGraph::IgnoreGlobals); G->computeExternalFlags(EFlags); - DEBUG(G->AssertGraphOK()); + SDEBUG(G->AssertGraphOK()); } GlobalsGraph->markIncompleteNodes(DSGraph::MarkFormalArgs |DSGraph::IgnoreGlobals); GlobalsGraph->computeExternalFlags(DSGraph::ProcessCallSites); - DEBUG(GlobalsGraph->AssertGraphOK()); + SDEBUG(GlobalsGraph->AssertGraphOK()); for (Function &F : M) if (!F.isDeclaration()) { DSGraph *Graph = getOrCreateGraph(&F); diff --git a/lib/DSA/TopDownClosure.cpp b/lib/DSA/TopDownClosure.cpp index 7d8212e88..3e50bb6e5 100644 --- a/lib/DSA/TopDownClosure.cpp +++ b/lib/DSA/TopDownClosure.cpp @@ -180,7 +180,7 @@ bool TDDataStructures::runOnModule(Module &M) { // CBU contains the correct call graph. // Restore it, so that subsequent passes and clients can get it. restoreCorrectCallGraph(); - DEBUG(print(errs(), &M)); + SDEBUG(print(errs(), &M)); return false; } @@ -247,7 +247,7 @@ void TDDataStructures::InlineCallersIntoGraph(DSGraph* DSG) { cloneGlobalsInto(DSG, DSGraph::DontCloneCallNodes | DSGraph::DontCloneAuxCallNodes); - DEBUG(errs() << "[TD] Inlining callers into '" + SDEBUG(errs() << "[TD] Inlining callers into '" << DSG->getFunctionNames() << "'\n"); DSG->maskIncompleteMarkers(); @@ -265,15 +265,15 @@ void TDDataStructures::InlineCallersIntoGraph(DSGraph* DSG) { do { const DSCallSite &CS = *EdgesFromCaller.back().CS; const Function &CF = *EdgesFromCaller.back().CalledFunction; - DEBUG(errs() << " [TD] Inlining graph into Fn '" + SDEBUG(errs() << " [TD] Inlining graph into Fn '" << CF.getName().str() << "' from "); if (CallerGraph->getReturnNodes().empty()) { - DEBUG(errs() << "SYNTHESIZED INDIRECT GRAPH"); + SDEBUG(errs() << "SYNTHESIZED INDIRECT GRAPH"); } else { - DEBUG(errs() << "Fn '" << CS.getCallSite().getInstruction()-> + SDEBUG(errs() << "Fn '" << CS.getCallSite().getInstruction()-> getParent()->getParent()->getName().str() << "'"); } - DEBUG(errs() << ": " << CF.getFunctionType()->getNumParams() + SDEBUG(errs() << ": " << CF.getFunctionType()->getNumParams() << " args\n"); // Get the formal argument and return nodes for the called function and @@ -387,7 +387,7 @@ void TDDataStructures::InlineCallersIntoGraph(DSGraph* DSG) { // If we already have this graph, recycle it. if (IndCallRecI != IndCallMap.end() && IndCallRecI->first == Callees) { - DEBUG(errs() << " [TD] *** Reuse of indcall graph for " << Callees.size() + SDEBUG(errs() << " [TD] *** Reuse of indcall graph for " << Callees.size() << " callees!\n"); DSGraph * IndCallGraph = IndCallRecI->second; assert(IndCallGraph->getFunctionCalls().size() == 1); diff --git a/lib/DSA/TypeSafety.cpp b/lib/DSA/TypeSafety.cpp index fd0c49c19..128365479 100644 --- a/lib/DSA/TypeSafety.cpp +++ b/lib/DSA/TypeSafety.cpp @@ -157,7 +157,7 @@ TypeSafety::isFieldDisjoint (const Value * V, const Function * F) { DSNodeHandle DH = getDSNodeHandle (V, F); DSNode *node = DH.getNode(); unsigned offset = DH.getOffset(); - DEBUG(errs() << " check fields overlap at: " << offset << "\n"); + SDEBUG(errs() << " check fields overlap at: " << offset << "\n"); // // If there is no DSNode, claim that it is not type safe. @@ -203,7 +203,7 @@ TypeSafety::isFieldDisjoint (const GlobalValue * V, unsigned offset) { DSNodeHandle DH = getDSNodeHandle (V); DSNode *node = DH.getNode(); //unsigned offset = DH.getOffset(); - DEBUG(errs() << " check fields overlap at: " << offset << "\n"); + SDEBUG(errs() << " check fields overlap at: " << offset << "\n"); // // If there is no DSNode, claim that it is not type safe. @@ -301,7 +301,7 @@ TypeSafety::fieldMapUpdate (const DSNode * N) { svset::const_iterator tb = TypeSet->begin(); if (++tb != TypeSet->end()) { fmap[offset] = true; - DEBUG(errs() << "Multiple fields at " << offset << "\n"); + SDEBUG(errs() << "Multiple fields at " << offset << "\n"); } } @@ -340,7 +340,7 @@ TypeSafety::fieldMapUpdate (const DSNode * N) { fmap[next_offset] = true; overlaps = true; if(overlaps) { - DEBUG(errs() << "Found overlap at " << offset << " with " << next_offset << "\n"); + SDEBUG(errs() << "Found overlap at " << offset << " with " << next_offset << "\n"); break; } } @@ -436,7 +436,7 @@ TypeSafety::typeFieldsOverlap (const DSNode * N) { } } if(overlaps) { - DEBUG(errs() << " Found overlap at " << offset << " with " << next_offset << "\n"); + SDEBUG(errs() << " Found overlap at " << offset << " with " << next_offset << "\n"); break; } } diff --git a/lib/smack/AddTiming.cpp b/lib/smack/AddTiming.cpp index 5ac78eb0f..ad1eb2a40 100644 --- a/lib/smack/AddTiming.cpp +++ b/lib/smack/AddTiming.cpp @@ -18,6 +18,7 @@ //===----------------------------------------------------------------------===// #include "smack/AddTiming.h" +#include "smack/Debug.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/TargetLibraryInfo.h" @@ -28,7 +29,6 @@ #include "llvm/IR/Value.h" #include "llvm/Pass.h" #include "llvm/Support/CommandLine.h" -#include "smack/Debug.h" #include "llvm/Support/raw_ostream.h" #include "smack/VerifierCodeMetadata.h" @@ -44,73 +44,69 @@ namespace smack { // Register this pass. char AddTiming::ID = 0; -static RegisterPass -X("add-timing-info", "Add Timing Info"); +static RegisterPass X("add-timing-info", "Add Timing Info"); -const std::string AddTiming::INT_TIMING_COST_METADATA = "smack.InstTimingCost.Int64"; -const std::string AddTiming::INSTRUCTION_NAME_METADATA = "smack.LLVMInstructionName"; +const std::string AddTiming::INT_TIMING_COST_METADATA = + "smack.InstTimingCost.Int64"; +const std::string AddTiming::INSTRUCTION_NAME_METADATA = + "smack.LLVMInstructionName"; -static bool begins_with(const std::string& possible_prefix, - const std::string& the_string) { +static bool begins_with(const std::string &possible_prefix, + const std::string &the_string) { return (0 == the_string.find(possible_prefix)); } -static bool isAutogeneratedSmackFunction(Function& F) { +static bool isAutogeneratedSmackFunction(Function &F) { auto name = F.getName(); - return - (begins_with("__SMACK", name) || - begins_with("__VERIFIER", name)); + return (begins_with("__SMACK", name) || begins_with("__VERIFIER", name)); } - -void -AddTiming::getAnalysisUsage(AnalysisUsage &AU) const { + +void AddTiming::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired(); AU.addRequired(); AU.addRequired(); } - -bool -AddTiming::runOnFunction(Function &F) { - this->F = &F; - if (isAutogeneratedSmackFunction(F)) { - //No need to annotate autogenerated functions like __VERIFIER_assume or __SMACK_dummy - return false; - } - - TTI = &(getAnalysis().getTTI(F)); - for (Function::iterator B = F.begin(), BE = F.end(); B != BE; ++B) { - for (BasicBlock::iterator it = B->begin(), e = B->end(); it != e; ++it) { - Instruction *Inst = &*it; - //Add the naming metadata first, so we don't get unnecessary metadata in the print - addNamingMetadata(Inst); - addTimingMetadata(Inst); - } - } - - return false; + +bool AddTiming::runOnFunction(Function &F) { + this->F = &F; + if (isAutogeneratedSmackFunction(F)) { + // No need to annotate autogenerated functions like __VERIFIER_assume or + // __SMACK_dummy + return false; + } + + TTI = &(getAnalysis().getTTI(F)); + for (Function::iterator B = F.begin(), BE = F.end(); B != BE; ++B) { + for (BasicBlock::iterator it = B->begin(), e = B->end(); it != e; ++it) { + Instruction *Inst = &*it; + // Add the naming metadata first, so we don't get unnecessary metadata in + // the print + addNamingMetadata(Inst); + addTimingMetadata(Inst); + } + } + + return false; } -void -AddTiming::addTimingMetadata(Instruction* Inst) const { +void AddTiming::addTimingMetadata(Instruction *Inst) const { unsigned Cost = getInstructionCost(Inst); if (Cost != (unsigned)NO_TIMING_INFO) { addMetadata(Inst, "smack.InstTimingCost.Int64", Cost); - } + } } -void -AddTiming::addNamingMetadata(Instruction* Inst) const { +void AddTiming::addNamingMetadata(Instruction *Inst) const { std::string nameString; llvm::raw_string_ostream os(nameString); Inst->print(os); addMetadata(Inst, INSTRUCTION_NAME_METADATA, os.str()); } - static TargetTransformInfo::OperandValueKind getOperandInfo(Value *V) { TargetTransformInfo::OperandValueKind OpInfo = - TargetTransformInfo::OK_AnyValue; + TargetTransformInfo::OK_AnyValue; // Check for a splat of a constant or for a non uniform vector of constants. if (isa(V) || isa(V)) { @@ -129,16 +125,18 @@ unsigned AddTiming::getInstructionCost(const Instruction *I) const { // When an assume statement appears in the C code // llvm turns it into a series of IR instructions // e.g. __VERIFIER_assume(x > y) would create a icmp instruction - // which timing annotations would assign a cost to. Since these instructions do not + // which timing annotations would assign a cost to. Since these instructions + // do not // occur in the executed code, this leads to an inaccurate timing model. - // The VerifierCodeMetadata marks such nodes in the IR. We can then just return 0 + // The VerifierCodeMetadata marks such nodes in the IR. We can then just + // return 0 - if(VerifierCodeMetadata::isMarked(*I)) { + if (VerifierCodeMetadata::isMarked(*I)) { return 0; } switch (I->getOpcode()) { - case Instruction::GetElementPtr:{ + case Instruction::GetElementPtr: { Type *ValTy = I->getOperand(0)->getType()->getPointerElementType(); return TTI->getAddressComputationCost(ValTy); } @@ -167,9 +165,9 @@ unsigned AddTiming::getInstructionCost(const Instruction *I) const { case Instruction::Or: case Instruction::Xor: { TargetTransformInfo::OperandValueKind Op1VK = - getOperandInfo(I->getOperand(0)); + getOperandInfo(I->getOperand(0)); TargetTransformInfo::OperandValueKind Op2VK = - getOperandInfo(I->getOperand(1)); + getOperandInfo(I->getOperand(1)); return TTI->getArithmeticInstrCost(I->getOpcode(), I->getType(), Op1VK, Op2VK); } @@ -186,17 +184,18 @@ unsigned AddTiming::getInstructionCost(const Instruction *I) const { case Instruction::Store: { const StoreInst *SI = cast(I); Type *ValTy = SI->getValueOperand()->getType(); - assert(!ValTy->isStructTy() && "Timing annotations do not currently work for struct sized stores"); - return TTI->getMemoryOpCost(I->getOpcode(), ValTy, - SI->getAlignment(), - SI->getPointerAddressSpace()); + assert(!ValTy->isStructTy() && + "Timing annotations do not currently work for struct sized stores"); + return TTI->getMemoryOpCost(I->getOpcode(), ValTy, SI->getAlignment(), + SI->getPointerAddressSpace()); } case Instruction::Load: { const LoadInst *LI = cast(I); - assert(!I->getType()->isStructTy() && "Timing annotations do not currently work for struct sized loads"); + assert(!I->getType()->isStructTy() && + "Timing annotations do not currently work for struct sized loads"); return TTI->getMemoryOpCost(I->getOpcode(), I->getType(), - LI->getAlignment(), - LI->getPointerAddressSpace()); + LI->getAlignment(), + LI->getPointerAddressSpace()); } case Instruction::ZExt: case Instruction::SExt: @@ -225,7 +224,7 @@ unsigned AddTiming::getInstructionCost(const Instruction *I) const { } case Instruction::Call: { if (const IntrinsicInst *II = dyn_cast(I)) { - SmallVector Tys; + SmallVector Tys; for (unsigned J = 0, JE = II->getNumArgOperands(); J != JE; ++J) Tys.push_back(II->getArgOperand(J)->getType()); @@ -236,7 +235,7 @@ unsigned AddTiming::getInstructionCost(const Instruction *I) const { return TTI->getIntrinsicInstrCost(II->getIntrinsicID(), II->getType(), Tys, FMF); } - + return NO_TIMING_INFO; } default: @@ -244,21 +243,23 @@ unsigned AddTiming::getInstructionCost(const Instruction *I) const { return NO_TIMING_INFO; } } - -void AddTiming::addMetadata(Instruction *Inst, const std::string &name, const std::string& value) const { - LLVMContext& C = Inst->getContext(); - MDNode* N = MDNode::get(C, MDString::get(C, value)); + +void AddTiming::addMetadata(Instruction *Inst, const std::string &name, + const std::string &value) const { + LLVMContext &C = Inst->getContext(); + MDNode *N = MDNode::get(C, MDString::get(C, value)); Inst->setMetadata(name, N); } - -void AddTiming::addMetadata(Instruction *Inst, const std::string &name, unsigned cost) const { - LLVMContext& C = Inst->getContext(); - MDNode* N = MDNode::get(C, ConstantAsMetadata::get(ConstantInt::get(C, llvm::APInt(64, (uint64_t)cost, false)))); +void AddTiming::addMetadata(Instruction *Inst, const std::string &name, + unsigned cost) const { + LLVMContext &C = Inst->getContext(); + MDNode *N = MDNode::get(C, ConstantAsMetadata::get(ConstantInt::get( + C, llvm::APInt(64, (uint64_t)cost, false)))); Inst->setMetadata(name, N); } - -void AddTiming::print(raw_ostream &OS, const Module*) const { + +void AddTiming::print(raw_ostream &OS, const Module *) const { if (!F) return; @@ -271,8 +272,8 @@ void AddTiming::print(raw_ostream &OS, const Module*) const { } else { OS << "Cost Model: Unknown cost"; } - OS << " for instruction: "<< *Inst << "\n"; + OS << " for instruction: " << *Inst << "\n"; } } } -}//namespace smack +} // namespace smack diff --git a/lib/smack/BoogieAst.cpp b/lib/smack/BoogieAst.cpp index 92ca8a692..13035999e 100644 --- a/lib/smack/BoogieAst.cpp +++ b/lib/smack/BoogieAst.cpp @@ -4,259 +4,269 @@ #include "smack/BoogieAst.h" #include "smack/Naming.h" #include "llvm/IR/Constants.h" -#include #include #include +#include namespace smack { unsigned Decl::uniqueId = 0; -const Expr* Expr::exists(std::list vars, const Expr* e) { +const Expr *Expr::exists(std::list vars, const Expr *e) { return new QuantExpr(QuantExpr::Exists, vars, e); } -const Expr* Expr::forall(std::list vars, const Expr* e) { +const Expr *Expr::forall(std::list vars, const Expr *e) { return new QuantExpr(QuantExpr::Forall, vars, e); } -const Expr* Expr::and_(const Expr* l, const Expr* r) { +const Expr *Expr::and_(const Expr *l, const Expr *r) { return new BinExpr(BinExpr::And, l, r); } -const Expr* Expr::cond(const Expr* c, const Expr* t, const Expr* e) { - return new CondExpr(c,t,e); +const Expr *Expr::or_(const Expr *l, const Expr *r) { + return new BinExpr(BinExpr::Or, l, r); } -const Expr* Expr::eq(const Expr* l, const Expr* r) { +const Expr *Expr::cond(const Expr *c, const Expr *t, const Expr *e) { + return new CondExpr(c, t, e); +} + +const Expr *Expr::eq(const Expr *l, const Expr *r) { return new BinExpr(BinExpr::Eq, l, r); } -const Expr* Expr::lt(const Expr* l, const Expr* r) { +const Expr *Expr::lt(const Expr *l, const Expr *r) { return new BinExpr(BinExpr::Lt, l, r); } -const Expr* Expr::fn(std::string f, std::list args) { +const Expr *Expr::fn(std::string f, std::list args) { return new FunExpr(f, args); } -const Expr* Expr::fn(std::string f, const Expr* x) { - return new FunExpr(f, std::list(1, x)); +const Expr *Expr::fn(std::string f, const Expr *x) { + return new FunExpr(f, std::list(1, x)); } -const Expr* Expr::fn(std::string f, const Expr* x, const Expr* y) { - std::list ps; +const Expr *Expr::fn(std::string f, const Expr *x, const Expr *y) { + std::list ps; ps.push_back(x); ps.push_back(y); return new FunExpr(f, ps); } -const Expr* Expr::fn(std::string f, const Expr* x, const Expr* y, const Expr* z) { - std::list ps; +const Expr *Expr::fn(std::string f, const Expr *x, const Expr *y, + const Expr *z) { + std::list ps; ps.push_back(x); ps.push_back(y); ps.push_back(z); return new FunExpr(f, ps); } -const Expr* Expr::id(std::string s) { - return new VarExpr(s); -} +const Expr *Expr::id(std::string s) { return new VarExpr(s); } -const Expr* Expr::impl(const Expr* l, const Expr* r) { +const Expr *Expr::impl(const Expr *l, const Expr *r) { return new BinExpr(BinExpr::Imp, l, r); } -const Expr* Expr::lit(bool b) { - return new BoolLit(b); -} +const Expr *Expr::lit(bool b) { return new BoolLit(b); } -const Expr* Expr::lit(std::string v) { - return new StringLit(v); -} +const Expr *Expr::lit(std::string v) { return new StringLit(v); } -const Expr* Expr::lit(unsigned long v) { - return new IntLit(v); -} +const Expr *Expr::lit(unsigned long long v) { return new IntLit(v); } -const Expr* Expr::lit(long v) { - return new IntLit(v); -} +const Expr *Expr::lit(long long v) { return new IntLit(v); } -const Expr* Expr::lit(std::string v, unsigned w) { - return w ? (const Expr*) new BvLit(v,w) : (const Expr*) new IntLit(v); +const Expr *Expr::lit(std::string v, unsigned w) { + return w ? (const Expr *)new BvLit(v, w) : (const Expr *)new IntLit(v); } -const Expr* Expr::lit(unsigned long v, unsigned w) { - return new BvLit(v,w); +const Expr *Expr::lit(unsigned long long v, unsigned w) { + return new BvLit(v, w); } -const Expr* Expr::lit(bool n, std::string s, std::string e, unsigned ss, unsigned es) { +const Expr *Expr::lit(bool n, std::string s, std::string e, unsigned ss, + unsigned es) { return new FPLit(n, s, e, ss, es); } -const Expr* Expr::lit(RModeKind v) { - return new RModeLit(v); +const Expr *Expr::lit(std::string v, unsigned ss, unsigned es) { + return new FPLit(v, ss, es); } -const Expr* Expr::neq(const Expr* l, const Expr* r) { +const Expr *Expr::lit(RModeKind v) { return new RModeLit(v); } + +const Expr *Expr::neq(const Expr *l, const Expr *r) { return new BinExpr(BinExpr::Neq, l, r); } -const Expr* Expr::not_(const Expr* e) { - return new NotExpr(e); -} +const Expr *Expr::not_(const Expr *e) { return new NotExpr(e); } -const Expr* Expr::sel(const Expr* b, const Expr* i) { +const Expr *Expr::sel(const Expr *b, const Expr *i) { return new SelExpr(b, i); } -const Expr* Expr::sel(std::string b, std::string i) { +const Expr *Expr::sel(std::string b, std::string i) { return new SelExpr(id(b), id(i)); } -const Expr* Expr::upd(const Expr* b, const Expr* i, const Expr* v) { +const Expr *Expr::upd(const Expr *b, const Expr *i, const Expr *v) { return new UpdExpr(b, i, v); } -const Expr* Expr::if_then_else(const Expr* c, const Expr* t, const Expr* e) { +const Expr *Expr::if_then_else(const Expr *c, const Expr *t, const Expr *e) { return new IfThenElseExpr(c, t, e); } -const Attr* Attr::attr(std::string s, std::initializer_list vs) { - return new Attr(s,vs); +const Expr *Expr::bvExtract(const Expr *v, const Expr *u, const Expr *l) { + return new BvExtract(v, u, l); +} + +const Expr *Expr::bvExtract(const Expr *v, unsigned u, unsigned l) { + return new BvExtract(v, Expr::lit(u), Expr::lit(l)); +} + +const Expr *Expr::bvExtract(std::string v, unsigned u, unsigned l) { + return new BvExtract(Expr::id(v), Expr::lit(u), Expr::lit(l)); } -const Attr* Attr::attr(std::string s, std::list vs) { - return new Attr(s,vs); +const Expr *Expr::bvConcat(const Expr *left, const Expr *right) { + return new BvConcat(left, right); } -const Attr* Attr::attr(std::string s) { - return attr(s, {}); +const Attr *Attr::attr(std::string s, std::initializer_list vs) { + return new Attr(s, vs); } -const Attr* Attr::attr(std::string s, std::string v) { +const Attr *Attr::attr(std::string s, std::list vs) { + return new Attr(s, vs); +} + +const Attr *Attr::attr(std::string s) { return attr(s, {}); } + +const Attr *Attr::attr(std::string s, std::string v) { return new Attr(s, {Expr::lit(v)}); } -const Attr* Attr::attr(std::string s, int v) { - return attr(s, {Expr::lit((long) v)}); +const Attr *Attr::attr(std::string s, int v) { + return attr(s, {Expr::lit((long long)v)}); } -const Attr* Attr::attr(std::string s, std::string v, int i) { - return attr(s, {Expr::lit(v), Expr::lit((long) i)}); +const Attr *Attr::attr(std::string s, std::string v, int i) { + return attr(s, {Expr::lit(v), Expr::lit((long long)i)}); } -const Attr* Attr::attr(std::string s, std::string v, int i, int j) { - return attr(s, {Expr::lit(v), Expr::lit((long) i), Expr::lit((long) j)}); +const Attr *Attr::attr(std::string s, std::string v, int i, int j) { + return attr(s, + {Expr::lit(v), Expr::lit((long long)i), Expr::lit((long long)j)}); } -const Stmt* Stmt::annot(std::list attrs) { - AssumeStmt* s = new AssumeStmt(Expr::lit(true)); +const Stmt *Stmt::annot(std::list attrs) { + AssumeStmt *s = new AssumeStmt(Expr::lit(true)); for (auto A : attrs) s->add(A); return s; } -const Stmt* Stmt::annot(const Attr* a) { - return Stmt::annot(std::list(1, a)); +const Stmt *Stmt::annot(const Attr *a) { + return Stmt::annot(std::list(1, a)); } -const Stmt* Stmt::assert_(const Expr* e, std::list attrs) { +const Stmt *Stmt::assert_(const Expr *e, std::list attrs) { return new AssertStmt(e, attrs); } -const Stmt* Stmt::assign(const Expr* e, const Expr* f) { - return new AssignStmt(std::list(1, e), std::list(1, f)); +const Stmt *Stmt::assign(const Expr *e, const Expr *f) { + return new AssignStmt(std::list(1, e), + std::list(1, f)); } -const Stmt* Stmt::assign(std::list lhs, std::list rhs) { +const Stmt *Stmt::assign(std::list lhs, + std::list rhs) { return new AssignStmt(lhs, rhs); } -const Stmt* Stmt::assume(const Expr* e) { - return new AssumeStmt(e); -} +const Stmt *Stmt::assume(const Expr *e) { return new AssumeStmt(e); } -const Stmt* Stmt::assume(const Expr* e, const Attr* a) { - AssumeStmt* s = new AssumeStmt(e); +const Stmt *Stmt::assume(const Expr *e, const Attr *a) { + AssumeStmt *s = new AssumeStmt(e); s->add(a); - return (const AssumeStmt*) s; + return (const AssumeStmt *)s; } -const Stmt* Stmt::call(std::string p, std::list args, std::list rets, - std::list attrs) { +const Stmt *Stmt::call(std::string p, std::list args, + std::list rets, + std::list attrs) { return new CallStmt(p, attrs, args, rets); } -const Stmt* Stmt::comment(std::string s) { - return new Comment(s); -} +const Stmt *Stmt::comment(std::string s) { return new Comment(s); } -const Stmt* Stmt::goto_(std::list ts) { - return new GotoStmt(ts); -} +const Stmt *Stmt::goto_(std::list ts) { return new GotoStmt(ts); } -const Stmt* Stmt::havoc(std::string x) { +const Stmt *Stmt::havoc(std::string x) { return new HavocStmt(std::list(1, x)); } -const Stmt* Stmt::return_(const Expr* e) { - return new ReturnStmt(e); +const Stmt *Stmt::havoc(const Expr *x) { + std::stringstream s; + s << x; + return new HavocStmt(std::list(1, s.str())); } -const Stmt* Stmt::return_() { - return new ReturnStmt(); -} +const Stmt *Stmt::return_(const Expr *e) { return new ReturnStmt(e); } -const Stmt* Stmt::skip() { - return new AssumeStmt(Expr::lit(true)); -} +const Stmt *Stmt::return_() { return new ReturnStmt(); } -const Stmt* Stmt::code(std::string s) { - return new CodeStmt(s); -} +const Stmt *Stmt::skip() { return new AssumeStmt(Expr::lit(true)); } + +const Stmt *Stmt::code(std::string s) { return new CodeStmt(s); } -Decl* Decl::typee(std::string name, std::string type, std::list attrs) { - return new TypeDecl(name,type,attrs); +Decl *Decl::typee(std::string name, std::string type, + std::list attrs) { + return new TypeDecl(name, type, attrs); } -Decl* Decl::axiom(const Expr* e, std::string name) { +Decl *Decl::axiom(const Expr *e, std::string name) { return new AxiomDecl(name, e); } -FuncDecl* Decl::function(std::string name, std::list args, - std::string type, const Expr* e, std::list attrs) { - return new FuncDecl(name,attrs,args,type,e); +FuncDecl *Decl::function(std::string name, std::list args, + std::string type, const Expr *e, + std::list attrs) { + return new FuncDecl(name, attrs, args, type, e); } -Decl* Decl::constant(std::string name, std::string type) { - return Decl::constant(name, type, std::list(), false); +Decl *Decl::constant(std::string name, std::string type) { + return Decl::constant(name, type, std::list(), false); } -Decl* Decl::constant(std::string name, std::string type, bool unique) { - return Decl::constant(name, type, std::list(), unique); +Decl *Decl::constant(std::string name, std::string type, bool unique) { + return Decl::constant(name, type, std::list(), unique); } -Decl* Decl::constant(std::string name, std::string type, std::list ax, bool unique) { +Decl *Decl::constant(std::string name, std::string type, + std::list ax, bool unique) { return new ConstDecl(name, type, ax, unique); } -Decl* Decl::variable(std::string name, std::string type) { +Decl *Decl::variable(std::string name, std::string type) { return new VarDecl(name, type); } -ProcDecl* Decl::procedure(std::string name, - std::list args, std::list rets, - std::list decls, std::list blocks) { +ProcDecl *Decl::procedure(std::string name, std::list args, + std::list rets, std::list decls, + std::list blocks) { return new ProcDecl(name, args, rets, decls, blocks); } -Decl* Decl::code(std::string name, std::string s) { +Decl *Decl::code(std::string name, std::string s) { return new CodeDecl(name, s); } -FuncDecl* Decl::code(ProcDecl* P) { - std::list decls; - std::list blocks; +FuncDecl *Decl::code(ProcDecl *P) { + std::list decls; + std::list blocks; for (auto B : *P) { blocks.push_back(Block::block(B->getName())); for (auto S : *B) { - const Stmt* SS; + const Stmt *SS; if (llvm::isa(S)) - SS = Stmt::return_(Expr::neq(Expr::id(P->getReturns().front().first),Expr::lit(0U))); + SS = Stmt::return_( + Expr::neq(Expr::id(P->getReturns().front().first), Expr::lit(0U))); else SS = S; blocks.back()->getStatements().push_back(SS); @@ -271,41 +281,39 @@ FuncDecl* Decl::code(ProcDecl* P) { for (auto R : P->getReturns()) decls.push_back(Decl::variable(R.first, R.second)); - return Decl::function( - P->getName(), P->getParameters(), "bool", new CodeExpr(decls, blocks), - {Attr::attr("inline")} - ); + return Decl::function(P->getName(), P->getParameters(), "bool", + new CodeExpr(decls, blocks), {Attr::attr("inline")}); } -std::ostream& operator<<(std::ostream& os, const Expr& e) { +std::ostream &operator<<(std::ostream &os, const Expr &e) { e.print(os); return os; } -std::ostream& operator<<(std::ostream& os, const Expr* e) { +std::ostream &operator<<(std::ostream &os, const Expr *e) { e->print(os); return os; } -std::ostream& operator<<(std::ostream& os, const Attr* a) { +std::ostream &operator<<(std::ostream &os, const Attr *a) { a->print(os); return os; } -std::ostream& operator<<(std::ostream& os, const Stmt* s) { +std::ostream &operator<<(std::ostream &os, const Stmt *s) { s->print(os); return os; } -std::ostream& operator<<(std::ostream& os, const Block* b) { +std::ostream &operator<<(std::ostream &os, const Block *b) { b->print(os); return os; } -std::ostream& operator<<(std::ostream& os, Decl& d) { +std::ostream &operator<<(std::ostream &os, Decl &d) { d.print(os); return os; } -std::ostream& operator<<(std::ostream& os, Decl* d) { +std::ostream &operator<<(std::ostream &os, Decl *d) { d->print(os); return os; } -std::ostream& operator<<(std::ostream& os, Program* p) { +std::ostream &operator<<(std::ostream &os, Program *p) { if (p == 0) { os << " Program!\n"; } else { @@ -313,46 +321,52 @@ std::ostream& operator<<(std::ostream& os, Program* p) { } return os; } -std::ostream& operator<<(std::ostream& os, Program& p) { +std::ostream &operator<<(std::ostream &os, Program &p) { p.print(os); return os; } -template std::ostream& operator<<(std::ostream& os, std::pair p) { +template +std::ostream &operator<<(std::ostream &os, std::pair p) { os << p.first << ": " << p.second; return os; } -template void print_seq(std::ostream& os, std::list ts, - std::string init, std::string sep, std::string term) { +template +void print_seq(std::ostream &os, std::list ts, std::string init, + std::string sep, std::string term) { os << init; for (typename std::list::iterator i = ts.begin(); i != ts.end(); ++i) os << (i == ts.begin() ? "" : sep) << *i; os << term; } -template void print_seq(std::ostream& os, std::list ts, std::string sep) { +template +void print_seq(std::ostream &os, std::list ts, std::string sep) { print_seq(os, ts, "", sep, ""); } -template void print_seq(std::ostream& os, std::list ts) { +template void print_seq(std::ostream &os, std::list ts) { print_seq(os, ts, "", "", ""); } -template void print_set(std::ostream& os, std::set ts, - std::string init, std::string sep, std::string term) { +template +void print_set(std::ostream &os, std::set ts, std::string init, + std::string sep, std::string term) { os << init; - for (typename std::set::iterator i = ts.begin(); i != ts.end(); ++i) + for (typename std::set::iterator i = ts.begin(); i != ts.end(); ++i) os << (i == ts.begin() ? "" : sep) << *i; os << term; } -template void print_set(std::ostream& os, std::set ts, std::string sep) { - print_set(os, ts, "", sep, ""); +template +void print_set(std::ostream &os, std::set ts, std::string sep) { + print_set(os, ts, "", sep, ""); } -template void print_set(std::ostream& os, std::set ts) { - print_set(os, ts, "", "", ""); +template +void print_set(std::ostream &os, std::set ts) { + print_set(os, ts, "", "", ""); } -void BinExpr::print(std::ostream& os) const { +void BinExpr::print(std::ostream &os) const { os << "(" << lhs << " "; switch (op) { case Iff: @@ -410,20 +424,18 @@ void BinExpr::print(std::ostream& os) const { os << " " << rhs << ")"; } -void CondExpr::print(std::ostream& os) const { +void CondExpr::print(std::ostream &os) const { os << "(if " << cond << " then " << then << " else " << else_ << ")"; } -void FunExpr::print(std::ostream& os) const { +void FunExpr::print(std::ostream &os) const { os << fun; - print_seq(os, args, "(", ", ", ")"); + print_seq(os, args, "(", ", ", ")"); } -void BoolLit::print(std::ostream& os) const { - os << (val ? "true" : "false"); -} +void BoolLit::print(std::ostream &os) const { os << (val ? "true" : "false"); } -void RModeLit::print(std::ostream& os) const { +void RModeLit::print(std::ostream &os) const { switch (val) { case RModeKind::RNE: os << "RNE"; @@ -443,27 +455,24 @@ void RModeLit::print(std::ostream& os) const { } } -void IntLit::print(std::ostream& os) const { - os << val; -} +void IntLit::print(std::ostream &os) const { os << val; } -void BvLit::print(std::ostream& os) const { - os << val << "bv" << width; -} +void BvLit::print(std::ostream &os) const { os << val << "bv" << width; } -void FPLit::print(std::ostream& os) const { - os << (neg ? "-" : "") << sig << "e" << expo << "f" << sigSize << "e" << expSize; +void FPLit::print(std::ostream &os) const { + if (specialValue.empty()) { + os << (neg ? "-" : "") << "0x" << sig << "e" << expo << "f"; + } else { + os << "0" << specialValue; + } + os << sigSize << "e" << expSize; } -void NegExpr::print(std::ostream& os) const { - os << "-(" << expr << ")"; -} +void NegExpr::print(std::ostream &os) const { os << "-(" << expr << ")"; } -void NotExpr::print(std::ostream& os) const { - os << "!(" << expr << ")"; -} +void NotExpr::print(std::ostream &os) const { os << "!(" << expr << ")"; } -void QuantExpr::print(std::ostream& os) const { +void QuantExpr::print(std::ostream &os) const { os << "("; switch (quant) { case Forall: @@ -477,131 +486,133 @@ void QuantExpr::print(std::ostream& os) const { os << " :: " << expr << ")"; } -void SelExpr::print(std::ostream& os) const { +void SelExpr::print(std::ostream &os) const { os << base; - print_seq(os, idxs, "[", ", ", "]"); + print_seq(os, idxs, "[", ", ", "]"); } -void UpdExpr::print(std::ostream& os) const { +void UpdExpr::print(std::ostream &os) const { os << base << "["; - print_seq(os, idxs, ", "); + print_seq(os, idxs, ", "); os << " := " << val << "]"; } -void VarExpr::print(std::ostream& os) const { - os << var; -} +void VarExpr::print(std::ostream &os) const { os << var; } -void CodeExpr::print(std::ostream& os) const { - os << "|{" << "\n"; +void CodeExpr::print(std::ostream &os) const { + os << "|{" + << "\n"; if (decls.size() > 0) - print_seq(os, decls, " ", "\n ", "\n"); - print_seq(os, blocks, "\n"); - os << "\n" << "}|"; + print_seq(os, decls, " ", "\n ", "\n"); + print_seq(os, blocks, "\n"); + os << "\n" + << "}|"; } -void IfThenElseExpr::print(std::ostream& os) const { +void IfThenElseExpr::print(std::ostream &os) const { os << "if " << cond << " then " << true_value << " else " << false_value; } -void StringLit::print(std::ostream& os) const { - os << "\"" << val << "\""; +void BvExtract::print(std::ostream &os) const { + os << var << "[" << upper << ":" << lower << "]"; +} + +void BvConcat::print(std::ostream &os) const { + os << "(" << left << "++" << right << ")"; } -void Attr::print(std::ostream& os) const { +void StringLit::print(std::ostream &os) const { os << "\"" << val << "\""; } + +void Attr::print(std::ostream &os) const { os << "{:" << name; if (vals.size() > 0) - print_seq(os, vals, " ", ", ", ""); + print_seq(os, vals, " ", ", ", ""); os << "}"; } -void AssertStmt::print(std::ostream& os) const { +void AssertStmt::print(std::ostream &os) const { os << "assert "; if (attrs.size() > 0) - print_seq(os, attrs, "", " ", " "); + print_seq(os, attrs, "", " ", " "); os << expr << ";"; } -void AssignStmt::print(std::ostream& os) const { - print_seq(os, lhs, ", "); +void AssignStmt::print(std::ostream &os) const { + print_seq(os, lhs, ", "); os << " := "; - print_seq(os, rhs, ", "); + print_seq(os, rhs, ", "); os << ";"; } -void AssumeStmt::print(std::ostream& os) const { +void AssumeStmt::print(std::ostream &os) const { os << "assume "; if (attrs.size() > 0) - print_seq(os, attrs, "", " ", " "); + print_seq(os, attrs, "", " ", " "); os << expr << ";"; } -void CallStmt::print(std::ostream& os) const { +void CallStmt::print(std::ostream &os) const { os << "call "; if (attrs.size() > 0) - print_seq(os, attrs, "", " ", " "); + print_seq(os, attrs, "", " ", " "); if (returns.size() > 0) print_seq(os, returns, "", ", ", " := "); os << proc; - print_seq(os, params, "(", ", ", ")"); + print_seq(os, params, "(", ", ", ")"); os << ";"; } -void Comment::print(std::ostream& os) const { - os << "// " << str; -} +void Comment::print(std::ostream &os) const { os << "// " << str; } -void GotoStmt::print(std::ostream& os) const { +void GotoStmt::print(std::ostream &os) const { os << "goto "; print_seq(os, targets, ", "); os << ";"; } -void HavocStmt::print(std::ostream& os) const { +void HavocStmt::print(std::ostream &os) const { os << "havoc "; print_seq(os, vars, ", "); os << ";"; } -void ReturnStmt::print(std::ostream& os) const { +void ReturnStmt::print(std::ostream &os) const { os << "return"; if (expr) os << " " << expr; os << ";"; } -void CodeStmt::print(std::ostream& os) const { - os << code; -} +void CodeStmt::print(std::ostream &os) const { os << code; } -void TypeDecl::print(std::ostream& os) const { +void TypeDecl::print(std::ostream &os) const { os << "type "; if (attrs.size() > 0) - print_seq(os, attrs, "", " ", " "); + print_seq(os, attrs, "", " ", " "); os << name; if (alias != "") os << " = " << alias; os << ";"; } -void AxiomDecl::print(std::ostream& os) const { +void AxiomDecl::print(std::ostream &os) const { os << "axiom "; if (attrs.size() > 0) - print_seq(os, attrs, "", " ", " "); + print_seq(os, attrs, "", " ", " "); os << expr << ";"; } -void ConstDecl::print(std::ostream& os) const { +void ConstDecl::print(std::ostream &os) const { os << "const "; if (attrs.size() > 0) - print_seq(os, attrs, "", " ", " "); + print_seq(os, attrs, "", " ", " "); os << (unique ? "unique " : "") << name << ": " << type << ";"; } -void FuncDecl::print(std::ostream& os) const { +void FuncDecl::print(std::ostream &os) const { os << "function "; if (attrs.size() > 0) - print_seq(os, attrs, "", " ", " "); + print_seq(os, attrs, "", " ", " "); os << name << "("; for (auto P = params.begin(), E = params.end(); P != E; ++P) os << (P == params.begin() ? "" : ", ") << P->first << ": " << P->second; @@ -612,16 +623,16 @@ void FuncDecl::print(std::ostream& os) const { os << ";"; } -void VarDecl::print(std::ostream& os) const { +void VarDecl::print(std::ostream &os) const { if (attrs.size() > 0) - print_seq(os, attrs, "", " ", " "); + print_seq(os, attrs, "", " ", " "); os << "var " << name << ": " << type << ";"; } -void ProcDecl::print(std::ostream& os) const { +void ProcDecl::print(std::ostream &os) const { os << "procedure "; if (attrs.size() > 0) - print_seq(os, attrs, "", " ", " "); + print_seq(os, attrs, "", " ", " "); os << name << "("; for (auto P = params.begin(), E = params.end(); P != E; ++P) os << (P == params.begin() ? "" : ", ") << P->first << ": " << P->second; @@ -642,35 +653,36 @@ void ProcDecl::print(std::ostream& os) const { } if (requires.size() > 0) { os << "\n"; - print_seq(os, requires, " requires ", ";\n requires ", ";"); + print_seq(os, requires, " requires ", ";\n requires ", ";"); } if (ensures.size() > 0) { os << "\n"; - print_seq(os, ensures, " ensures ", ";\n ensures ", ";"); + print_seq(os, ensures, " ensures ", ";\n ensures ", ";"); } if (blocks.size() > 0) { os << "\n"; - os << "{" << "\n"; + os << "{" + << "\n"; if (decls.size() > 0) - print_seq(os, decls, " ", "\n ", "\n"); - print_seq(os, blocks, "\n"); - os << "\n" << "}"; + print_seq(os, decls, " ", "\n ", "\n"); + print_seq(os, blocks, "\n"); + os << "\n" + << "}"; } } -void CodeDecl::print(std::ostream& os) const { - os << code; -} +void CodeDecl::print(std::ostream &os) const { os << code; } -void Block::print(std::ostream& os) const { +void Block::print(std::ostream &os) const { if (name != "") - os << name << ":" << "\n"; - print_seq(os, stmts, " ", "\n ", ""); + os << name << ":" + << "\n"; + print_seq(os, stmts, " ", "\n ", ""); } -void Program::print(std::ostream& os) const { +void Program::print(std::ostream &os) const { os << prelude; - print_seq(os, decls, "\n"); + print_seq(os, decls, "\n"); os << "\n"; } } diff --git a/lib/smack/BplFilePrinter.cpp b/lib/smack/BplFilePrinter.cpp index 96b3bfe3d..414e16f6e 100644 --- a/lib/smack/BplFilePrinter.cpp +++ b/lib/smack/BplFilePrinter.cpp @@ -14,14 +14,14 @@ using llvm::errs; char BplFilePrinter::ID = 0; -void BplFilePrinter::getAnalysisUsage(llvm::AnalysisUsage& AU) const { +void BplFilePrinter::getAnalysisUsage(llvm::AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired(); } -bool BplFilePrinter::runOnModule(llvm::Module& m) { - SmackModuleGenerator& smackGenerator = getAnalysis(); - Program* program = smackGenerator.getProgram(); +bool BplFilePrinter::runOnModule(llvm::Module &m) { + SmackModuleGenerator &smackGenerator = getAnalysis(); + Program *program = smackGenerator.getProgram(); std::ostringstream s; program->print(s); out << s.str(); diff --git a/lib/smack/BplPrinter.cpp b/lib/smack/BplPrinter.cpp index 41e8d377c..2e1baf5c1 100644 --- a/lib/smack/BplPrinter.cpp +++ b/lib/smack/BplPrinter.cpp @@ -15,14 +15,14 @@ using llvm::errs; llvm::RegisterPass Y("bpl_print", "BoogiePL printer pass"); char BplPrinter::ID = 0; -void BplPrinter::getAnalysisUsage(llvm::AnalysisUsage& AU) const { +void BplPrinter::getAnalysisUsage(llvm::AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired(); } -bool BplPrinter::runOnModule(llvm::Module& m) { - SmackModuleGenerator& smackGenerator = getAnalysis(); - Program* program = smackGenerator.getProgram(); +bool BplPrinter::runOnModule(llvm::Module &m) { + SmackModuleGenerator &smackGenerator = getAnalysis(); + Program *program = smackGenerator.getProgram(); std::ostringstream s; program->print(s); DEBUG_WITH_TYPE("bpl", errs() << "" << s.str()); diff --git a/lib/smack/CodifyStaticInits.cpp b/lib/smack/CodifyStaticInits.cpp index ead8c9113..5c92b330f 100644 --- a/lib/smack/CodifyStaticInits.cpp +++ b/lib/smack/CodifyStaticInits.cpp @@ -6,13 +6,13 @@ #include "smack/CodifyStaticInits.h" #include "smack/DSAWrapper.h" +#include "smack/Debug.h" #include "smack/Naming.h" #include "smack/SmackOptions.h" +#include "llvm/IR/DataLayout.h" #include "llvm/IR/IRBuilder.h" -#include "smack/Debug.h" -#include "llvm/Support/raw_ostream.h" #include "llvm/Support/Regex.h" -#include "llvm/IR/DataLayout.h" +#include "llvm/Support/raw_ostream.h" #include #include @@ -23,19 +23,18 @@ namespace smack { using namespace llvm; -bool CodifyStaticInits::runOnModule(Module& M) { +bool CodifyStaticInits::runOnModule(Module &M) { TD = &M.getDataLayout(); - LLVMContext& C = M.getContext(); - DSAWrapper* DSA = &getAnalysis(); + LLVMContext &C = M.getContext(); + DSAWrapper *DSA = &getAnalysis(); - Function* F = dyn_cast( - M.getOrInsertFunction(Naming::STATIC_INIT_PROC, - Type::getVoidTy(C), NULL)); + Function *F = dyn_cast(M.getOrInsertFunction( + Naming::STATIC_INIT_PROC, Type::getVoidTy(C), NULL)); - BasicBlock* B = BasicBlock::Create(C, "entry", F); + BasicBlock *B = BasicBlock::Create(C, "entry", F); IRBuilder<> IRB(B); - std::deque< std::tuple< Constant*, Constant*, std::vector > > worklist; + std::deque>> worklist; for (auto &G : M.globals()) if (G.hasInitializer()) @@ -48,47 +47,42 @@ bool CodifyStaticInits::runOnModule(Module& M) { // intended property of being read. if (DSA->isRead(&G) || !G.hasGlobalUnnamedAddr()) - worklist.push_back(std::make_tuple( - G.getInitializer(), &G, std::vector())); + worklist.push_back( + std::make_tuple(G.getInitializer(), &G, std::vector())); while (worklist.size()) { - Constant* V = std::get<0>(worklist.front()); - Constant* P = std::get<1>(worklist.front()); - std::vector I = std::get<2>(worklist.front()); + Constant *V = std::get<0>(worklist.front()); + Constant *P = std::get<1>(worklist.front()); + std::vector I = std::get<2>(worklist.front()); worklist.pop_front(); - if (V->getType()->isIntegerTy() || - V->getType()->isPointerTy() || - V->getType()->isFloatingPointTy() || - V->getType()->isVectorTy()) + if (V->getType()->isIntegerTy() || V->getType()->isPointerTy() || + V->getType()->isFloatingPointTy() || V->getType()->isVectorTy()) - IRB.CreateStore(V, IRB.CreateGEP(P, ArrayRef(I))); + IRB.CreateStore(V, IRB.CreateGEP(P, ArrayRef(I))); - else if (ArrayType* AT = dyn_cast(V->getType())) - for (unsigned i = AT->getNumElements(); i-- > 0; ) { + else if (ArrayType *AT = dyn_cast(V->getType())) + for (unsigned i = AT->getNumElements(); i-- > 0;) { auto A = V->getAggregateElement(i); - std::vector idxs(I); + std::vector idxs(I); if (idxs.empty()) - idxs.push_back(ConstantInt::get(Type::getInt32Ty(C),0)); - idxs.push_back(ConstantInt::get(Type::getInt64Ty(C),i)); - worklist.push_front(std::make_tuple(A, P, std::vector(idxs))); + idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 0)); + idxs.push_back(ConstantInt::get(Type::getInt64Ty(C), i)); + worklist.push_front(std::make_tuple(A, P, std::vector(idxs))); } - else if (StructType* ST = dyn_cast(V->getType())) - for (unsigned i = ST->getNumElements(); i-- > 0; ) { + else if (StructType *ST = dyn_cast(V->getType())) + for (unsigned i = ST->getNumElements(); i-- > 0;) { auto A = V->getAggregateElement(i); - std::vector idxs(I); + std::vector idxs(I); if (idxs.empty()) - idxs.push_back(ConstantInt::get(Type::getInt32Ty(C),0)); - idxs.push_back(ConstantInt::get(Type::getInt32Ty(C),i)); - worklist.push_front(std::make_tuple(A, P, std::vector(idxs))); + idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 0)); + idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), i)); + worklist.push_front(std::make_tuple(A, P, std::vector(idxs))); } - else if (V->getType()->isX86_FP80Ty()) - errs() << "warning: ignored X86 FP80 initializer" << "\n"; - else - assert (false && "Unexpected static initializer."); + assert(false && "Unexpected static initializer."); } IRB.CreateRetVoid(); @@ -105,7 +99,6 @@ void CodifyStaticInits::getAnalysisUsage(llvm::AnalysisUsage &AU) const { char CodifyStaticInits::ID = 0; // Register the pass -static RegisterPass -X("codify-static-inits", "Codify Static Initializers"); - +static RegisterPass X("codify-static-inits", + "Codify Static Initializers"); } diff --git a/lib/smack/Contracts.cpp b/lib/smack/Contracts.cpp index d8aa53c3d..6c8d850e3 100644 --- a/lib/smack/Contracts.cpp +++ b/lib/smack/Contracts.cpp @@ -3,8 +3,8 @@ // #include "smack/Contracts.h" -#include "llvm/IR/InstIterator.h" #include "llvm/Analysis/CFG.h" +#include "llvm/IR/InstIterator.h" using namespace llvm; @@ -12,74 +12,75 @@ namespace smack { unsigned ContractsExtractor::uniqueSliceId = 0; -Slice* ContractsExtractor::extractSlice(Value* V) { - Instruction* I = dyn_cast(V); +Slice *ContractsExtractor::extractSlice(Value *V) { + Instruction *I = dyn_cast(V); assert(I && "Expected instruction."); stringstream name; name << "$expr" << uniqueSliceId++; - Slice* S = new Slice(*I, slices, name.str()); - if (Decl* D = (Decl*) S->getBoogieDecl(naming,rep)) + Slice *S = new Slice(*I, slices, name.str()); + if (Decl *D = (Decl *)S->getBoogieDecl(naming, rep)) rep.getProgram().addDecl(D); S->remove(); return S; } -typedef SmallVector< pair, 10 > EdgeList; +typedef SmallVector, 10> EdgeList; -bool looksLikeLoopHead(BasicBlock* B) { +bool looksLikeLoopHead(BasicBlock *B) { EdgeList backedges; FindFunctionBackedges(*B->getParent(), backedges); for (pred_iterator A = pred_begin(B), Z = pred_end(B); A != Z; ++A) - for (EdgeList::iterator E = backedges.begin(), End = backedges.end(); E != End; ++E) + for (EdgeList::iterator E = backedges.begin(), End = backedges.end(); + E != End; ++E) if (E->first == *A && E->second == B) return true; return false; } -void ContractsExtractor::visitCallInst(CallInst& ci) { - Function* f = ci.getCalledFunction(); +void ContractsExtractor::visitCallInst(CallInst &ci) { + Function *f = ci.getCalledFunction(); string name = f && f->hasName() ? f->getName().str() : ""; if (name == "forall") { assert(ci.getNumArgOperands() == 2 && "Unexpected operands to forall."); - Value* arg = ci.getArgOperand(1); - ci.setArgOperand(1,sliceIdx(ci.getContext())); + Value *arg = ci.getArgOperand(1); + ci.setArgOperand(1, sliceIdx(ci.getContext())); slices.push_back(extractSlice(arg)); } else if (name == "exists") { assert(ci.getNumArgOperands() == 2 && "Unexpected operands to exists."); - Value* arg = ci.getArgOperand(1); - ci.setArgOperand(1,sliceIdx(ci.getContext())); + Value *arg = ci.getArgOperand(1); + ci.setArgOperand(1, sliceIdx(ci.getContext())); slices.push_back(extractSlice(arg)); } else if (name == "requires") { assert(ci.getNumArgOperands() == 1 && "Unexpected operands to requires."); - Value* V = ci.getArgOperand(0); - ci.setArgOperand(0,ConstantInt::getTrue(ci.getContext())); - proc.addRequires(extractSlice(V)->getBoogieExpression(naming,rep)); + Value *V = ci.getArgOperand(0); + ci.setArgOperand(0, ConstantInt::getTrue(ci.getContext())); + proc.addRequires(extractSlice(V)->getBoogieExpression(naming, rep)); ci.eraseFromParent(); } else if (name == "ensures") { assert(ci.getNumArgOperands() == 1 && "Unexpected operands to ensures."); - Value* V = ci.getArgOperand(0); - ci.setArgOperand(0,ConstantInt::getTrue(ci.getContext())); - proc.addEnsures(extractSlice(V)->getBoogieExpression(naming,rep)); + Value *V = ci.getArgOperand(0); + ci.setArgOperand(0, ConstantInt::getTrue(ci.getContext())); + proc.addEnsures(extractSlice(V)->getBoogieExpression(naming, rep)); ci.eraseFromParent(); } else if (name == "invariant") { assert(ci.getNumArgOperands() == 1 && "Unexpected operands to invariant."); - BasicBlock* body = ci.getParent(); - BasicBlock* head = body; + BasicBlock *body = ci.getParent(); + BasicBlock *head = body; do { pred_iterator P = pred_begin(head); assert(P != pred_end(head) && "Expected predecessors!"); head = *P; } while (!looksLikeLoopHead(head)); - Value* V = ci.getArgOperand(0); - ci.setArgOperand(0,sliceIdx(ci.getContext())); + Value *V = ci.getArgOperand(0); + ci.setArgOperand(0, sliceIdx(ci.getContext())); slices.push_back(extractSlice(V)); ci.removeFromParent(); @@ -87,9 +88,9 @@ void ContractsExtractor::visitCallInst(CallInst& ci) { // head block to be loop invariants. Therefore we push this instruction to // the front -- just after any Phi nodes. BasicBlock::iterator I = head->begin(); - while (isa(I)) ++I; - head->getInstList().insert(I,&ci); + while (isa(I)) + ++I; + head->getInstList().insert(I, &ci); } } - } diff --git a/lib/smack/DSAWrapper.cpp b/lib/smack/DSAWrapper.cpp index ac599c588..a419fb8bf 100644 --- a/lib/smack/DSAWrapper.cpp +++ b/lib/smack/DSAWrapper.cpp @@ -5,9 +5,9 @@ // the University of Illinois Open Source License. See LICENSE for details. // #include "smack/DSAWrapper.h" -#include "dsa/DataStructure.h" #include "assistDS/DSNodeEquivs.h" #include "dsa/DSGraph.h" +#include "dsa/DataStructure.h" #include "dsa/TypeSafety.h" #include "llvm/Support/FileSystem.h" @@ -18,25 +18,28 @@ namespace smack { using namespace llvm; char DSAWrapper::ID; -RegisterPass DSAWrapperPass("dsa-wrapper", - "SMACK Data Structure Graph Based Alias Analysis Wrapper"); - -void MemcpyCollector::visitMemCpyInst(llvm::MemCpyInst& mci) { - const llvm::EquivalenceClasses &eqs - = nodeEqs->getEquivalenceClasses(); - const llvm::DSNode *n1 = eqs.getLeaderValue( - nodeEqs->getMemberForValue(mci.getOperand(0)) ); - const llvm::DSNode *n2 = eqs.getLeaderValue( - nodeEqs->getMemberForValue(mci.getOperand(1)) ); +RegisterPass + DSAWrapperPass("dsa-wrapper", + "SMACK Data Structure Graph Based Alias Analysis Wrapper"); + +void MemcpyCollector::visitMemCpyInst(llvm::MemCpyInst &mci) { + const llvm::EquivalenceClasses &eqs = + nodeEqs->getEquivalenceClasses(); + const llvm::DSNode *n1 = + eqs.getLeaderValue(nodeEqs->getMemberForValue(mci.getOperand(0))); + const llvm::DSNode *n2 = + eqs.getLeaderValue(nodeEqs->getMemberForValue(mci.getOperand(1))); bool f1 = false, f2 = false; - for (unsigned i=0; i(); AU.addRequiredTransitive(); AU.addRequiredTransitive(); - AU.addRequired >(); + AU.addRequired>(); } bool DSAWrapper::runOnModule(llvm::Module &M) { @@ -52,21 +55,21 @@ bool DSAWrapper::runOnModule(llvm::Module &M) { TD = &getAnalysis(); BU = &getAnalysis(); nodeEqs = &getAnalysis(); - TS = &getAnalysis >(); + TS = &getAnalysis>(); memcpys = collectMemcpys(M, new MemcpyCollector(nodeEqs)); staticInits = collectStaticInits(M); module = &M; return false; } -std::vector DSAWrapper::collectMemcpys( - llvm::Module &M, MemcpyCollector *mcc) { +std::vector +DSAWrapper::collectMemcpys(llvm::Module &M, MemcpyCollector *mcc) { - for (llvm::Module::iterator func = M.begin(), e = M.end(); - func != e; ++func) { + for (llvm::Module::iterator func = M.begin(), e = M.end(); func != e; + ++func) { - for (llvm::Function::iterator block = func->begin(); - block != func->end(); ++block) { + for (llvm::Function::iterator block = func->begin(); block != func->end(); + ++block) { mcc->visit(*block); } @@ -74,8 +77,9 @@ std::vector DSAWrapper::collectMemcpys( return mcc->getMemcpys(); } -std::vector DSAWrapper::collectStaticInits(llvm::Module &M) { - std::vector sis; +std::vector +DSAWrapper::collectStaticInits(llvm::Module &M) { + std::vector sis; for (GlobalVariable &GV : M.globals()) { if (GV.hasInitializer()) { if (auto *N = getNode(&GV)) { @@ -104,57 +108,58 @@ DSGraph *DSAWrapper::getGraphForValue(const Value *V) { llvm_unreachable("Unexpected value."); } -int DSAWrapper::getOffset(const MemoryLocation* l) { - const DSGraph::ScalarMapTy& S = getGraphForValue(l->Ptr)->getScalarMap(); - DSGraph::ScalarMapTy::const_iterator I = S.find((const Value*)l->Ptr); +int DSAWrapper::getOffset(const MemoryLocation *l) { + const DSGraph::ScalarMapTy &S = getGraphForValue(l->Ptr)->getScalarMap(); + DSGraph::ScalarMapTy::const_iterator I = S.find((const Value *)l->Ptr); if (I == S.end()) return 0; if (I->second.getNode() && I->second.getNode()->isCollapsedNode()) return -1; unsigned offset = I->second.getOffset(); assert(offset <= INT_MAX && "Cannot handle large offsets"); - return (int) offset; + return (int)offset; } -bool DSAWrapper::isMemcpyd(const llvm::DSNode* n) { - const llvm::EquivalenceClasses &eqs - = nodeEqs->getEquivalenceClasses(); - const llvm::DSNode* nn = eqs.getLeaderValue(n); - for (unsigned i=0; i &eqs = + nodeEqs->getEquivalenceClasses(); + const llvm::DSNode *nn = eqs.getLeaderValue(n); + for (unsigned i = 0; i < memcpys.size(); i++) if (memcpys[i] == nn) return true; return false; } -bool DSAWrapper::isStaticInitd(const llvm::DSNode* n) { - const llvm::EquivalenceClasses &eqs - = nodeEqs->getEquivalenceClasses(); - const llvm::DSNode* nn = eqs.getLeaderValue(n); - for (unsigned i=0; i &eqs = + nodeEqs->getEquivalenceClasses(); + const llvm::DSNode *nn = eqs.getLeaderValue(n); + for (unsigned i = 0; i < staticInits.size(); i++) if (staticInits[i] == nn) return true; return false; } -bool DSAWrapper::isFieldDisjoint(const llvm::Value* V, const llvm::Function* F) { +bool DSAWrapper::isFieldDisjoint(const llvm::Value *V, + const llvm::Function *F) { return TS->isFieldDisjoint(V, F); } -bool DSAWrapper::isFieldDisjoint(const GlobalValue* V, unsigned offset) { +bool DSAWrapper::isFieldDisjoint(const GlobalValue *V, unsigned offset) { return TS->isFieldDisjoint(V, offset); } -bool DSAWrapper::isRead(const Value* V) { +bool DSAWrapper::isRead(const Value *V) { const DSNode *N = getNode(V); return N && (N->isReadNode()); } -bool DSAWrapper::isAlloced(const Value* v) { +bool DSAWrapper::isAlloced(const Value *v) { const DSNode *N = getNode(v); return N && (N->isHeapNode() || N->isAllocaNode()); } -bool DSAWrapper::isExternal(const Value* v) { +bool DSAWrapper::isExternal(const Value *v) { const DSNode *N = getNode(v); return N && N->isExternalNode(); } @@ -166,22 +171,29 @@ bool DSAWrapper::isSingletonGlobal(const Value *V) { // Ensure this node has a unique scalar type... (?) DSNode::const_type_iterator TSi = N->type_begin(); - if (TSi == N->type_end()) return false; - svset::const_iterator Ti = TSi->second->begin(); - if (Ti == TSi->second->end()) return false; - const Type* T = *Ti; - while (T->isPointerTy()) T = T->getPointerElementType(); - if (!T->isSingleValueType()) return false; + if (TSi == N->type_end()) + return false; + svset::const_iterator Ti = TSi->second->begin(); + if (Ti == TSi->second->end()) + return false; + const Type *T = *Ti; + while (T->isPointerTy()) + T = T->getPointerElementType(); + if (!T->isSingleValueType()) + return false; ++Ti; - if (Ti != TSi->second->end()) return false; + if (Ti != TSi->second->end()) + return false; ++TSi; - if (TSi != N->type_end()) return false; + if (TSi != N->type_end()) + return false; // Ensure this node is in its own class... (?) - const EquivalenceClasses &Cs = nodeEqs->getEquivalenceClasses(); - EquivalenceClasses::iterator C = Cs.findValue(N); + const EquivalenceClasses &Cs = + nodeEqs->getEquivalenceClasses(); + EquivalenceClasses::iterator C = Cs.findValue(N); assert(C != Cs.end() && "Did not find value."); - EquivalenceClasses::member_iterator I = Cs.member_begin(C); + EquivalenceClasses::member_iterator I = Cs.member_begin(C); if (I == Cs.member_end()) return false; ++I; @@ -191,9 +203,9 @@ bool DSAWrapper::isSingletonGlobal(const Value *V) { return true; } -unsigned DSAWrapper::getPointedTypeSize(const Value* v) { - if (llvm::PointerType* t = llvm::dyn_cast(v->getType())) { - llvm::Type* pointedType = t->getTypeAtIndex(0u); +unsigned DSAWrapper::getPointedTypeSize(const Value *v) { + if (llvm::PointerType *t = llvm::dyn_cast(v->getType())) { + llvm::Type *pointedType = t->getElementType(); if (pointedType->isSized()) return dataLayout->getTypeStoreSize(pointedType); else @@ -202,19 +214,19 @@ unsigned DSAWrapper::getPointedTypeSize(const Value* v) { llvm_unreachable("Type should be pointer."); } -int DSAWrapper::getOffset(const Value* v) { +int DSAWrapper::getOffset(const Value *v) { return getOffset(new MemoryLocation(v)); } // TODO: Should this return the node or its leader? -const DSNode *DSAWrapper::getNode(const Value* v) { - const llvm::EquivalenceClasses &eqs - = nodeEqs->getEquivalenceClasses(); +const DSNode *DSAWrapper::getNode(const Value *v) { + const llvm::EquivalenceClasses &eqs = + nodeEqs->getEquivalenceClasses(); auto *N = nodeEqs->getMemberForValue(v); return N ? eqs.getLeaderValue(N) : nullptr; } -void DSAWrapper::printDSAGraphs(const char* Filename) { +void DSAWrapper::printDSAGraphs(const char *Filename) { std::error_code EC; llvm::raw_fd_ostream F(Filename, EC, sys::fs::OpenFlags::F_None); TD->print(F, module); diff --git a/lib/smack/Debug.cpp b/lib/smack/Debug.cpp index 95f3818de..9b7668786 100644 --- a/lib/smack/Debug.cpp +++ b/lib/smack/Debug.cpp @@ -29,9 +29,7 @@ bool isCurrentDebugType(const char *DebugType) { void setCurrentDebugTypes(const char **Types, unsigned Count); -void setCurrentDebugType(const char *Type) { - setCurrentDebugTypes(&Type, 1); -} +void setCurrentDebugType(const char *Type) { setCurrentDebugTypes(&Type, 1); } void setCurrentDebugTypes(const char **Types, unsigned Count) { CurrentDebugType->clear(); @@ -42,9 +40,9 @@ void setCurrentDebugTypes(const char **Types, unsigned Count) { #ifndef NDEBUG -static ::llvm::cl::opt -Debug("debug", cl::desc("Enable debug output"), cl::Hidden, - cl::location(DebugFlag)); +static ::llvm::cl::opt Debug("debug", + cl::desc("Enable debug output"), + cl::Hidden, cl::location(DebugFlag)); namespace { @@ -53,28 +51,27 @@ struct DebugOnlyOpt { if (Val.empty()) return; DebugFlag = true; - SmallVector dbgTypes; + SmallVector dbgTypes; StringRef(Val).split(dbgTypes, ',', -1, false); for (auto dbgType : dbgTypes) CurrentDebugType->push_back(dbgType); } }; - } static DebugOnlyOpt DebugOnlyOptLoc; -static ::llvm::cl::opt > -DebugOnly("debug-only", cl::desc("Enable a specific type of debug output (comma separated list of types)"), - cl::Hidden, cl::ZeroOrMore, cl::value_desc("debug string"), - cl::location(DebugOnlyOptLoc), cl::ValueRequired); +static ::llvm::cl::opt> + DebugOnly("debug-only", cl::desc("Enable a specific type of debug output " + "(comma separated list of types)"), + cl::Hidden, cl::ZeroOrMore, cl::value_desc("debug string"), + cl::location(DebugOnlyOptLoc), cl::ValueRequired); raw_ostream &smack::dbgs() { static struct dbgstream { circular_raw_ostream strm; - dbgstream() : - strm(errs(), "*** Debug Log Output ***\n", 0) { } + dbgstream() : strm(errs(), "*** Debug Log Output ***\n", 0) {} } thestrm; return thestrm.strm; @@ -82,9 +79,7 @@ raw_ostream &smack::dbgs() { #else namespace smack { - raw_ostream &dbgs() { - return llvm::errs(); - } +raw_ostream &dbgs() { return llvm::errs(); } } #endif diff --git a/lib/smack/ExtractContracts.cpp b/lib/smack/ExtractContracts.cpp index ebf3b009f..39f34dd10 100644 --- a/lib/smack/ExtractContracts.cpp +++ b/lib/smack/ExtractContracts.cpp @@ -4,21 +4,21 @@ #define DEBUG_TYPE "contracts" -#include "smack/SmackOptions.h" -#include "smack/Naming.h" #include "smack/ExtractContracts.h" +#include "smack/Debug.h" +#include "smack/Naming.h" +#include "smack/SmackOptions.h" +#include "llvm/Analysis/LoopInfo.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/Dominators.h" -#include "llvm/Analysis/LoopInfo.h" -#include "llvm/Transforms/Utils/CodeExtractor.h" -#include "llvm/Transforms/Utils/Cloning.h" #include "llvm/IR/IRBuilder.h" -#include "smack/Debug.h" +#include "llvm/Transforms/Utils/Cloning.h" +#include "llvm/Transforms/Utils/CodeExtractor.h" -#include -#include #include #include +#include +#include namespace smack { @@ -26,193 +26,191 @@ using namespace llvm; namespace { - bool isContractFunction(Function *F) { - auto name = F->getName(); - return name == Naming::CONTRACT_REQUIRES - || name == Naming::CONTRACT_ENSURES - || name == Naming::CONTRACT_INVARIANT; - } +bool isContractFunction(Function *F) { + auto name = F->getName(); + return name == Naming::CONTRACT_REQUIRES || + name == Naming::CONTRACT_ENSURES || name == Naming::CONTRACT_INVARIANT; +} - typedef std::vector BlockList; - typedef std::map LoopMap; - - // Return the list of blocks which dominate the given blocks in the given - // function. - // NOTE this procedure assumes blocks are ordered in dominated order, both - // in the given selection of blocks, as well as in the given function. - BlockList blockPrefix(BlockList BBs, Function &F) { - BlockList prefix; - if (!BBs.empty()) { - for (auto &BB : F) { - prefix.push_back(&BB); - if (&BB == BBs.back()) - break; - } +typedef std::vector BlockList; +typedef std::map LoopMap; + +// Return the list of blocks which dominate the given blocks in the given +// function. +// NOTE this procedure assumes blocks are ordered in dominated order, both +// in the given selection of blocks, as well as in the given function. +BlockList blockPrefix(BlockList BBs, Function &F) { + BlockList prefix; + if (!BBs.empty()) { + for (auto &BB : F) { + prefix.push_back(&BB); + if (&BB == BBs.back()) + break; } - return prefix; } + return prefix; +} - // Return the list of blocks which dominate the given blocks in the given - // loop, not including the loop head. - // NOTE this procedure assumes blocks are ordered in dominated order, both - // in the given selection of blocks, as well as in the given loop. - BlockList blockPrefix(BlockList BBs, const Loop &L) { - BlockList prefix; - if (!BBs.empty()) { - for (auto BB : L.getBlocks()) { - if (BB == L.getHeader()) - continue; - prefix.push_back(BB); - if (BB == BBs.back()) - break; - } +// Return the list of blocks which dominate the given blocks in the given +// loop, not including the loop head. +// NOTE this procedure assumes blocks are ordered in dominated order, both +// in the given selection of blocks, as well as in the given loop. +BlockList blockPrefix(BlockList BBs, const Loop &L) { + BlockList prefix; + if (!BBs.empty()) { + for (auto BB : L.getBlocks()) { + if (BB == L.getHeader()) + continue; + prefix.push_back(BB); + if (BB == BBs.back()) + break; } - return prefix; } + return prefix; +} - // Split the basic blocks of the given function such that each invocation to - // contract functions is the last non-terminator instruction in its block. - std::tuple splitContractBlocks(Function &F, LoopInfo &LI) { - - BlockList contractBlocks; - LoopMap invariantBlocks; - - std::deque blocks; - for (auto &BB : F) - blocks.push_back(&BB); - - while (!blocks.empty()) { - auto BB = blocks.front(); - blocks.pop_front(); - - for (auto &I : *BB) { - if (auto CI = dyn_cast(&I)) { - if (auto *CF = CI->getCalledFunction()) { - if (isContractFunction(CF)) { - DEBUG(errs() << "splitting block at contract invocation: " << *CI << "\n"); - BasicBlock *B = CI->getParent(); - auto NewBB = B->splitBasicBlock(++CI->getIterator()); - LI.getLoopFor(B)->addBasicBlockToLoop(NewBB, LI); - blocks.push_front(NewBB); - - if (auto L = LI[B]) - invariantBlocks[L].push_back(B); - else - contractBlocks.push_back(B); - - break; - } +// Split the basic blocks of the given function such that each invocation to +// contract functions is the last non-terminator instruction in its block. +std::tuple splitContractBlocks(Function &F, LoopInfo &LI) { + + BlockList contractBlocks; + LoopMap invariantBlocks; + + std::deque blocks; + for (auto &BB : F) + blocks.push_back(&BB); + + while (!blocks.empty()) { + auto BB = blocks.front(); + blocks.pop_front(); + + for (auto &I : *BB) { + if (auto CI = dyn_cast(&I)) { + if (auto *CF = CI->getCalledFunction()) { + if (isContractFunction(CF)) { + SDEBUG(errs() << "splitting block at contract invocation: " << *CI + << "\n"); + BasicBlock *B = CI->getParent(); + auto NewBB = B->splitBasicBlock(++CI->getIterator()); + LI.getLoopFor(B)->addBasicBlockToLoop(NewBB, LI); + blocks.push_front(NewBB); + + if (auto L = LI[B]) + invariantBlocks[L].push_back(B); + else + contractBlocks.push_back(B); + + break; } } } } + } - contractBlocks = blockPrefix(contractBlocks, F); - - for (auto const& entry : invariantBlocks) { - auto L = entry.first; - auto BBs = entry.second; - invariantBlocks[L] = blockPrefix(BBs, *L); - } + contractBlocks = blockPrefix(contractBlocks, F); - return std::make_tuple( - contractBlocks, - invariantBlocks - ); + for (auto const &entry : invariantBlocks) { + auto L = entry.first; + auto BBs = entry.second; + invariantBlocks[L] = blockPrefix(BBs, *L); } - // Return the list of contract invocations in the given function. - std::vector getContractInvocations(Function &F) { - std::vector CIs; - for (auto &BB : F) - for (auto &I : BB) - if (auto CI = dyn_cast(&I)) - if (auto F = CI->getCalledFunction()) - if (isContractFunction(F)) - CIs.push_back(CI); - return CIs; - } + return std::make_tuple(contractBlocks, invariantBlocks); +} - // Replace the given invocation with a return of its argument; also remove - // all other contract invocations. - void setReturnToArgumentValue(Function *F, CallInst *II) { +// Return the list of contract invocations in the given function. +std::vector getContractInvocations(Function &F) { + std::vector CIs; + for (auto &BB : F) + for (auto &I : BB) + if (auto CI = dyn_cast(&I)) + if (auto F = CI->getCalledFunction()) + if (isContractFunction(F)) + CIs.push_back(CI); + return CIs; +} - for (auto &BB : *F) { +// Replace the given invocation with a return of its argument; also remove +// all other contract invocations. +void setReturnToArgumentValue(Function *F, CallInst *II) { - // Replace existing returns with return true. - if (auto RI = dyn_cast(BB.getTerminator())) { - IRBuilder<> Builder(RI); - Builder.CreateRet(ConstantInt::getTrue(F->getFunctionType()->getReturnType())); - RI->eraseFromParent(); - continue; - } + for (auto &BB : *F) { - // Erase contract invocations, and replace the given invocation - // with a return of its argument. - for (auto &I : BB) { - if (auto CI = dyn_cast(&I)) { - if (auto F = CI->getCalledFunction()) { - if (isContractFunction(F)) { - if (CI == II) { - IRBuilder<> Builder(CI); - BB.getTerminator()->eraseFromParent(); - Builder.CreateRet(CI->getArgOperand(0)); - } - CI->eraseFromParent(); - break; + // Replace existing returns with return true. + if (auto RI = dyn_cast(BB.getTerminator())) { + IRBuilder<> Builder(RI); + Builder.CreateRet( + ConstantInt::getTrue(F->getFunctionType()->getReturnType())); + RI->eraseFromParent(); + continue; + } + + // Erase contract invocations, and replace the given invocation + // with a return of its argument. + for (auto &I : BB) { + if (auto CI = dyn_cast(&I)) { + if (auto F = CI->getCalledFunction()) { + if (isContractFunction(F)) { + if (CI == II) { + IRBuilder<> Builder(CI); + BB.getTerminator()->eraseFromParent(); + Builder.CreateRet(CI->getArgOperand(0)); } + CI->eraseFromParent(); + break; } } } } } +} - // Return a copy of the given function in which the given invocation is - // replaced by a return of its argument value, and all contract - // invocations are removed. - Function *getContractExpr(Function *F, CallInst *I) { - ValueToValueMapTy VMap; - SmallVector Returns; - - FunctionType *FT = FunctionType::get( - I->getFunctionType()->getParamType(0), - F->getFunctionType()->params(), - F->getFunctionType()->isVarArg()); - - Function *NewF = Function::Create(FT, F->getLinkage(), Naming::CONTRACT_EXPR, F->getParent()); - - // Loop over the arguments, copying the names of the mapped arguments over... - // See implementation of llvm::CloneFunction - Function::arg_iterator DestA = NewF->arg_begin(); - for (auto &A : F->args()) { - DestA->setName(A.getName()); - VMap[&A] = &*DestA++; - } - CloneFunctionInto(NewF, F, VMap, false, Returns); - setReturnToArgumentValue(NewF, dyn_cast(VMap[I])); - return NewF; +// Return a copy of the given function in which the given invocation is +// replaced by a return of its argument value, and all contract +// invocations are removed. +Function *getContractExpr(Function *F, CallInst *I) { + ValueToValueMapTy VMap; + SmallVector Returns; + + FunctionType *FT = FunctionType::get(I->getFunctionType()->getParamType(0), + F->getFunctionType()->params(), + F->getFunctionType()->isVarArg()); + + Function *NewF = Function::Create(FT, F->getLinkage(), Naming::CONTRACT_EXPR, + F->getParent()); + + // Loop over the arguments, copying the names of the mapped arguments over... + // See implementation of llvm::CloneFunction + Function::arg_iterator DestA = NewF->arg_begin(); + for (auto &A : F->args()) { + DestA->setName(A.getName()); + VMap[&A] = &*DestA++; } + CloneFunctionInto(NewF, F, VMap, false, Returns); + setReturnToArgumentValue(NewF, dyn_cast(VMap[I])); + return NewF; +} - // Return copies of the given function in for each contract invocation, in - // which each returns the argument value of the corresponding contract - // invocation. The first function of each returned pair is the invoked - // contract function; the second function is the new function created for the - // given invocation. - std::vector> getContractExprs(Function &F) { - std::vector> Fs; - for (auto CI : getContractInvocations(F)) { - Function *newF = getContractExpr(&F, CI); - Fs.push_back(std::make_tuple(CI->getCalledFunction(), newF)); - } - return Fs; +// Return copies of the given function in for each contract invocation, in +// which each returns the argument value of the corresponding contract +// invocation. The first function of each returned pair is the invoked +// contract function; the second function is the new function created for the +// given invocation. +std::vector> getContractExprs(Function &F) { + std::vector> Fs; + for (auto CI : getContractInvocations(F)) { + Function *newF = getContractExpr(&F, CI); + Fs.push_back(std::make_tuple(CI->getCalledFunction(), newF)); } + return Fs; +} } bool ExtractContracts::runOnModule(Module &M) { bool modified = false; - std::vector Fs; - std::vector newFs; + std::vector Fs; + std::vector newFs; for (Function &F : M) if (!F.isDeclaration()) @@ -221,18 +219,19 @@ bool ExtractContracts::runOnModule(Module &M) { for (auto F : Fs) { BlockList contractBlocks; LoopMap invariantBlocks; - auto& LI = getAnalysis(*F).getLoopInfo(); + auto &LI = getAnalysis(*F).getLoopInfo(); std::tie(contractBlocks, invariantBlocks) = splitContractBlocks(*F, LI); if (!contractBlocks.empty() || !invariantBlocks.empty()) { - DEBUG(errs() << "function " << F->getName() << " after splitting: " << *F << "\n"); + SDEBUG(errs() << "function " << F->getName() << " after splitting: " << *F + << "\n"); modified = true; } if (!contractBlocks.empty()) { auto *newF = CodeExtractor(contractBlocks).extractCodeRegion(); - std::vector Is; + std::vector Is; for (auto V : newF->users()) if (auto I = dyn_cast(V)) Is.push_back(I); @@ -240,9 +239,10 @@ bool ExtractContracts::runOnModule(Module &M) { for (auto I : Is) { IRBuilder<> Builder(I); - // insert one contract invocation per invocation in the original function + // insert one contract invocation per invocation in the original + // function for (auto Fs : getContractExprs(*newF)) { - std::vector Args; + std::vector Args; for (auto &A : I->arg_operands()) Args.push_back(A); auto *E = Builder.CreateCall(std::get<1>(Fs), Args); @@ -252,14 +252,15 @@ bool ExtractContracts::runOnModule(Module &M) { I->eraseFromParent(); } newF->eraseFromParent(); - DEBUG(errs() << "function " << F->getName() << " after contract extraction: " << *F << "\n"); + SDEBUG(errs() << "function " << F->getName() + << " after contract extraction: " << *F << "\n"); } - for (auto const & entry : invariantBlocks) { + for (auto const &entry : invariantBlocks) { auto BBs = entry.second; auto *newF = CodeExtractor(BBs).extractCodeRegion(); - std::vector Is; + std::vector Is; for (auto V : newF->users()) if (auto I = dyn_cast(V)) Is.push_back(I); @@ -269,7 +270,7 @@ bool ExtractContracts::runOnModule(Module &M) { // insert one invariant invocation per invocation in the original loop for (auto Fs : getContractExprs(*newF)) { - std::vector Args; + std::vector Args; for (auto &A : I->arg_operands()) Args.push_back(A); auto *E = Builder.CreateCall(std::get<1>(Fs), Args); @@ -279,12 +280,13 @@ bool ExtractContracts::runOnModule(Module &M) { I->eraseFromParent(); } newF->eraseFromParent(); - DEBUG(errs() << "function " << F->getName() << " after invariant extraction: " << *F << "\n"); + SDEBUG(errs() << "function " << F->getName() + << " after invariant extraction: " << *F << "\n"); } } for (auto F : newFs) { - DEBUG(errs() << "added function:" << *F); + SDEBUG(errs() << "added function:" << *F); } return modified; @@ -299,7 +301,6 @@ void ExtractContracts::getAnalysisUsage(AnalysisUsage &AU) const { char ExtractContracts::ID = 0; // Register the pass -static RegisterPass -X("extract-contracts", "Extract Contracts"); - +static RegisterPass X("extract-contracts", + "Extract Contracts"); } diff --git a/lib/smack/IntegerOverflowChecker.cpp b/lib/smack/IntegerOverflowChecker.cpp index cd442c9ad..be6eaf7a8 100644 --- a/lib/smack/IntegerOverflowChecker.cpp +++ b/lib/smack/IntegerOverflowChecker.cpp @@ -9,17 +9,17 @@ #define DEBUG_TYPE "smack-overflow" #include "smack/IntegerOverflowChecker.h" +#include "smack/Debug.h" #include "smack/Naming.h" -#include "llvm/IR/Module.h" -#include "llvm/IR/InstIterator.h" +#include "smack/SmackOptions.h" +#include "llvm/ADT/APInt.h" #include "llvm/IR/Constants.h" -#include "smack/Debug.h" -#include "llvm/IR/ValueSymbolTable.h" #include "llvm/IR/IRBuilder.h" +#include "llvm/IR/InstIterator.h" +#include "llvm/IR/Module.h" +#include "llvm/IR/ValueSymbolTable.h" #include "llvm/Support/Regex.h" #include -#include "llvm/ADT/APInt.h" -#include "smack/SmackOptions.h" namespace smack { @@ -27,11 +27,10 @@ using namespace llvm; Regex OVERFLOW_INTRINSICS("^llvm.(u|s)(add|sub|mul).with.overflow.i([0-9]+)$"); -const std::map IntegerOverflowChecker::INSTRUCTION_TABLE { - {"add", Instruction::Add}, - {"sub", Instruction::Sub}, - {"mul", Instruction::Mul} -}; +const std::map + IntegerOverflowChecker::INSTRUCTION_TABLE{{"add", Instruction::Add}, + {"sub", Instruction::Sub}, + {"mul", Instruction::Mul}}; std::string IntegerOverflowChecker::getMax(unsigned bits, bool isSigned) { if (isSigned) @@ -51,12 +50,15 @@ std::string IntegerOverflowChecker::getMin(unsigned bits, bool isSigned) { * Optionally generates a double wide version of v for the purpose of detecting * overflow. */ -Value* IntegerOverflowChecker::extendBitWidth(Value* v, int bits, bool isSigned, Instruction* i) { +Value *IntegerOverflowChecker::extendBitWidth(Value *v, int bits, bool isSigned, + Instruction *i) { if (SmackOptions::IntegerOverflow) { if (isSigned) - return CastInst::CreateSExtOrBitCast(v, IntegerType::get(i->getFunction()->getContext(), bits*2), "", i); + return CastInst::CreateSExtOrBitCast( + v, IntegerType::get(i->getFunction()->getContext(), bits * 2), "", i); else - return CastInst::CreateZExtOrBitCast(v, IntegerType::get(i->getFunction()->getContext(), bits*2), "", i); + return CastInst::CreateZExtOrBitCast( + v, IntegerType::get(i->getFunction()->getContext(), bits * 2), "", i); } else return v; } @@ -65,17 +67,25 @@ Value* IntegerOverflowChecker::extendBitWidth(Value* v, int bits, bool isSigned, * Generates instructions to determine whether a Value v is is out of range for * its bit width and sign. */ -BinaryOperator* IntegerOverflowChecker::createFlag(Value* v, int bits, bool isSigned, Instruction* i) { +BinaryOperator *IntegerOverflowChecker::createFlag(Value *v, int bits, + bool isSigned, + Instruction *i) { if (SmackOptions::IntegerOverflow) { - ConstantInt* max = ConstantInt::get(IntegerType::get(i->getFunction()->getContext(), bits*2), getMax(bits, isSigned), 10); - ConstantInt* min = ConstantInt::get(IntegerType::get(i->getFunction()->getContext(), bits*2), getMin(bits, isSigned), 10); - CmpInst::Predicate maxCmpPred = (isSigned ? CmpInst::ICMP_SGT : CmpInst::ICMP_UGT); - CmpInst::Predicate minCmpPred = (isSigned ? CmpInst::ICMP_SLT : CmpInst::ICMP_ULT); - ICmpInst* gt = new ICmpInst(i, maxCmpPred, v, max, ""); - ICmpInst* lt = new ICmpInst(i, minCmpPred, v, min, ""); + ConstantInt *max = ConstantInt::get( + IntegerType::get(i->getFunction()->getContext(), bits * 2), + getMax(bits, isSigned), 10); + ConstantInt *min = ConstantInt::get( + IntegerType::get(i->getFunction()->getContext(), bits * 2), + getMin(bits, isSigned), 10); + CmpInst::Predicate maxCmpPred = + (isSigned ? CmpInst::ICMP_SGT : CmpInst::ICMP_UGT); + CmpInst::Predicate minCmpPred = + (isSigned ? CmpInst::ICMP_SLT : CmpInst::ICMP_ULT); + ICmpInst *gt = new ICmpInst(i, maxCmpPred, v, max, ""); + ICmpInst *lt = new ICmpInst(i, minCmpPred, v, min, ""); return BinaryOperator::Create(Instruction::Or, gt, lt, "", i); } else { - ConstantInt* a = ConstantInt::getFalse(i->getFunction()->getContext()); + ConstantInt *a = ConstantInt::getFalse(i->getFunction()->getContext()); return BinaryOperator::Create(Instruction::And, a, a, "", i); } } @@ -83,9 +93,11 @@ BinaryOperator* IntegerOverflowChecker::createFlag(Value* v, int bits, bool isSi /* * Create an instruction to cast v to bits size. */ -Value* IntegerOverflowChecker::createResult(Value* v, int bits, Instruction* i) { +Value *IntegerOverflowChecker::createResult(Value *v, int bits, + Instruction *i) { if (SmackOptions::IntegerOverflow) - return CastInst::CreateTruncOrBitCast(v, IntegerType::get(i->getFunction()->getContext(), bits), "", i); + return CastInst::CreateTruncOrBitCast( + v, IntegerType::get(i->getFunction()->getContext(), bits), "", i); else return v; } @@ -94,8 +106,10 @@ Value* IntegerOverflowChecker::createResult(Value* v, int bits, Instruction* i) * This adds a call instruction to __SMACK_check_overflow to determine if an * overflow occured as indicated by flag. */ -void IntegerOverflowChecker::addCheck(Function* co, Value* flag, Instruction* i) { - ArrayRef args(CastInst::CreateIntegerCast(flag, co->arg_begin()->getType(), false, "", i)); +void IntegerOverflowChecker::addCheck(Function *co, Value *flag, + Instruction *i) { + Value *args = CastInst::CreateIntegerCast(flag, co->arg_begin()->getType(), + false, "", i); CallInst::Create(co, args, "", i); } @@ -103,43 +117,50 @@ void IntegerOverflowChecker::addCheck(Function* co, Value* flag, Instruction* i) * This inserts a call to assume with flag negated to prevent the verifier * from exploring paths past a __SMACK_check_overflow */ -void IntegerOverflowChecker::addBlockingAssume(Function* va, Value* flag, Instruction* i) { - ArrayRef args(CastInst::CreateIntegerCast(BinaryOperator::CreateNot(flag, "", i), - va->arg_begin()->getType(), false, "", i)); +void IntegerOverflowChecker::addBlockingAssume(Function *va, Value *flag, + Instruction *i) { + Value *args = + CastInst::CreateIntegerCast(BinaryOperator::CreateNot(flag, "", i), + va->arg_begin()->getType(), false, "", i); CallInst::Create(va, args, "", i); } -bool IntegerOverflowChecker::runOnModule(Module& m) { - Function* co = m.getFunction("__SMACK_check_overflow"); +bool IntegerOverflowChecker::runOnModule(Module &m) { + Function *co = m.getFunction("__SMACK_check_overflow"); assert(co != NULL && "Function __SMACK_check_overflow should be present."); - Function* va = m.getFunction("__VERIFIER_assume"); + Function *va = m.getFunction("__VERIFIER_assume"); assert(va != NULL && "Function __VERIFIER_assume should be present."); - std::vector instToRemove; - for (auto& F : m) { + std::vector instToErase; + for (auto &F : m) { if (Naming::isSmackName(F.getName())) continue; for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) { - // Add check for UBSan left shift when needed + // Add check for UBSan left shift/signed division when needed if (SmackOptions::IntegerOverflow) { if (auto chkshft = dyn_cast(&*I)) { - Function* chkfn = chkshft->getCalledFunction(); + Function *chkfn = chkshft->getCalledFunction(); if (chkfn && chkfn->hasName() && - chkfn->getName().find("__ubsan_handle_shift_out_of_bounds") != std::string::npos) { - // If the call to __ubsan_handle_shift_out_of_bounds is reachable, + (chkfn->getName().find("__ubsan_handle_shift_out_of_bounds") != + std::string::npos || + chkfn->getName().find("__ubsan_handle_divrem_overflow") != + std::string::npos)) { + // If the call to __ubsan_handle_* is reachable, // then an overflow is possible. - ConstantInt* flag = ConstantInt::getTrue(chkshft->getFunction()->getContext()); + ConstantInt *flag = + ConstantInt::getTrue(chkshft->getFunction()->getContext()); addCheck(co, flag, &*I); addBlockingAssume(va, flag, &*I); I->replaceAllUsesWith(flag); - instToRemove.push_back(&*I); + instToErase.push_back(&*I); } } } if (auto ei = dyn_cast(&*I)) { if (auto ci = dyn_cast(ei->getAggregateOperand())) { - Function* f = ci->getCalledFunction(); + Function *f = ci->getCalledFunction(); SmallVector info; - if (f && f->hasName() && OVERFLOW_INTRINSICS.match(f->getName(), &info) && + if (f && f->hasName() && + OVERFLOW_INTRINSICS.match(f->getName(), &info) && ei->getIndices()[0] == 1) { /* * If ei is an ExtractValueInst whose value flows from an LLVM @@ -154,50 +175,43 @@ bool IntegerOverflowChecker::runOnModule(Module& m) { * - Finally, an assumption about the value of the flag is created * to block erroneous checking of paths after the overflow check. */ - DEBUG(errs() << "Processing intrinsic: " << f->getName().str() << "\n"); + SDEBUG(errs() << "Processing intrinsic: " << f->getName().str() + << "\n"); assert(info.size() == 4 && "Must capture three matched strings."); bool isSigned = (info[1] == "s"); std::string op = info[2]; int bits = std::stoi(info[3]); - Instruction* prev = &*std::prev(I); - Value* eo1 = extendBitWidth(ci->getArgOperand(0), bits, isSigned, &*I); - Value* eo2 = extendBitWidth(ci->getArgOperand(1), bits, isSigned, &*I); - DEBUG(errs() << "Processing operator: " << op << "\n"); - assert(INSTRUCTION_TABLE.count(op) != 0 && "Operator must be present in our instruction table."); - BinaryOperator* ai = BinaryOperator::Create(INSTRUCTION_TABLE.at(op), eo1, eo2, "", &*I); + Instruction *prev = &*std::prev(I); + Value *eo1 = + extendBitWidth(ci->getArgOperand(0), bits, isSigned, &*I); + Value *eo2 = + extendBitWidth(ci->getArgOperand(1), bits, isSigned, &*I); + SDEBUG(errs() << "Processing operator: " << op << "\n"); + assert(INSTRUCTION_TABLE.count(op) != 0 && + "Operator must be present in our instruction table."); + BinaryOperator *ai = BinaryOperator::Create( + INSTRUCTION_TABLE.at(op), eo1, eo2, "", &*I); if (auto pei = dyn_cast_or_null(prev)) { if (ci == dyn_cast(pei->getAggregateOperand())) { - Value* r = createResult(ai, bits, &*I); + Value *r = createResult(ai, bits, &*I); prev->replaceAllUsesWith(r); - instToRemove.push_back(prev); + instToErase.push_back(prev); } } - BinaryOperator* flag = createFlag(ai, bits, isSigned, &*I); + BinaryOperator *flag = createFlag(ai, bits, isSigned, &*I); if (SmackOptions::IntegerOverflow) addCheck(co, flag, &*I); addBlockingAssume(va, flag, &*I); I->replaceAllUsesWith(flag); - instToRemove.push_back(&*I); + instToErase.push_back(&*I); + instToErase.push_back(ci); } } } - if (auto sdi = dyn_cast(&*I)) { - if (sdi->getOpcode() == Instruction::SDiv && SmackOptions::IntegerOverflow) { - int bits = sdi->getType()->getIntegerBitWidth(); - Value* eo1 = extendBitWidth(sdi->getOperand(0), bits, true, &*I); - Value* eo2 = extendBitWidth(sdi->getOperand(1), bits, true, &*I); - BinaryOperator* lsdi = BinaryOperator::Create(Instruction::SDiv, eo1, eo2, "", &*I); - BinaryOperator* flag = createFlag(lsdi, bits, true, &*I); - addCheck(co, flag, &*I); - Value* r = createResult(lsdi, bits, &*I); - I->replaceAllUsesWith(r); - instToRemove.push_back(&*I); - } - } } } - for (auto I : instToRemove) { - I->removeFromParent(); + for (auto I : instToErase) { + I->eraseFromParent(); } return true; } @@ -205,7 +219,7 @@ bool IntegerOverflowChecker::runOnModule(Module& m) { // Pass ID variable char IntegerOverflowChecker::ID = 0; -const char* IntegerOverflowChecker::getPassName() const { +StringRef IntegerOverflowChecker::getPassName() const { return "Checked integer arithmetic intrinsics"; } } diff --git a/lib/smack/MemorySafetyChecker.cpp b/lib/smack/MemorySafetyChecker.cpp index b0f86299c..e37c39905 100644 --- a/lib/smack/MemorySafetyChecker.cpp +++ b/lib/smack/MemorySafetyChecker.cpp @@ -2,36 +2,36 @@ // This file is distributed under the MIT License. See LICENSE for details. // #include "smack/MemorySafetyChecker.h" +#include "smack/Debug.h" #include "smack/Naming.h" #include "smack/SmackOptions.h" -#include "llvm/IR/Module.h" -#include "llvm/IR/Instructions.h" -#include "llvm/IR/InstIterator.h" #include "llvm/IR/Constants.h" -#include "smack/Debug.h" -#include "llvm/IR/ValueSymbolTable.h" +#include "llvm/IR/InstIterator.h" +#include "llvm/IR/Instructions.h" #include "llvm/IR/IntrinsicInst.h" +#include "llvm/IR/Module.h" +#include "llvm/IR/ValueSymbolTable.h" namespace smack { using namespace llvm; -Function* MemorySafetyChecker::getLeakCheckFunction(Module& M) { +Function *MemorySafetyChecker::getLeakCheckFunction(Module &M) { if (!leakCheckFunction.count(&M)) { auto F = M.getFunction(Naming::MEMORY_LEAK_FUNCTION); - assert (F && "Memory leak check function must be present."); + assert(F && "Memory leak check function must be present."); leakCheckFunction[&M] = F; } return leakCheckFunction[&M]; } -Function* MemorySafetyChecker::getSafetyCheckFunction(Module& M) { +Function *MemorySafetyChecker::getSafetyCheckFunction(Module &M) { if (!safetyCheckFunction.count(&M)) { - auto& C = M.getContext(); + auto &C = M.getContext(); auto T = PointerType::getUnqual(Type::getInt8Ty(C)); auto F = dyn_cast(M.getOrInsertFunction( - Naming::MEMORY_SAFETY_FUNCTION, - FunctionType::get(Type::getVoidTy(C), {T, T}, false))); + Naming::MEMORY_SAFETY_FUNCTION, + FunctionType::get(Type::getVoidTy(C), {T, T}, false))); assert(F && "Memory safety function must be present."); F->addFnAttr(Attribute::AttrKind::ReadNone); F->addFnAttr(Attribute::AttrKind::NoUnwind); @@ -40,22 +40,23 @@ Function* MemorySafetyChecker::getSafetyCheckFunction(Module& M) { return safetyCheckFunction[&M]; } -void MemorySafetyChecker::insertMemoryLeakCheck(Instruction* I) { - auto& M = *I->getParent()->getParent()->getParent(); +void MemorySafetyChecker::insertMemoryLeakCheck(Instruction *I) { + auto &M = *I->getParent()->getParent()->getParent(); CallInst::Create(getLeakCheckFunction(M), "", I); } -void MemorySafetyChecker::insertMemoryAccessCheck(Value* addr, Value* size, Instruction* I) { - auto& M = *I->getParent()->getParent()->getParent(); - auto& C = M.getContext(); +void MemorySafetyChecker::insertMemoryAccessCheck(Value *addr, Value *size, + Instruction *I) { + auto &M = *I->getParent()->getParent()->getParent(); + auto &C = M.getContext(); auto T = PointerType::getUnqual(Type::getInt8Ty(C)); - CallInst::Create(getSafetyCheckFunction(M), { - CastInst::Create(Instruction::BitCast, addr, T, "", I), - CastInst::CreateBitOrPointerCast(size, T, "", I) - }, "", I); + CallInst::Create(getSafetyCheckFunction(M), + {CastInst::Create(Instruction::BitCast, addr, T, "", I), + CastInst::CreateBitOrPointerCast(size, T, "", I)}, + "", I); } -bool MemorySafetyChecker::runOnFunction(Function& F) { +bool MemorySafetyChecker::runOnFunction(Function &F) { if (Naming::isSmackName(F.getName())) return false; @@ -63,49 +64,49 @@ bool MemorySafetyChecker::runOnFunction(Function& F) { return true; } -void MemorySafetyChecker::visitReturnInst(llvm::ReturnInst& I) { - auto& F = *I.getParent()->getParent(); +void MemorySafetyChecker::visitReturnInst(llvm::ReturnInst &I) { + auto &F = *I.getParent()->getParent(); if (SmackOptions::isEntryPoint(F.getName())) insertMemoryLeakCheck(&I); } namespace { - Value* accessSizeAsPointer(Module& M, Value* V) { - auto T = dyn_cast(V->getType()); - assert(T && "expected pointer type"); +Value *accessSizeAsPointer(Module &M, Value *V) { + auto T = dyn_cast(V->getType()); + assert(T && "expected pointer type"); - return ConstantExpr::getIntToPtr( + return ConstantExpr::getIntToPtr( ConstantInt::get( - Type::getInt64Ty(M.getContext()), - M.getDataLayout().getTypeStoreSize(T->getPointerElementType())), + Type::getInt64Ty(M.getContext()), + M.getDataLayout().getTypeStoreSize(T->getPointerElementType())), PointerType::getUnqual(Type::getInt8Ty(M.getContext()))); - } +} - Value* accessSizeAsPointer(LoadInst& I) { - auto& M = *I.getParent()->getParent()->getParent(); - return accessSizeAsPointer(M, I.getPointerOperand()); - } +Value *accessSizeAsPointer(LoadInst &I) { + auto &M = *I.getParent()->getParent()->getParent(); + return accessSizeAsPointer(M, I.getPointerOperand()); +} - Value* accessSizeAsPointer(StoreInst& I) { - auto& M = *I.getParent()->getParent()->getParent(); - return accessSizeAsPointer(M, I.getPointerOperand()); - } +Value *accessSizeAsPointer(StoreInst &I) { + auto &M = *I.getParent()->getParent()->getParent(); + return accessSizeAsPointer(M, I.getPointerOperand()); +} } -void MemorySafetyChecker::visitLoadInst(LoadInst& I) { +void MemorySafetyChecker::visitLoadInst(LoadInst &I) { insertMemoryAccessCheck(I.getPointerOperand(), accessSizeAsPointer(I), &I); } -void MemorySafetyChecker::visitStoreInst(StoreInst& I) { +void MemorySafetyChecker::visitStoreInst(StoreInst &I) { insertMemoryAccessCheck(I.getPointerOperand(), accessSizeAsPointer(I), &I); } -void MemorySafetyChecker::visitMemSetInst(MemSetInst& I) { +void MemorySafetyChecker::visitMemSetInst(MemSetInst &I) { insertMemoryAccessCheck(I.getDest(), I.getLength(), &I); } -void MemorySafetyChecker::visitMemTransferInst(MemTransferInst& I) { +void MemorySafetyChecker::visitMemTransferInst(MemTransferInst &I) { insertMemoryAccessCheck(I.getDest(), I.getLength(), &I); insertMemoryAccessCheck(I.getSource(), I.getLength(), &I); } diff --git a/lib/smack/Naming.cpp b/lib/smack/Naming.cpp index 657b49963..b999d7f26 100644 --- a/lib/smack/Naming.cpp +++ b/lib/smack/Naming.cpp @@ -3,10 +3,10 @@ // #include "smack/Naming.h" -#include "llvm/Support/GraphWriter.h" -#include "llvm/IR/Type.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Instructions.h" +#include "llvm/IR/Type.h" +#include "llvm/Support/GraphWriter.h" #include namespace smack { @@ -79,104 +79,81 @@ const std::string Naming::PTR_VAR = "$p"; const std::string Naming::GLOBAL_VAR = "$g"; const std::string Naming::UNDEF_SYM = "$u"; const std::string Naming::CONTRACT_EXPR = "$expr"; -const std::string Naming::MEMORY_SAFETY_FUNCTION = "__SMACK_check_memory_safety"; +const std::string Naming::MEMORY_SAFETY_FUNCTION = + "__SMACK_check_memory_safety"; const std::string Naming::MEMORY_LEAK_FUNCTION = "__SMACK_check_memory_leak"; using namespace llvm; -const std::map Naming::INSTRUCTION_TABLE { - {Instruction::Trunc, "$trunc"}, - {Instruction::ZExt, "$zext"}, - {Instruction::SExt, "$sext"}, - {Instruction::FPTrunc, "$fptrunc"}, - {Instruction::FPExt, "$fpext"}, - {Instruction::BitCast, "$bitcast"}, - {Instruction::FPToUI, "$fp2ui"}, - {Instruction::FPToSI, "$fp2si"}, - {Instruction::UIToFP, "$ui2fp"}, - {Instruction::SIToFP, "$si2fp"}, - {Instruction::PtrToInt, "$p2i"}, - {Instruction::IntToPtr, "$i2p"}, - {Instruction::Add, "$add"}, - {Instruction::Sub, "$sub"}, - {Instruction::Mul, "$mul"}, - {Instruction::SDiv, "$sdiv"}, - {Instruction::UDiv, "$udiv"}, - {Instruction::SRem, "$srem"}, - {Instruction::URem, "$urem"}, - {Instruction::And, "$and"}, - {Instruction::Or, "$or"}, - {Instruction::Xor, "$xor"}, - {Instruction::LShr, "$lshr"}, - {Instruction::AShr, "$ashr"}, - {Instruction::Shl, "$shl"}, - {Instruction::FAdd, "$fadd"}, - {Instruction::FSub, "$fsub"}, - {Instruction::FMul, "$fmul"}, - {Instruction::FDiv, "$fdiv"}, - {Instruction::FRem, "$frem"}, - {Instruction::ShuffleVector, "$shufflevector"}, - {Instruction::InsertElement, "$insertelement"}, - {Instruction::ExtractElement, "$extractelement"} -}; - -const std::map Naming::CMPINST_TABLE { - {CmpInst::ICMP_EQ, "$eq"}, - {CmpInst::ICMP_NE, "$ne"}, - {CmpInst::ICMP_SGE, "$sge"}, - {CmpInst::ICMP_UGE, "$uge"}, - {CmpInst::ICMP_SLE, "$sle"}, - {CmpInst::ICMP_ULE, "$ule"}, - {CmpInst::ICMP_SLT, "$slt"}, - {CmpInst::ICMP_ULT, "$ult"}, - {CmpInst::ICMP_SGT, "$sgt"}, - {CmpInst::ICMP_UGT, "$ugt"}, - {CmpInst::FCMP_FALSE, "$ffalse"}, - {CmpInst::FCMP_OEQ, "$foeq"}, - {CmpInst::FCMP_OGE, "$foge"}, - {CmpInst::FCMP_OGT, "$fogt"}, - {CmpInst::FCMP_OLE, "$fole"}, - {CmpInst::FCMP_OLT, "$folt"}, - {CmpInst::FCMP_ONE, "$fone"}, - {CmpInst::FCMP_ORD, "$ford"}, - {CmpInst::FCMP_TRUE, "$ftrue"}, - {CmpInst::FCMP_UEQ, "$fueq"}, - {CmpInst::FCMP_UGE, "$fuge"}, - {CmpInst::FCMP_UGT, "$fugt"}, - {CmpInst::FCMP_ULE, "$fule"}, - {CmpInst::FCMP_ULT, "$fult"}, - {CmpInst::FCMP_UNE, "$fune"}, - {CmpInst::FCMP_UNO, "$funo"} -}; - -const std::map Naming::ATOMICRMWINST_TABLE { - {AtomicRMWInst::Add, "$add"}, - {AtomicRMWInst::Sub, "$sub"}, - {AtomicRMWInst::And, "$and"}, - {AtomicRMWInst::Nand, "$nand"}, - {AtomicRMWInst::Or, "$or"}, - {AtomicRMWInst::Xor, "$xor"}, - {AtomicRMWInst::Max, "$smax"}, - {AtomicRMWInst::Min, "$smin"}, - {AtomicRMWInst::UMax, "$umax"}, - {AtomicRMWInst::UMin, "$umin"} -}; +const std::map Naming::INSTRUCTION_TABLE{ + {Instruction::Trunc, "$trunc"}, + {Instruction::ZExt, "$zext"}, + {Instruction::SExt, "$sext"}, + {Instruction::FPTrunc, "$fptrunc"}, + {Instruction::FPExt, "$fpext"}, + {Instruction::BitCast, "$bitcast"}, + {Instruction::FPToUI, "$fp2ui"}, + {Instruction::FPToSI, "$fp2si"}, + {Instruction::UIToFP, "$ui2fp"}, + {Instruction::SIToFP, "$si2fp"}, + {Instruction::PtrToInt, "$p2i"}, + {Instruction::IntToPtr, "$i2p"}, + {Instruction::Add, "$add"}, + {Instruction::Sub, "$sub"}, + {Instruction::Mul, "$mul"}, + {Instruction::SDiv, "$sdiv"}, + {Instruction::UDiv, "$udiv"}, + {Instruction::SRem, "$srem"}, + {Instruction::URem, "$urem"}, + {Instruction::And, "$and"}, + {Instruction::Or, "$or"}, + {Instruction::Xor, "$xor"}, + {Instruction::LShr, "$lshr"}, + {Instruction::AShr, "$ashr"}, + {Instruction::Shl, "$shl"}, + {Instruction::FAdd, "$fadd"}, + {Instruction::FSub, "$fsub"}, + {Instruction::FMul, "$fmul"}, + {Instruction::FDiv, "$fdiv"}, + {Instruction::FRem, "$frem"}, + {Instruction::ShuffleVector, "$shufflevector"}, + {Instruction::InsertElement, "$insertelement"}, + {Instruction::ExtractElement, "$extractelement"}}; + +const std::map Naming::CMPINST_TABLE{ + {CmpInst::ICMP_EQ, "$eq"}, {CmpInst::ICMP_NE, "$ne"}, + {CmpInst::ICMP_SGE, "$sge"}, {CmpInst::ICMP_UGE, "$uge"}, + {CmpInst::ICMP_SLE, "$sle"}, {CmpInst::ICMP_ULE, "$ule"}, + {CmpInst::ICMP_SLT, "$slt"}, {CmpInst::ICMP_ULT, "$ult"}, + {CmpInst::ICMP_SGT, "$sgt"}, {CmpInst::ICMP_UGT, "$ugt"}, + {CmpInst::FCMP_FALSE, "$ffalse"}, {CmpInst::FCMP_OEQ, "$foeq"}, + {CmpInst::FCMP_OGE, "$foge"}, {CmpInst::FCMP_OGT, "$fogt"}, + {CmpInst::FCMP_OLE, "$fole"}, {CmpInst::FCMP_OLT, "$folt"}, + {CmpInst::FCMP_ONE, "$fone"}, {CmpInst::FCMP_ORD, "$ford"}, + {CmpInst::FCMP_TRUE, "$ftrue"}, {CmpInst::FCMP_UEQ, "$fueq"}, + {CmpInst::FCMP_UGE, "$fuge"}, {CmpInst::FCMP_UGT, "$fugt"}, + {CmpInst::FCMP_ULE, "$fule"}, {CmpInst::FCMP_ULT, "$fult"}, + {CmpInst::FCMP_UNE, "$fune"}, {CmpInst::FCMP_UNO, "$funo"}}; + +const std::map Naming::ATOMICRMWINST_TABLE{ + {AtomicRMWInst::Add, "$add"}, {AtomicRMWInst::Sub, "$sub"}, + {AtomicRMWInst::And, "$and"}, {AtomicRMWInst::Nand, "$nand"}, + {AtomicRMWInst::Or, "$or"}, {AtomicRMWInst::Xor, "$xor"}, + {AtomicRMWInst::Max, "$smax"}, {AtomicRMWInst::Min, "$smin"}, + {AtomicRMWInst::UMax, "$umax"}, {AtomicRMWInst::UMin, "$umin"}}; Regex Naming::BPL_KW( - "^(bool|int|real|false|true|old|forall|exists|requires|modifies|ensures|invariant|free" - "|unique|finite|complete|type|const|function|axiom|var|procedure" - "|implementation|where|returns|assume|assert|havoc|call|return|while" - "|break|goto|if|then|else|div|mod|yield|par|async|lambda)$"); + "^(bool|int|real|false|true|old|forall|exists|requires|modifies|ensures|" + "invariant|free" + "|unique|finite|complete|type|const|function|axiom|var|procedure" + "|implementation|where|returns|assume|assert|havoc|call|return|while" + "|break|goto|if|then|else|div|mod|yield|par|async|lambda)$"); Regex Naming::SMACK_NAME(".*__SMACK_.*"); -bool Naming::isBplKeyword(std::string s) { - return BPL_KW.match(s); -} +bool Naming::isBplKeyword(std::string s) { return BPL_KW.match(s); } -bool Naming::isSmackName(std::string n) { - return SMACK_NAME.match(n); -} +bool Naming::isSmackName(std::string n) { return SMACK_NAME.match(n); } bool Naming::isSmackGeneratedName(std::string n) { return n.size() > 0 && n[0] == '$'; @@ -189,18 +166,26 @@ std::string Naming::escape(std::string s) { case '@': Str[i] = '.'; break; - case '\01': case '\\': - case ':': case ' ': - case '(': case ')': - case '[': case ']': - case '{': case '}': - case '<': case '>': - case '|': case '"': - case '-': case ';': + case '\01': + case '\\': + case ':': + case ' ': + case '(': + case ')': + case '[': + case ']': + case '{': + case '}': + case '<': + case '>': + case '|': + case '"': + case '-': + case ';': Str[i] = '_'; break; - // Another character to escape would be '$', but SMACK internally - // generates LLVM IR that uses this character. + // Another character to escape would be '$', but SMACK internally + // generates LLVM IR that uses this character. } return Str; } @@ -210,7 +195,7 @@ void Naming::reset() { varNum = 0; } -std::string Naming::get(const Value& V) { +std::string Naming::get(const Value &V) { if (names.count(&V)) return names[&V]; @@ -263,16 +248,17 @@ std::string Naming::freshUndefName() { return s.str(); } -std::string Naming::freshVarName(const Value& V) { +std::string Naming::freshVarName(const Value &V) { std::stringstream s; + const Type *type = V.getType(); - if (V.getType()->isFloatingPointTy()) + if (type->isFloatingPointTy()) s << FLOAT_VAR; - else if (V.getType()->isIntegerTy()) + else if (type->isIntegerTy()) s << INT_VAR; - else if (auto VT = dyn_cast(V.getType())) + else if (type->isVectorTy()) s << VECTOR_VAR; else @@ -281,5 +267,4 @@ std::string Naming::freshVarName(const Value& V) { s << varNum++; return s.str(); } - } diff --git a/lib/smack/NormalizeLoops.cpp b/lib/smack/NormalizeLoops.cpp index fbca98d92..156e39fe3 100644 --- a/lib/smack/NormalizeLoops.cpp +++ b/lib/smack/NormalizeLoops.cpp @@ -10,33 +10,34 @@ #include "smack/NormalizeLoops.h" #include "smack/Naming.h" -#include "llvm/IR/Module.h" -#include "llvm/IR/InstIterator.h" -#include "llvm/IR/Constants.h" -#include "llvm/IR/ValueSymbolTable.h" -#include "llvm/IR/IRBuilder.h" #include "llvm/Analysis/LoopInfo.h" +#include "llvm/IR/Constants.h" #include "llvm/IR/Dominators.h" +#include "llvm/IR/IRBuilder.h" +#include "llvm/IR/InstIterator.h" +#include "llvm/IR/Module.h" +#include "llvm/IR/ValueSymbolTable.h" #include -#include #include +#include namespace smack { using namespace llvm; // Register LoopInfo -void NormalizeLoops::getAnalysisUsage(AnalysisUsage& AU) const { +void NormalizeLoops::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); } /** * Creates a basic block which unconditionally branches to \param target. */ -BasicBlock* makeForwardingBlock(BasicBlock* target) { - auto& context = target->getContext(); - BasicBlock* result = BasicBlock::Create(context, "forwarder", target->getParent()); - BranchInst* branch = BranchInst::Create(target); +BasicBlock *makeForwardingBlock(BasicBlock *target) { + auto &context = target->getContext(); + BasicBlock *result = + BasicBlock::Create(context, "forwarder", target->getParent()); + BranchInst *branch = BranchInst::Create(target); result->getInstList().push_back(branch); return result; } @@ -45,12 +46,15 @@ BasicBlock* makeForwardingBlock(BasicBlock* target) { * Returns a vector of each successor index in \param ti which equals \param * headerBlock. */ -std::vector getSuccessorIndices(TerminatorInst* ti, BasicBlock* headerBlock) { +std::vector getSuccessorIndices(TerminatorInst *ti, + BasicBlock *headerBlock) { std::vector result; unsigned numSuccs = ti->getNumSuccessors(); - - if (numSuccs <= 1) { return result; } - + + if (numSuccs <= 1) { + return result; + } + for (unsigned i = 0; i < numSuccs; ++i) { if (ti->getSuccessor(i) == headerBlock) { result.push_back(i); @@ -65,9 +69,9 @@ std::vector getSuccessorIndices(TerminatorInst* ti, BasicBlock* header * \param blockMap is updated to map between \param BB and the newly created * forwarding block. */ -void splitBlock(BasicBlock* BB, BasicBlock* headerBlock, - std::map& blockMap) { - TerminatorInst* ti = BB->getTerminator(); +void splitBlock(BasicBlock *BB, BasicBlock *headerBlock, + std::map &blockMap) { + TerminatorInst *ti = BB->getTerminator(); // Get a list of all successor indices which point to headerBlock. std::vector succIndices = getSuccessorIndices(ti, headerBlock); @@ -76,7 +80,7 @@ void splitBlock(BasicBlock* BB, BasicBlock* headerBlock, // successor block, e.g., in a SwitchInst. We need to make sure each such // index uses the same forwarding block. if (succIndices.size()) { - BasicBlock* forwarder = makeForwardingBlock(headerBlock); + BasicBlock *forwarder = makeForwardingBlock(headerBlock); blockMap[BB] = forwarder; for (auto succIndex : succIndices) { ti->setSuccessor(succIndex, forwarder); @@ -89,11 +93,12 @@ void splitBlock(BasicBlock* BB, BasicBlock* headerBlock, * Fixes any PHI nodes in \param phis to get their incoming block from the new * blocks in \param blockMap. */ -void processPhis(std::vector& phis, std::map& blockMap) { - for (PHINode* phi : phis) { +void processPhis(std::vector &phis, + std::map &blockMap) { + for (PHINode *phi : phis) { unsigned numIncoming = phi->getNumIncomingValues(); for (unsigned i = 0; i < numIncoming; ++i) { - BasicBlock* incomingBlock = phi->getIncomingBlock(i); + BasicBlock *incomingBlock = phi->getIncomingBlock(i); if (blockMap.count(incomingBlock)) { phi->setIncomingBlock(i, blockMap[incomingBlock]); } @@ -102,24 +107,26 @@ void processPhis(std::vector& phis, std::map } void processLoop(Loop *loop) { - std::vector phis; - std::set phiIncBlocks; - std::set loopBlocks(loop->block_begin(), loop->block_end()); - BasicBlock* headerBlock = loop->getHeader(); + std::vector phis; + std::set phiIncBlocks; + std::set loopBlocks(loop->block_begin(), loop->block_end()); + BasicBlock *headerBlock = loop->getHeader(); // Gather Phis in the header - for (Instruction& I : *headerBlock) { - if (auto* phi = dyn_cast(&I)) { + for (Instruction &I : *headerBlock) { + if (auto *phi = dyn_cast(&I)) { phis.push_back(phi); phiIncBlocks.insert(phi->block_begin(), phi->block_end()); } } - std::map blockMap; + std::map blockMap; // Add forwarding blocks - for (BasicBlock* BB : phiIncBlocks) { - if (loopBlocks.count(BB) == 0) { continue; } + for (BasicBlock *BB : phiIncBlocks) { + if (loopBlocks.count(BB) == 0) { + continue; + } splitBlock(BB, headerBlock, blockMap); } @@ -132,11 +139,14 @@ void processLoop(Loop *loop) { } } -bool NormalizeLoops::runOnModule(Module& m) { +bool NormalizeLoops::runOnModule(Module &m) { for (auto F = m.begin(), FEnd = m.end(); F != FEnd; ++F) { - if (F->isIntrinsic() || F->empty()) { continue; } - LoopInfo& loopInfo = getAnalysis(*F).getLoopInfo(); - for (LoopInfo::iterator LI = loopInfo.begin(), LIEnd = loopInfo.end(); LI != LIEnd; ++LI) { + if (F->isIntrinsic() || F->empty()) { + continue; + } + LoopInfo &loopInfo = getAnalysis(*F).getLoopInfo(); + for (LoopInfo::iterator LI = loopInfo.begin(), LIEnd = loopInfo.end(); + LI != LIEnd; ++LI) { processLoop(*LI); } } @@ -147,7 +157,5 @@ bool NormalizeLoops::runOnModule(Module& m) { // Pass ID variable char NormalizeLoops::ID = 0; -const char* NormalizeLoops::getPassName() const { - return "NormalizeLoops"; -} +StringRef NormalizeLoops::getPassName() const { return "NormalizeLoops"; } } diff --git a/lib/smack/Prelude.cpp b/lib/smack/Prelude.cpp new file mode 100644 index 000000000..c48ad0c3e --- /dev/null +++ b/lib/smack/Prelude.cpp @@ -0,0 +1,1562 @@ +#include "smack/Prelude.h" +#include "smack/Naming.h" +#include "smack/Regions.h" +#include "smack/SmackOptions.h" +#include "llvm/Support/Casting.h" + +#include +#include +#include + +namespace smack { + +// make type names such as i32 +std::string getIntTypeName(unsigned width) { + return "i" + std::to_string(width); +} + +// make type names such as bv32 +std::string getBvTypeName(unsigned width) { + return "bv" + std::to_string(width); +} + +// make type name rmode +std::string getRMODETypeName() { return "rmode"; } + +// make floating-point type names by bit width +// when bitWidth is 0, the uninterpreted type is returned +std::string getFpTypeName(unsigned bitWidth) { + static const std::map floatNameTable{ + {0, Naming::UNINTERPRETED_FLOAT_TYPE}, + {16, Naming::HALF_TYPE}, + {32, Naming::FLOAT_TYPE}, + {64, Naming::DOUBLE_TYPE}, + {80, Naming::LONG_DOUBLE_TYPE}}; + auto it = floatNameTable.find(bitWidth); + if (it != floatNameTable.end()) + return it->second; + else + llvm_unreachable("invalid floating-point bit width"); +} + +// make type names such as [ref] i32 +std::string getMapTypeName(std::string elemType) { return "[ref] " + elemType; } + +// make generic type names +// when the `i` is 0, it returns the prefix +// otherwise it returns `prefix+i` +std::string makeVarName(unsigned i, std::string prefix) { + return i ? prefix + std::to_string(i) : prefix; +} + +// make var names such as i, i1 +std::string makeIntVarName(unsigned i) { return makeVarName(i, "i"); } + +// make var names such as p, p1 +std::string makePtrVarName(unsigned i) { return makeVarName(i, "p"); } + +// make var names such as f, f1 +std::string makeFpVarName(unsigned i) { return makeVarName(i, "f"); } + +// make var names such as M, M1 +std::string makeMapVarName(unsigned i) { return makeVarName(i, "M"); } + +std::string makeRMODEVarName() { return makeVarName(0, "rm"); } + +// make id expr +const Expr *makeIntVarExpr(unsigned i) { return Expr::id(makeIntVarName(i)); } + +const Expr *makePtrVarExpr(unsigned i) { return Expr::id(makePtrVarName(i)); } + +const Expr *makeFpVarExpr(unsigned i) { return Expr::id(makeFpVarName(i)); } + +const Expr *makeMapVarExpr(unsigned i) { return Expr::id(makeMapVarName(i)); } + +template +std::list makeListOfElems(unsigned numElems, U makeElem) { + std::list elemList; + if (numElems == 1) + elemList.emplace_back(makeElem(0)); + else + for (unsigned i = 1; i <= numElems; ++i) { + elemList.emplace_back(makeElem(i)); + } + return elemList; +} + +// make bindings such as [(i,i32)], [(i1,i32),(i2,i32)] +std::list makeIntVars(unsigned numVars, std::string type) { + return makeListOfElems(numVars, [&](unsigned i) -> Binding { + return {makeIntVarName(i), type}; + }); +} + +// make bindings such as [(p,ref)], [(p1,ref),(p2,ref)] +std::list makePtrVars(unsigned numVars) { + return makeListOfElems(numVars, [&](unsigned i) -> Binding { + return {makePtrVarName(i), Naming::PTR_TYPE}; + }); +} + +// make bindings such as [(f,float)], [(f1,float),(f2,float)] +std::list makeFpVars(unsigned numVars, unsigned bitWidth) { + return makeListOfElems(numVars, [&](unsigned i) -> Binding { + return {makeFpVarName(i), getFpTypeName(bitWidth)}; + }); +} + +// make bindings such as [(M,[ref]T)], [(p1,[ref]T),(p2,[ref]T)] +std::list makeMapVars(unsigned numVars, std::string elemType) { + return makeListOfElems(numVars, [&](unsigned i) -> Binding { + return {makeMapVarName(i), getMapTypeName(elemType)}; + }); +} + +// make id exprs +std::list makeIntVarExprs(unsigned numExprs) { + return makeListOfElems(numExprs, &makeIntVarExpr); +} + +std::list makePtrVarExprs(unsigned numExprs) { + return makeListOfElems(numExprs, &makePtrVarExpr); +} + +std::list makeFpVarExprs(unsigned numExprs) { + return makeListOfElems(numExprs, &makeFpVarExpr); +} + +std::list makeMapVarExprs(unsigned numExprs) { + return makeListOfElems(numExprs, &makeMapVarExpr); +} + +// make attributes +const Attr *makeBuiltinAttr(std::string arg) { + return Attr::attr("builtin", arg); +} + +const Attr *makeBvbuiltinAttr(std::string arg) { + return Attr::attr("bvbuiltin", arg); +} + +const Attr *makeInlineAttr() { return Attr::attr("inline"); } + +// declare an uninterpreted function +FuncDecl *uninterpretedOp(std::string baseName, + std::initializer_list nameArgs, + std::list args, std::string retType) { + return Decl::function(indexedName(baseName, nameArgs), args, retType, nullptr, + {}); +} + +// declare a function with `:inline` attribute +FuncDecl *inlinedOp(std::string baseName, + std::initializer_list nameArgs, + std::list args, std::string retType, + const Expr *body) { + return Decl::function(indexedName(baseName, nameArgs), args, retType, body, + {makeInlineAttr()}); +} + +// declare a function with an attribute indicating it's a built-in function +FuncDecl *builtinOp(std::string baseName, const Attr *attr, + std::initializer_list nameArgs, + std::list args, std::string retType) { + return Decl::function(indexedName(baseName, nameArgs), args, retType, nullptr, + {attr}); +} + +const std::vector IntOpGen::INTEGER_SIZES{ + 1, 5, 6, 8, 16, 24, 32, 40, 48, 56, 64, 80, 88, 96, 128, 160, 256}; + +// floating-point layout map: bit-width -> (exponent bit-width, significand +// bit-width) +const std::map> FpOpGen::FP_LAYOUT{ + {16, {5, 11}}, {32, {8, 24}}, {64, {11, 53}}, {80, {15, 65}}}; + +const std::vector FpOpGen::FP_BIT_WIDTHS{16, 32, 64, 80}; + +// make Boogie map selection expression such as +// M[p], M[$add.ref(p, 1)] +const Expr *Prelude::mapSelExpr(unsigned idx) { + auto ptrVar = makePtrVarExpr(0); + auto idxExpr = idx ? Expr::fn(indexedName("$add", {Naming::PTR_TYPE}), ptrVar, + rep.pointerLit((unsigned long long)idx)) + : ptrVar; + return Expr::sel(makeMapVarExpr(0), idxExpr); +} + +// make Boogie map update expression such as +// M[p:=v], M[$add.ref(p,1):=v] +const Expr *Prelude::mapUpdExpr(unsigned idx, const Expr *val, + const Expr *map) { + auto ptrVar = makePtrVarExpr(0); + auto mapExpr = map ? map : makeMapVarExpr(0); + auto idxExpr = idx ? Expr::fn(indexedName("$add", {Naming::PTR_TYPE}), ptrVar, + rep.pointerLit((unsigned long long)idx)) + : ptrVar; + return Expr::upd(mapExpr, idxExpr, val); +} + +// make type-safe load functions +FuncDecl *Prelude::safeLoad(std::string elemType) { + return inlinedOp("$load", {elemType}, + {makeMapVars(1, elemType).front(), makePtrVars(1).front()}, + elemType, mapSelExpr(0)); +} + +// make type-unsafe load functions +// argument `bytes` indicate whether the map element type is bv or int given +// the `--float` flag is enabled +FuncDecl *Prelude::unsafeLoad(std::string elemType, const Expr *body, + bool bytes) { + return inlinedOp( + "$load", {bytes ? "bytes" : "unsafe", elemType}, + {makeMapVars(1, bytes ? getBvTypeName(8) : getIntTypeName(8)).front(), + makePtrVars(1).front()}, + elemType, body); +} + +// make type-safe store functions +FuncDecl *Prelude::safeStore(Binding elemBinding) { + auto elemType = elemBinding.second; + auto elemExpr = Expr::id(elemBinding.first); + return inlinedOp( + "$store", {elemType}, + {makeMapVars(1, elemType).front(), makePtrVars(1).front(), elemBinding}, + getMapTypeName(elemType), mapUpdExpr(0, elemExpr)); +} + +// make type-unsafe store functions +// argument `bytes` indicate whether the map element type is bv or int given +// the `--float` flag is enabled +FuncDecl *Prelude::unsafeStore(Binding elemBinding, const Expr *body, + bool bytes) { + auto elemType = elemBinding.second; + return inlinedOp( + "$store", {bytes ? "bytes" : "unsafe", elemType}, + {makeMapVars(1, bytes ? getBvTypeName(8) : getIntTypeName(8)).front(), + makePtrVars(1).front(), elemBinding}, + getMapTypeName(bytes ? getBvTypeName(8) : getIntTypeName(8)), body); +} + +// declare extractvalue functions +// e.g., function $extractvalue.float(p: ref, i: int) returns (float); +FuncDecl *extractValue(std::string resType) { + std::list args = makePtrVars(1); + args.emplace_back(Binding{"i", "int"}); + return uninterpretedOp("$extractvalue", {resType}, args, resType); +} + +// declare extractvalue functions for integers +// e.g., function $extractvalue.bv256(p: ref, i: int) returns (bv256); +FuncDecl *extractValue(unsigned width) { + std::string resType = + SmackOptions::BitPrecise ? getBvTypeName(width) : getIntTypeName(width); + return extractValue(resType); +} + +void printFuncs(FuncsT funcs, std::stringstream &s) { + for (auto &f : funcs) + s << f << "\n"; +} + +void describe(std::string comment, std::stringstream &s) { + s << "// " << comment << "\n"; +} + +// generate bv arithmetic attribute +const Attr *IntOp::bvAttrFunc(std::string opName) { + return makeBvbuiltinAttr("bv" + opName); +} + +// generate int arithmetic attribute +const Attr *IntOp::intAttrFunc(std::string opName) { + return makeBuiltinAttr(opName.substr(1)); +} + +struct IntOpGen::IntArithOp : public IntOp { + IntArithOp(std::string opName, unsigned arity, Op *intOp, Op *bvOp, + bool alsoUsedByPtr) + : IntOp(opName, arity, intOp, bvOp, alsoUsedByPtr) {} + + FuncDecl *getIntFunc(unsigned size) const { + std::string type = getIntTypeName(size); + std::string name = "$" + opName; + + if (auto bop = dyn_cast>(intOp)) + // builtin int functions + // e.g.: function {:builtin "div"} $sdiv.i1(i1: i1, i2: i1) returns (i1); + // return builtinOp(name, makeBuiltinAttr(op.substr(1)), {type}, + return builtinOp(name, ((IntOp::attrT)bop->func)(opName), {type}, + makeIntVars(arity, type), type); + else if (auto iop = dyn_cast>(intOp)) + // inlined int functions + // e.g.: function {:inline} $add.i1(i1: i1, i2: i1) returns (i1) { (i1 + + // i2) } + return inlinedOp(name, {type}, makeIntVars(arity, type), type, + ((IntOp::exprT)iop->func)(size)); + else + // uninterpreted int functions + // e.g.: function $not.i1(i1: i1) returns (i1); + return uninterpretedOp(name, {type}, makeIntVars(arity, type), type); + } + + FuncDecl *getBvFunc(unsigned size) const { + std::string type = getBvTypeName(size); + std::string name = "$" + opName; + + if (auto bop = dyn_cast>(bvOp)) + // builtin bv functions + // e.g.: function {:bvbuiltin "bvadd"} $add.bv1(i1: bv1, i2: bv1) returns + // (bv1); + // return builtinOp(name, makeBvbuiltinAttr("bv"+op), {type}, + return builtinOp(name, ((IntOp::attrT)bop->func)(opName), {type}, + makeIntVars(arity, type), type); + else if (auto iop = dyn_cast>(bvOp)) + // inlined bv functions + // e.g.: function {:inline} $smin.bv32(i1: bv32, i2: bv32) returns (bv32) + // { if $slt.bv32.bool(i1, i2) then i1 else i2 } + return inlinedOp(name, {type}, makeIntVars(arity, type), type, + ((IntOp::exprT)iop->func)(size)); + else + llvm_unreachable("no uninterpreted bv arithmetic operations."); + } + + FuncsT getFuncs(unsigned size) const override { + FuncsT funcs; + if (!SmackOptions::BitPrecise || + (!SmackOptions::BitPrecisePointers && alsoUsedByPtr)) + funcs.push_back(getIntFunc(size)); + if (SmackOptions::BitPrecise) + funcs.push_back(getBvFunc(size)); + return funcs; + } + + // generate inlined int arithmetic function body such as `i1+i2` + template static const Expr *intArithExpr(unsigned size) { + return new BinExpr(OP, makeIntVarExpr(1), makeIntVarExpr(2)); + } + + // generate inlined bv min/max function body such as + // `if $slt.bv1.bool(i1, i2) then i1 else i2` + template + static const Expr *bvMinMaxExpr(unsigned size) { + std::string signLetter = SIGN ? "s" : "u"; + std::string pred = MIN ? "lt" : "gt"; + return Expr::if_then_else( + Expr::fn(indexedName("$" + signLetter + pred, + {getBvTypeName(size), Naming::BOOL_TYPE}), + makeIntVarExprs(2)), + makeIntVarExpr(1), makeIntVarExpr(2)); + } + + // generate inlined int min/max function body such as `if (i1 < i2) then i1 + // else i2` + template static const Expr *intMinMaxExpr(unsigned size) { + const Expr *a1 = makeIntVarExpr(1); + const Expr *a2 = makeIntVarExpr(2); + auto pred = MIN ? Expr::lt(a1, a2) : Expr::lt(a2, a1); + return Expr::if_then_else(pred, a1, a2); + } +}; + +void IntOpGen::generateArithOps(std::stringstream &s) const { + describe("Integer arithmetic operations", s); + + const auto bvBuiltinOp = new BuiltinOp(IntOp::bvAttrFunc); + const auto intBuiltinOp = new BuiltinOp(IntOp::intAttrFunc); + const auto uninterpretedOp = new UninterpretedOp(); + const std::vector intArithOpTable{ + {"add", 2, new InlinedOp( + IntOpGen::IntArithOp::intArithExpr), + bvBuiltinOp, true}, + {"sub", 2, new InlinedOp( + IntOpGen::IntArithOp::intArithExpr), + bvBuiltinOp, true}, + {"mul", 2, new InlinedOp( + IntOpGen::IntArithOp::intArithExpr), + bvBuiltinOp, true}, + {"sdiv", 2, intBuiltinOp, bvBuiltinOp, false}, + {"smod", 2, intBuiltinOp, bvBuiltinOp, false}, + {"srem", 2, intBuiltinOp, bvBuiltinOp, false}, + {"udiv", 2, intBuiltinOp, bvBuiltinOp, false}, + {"urem", 2, intBuiltinOp, bvBuiltinOp, false}, + {"shl", 2, uninterpretedOp, bvBuiltinOp, false}, + {"lshr", 2, uninterpretedOp, bvBuiltinOp, false}, + {"ashr", 2, uninterpretedOp, bvBuiltinOp, false}, + {"and", 2, uninterpretedOp, bvBuiltinOp, false}, + {"or", 2, uninterpretedOp, bvBuiltinOp, false}, + {"xor", 2, uninterpretedOp, bvBuiltinOp, false}, + {"nand", 2, uninterpretedOp, bvBuiltinOp, false}, + {"not", 1, uninterpretedOp, bvBuiltinOp, false}, + {"smin", 2, + new InlinedOp(IntOpGen::IntArithOp::intMinMaxExpr), + new InlinedOp( + IntOpGen::IntArithOp::bvMinMaxExpr), + false}, + {"smax", 2, + new InlinedOp(IntOpGen::IntArithOp::intMinMaxExpr), + new InlinedOp( + IntOpGen::IntArithOp::bvMinMaxExpr), + false}, + {"umin", 2, + new InlinedOp(IntOpGen::IntArithOp::intMinMaxExpr), + new InlinedOp( + IntOpGen::IntArithOp::bvMinMaxExpr), + false}, + {"umax", 2, + new InlinedOp(IntOpGen::IntArithOp::intMinMaxExpr), + new InlinedOp( + IntOpGen::IntArithOp::bvMinMaxExpr), + false}}; + + for (auto &op : intArithOpTable) + for (auto size : INTEGER_SIZES) + printFuncs(op.getFuncs(size), s); + + if (!SmackOptions::BitPrecise) { + // axioms for i1 + // e.g., axiom ($and.i1(0, 0) == 0); + for (unsigned i = 0; i < 2; ++i) { + for (unsigned j = 0; j < 2; ++j) { + s << Decl::axiom( + Expr::eq(Expr::fn(indexedName("$and", {getIntTypeName(1)}), + Expr::lit(i), Expr::lit(j)), + Expr::lit(i & j))) + << "\n"; + s << Decl::axiom( + Expr::eq(Expr::fn(indexedName("$or", {getIntTypeName(1)}), + Expr::lit(i), Expr::lit(j)), + Expr::lit(i | j))) + << "\n"; + s << Decl::axiom( + Expr::eq(Expr::fn(indexedName("$xor", {getIntTypeName(1)}), + Expr::lit(i), Expr::lit(j)), + Expr::lit(i ^ j))) + << "\n"; + } + } + // special axiom for $and.i32: axiom ($and.i32(32, 16) == 0); + s << Decl::axiom( + Expr::eq(Expr::fn(indexedName("$and", {getIntTypeName(32)}), + Expr::lit(32U), Expr::lit(16U)), + Expr::lit(0U))) + << "\n"; + } +} + +struct IntOpGen::IntPred : public IntOp { + + IntPred(std::string opName, Op *intOp, Op *bvOp) + : IntOp(opName, 2, intOp, bvOp, true) {} + + std::pair getIntFuncs(unsigned size) const { + std::string name = "$" + opName; + std::string type = getIntTypeName(size); + assert(isa>(intOp)); + auto iop = llvm::cast>(intOp); + // e.g.: function {:inline} $ule.i1.bool(i1: i1, i2: i1) returns (bool) + // { (i1 <= i2) } + auto compFunc = + inlinedOp(name, {type, Naming::BOOL_TYPE}, makeIntVars(2, type), + Naming::BOOL_TYPE, ((IntOp::exprT)iop->func)(size)); + // e.g.: function {:inline} $ule.i1(i1: i1, i2: i1) returns (i1) + // { if $ule.i1.bool(i1, i2) then 1 else 0 } + auto predFunc = + inlinedOp(name, {type}, makeIntVars(2, type), getIntTypeName(1), + Expr::if_then_else( + Expr::fn(indexedName(name, {type, Naming::BOOL_TYPE}), + makeIntVarExprs(2)), + Expr::lit(1ll), Expr::lit(0ll))); + return {compFunc, predFunc}; + } + + std::pair getBvFuncs(unsigned size) const { + std::string name = "$" + opName; + std::string type = getBvTypeName(size); + FuncDecl *compFunc, *predFunc; + if (auto bop = dyn_cast>(bvOp)) + // e.g.: function {:bvbuiltin "bvule"} $ule.bv1.bool(i1: bv1, i2: bv1) + // returns (bool); + compFunc = builtinOp(name, ((IntOp::attrT)bop->func)(opName), + {type, Naming::BOOL_TYPE}, makeIntVars(2, type), + Naming::BOOL_TYPE); + else if (auto iop = dyn_cast>(bvOp)) + // e.g.: function {:inline} $eq.bv1.bool(i1: bv1, i2: bv1) returns (bool) + // { (i1 == i2) } + compFunc = + inlinedOp(name, {type, Naming::BOOL_TYPE}, makeIntVars(2, type), + Naming::BOOL_TYPE, ((IntOp::exprT)iop->func)(size)); + else + llvm_unreachable("no uninterpreted bv predicates"); + // e.g.: function {:inline} $ule.bv1(i1: bv1, i2: bv1) returns (bv1) + // { if $ule.bv1.bool(i1, i2) then 1bv1 else 0bv1 } + predFunc = + inlinedOp(name, {type}, makeIntVars(2, type), getBvTypeName(1), + Expr::if_then_else( + Expr::fn(indexedName(name, {type, Naming::BOOL_TYPE}), + makeIntVarExpr(1), makeIntVarExpr(2)), + Expr::lit(1, 1), Expr::lit(0, 1))); + return {compFunc, predFunc}; + } + + FuncsT getFuncs(unsigned size) const override { + FuncDecl *compFunc, *predFunc; + FuncsT funcs; + if (!SmackOptions::BitPrecise || !SmackOptions::BitPrecisePointers) { + std::tie(compFunc, predFunc) = getIntFuncs(size); + funcs.push_back(compFunc); + funcs.push_back(predFunc); + } + if (SmackOptions::BitPrecise) { + std::tie(compFunc, predFunc) = getBvFuncs(size); + funcs.push_back(compFunc); + funcs.push_back(predFunc); + } + return funcs; + } +}; + +void IntOpGen::generatePreds(std::stringstream &s) const { + describe("Integer predicates", s); + + const auto bvBuiltinOp = new BuiltinOp(IntOp::bvAttrFunc); + const auto leInlinedOp = new InlinedOp( + IntOpGen::IntArithOp::intArithExpr); + const auto ltInlinedOp = new InlinedOp( + IntOpGen::IntArithOp::intArithExpr); + const auto geInlinedOp = new InlinedOp( + IntOpGen::IntArithOp::intArithExpr); + const auto gtInlinedOp = new InlinedOp( + IntOpGen::IntArithOp::intArithExpr); + const auto eqInlinedOp = new InlinedOp( + IntOpGen::IntArithOp::intArithExpr); + const auto neInlinedOp = new InlinedOp( + IntOpGen::IntArithOp::intArithExpr); + const std::vector intPredTable{ + {"ule", leInlinedOp, bvBuiltinOp}, {"ult", ltInlinedOp, bvBuiltinOp}, + {"uge", geInlinedOp, bvBuiltinOp}, {"ugt", gtInlinedOp, bvBuiltinOp}, + {"sle", leInlinedOp, bvBuiltinOp}, {"slt", ltInlinedOp, bvBuiltinOp}, + {"sge", geInlinedOp, bvBuiltinOp}, {"sgt", gtInlinedOp, bvBuiltinOp}, + {"eq", eqInlinedOp, eqInlinedOp}, {"ne", neInlinedOp, neInlinedOp}}; + + for (auto &pred : intPredTable) + for (auto size : INTEGER_SIZES) + printFuncs(pred.getFuncs(size), s); +} + +struct IntOpGen::IntConv { + typedef const Attr *(*attrT)(unsigned, unsigned); + typedef const Expr *(*idExprT)(); + typedef const Expr *(*truncExprT)(unsigned); + std::string opName; + bool upCast; + Op *intOp; + Op *bvOp; + + FuncDecl *getIntFunc(unsigned size1, unsigned size2) const { + assert(isa>(intOp)); + auto iop = llvm::cast>(intOp); + std::string type1 = getIntTypeName(size1); + std::string type2 = getIntTypeName(size2); + + // e.g.: function {:inline} $zext.i1.i5(i: i1) returns (i5) { i } + return inlinedOp("$" + opName, {type1, type2}, makeIntVars(1, type1), type2, + ((idExprT)iop->func)()); + } + + FuncDecl *getBvFunc(unsigned size1, unsigned size2) const { + std::string type1 = getBvTypeName(size1); + std::string type2 = getBvTypeName(size2); + std::string name = "$" + opName; + if (auto bop = dyn_cast>(bvOp)) { + // e.g.: function {:bvbuiltin (_ sign_extend 8)} $sext.bv8.bv16(i: bv8) + // returns (bv16); + return builtinOp(name, ((attrT)bop->func)(size1, size2), {type1, type2}, + makeIntVars(1, type1), type2); + } else if (auto iop = dyn_cast>(bvOp)) { + // e.g.: function {:inline} $trunc.bv5.bv1(i: bv5) returns (bv1) { i[1:0] + // } + return inlinedOp(name, {type1, type2}, makeIntVars(1, type1), type2, + ((truncExprT)iop->func)(size2)); + } else + llvm_unreachable("no uninterpreted bv cast"); + } + + FuncsT getFuncs(unsigned size1, unsigned size2) const { + if (SmackOptions::BitPrecise) + return {getBvFunc(size1, size2)}; + else + return {getIntFunc(size1, size2)}; + } + + // generate identity expression such as `i1` + static const Expr *intIdentityExpr() { return makeIntVarExpr(0); } + + // generate bv truncation function body such as `i[1:0]` + static const Expr *truncExpr(unsigned size) { + return Expr::bvExtract(makeIntVarName(0), size, 0); + } + + // generate bv extension function attribute such as `:bvbuiltin (_ sign_extend + // 8)` + template + static const Attr *extAttr(unsigned size1, unsigned size2) { + std::string builtInOp = SIGN ? "sign_extend" : "zero_extend"; + std::string builtInAttrArg = + "(_ " + builtInOp + " " + std::to_string(size2 - size1) + ")"; + return makeBvbuiltinAttr(builtInAttrArg); + } +}; + +void IntOpGen::generateConvOps(std::stringstream &s) const { + describe("Conversion between integer types", s); + + const auto inlinedIdentity = + new InlinedOp(IntConv::intIdentityExpr); + const auto inlinedTrunc = + new InlinedOp(IntConv::truncExpr); + const auto builtinSext = + new BuiltinOp(IntConv::extAttr); + const auto builtinZext = + new BuiltinOp(IntConv::extAttr); + const std::vector intConvTable{ + {"trunc", false, inlinedIdentity, inlinedTrunc}, + {"sext", true, inlinedIdentity, builtinSext}, + {"zext", true, inlinedIdentity, builtinZext}}; + + for (auto &conv : intConvTable) { + for (size_t s1 = 0; s1 < INTEGER_SIZES.size(); ++s1) { + const unsigned &size1 = INTEGER_SIZES[s1]; + for (size_t s2 = s1 + 1; s2 < INTEGER_SIZES.size(); ++s2) { + const unsigned &size2 = INTEGER_SIZES[s2]; + if (conv.upCast) + printFuncs(conv.getFuncs(size1, size2), s); + else + printFuncs(conv.getFuncs(size2, size1), s); + } + } + } +} + +void IntOpGen::generateMemOps(std::stringstream &s) const { + describe("Integer load/store operations", s); + + for (auto size : INTEGER_SIZES) { + if (!SmackOptions::BitPrecise) { + std::string type = getIntTypeName(size); + auto binding = makeIntVars(1, type).front(); + // e.g.: function {:inline} $load.i1(M: [ref] i1, p: ref) returns (i1) { + // M[p] } + s << prelude.safeLoad(type) << "\n"; + // e.g.: function {:inline} $store.i1(M: [ref] i1, p: ref, i: i1) + // returns ([ref] i1) { M[p := i] } + s << prelude.safeStore(binding) << "\n"; + } else { + // e.g.: function {:inline} $load.bv1(M: [ref] bv1, p: ref) returns (bv1) + // { M[p] } + std::string type = getBvTypeName(size); + auto binding = makeIntVars(1, type).front(); + s << prelude.safeLoad(type) << "\n"; + // e.g.: function {:inline} $store.bv1(M: [ref] bv1, p: ref, v: bv1) + // returns ([ref] bv1) { M[p := i] } + s << prelude.safeStore(binding) << "\n"; + + auto byteType = getBvTypeName(8); + auto valExpr = makeIntVarExpr(0); + + if (size < 8) { + // e.g., function {:inline} $load.bytes.bv1(M: [ref] bv8, p: ref) + // returns (bv1) { $trunc.bv8.bv1(M[p]) } + s << prelude.unsafeLoad( + type, Expr::fn(indexedName("$trunc", {byteType, type}), + prelude.mapSelExpr(0))) + << "\n"; + // e.g., function {:inline} $store.bytes.bv1(M: [ref] bv8, p: ref, i: + // bv1) + // returns ([ref] bv8) { M[p := $zext.bv1.bv8(i)] } + s << prelude.unsafeStore( + binding, + prelude.mapUpdExpr( + 0, + Expr::fn(indexedName("$zext", {type, byteType}), valExpr))) + << "\n"; + } else if (size == 8) { + // function {:inline} $load.bytes.bv8(M: [ref] bv8, p: ref) returns + // (bv8) { M[p] } + s << prelude.unsafeLoad(type, prelude.mapSelExpr(0)) << "\n"; + // function {:inline} $load.bytes.bv8(M: [ref] bv8, p: ref) returns + // (bv8) { M[p] } + s << prelude.unsafeStore(binding, prelude.mapUpdExpr(0, valExpr)) + << "\n"; + } else { + auto loadBody = prelude.mapSelExpr(0); + auto storeBody = prelude.mapUpdExpr(0, Expr::bvExtract(valExpr, 8, 0)); + for (unsigned i = 1; i> 3; ++i) { + unsigned lowerIdx = i << 3; + unsigned upperIdx = lowerIdx + 8; + loadBody = Expr::bvConcat(prelude.mapSelExpr(i), loadBody); + storeBody = prelude.mapUpdExpr( + i, Expr::bvExtract(valExpr, upperIdx, lowerIdx), storeBody); + } + // e.g., function {:inline} $load.bytes.bv16(M: [ref] bv8, p: ref) + // returns (bv16) { (M[$add.ref(p, 1)]++M[p]) } + s << prelude.unsafeLoad(type, loadBody) << "\n"; + // e.g., function {:inline} $store.bytes.bv16(M: [ref] bv8, p: ref, i: + // bv16) + // returns ([ref] bv8) { M[p := i[8:0]][$add.ref(p, 1) := i[16:8]] } + s << prelude.unsafeStore(binding, storeBody) << "\n"; + } + } + } +} + +void IntOpGen::generateExtractValueFuncs(std::stringstream &s) const { + for (auto size : INTEGER_SIZES) + s << extractValue(size) << "\n"; +} + +void IntOpGen::generateBvIntConvs(std::stringstream &s) const { + describe("SMT bit-vector/integer conversion", s); + + auto ptrSize = prelude.rep.ptrSizeInBits; + std::string b = std::to_string(ptrSize); + std::string bt = "bv" + b; + std::string it = "i" + b; + s << Decl::function(indexedName("$int2bv", {ptrSize}), {{"i", it}}, bt, + nullptr, {makeBuiltinAttr("(_ int2bv " + b + ")")}) + << "\n"; + if (SmackOptions::BitPrecise && !SmackOptions::BitPrecisePointers) { + s << Decl::function(indexedName("$bv2uint", {ptrSize}), {{"i", bt}}, it, + nullptr, {makeBuiltinAttr("bv2int")}) + << "\n"; + const Expr *arg = Expr::id("i"); + const Expr *uint = Expr::fn(indexedName("$bv2uint", {ptrSize}), arg); + std::string offset; + if (ptrSize == 32) + offset = "4294967296"; + else if (ptrSize == 64) + offset = "18446744073709551616"; + else + llvm_unreachable("Unexpected pointer bit width."); + s << Decl::function( + indexedName("$bv2int", {ptrSize}), {{"i", bt}}, it, + Expr::cond(Expr::fn(indexedName("$slt", {bt, Naming::BOOL_TYPE}), + {arg, Expr::lit(0ULL, ptrSize)}), + Expr::fn(indexedName("$sub", {it}), + {uint, Expr::lit(offset, 0U)}), + uint), + {makeInlineAttr()}) + << "\n"; + } else + s << Decl::function(indexedName("$bv2int", {ptrSize}), {{"i", bt}}, it, + nullptr, {makeBuiltinAttr("bv2int")}) + << "\n"; + s << "\n"; +} + +void IntOpGen::generate(std::stringstream &s) const { + generateBvIntConvs(s); + generateArithOps(s); + generatePreds(s); + generateMemOps(s); + generateConvOps(s); + generateExtractValueFuncs(s); +} + +void TypeDeclGen::generate(std::stringstream &s) const { + describe("Basic types", s); + + for (unsigned size : IntOpGen::INTEGER_SIZES) + s << Decl::typee(getIntTypeName(size), "int") << "\n"; + s << Decl::typee(Naming::PTR_TYPE, prelude.rep.pointerType()) << "\n"; + if (SmackOptions::FloatEnabled) { + s << Decl::typee(Naming::HALF_TYPE, "float11e5") << "\n"; + s << Decl::typee(Naming::FLOAT_TYPE, "float24e8") << "\n"; + s << Decl::typee(Naming::DOUBLE_TYPE, "float53e11") << "\n"; + s << Decl::typee(Naming::LONG_DOUBLE_TYPE, "float65e15") << "\n"; + } else { + s << Decl::typee(Naming::UNINTERPRETED_FLOAT_TYPE, "") << "\n"; + } + s << "\n"; +} + +void ConstDeclGen::generatePtrConstant(unsigned val, + std::stringstream &s) const { + std::string ptrConst = + indexedName("$" + std::to_string(val), {Naming::PTR_TYPE}); + s << Decl::constant(ptrConst, Naming::PTR_TYPE) << "\n"; + s << Decl::axiom(Expr::eq(Expr::id(ptrConst), + prelude.rep.pointerLit((unsigned long long)val))) + << "\n"; +} + +void ConstDeclGen::generateIntConstant(unsigned val, + std::stringstream &s) const { + std::string intConst = "$" + std::to_string(val); + s << Decl::constant(intConst, prelude.rep.intType(32)) << "\n"; + s << Decl::axiom( + Expr::eq(Expr::id(intConst), + prelude.rep.integerLit((unsigned long long)val, 32))) + << "\n"; +} + +void ConstDeclGen::generate(std::stringstream &s) const { + describe("Basic constants", s); + + // e.g., const $0: i32; axiom ($0 == 0); + generateIntConstant(0, s); + generateIntConstant(1, s); + + // e.g., const $1.ref: ref; axiom ($1.ref == 1); + generatePtrConstant(0, s); + generatePtrConstant(1, s); + generatePtrConstant(1024, s); + + describe("Memory model constants", s); + + // e.g., const $GLOBALS_BOTTOM: ref; + s << Decl::constant(Naming::GLOBALS_BOTTOM, Naming::PTR_TYPE) << "\n"; + s << Decl::constant(Naming::EXTERNS_BOTTOM, Naming::PTR_TYPE) << "\n"; + s << Decl::constant(Naming::MALLOC_TOP, Naming::PTR_TYPE) << "\n"; + s << "\n"; +} + +void MemDeclGen::generateMemoryMaps(std::stringstream &s) const { + describe("Memory maps (" + std::to_string(prelude.rep.regions->size()) + + " regions)", + s); + + for (auto M : prelude.rep.memoryMaps()) + s << "var " << M.first << ": " << M.second << ";" + << "\n"; + + s << "\n"; +} + +void MemDeclGen::generateAddrBoundsAndPred(std::stringstream &s) const { + describe("Memory address bounds", s); + + // e.g., axiom ($GLOBALS_BOTTOM == $sub.ref(0, 45419)); + s << Decl::axiom(Expr::eq(Expr::id(Naming::GLOBALS_BOTTOM), + prelude.rep.pointerLit(prelude.rep.globalsOffset))) + << "\n"; + s << Decl::axiom(Expr::eq( + Expr::id(Naming::EXTERNS_BOTTOM), + Expr::fn("$add.ref", Expr::id(Naming::GLOBALS_BOTTOM), + prelude.rep.pointerLit(prelude.rep.externsOffset)))) + << "\n"; + unsigned long long malloc_top; + if (prelude.rep.ptrSizeInBits == 32) + malloc_top = 2147483647UL; + else if (prelude.rep.ptrSizeInBits == 64) + malloc_top = 9223372036854775807UL; + else + llvm_unreachable("Unexpected pointer bit width."); + s << Decl::axiom(Expr::eq(Expr::id(Naming::MALLOC_TOP), + prelude.rep.pointerLit(malloc_top))) + << "\n"; + + // $isExternal predicate: + // function {:inline} $isExternal(p: ref) returns (bool) + // {$slt.ref.bool(p,$EXTERNS_BOTTOM)} + s << Decl::function( + Naming::EXTERNAL_ADDR, makePtrVars(1), Naming::BOOL_TYPE, + Expr::fn(indexedName("$slt", {Naming::PTR_TYPE, Naming::BOOL_TYPE}), + makePtrVarExpr(0), Expr::id(Naming::EXTERNS_BOTTOM))) + << "\n"; + s << "\n"; +} + +void MemDeclGen::generateGlobalAllocations(std::stringstream &s) const { + if (SmackOptions::MemorySafety) { + describe("Global allocations", s); + + std::list stmts; + for (auto E : prelude.rep.globalAllocations) + stmts.push_back(Stmt::call( + "$galloc", + {prelude.rep.expr(E.first), prelude.rep.pointerLit(E.second)})); + s << Decl::procedure("$global_allocations", {}, {}, {}, + {Block::block("", stmts)}) + << "\n"; + s << "\n"; + } +} + +void MemDeclGen::generate(std::stringstream &s) const { + generateMemoryMaps(s); + generateAddrBoundsAndPred(s); + generateGlobalAllocations(s); +} + +void PtrOpGen::generatePtrNumConvs(std::stringstream &s) const { + describe("Pointer-number conversion", s); + + // e.g., function {:inline} $p2i.ref.i8(p: ref) returns (i8) { + // $trunc.i64.i8(p) } + for (unsigned i = 8; i <= 64; i <<= 1) { + s << Decl::function( + indexedName("$p2i", {Naming::PTR_TYPE, prelude.rep.intType(i)}), + {{"p", Naming::PTR_TYPE}}, prelude.rep.intType(i), + prelude.rep.pointerToInteger(Expr::id("p"), i), {makeInlineAttr()}) + << "\n"; + s << Decl::function( + indexedName("$i2p", {prelude.rep.intType(i), Naming::PTR_TYPE}), + {{"i", prelude.rep.intType(i)}}, Naming::PTR_TYPE, + prelude.rep.integerToPointer(Expr::id("i"), i), {makeInlineAttr()}) + << "\n"; + } + s << "\n"; +} + +void PtrOpGen::generatePreds(std::stringstream &s) const { + describe("Pointer predicates", s); + + const std::vector predicates{"$eq", "$ne", "$ugt", "$uge", + "$ult", "$ule", "$sgt", "$sge", + "$slt", "$sle"}; + + // e.g., function {:inline} $eq.ref(p1: ref, p2: ref) + // returns (i1) { (if $eq.i64.bool(p1, p2) then 1 else 0) } + for (auto pred : predicates) { + s << Decl::function( + indexedName(pred, {Naming::PTR_TYPE}), + {{"p1", Naming::PTR_TYPE}, {"p2", Naming::PTR_TYPE}}, + prelude.rep.intType(1), + Expr::cond(Expr::fn(indexedName(pred, + {prelude.rep.pointerType(), + Naming::BOOL_TYPE}), + {Expr::id("p1"), Expr::id("p2")}), + prelude.rep.integerLit(1LL, 1), + prelude.rep.integerLit(0LL, 1)), + {makeInlineAttr()}) + << "\n"; + s << Decl::function( + indexedName(pred, {Naming::PTR_TYPE, Naming::BOOL_TYPE}), + {{"p1", Naming::PTR_TYPE}, {"p2", Naming::PTR_TYPE}}, + Naming::BOOL_TYPE, + Expr::fn(indexedName( + pred, {prelude.rep.pointerType(), Naming::BOOL_TYPE}), + {Expr::id("p1"), Expr::id("p2")}), + {makeInlineAttr()}) + << "\n"; + } + s << "\n"; +} + +void PtrOpGen::generateArithOps(std::stringstream &s) const { + describe("Pointer arithmetic operations", s); + + const std::vector operations = {"$add", "$sub", "$mul"}; + + // e.g., function {:inline} $add.ref(p1: ref, p2: ref) returns (ref) { + // $add.i64(p1, p2) } + for (auto op : operations) { + s << Decl::function(indexedName(op, {Naming::PTR_TYPE}), + {{"p1", Naming::PTR_TYPE}, {"p2", Naming::PTR_TYPE}}, + Naming::PTR_TYPE, + Expr::fn(indexedName(op, {prelude.rep.pointerType()}), + {Expr::id("p1"), Expr::id("p2")}), + {makeInlineAttr()}) + << "\n"; + } + s << "\n"; +} + +void PtrOpGen::generateMemOps(std::stringstream &s) const { + describe("Pointer load/store operations", s); + + if (SmackOptions::BitPrecise) { + describe("Bytewise pointer storage", s); + + // e.g., function {:inline} $load.bytes.ref(M: [ref] bv8, p: ref) + // returns (ref) { $i2p.bv64.ref($load.bytes.bv64(M, p)) } + auto intType = getBvTypeName(prelude.rep.ptrSizeInBits); + s << prelude.unsafeLoad( + Naming::PTR_TYPE, + Expr::fn(indexedName("$i2p", {intType, Naming::PTR_TYPE}), + Expr::fn(indexedName("$load", {"bytes", intType}), + makeMapVarExpr(0), makePtrVarExpr(0)))) + << "\n"; + + // e.g., function {:inline} $store.bytes.ref(M: [ref] bv8, p: ref, p1: ref) + // returns ([ref] bv8) { $store.bytes.bv64(M, p, $p2i.ref.bv64(p1)) } + auto binding = makePtrVars(2).front(); + auto indexExpr = makePtrVarExpr(0); + s << prelude.unsafeStore( + binding, + Expr::fn(indexedName("$store", {"bytes", intType}), + makeMapVarExpr(0), indexExpr, + Expr::fn(indexedName("$p2i", {Naming::PTR_TYPE, intType}), + makePtrVarExpr(1)))) + << "\n"; + } + s << prelude.safeLoad(Naming::PTR_TYPE) << "\n"; + s << prelude.safeStore(makeIntVars(1, Naming::PTR_TYPE).front()) << "\n"; + s << "\n"; +} + +void PtrOpGen::generateConvOps(std::stringstream &s) const { + describe("Pointer conversion", s); + + // pointer bit casts: + // function {:inline} $bitcast.ref.ref(i: ref) returns (ref) {i} + s << inlinedOp("$bitcast", {Naming::PTR_TYPE, Naming::PTR_TYPE}, + makePtrVars(1), Naming::PTR_TYPE, makePtrVarExpr(0)) + << "\n"; +} + +void PtrOpGen::generateExtractValueFuncs(std::stringstream &s) const { + s << extractValue(Naming::PTR_TYPE) << "\n"; +} + +void PtrOpGen::generate(std::stringstream &s) const { + generateArithOps(s); + generatePreds(s); + generateMemOps(s); + generateConvOps(s); + generateExtractValueFuncs(s); + generatePtrNumConvs(s); +} + +// generate floating-point built-in attributes +const Attr *FpOp::fpAttrFunc(std::string opName) { + static const std::map fpAttrTable{ + {"abs", "fp.abs"}, + {"round", "fp.roundToIntegral"}, + {"min", "fp.min"}, + {"max", "fp.max"}, + {"sqrt", "fp.sqrt"}, + {"fadd", "fp.add"}, + {"fsub", "fp.sub"}, + {"fmul", "fp.mul"}, + {"fdiv", "fp.div"}, + {"frem", "fp.rem"}, + {"fma", "fp.fma"}, + {"isnormal", "fp.isNormal"}, + {"issubnormal", "fp.isSubnormal"}, + {"iszero", "fp.isZero"}, + {"isinfinite", "fp.isInfinite"}, + {"isnan", "fp.isNaN"}, + {"isnegative", "fp.isNegative"}, + {"ispositive", "fp.isPositive"}, + {"foeq", "fp.eq"}, + {"fole", "fp.leq"}, + {"folt", "fp.lt"}, + {"foge", "fp.geq"}, + {"fogt", "fp.gt"}}; + return makeBuiltinAttr(fpAttrTable.at(opName)); +} + +struct FpOpGen::FpArithOp : public FpOp { + bool rMode; + + FpArithOp(std::string opName, unsigned arity, bool rMode) + : FpOp(opName, arity, new BuiltinOp(fpAttrFunc)), + rMode(rMode) {} + + FuncDecl *getModeledFpFunc(unsigned bitWidth) const override { + assert(isa>(op)); + auto bop = llvm::cast>(op); + auto builtinAttr = ((FpOp::attrT)bop->func)(opName); + auto type = getFpTypeName(bitWidth); + auto name = "$" + opName; + std::list bs = makeFpVars(arity, bitWidth); + + if (rMode) + bs.insert(bs.begin(), {makeRMODEVarName(), getRMODETypeName()}); + + // e.g., function {:builtin "fp.add"} $fadd.bvhalf(rm: rmode, f1: bvhalf, + // f2: bvhalf) + // returns (bvhalf); + return builtinOp(name, builtinAttr, {type}, bs, type); + } + + FuncDecl *getUninterpretedFpFunc() const override { + auto name = "$" + opName; + std::string type = getFpTypeName(0); + // e.g.: function $fadd.fp(f1: float, f2: float) returns (float); + return uninterpretedOp(name, {type}, makeFpVars(arity, 0), type); + } +}; + +void FpOpGen::generateArithOps(std::stringstream &s) const { + describe("Floating-point arithmetic operations", s); + + // TODO eliminate the fourth item + const std::vector fpArithOps{ + {"abs", 1, false}, {"round", 1, true}, {"sqrt", 1, true}, + {"fadd", 2, true}, {"fsub", 2, true}, {"fmul", 2, true}, + {"fdiv", 2, true}, {"frem", 2, false}, {"min", 2, false}, + {"max", 2, false}, {"fma", 3, true}}; + + for (auto &f : fpArithOps) { + if (SmackOptions::FloatEnabled) + for (auto bw : FP_BIT_WIDTHS) + s << f.getModeledFpFunc(bw) << "\n"; + else + s << f.getUninterpretedFpFunc() << "\n"; + } +} + +struct FpOpGen::FpPred : public FpOp { + typedef const Expr *(*exprT)(std::string, const Expr *a1, const Expr *a2, + unsigned bitWidth); + bool llvmBuiltin; + + FpPred(std::string opName, unsigned arity, bool llvmBuiltin, Op *op) + : FpOp(opName, arity, op), llvmBuiltin(llvmBuiltin) {} + + FuncDecl *getModeledFpFunc(unsigned bitWidth) const override { + auto type = getFpTypeName(bitWidth); + auto name = "$" + opName; + if (auto bop = dyn_cast>(op)) { + auto builtinAttr = ((FpOp::attrT)bop->func)(opName); + + // e.g: function {:builtin "fp.isNormal"} $isnormal.bvhalf.bool(i: bvhalf) + // returns (bool); + return builtinOp(name, builtinAttr, {type, Naming::BOOL_TYPE}, + makeFpVars(arity, bitWidth), Naming::BOOL_TYPE); + } else if (auto iop = dyn_cast>(op)) { + auto a1 = makeFpVarExpr(1); + auto a2 = makeFpVarExpr(2); + // e.g.: function {:inline} $ford.bvhalf.bool(f1:bvhalf, f2:bvhalf) + // returns (bool) {!$funo.bvhalf.bool(f1,f2)} + return inlinedOp(name, {type, Naming::BOOL_TYPE}, + makeFpVars(arity, bitWidth), Naming::BOOL_TYPE, + ((exprT)iop->func)(opName, a1, a2, bitWidth)); + } else + llvm_unreachable("no uninterpreted fp predicates."); + } + + FuncDecl *getUninterpretedFpFunc() const override { + if (llvmBuiltin) { + // e.g: function $foeq.float.bool(i1: float, i2: float) returns (bool); + auto type = getFpTypeName(0); + + return uninterpretedOp("$" + opName, {type, Naming::BOOL_TYPE}, + makeFpVars(arity, 0), Naming::BOOL_TYPE); + } else + return nullptr; + } + + // helper function: generate expressions such as `$isnan.bvhalf.bool(f1)` + static const Expr *applyCompFn(std::string baseName, unsigned bitWidth, + std::list args) { + return Expr::fn( + indexedName(baseName, {getFpTypeName(bitWidth), Naming::BOOL_TYPE}), + args); + } + + // helper function: generate expressions that negate a predicate such as + // !($fueq.bvhalf.bool(f1, f2)) + static std::function + fpPredNegBody(std::string opName) { + return [opName](const Expr *a1, const Expr *a2, unsigned bitWidth) { + return Expr::not_(applyCompFn(opName, bitWidth, {a1, a2})); + }; + } + + // e.g., ($isnan.bvhalf.bool(f1) || $isnan.bvhalf.bool(f2)) + static const Expr *funoBody(const Expr *a1, const Expr *a2, + unsigned bitWidth) { + return Expr::or_(applyCompFn("$isnan", bitWidth, {a1}), + applyCompFn("$isnan", bitWidth, {a2})); + } + + // generate fp predicate function body that follows the pattern p1 || p2 where + // p1 and p2 + // are fp predicates + static std::function + fpPredDisjuncBody(std::string opName) { + return [opName](const Expr *a1, const Expr *a2, unsigned bitWidth) { + return Expr::or_(funoBody(a1, a2, bitWidth), + applyCompFn(opName, bitWidth, {a1, a2})); + }; + } + + // generate function bodies for `ftrue` and `ffalse` + template + static const Expr *fpLitBody(const Expr *a1, const Expr *a2, + unsigned bitWidth) { + return Expr::lit(VALUE); + } + + // generate inlined fp predicate function body + static const Expr *fpPredExpr(std::string opName, const Expr *a1, + const Expr *a2, unsigned bitWidth) { + static const std::map< + std::string, + std::function> + fpPredExprTable{{"fone", fpPredNegBody("$fueq")}, + {"ford", fpPredNegBody("$funo")}, + {"fueq", fpPredDisjuncBody("$foeq")}, + {"fugt", fpPredDisjuncBody("$fogt")}, + {"fuge", fpPredDisjuncBody("$foge")}, + {"fult", fpPredDisjuncBody("$folt")}, + {"fule", fpPredDisjuncBody("$fole")}, + {"fune", fpPredDisjuncBody("$fone")}, + {"funo", funoBody}, + {"ffalse", fpLitBody}, + {"ftrue", fpLitBody}}; + + auto ret = fpPredExprTable.at(opName)(a1, a2, bitWidth); + return ret; + } +}; + +void FpOpGen::generatePreds(std::stringstream &s) const { + describe("Floating-point predicates", s); + + const auto fpBuiltinOp = new BuiltinOp(FpOp::fpAttrFunc); + const auto fpInlinedPred = new InlinedOp(FpPred::fpPredExpr); + const std::vector fpPredTable{{"isnormal", 1, false, fpBuiltinOp}, + {"issubnormal", 1, false, fpBuiltinOp}, + {"iszero", 1, false, fpBuiltinOp}, + {"isinfinite", 1, false, fpBuiltinOp}, + {"isnan", 1, false, fpBuiltinOp}, + {"isnegative", 1, false, fpBuiltinOp}, + {"ispositive", 1, false, fpBuiltinOp}, + {"foeq", 2, true, fpBuiltinOp}, + {"fole", 2, true, fpBuiltinOp}, + {"folt", 2, true, fpBuiltinOp}, + {"foge", 2, true, fpBuiltinOp}, + {"fogt", 2, true, fpBuiltinOp}, + {"fone", 2, true, fpInlinedPred}, + {"ford", 2, true, fpInlinedPred}, + {"fueq", 2, true, fpInlinedPred}, + {"fugt", 2, true, fpInlinedPred}, + {"fuge", 2, true, fpInlinedPred}, + {"fult", 2, true, fpInlinedPred}, + {"fule", 2, true, fpInlinedPred}, + {"fune", 2, true, fpInlinedPred}, + {"funo", 2, true, fpInlinedPred}, + {"ffalse", 2, true, fpInlinedPred}, + {"ftrue", 2, true, fpInlinedPred}}; + + for (auto &p : fpPredTable) { + if (SmackOptions::FloatEnabled) + for (auto bw : FP_BIT_WIDTHS) + s << p.getModeledFpFunc(bw) << "\n"; + else { + auto func = p.getUninterpretedFpFunc(); + if (func) + s << func << "\n"; + } + } +} + +void FpOpGen::generateConvOps(std::stringstream &s) const { + describe("Floating-point conversion", s); + + if (SmackOptions::FloatEnabled) { + for (auto srcBw : FP_BIT_WIDTHS) { + for (auto desBw : FP_BIT_WIDTHS) { + if (srcBw != desBw) { + std::string name = srcBw < desBw ? "$fpext" : "$fptrunc"; + + auto exp = FP_LAYOUT.at(desBw).first; + auto sig = FP_LAYOUT.at(desBw).second; + std::string srcType = getFpTypeName(srcBw); + std::string desType = getFpTypeName(desBw); + std::string attr = "(_ to_fp " + std::to_string(exp) + " " + + std::to_string(sig) + ")"; + std::list bs = makeFpVars(1, srcBw); + + bs.insert(bs.begin(), {makeRMODEVarName(), getRMODETypeName()}); + // e.g., function {:builtin "(_ to_fp 8 24)"} + // $fpext.bvhalf.bvfloat(rm: rmode, f: bvhalf) returns (bvfloat); + s << builtinOp(name, makeBuiltinAttr(attr), {srcType, desType}, bs, + desType) + << "\n"; + } + } + } + } else { + std::string srcType = getFpTypeName(0); + std::string desType = getFpTypeName(0); + // e.g., function $fpext.float(f: float) returns (float); + s << uninterpretedOp("$fpext", {srcType, desType}, makeFpVars(1, 0), + desType) + << "\n"; + s << uninterpretedOp("$fptrunc", {srcType, desType}, makeFpVars(1, 0), + desType) + << "\n"; + } +} + +struct FpOpGen::FpIntConv { + typedef const Attr *(*attrT)(unsigned, unsigned); + std::string opName; + bool f2i; + bool bitCast; + Op *modeledFpOp; + + FpIntConv(std::string opName, bool f2i, bool bitCast, Op *modeledFpOp) + : opName(opName), f2i(f2i), bitCast(bitCast), modeledFpOp(modeledFpOp) {} + + FuncDecl *getUninterpretedFpIntCast(unsigned fpBw, unsigned intBw, + bool rMode) const { + std::string srcType = f2i ? getFpTypeName(fpBw) : getIntTypeName(intBw); + std::string desType = f2i ? getIntTypeName(intBw) : getFpTypeName(fpBw); + std::list bs = f2i ? makeFpVars(1, fpBw) : makeIntVars(1, srcType); + + if (rMode) + bs.insert(bs.begin(), {makeRMODEVarName(), getRMODETypeName()}); + + // e.g., function $fp2ui.bvhalf.i1(rm: rmode, f: bvhalf) returns (i1); + return uninterpretedOp("$" + opName, {srcType, desType}, bs, desType); + } + + FuncDecl *getModeledFpFunc(unsigned fpBw, unsigned intBw) const { + // Note that these functions are used in math.c + // which is not sensitive to the flags. + // So we have to include all of the conversion. + + // Warning: undefined behaviors can occur + // https://llvm.org/docs/LangRef.html#uitofp-to-instruction + if (!SmackOptions::BitPrecise) + return getUninterpretedFpIntCast(fpBw, intBw, !bitCast); + + std::string srcType = f2i ? getFpTypeName(fpBw) : getBvTypeName(intBw); + std::string desType = f2i ? getBvTypeName(intBw) : getFpTypeName(fpBw); + std::list bs = f2i ? makeFpVars(1, fpBw) : makeIntVars(1, srcType); + std::string name = "$" + opName; + + if (!bitCast) + bs.insert(bs.begin(), {makeRMODEVarName(), getRMODETypeName()}); + if (auto bop = dyn_cast>(modeledFpOp)) + // e.g., function {:builtin "(_ fp.to_sbv 1)"} + // $fp2si.bvhalf.bv1(rm: rmode, f: bvhalf) returns (bv1); + return builtinOp(name, ((attrT)bop->func)(fpBw, intBw), + {srcType, desType}, bs, desType); + else if (isa(modeledFpOp)) + // e.g., function $bitcast.bvhalf.bv16(f: bvhalf) returns (bv16); + return uninterpretedOp(name, {srcType, desType}, bs, desType); + else + llvm_unreachable("no inlined fp/bv cast"); + } + + FuncDecl *getUninterpretedFpFunc(unsigned intBw) const { + if (!SmackOptions::BitPrecise) + return getUninterpretedFpIntCast(0, intBw, false); + + std::string srcType = f2i ? getFpTypeName(0) : getBvTypeName(intBw); + std::string desType = f2i ? getBvTypeName(intBw) : getFpTypeName(0); + std::list bs = f2i ? makeFpVars(1, 0) : makeIntVars(1, srcType); + + // e.g., function $fp2ui.float.i1(f: float) returns (i1); + return uninterpretedOp("$" + opName, {srcType, desType}, bs, desType); + } + + // generate bv to fp bitcast builtin attribute such as `:builtin "(_ to_fp 5 + // 11)"` + static const Attr *bitcastAttr(unsigned fpBw, unsigned intBw) { + std::string attr = "(_ to_fp " + std::to_string(FP_LAYOUT.at(fpBw).first) + + " " + std::to_string(FP_LAYOUT.at(fpBw).second) + ")"; + return makeBuiltinAttr(attr); + } + + // generate fp/bv conversion builtin attribute such as `:builtin "(_ fp.to_sbv + // 1)"` + template + static const Attr *fpIntAttr(unsigned fpBw, unsigned intBw) { + std::string signLetter = SIGN ? "s" : "u"; + std::string attr = + F2I ? ("(_ fp.to_" + signLetter + "bv " + std::to_string(intBw) + ")") + : (std::string("(_ to_fp") + (SIGN ? " " : "_unsigned ") + + std::to_string(FP_LAYOUT.at(fpBw).first) + " " + + std::to_string(FP_LAYOUT.at(fpBw).second) + ")"); + return makeBuiltinAttr(attr); + } +}; + +void FpOpGen::generateFpIntConv(std::stringstream &s) const { + describe("Floating-point/integer conversion", s); + + auto uninterpretedOp = new UninterpretedOp(); + const std::vector fpIntConvTable{ + {"bitcast", true, true, uninterpretedOp}, + {"bitcast", false, true, + new BuiltinOp(FpIntConv::bitcastAttr)}, + {"fp2si", true, false, + new BuiltinOp(FpIntConv::fpIntAttr)}, + {"fp2ui", true, false, + new BuiltinOp(FpIntConv::fpIntAttr)}, + {"si2fp", false, false, + new BuiltinOp(FpIntConv::fpIntAttr)}, + {"ui2fp", false, false, + new BuiltinOp(FpIntConv::fpIntAttr)}, + }; + + for (auto &conv : fpIntConvTable) { + if (SmackOptions::FloatEnabled) { + for (auto bw : FP_BIT_WIDTHS) { + for (auto is : IntOpGen::INTEGER_SIZES) { + if (!conv.bitCast || bw == is) + s << conv.getModeledFpFunc(bw, is) << "\n"; + } + } + } else { + for (auto is : IntOpGen::INTEGER_SIZES) + if (!conv.bitCast || is == 8 || + std::find(FP_BIT_WIDTHS.begin(), FP_BIT_WIDTHS.end(), is) != + FP_BIT_WIDTHS.end()) + s << conv.getUninterpretedFpFunc(is) << "\n"; + } + } +} + +void FpOpGen::generateMemOps(std::stringstream &s) const { + describe("Floating-point load/store operations", s); + + if (SmackOptions::FloatEnabled) { + for (auto bw : FP_BIT_WIDTHS) { + std::string type = getFpTypeName(bw); + auto binding = makeFpVars(1, bw).front(); + // e.g., function {:inline} $load.bvhalf(M: [ref] bvhalf, p: ref) + // returns (bvhalf) { M[p] } + s << prelude.safeLoad(type) << "\n"; + // e.g., function {:inline} $store.bvhalf(M: [ref] bvhalf, p: ref, f: + // bvhalf) + // returns ([ref] bvhalf) { M[p := f] } + s << prelude.safeStore(binding) << "\n"; + + if (SmackOptions::BitPrecise) { + std::string bvType = getBvTypeName(bw); + // e.g., function {:inline} $load.bytes.bvhalf(M: [ref] bv8, p: ref) + // returns (bvhalf) { $bitcast.bv16.bvhalf($load.bytes.bv16(M, p)) } + s << prelude.unsafeLoad( + type, + Expr::fn(indexedName("$bitcast", {bvType, type}), + Expr::fn(indexedName("$load", {"bytes", bvType}), + makeMapVarExpr(0), makePtrVarExpr(0)))) + << "\n"; + // e.g., function {:inline} $store.bytes.bvhalf(M: [ref] bv8, p: ref, f: + // bvhalf) + // returns ([ref] bv8) { $store.bytes.bv16(M, p, + // $bitcast.bvhalf.bv16(f)) } + s << prelude.unsafeStore( + binding, + Expr::fn(indexedName("$store", {"bytes", bvType}), + makeMapVarExpr(0), makePtrVarExpr(0), + Expr::fn(indexedName("$bitcast", {type, bvType}), + makeFpVarExpr(0)))) + << "\n"; + } else { + std::string intType = getIntTypeName(bw); + // e.g., function {:inline} $load.unsafe.bvhalf(M: [ref] i8, p: ref) + // returns (bvhalf) { $bitcast.i16.bvhalf($load.i16(M, p)) } + s << prelude.unsafeLoad( + type, Expr::fn(indexedName("$bitcast", {intType, type}), + Expr::fn(indexedName("$load", {intType}), + makeMapVarExpr(0), makePtrVarExpr(0))), + false) + << "\n"; + // e.g., function {:inline} $store.unsafe.bvfloat(M: [ref] i8, p: ref, + // f: bvfloat) + // returns ([ref] i8) { $store.i32(M, p, $bitcast.bvfloat.i32(f)) } + s << prelude.unsafeStore( + binding, + Expr::fn(indexedName("$store", {intType}), makeMapVarExpr(0), + makePtrVarExpr(0), + Expr::fn(indexedName("$bitcast", {type, intType}), + makeFpVarExpr(0))), + false) + << "\n"; + } + } + } else { + std::string type = getFpTypeName(0); + auto binding = makeFpVars(1, 0).front(); + // function {:inline} $load.float(M: [ref] float, p: ref) returns (float) { + // M[p] } + s << prelude.safeLoad(type) << "\n"; + // function {:inline} $store.float(M: [ref] float, p: ref, f: float) + // returns ([ref] float) { M[p := f] } + s << prelude.safeStore(binding) << "\n"; + + if (SmackOptions::BitPrecise) { + std::string bvType = getBvTypeName(8); + // function {:inline} $load.bytes.float(M: [ref] bv8, p: ref) + // returns (float) { $bitcast.bv8.float(M[p]) } + s << prelude.unsafeLoad(type, + Expr::fn(indexedName("$bitcast", {bvType, type}), + prelude.mapSelExpr(0))) + << "\n"; + // function {:inline} $store.bytes.float(M: [ref] bv8, p: ref, f: float) + // returns ([ref] bv8) { M[p := $bitcast.float.bv8(f)] } + s << prelude.unsafeStore( + binding, + prelude.mapUpdExpr( + 0, Expr::fn(indexedName("$bitcast", {type, bvType}), + makeFpVarExpr(0)))) + << "\n"; + } else { + std::string intType = getIntTypeName(8); + // function {:inline} $load.unsafe.float(M: [ref] i8, p: ref) + // returns (float) { $bitcast.i8.float(M[p]) } + s << prelude.unsafeLoad(type, + Expr::fn(indexedName("$bitcast", {intType, type}), + prelude.mapSelExpr(0)), + false) + << "\n"; + // function {:inline} $store.unsafe.float(M: [ref] i8, p: ref, f: float) + // returns ([ref] i8) { M[p := $bitcast.float.i8(f)] } + s << prelude.unsafeStore( + binding, + prelude.mapUpdExpr( + 0, Expr::fn(indexedName("$bitcast", {type, intType}), + makeFpVarExpr(0))), + false) + << "\n"; + } + } +} + +void FpOpGen::generateExtractValueFuncs(std::stringstream &s) const { + if (SmackOptions::FloatEnabled) { + for (auto bw : FP_BIT_WIDTHS) + s << extractValue(getFpTypeName(bw)) << "\n"; + } else + s << extractValue(Naming::UNINTERPRETED_FLOAT_TYPE) << "\n"; +} + +void FpOpGen::generate(std::stringstream &s) const { + // generate type-specific declarations + if (SmackOptions::FloatEnabled) { + // rounding mode declaration + // var $rmode: rmode; + s << Decl::variable(Naming::RMODE_VAR, getRMODETypeName()); + } else { + // uninterpreted floating-point type constructor + // function $fp(ipart:int, fpart:int, epart:int) returns (float); + s << Decl::function("$fp", + {{"ipart", "int"}, {"fpart", "int"}, {"epart", "int"}}, + getFpTypeName(0), nullptr, {}) + << "\n"; + } + + generateArithOps(s); + generatePreds(s); + generateFpIntConv(s); + generateConvOps(s); + generateMemOps(s); + generateExtractValueFuncs(s); +} + +std::string Prelude::getPrelude() { + std::stringstream s; + + typeDeclGen->generate(s); + constDeclGen->generate(s); + memDeclGen->generate(s); + intOpGen->generate(s); + ptrOpGen->generate(s); + fpOpGen->generate(s); + + return s.str(); +} + +} // namespace smack diff --git a/lib/smack/Regions.cpp b/lib/smack/Regions.cpp index 2b4b956f8..c1d20e3e2 100644 --- a/lib/smack/Regions.cpp +++ b/lib/smack/Regions.cpp @@ -1,89 +1,86 @@ // // This file is distributed under the MIT License. See LICENSE for details. // -#include "dsa/DSNode.h" +#include "smack/Regions.h" +#include "assistDS/DSNodeEquivs.h" #include "dsa/DSGraph.h" +#include "dsa/DSNode.h" #include "dsa/DataStructure.h" #include "dsa/TypeSafety.h" -#include "assistDS/DSNodeEquivs.h" -#include "smack/Regions.h" -#include "smack/SmackOptions.h" #include "smack/DSAWrapper.h" -#include "llvm/IR/GetElementPtrTypeIterator.h" #include "smack/Debug.h" +#include "smack/SmackOptions.h" +#include "llvm/IR/GetElementPtrTypeIterator.h" #define DEBUG_TYPE "regions" namespace smack { -const DataLayout* Region::DL = nullptr; -DSAWrapper* Region::DSA = nullptr; +const DataLayout *Region::DL = nullptr; +DSAWrapper *Region::DSA = nullptr; // DSNodeEquivs* Region::NEQS = nullptr; namespace { - const Function* getFunction(const Value* V) { - if (const Instruction *I = dyn_cast(V)) - return I->getParent()->getParent(); - else if (const Argument *A = dyn_cast(V)) - return A->getParent(); - else if (const BasicBlock *BB = dyn_cast(V)) - return BB->getParent(); - - // XXX I know this looks bad, but it works for now - for (auto U : V->users()) - return getFunction(U); - - llvm_unreachable("Unexpected value."); - } - - bool isFieldDisjoint(DSAWrapper* DSA, const Value* V, unsigned offset) { - if (const GlobalValue* G = dyn_cast(V)) - return DSA->isFieldDisjoint(G, offset); - else - return DSA->isFieldDisjoint(V, getFunction(V)); - } +const Function *getFunction(const Value *V) { + if (const Instruction *I = dyn_cast(V)) + return I->getParent()->getParent(); + else if (const Argument *A = dyn_cast(V)) + return A->getParent(); + else if (const BasicBlock *BB = dyn_cast(V)) + return BB->getParent(); + + // XXX I know this looks bad, but it works for now + for (auto U : V->users()) + return getFunction(U); + + llvm_unreachable("Unexpected value."); +} +bool isFieldDisjoint(DSAWrapper *DSA, const Value *V, unsigned offset) { + if (const GlobalValue *G = dyn_cast(V)) + return DSA->isFieldDisjoint(G, offset); + else + return DSA->isFieldDisjoint(V, getFunction(V)); +} } -void Region::init(Module& M, Pass& P) { +void Region::init(Module &M, Pass &P) { DL = &M.getDataLayout(); DSA = &P.getAnalysis(); } namespace { - unsigned numGlobals(const DSNode* N) { - unsigned count = 0; - - // shamelessly ripped from getCaption(..) in lib/DSA/Printer.cpp - EquivalenceClasses *GlobalECs = 0; - const DSGraph *G = N->getParentGraph(); - if (G) GlobalECs = &G->getGlobalECs(); - - for (auto i = N->globals_begin(), e = N->globals_end(); i != e; ++i) { - count += 1; - - if (GlobalECs) { - // Figure out how many globals are equivalent to this one. - auto I = GlobalECs->findValue(*i); - if (I != GlobalECs->end()) { - count += std::distance( - GlobalECs->member_begin(I), GlobalECs->member_end()) - 1; - } +unsigned numGlobals(const DSNode *N) { + unsigned count = 0; + + // shamelessly ripped from getCaption(..) in lib/DSA/Printer.cpp + EquivalenceClasses *GlobalECs = 0; + const DSGraph *G = N->getParentGraph(); + if (G) + GlobalECs = &G->getGlobalECs(); + + for (auto i = N->globals_begin(), e = N->globals_end(); i != e; ++i) { + count += 1; + + if (GlobalECs) { + // Figure out how many globals are equivalent to this one. + auto I = GlobalECs->findValue(*i); + if (I != GlobalECs->end()) { + count += + std::distance(GlobalECs->member_begin(I), GlobalECs->member_end()) - + 1; } } - - return count; } + + return count; +} } -bool Region::isSingleton(const DSNode* N, unsigned offset, unsigned length) { - if (N->isGlobalNode() - && numGlobals(N) == 1 - && !N->isArrayNode() - && !N->isAllocaNode() - && !N->isHeapNode() - && !N->isExternalNode() - && !N->isUnknownNode()) { +bool Region::isSingleton(const DSNode *N, unsigned offset, unsigned length) { + if (N->isGlobalNode() && numGlobals(N) == 1 && !N->isArrayNode() && + !N->isAllocaNode() && !N->isHeapNode() && !N->isExternalNode() && + !N->isUnknownNode()) { // TODO can we do something for non-global nodes? @@ -98,39 +95,43 @@ bool Region::isSingleton(const DSNode* N, unsigned offset, unsigned length) { assert(DL && "Missing data layout information."); for (auto I = N->type_begin(), E = N->type_end(); I != E; ++I) { - if (I->first < offset) continue; - if (I->first > offset) break; - if (I->second->begin() == I->second->end()) break; - if ((++(I->second->begin())) != I->second->end()) break; - Type* T = *I->second->begin(); - if (!T->isSized()) break; - if (DL->getTypeAllocSize(T) != length) break; - if (!T->isSingleValueType()) break; + if (I->first < offset) + continue; + if (I->first > offset) + break; + if (I->second->begin() == I->second->end()) + break; + if ((++(I->second->begin())) != I->second->end()) + break; + Type *T = *I->second->begin(); + if (!T->isSized()) + break; + if (DL->getTypeAllocSize(T) != length) + break; + if (!T->isSingleValueType()) + break; return true; } } return false; } -bool Region::isAllocated(const DSNode* N) { - return N->isHeapNode() - || N->isAllocaNode(); +bool Region::isAllocated(const DSNode *N) { + return N->isHeapNode() || N->isAllocaNode(); } -bool Region::isComplicated(const DSNode* N) { - return N->isIntToPtrNode() - || N->isIntToPtrNode() - || N->isExternalNode() - || N->isUnknownNode(); +bool Region::isComplicated(const DSNode *N) { + return N->isIntToPtrNode() || N->isPtrToIntNode() || N->isExternalNode() || + N->isUnknownNode(); } -void Region::init(const Value* V, unsigned length) { - Type* T = V->getType(); - assert (T->isPointerTy() && "Expected pointer argument."); +void Region::init(const Value *V, unsigned length) { + Type *T = V->getType(); + assert(T->isPointerTy() && "Expected pointer argument."); T = T->getPointerElementType(); context = &V->getContext(); - representative = (DSA && !dyn_cast(V)) - ? DSA->getNode(V) : nullptr; + representative = + (DSA && !dyn_cast(V)) ? DSA->getNode(V) : nullptr; this->type = T; int offset = DSA ? DSA->getOffset(V) : 0; if (offset < 0) { @@ -141,34 +142,32 @@ void Region::init(const Value* V, unsigned length) { this->length = length; } - singleton = DL && representative - && isSingleton(representative, offset, length); - + singleton = + DL && representative && isSingleton(representative, offset, length); allocated = !representative || isAllocated(representative); bytewise = DSA && SmackOptions::BitPrecise && - (SmackOptions::NoByteAccessInference || !isFieldDisjoint(DSA,V,offset) || - DSA->isMemcpyd(representative) || T->isIntegerTy(8)); + (SmackOptions::NoByteAccessInference || + !isFieldDisjoint(DSA, V, offset) || + DSA->isMemcpyd(representative) || T->isIntegerTy(8)); incomplete = !representative || representative->isIncompleteNode(); complicated = !representative || isComplicated(representative); collapsed = !representative || representative->isCollapsedNode(); } -Region::Region(const Value* V) { - unsigned length = DSA ? DSA->getPointedTypeSize(V) : - std::numeric_limits::max(); +Region::Region(const Value *V) { + unsigned length = + DSA ? DSA->getPointedTypeSize(V) : std::numeric_limits::max(); init(V, length); } -Region::Region(const Value* V, unsigned length) { - init(V, length); -} +Region::Region(const Value *V, unsigned length) { init(V, length); } bool Region::isDisjoint(unsigned offset, unsigned length) { - return this->offset + this->length <= offset - || offset + length <= this->offset; + return this->offset + this->length <= offset || + offset + length <= this->offset; } -void Region::merge(Region& R) { +void Region::merge(Region &R) { bool collapse = type != R.type; unsigned long low = std::min(offset, R.offset); unsigned long high = std::max(offset + length, R.offset + R.length); @@ -183,19 +182,23 @@ void Region::merge(Region& R) { type = (bytewise || collapse) ? NULL : type; } -bool Region::overlaps(Region& R) { - return (incomplete && R.incomplete) - || (complicated && R.complicated) - || (representative == R.representative - && (collapsed || !isDisjoint(R.offset, R.length))); +bool Region::overlaps(Region &R) { + return (incomplete && R.incomplete) || (complicated && R.complicated) || + (representative == R.representative && + (collapsed || !isDisjoint(R.offset, R.length))); } -void Region::print(raw_ostream& O) { +void Region::print(raw_ostream &O) { // TODO identify the representative O << "[" << offset << "," << (offset + length) << "]{"; - if (isSingleton()) O << "S"; - if (bytewise) O << "B"; - if (isAllocated()) O << "A"; + if (isSingleton()) + O << "S"; + if (bytewise) + O << "B"; + if (complicated) + O << "C"; + if (isAllocated()) + O << "A"; O << "}"; } @@ -209,79 +212,71 @@ void Regions::getAnalysisUsage(llvm::AnalysisUsage &AU) const { AU.addRequiredTransitive(); AU.addRequiredTransitive(); AU.addRequiredTransitive(); - AU.addRequiredTransitive >(); + AU.addRequiredTransitive>(); AU.addRequired(); } } -bool Regions::runOnModule(Module& M) { +bool Regions::runOnModule(Module &M) { if (!SmackOptions::NoMemoryRegionSplitting) { - Region::init(M,*this); + Region::init(M, *this); visit(M); } return false; } -unsigned Regions::size() const { - return regions.size(); -} +unsigned Regions::size() const { return regions.size(); } -Region& Regions::get(unsigned R) { - return regions[R]; -} +Region &Regions::get(unsigned R) { return regions[R]; } -unsigned Regions::idx(const Value* V) { - DEBUG( - errs() << "[regions] for: " << *V << "\n"; - auto U = V; - while (U && !isa(U) && !U->use_empty()) U = U->user_back(); - if (auto I = dyn_cast(U)) { - auto F = I->getParent()->getParent(); - if (I != V) - errs() << " at instruction: " << *I << "\n"; - errs() << " in function: " << F->getName() << "\n"; - } - ); +unsigned Regions::idx(const Value *V) { + SDEBUG(errs() << "[regions] for: " << *V << "\n"; auto U = V; + while (U && !isa(U) && !U->use_empty()) U = + U->user_back(); + if (auto I = dyn_cast(U)) { + auto F = I->getParent()->getParent(); + if (I != V) + errs() << " at instruction: " << *I << "\n"; + errs() << " in function: " << F->getName() << "\n"; + }); Region R(V); return idx(R); } -unsigned Regions::idx(const Value* V, unsigned length) { - DEBUG( - errs() << "[regions] for: " << *V << " with length " << length << "\n"; - auto U = V; - while (U && !isa(U) && !U->use_empty()) U = U->user_back(); - if (auto I = dyn_cast(U)) { - auto F = I->getParent()->getParent(); - if (I != V) - errs() << " at instruction: " << *I << "\n"; - errs() << " in function: " << F->getName() << "\n"; - } - ); - Region R(V,length); +unsigned Regions::idx(const Value *V, unsigned length) { + SDEBUG(errs() << "[regions] for: " << *V << " with length " << length << "\n"; + auto U = V; while (U && !isa(U) && !U->use_empty()) U = + U->user_back(); + if (auto I = dyn_cast(U)) { + auto F = I->getParent()->getParent(); + if (I != V) + errs() << " at instruction: " << *I << "\n"; + errs() << " in function: " << F->getName() << "\n"; + }); + Region R(V, length); return idx(R); } -unsigned Regions::idx(Region& R) { +unsigned Regions::idx(Region &R) { unsigned r; - DEBUG(errs() << "[regions] using region: "); - DEBUG(R.print(errs())); - DEBUG(errs() << "\n"); + SDEBUG(errs() << "[regions] using region: "); + SDEBUG(R.print(errs())); + SDEBUG(errs() << "\n"); for (r = 0; r < regions.size(); ++r) { if (regions[r].overlaps(R)) { - DEBUG(errs() << "[regions] found overlap at index " << r << ": "); - DEBUG(regions[r].print(errs())); - DEBUG(errs() << "\n"); + SDEBUG(errs() << "[regions] found overlap at index " << r << ": "); + SDEBUG(regions[r].print(errs())); + SDEBUG(errs() << "\n"); regions[r].merge(R); - DEBUG(errs() << "[regions] merged region: "); - DEBUG(regions[r].print(errs())); - DEBUG(errs() << "\n"); + SDEBUG(errs() << "[regions] merged region: "); + SDEBUG(regions[r].print(errs())); + SDEBUG(errs() << "\n"); break; } @@ -293,20 +288,21 @@ unsigned Regions::idx(Region& R) { else { // Here is the tricky part: in case R was merged with an existing region, // we must now also merge any other region which intersects with R. - unsigned q = r+1; + unsigned q = r + 1; while (q < regions.size()) { if (regions[r].overlaps(regions[q])) { - DEBUG(errs() << "[regions] found extra overlap at index " << q << ": "); - DEBUG(regions[q].print(errs())); - DEBUG(errs() << "\n"); + SDEBUG(errs() << "[regions] found extra overlap at index " << q + << ": "); + SDEBUG(regions[q].print(errs())); + SDEBUG(errs() << "\n"); regions[r].merge(regions[q]); - regions.erase(regions.begin()+q); + regions.erase(regions.begin() + q); - DEBUG(errs() << "[regions] merged region: "); - DEBUG(regions[r].print(errs())); - DEBUG(errs() << "\n"); + SDEBUG(errs() << "[regions] merged region: "); + SDEBUG(regions[r].print(errs())); + SDEBUG(errs() << "\n"); } else { q++; @@ -314,18 +310,14 @@ unsigned Regions::idx(Region& R) { } } - DEBUG(errs() << "[regions] returning index: " << r << "\n\n"); + SDEBUG(errs() << "[regions] returning index: " << r << "\n\n"); return r; } -void Regions::visitLoadInst(LoadInst& I) { - idx(I.getPointerOperand()); -} +void Regions::visitLoadInst(LoadInst &I) { idx(I.getPointerOperand()); } -void Regions::visitStoreInst(StoreInst& I) { - idx(I.getPointerOperand()); -} +void Regions::visitStoreInst(StoreInst &I) { idx(I.getPointerOperand()); } void Regions::visitAtomicCmpXchgInst(AtomicCmpXchgInst &I) { idx(I.getPointerOperand()); @@ -343,11 +335,11 @@ void Regions::visitMemIntrinsic(MemIntrinsic &I) { else length = std::numeric_limits::max(); - idx(I.getDest(),length); + idx(I.getDest(), length); } -void Regions::visitCallInst(CallInst& I) { - Function* F = I.getCalledFunction(); +void Regions::visitCallInst(CallInst &I) { + Function *F = I.getCalledFunction(); std::string name = F && F->hasName() ? F->getName().str() : ""; if (I.getType()->isPointerTy()) @@ -355,19 +347,19 @@ void Regions::visitCallInst(CallInst& I) { if (name.find("__SMACK_values") != std::string::npos) { assert(I.getNumArgOperands() == 2 && "Expected two operands."); - const Value* P = I.getArgOperand(0); - const Value* N = I.getArgOperand(1); + const Value *P = I.getArgOperand(0); + const Value *N = I.getArgOperand(1); while (isa(P)) P = dyn_cast(P)->getOperand(0); - const PointerType* T = dyn_cast(P->getType()); + const PointerType *T = dyn_cast(P->getType()); assert(T && "Expected pointer argument."); if (auto I = dyn_cast(N)) { const unsigned bound = I->getZExtValue(); const unsigned size = T->getElementType()->getIntegerBitWidth() / 8; const unsigned length = bound * size; - idx(P,length); + idx(P, length); } else { llvm_unreachable("Non-constant size expression not yet handled."); diff --git a/lib/smack/RemoveDeadDefs.cpp b/lib/smack/RemoveDeadDefs.cpp index 2b9ff09c9..09d1a9aa7 100644 --- a/lib/smack/RemoveDeadDefs.cpp +++ b/lib/smack/RemoveDeadDefs.cpp @@ -4,11 +4,11 @@ #define DEBUG_TYPE "remove-dead-defs" -#include "smack/SmackOptions.h" #include "smack/RemoveDeadDefs.h" #include "smack/Debug.h" -#include "llvm/Support/raw_ostream.h" +#include "smack/SmackOptions.h" #include "llvm/IR/DataLayout.h" +#include "llvm/Support/raw_ostream.h" #include @@ -16,9 +16,9 @@ namespace smack { using namespace llvm; -bool RemoveDeadDefs::runOnModule(Module& M) { +bool RemoveDeadDefs::runOnModule(Module &M) { TD = &M.getDataLayout(); - std::vector dead; + std::vector dead; do { dead.clear(); @@ -32,12 +32,12 @@ bool RemoveDeadDefs::runOnModule(Module& M) { continue; if (name.find("__VERIFIER_assume") != std::string::npos) - continue; + continue; if (SmackOptions::isEntryPoint(name)) continue; - DEBUG(errs() << "removing dead definition: " << name << "\n"); + SDEBUG(errs() << "removing dead definition: " << name << "\n"); dead.push_back(&F); } @@ -52,7 +52,6 @@ bool RemoveDeadDefs::runOnModule(Module& M) { char RemoveDeadDefs::ID = 0; // Register the pass -static RegisterPass -X("remove-dead-defs", "Remove Dead Definitions"); - +static RegisterPass X("remove-dead-defs", + "Remove Dead Definitions"); } diff --git a/lib/smack/SimplifyLibCalls.cpp b/lib/smack/SimplifyLibCalls.cpp index 48a259ea0..6c65cae8a 100644 --- a/lib/smack/SimplifyLibCalls.cpp +++ b/lib/smack/SimplifyLibCalls.cpp @@ -4,33 +4,31 @@ #define DEBUG_TYPE "simplify-libcalls" -#include "smack/SmackOptions.h" -#include "smack/Naming.h" #include "smack/SimplifyLibCalls.h" #include "smack/Debug.h" +#include "smack/Naming.h" +#include "smack/SmackOptions.h" #include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" -#include -#include #include #include +#include +#include namespace smack { using namespace llvm; -void SimplifyLibCalls::getAnalysisUsage(AnalysisUsage& AU) const { +void SimplifyLibCalls::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired(); } -bool SimplifyLibCalls::runOnModule(Module& M) { +bool SimplifyLibCalls::runOnModule(Module &M) { modified = false; simplifier = new LibCallSimplifier( - M.getDataLayout(), - &getAnalysis().getTLI() - ); + M.getDataLayout(), &getAnalysis().getTLI()); if (simplifier) visit(M); return modified; @@ -46,7 +44,6 @@ void SimplifyLibCalls::visitCallInst(CallInst &I) { char SimplifyLibCalls::ID = 0; // Register the pass -static RegisterPass -X("simplify-libcalls", "Simplify Library Calls"); - +static RegisterPass X("simplify-libcalls", + "Simplify Library Calls"); } diff --git a/lib/smack/Slicing.cpp b/lib/smack/Slicing.cpp index cc792225c..4e4f57234 100644 --- a/lib/smack/Slicing.cpp +++ b/lib/smack/Slicing.cpp @@ -3,51 +3,55 @@ // #include "smack/Slicing.h" +#include "smack/Debug.h" #include "smack/SmackInstGenerator.h" -#include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Analysis/CFG.h" #include "llvm/IR/Instructions.h" -#include "smack/Debug.h" -#include +#include "llvm/Transforms/Utils/BasicBlockUtils.h" #include #include +#include using namespace llvm; namespace smack { -typedef SmallVector< pair, 10 > EdgeList; +typedef SmallVector, 10> EdgeList; -bool contains(EdgeList& backedges, const BasicBlock* src, const BasicBlock* tgt) { - for (EdgeList::iterator E = backedges.begin(), End = backedges.end(); E != End; ++E) { +bool contains(EdgeList &backedges, const BasicBlock *src, + const BasicBlock *tgt) { + for (EdgeList::iterator E = backedges.begin(), End = backedges.end(); + E != End; ++E) { if (E->first == src && E->second == tgt) return true; } return false; } -bool hasIncomingBackEdge(PHINode* Phi, EdgeList& backedges) { - for (PHINode::block_iterator B = Phi->block_begin(); B != Phi->block_end(); ++B) { - if (contains(backedges,*B,Phi->getParent())) +bool hasIncomingBackEdge(PHINode *Phi, EdgeList &backedges) { + for (PHINode::block_iterator B = Phi->block_begin(); B != Phi->block_end(); + ++B) { + if (contains(backedges, *B, Phi->getParent())) return true; } return false; } -Value* getQuantifiedVariable(Instruction* I) { - if (CallInst* CI = dyn_cast(I)) - if (Function* F = CI->getCalledFunction()) +Value *getQuantifiedVariable(Instruction *I) { + if (CallInst *CI = dyn_cast(I)) + if (Function *F = CI->getCalledFunction()) if (F->hasName() && F->getName().find("qvar") != string::npos) - if (ConstantExpr* CE = dyn_cast(CI->getArgOperand(0))) + if (ConstantExpr *CE = dyn_cast(CI->getArgOperand(0))) if (CE->getOpcode() == Instruction::GetElementPtr) - if (GlobalValue* G = dyn_cast(CE->getOperand(0))) - if (ConstantDataSequential* S = dyn_cast(G->getOperand(0))) + if (GlobalValue *G = dyn_cast(CE->getOperand(0))) + if (ConstantDataSequential *S = + dyn_cast(G->getOperand(0))) return S; return 0; } -GlobalValue* usedGlobal(User* U) { - GlobalValue* G = 0; +GlobalValue *usedGlobal(User *U) { + GlobalValue *G = 0; for (User::op_iterator V = U->op_begin(), E = U->op_end(); V != E; ++V) { if (dyn_cast(V)) continue; @@ -59,13 +63,13 @@ GlobalValue* usedGlobal(User* U) { return G; } -Slice* getSubslice(Instruction* I, Slices& slices) { - if (CallInst* CI = dyn_cast(I)) - if (Function* F = CI->getCalledFunction()) +Slice *getSubslice(Instruction *I, Slices &slices) { + if (CallInst *CI = dyn_cast(I)) + if (Function *F = CI->getCalledFunction()) if (F->hasName()) if (F->getName().find("forall") != string::npos || F->getName().find("exists") != string::npos) - if (ConstantInt* C = dyn_cast(CI->getArgOperand(1))) { + if (ConstantInt *C = dyn_cast(CI->getArgOperand(1))) { uint64_t i = C->getLimitedValue(); assert(slices.size() > i && "Did not find expression."); return slices[i]; @@ -74,16 +78,16 @@ Slice* getSubslice(Instruction* I, Slices& slices) { return 0; } -pair getParameter(Value* V, Naming& naming, SmackRep& rep) { +pair getParameter(Value *V, Naming &naming, SmackRep &rep) { - if (GlobalVariable* G = dyn_cast(V)) { + if (GlobalVariable *G = dyn_cast(V)) { // XXX I need to be fixed FIXME unsigned r = 0; // rep.getRegion(G); llvm_unreachable("This code is under contsruction."); return make_pair(rep.memReg(r), rep.memType(r)); } - else if (ConstantDataSequential* S = dyn_cast(V)) + else if (ConstantDataSequential *S = dyn_cast(V)) return make_pair(S->getAsCString(), "int"); else if (V->hasName() && V->getName().find("result") != string::npos) @@ -93,39 +97,40 @@ pair getParameter(Value* V, Naming& naming, SmackRep& rep) { return make_pair(naming.get(*V), rep.type(V)); } -Slice::Slice(Instruction& I, Slices& S, string name) - : value(I), block(*I.getParent()), function(*block.getParent()), - context(function.getContext()), slices(S), name(name) { +Slice::Slice(Instruction &I, Slices &S, string name) + : value(I), block(*I.getParent()), function(*block.getParent()), + context(function.getContext()), slices(S), name(name) { EdgeList backedges; FindFunctionBackedges(function, backedges); - queue workList; + queue workList; workList.push(&I); while (!workList.empty()) { - Instruction* I = workList.front(); + Instruction *I = workList.front(); workList.pop(); if (values.count(I) || inputs.count(I)) continue; - if (PHINode* Phi = dyn_cast(I)) { + if (PHINode *Phi = dyn_cast(I)) { if (hasIncomingBackEdge(Phi, backedges)) { inputs.insert(I); continue; } } - if (GlobalValue* G = usedGlobal(I)) + if (GlobalValue *G = usedGlobal(I)) inputs.insert(G); - if (Value* Q = getQuantifiedVariable(I)) + if (Value *Q = getQuantifiedVariable(I)) inputs.insert(Q); // Add inputs from any subslices, excluding quantified variables - if (Slice* S = getSubslice(I,slices)) - for (unordered_set::iterator V = S->inputs.begin(), - E = S->inputs.end(); V != E; ++V) + if (Slice *S = getSubslice(I, slices)) + for (unordered_set::iterator V = S->inputs.begin(), + E = S->inputs.end(); + V != E; ++V) if (!inputs.count(*V) && !dyn_cast(*V)) inputs.insert(*V); @@ -133,13 +138,13 @@ Slice::Slice(Instruction& I, Slices& S, string name) values.insert(I->getParent()); // ENSURE EACH BLOCK HAS A TERMINATOR - if (BranchInst* Br = dyn_cast(I->getParent()->getTerminator())) + if (BranchInst *Br = dyn_cast(I->getParent()->getTerminator())) if (I->getParent() != &block) workList.push(Br); - if (BranchInst* Br = dyn_cast(I)) { + if (BranchInst *Br = dyn_cast(I)) { if (Br->isConditional()) { - if (Instruction* J = dyn_cast(Br->getCondition())) { + if (Instruction *J = dyn_cast(Br->getCondition())) { workList.push(J); } values.insert(Br->getSuccessor(1)); @@ -148,21 +153,21 @@ Slice::Slice(Instruction& I, Slices& S, string name) continue; } - if (PHINode* Phi = dyn_cast(I)) { - for (PHINode::block_iterator B = Phi->block_begin(); B != Phi->block_end(); ++B) { - workList.push( (*B)->getTerminator() ); + if (PHINode *Phi = dyn_cast(I)) { + for (PHINode::block_iterator B = Phi->block_begin(); + B != Phi->block_end(); ++B) { + workList.push((*B)->getTerminator()); } } for (User::op_iterator U = I->op_begin(); U != I->op_end(); ++U) { - if (Instruction* J = dyn_cast(U)) { - if (!contains(backedges,J->getParent(),I->getParent())) { + if (Instruction *J = dyn_cast(U)) { + if (!contains(backedges, J->getParent(), I->getParent())) { workList.push(J); } } } } - } void Slice::remove() { @@ -171,12 +176,12 @@ void Slice::remove() { // map succ; - queue workList; - set deleted; + queue workList; + set deleted; workList.push(&value); while (!workList.empty()) { - Value* V = workList.front(); + Value *V = workList.front(); workList.pop(); if (deleted.count(V)) @@ -185,40 +190,39 @@ void Slice::remove() { if (V->getNumUses() > 0) continue; - if (User* U = dyn_cast(V)) + if (User *U = dyn_cast(V)) for (User::op_iterator W = U->op_begin(); W != U->op_end(); ++W) workList.push(*W); - if (PHINode* I = dyn_cast(V)) + if (PHINode *I = dyn_cast(V)) for (PHINode::block_iterator A = I->block_begin(), Z = I->block_end(); - A != Z; ++ A) + A != Z; ++A) workList.push((*A)->getTerminator()); - if (BranchInst* I = dyn_cast(V)) { + if (BranchInst *I = dyn_cast(V)) { if (I->isConditional()) { - Value* C = I->getCondition(); + Value *C = I->getCondition(); workList.push(C); I->setCondition(UndefValue::get(C->getType())); } continue; } - if (Instruction* I = dyn_cast(V)) + if (Instruction *I = dyn_cast(V)) I->eraseFromParent(); deleted.insert(V); } } -string Slice::getName() { - return name; -} +string Slice::getName() { return name; } -const Expr* Slice::getCode(Naming& naming, SmackRep& rep) { - CodeExpr* code = new CodeExpr(rep.getProgram(), {}); +const Expr *Slice::getCode(Naming &naming, SmackRep &rep) { + CodeExpr *code = new CodeExpr(rep.getProgram(), {}); SmackInstGenerator igen(rep, *code, naming, slices); - for (Function::iterator B = function.begin(), E = function.end(); B != E; ++B) { + for (Function::iterator B = function.begin(), E = function.end(); B != E; + ++B) { if (!values.count(B)) continue; igen.visitBasicBlock(*B); @@ -240,29 +244,31 @@ const Expr* Slice::getCode(Naming& naming, SmackRep& rep) { return code; } -const Decl* Slice::getBoogieDecl(Naming& naming, SmackRep& rep) { +const Decl *Slice::getBoogieDecl(Naming &naming, SmackRep &rep) { if (name == "") return 0; Naming localNaming(naming); - vector< pair > params; - for (unordered_set::iterator V = inputs.begin(), E = inputs.end(); V != E; ++V) - params.push_back(getParameter(*V,localNaming,rep)); - Decl* D = Decl::function(getName(),params,"bool",getCode(localNaming,rep)); + vector> params; + for (unordered_set::iterator V = inputs.begin(), E = inputs.end(); + V != E; ++V) + params.push_back(getParameter(*V, localNaming, rep)); + Decl *D = + Decl::function(getName(), params, "bool", getCode(localNaming, rep)); D->addAttr(Attr::attr("inline")); return D; } -const Expr* Slice::getBoogieExpression(Naming& naming, SmackRep& rep) { +const Expr *Slice::getBoogieExpression(Naming &naming, SmackRep &rep) { if (name == "") { Naming localNaming(naming); - const Expr* code = getCode(localNaming,rep); + const Expr *code = getCode(localNaming, rep); return code; } - vector args; - for (unordered_set::iterator V = inputs.begin(), E = inputs.end(); V != E; ++V) - args.push_back(Expr::id(getParameter(*V,naming,rep).first)); - return Expr::fn(getName(),args); + vector args; + for (unordered_set::iterator V = inputs.begin(), E = inputs.end(); + V != E; ++V) + args.push_back(Expr::id(getParameter(*V, naming, rep).first)); + return Expr::fn(getName(), args); } - } diff --git a/lib/smack/SmackInstGenerator.cpp b/lib/smack/SmackInstGenerator.cpp index 9011ad9db..30fd63141 100644 --- a/lib/smack/SmackInstGenerator.cpp +++ b/lib/smack/SmackInstGenerator.cpp @@ -4,41 +4,42 @@ #define DEBUG_TYPE "smack-inst-gen" #include "smack/SmackInstGenerator.h" #include "smack/BoogieAst.h" +#include "smack/Debug.h" +#include "smack/Naming.h" +#include "smack/SmackOptions.h" #include "smack/SmackRep.h" #include "smack/VectorOperations.h" -#include "smack/SmackOptions.h" -#include "smack/Naming.h" -#include "llvm/IR/InstVisitor.h" +#include "llvm/Analysis/LoopInfo.h" #include "llvm/IR/DebugInfo.h" -#include "smack/Debug.h" #include "llvm/IR/GetElementPtrTypeIterator.h" +#include "llvm/IR/InstVisitor.h" #include "llvm/Support/GraphWriter.h" -#include "llvm/Analysis/LoopInfo.h" #include -#include -#include "llvm/Support/raw_ostream.h" #include "dsa/DSNode.h" +#include "llvm/Support/raw_ostream.h" +#include + +#include "smack/SmackWarnings.h" namespace smack { using llvm::errs; using namespace llvm; -const bool CODE_WARN = true; const bool SHOW_ORIG = false; -#define WARN(str) \ - if (CODE_WARN) emit(Stmt::comment(std::string("WARNING: ") + str)) -#define ORIG(ins) \ - if (SHOW_ORIG) emit(Stmt::comment(i2s(ins))) +#define ORIG(ins) \ + if (SHOW_ORIG) \ + emit(Stmt::comment(i2s(ins))) -Regex VAR_DECL("^[[:space:]]*var[[:space:]]+([[:alpha:]_.$#'`~^\\?][[:alnum:]_.$#'`~^\\?]*):.*;"); +Regex VAR_DECL("^[[:space:]]*var[[:space:]]+([[:alpha:]_.$#'`~^\\?][[:alnum:]_." + "$#'`~^\\?]*):.*;"); // Procedures whose return value should not be marked as external Regex EXTERNAL_PROC_IGNORE("^(malloc|__VERIFIER_nondet)$"); -std::string i2s(const llvm::Instruction& i) { +std::string i2s(const llvm::Instruction &i) { std::string s; llvm::raw_string_ostream ss(s); ss << i; @@ -46,46 +47,56 @@ std::string i2s(const llvm::Instruction& i) { return s; } -void SmackInstGenerator::emit(const Stmt* s) { +Type *getElemType(const Type *t, unsigned idx) { + if (const llvm::StructType *st = llvm::dyn_cast(t)) + return st->getElementType(idx); + else if (const llvm::ArrayType *at = llvm::dyn_cast(t)) + return at->getElementType(); + else + llvm_unreachable("Unexpected aggregate type."); +} + +void SmackInstGenerator::emit(const Stmt *s) { // stringstream str; // s->print(str); - // DEBUG(llvm::errs() << "emit: " << str.str() << "\n"); + // SDEBUG(llvm::errs() << "emit: " << str.str() << "\n"); currBlock->addStmt(s); } -const Stmt* SmackInstGenerator::recordProcedureCall( - const llvm::Value* V, std::list attrs) { - auto D = Decl::procedure("boogie_si_record_" + rep->type(V), {{"x", rep->type(V)}}); +const Stmt * +SmackInstGenerator::recordProcedureCall(const llvm::Value *V, + std::list attrs) { + auto D = Decl::procedure("boogie_si_record_" + rep->type(V), + {{"x", rep->type(V)}}); rep->addAuxiliaryDeclaration(D); return Stmt::call(D->getName(), {rep->expr(V)}, {}, attrs); } -Block* SmackInstGenerator::createBlock() { - Block* b = Block::block(naming->freshBlockName()); +Block *SmackInstGenerator::createBlock() { + Block *b = Block::block(naming->freshBlockName()); proc->getBlocks().push_back(b); return b; } -Block* SmackInstGenerator::getBlock(llvm::BasicBlock* bb) { +Block *SmackInstGenerator::getBlock(llvm::BasicBlock *bb) { if (blockMap.count(bb) == 0) blockMap[bb] = createBlock(); return blockMap[bb]; } -void SmackInstGenerator::nameInstruction(llvm::Instruction& inst) { +void SmackInstGenerator::nameInstruction(llvm::Instruction &inst) { if (inst.getType()->isVoidTy()) return; proc->getDeclarations().push_back( - Decl::variable(naming->get(inst), rep->type(&inst)) - ); + Decl::variable(naming->get(inst), rep->type(&inst))); } -void SmackInstGenerator::annotate(llvm::Instruction& I, Block* B) { +void SmackInstGenerator::annotate(llvm::Instruction &I, Block *B) { // do not generate sourceloc from calls to llvm.debug since // those point to variable declaration lines and such - if (llvm::CallInst* ci = llvm::dyn_cast(&I)) { - llvm::Function* f = ci->getCalledFunction(); + if (llvm::CallInst *ci = llvm::dyn_cast(&I)) { + llvm::Function *f = ci->getCalledFunction(); std::string name = f && f->hasName() ? f->getName().str() : ""; if (name.find("llvm.dbg.") != std::string::npos) { return; @@ -96,52 +107,52 @@ void SmackInstGenerator::annotate(llvm::Instruction& I, Block* B) { const DebugLoc DL = I.getDebugLoc(); auto *scope = cast(DL.getScope()); B->addStmt(Stmt::annot(Attr::attr("sourceloc", scope->getFilename().str(), - DL.getLine(), DL.getCol()))); + DL.getLine(), DL.getCol()))); } - //https://stackoverflow.com/questions/22138947/reading-metadata-from-instruction - SmallVector, 4> MDForInst; + // https://stackoverflow.com/questions/22138947/reading-metadata-from-instruction + SmallVector, 4> MDForInst; I.getAllMetadata(MDForInst); SmallVector Names; I.getModule()->getMDKindNames(Names); // for(auto II = MDForInst.begin(), EE = MDForInst.end(); II !=EE; ++II) { - for (auto II : MDForInst){ + for (auto II : MDForInst) { std::string name = Names[II.first]; - if(name.find("smack.") == 0 || name.find("verifier.") == 0) { - std::list attrs; - for(auto AI = II.second->op_begin(), AE = II.second->op_end(); AI != AE; ++AI){ - if (auto *CI = mdconst::dyn_extract(*AI)){ - auto value = CI->getZExtValue(); - attrs.push_back(Expr::lit((long) value)); - } else if (auto *CI = dyn_cast(*AI)){ - auto value = CI->getString(); - attrs.push_back(Expr::lit(value)); - } else { - llvm_unreachable("unexpected attribute type in smack metadata"); - } + if (name.find("smack.") == 0 || name.find("verifier.") == 0) { + std::list attrs; + for (auto AI = II.second->op_begin(), AE = II.second->op_end(); AI != AE; + ++AI) { + if (auto *CI = mdconst::dyn_extract(*AI)) { + auto value = CI->getZExtValue(); + attrs.push_back(Expr::lit((long long)value)); + } else if (auto *CI = dyn_cast(*AI)) { + auto value = CI->getString(); + attrs.push_back(Expr::lit(value)); + } else { + llvm_unreachable("unexpected attribute type in smack metadata"); + } } B->addStmt(Stmt::annot(Attr::attr(name, attrs))); } } } - -void SmackInstGenerator::processInstruction(llvm::Instruction& inst) { - DEBUG(errs() << "Inst: " << inst << "\n"); +void SmackInstGenerator::processInstruction(llvm::Instruction &inst) { + SDEBUG(errs() << "Inst: " << inst << "\n"); annotate(inst, currBlock); ORIG(inst); nameInstruction(inst); nextInst++; } -void SmackInstGenerator::visitBasicBlock(llvm::BasicBlock& bb) { +void SmackInstGenerator::visitBasicBlock(llvm::BasicBlock &bb) { nextInst = bb.begin(); currBlock = getBlock(&bb); - auto* F = bb.getParent(); + auto *F = bb.getParent(); if (&bb == &F->getEntryBlock()) { - for (auto& I : bb.getInstList()) { + for (auto &I : bb.getInstList()) { if (llvm::isa(I)) continue; if (I.getDebugLoc()) { @@ -150,32 +161,36 @@ void SmackInstGenerator::visitBasicBlock(llvm::BasicBlock& bb) { } } if (SmackOptions::isEntryPoint(naming->get(*F))) { - emit(recordProcedureCall(F, {Attr::attr("cexpr", "smack:entry:" + naming->get(*F))})); - for (auto& A : F->getArgumentList()) { - emit(recordProcedureCall(&A, {Attr::attr("cexpr", "smack:arg:" + naming->get(*F) + ":" + naming->get(A))})); + emit(recordProcedureCall( + F, {Attr::attr("cexpr", "smack:entry:" + naming->get(*F))})); + for (auto &A : F->getArgumentList()) { + emit(recordProcedureCall(&A, + {Attr::attr("cexpr", + "smack:arg:" + naming->get(*F) + + ":" + naming->get(A))})); } } } } -void SmackInstGenerator::visitInstruction(llvm::Instruction& inst) { - DEBUG(errs() << "Instruction not handled: " << inst << "\n"); +void SmackInstGenerator::visitInstruction(llvm::Instruction &inst) { + SDEBUG(errs() << "Instruction not handled: " << inst << "\n"); llvm_unreachable("Instruction not handled."); } -void SmackInstGenerator::generatePhiAssigns(llvm::TerminatorInst& ti) { - llvm::BasicBlock* block = ti.getParent(); - std::list lhs; - std::list rhs; +void SmackInstGenerator::generatePhiAssigns(llvm::TerminatorInst &ti) { + llvm::BasicBlock *block = ti.getParent(); + std::list lhs; + std::list rhs; for (unsigned i = 0; i < ti.getNumSuccessors(); i++) { // write to the phi-node variable of the successor - for (llvm::BasicBlock::iterator - s = ti.getSuccessor(i)->begin(), e = ti.getSuccessor(i)->end(); + for (llvm::BasicBlock::iterator s = ti.getSuccessor(i)->begin(), + e = ti.getSuccessor(i)->end(); s != e && llvm::isa(s); ++s) { - llvm::PHINode* phi = llvm::cast(s); - if (llvm::Value* v = phi->getIncomingValueForBlock(block)) { + llvm::PHINode *phi = llvm::cast(s); + if (llvm::Value *v = phi->getIncomingValueForBlock(block)) { v = v->stripPointerCasts(); lhs.push_back(rep->expr(phi)); rhs.push_back(rep->expr(v)); @@ -188,8 +203,8 @@ void SmackInstGenerator::generatePhiAssigns(llvm::TerminatorInst& ti) { } void SmackInstGenerator::generateGotoStmts( - llvm::Instruction& inst, - std::vector > targets) { + llvm::Instruction &inst, + std::vector> targets) { assert(targets.size() > 0); @@ -197,16 +212,16 @@ void SmackInstGenerator::generateGotoStmts( std::list dispatch; for (unsigned i = 0; i < targets.size(); i++) { - const Expr* condition = targets[i].first; - llvm::BasicBlock* target = targets[i].second; + const Expr *condition = targets[i].first; + llvm::BasicBlock *target = targets[i].second; if (target->getUniquePredecessor() == inst.getParent()) { - Block* b = getBlock(target); + Block *b = getBlock(target); b->insert(Stmt::assume(condition)); dispatch.push_back(b->getName()); } else { - Block* b = createBlock(); + Block *b = createBlock(); annotate(inst, b); b->addStmt(Stmt::assume(condition)); b->addStmt(Stmt::goto_({getBlock(target)->getName()})); @@ -224,99 +239,98 @@ void SmackInstGenerator::generateGotoStmts( /* TERMINATOR INSTRUCTIONS */ /******************************************************************************/ -void SmackInstGenerator::visitReturnInst(llvm::ReturnInst& ri) { +void SmackInstGenerator::visitReturnInst(llvm::ReturnInst &ri) { processInstruction(ri); - llvm::Value* v = ri.getReturnValue(); + llvm::Value *v = ri.getReturnValue(); if (v) emit(Stmt::assign(Expr::id(Naming::RET_VAR), rep->expr(v))); emit(Stmt::assign(Expr::id(Naming::EXN_VAR), Expr::lit(false))); emit(Stmt::return_()); } -void SmackInstGenerator::visitBranchInst(llvm::BranchInst& bi) { +void SmackInstGenerator::visitBranchInst(llvm::BranchInst &bi) { processInstruction(bi); // Collect the list of tarets - std::vector > targets; + std::vector> targets; if (bi.getNumSuccessors() == 1) { // Unconditional branch - targets.push_back({Expr::lit(true),bi.getSuccessor(0)}); + targets.push_back({Expr::lit(true), bi.getSuccessor(0)}); } else { // Conditional branch assert(bi.getNumSuccessors() == 2); - const Expr* e = Expr::eq(rep->expr(bi.getCondition()), rep->integerLit(1UL,1)); - targets.push_back({e,bi.getSuccessor(0)}); - targets.push_back({Expr::not_(e),bi.getSuccessor(1)}); + const Expr *e = + Expr::eq(rep->expr(bi.getCondition()), rep->integerLit(1ULL, 1)); + targets.push_back({e, bi.getSuccessor(0)}); + targets.push_back({Expr::not_(e), bi.getSuccessor(1)}); } generatePhiAssigns(bi); if (bi.getNumSuccessors() > 1) emit(Stmt::annot(Attr::attr(Naming::BRANCH_CONDITION_ANNOTATION, - {rep->expr(bi.getCondition())}))); + {rep->expr(bi.getCondition())}))); generateGotoStmts(bi, targets); } -void SmackInstGenerator::visitSwitchInst(llvm::SwitchInst& si) { +void SmackInstGenerator::visitSwitchInst(llvm::SwitchInst &si) { processInstruction(si); // Collect the list of tarets - std::vector > targets; + std::vector> targets; - const Expr* e = rep->expr(si.getCondition()); - const Expr* n = Expr::lit(true); + const Expr *e = rep->expr(si.getCondition()); + const Expr *n = Expr::lit(true); - for (llvm::SwitchInst::CaseIt - i = si.case_begin(); i != si.case_begin(); ++i) { + for (llvm::SwitchInst::CaseIt i = si.case_begin(); i != si.case_begin(); + ++i) { - const Expr* v = rep->expr(i.getCaseValue()); - targets.push_back({Expr::eq(e,v),i.getCaseSuccessor()}); + const Expr *v = rep->expr(i.getCaseValue()); + targets.push_back({Expr::eq(e, v), i.getCaseSuccessor()}); // Add the negation of this case to the default case n = Expr::and_(n, Expr::neq(e, v)); } // The default case - targets.push_back({n,si.getDefaultDest()}); + targets.push_back({n, si.getDefaultDest()}); generatePhiAssigns(si); emit(Stmt::annot(Attr::attr(Naming::BRANCH_CONDITION_ANNOTATION, - {rep->expr(si.getCondition())}))); + {rep->expr(si.getCondition())}))); generateGotoStmts(si, targets); } -void SmackInstGenerator::visitInvokeInst(llvm::InvokeInst& ii) { +void SmackInstGenerator::visitInvokeInst(llvm::InvokeInst &ii) { processInstruction(ii); - llvm::Function* f = ii.getCalledFunction(); + llvm::Function *f = ii.getCalledFunction(); if (f) { emit(rep->call(f, ii)); } else { // llvm_unreachable("Unexpected invoke instruction."); - WARN("unsoundly ignoring invoke instruction... "); + SmackWarnings::warnUnsound("invoke instruction", currBlock, &ii, + ii.getType()->isVoidTy()); } - std::vector > targets; - targets.push_back({ - Expr::not_(Expr::id(Naming::EXN_VAR)), - ii.getNormalDest()}); - targets.push_back({ - Expr::id(Naming::EXN_VAR), - ii.getUnwindDest()}); + std::vector> targets; + targets.push_back( + {Expr::not_(Expr::id(Naming::EXN_VAR)), ii.getNormalDest()}); + targets.push_back({Expr::id(Naming::EXN_VAR), ii.getUnwindDest()}); emit(Stmt::annot(Attr::attr(Naming::BRANCH_CONDITION_ANNOTATION, - {Expr::id(Naming::EXN_VAR)}))); + {Expr::id(Naming::EXN_VAR)}))); generateGotoStmts(ii, targets); } -void SmackInstGenerator::visitResumeInst(llvm::ResumeInst& ri) { +void SmackInstGenerator::visitResumeInst(llvm::ResumeInst &ri) { processInstruction(ri); emit(Stmt::assign(Expr::id(Naming::EXN_VAR), Expr::lit(true))); emit(Stmt::assign(Expr::id(Naming::EXN_VAL_VAR), rep->expr(ri.getValue()))); emit(Stmt::return_()); } -void SmackInstGenerator::visitUnreachableInst(llvm::UnreachableInst& ii) { +void SmackInstGenerator::visitUnreachableInst(llvm::UnreachableInst &ii) { processInstruction(ii); emit(Stmt::assume(Expr::lit(false))); @@ -326,8 +340,17 @@ void SmackInstGenerator::visitUnreachableInst(llvm::UnreachableInst& ii) { /* BINARY OPERATIONS */ /******************************************************************************/ -void SmackInstGenerator::visitBinaryOperator(llvm::BinaryOperator& I) { +void SmackInstGenerator::visitBinaryOperator(llvm::BinaryOperator &I) { processInstruction(I); + if (rep->isBitwiseOp(&I)) + SmackWarnings::warnIfUnsound(std::string("bitwise operation ") + + I.getOpcodeName(), + SmackOptions::BitPrecise, currBlock, &I); + if (rep->isFpArithOp(&I)) + SmackWarnings::warnIfUnsound(std::string("floating-point arithmetic ") + + I.getOpcodeName(), + SmackOptions::FloatEnabled, currBlock, &I); + const Expr *E; if (isa(I.getType())) { auto X = I.getOperand(0); @@ -349,7 +372,8 @@ void SmackInstGenerator::visitExtractElementInst(ExtractElementInst &I) { auto X = I.getOperand(0); auto Y = I.getOperand(1); auto D = VectorOperations(rep).extract(X->getType(), Y->getType()); - emit(Stmt::assign(rep->expr(&I), Expr::fn(D->getName(), {rep->expr(X), rep->expr(Y)}))); + emit(Stmt::assign(rep->expr(&I), + Expr::fn(D->getName(), {rep->expr(X), rep->expr(Y)}))); } void SmackInstGenerator::visitInsertElementInst(InsertElementInst &I) { @@ -358,7 +382,9 @@ void SmackInstGenerator::visitInsertElementInst(InsertElementInst &I) { auto Y = I.getOperand(1); auto Z = I.getOperand(2); auto D = VectorOperations(rep).insert(X->getType(), Z->getType()); - emit(Stmt::assign(rep->expr(&I), Expr::fn(D->getName(), {rep->expr(X), rep->expr(Y), rep->expr(Z)}))); + emit(Stmt::assign( + rep->expr(&I), + Expr::fn(D->getName(), {rep->expr(X), rep->expr(Y), rep->expr(Z)}))); } void SmackInstGenerator::visitShuffleVectorInst(ShuffleVectorInst &I) { @@ -370,69 +396,76 @@ void SmackInstGenerator::visitShuffleVectorInst(ShuffleVectorInst &I) { for (auto idx : M) mask.push_back(idx); auto D = VectorOperations(rep).shuffle(X->getType(), I.getType(), mask); - emit(Stmt::assign(rep->expr(&I), Expr::fn(D->getName(), {rep->expr(X), rep->expr(Y)}))); + emit(Stmt::assign(rep->expr(&I), + Expr::fn(D->getName(), {rep->expr(X), rep->expr(Y)}))); } /******************************************************************************/ /* AGGREGATE OPERATIONS */ /******************************************************************************/ -void SmackInstGenerator::visitExtractValueInst(llvm::ExtractValueInst& evi) { +void SmackInstGenerator::visitExtractValueInst(llvm::ExtractValueInst &evi) { processInstruction(evi); - if (!SmackOptions::BitPrecise) { - const Expr* e = rep->expr(evi.getAggregateOperand()); - for (unsigned i = 0; i < evi.getNumIndices(); i++) - e = Expr::fn(Naming::EXTRACT_VALUE, e, Expr::lit((unsigned long) evi.getIndices()[i])); - emit(Stmt::assign(rep->expr(&evi),e)); - } else { - WARN("Ignoring extract instruction under bit vector mode."); + const Value *ao = evi.getAggregateOperand(); + const Expr *e = rep->expr(ao); + const Type *t = ao->getType(); + + for (auto &idx : evi.indices()) { + e = Expr::fn(rep->opName(Naming::EXTRACT_VALUE, {getElemType(t, idx)}), e, + Expr::lit((unsigned long long)idx)); + t = getElemType(t, idx); } + emit(Stmt::assign(rep->expr(&evi), e)); } -void SmackInstGenerator::visitInsertValueInst(llvm::InsertValueInst& ivi) { +void SmackInstGenerator::visitInsertValueInst(llvm::InsertValueInst &ivi) { processInstruction(ivi); - const Expr* old = rep->expr(ivi.getAggregateOperand()); - const Expr* res = rep->expr(&ivi); - const llvm::Type* t = ivi.getType(); - - for (unsigned i = 0; i < ivi.getNumIndices(); i++) { - unsigned idx = ivi.getIndices()[i]; - - unsigned num_elements; - if (const llvm::StructType* st = llvm::dyn_cast(t)) { - num_elements = st->getNumElements(); - t = st->getElementType(idx); - } else if (const llvm::ArrayType* at = llvm::dyn_cast(t)) { - num_elements = at->getNumElements(); - t = at->getElementType(); + const Expr *old = rep->expr(ivi.getAggregateOperand()); + const Expr *res = rep->expr(&ivi); + const llvm::Type *t = ivi.getType(); + + auto getNumElements = [](const Type *t) -> unsigned { + if (const llvm::StructType *st = + llvm::dyn_cast(t)) { + return st->getNumElements(); + } else if (const llvm::ArrayType *at = + llvm::dyn_cast(t)) { + return at->getNumElements(); } else { llvm_unreachable("Unexpected aggregate type."); } + }; - for (unsigned j = 0; j < num_elements; j++) { + for (auto &idx : ivi.indices()) { + + for (unsigned j = 0; j < getNumElements(t); j++) { if (j != idx) { emit(Stmt::assume(Expr::eq( - Expr::fn(Naming::EXTRACT_VALUE, res, Expr::lit(j)), - Expr::fn(Naming::EXTRACT_VALUE, old, Expr::lit(j)) - ))); + Expr::fn(rep->opName(Naming::EXTRACT_VALUE, {getElemType(t, j)}), + res, Expr::lit(j)), + Expr::fn(rep->opName(Naming::EXTRACT_VALUE, {getElemType(t, j)}), + old, Expr::lit(j))))); } } - res = Expr::fn(Naming::EXTRACT_VALUE, res, Expr::lit(idx)); - old = Expr::fn(Naming::EXTRACT_VALUE, old, Expr::lit(idx)); + res = Expr::fn(rep->opName(Naming::EXTRACT_VALUE, {getElemType(t, idx)}), + res, Expr::lit(idx)); + old = Expr::fn(rep->opName(Naming::EXTRACT_VALUE, {getElemType(t, idx)}), + old, Expr::lit(idx)); + t = getElemType(t, idx); } - emit(Stmt::assume(Expr::eq(res,rep->expr(ivi.getInsertedValueOperand())))); + emit(Stmt::assume(Expr::eq(res, rep->expr(ivi.getInsertedValueOperand())))); } /******************************************************************************/ /* MEMORY ACCESS AND ADDRESSING OPERATIONS */ /******************************************************************************/ -void SmackInstGenerator::visitAllocaInst(llvm::AllocaInst& ai) { +void SmackInstGenerator::visitAllocaInst(llvm::AllocaInst &ai) { processInstruction(ai); emit(rep->alloca(ai)); } -void SmackInstGenerator::visitLoadInst(llvm::LoadInst& li) { +void SmackInstGenerator::visitLoadInst(llvm::LoadInst &li) { processInstruction(li); auto P = li.getPointerOperand(); auto T = dyn_cast(P->getType()); @@ -453,17 +486,18 @@ void SmackInstGenerator::visitLoadInst(llvm::LoadInst& li) { if (SmackOptions::MemoryModelDebug) { emit(Stmt::call(Naming::REC_MEM_OP, {Expr::id(Naming::MEM_OP_VAL)})); - emit(recordProcedureCall(ConstantInt::get(Type::getInt32Ty(li.getContext()), 0), {})); + emit(recordProcedureCall( + ConstantInt::get(Type::getInt32Ty(li.getContext()), 0), {})); emit(recordProcedureCall(P, {})); emit(recordProcedureCall(&li, {})); } } -void SmackInstGenerator::visitStoreInst(llvm::StoreInst& si) { +void SmackInstGenerator::visitStoreInst(llvm::StoreInst &si) { processInstruction(si); - const llvm::Value* P = si.getPointerOperand(); - const llvm::Value* V = si.getOperand(0)->stripPointerCasts(); - assert (!V->getType()->isAggregateType() && "Unexpected store value."); + const llvm::Value *P = si.getPointerOperand(); + const llvm::Value *V = si.getValueOperand()->stripPointerCasts(); + assert(!V->getType()->isAggregateType() && "Unexpected store value."); if (isa(V->getType())) { auto D = VectorOperations(rep).store(P); @@ -471,14 +505,20 @@ void SmackInstGenerator::visitStoreInst(llvm::StoreInst& si) { auto E = Expr::fn(D->getName(), {M, rep->expr(P), rep->expr(V)}); emit(Stmt::assign(M, E)); } else { - emit(rep->store(P,V)); + emit(rep->store(P, V)); + if (const Stmt *inverseAssume = rep->inverseFPCastAssume(&si)) { + emit(inverseAssume); + } } if (SmackOptions::SourceLocSymbols) { - if (const llvm::GlobalVariable* G = llvm::dyn_cast(P)) { - if (const llvm::PointerType* t = llvm::dyn_cast(G->getType())) { + if (const llvm::GlobalVariable *G = + llvm::dyn_cast(P)) { + if (const llvm::PointerType *t = + llvm::dyn_cast(G->getType())) { if (!t->getElementType()->isPointerTy() && G->hasName()) { - emit(recordProcedureCall(V, {Attr::attr("cexpr", G->getName().str())})); + emit(recordProcedureCall(V, + {Attr::attr("cexpr", G->getName().str())})); } } } @@ -486,36 +526,41 @@ void SmackInstGenerator::visitStoreInst(llvm::StoreInst& si) { if (SmackOptions::MemoryModelDebug) { emit(Stmt::call(Naming::REC_MEM_OP, {Expr::id(Naming::MEM_OP_VAL)})); - emit(recordProcedureCall(ConstantInt::get(Type::getInt32Ty(si.getContext()), 1), {})); + emit(recordProcedureCall( + ConstantInt::get(Type::getInt32Ty(si.getContext()), 1), {})); emit(recordProcedureCall(P, {})); emit(recordProcedureCall(V, {})); } } -void SmackInstGenerator::visitAtomicCmpXchgInst(llvm::AtomicCmpXchgInst& i) { +void SmackInstGenerator::visitAtomicCmpXchgInst(llvm::AtomicCmpXchgInst &i) { processInstruction(i); - const Expr* res = rep->expr(&i); - const Expr* mem = rep->load(i.getOperand(0)); - const Expr* cmp = rep->expr(i.getOperand(1)); - const Expr* swp = rep->expr(i.getOperand(2)); - emit(Stmt::assign(res,mem)); + const Expr *res = rep->expr(&i); + const Expr *mem = rep->load(i.getOperand(0)); + const Expr *cmp = rep->expr(i.getOperand(1)); + const Expr *swp = rep->expr(i.getOperand(2)); + emit(Stmt::assign(res, mem)); emit(rep->store(i.getOperand(0), Expr::cond(Expr::eq(mem, cmp), swp, mem))); } -void SmackInstGenerator::visitAtomicRMWInst(llvm::AtomicRMWInst& i) { +void SmackInstGenerator::visitAtomicRMWInst(llvm::AtomicRMWInst &i) { using llvm::AtomicRMWInst; processInstruction(i); - const Expr* res = rep->expr(&i); - const Expr* mem = rep->load(i.getPointerOperand()); - const Expr* val = rep->expr(i.getValOperand()); - emit(Stmt::assign(res,mem)); + const Expr *res = rep->expr(&i); + const Expr *mem = rep->load(i.getPointerOperand()); + const Expr *val = rep->expr(i.getValOperand()); + auto valT = rep->type(i.getValOperand()->getType()); + emit(Stmt::assign(res, mem)); emit(rep->store(i.getPointerOperand(), - i.getOperation() == AtomicRMWInst::Xchg - ? val - : Expr::fn(Naming::ATOMICRMWINST_TABLE.at(i.getOperation()),mem,val) )); - } + i.getOperation() == AtomicRMWInst::Xchg + ? val + : Expr::fn(indexedName(Naming::ATOMICRMWINST_TABLE.at( + i.getOperation()), + {valT}), + mem, val))); +} -void SmackInstGenerator::visitGetElementPtrInst(llvm::GetElementPtrInst& I) { +void SmackInstGenerator::visitGetElementPtrInst(llvm::GetElementPtrInst &I) { processInstruction(I); emit(Stmt::assign(rep->expr(&I), rep->ptrArith(&I))); } @@ -524,7 +569,7 @@ void SmackInstGenerator::visitGetElementPtrInst(llvm::GetElementPtrInst& I) { /* CONVERSION OPERATIONS */ /******************************************************************************/ -void SmackInstGenerator::visitCastInst(llvm::CastInst& I) { +void SmackInstGenerator::visitCastInst(llvm::CastInst &I) { processInstruction(I); const Expr *E; if (isa(I.getType())) { @@ -535,13 +580,20 @@ void SmackInstGenerator::visitCastInst(llvm::CastInst& I) { E = rep->cast(&I); } emit(Stmt::assign(rep->expr(&I), E)); + + if (I.getOpcode() == Instruction::BitCast) { + if (const Stmt *inverseAssume = + rep->inverseFPCastAssume(I.getOperand(0), I.getType())) { + emit(inverseAssume); + } + } } /******************************************************************************/ /* OTHER OPERATIONS */ /******************************************************************************/ -void SmackInstGenerator::visitCmpInst(llvm::CmpInst& I) { +void SmackInstGenerator::visitCmpInst(llvm::CmpInst &I) { processInstruction(I); const Expr *E; if (isa(I.getType())) { @@ -555,29 +607,30 @@ void SmackInstGenerator::visitCmpInst(llvm::CmpInst& I) { emit(Stmt::assign(rep->expr(&I), E)); } -void SmackInstGenerator::visitPHINode(llvm::PHINode& phi) { +void SmackInstGenerator::visitPHINode(llvm::PHINode &phi) { // NOTE: this is really a No-Op, since assignments to the phi nodes // are handled in the translation of branch/switch instructions. processInstruction(phi); } -void SmackInstGenerator::visitSelectInst(llvm::SelectInst& i) { +void SmackInstGenerator::visitSelectInst(llvm::SelectInst &i) { processInstruction(i); std::string x = naming->get(i); - const Expr - *c = rep->expr(i.getCondition()), - *v1 = rep->expr(i.getTrueValue()), - *v2 = rep->expr(i.getFalseValue()); - - assert(!i.getCondition()->getType()->isVectorTy() && "Vector condition is not supported."); - emit(Stmt::assign(Expr::id(x), - Expr::if_then_else(Expr::eq(c, rep->integerLit(1L,1)), v1, v2))); + const Expr *c = rep->expr(i.getCondition()), + *v1 = rep->expr(i.getTrueValue()), + *v2 = rep->expr(i.getFalseValue()); + + assert(!i.getCondition()->getType()->isVectorTy() && + "Vector condition is not supported."); + emit(Stmt::assign( + Expr::id(x), + Expr::if_then_else(Expr::eq(c, rep->integerLit(1LL, 1)), v1, v2))); } -void SmackInstGenerator::visitCallInst(llvm::CallInst& ci) { +void SmackInstGenerator::visitCallInst(llvm::CallInst &ci) { processInstruction(ci); - Function* f = ci.getCalledFunction(); + Function *f = ci.getCalledFunction(); if (!f) { assert(ci.getCalledValue() && "Called value is null"); f = cast(ci.getCalledValue()->stripPointerCasts()); @@ -586,32 +639,23 @@ void SmackInstGenerator::visitCallInst(llvm::CallInst& ci) { std::string name = f->hasName() ? f->getName() : ""; if (ci.isInlineAsm()) { - WARN("unsoundly ignoring inline asm call: " + i2s(ci)); - emit(Stmt::skip()); - - } else if (name.find("llvm.dbg.") != std::string::npos) { - WARN("ignoring llvm.debug call."); + SmackWarnings::warnUnsound("inline asm call " + i2s(ci), currBlock, &ci, + ci.getType()->isVoidTy()); emit(Stmt::skip()); - } else if (name.find("llvm.expect.") != std::string::npos) { - // The llvm.expect.* function has two arguments: a value v and an expected - // value that is supposed to be used by optimizers. - // Semantically, this function simply returns the value v. - Value* val = ci.getArgOperand(0); - emit(Stmt::assign(rep->expr(&ci), rep->expr(val))); - } else if (name.find(Naming::RUST_ENTRY) != std::string::npos) { // Set the entry point for Rust programs auto castExpr = ci.getArgOperand(0); if (auto CE = dyn_cast(castExpr)) { auto mainFunc = CE->getOperand(0); - emit(Stmt::call(mainFunc->getName(), {},{})); + emit(Stmt::call(mainFunc->getName(), {}, {})); } - } else if (name.find(Naming::RUST_PANIC1) != std::string::npos - || name.find(Naming::RUST_PANIC2) != std::string::npos) { + } else if (name.find(Naming::RUST_PANIC1) != std::string::npos || + name.find(Naming::RUST_PANIC2) != std::string::npos) { // Convert Rust's panic functions into assertion violations - emit(Stmt::assert_(Expr::lit(false), {Attr::attr(Naming::RUST_PANIC_ANNOTATION)})); + emit(Stmt::assert_(Expr::lit(false), + {Attr::attr(Naming::RUST_PANIC_ANNOTATION)})); } else if (name.find(Naming::VALUE_PROC) != std::string::npos) { emit(rep->valueAnnotation(ci)); @@ -633,7 +677,7 @@ void SmackInstGenerator::visitCallInst(llvm::CallInst& ci) { std::string decl = rep->code(ci); rep->getProgram()->getDeclarations().push_back(Decl::code(decl, decl)); if (VAR_DECL.match(decl)) { - std::string var = VAR_DECL.sub("\\1",decl); + std::string var = VAR_DECL.sub("\\1", decl); rep->addBplGlobal(var); } @@ -643,16 +687,18 @@ void SmackInstGenerator::visitCallInst(llvm::CallInst& ci) { } else if (name == "__CONTRACT_int_variable") { // TODO assume that all variables are within an expression scope (?) - // emit(Stmt::assign(rep->expr(&ci), Expr::id(rep->getString(ci.getArgOperand(0))))); + // emit(Stmt::assign(rep->expr(&ci), + // Expr::id(rep->getString(ci.getArgOperand(0))))); } else if (name == Naming::CONTRACT_FORALL) { - llvm_unreachable("universal quantifiers not implemented."); + llvm_unreachable("universal quantifiers not implemented."); // assert(ci.getNumArgOperands() == 2 // && "Expected contract expression argument to contract function."); // CallInst* cj = dyn_cast(ci.getArgOperand(1)); - // assert(cj && "Expected contract expression argument to contract function."); + // assert(cj && "Expected contract expression argument to contract + // function."); // Function* F = cj->getCalledFunction(); // assert(F && rep->isContractExpr(F) // && "Expected contract expression argument to contract function."); @@ -666,7 +712,8 @@ void SmackInstGenerator::visitCallInst(llvm::CallInst& ci) { // if (AX.hasAttribute(i+1, "contract-var")) // var = AX.getAttribute(i+1, "contract-var").getValueAsString(); // args.push_back( - // var == binding ? Expr::id(binding) : rep->expr(cj->getArgOperand(i))); + // var == binding ? Expr::id(binding) : + // rep->expr(cj->getArgOperand(i))); // } // for (auto m : rep->memoryMaps()) // args.push_back(Expr::id(m.first)); @@ -679,16 +726,16 @@ void SmackInstGenerator::visitCallInst(llvm::CallInst& ci) { name == Naming::CONTRACT_ENSURES || name == Naming::CONTRACT_INVARIANT) { - assert(ci.getNumArgOperands() == 1 - && "Expected contract expression argument to contract function."); - CallInst* cj = dyn_cast(ci.getArgOperand(0)); + assert(ci.getNumArgOperands() == 1 && + "Expected contract expression argument to contract function."); + CallInst *cj = dyn_cast(ci.getArgOperand(0)); assert(cj && "Expected contract expression argument to contract function."); - Function* F = cj->getCalledFunction(); - assert(F && rep->isContractExpr(F) - && "Expected contract expression argument to contract function."); + Function *F = cj->getCalledFunction(); + assert(F && rep->isContractExpr(F) && + "Expected contract expression argument to contract function."); - std::list args; - for (auto& V : cj->arg_operands()) + std::list args; + for (auto &V : cj->arg_operands()) args.push_back(rep->expr(V)); for (auto m : rep->memoryMaps()) args.push_back(Expr::id(m.first)); @@ -703,44 +750,51 @@ void SmackInstGenerator::visitCallInst(llvm::CallInst& ci) { auto H = L->getHeader(); assert(H && blockMap.count(H)); blockMap[H]->getStatements().push_front( - Stmt::assert_(E, {Attr::attr(Naming::LOOP_INVARIANT_ANNOTATION)})); + Stmt::assert_(E, {Attr::attr(Naming::LOOP_INVARIANT_ANNOTATION)})); } - // } else if (name == "result") { - // assert(ci.getNumArgOperands() == 0 && "Unexpected operands to result."); - // emit(Stmt::assign(rep->expr(&ci),Expr::id(Naming::RET_VAR))); - // - // } else if (name == "qvar") { - // assert(ci.getNumArgOperands() == 1 && "Unexpected operands to qvar."); - // emit(Stmt::assign(rep->expr(&ci),Expr::id(rep->getString(ci.getArgOperand(0))))); - // - // } else if (name == "old") { - // assert(ci.getNumArgOperands() == 1 && "Unexpected operands to old."); - // llvm::LoadInst* LI = llvm::dyn_cast(ci.getArgOperand(0)); - // assert(LI && "Expected value from Load."); - // emit(Stmt::assign(rep->expr(&ci), - // Expr::fn("old",rep->load(LI->getPointerOperand())) )); - - // } else if (name == "forall") { - // assert(ci.getNumArgOperands() == 2 && "Unexpected operands to forall."); - // Value* var = ci.getArgOperand(0); - // Value* arg = ci.getArgOperand(1); - // Slice* S = getSlice(arg); - // emit(Stmt::assign(rep->expr(&ci), - // Expr::forall(rep->getString(var), "int", S->getBoogieExpression(naming,rep)))); - // - // } else if (name == "exists") { - // assert(ci.getNumArgOperands() == 2 && "Unexpected operands to forall."); - // Value* var = ci.getArgOperand(0); - // Value* arg = ci.getArgOperand(1); - // Slice* S = getSlice(arg); - // emit(Stmt::assign(rep->expr(&ci), - // Expr::exists(rep->getString(var), "int", S->getBoogieExpression(naming,rep)))); - // - // } else if (name == "invariant") { - // assert(ci.getNumArgOperands() == 1 && "Unexpected operands to invariant."); - // Slice* S = getSlice(ci.getArgOperand(0)); - // emit(Stmt::assert_(S->getBoogieExpression(naming,rep))); + // } else if (name == "result") { + // assert(ci.getNumArgOperands() == 0 && "Unexpected operands to + // result."); + // emit(Stmt::assign(rep->expr(&ci),Expr::id(Naming::RET_VAR))); + // + // } else if (name == "qvar") { + // assert(ci.getNumArgOperands() == 1 && "Unexpected operands to qvar."); + // emit(Stmt::assign(rep->expr(&ci),Expr::id(rep->getString(ci.getArgOperand(0))))); + // + // } else if (name == "old") { + // assert(ci.getNumArgOperands() == 1 && "Unexpected operands to old."); + // llvm::LoadInst* LI = + // llvm::dyn_cast(ci.getArgOperand(0)); + // assert(LI && "Expected value from Load."); + // emit(Stmt::assign(rep->expr(&ci), + // Expr::fn("old",rep->load(LI->getPointerOperand())) )); + + // } else if (name == "forall") { + // assert(ci.getNumArgOperands() == 2 && "Unexpected operands to + // forall."); + // Value* var = ci.getArgOperand(0); + // Value* arg = ci.getArgOperand(1); + // Slice* S = getSlice(arg); + // emit(Stmt::assign(rep->expr(&ci), + // Expr::forall(rep->getString(var), "int", + // S->getBoogieExpression(naming,rep)))); + // + // } else if (name == "exists") { + // assert(ci.getNumArgOperands() == 2 && "Unexpected operands to + // forall."); + // Value* var = ci.getArgOperand(0); + // Value* arg = ci.getArgOperand(1); + // Slice* S = getSlice(arg); + // emit(Stmt::assign(rep->expr(&ci), + // Expr::exists(rep->getString(var), "int", + // S->getBoogieExpression(naming,rep)))); + // + // } else if (name == "invariant") { + // assert(ci.getNumArgOperands() == 1 && "Unexpected operands to + // invariant."); + // Slice* S = getSlice(ci.getArgOperand(0)); + // emit(Stmt::assert_(S->getBoogieExpression(naming,rep))); } else { emit(rep->call(f, ci)); @@ -749,45 +803,51 @@ void SmackInstGenerator::visitCallInst(llvm::CallInst& ci) { if (f->isDeclaration() && rep->isExternal(&ci)) { std::string name = naming->get(*f); if (!EXTERNAL_PROC_IGNORE.match(name)) - emit(Stmt::assume(Expr::fn(Naming::EXTERNAL_ADDR,rep->expr(&ci)))); + emit(Stmt::assume(Expr::fn(Naming::EXTERNAL_ADDR, rep->expr(&ci)))); } - if ((naming->get(*f).find("__SMACK") == 0 || naming->get(*f).find("__VERIFIER") == 0) - && !f->getReturnType()->isVoidTy()) { - emit(recordProcedureCall(&ci, {Attr::attr("cexpr", "smack:ext:" + naming->get(*f))})); + if ((naming->get(*f).find("__SMACK") == 0 || + naming->get(*f).find("__VERIFIER") == 0) && + !f->getReturnType()->isVoidTy()) { + emit(recordProcedureCall( + &ci, {Attr::attr("cexpr", "smack:ext:" + naming->get(*f))})); } } -bool isSourceLoc(const Stmt* stmt) { - return (stmt->getKind() == Stmt::ASSUME - && (llvm::cast(stmt))->hasAttr("sourceloc")) - || (stmt->getKind() == Stmt::CALL); +bool isSourceLoc(const Stmt *stmt) { + return (stmt->getKind() == Stmt::ASSUME && + (llvm::cast(stmt))->hasAttr("sourceloc")) || + (stmt->getKind() == Stmt::CALL); } -void SmackInstGenerator::visitDbgValueInst(llvm::DbgValueInst& dvi) { +void SmackInstGenerator::visitDbgValueInst(llvm::DbgValueInst &dvi) { processInstruction(dvi); if (SmackOptions::SourceLocSymbols) { - Value* V = dvi.getValue(); + Value *V = dvi.getValue(); const llvm::DILocalVariable *var = dvi.getVariable(); - //if (V && !V->getType()->isPointerTy() && !llvm::isa(V)) { + // if (V && !V->getType()->isPointerTy() && !llvm::isa(V)) { if (V && !V->getType()->isPointerTy()) { - //if (currBlock->begin() != currBlock->end() - //&& currBlock->getStatements().back()->getKind() == Stmt::ASSUME) { + // if (currBlock->begin() != currBlock->end() + //&& currBlock->getStatements().back()->getKind() == Stmt::ASSUME) { // && isSourceLoc(currBlock->getStatements().back())) { - //assert(&*currInst == &dvi && "Current Instruction mismatch!"); + // assert(&*currInst == &dvi && "Current Instruction mismatch!"); auto currInst = std::prev(nextInst); if (currInst != dvi.getParent()->begin()) { - const Instruction& pi = *std::prev(currInst); + const Instruction &pi = *std::prev(currInst); V = V->stripPointerCasts(); - WARN(i2s(pi)); - if (!llvm::isa(&pi) && V == llvm::dyn_cast(&pi)) - emit(recordProcedureCall(V, {Attr::attr("cexpr", var->getName().str())})); + if (!llvm::isa(&pi) && + V == llvm::dyn_cast(&pi)) + emit(recordProcedureCall( + V, {Attr::attr("cexpr", var->getName().str())})); } - Function* F = dvi.getFunction(); - for(auto &arg : F->args()) { + Function *F = dvi.getFunction(); + for (auto &arg : F->args()) { if (&arg == V && var->getScope() == F->getMetadata("dbg")) { - emit(recordProcedureCall(V, {Attr::attr("cexpr", naming->get(*F) + ":arg:"+ var->getName().str())})); + emit(recordProcedureCall( + V, + {Attr::attr("cexpr", + naming->get(*F) + ":arg:" + var->getName().str())})); break; } } @@ -795,29 +855,324 @@ void SmackInstGenerator::visitDbgValueInst(llvm::DbgValueInst& dvi) { } } -void SmackInstGenerator::visitLandingPadInst(llvm::LandingPadInst& lpi) { +void SmackInstGenerator::visitLandingPadInst(llvm::LandingPadInst &lpi) { processInstruction(lpi); // TODO what exactly!? - emit(Stmt::assign(rep->expr(&lpi),Expr::id(Naming::EXN_VAL_VAR))); + emit(Stmt::assign(rep->expr(&lpi), Expr::id(Naming::EXN_VAL_VAR))); if (lpi.isCleanup()) emit(Stmt::assign(Expr::id(Naming::EXN_VAR), Expr::lit(false))); - WARN("unsoundly ignoring landingpad clauses..."); + SmackWarnings::warnUnsound("landingpad clauses", currBlock, &lpi, true); } /******************************************************************************/ /* INTRINSIC FUNCTIONS */ /******************************************************************************/ -void SmackInstGenerator::visitMemCpyInst(llvm::MemCpyInst& mci) { +void SmackInstGenerator::visitMemCpyInst(llvm::MemCpyInst &mci) { processInstruction(mci); - assert (mci.getNumOperands() == 6); + assert(mci.getNumOperands() == 6); emit(rep->memcpy(mci)); } -void SmackInstGenerator::visitMemSetInst(llvm::MemSetInst& msi) { +void SmackInstGenerator::visitMemSetInst(llvm::MemSetInst &msi) { processInstruction(msi); - assert (msi.getNumOperands() == 6); + assert(msi.getNumOperands() == 6); emit(rep->memset(msi)); } +void SmackInstGenerator::generateUnModeledCall(llvm::CallInst *ci) { + SmackWarnings::warnUnsound(ci->getCalledFunction()->getName(), currBlock, ci, + ci->getType()->isVoidTy()); + emit(rep->call(ci->getCalledFunction(), *ci)); +} + +void SmackInstGenerator::visitIntrinsicInst(llvm::IntrinsicInst &ii) { + processInstruction(ii); + + //(CallInst -> Void) -> [Flags] -> (CallInst -> Void) + static const auto conditionalModel = [this]( + std::function modelGenFunc, + std::initializer_list *> requiredFlags) { + auto unsetFlags = SmackWarnings::getUnsetFlags(requiredFlags); + return [this, unsetFlags, modelGenFunc](CallInst *ci) { + if (unsetFlags.empty()) + modelGenFunc(ci); + else { + SmackWarnings::warnUnsound("call to " + + ci->getCalledFunction()->getName().str(), + unsetFlags, currBlock, ci); + emit(rep->call(ci->getCalledFunction(), *ci)); + } + }; + }; + + static const auto f16UpCast = conditionalModel( + [this](CallInst *ci) { + // translation: $f := $fpext.bvhalf.*($rmode, $bitcast.bv16.bvhalf($i)); + auto argT = rep->type(ci->getArgOperand(0)->getType()); + auto retT = rep->type(ci->getFunctionType()->getReturnType()); + emit(Stmt::assign( + rep->expr(ci), + Expr::fn( + indexedName("$fpext", {Naming::HALF_TYPE, retT}), + {Expr::id(Naming::RMODE_VAR), + Expr::fn(indexedName("$bitcast", {argT, Naming::HALF_TYPE}), + rep->expr(ci->getArgOperand(0)))}))); + }, + {&SmackOptions::FloatEnabled, &SmackOptions::BitPrecise}); + + static const auto f16DownCast = conditionalModel( + [this](CallInst *ci) { + // translation: assume($bitcast.bv16.bvhalf($i) == + // $fptrunc.bvfloat.bvhalf($rmode, $f)); + auto argT = rep->type(ci->getArgOperand(0)->getType()); + auto retT = rep->type(ci->getFunctionType()->getReturnType()); + emit(Stmt::assume(Expr::eq( + Expr::fn(indexedName("$fptrunc", {argT, Naming::HALF_TYPE}), + Expr::id(Naming::RMODE_VAR), + rep->expr(ci->getArgOperand(0))), + Expr::fn(indexedName("$bitcast", {retT, Naming::HALF_TYPE}), + rep->expr(ci))))); + }, + {&SmackOptions::FloatEnabled, &SmackOptions::BitPrecise}); + + static const auto fma = conditionalModel( + [this](CallInst *ci) { + emit(Stmt::assign( + rep->expr(ci), + Expr::fn(indexedName( + "$fma", + {rep->type(ci->getFunctionType()->getReturnType())}), + rep->expr(ci->getArgOperand(0)), + rep->expr(ci->getArgOperand(1)), + rep->expr(ci->getArgOperand(2))))); + }, + {&SmackOptions::FloatEnabled}); + + static const auto bitreverse = [this](Value *arg) { + auto width = arg->getType()->getIntegerBitWidth(); + auto var = rep->expr(arg); + + // Swap the bits to the right and left of the middle + const Expr *body; + if (width % 2 == 0) { + body = Expr::bvConcat(Expr::bvExtract(var, width / 2, width / 2 - 1), + Expr::bvExtract(var, width / 2 + 1, width / 2)); + } else { + body = Expr::bvExtract(var, width / 2 + 1, width / 2); + } + // Swap the bits to the right and the left of the already swapped portion. + unsigned offset = width & 1; + for (unsigned i = width % 2 == 0 ? 1 : 0; i < width / 2; ++i) { + body = Expr::bvConcat( + Expr::bvConcat(Expr::bvExtract(var, width / 2 - i, width / 2 - i - 1), + body), + Expr::bvExtract(var, width / 2 + i + 1 + offset, + width / 2 + i + offset)); + } + return body; + }; + + static const auto bswap = [this](Value *arg) { + auto width = arg->getType()->getIntegerBitWidth(); + auto var = rep->expr(arg); + + // Swap the bytes to the right and left of the middle + const Expr *body = + Expr::bvConcat(Expr::bvExtract(var, width / 2, width / 2 - 8), + Expr::bvExtract(var, width / 2 + 8, width / 2)); + + // Swap the bytes to the right and the left of the already swapped portion. + for (unsigned i = 8; i < width / 2; i += 8) { + body = Expr::bvConcat( + Expr::bvConcat(Expr::bvExtract(var, width / 2 - i, width / 2 - i - 8), + body), + Expr::bvExtract(var, width / 2 + i + 8, width / 2 + i)); + } + return body; + }; + + // Count leading zeros + static const auto ctlz = conditionalModel( + [this](CallInst *ci) { + auto width = ci->getArgOperand(0)->getType()->getIntegerBitWidth(); + auto var = rep->expr(ci->getArgOperand(0)); + + // e.g., if v[32:31] == 1 then 0bv32 else if v[31:30] == 1 then 1bv32 + // else + // ... else if v[1:0] == 1 then 31bv32 else 32bv32 + const Expr *body = Expr::lit(width, width); + for (unsigned i = 0; i < width; ++i) { + body = Expr::if_then_else( + Expr::eq(Expr::bvExtract(var, i + 1, i), Expr::lit(1, 1)), + Expr::lit(width - i - 1, width), body); + } + + // Handle the is_zero_undef case, i.e. if the flag is set and the + // argument + // is zero, then the result is undefined. + auto isZeroUndef = rep->expr(ci->getArgOperand(1)); + body = Expr::if_then_else( + Expr::and_(Expr::eq(isZeroUndef, Expr::lit(1, 1)), + Expr::eq(var, Expr::lit(0, width))), + rep->expr(ci), // The result is undefined + body); + emit(Stmt::havoc(rep->expr(ci))); + emit(Stmt::assign(rep->expr(ci), body)); + }, + {&SmackOptions::BitPrecise}); + + // Count trailing zeros + static const auto cttz = conditionalModel( + [this](CallInst *ci) { + auto width = ci->getArgOperand(0)->getType()->getIntegerBitWidth(); + auto arg = rep->expr(ci->getArgOperand(0)); + + // e.g., if v[1:0] == 1 then 0bv32 else if v[2:1] == 1 then 1bv32 else + // ... else if v[32:31] == 1 then 31bv32 else 32bv32 + const Expr *body = Expr::lit(width, width); + for (unsigned i = width; i > 0; --i) { + body = Expr::if_then_else( + Expr::eq(Expr::bvExtract(arg, i, i - 1), Expr::lit(1, 1)), + Expr::lit(i - 1, width), body); + } + + // Handle the is_zero_undef case, i.e. if the flag is set and the + // argument + // is zero, then the result is undefined. + auto isZeroUndef = rep->expr(ci->getArgOperand(1)); + body = Expr::if_then_else( + Expr::and_(Expr::eq(isZeroUndef, Expr::lit(1, 1)), + Expr::eq(arg, Expr::lit(0, width))), + rep->expr(ci), // The result is undefined + body); + emit(Stmt::havoc(rep->expr(ci))); + emit(Stmt::assign(rep->expr(ci), body)); + }, + {&SmackOptions::BitPrecise}); + + // Count the population of 1s in a bv + static const auto ctpop = [this](Value *arg) { + auto width = arg->getType()->getIntegerBitWidth(); + auto var = rep->expr(arg); + auto body = Expr::lit(0, width); + auto type = rep->type(arg->getType()); + + for (unsigned i = 0; i < width; ++i) { + body = Expr::fn(indexedName("$add", {type}), + Expr::fn(indexedName("$zext", {"bv1", type}), + Expr::bvExtract(var, i + 1, i)), + body); + } + return body; + }; + + static const auto assignBvExpr = [this]( + std::function exprGenFunc) { + return conditionalModel( + [this, exprGenFunc](CallInst *ci) { + emit(Stmt::assign(rep->expr(ci), exprGenFunc(ci->getArgOperand(0)))); + }, + {&SmackOptions::BitPrecise}); + }; + + static const auto assignUnFPFuncApp = [this](std::string fnBase) { + return conditionalModel( + [this, fnBase](CallInst *ci) { + // translation: $res := $.bv*($arg1); + emit(Stmt::assign( + rep->expr(ci), + Expr::fn( + indexedName(fnBase, + {rep->type(ci->getArgOperand(0)->getType())}), + rep->expr(ci->getArgOperand(0))))); + }, + {&SmackOptions::FloatEnabled}); + }; + + static const auto assignBinFPFuncApp = [this](std::string fnBase) { + return conditionalModel( + [this, fnBase](CallInst *ci) { + // translation: $res := $.bv*($arg1, $arg2); + emit(Stmt::assign( + rep->expr(ci), + Expr::fn(indexedName( + fnBase, + {rep->type(ci->getFunctionType()->getReturnType())}), + {rep->expr(ci->getArgOperand(0)), + rep->expr(ci->getArgOperand(1))}))); + }, + {&SmackOptions::FloatEnabled}); + }; + + // Expr* -> (CallInst -> Void) + static const auto assignRoundFPFuncApp = [this](const Expr *rMode) { + return conditionalModel( + [this, rMode](CallInst *ci) { + emit(Stmt::assign( + rep->expr(ci), + Expr::fn(indexedName( + "$round", + {rep->type(ci->getFunctionType()->getReturnType())}), + {rMode, rep->expr(ci->getArgOperand(0))}))); + }, + {&SmackOptions::FloatEnabled}); + }; + + static const auto identity = [this](CallInst *ci) { + // translation: $res := $arg1 + Value *val = ci->getArgOperand(0); + emit(Stmt::assign(rep->expr(ci), rep->expr(val))); + }; + + static const auto ignore = [this](CallInst *ci) { emit(Stmt::skip()); }; + + // TODO: these functions is consistent with the implementations in math.c, + // meaning we can use __builtin_* to implement math.c which is mostly + // modeled using __SMACK_code. + + static const std::map> + stmtMap{ + {llvm::Intrinsic::bitreverse, assignBvExpr(bitreverse)}, + {llvm::Intrinsic::bswap, assignBvExpr(bswap)}, + {llvm::Intrinsic::convert_from_fp16, f16UpCast}, + {llvm::Intrinsic::convert_to_fp16, f16DownCast}, + {llvm::Intrinsic::ctlz, ctlz}, + {llvm::Intrinsic::ctpop, assignBvExpr(ctpop)}, + {llvm::Intrinsic::cttz, cttz}, + {llvm::Intrinsic::dbg_declare, ignore}, + {llvm::Intrinsic::expect, identity}, + {llvm::Intrinsic::fabs, assignUnFPFuncApp("$abs")}, + {llvm::Intrinsic::fma, fma}, + {llvm::Intrinsic::sqrt, assignUnFPFuncApp("$sqrt")}, + {llvm::Intrinsic::maxnum, assignBinFPFuncApp("$max")}, + {llvm::Intrinsic::minnum, assignBinFPFuncApp("$min")}, + {llvm::Intrinsic::ceil, + assignRoundFPFuncApp(Expr::lit(RModeKind::RTP))}, + {llvm::Intrinsic::floor, + assignRoundFPFuncApp(Expr::lit(RModeKind::RTN))}, + {llvm::Intrinsic::nearbyint, + assignRoundFPFuncApp(Expr::id(Naming::RMODE_VAR))}, + {llvm::Intrinsic::rint, + assignRoundFPFuncApp(Expr::id(Naming::RMODE_VAR))}, + {llvm::Intrinsic::round, + assignRoundFPFuncApp(Expr::lit(RModeKind::RNA))}, + {llvm::Intrinsic::trunc, + assignRoundFPFuncApp(Expr::lit(RModeKind::RTZ))} + // TODO: we cannot properly handle copysign because our fp2bv is not + // carefully implemented. + // The current version of llvm does not have these intrinsics while + // the latest version does + // we keep the code to save work in the future + // TODO: in future versions, there may be intrinsics that round floats + // to integers like lround + }; + + auto it = stmtMap.find(ii.getIntrinsicID()); + if (it != stmtMap.end()) + it->second(&ii); + else + generateUnModeledCall(&ii); +} + } // namespace smack diff --git a/lib/smack/SmackModuleGenerator.cpp b/lib/smack/SmackModuleGenerator.cpp index 00fc49d79..2c70404f4 100644 --- a/lib/smack/SmackModuleGenerator.cpp +++ b/lib/smack/SmackModuleGenerator.cpp @@ -3,13 +3,14 @@ // #define DEBUG_TYPE "smack-mod-gen" #include "smack/SmackModuleGenerator.h" -#include "smack/SmackInstGenerator.h" #include "smack/BoogieAst.h" +#include "smack/Debug.h" #include "smack/Naming.h" +#include "smack/Prelude.h" #include "smack/Regions.h" -#include "smack/SmackRep.h" +#include "smack/SmackInstGenerator.h" #include "smack/SmackOptions.h" -#include "smack/Debug.h" +#include "smack/SmackRep.h" namespace smack { @@ -20,38 +21,38 @@ SmackModuleGenerator::SmackModuleGenerator() : ModulePass(ID) { program = new Program(); } -void SmackModuleGenerator::getAnalysisUsage(llvm::AnalysisUsage& AU) const { +void SmackModuleGenerator::getAnalysisUsage(llvm::AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired(); AU.addRequired(); } -bool SmackModuleGenerator::runOnModule(llvm::Module& m) { +bool SmackModuleGenerator::runOnModule(llvm::Module &m) { generateProgram(m); return false; } -void SmackModuleGenerator::generateProgram(llvm::Module& M) { +void SmackModuleGenerator::generateProgram(llvm::Module &M) { Naming naming; SmackRep rep(&M.getDataLayout(), &naming, program, &getAnalysis()); - std::list& decls = program->getDeclarations(); + std::list &decls = program->getDeclarations(); - DEBUG(errs() << "Analyzing globals...\n"); + SDEBUG(errs() << "Analyzing globals...\n"); - for (auto& G : M.globals()) { + for (auto &G : M.globals()) { auto ds = rep.globalDecl(&G); decls.insert(decls.end(), ds.begin(), ds.end()); } - DEBUG(errs() << "Analyzing functions...\n"); + SDEBUG(errs() << "Analyzing functions...\n"); - for (auto& F : M) { + for (auto &F : M) { // Reset the counters for per-function names naming.reset(); - DEBUG(errs() << "Analyzing function: " << naming.get(F) << "\n"); + SDEBUG(errs() << "Analyzing function: " << naming.get(F) << "\n"); auto ds = rep.globalDecl(&F); decls.insert(decls.end(), ds.begin(), ds.end()); @@ -66,13 +67,15 @@ void SmackModuleGenerator::generateProgram(llvm::Module& M) { continue; if (!F.empty() && !F.getEntryBlock().empty()) { - DEBUG(errs() << "Analyzing function body: " << naming.get(F) << "\n"); + SDEBUG(errs() << "Analyzing function body: " << naming.get(F) << "\n"); for (auto P : procs) { - SmackInstGenerator igen(getAnalysis(F).getLoopInfo(), &rep, P, &naming); - DEBUG(errs() << "Generating body for " << naming.get(F) << "\n"); + SmackInstGenerator igen( + getAnalysis(F).getLoopInfo(), &rep, P, + &naming); + SDEBUG(errs() << "Generating body for " << naming.get(F) << "\n"); igen.visit(F); - DEBUG(errs() << "\n"); + SDEBUG(errs() << "\n"); // First execute static initializers, in the main procedure. if (F.hasName() && SmackOptions::isEntryPoint(F.getName())) { @@ -81,7 +84,8 @@ void SmackModuleGenerator::generateProgram(llvm::Module& M) { } else if (naming.get(F).find(Naming::INIT_FUNC_PREFIX) == 0) rep.addInitFunc(&F); } - DEBUG(errs() << "Finished analyzing function: " << naming.get(F) << "\n\n"); + SDEBUG(errs() << "Finished analyzing function: " << naming.get(F) + << "\n\n"); } // MODIFIES @@ -94,9 +98,10 @@ void SmackModuleGenerator::generateProgram(llvm::Module& M) { // NOTE we must do this after instruction generation, since we would not // otherwise know how many regions to declare. - program->appendPrelude(rep.getPrelude()); + Prelude prelude(rep); + program->appendPrelude(prelude.getPrelude()); - std::list kill_list; + std::list kill_list; for (auto D : *program) { if (auto P = dyn_cast(D)) { if (rep.isContractExpr(D->getName())) { diff --git a/lib/smack/SmackOptions.cpp b/lib/smack/SmackOptions.cpp index 8c46708fb..3a3c347df 100644 --- a/lib/smack/SmackOptions.cpp +++ b/lib/smack/SmackOptions.cpp @@ -7,56 +7,64 @@ namespace smack { -const llvm::cl::list SmackOptions::EntryPoints( - "entry-points", - llvm::cl::ZeroOrMore, - llvm::cl::desc("Entry point procedure names"), - llvm::cl::value_desc("PROCS") -); - -const llvm::cl::opt SmackOptions::Warnings( - "warnings", llvm::cl::desc("Enable warnings.") -); +const llvm::cl::list + SmackOptions::EntryPoints("entry-points", llvm::cl::ZeroOrMore, + llvm::cl::desc("Entry point procedure names"), + llvm::cl::value_desc("PROCS")); + +const llvm::cl::opt SmackOptions::WarningLevel( + "warn-type", llvm::cl::desc("Enable certain type of warning messages."), + llvm::cl::values( + clEnumValN(SmackWarnings::WarningLevel::Silent, "silent", + "No warning messages"), + clEnumValN(SmackWarnings::WarningLevel::Unsound, "unsound", + "Enable warnings about unsoundness"), + clEnumValN( + SmackWarnings::WarningLevel::Info, "info", + "Enable warnings about unsoundness and translation information"))); + +const llvm::cl::opt SmackOptions::ColoredWarnings( + "colored-warnings", llvm::cl::desc("Enable colored warning messages.")); const llvm::cl::opt SmackOptions::MemoryModelDebug( - "mem-mod-dbg", llvm::cl::desc("Enable memory model debugging.") -); + "mem-mod-dbg", llvm::cl::desc("Enable memory model debugging.")); const llvm::cl::opt SmackOptions::MemoryModelImpls( - "mem-mod-impls", llvm::cl::desc("Provide implementations for memory model procedures.") -); + "mem-mod-impls", + llvm::cl::desc("Provide implementations for memory model procedures.")); const llvm::cl::opt SmackOptions::SourceLocSymbols( - "source-loc-syms", llvm::cl::desc("Include source locations in generated code.") -); + "source-loc-syms", + llvm::cl::desc("Include source locations in generated code.")); -const llvm::cl::opt SmackOptions::BitPrecise( - "bit-precise", llvm::cl::desc("Model non-pointer values as bit vectors.") -); +llvm::cl::opt SmackOptions::BitPrecise( + "bit-precise", llvm::cl::desc("Model non-pointer values as bit vectors.")); const llvm::cl::opt SmackOptions::BitPrecisePointers( - "bit-precise-pointers", llvm::cl::desc("Model pointers as bit vectors.") -); + "bit-precise-pointers", + llvm::cl::desc("Model pointers and non-pointer values as bit vectors.")); -const llvm::cl::opt SmackOptions::AddTiming("timing-annotations", llvm::cl::desc("Add timing annotations.")); +const llvm::cl::opt + SmackOptions::AddTiming("timing-annotations", + llvm::cl::desc("Add timing annotations.")); const llvm::cl::opt SmackOptions::NoMemoryRegionSplitting( - "no-memory-splitting", llvm::cl::desc("Disable splitting memory into regions.") -); + "no-memory-splitting", + llvm::cl::desc("Disable splitting memory into regions.")); const llvm::cl::opt SmackOptions::NoByteAccessInference( - "no-byte-access-inference", llvm::cl::desc("Optimize bit-precision with DSA.") -); + "no-byte-access-inference", + llvm::cl::desc("Optimize bit-precision with DSA.")); const llvm::cl::opt SmackOptions::FloatEnabled( - "float", llvm::cl::desc("Enable interpreted floating-point type") -); + "float", llvm::cl::desc("Enable interpreted floating-point type")); -const llvm::cl::opt SmackOptions::MemorySafety( - "memory-safety", llvm::cl::desc("Enable memory safety checks")); +const llvm::cl::opt + SmackOptions::MemorySafety("memory-safety", + llvm::cl::desc("Enable memory safety checks")); const llvm::cl::opt SmackOptions::IntegerOverflow( - "integer-overflow", llvm::cl::desc("Enable integer overflow checks")); + "integer-overflow", llvm::cl::desc("Enable integer overflow checks")); bool SmackOptions::isEntryPoint(std::string name) { for (auto EP : EntryPoints) @@ -64,5 +72,4 @@ bool SmackOptions::isEntryPoint(std::string name) { return true; return false; } - } diff --git a/lib/smack/SmackRep.cpp b/lib/smack/SmackRep.cpp index d9d69ad48..e3c1ba466 100644 --- a/lib/smack/SmackRep.cpp +++ b/lib/smack/SmackRep.cpp @@ -3,64 +3,59 @@ // #define DEBUG_TYPE "smack-rep" #include "smack/SmackRep.h" -#include "smack/SmackOptions.h" #include "smack/CodifyStaticInits.h" +#include "smack/SmackOptions.h" #include "smack/VectorOperations.h" #include "smack/BoogieAst.h" +#include "smack/Debug.h" #include "smack/Naming.h" #include "smack/Regions.h" -#include "smack/Debug.h" +#include "smack/SmackWarnings.h" #include #include #include namespace { - using namespace llvm; - using namespace std; +using namespace llvm; - list findCallers(Function* F) { - list callers; +std::list findCallers(Function *F) { + std::list callers; - if (F) { - queue users; - set covered; + if (F) { + std::queue users; + std::set covered; - users.push(F); - covered.insert(F); + users.push(F); + covered.insert(F); - while (!users.empty()) { - auto U = users.front(); - users.pop(); + while (!users.empty()) { + auto U = users.front(); + users.pop(); - if (CallInst* CI = dyn_cast(U)) - callers.push_back(CI); + if (CallInst *CI = dyn_cast(U)) + callers.push_back(CI); - else - for (auto V : U->users()) - if (!covered.count(V)) { - users.push(V); - covered.insert(V); - } - } + else + for (auto V : U->users()) + if (!covered.count(V)) { + users.push(V); + covered.insert(V); + } } - - return callers; } + + return callers; +} } namespace smack { const unsigned MEMORY_INTRINSIC_THRESHOLD = 0; -const std::vector INTEGER_SIZES = {1, 8, 16, 24, 32, 40, 48, 56, 64, 80, 88, 96, 128}; -const std::vector REF_CONSTANTS = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 1024 -}; - -std::string indexedName(std::string name, std::initializer_list idxs) { +std::string indexedName(std::string name, + std::initializer_list idxs) { std::stringstream idxd; idxd << name; for (auto idx : idxs) @@ -68,7 +63,8 @@ std::string indexedName(std::string name, std::initializer_list idx return idxd.str(); } -std::string indexedName(std::string name, std::initializer_list idxs) { +std::string indexedName(std::string name, + std::initializer_list idxs) { std::stringstream idxd; idxd << name; for (auto idx : idxs) @@ -76,22 +72,20 @@ std::string indexedName(std::string name, std::initializer_list idxs) return idxd.str(); } -bool isFloat(const llvm::Type* t) { - return t->isFloatingPointTy(); -} +bool isFloat(const llvm::Type *t) { return t->isFloatingPointTy(); } -bool isFloat(const llvm::Value* v) { - return isFloat(v->getType()); -} +bool isFloat(const llvm::Value *v) { return isFloat(v->getType()); } Regex STRING_CONSTANT("^\\.str[0-9]*$"); -bool isCodeString(const llvm::Value* V) { - for (llvm::Value::const_user_iterator U1 = V->user_begin(); U1 != V->user_end(); ++U1) { - if (const Constant* C = dyn_cast(*U1)) { - for (llvm::Value::const_user_iterator U2 = C->user_begin(); U2 != C->user_end(); ++U2) { - if (const CallInst* CI = dyn_cast(*U2)) { - llvm::Function* F = CI->getCalledFunction(); +bool isCodeString(const llvm::Value *V) { + for (llvm::Value::const_user_iterator U1 = V->user_begin(); + U1 != V->user_end(); ++U1) { + if (const Constant *C = dyn_cast(*U1)) { + for (llvm::Value::const_user_iterator U2 = C->user_begin(); + U2 != C->user_end(); ++U2) { + if (const CallInst *CI = dyn_cast(*U2)) { + llvm::Function *F = CI->getCalledFunction(); std::string name = F && F->hasName() ? F->getName().str() : ""; if (name.find(Naming::CODE_PROC) != std::string::npos || name.find(Naming::TOP_DECL_PROC) != std::string::npos || @@ -105,54 +99,56 @@ bool isCodeString(const llvm::Value* V) { return false; } -SmackRep::SmackRep(const DataLayout* L, Naming* N, Program* P, Regions* R) - : targetData(L), naming(N), program(P), regions(R), - globalsBottom(0), externsBottom(-32768), uniqueFpNum(0), - ptrSizeInBits(targetData->getPointerSizeInBits()) -{ - if (SmackOptions::MemorySafety) - initFuncs.push_back("$global_allocations"); - initFuncs.push_back(Naming::STATIC_INIT_PROC); +SmackRep::SmackRep(const DataLayout *L, Naming *N, Program *P, Regions *R) + : targetData(L), naming(N), program(P), regions(R), globalsOffset(0), + externsOffset(-32768), uniqueFpNum(0), + ptrSizeInBits(targetData->getPointerSizeInBits()) { + if (SmackOptions::MemorySafety) + initFuncs.push_back("$global_allocations"); + initFuncs.push_back(Naming::STATIC_INIT_PROC); } -void SmackRep::addAuxiliaryDeclaration(Decl* D) { +void SmackRep::addAuxiliaryDeclaration(Decl *D) { if (auxDecls.count(D->getName())) return; auxDecls[D->getName()] = D; } -std::list SmackRep::auxiliaryDeclarations() { - std::list ds; +std::list SmackRep::auxiliaryDeclarations() { + std::list ds; for (auto D : auxDecls) ds.push_back(D.second); return ds; } -std::string SmackRep::getString(const llvm::Value* v) { - if (const llvm::ConstantExpr* constantExpr = llvm::dyn_cast(v)) +std::string SmackRep::getString(const llvm::Value *v) { + if (const llvm::ConstantExpr *constantExpr = + llvm::dyn_cast(v)) if (constantExpr->getOpcode() == llvm::Instruction::GetElementPtr) - if (const llvm::GlobalValue* cc = llvm::dyn_cast(constantExpr->getOperand(0))) - if (const llvm::ConstantDataSequential* cds = llvm::dyn_cast(cc->getOperand(0))) - return cds ->getAsCString(); + if (const llvm::GlobalValue *cc = llvm::dyn_cast( + constantExpr->getOperand(0))) + if (const llvm::ConstantDataSequential *cds = + llvm::dyn_cast( + cc->getOperand(0))) + return cds->getAsCString(); return ""; } -unsigned SmackRep::getElementSize(const llvm::Value* v) { +unsigned SmackRep::getElementSize(const llvm::Value *v) { return getSize(v->getType()->getPointerElementType()); } -unsigned SmackRep::getIntSize(const llvm::Value* v) { +unsigned SmackRep::getIntSize(const llvm::Value *v) { return getSize(v->getType()); } -unsigned SmackRep::getIntSize(const llvm::Type* t) { +unsigned SmackRep::getIntSize(const llvm::Type *t) { return t->getIntegerBitWidth(); } -unsigned SmackRep::getSize(llvm::Type* T) { - return T->isSingleValueType() - ? targetData->getTypeSizeInBits(T) - : targetData->getTypeStoreSizeInBits(T); +unsigned SmackRep::getSize(llvm::Type *T) { + return T->isSingleValueType() ? targetData->getTypeSizeInBits(T) + : targetData->getTypeStoreSizeInBits(T); } std::string SmackRep::pointerType() { @@ -175,7 +171,8 @@ std::string SmackRep::vectorType(int n, Type *T) { return s.str(); } -std::string SmackRep::opName(const std::string& operation, std::list types) { +std::string SmackRep::opName(const std::string &operation, + std::list types) { std::stringstream s; s << operation; for (auto t : types) @@ -183,7 +180,8 @@ std::string SmackRep::opName(const std::string& operation, std::list types) { +std::string SmackRep::opName(const std::string &operation, + std::initializer_list types) { std::stringstream s; s << operation; for (auto t : types) @@ -191,30 +189,31 @@ std::string SmackRep::opName(const std::string& operation, std::initializer_list return s.str(); } -std::string SmackRep::procName(const llvm::User& U) { - if (const llvm::CallInst* CI = llvm::dyn_cast(&U)) +std::string SmackRep::procName(const llvm::User &U) { + if (const llvm::CallInst *CI = llvm::dyn_cast(&U)) return procName(CI->getCalledFunction(), U); else llvm_unreachable("Unexpected user expression."); } -std::string SmackRep::procName(llvm::Function* F, const llvm::User& U) { - std::list types; - for (unsigned i = 0; i < U.getNumOperands()-1; i++) +std::string SmackRep::procName(llvm::Function *F, const llvm::User &U) { + std::list types; + for (unsigned i = 0; i < U.getNumOperands() - 1; i++) types.push_back(U.getOperand(i)->getType()); return procName(F, types); } -std::string SmackRep::procName(llvm::Function* F, std::list types) { +std::string SmackRep::procName(llvm::Function *F, + std::list types) { std::stringstream name; name << naming->get(*F); if (F->isVarArg()) - for (auto* T : types) + for (auto *T : types) name << "." << type(T); return name.str(); } -std::string SmackRep::type(const llvm::Type* t) { +std::string SmackRep::type(const llvm::Type *t) { if (t->isFloatingPointTy()) { if (!SmackOptions::FloatEnabled) @@ -244,24 +243,22 @@ std::string SmackRep::type(const llvm::Type* t) { return Naming::PTR_TYPE; } -std::string SmackRep::type(const llvm::Value* v) { - return type(v->getType()); -} +std::string SmackRep::type(const llvm::Value *v) { return type(v->getType()); } -unsigned SmackRep::storageSize(llvm::Type* T) { +unsigned SmackRep::storageSize(llvm::Type *T) { return targetData->getTypeStoreSize(T); } -unsigned SmackRep::offset(llvm::ArrayType* T, unsigned idx) { +unsigned SmackRep::offset(llvm::ArrayType *T, unsigned idx) { return storageSize(T->getElementType()) * idx; } -unsigned SmackRep::offset(llvm::StructType* T, unsigned idx) { +unsigned SmackRep::offset(llvm::StructType *T, unsigned idx) { return targetData->getStructLayout(T)->getElementOffset(idx); } std::string SmackRep::memReg(unsigned idx) { - return indexedName(Naming::MEMORY,{idx}); + return indexedName(Naming::MEMORY, {idx}); } std::string SmackRep::memType(unsigned region) { @@ -269,112 +266,100 @@ std::string SmackRep::memType(unsigned region) { if (!regions->get(region).isSingleton() || (SmackOptions::BitPrecise && SmackOptions::NoByteAccessInference)) s << "[" << Naming::PTR_TYPE << "] "; - const Type* T = regions->get(region).getType(); + const Type *T = regions->get(region).getType(); s << (T ? type(T) : intType(8)); return s.str(); } -std::string SmackRep::memPath(unsigned region) { - return memReg(region); -} +std::string SmackRep::memPath(unsigned region) { return memReg(region); } -std::string SmackRep::memPath(const llvm::Value* v) { +std::string SmackRep::memPath(const llvm::Value *v) { return memPath(regions->idx(v)); } -std::list< std::pair< std::string, std::string > > SmackRep::memoryMaps() { - std::list< std::pair< std::string, std::string > > mms; - for (unsigned i=0; isize(); i++) +std::list> SmackRep::memoryMaps() { + std::list> mms; + for (unsigned i = 0; i < regions->size(); i++) mms.push_back({memReg(i), memType(i)}); return mms; } -bool SmackRep::isExternal(const llvm::Value* v) { - return v->getType()->isPointerTy() - && !regions->get(regions->idx(v)).isAllocated(); +bool SmackRep::isExternal(const llvm::Value *v) { + return v->getType()->isPointerTy() && + !regions->get(regions->idx(v)).isAllocated(); } -const Stmt* SmackRep::alloca(llvm::AllocaInst& i) { - const Expr* size = - Expr::fn("$mul.ref", - pointerLit(storageSize(i.getAllocatedType())), +const Stmt *SmackRep::alloca(llvm::AllocaInst &i) { + const Expr *size = Expr::fn( + "$mul.ref", pointerLit(storageSize(i.getAllocatedType())), integerToPointer(expr(i.getArraySize()), getIntSize(i.getArraySize()))); // TODO this should not be a pointer type. - return Stmt::call(Naming::ALLOC,{size},{naming->get(i)}); + return Stmt::call(Naming::ALLOC, {size}, {naming->get(i)}); } -const Stmt* SmackRep::memcpy(const llvm::MemCpyInst& mci) { +const Stmt *SmackRep::memcpy(const llvm::MemCpyInst &mci) { unsigned length; if (auto CI = dyn_cast(mci.getLength())) length = CI->getZExtValue(); else length = std::numeric_limits::max(); - unsigned r1 = regions->idx(mci.getOperand(0),length); - unsigned r2 = regions->idx(mci.getOperand(1),length); + unsigned r1 = regions->idx(mci.getOperand(0), length); + unsigned r2 = regions->idx(mci.getOperand(1), length); - const Type* T = regions->get(r1).getType(); - Decl* P = memcpyProc(T ? type(T) : intType(8), length); + const Type *T = regions->get(r1).getType(); + Decl *P = memcpyProc(T ? type(T) : intType(8), length); auxDecls[P->getName()] = P; - const Value - *dst = mci.getArgOperand(0), - *src = mci.getArgOperand(1), - *len = mci.getArgOperand(2), - *aln = mci.getArgOperand(3), - *vol = mci.getArgOperand(4); - - return Stmt::call(P->getName(), { - Expr::id(memReg(r1)), - Expr::id(memReg(r2)), - expr(dst), - expr(src), - integerToPointer(expr(len), len->getType()->getIntegerBitWidth()), - integerToPointer(expr(aln), aln->getType()->getIntegerBitWidth()), - Expr::eq(expr(vol), integerLit(1UL,1)) - }, {memReg(r1)}); -} - -const Stmt* SmackRep::memset(const llvm::MemSetInst& msi) { + const Value *dst = mci.getArgOperand(0), *src = mci.getArgOperand(1), + *len = mci.getArgOperand(2), *aln = mci.getArgOperand(3), + *vol = mci.getArgOperand(4); + + return Stmt::call( + P->getName(), + {Expr::id(memReg(r1)), Expr::id(memReg(r2)), expr(dst), expr(src), + integerToPointer(expr(len), len->getType()->getIntegerBitWidth()), + integerToPointer(expr(aln), aln->getType()->getIntegerBitWidth()), + Expr::eq(expr(vol), integerLit(1ULL, 1))}, + {memReg(r1)}); +} + +const Stmt *SmackRep::memset(const llvm::MemSetInst &msi) { unsigned length; if (auto CI = dyn_cast(msi.getLength())) length = CI->getZExtValue(); else length = std::numeric_limits::max(); - unsigned r = regions->idx(msi.getOperand(0),length); + unsigned r = regions->idx(msi.getOperand(0), length); - const Type* T = regions->get(r).getType(); - Decl* P = memsetProc(T ? type(T) : intType(8), length); + const Type *T = regions->get(r).getType(); + Decl *P = memsetProc(T ? type(T) : intType(8), length); auxDecls[P->getName()] = P; - const Value - *dst = msi.getArgOperand(0), - *val = msi.getArgOperand(1), - *len = msi.getArgOperand(2), - *aln = msi.getArgOperand(3), - *vol = msi.getArgOperand(4); + const Value *dst = msi.getArgOperand(0), *val = msi.getArgOperand(1), + *len = msi.getArgOperand(2), *aln = msi.getArgOperand(3), + *vol = msi.getArgOperand(4); - return Stmt::call(P->getName(), { - Expr::id(memReg(r)), - expr(dst), - expr(val), - integerToPointer(expr(len), len->getType()->getIntegerBitWidth()), - integerToPointer(expr(aln), aln->getType()->getIntegerBitWidth()), - Expr::eq(expr(vol), integerLit(1UL,1)) - }, {memReg(r)}); + return Stmt::call( + P->getName(), + {Expr::id(memReg(r)), expr(dst), expr(val), + integerToPointer(expr(len), len->getType()->getIntegerBitWidth()), + integerToPointer(expr(aln), aln->getType()->getIntegerBitWidth()), + Expr::eq(expr(vol), integerLit(1ULL, 1))}, + {memReg(r)}); } -const Stmt* SmackRep::valueAnnotation(const CallInst& CI) { +const Stmt *SmackRep::valueAnnotation(const CallInst &CI) { std::string name; - std::list args({ expr(CI.getArgOperand(0)) }); - std::list rets({ naming->get(CI) }); - std::list attrs; + std::list args({expr(CI.getArgOperand(0))}); + std::list rets({naming->get(CI)}); + std::list attrs; assert(CI.getNumArgOperands() > 0 && "Expected at least one argument."); assert(CI.getNumArgOperands() <= 2 && "Expected at most two arguments."); - const Value* V = CI.getArgOperand(0)->stripPointerCasts(); + const Value *V = CI.getArgOperand(0)->stripPointerCasts(); if (CI.getNumArgOperands() == 1) { name = indexedName(Naming::VALUE_PROC, {type(V->getType())}); @@ -386,18 +371,19 @@ const Stmt* SmackRep::valueAnnotation(const CallInst& CI) { assert(GEP && "Expected GEP argument to load instruction."); auto A = dyn_cast(GEP->getPointerOperand()); assert(A && "Expected function argument to GEP instruction."); - auto T = GEP->getType()->getElementType(); + auto T = GEP->getResultElementType(); const unsigned bits = this->getSize(T); const unsigned bytes = bits / 8; const unsigned R = regions->idx(GEP); bool bytewise = regions->get(R).bytewiseAccess(); attrs.push_back(Attr::attr("name", {Expr::id(naming->get(*A))})); - attrs.push_back(Attr::attr("field", { - Expr::lit(Naming::LOAD + "." + (bytewise ? "bytes." : "") + intType(bits)), - Expr::id(memPath(R)), - ptrArith(GEP), - Expr::lit(bytes), - })); + attrs.push_back( + Attr::attr("field", + { + Expr::lit(Naming::LOAD + "." + + (bytewise ? "bytes." : "") + intType(bits)), + Expr::id(memPath(R)), ptrArith(GEP), Expr::lit(bytes), + })); } else { llvm_unreachable("Unexpected argument type."); @@ -405,9 +391,9 @@ const Stmt* SmackRep::valueAnnotation(const CallInst& CI) { } else { name = Naming::VALUE_PROC + "s"; - const Argument* A; - Type* T; - const Expr* addr; + const Argument *A; + Type *T; + const Expr *addr; if ((A = dyn_cast(V))) { auto PT = dyn_cast(A->getType()); @@ -418,7 +404,7 @@ const Stmt* SmackRep::valueAnnotation(const CallInst& CI) { } else if (auto GEP = dyn_cast(V)) { A = dyn_cast(GEP->getPointerOperand()); assert(A && "Expected function argument to GEP instruction."); - T = GEP->getType()->getElementType(); + T = GEP->getResultElementType(); addr = ptrArith(GEP); } else if (auto LI = dyn_cast(V)) { @@ -447,32 +433,23 @@ const Stmt* SmackRep::valueAnnotation(const CallInst& CI) { bool bytewise = regions->get(R).bytewiseAccess(); args.push_back(expr(CI.getArgOperand(1))); attrs.push_back(Attr::attr("name", {Expr::id(naming->get(*A))})); - attrs.push_back(Attr::attr("array", { - Expr::lit(Naming::LOAD + "." + (bytewise ? "bytes." : "") + intType(bits)), - Expr::id(memPath(R)), - addr, - Expr::lit(bytes), - Expr::lit(length) - })); + attrs.push_back(Attr::attr( + "array", + {Expr::lit(Naming::LOAD + "." + (bytewise ? "bytes." : "") + + intType(bits)), + Expr::id(memPath(R)), addr, Expr::lit(bytes), Expr::lit(length)})); } - return Stmt::call( - name, - args, - rets, - attrs - ); + return Stmt::call(name, args, rets, attrs); } -const Stmt* SmackRep::returnValueAnnotation(const CallInst& CI) { +const Stmt *SmackRep::returnValueAnnotation(const CallInst &CI) { assert(CI.getNumArgOperands() == 0 && "Expected no operands."); - Type* T = CI.getParent()->getParent()->getReturnType(); + Type *T = CI.getParent()->getParent()->getReturnType(); std::string name = indexedName(Naming::VALUE_PROC, {type(T)}); - return Stmt::call( - name, - std::list({ Expr::id(Naming::RET_VAR) }), - std::list({ naming->get(CI) }), - {Attr::attr("name", {Expr::id(Naming::RET_VAR)})}); + return Stmt::call(name, std::list({Expr::id(Naming::RET_VAR)}), + std::list({naming->get(CI)}), + {Attr::attr("name", {Expr::id(Naming::RET_VAR)})}); } // TODO work the following into SmackRep::returnValueAnnotation @@ -492,7 +469,8 @@ const Stmt* SmackRep::returnValueAnnotation(const CallInst& CI) { // const unsigned length = bound * bytes; // const unsigned R = regions->idx(V, length); // bool bytewise = regions->get(R).bytewiseAccess(); -// std::string L = Naming::LOAD + "." + (bytewise ? "bytes." : "") + intType(bits); +// std::string L = Naming::LOAD + "." + (bytewise ? "bytes." : "") + +// intType(bits); // return Stmt::call(Naming::OBJECT_PROC, // std::vector({ // Expr::id(Naming::RET_VAR), @@ -513,9 +491,10 @@ const Stmt* SmackRep::returnValueAnnotation(const CallInst& CI) { // // } -bool SmackRep::isUnsafeFloatAccess(const Type* elemTy, const Type* resultTy) { +bool SmackRep::isUnsafeFloatAccess(const Type *elemTy, const Type *resultTy) { if (elemTy->isFloatingPointTy()) { - bool isByteMap = !resultTy || (resultTy->isIntegerTy() && resultTy->getIntegerBitWidth() == 8UL); + bool isByteMap = !resultTy || (resultTy->isIntegerTy() && + resultTy->getIntegerBitWidth() == 8UL); if (isByteMap && !SmackOptions::BitPrecise) return true; assert(resultTy->isFloatingPointTy() && "Unsupported map result type."); @@ -523,68 +502,76 @@ bool SmackRep::isUnsafeFloatAccess(const Type* elemTy, const Type* resultTy) { return false; } -const Expr* SmackRep::load(const llvm::Value* P) { - const PointerType* T = dyn_cast(P->getType()); +const Expr *SmackRep::load(const llvm::Value *P) { + const PointerType *T = dyn_cast(P->getType()); assert(T && "Expected pointer type."); const unsigned R = regions->idx(P); bool bytewise = regions->get(R).bytewiseAccess(); bool singleton = regions->get(R).isSingleton(); - const Type* resultTy = regions->get(R).getType(); - const Expr* M = Expr::id(memPath(R)); - std::string N = Naming::LOAD + "." - + (bytewise ? "bytes." : (isUnsafeFloatAccess(T->getElementType(), resultTy)? "unsafe." : "")) - + type(T->getElementType()); + const Type *resultTy = regions->get(R).getType(); + const Expr *M = Expr::id(memPath(R)); + std::string N = + Naming::LOAD + "." + + (bytewise ? "bytes." : (isUnsafeFloatAccess(T->getElementType(), resultTy) + ? "unsafe." + : "")) + + type(T->getElementType()); return singleton ? M : Expr::fn(N, M, SmackRep::expr(P)); } -const Stmt* SmackRep::store(const Value* P, const Value* V) { +const Stmt *SmackRep::store(const Value *P, const Value *V) { return store(P, expr(V)); } -const Stmt* SmackRep::store(const Value* P, const Expr* V) { - const PointerType* T = dyn_cast(P->getType()); +const Stmt *SmackRep::store(const Value *P, const Expr *V) { + const PointerType *T = dyn_cast(P->getType()); assert(T && "Expected pointer type."); return store(regions->idx(P), T->getElementType(), expr(P), V); } -const Stmt* SmackRep::store(unsigned R, const Type* T, - const Expr* P, const Expr* V) { +const Stmt *SmackRep::store(unsigned R, const Type *T, const Expr *P, + const Expr *V) { bool bytewise = regions->get(R).bytewiseAccess(); bool singleton = regions->get(R).isSingleton(); - const Type* resultTy = regions->get(R).getType(); - std::string N = Naming::STORE + "." - + (bytewise ? "bytes." : (isUnsafeFloatAccess(T, resultTy)? "unsafe." : "")) + type(T); - const Expr* M = Expr::id(memPath(R)); - return Stmt::assign(M, singleton ? V : Expr::fn(N,M,P,V)); + const Type *resultTy = regions->get(R).getType(); + std::string N = + Naming::STORE + "." + + (bytewise ? "bytes." + : (isUnsafeFloatAccess(T, resultTy) ? "unsafe." : "")) + + type(T); + const Expr *M = Expr::id(memPath(R)); + return Stmt::assign(M, singleton ? V : Expr::fn(N, M, P, V)); } -const Expr* SmackRep::pa(const Expr* base, long long idx, unsigned long size) { +const Expr *SmackRep::pa(const Expr *base, long long idx, unsigned size) { if (idx >= 0) { - return pa(base, idx * size); + return pa(base, pointerLit(idx), pointerLit(size)); } else { - return pa(base, Expr::fn("$sub.ref", pointerLit(0UL), - pointerLit((unsigned long) std::abs(idx))), pointerLit(size)); + return pa(base, Expr::fn("$sub.ref", pointerLit(0ULL), + pointerLit((unsigned long long)std::abs(idx))), + pointerLit(size)); } } -const Expr* SmackRep::pa(const Expr* base, const Expr* idx, unsigned long size) { +const Expr *SmackRep::pa(const Expr *base, const Expr *idx, unsigned size) { return pa(base, idx, pointerLit(size)); } -const Expr* SmackRep::pa(const Expr* base, unsigned long offset) { +const Expr *SmackRep::pa(const Expr *base, unsigned long long offset) { return offset > 0 ? pa(base, pointerLit(offset)) : base; } -const Expr* SmackRep::pa(const Expr* base, const Expr* idx, const Expr* size) { +const Expr *SmackRep::pa(const Expr *base, const Expr *idx, const Expr *size) { return pa(base, Expr::fn("$mul.ref", idx, size)); } -const Expr* SmackRep::pa(const Expr* base, const Expr* offset) { +const Expr *SmackRep::pa(const Expr *base, const Expr *offset) { return Expr::fn("$add.ref", base, offset); } -const Expr* SmackRep::pointerToInteger(const Expr* e, unsigned width) { - e = bitConversion(e, SmackOptions::BitPrecisePointers, SmackOptions::BitPrecise); +const Expr *SmackRep::pointerToInteger(const Expr *e, unsigned width) { + e = bitConversion(e, SmackOptions::BitPrecisePointers, + SmackOptions::BitPrecise); if (ptrSizeInBits < width) e = Expr::fn(opName("$zext", {ptrSizeInBits, width}), e); else if (ptrSizeInBits > width) @@ -592,16 +579,17 @@ const Expr* SmackRep::pointerToInteger(const Expr* e, unsigned width) { return e; } -const Expr* SmackRep::integerToPointer(const Expr* e, unsigned width) { +const Expr *SmackRep::integerToPointer(const Expr *e, unsigned width) { if (width < ptrSizeInBits) e = Expr::fn(opName("$zext", {width, ptrSizeInBits}), e); else if (width > ptrSizeInBits) e = Expr::fn(opName("$trunc", {width, ptrSizeInBits}), e); - e = bitConversion(e, SmackOptions::BitPrecise, SmackOptions::BitPrecisePointers); + e = bitConversion(e, SmackOptions::BitPrecise, + SmackOptions::BitPrecisePointers); return e; } -const Expr* SmackRep::bitConversion(const Expr* e, bool src, bool dst) { +const Expr *SmackRep::bitConversion(const Expr *e, bool src, bool dst) { if (src == dst) return e; std::stringstream fn; @@ -609,48 +597,52 @@ const Expr* SmackRep::bitConversion(const Expr* e, bool src, bool dst) { return Expr::fn(fn.str(), e); } -const Expr* SmackRep::pointerLit(unsigned long v) { - return SmackOptions::BitPrecisePointers ? Expr::lit(v,ptrSizeInBits) : Expr::lit(v); +const Expr *SmackRep::pointerLit(unsigned long long v) { + return SmackOptions::BitPrecisePointers ? Expr::lit(v, ptrSizeInBits) + : Expr::lit(v); } -const Expr* SmackRep::pointerLit(long v) { +const Expr *SmackRep::pointerLit(long long v) { if (v >= 0) - return pointerLit((unsigned long) v); + return pointerLit((unsigned long long)v); else - return Expr::fn("$sub.ref", pointerLit(0UL), pointerLit((unsigned long) std::abs(v))); + return Expr::fn("$sub.ref", pointerLit(0ULL), + pointerLit((unsigned long long)std::abs(v))); } -const Expr* SmackRep::integerLit(unsigned long v, unsigned width) { - return SmackOptions::BitPrecise ? Expr::lit(v,width) : Expr::lit(v); +const Expr *SmackRep::integerLit(unsigned long long v, unsigned width) { + return SmackOptions::BitPrecise ? Expr::lit(v, width) : Expr::lit(v); } -const Expr* SmackRep::integerLit(long v, unsigned width) { +const Expr *SmackRep::integerLit(long long v, unsigned width) { if (v >= 0) - return integerLit((unsigned long) v, width); + return integerLit((unsigned long long)v, width); else { std::stringstream op; op << "$sub." << (SmackOptions::BitPrecise ? "bv" : "i") << width; - return Expr::fn(op.str(), integerLit(0UL, width), integerLit((unsigned long) std::abs(v), width)); + return Expr::fn(op.str(), integerLit(0ULL, width), + integerLit((unsigned long long)std::abs(v), width)); } } -const Expr* SmackRep::lit(const llvm::Value* v, bool isUnsigned) { +const Expr *SmackRep::lit(const llvm::Value *v, bool isUnsigned) { using namespace llvm; - if (const ConstantInt* ci = llvm::dyn_cast(v)) { - const APInt& API = ci->getValue(); + if (const ConstantInt *ci = llvm::dyn_cast(v)) { + const APInt &API = ci->getValue(); unsigned width = ci->getBitWidth(); - bool neg = isUnsigned? false : width > 1 && ci->isNegative(); - std::string str = (neg ? API.abs() : API).toString(10,false); - const Expr* e = SmackOptions::BitPrecise ? Expr::lit(str,width) : Expr::lit(str,0); + bool neg = isUnsigned ? false : width > 1 && ci->isNegative(); + std::string str = (neg ? API.abs() : API).toString(10, false); + const Expr *e = + SmackOptions::BitPrecise ? Expr::lit(str, width) : Expr::lit(str, 0); std::stringstream op; op << "$sub." << (SmackOptions::BitPrecise ? "bv" : "i") << width; - return neg ? Expr::fn(op.str(), integerLit(0UL,width), e) : e; + return neg ? Expr::fn(op.str(), integerLit(0ULL, width), e) : e; - } else if (const ConstantFP* CFP = dyn_cast(v)) { + } else if (const ConstantFP *CFP = dyn_cast(v)) { if (SmackOptions::FloatEnabled) { const APFloat APF = CFP->getValueAPF(); - const Type* type = CFP->getType(); + const Type *type = CFP->getType(); unsigned expSize, sigSize; if (type->isFloatTy()) { expSize = 8; @@ -665,10 +657,49 @@ const Expr* SmackRep::lit(const llvm::Value* v, bool isUnsigned) { llvm_unreachable("Unsupported floating-point type."); } const APInt API = APF.bitcastToAPInt(); - const APInt n_sign = API.trunc(expSize+sigSize-1); - const APInt sig = n_sign.trunc(sigSize-1); - const APInt exp = n_sign.lshr(sigSize-1); - return Expr::lit(APF.isNegative(), sig.toString(10, false), exp.toString(10, false), sigSize, expSize); + const APInt exp = API.lshr(sigSize - 1).trunc(expSize); + APInt sig = API.trunc(sigSize - 1).zext(sigSize); + + if (exp.isAllOnesValue()) { + if (sig != 0) { + return Expr::lit("NaN", sigSize, expSize); + } + if (API.isNegative()) { + return Expr::lit("-oo", sigSize, expSize); + } + return Expr::lit("+oo", sigSize, expSize); + } + + if (exp != 0) { + sig.setBit(sigSize - 1); // hidden bit + } + + APInt bias = APInt::getSignedMaxValue(expSize); + if (exp == 0) { + --bias; + } + + bool overflow; + APInt moveDec = exp.usub_ov(bias, overflow); + moveDec &= APInt(expSize, 3); + int moveDecAsInt = *moveDec.getRawData(); + + APInt finalExp = + exp.usub_ov(bias, overflow).usub_ov(moveDec, overflow).ashr(2); + + int leftSize = 4 * (moveDecAsInt / 4 + 1); + int rightSize = 4 * ((sigSize - moveDecAsInt - 2) / 4 + 1); + + sig = sig.zext(leftSize + rightSize + 4) + << (rightSize - sigSize + moveDecAsInt + 1); + + sig.setBit(sig.getBitWidth() - 1); + + std::string hexSig = sig.toString(16, false).substr(1); + hexSig.insert(leftSize / 4, "."); + + return Expr::lit(API.isNegative(), hexSig, finalExp.toString(10, true), + sigSize, expSize); } else { const APFloat APF = CFP->getValueAPF(); std::string str; @@ -676,7 +707,7 @@ const Expr* SmackRep::lit(const llvm::Value* v, bool isUnsigned) { ss << *CFP; std::istringstream iss(str); std::string float_type; - long integerPart, fractionalPart, exponentPart; + long long integerPart, fractionalPart, exponentPart; char point, sign, exponent; iss >> float_type; iss >> integerPart; @@ -687,7 +718,7 @@ const Expr* SmackRep::lit(const llvm::Value* v, bool isUnsigned) { iss >> exponentPart; return Expr::fn("$fp", Expr::lit(integerPart), Expr::lit(fractionalPart), - Expr::lit(exponentPart)); + Expr::lit(exponentPart)); } } else if (llvm::isa(v)) @@ -697,52 +728,60 @@ const Expr* SmackRep::lit(const llvm::Value* v, bool isUnsigned) { llvm_unreachable("Literal type not supported."); } -const Expr* SmackRep::ptrArith(const llvm::GetElementPtrInst* I) { - std::vector< std::pair > args; +const Expr *SmackRep::ptrArith(const llvm::GetElementPtrInst *I) { + std::vector> args; gep_type_iterator T = gep_type_begin(I); for (unsigned i = 1; i < I->getNumOperands(); i++, ++T) - args.push_back({I->getOperand(i), *T}); + args.push_back({I->getOperand(i), T}); return ptrArith(I->getPointerOperand(), args); } -const Expr* SmackRep::ptrArith(const llvm::ConstantExpr* CE) { - assert (CE->getOpcode() == Instruction::GetElementPtr); - std::vector< std::pair > args; +const Expr *SmackRep::ptrArith(const llvm::ConstantExpr *CE) { + assert(CE->getOpcode() == Instruction::GetElementPtr); + std::vector> args; gep_type_iterator T = gep_type_begin(CE); for (unsigned i = 1; i < CE->getNumOperands(); i++, ++T) - args.push_back({CE->getOperand(i), *T}); + args.push_back({CE->getOperand(i), T}); return ptrArith(CE->getOperand(0), args); } -const Expr* SmackRep::ptrArith(const llvm::Value* p, - std::vector< std::pair > args) { +const Expr *SmackRep::ptrArith( + const llvm::Value *p, + std::vector> args) { using namespace llvm; - const Expr* e = expr(p); + const Expr *e = expr(p); for (auto a : args) { - if (StructType* st = dyn_cast(a.second)) { - assert(a.first->getType()->isIntegerTy() - && a.first->getType()->getPrimitiveSizeInBits() == 32 - && "Illegal struct index"); + + if (StructType *st = a.second.getStructTypeOrNull()) { + assert(a.first->getType()->isIntegerTy() && + a.first->getType()->getPrimitiveSizeInBits() == 32 && + "Illegal struct index"); unsigned fieldNo = dyn_cast(a.first)->getZExtValue(); e = pa(e, offset(st, fieldNo), 1); } else { - Type* et = dyn_cast(a.second)->getElementType(); + Type *et = a.second.getIndexedType(); assert(a.first->getType()->isIntegerTy() && "Illegal index"); - if (const ConstantInt* ci = dyn_cast(a.first)) { - assert(ci->getBitWidth() <= 64 && "Unsupported index bitwidth"); - e = pa(e, (long long) ci->getSExtValue(), storageSize(et)); + if (const ConstantInt *ci = dyn_cast(a.first)) { + // First check if the result of multiplication fits in 64 bits + const APInt &idx = ci->getValue(); + APInt size(idx.getBitWidth(), storageSize(et)); + APInt result = idx * size; + assert(result.getMinSignedBits() <= 64 && + "Index value too large (or too small if negative)"); + e = pa(e, (long long)ci->getSExtValue(), storageSize(et)); } else - e = pa(e, integerToPointer(expr(a.first), a.first->getType()->getIntegerBitWidth()), - storageSize(et)); + e = pa(e, integerToPointer(expr(a.first), + a.first->getType()->getIntegerBitWidth()), + storageSize(et)); } } return e; } -const Expr* SmackRep::expr(const llvm::Value* v, bool isConstIntUnsigned) { +const Expr *SmackRep::expr(const llvm::Value *v, bool isConstIntUnsigned) { using namespace llvm; if (isa(v)) { @@ -754,15 +793,15 @@ const Expr* SmackRep::expr(const llvm::Value* v, bool isConstIntUnsigned) { } else if (isa(v)) { std::string name = naming->get(*v); - auxDecls[name] = Decl::constant(name,type(v)); + auxDecls[name] = Decl::constant(name, type(v)); return Expr::id(name); } else if (naming->get(*v) != "") { return Expr::id(naming->get(*v)); - } else if (const Constant* constant = dyn_cast(v)) { + } else if (const Constant *constant = dyn_cast(v)) { - if (const ConstantExpr* CE = dyn_cast(constant)) { + if (const ConstantExpr *CE = dyn_cast(constant)) { if (CE->getOpcode() == Instruction::GetElementPtr) return ptrArith(CE); @@ -777,14 +816,14 @@ const Expr* SmackRep::expr(const llvm::Value* v, bool isConstIntUnsigned) { return cmp(CE); else { - DEBUG(errs() << "VALUE : " << *constant << "\n"); + SDEBUG(errs() << "VALUE : " << *constant << "\n"); llvm_unreachable("Constant expression of this type not supported."); } - } else if (const ConstantInt* ci = dyn_cast(constant)) { + } else if (const ConstantInt *ci = dyn_cast(constant)) { return lit(ci, isConstIntUnsigned); - } else if (const ConstantFP* cf = dyn_cast(constant)) { + } else if (const ConstantFP *cf = dyn_cast(constant)) { return lit(cf); } else if (auto cv = dyn_cast(constant)) { @@ -797,40 +836,44 @@ const Expr* SmackRep::expr(const llvm::Value* v, bool isConstIntUnsigned) { return Expr::id(Naming::NULL_VAL); else { - DEBUG(errs() << "VALUE : " << *constant << "\n"); + SDEBUG(errs() << "VALUE : " << *constant << "\n"); llvm_unreachable("This type of constant not supported."); } } else if (isa(v)) { - errs() << "warning: ignoring inline asm passed as argument.\n"; - return pointerLit(0UL); + SmackWarnings::warnUnsound("inline asm passed as argument", nullptr, + nullptr); + return pointerLit(0ULL); } else { - DEBUG(errs() << "VALUE : " << *v << "\n"); + SDEBUG(errs() << "VALUE : " << *v << "\n"); llvm_unreachable("Value of this type not supported."); } } -const Expr* SmackRep::cast(const llvm::Instruction* I) { +const Expr *SmackRep::cast(const llvm::Instruction *I) { return cast(I->getOpcode(), I->getOperand(0), I->getType()); } -const Expr* SmackRep::cast(const llvm::ConstantExpr* CE) { +const Expr *SmackRep::cast(const llvm::ConstantExpr *CE) { return cast(CE->getOpcode(), CE->getOperand(0), CE->getType()); } -const Expr* SmackRep::cast(unsigned opcode, const llvm::Value* v, const llvm::Type* t) { +const Expr *SmackRep::cast(unsigned opcode, const llvm::Value *v, + const llvm::Type *t) { std::string fn = Naming::INSTRUCTION_TABLE.at(opcode); - if (opcode == Instruction::FPTrunc || opcode == Instruction::FPExt - || opcode == Instruction::SIToFP || opcode == Instruction::UIToFP) { + if (opcode == Instruction::FPTrunc || opcode == Instruction::FPExt || + opcode == Instruction::SIToFP || opcode == Instruction::UIToFP) { if (SmackOptions::FloatEnabled) { - return Expr::fn(opName(fn, {v->getType(), t}), Expr::id(Naming::RMODE_VAR), expr(v)); + return Expr::fn(opName(fn, {v->getType(), t}), + Expr::id(Naming::RMODE_VAR), expr(v)); } else { return Expr::fn(opName(fn, {v->getType(), t}), expr(v)); } } else if (opcode == Instruction::FPToSI || opcode == Instruction::FPToUI) { if (SmackOptions::FloatEnabled) { - return Expr::fn(opName(fn, {v->getType(), t}), Expr::lit(RModeKind::RTZ), expr(v)); + return Expr::fn(opName(fn, {v->getType(), t}), Expr::lit(RModeKind::RTZ), + expr(v)); } else { return Expr::fn(opName(fn, {v->getType(), t}), expr(v)); } @@ -838,20 +881,36 @@ const Expr* SmackRep::cast(unsigned opcode, const llvm::Value* v, const llvm::Ty return Expr::fn(opName(fn, {v->getType(), t}), expr(v)); } -const Expr* SmackRep::bop(const llvm::ConstantExpr* CE) { - return bop(CE->getOpcode(), CE->getOperand(0), CE->getOperand(1), CE->getType()); +bool SmackRep::isBitwiseOp(llvm::Instruction *I) { + return I->isShift() || I->isBitwiseLogicOp(); +} + +bool SmackRep::isFpArithOp(llvm::Instruction *I) { + return isFpArithOp(I->getOpcode()); +} + +bool SmackRep::isFpArithOp(unsigned opcode) { + return opcode == Instruction::FAdd || opcode == Instruction::FSub || + opcode == Instruction::FMul || opcode == Instruction::FDiv; } -const Expr* SmackRep::bop(const llvm::BinaryOperator* BO) { - return bop(BO->getOpcode(), BO->getOperand(0), BO->getOperand(1), BO->getType()); +const Expr *SmackRep::bop(const llvm::ConstantExpr *CE) { + return bop(CE->getOpcode(), CE->getOperand(0), CE->getOperand(1), + CE->getType()); } -const Expr* SmackRep::bop(unsigned opcode, const llvm::Value* lhs, const llvm::Value* rhs, const llvm::Type* t) { +const Expr *SmackRep::bop(const llvm::BinaryOperator *BO) { + return bop(BO->getOpcode(), BO->getOperand(0), BO->getOperand(1), + BO->getType()); +} + +const Expr *SmackRep::bop(unsigned opcode, const llvm::Value *lhs, + const llvm::Value *rhs, const llvm::Type *t) { std::string fn = Naming::INSTRUCTION_TABLE.at(opcode); - if (opcode == Instruction::FAdd || opcode == Instruction::FSub - || opcode == Instruction::FMul || opcode == Instruction::FDiv) { + if (isFpArithOp(opcode)) { if (SmackOptions::FloatEnabled) { - return Expr::fn(opName(fn, {t}), Expr::id(Naming::RMODE_VAR), expr(lhs), expr(rhs)); + return Expr::fn(opName(fn, {t}), Expr::id(Naming::RMODE_VAR), expr(lhs), + expr(rhs)); } else { return Expr::fn(opName(fn, {t}), expr(lhs), expr(rhs)); } @@ -859,27 +918,29 @@ const Expr* SmackRep::bop(unsigned opcode, const llvm::Value* lhs, const llvm::V return Expr::fn(opName(fn, {t}), expr(lhs), expr(rhs)); } -const Expr* SmackRep::cmp(const llvm::CmpInst* I) { +const Expr *SmackRep::cmp(const llvm::CmpInst *I) { bool isUnsigned = I->isUnsigned(); return cmp(I->getPredicate(), I->getOperand(0), I->getOperand(1), isUnsigned); } -const Expr* SmackRep::cmp(const llvm::ConstantExpr* CE) { +const Expr *SmackRep::cmp(const llvm::ConstantExpr *CE) { return cmp(CE->getPredicate(), CE->getOperand(0), CE->getOperand(1), false); } -const Expr* SmackRep::cmp(unsigned predicate, const llvm::Value* lhs, const llvm::Value* rhs, bool isUnsigned) { - std::string fn = opName(Naming::CMPINST_TABLE.at(predicate), {lhs->getType()}); - const Expr* e1 = expr(lhs, isUnsigned); - const Expr* e2 = expr(rhs, isUnsigned); +const Expr *SmackRep::cmp(unsigned predicate, const llvm::Value *lhs, + const llvm::Value *rhs, bool isUnsigned) { + std::string fn = + opName(Naming::CMPINST_TABLE.at(predicate), {lhs->getType()}); + const Expr *e1 = expr(lhs, isUnsigned); + const Expr *e2 = expr(rhs, isUnsigned); if (lhs->getType()->isFloatingPointTy()) - return Expr::if_then_else(Expr::fn(fn+".bool", e1, e2), integerLit(1UL,1), integerLit(0UL,1)); + return Expr::if_then_else(Expr::fn(fn + ".bool", e1, e2), + integerLit(1ULL, 1), integerLit(0ULL, 1)); else return Expr::fn(fn, e1, e2); } - -bool SmackRep::isContractExpr(const llvm::Value* V) const { +bool SmackRep::isContractExpr(const llvm::Value *V) const { auto name = naming->get(*V); return isContractExpr(name); } @@ -888,12 +949,12 @@ bool SmackRep::isContractExpr(const std::string S) const { return S.find(Naming::CONTRACT_EXPR) == 0; } -ProcDecl* SmackRep::procedure(Function* F, CallInst* CI) { +ProcDecl *SmackRep::procedure(Function *F, CallInst *CI) { assert(F && "Unknown function call."); std::string name = naming->get(*F); - std::list< std::pair > params, rets; - std::list decls; - std::list blocks; + std::list> params, rets; + std::list decls; + std::list blocks; for (auto &A : F->getArgumentList()) params.push_back({naming->get(A), type(A.getType())}); @@ -902,24 +963,18 @@ ProcDecl* SmackRep::procedure(Function* F, CallInst* CI) { rets.push_back({Naming::RET_VAR, type(F->getReturnType())}); if (name == "malloc") { - Type* W = F->getFunctionType()->getParamType(0); + Type *W = F->getFunctionType()->getParamType(0); assert(W->isIntegerTy() && "Expected integer argument."); unsigned width = W->getIntegerBitWidth(); - blocks.push_back( - Block::block("", { - Stmt::call(Naming::MALLOC, - { integerToPointer(Expr::id(params.front().first), width) }, - { Naming::RET_VAR } - ) - }) - ); + blocks.push_back(Block::block( + "", + {Stmt::call(Naming::MALLOC, + {integerToPointer(Expr::id(params.front().first), width)}, + {Naming::RET_VAR})})); } else if (name == "free_") { - blocks.push_back( - Block::block("", { - Stmt::call(Naming::FREE, {Expr::id(params.front().first)}) - }) - ); + blocks.push_back(Block::block( + "", {Stmt::call(Naming::FREE, {Expr::id(params.front().first)})})); } else if (isContractExpr(F)) { for (auto m : memoryMaps()) @@ -935,30 +990,28 @@ ProcDecl* SmackRep::procedure(Function* F, CallInst* CI) { params.push_back({indexedName("p", {0}), type(T)}); } else { - FunctionType* T = F->getFunctionType(); + FunctionType *T = F->getFunctionType(); name = procName(F, *CI); for (unsigned i = T->getNumParams(); i < CI->getNumArgOperands(); i++) { - params.push_back({ - indexedName("p",{i}), - type(CI->getOperand(i)->getType()) - }); + params.push_back( + {indexedName("p", {i}), type(CI->getOperand(i)->getType())}); } } } - return static_cast( - Decl::procedure(name, params, rets, decls, blocks) - ); + return static_cast( + Decl::procedure(name, params, rets, decls, blocks)); } -std::list SmackRep::procedure(llvm::Function* F) { - std::list procs; +std::list SmackRep::procedure(llvm::Function *F) { + std::list procs; std::set names; - std::list callers = findCallers(F); + std::list callers = findCallers(F); // Consider `return_value` calls as normal `value` calls if (F->hasName() && F->getName().equals(Naming::VALUE_PROC)) { - auto more = findCallers(F->getParent()->getFunction(Naming::RETURN_VALUE_PROC)); + auto more = + findCallers(F->getParent()->getFunction(Naming::RETURN_VALUE_PROC)); callers.insert(callers.end(), more.begin(), more.end()); } @@ -977,17 +1030,17 @@ std::list SmackRep::procedure(llvm::Function* F) { return procs; } -const Expr* SmackRep::arg(llvm::Function* f, unsigned pos, llvm::Value* v) { +const Expr *SmackRep::arg(llvm::Function *f, unsigned pos, llvm::Value *v) { return expr(v); } -const Stmt* SmackRep::call(llvm::Function* f, const llvm::User& ci) { +const Stmt *SmackRep::call(llvm::Function *f, const llvm::User &ci) { using namespace llvm; assert(f && "Call encountered unresolved function."); std::string name = naming->get(*f); - std::list args; + std::list args; std::list rets; unsigned num_arg_operands = ci.getNumOperands(); @@ -1005,200 +1058,139 @@ const Stmt* SmackRep::call(llvm::Function* f, const llvm::User& ci) { return Stmt::call(procName(f, ci), args, rets); } -std::string SmackRep::code(llvm::CallInst& ci) { +// we use C-style format characters +// (https://docs.python.org/2.7/library/struct.html#format-characters) +// e.g., @f means the variable is a float +// while @h means the variable is a short +// absence of a format character means use the promoted type as is +std::string SmackRep::code(llvm::CallInst &ci) { - llvm::Function* f = ci.getCalledFunction(); + llvm::Function *f = ci.getCalledFunction(); assert(f && "Inline code embedded in unresolved function."); std::string fmt = getString(ci.getOperand(0)); assert(!fmt.empty() && "inline code: missing format std::string."); std::string s = fmt; - for (unsigned i=1; igetType(); + bool isCast = false; + if (idx + 1 < s.length()) { + switch (s[idx + 1]) { + case 'c': + case 'b': + case 'B': + targetType = Type::getInt8Ty(argV->getContext()); + isCast = true; + break; + case 'f': + targetType = Type::getFloatTy(argV->getContext()); + isCast = true; + break; + case 'h': + case 'H': + targetType = Type::getInt16Ty(argV->getContext()); + isCast = true; + break; + case 'i': + case 'I': + targetType = Type::getInt32Ty(argV->getContext()); + isCast = true; + break; + default: + break; + } + } + if (argV->getType() != targetType) { + assert(isa(argV) && "Expected a cast expression."); + CastInst *c = llvm::cast(argV); + argV = c->getOperand(0); + assert(argV->getType() == targetType && + "Argument type does not match specified type."); + } + std::ostringstream ss; - a->print(ss); - s = s.replace(idx,1,ss.str()); + arg(f, i, argV)->print(ss); + s = s.replace(idx, (isCast ? 2 : 1), ss.str()); } return s; } -std::string SmackRep::getPrelude() { - std::stringstream s; - - s << "// Basic types" << "\n"; - for (unsigned size : INTEGER_SIZES) - s << Decl::typee("i" + std::to_string(size),"int") << "\n"; - s << Decl::typee(Naming::PTR_TYPE, pointerType()) << "\n"; - if (SmackOptions::FloatEnabled) { - s << Decl::typee(Naming::HALF_TYPE, "float11e5") << "\n"; - s << Decl::typee(Naming::FLOAT_TYPE, "float24e8") << "\n"; - s << Decl::typee(Naming::DOUBLE_TYPE, "float53e11") << "\n"; - s << Decl::typee(Naming::LONG_DOUBLE_TYPE, "float65e15") << "\n"; - } else { - s << Decl::typee(Naming::UNINTERPRETED_FLOAT_TYPE, "") << "\n"; - } - s << "\n"; - - s << "// Basic constants" << "\n"; - s << Decl::constant("$0",intType(32)) << "\n"; - s << Decl::axiom(Expr::eq(Expr::id("$0"),integerLit(0UL,32))) << "\n"; - s << Decl::constant("$1",intType(32)) << "\n"; - s << Decl::axiom(Expr::eq(Expr::id("$1"),integerLit(1UL,32))) << "\n"; - - for (unsigned i : REF_CONSTANTS) { - std::stringstream t; - s << "const $" << i << ".ref: ref;" << "\n"; - t << "$" << i << ".ref"; - s << Decl::axiom(Expr::eq(Expr::id(t.str()),pointerLit((unsigned long) i))) << "\n"; - } - s << "\n"; - - s << "// Memory maps (" << regions->size() << " regions)" << "\n"; - for (auto M : memoryMaps()) - s << "var " << M.first << ": " << M.second << ";" << "\n"; - - s << "\n"; - - s << "// Memory address bounds" << "\n"; - s << Decl::axiom(Expr::eq(Expr::id(Naming::GLOBALS_BOTTOM),pointerLit(globalsBottom))) << "\n"; - s << Decl::axiom(Expr::eq(Expr::id(Naming::EXTERNS_BOTTOM),pointerLit(externsBottom))) << "\n"; - unsigned long malloc_top; - if (ptrSizeInBits == 32) - malloc_top = 2147483647UL; - else if (ptrSizeInBits == 64) - malloc_top = 9223372036854775807UL; - else - llvm_unreachable("Unexpected pointer bit width."); - s << Decl::axiom(Expr::eq(Expr::id(Naming::MALLOC_TOP),pointerLit(malloc_top))) << "\n"; - s << "\n"; - - if (SmackOptions::MemorySafety) { - s << "// Global allocations" << "\n"; - std::list stmts; - for (auto E : globalAllocations) - stmts.push_back(Stmt::call("$galloc", {expr(E.first), pointerLit(E.second)})); - s << Decl::procedure("$global_allocations", {}, {}, {}, {Block::block("",stmts)}) << "\n"; - s << "\n"; - } - - s << "// Bitstd::vector-integer conversions" << "\n"; - std::string b = std::to_string(ptrSizeInBits); - std::string bt = "bv" + b; - std::string it = "i" + b; - s << Decl::function(indexedName("$int2bv",{ptrSizeInBits}), {{"i",it}}, bt, NULL, {Attr::attr("builtin", "(_ int2bv " + b + ")")}) << "\n"; - if (SmackOptions::BitPrecise) { - s << Decl::function(indexedName("$bv2uint",{ptrSizeInBits}), {{"i",bt}}, it, NULL, {Attr::attr("builtin", "bv2int")}) << "\n"; - const Expr* arg = Expr::id("i"); - const Expr* uint = Expr::fn(indexedName("$bv2uint", {ptrSizeInBits}), arg); - std::string offset; - if (ptrSizeInBits == 32) - offset = "4294967296"; - else if (ptrSizeInBits == 64) - offset = "18446744073709551616"; - else - llvm_unreachable("Unexpected pointer bit width."); - s << Decl::function(indexedName("$bv2int",{ptrSizeInBits}), {{"i",bt}}, it, - Expr::cond(Expr::fn(indexedName("$slt", {bt, "bool"}), {arg, Expr::lit(0UL, ptrSizeInBits)}), - Expr::fn(indexedName("$sub", {it}), {uint, Expr::lit(offset, 0U)}), uint), {Attr::attr("inline")}); - } else - s << Decl::function(indexedName("$bv2int",{ptrSizeInBits}), {{"i",bt}}, it, NULL, {Attr::attr("builtin", "bv2int")}) << "\n"; - s << "\n"; - - if (SmackOptions::BitPrecise) { - // XXX TODO don't assume 64-bit pointers TODO XXX - s << "// Bytewise pointer storage" << "\n"; - s << "function {:inline} $load.bytes.ref(M: [ref] bv8, p: ref) " - << "returns (ref) { $i2p.bv64.ref($load.bytes.bv64(M, p)) }" - << "\n"; - s << "function {:inline} $store.bytes.ref(M: [ref] bv8, p: ref, v: ref)" - << "returns ([ref] bv8) { $store.bytes.bv64(M,p,$p2i.ref.bv64(v)) }" - << "\n"; - } +void SmackRep::addBplGlobal(std::string name) { bplGlobals.push_back(name); } - s << "// Pointer-number conversions" << "\n"; - for (unsigned i = 8; i <= 64; i <<= 1) { - s << Decl::function(indexedName("$p2i", {Naming::PTR_TYPE,intType(i)}), {{"p",Naming::PTR_TYPE}}, intType(i), pointerToInteger(Expr::id("p"),i), {Attr::attr("inline")}) << "\n"; - s << Decl::function(indexedName("$i2p", {intType(i),Naming::PTR_TYPE}), {{"i",intType(i)}}, Naming::PTR_TYPE, integerToPointer(Expr::id("i"),i), {Attr::attr("inline")}) << "\n"; +// Dealing with bitcasts between integers and floating-points +// by adding appropriate assume statements constraining cast inverses +const Stmt *SmackRep::inverseFPCastAssume(const Value *src, + const Type *destType) { + if (!(SmackOptions::BitPrecise && SmackOptions::FloatEnabled)) { + return nullptr; } - s << "\n"; - - s << "// Pointer predicates" << "\n"; - const std::vector predicates { - "$eq", "$ne", "$ugt", "$uge", "$ult", "$ule", "$sgt", "$sge", "$slt", "$sle" - }; - for (auto pred : predicates) { - s << Decl::function(indexedName(pred,{Naming::PTR_TYPE}), - {{"p1",Naming::PTR_TYPE}, {"p2",Naming::PTR_TYPE}}, intType(1), - Expr::cond( - Expr::fn(indexedName(pred,{pointerType(),Naming::BOOL_TYPE}), {Expr::id("p1"),Expr::id("p2")}), - integerLit(1L,1), - integerLit(0L,1)), - {Attr::attr("inline")} ) - << "\n"; - s << Decl::function(indexedName(pred,{Naming::PTR_TYPE,Naming::BOOL_TYPE}), - {{"p1",Naming::PTR_TYPE}, {"p2",Naming::PTR_TYPE}}, Naming::BOOL_TYPE, - Expr::fn(indexedName(pred,{pointerType(),Naming::BOOL_TYPE}), {Expr::id("p1"),Expr::id("p2")}), - {Attr::attr("inline")} ) - << "\n"; + const Type *srcType = src->getType(); + if (!(srcType->isFloatingPointTy() && destType->isIntegerTy())) { + return nullptr; } - s << "\n"; - - s << "// Pointer operations" << "\n"; - const std::vector operations = {"$add", "$sub", "$mul"}; - for (auto op : operations) { - s << Decl::function(indexedName(op,{Naming::PTR_TYPE}), - {{"p1",Naming::PTR_TYPE},{"p2",Naming::PTR_TYPE}}, Naming::PTR_TYPE, - Expr::fn(indexedName(op,{pointerType()}), {Expr::id("p1"), Expr::id("p2")}), - {Attr::attr("inline")}) - << "\n"; + std::string fn = Naming::INSTRUCTION_TABLE.at(Instruction::BitCast); + const Expr *srcExpr = expr(src); + const Expr *castFPToInt = + Expr::fn(opName(fn, {src->getType(), destType}), srcExpr); + const Expr *castIntToFP = + Expr::fn(opName(fn, {destType, src->getType()}), castFPToInt); + return Stmt::assume(Expr::eq(castIntToFP, srcExpr)); +} + +const Stmt *SmackRep::inverseFPCastAssume(const StoreInst *si) { + const Value *P = si->getPointerOperand(); + const PointerType *PT = dyn_cast(P->getType()); + assert(PT && "Expected pointer type."); + const Type *T = PT->getElementType(); + unsigned R = regions->idx(P); + if (!T->isFloatingPointTy() || !regions->get(R).bytewiseAccess() || + regions->get(R).isSingleton()) { + return nullptr; } - s << "\n"; - - return s.str(); -} - -void SmackRep::addBplGlobal(std::string name) { - bplGlobals.push_back(name); + return inverseFPCastAssume( + si->getValueOperand(), + Type::getIntNTy(T->getContext(), T->getPrimitiveSizeInBits())); } -unsigned SmackRep::numElements(const llvm::Constant* v) { +unsigned SmackRep::numElements(const llvm::Constant *v) { using namespace llvm; - if (const ArrayType* at = dyn_cast(v->getType())) + if (const ArrayType *at = dyn_cast(v->getType())) return at->getNumElements(); else return 1; } -void SmackRep::addInitFunc(const llvm::Function* f) { - assert(f->getReturnType()->isVoidTy() - && "Init functions cannot return a value"); - assert(f->getArgumentList().empty() - && "Init functions cannot take parameters"); +void SmackRep::addInitFunc(const llvm::Function *f) { + assert(f->getReturnType()->isVoidTy() && + "Init functions cannot return a value"); + assert(f->getArgumentList().empty() && + "Init functions cannot take parameters"); initFuncs.push_back(naming->get(*f)); } -Decl* SmackRep::getInitFuncs() { - ProcDecl* proc = (ProcDecl*) Decl::procedure( - Naming::INITIALIZE_PROC); - Block* b = Block::block(); +Decl *SmackRep::getInitFuncs() { + ProcDecl *proc = (ProcDecl *)Decl::procedure(Naming::INITIALIZE_PROC); + Block *b = Block::block(); for (auto name : initFuncs) b->addStmt(Stmt::call(name)); if (SmackOptions::FloatEnabled) { - b->addStmt(Stmt::assign(Expr::id(Naming::RMODE_VAR), Expr::lit(RModeKind::RNE))); + b->addStmt( + Stmt::assign(Expr::id(Naming::RMODE_VAR), Expr::lit(RModeKind::RNE))); } b->addStmt(Stmt::return_()); proc->getBlocks().push_back(b); return proc; } -std::list SmackRep::globalDecl(const llvm::GlobalValue* v) { +std::list SmackRep::globalDecl(const llvm::GlobalValue *v) { using namespace llvm; - std::list decls; - std::list ax; + std::list decls; + std::list ax; std::string name = naming->get(*v); if (isCodeString(v)) @@ -1207,13 +1199,13 @@ std::list SmackRep::globalDecl(const llvm::GlobalValue* v) { unsigned size = 0; bool external = false; - if (const GlobalVariable* g = dyn_cast(v)) { + if (const GlobalVariable *g = dyn_cast(v)) { if (g->hasInitializer()) { - const Constant* init = g->getInitializer(); + const Constant *init = g->getInitializer(); unsigned numElems = numElements(init); // NOTE: all global variables have pointer type in LLVM - if (const PointerType* t = dyn_cast(g->getType())) { + if (const PointerType *t = dyn_cast(g->getType())) { // in case we can determine the size of the element type ... if (t->getElementType()->isSized()) @@ -1228,7 +1220,7 @@ std::list SmackRep::globalDecl(const llvm::GlobalValue* v) { if (!g->hasName() || !STRING_CONSTANT.match(g->getName().str())) { if (numElems > 1) - ax.push_back(Attr::attr("count",numElems)); + ax.push_back(Attr::attr("count", numElems)); } } else { @@ -1243,20 +1235,24 @@ std::list SmackRep::globalDecl(const llvm::GlobalValue* v) { // Add padding between globals to be able to check memory overflows/underflows const unsigned globalsPadding = 1024; - decls.push_back(Decl::axiom(Expr::eq( - Expr::id(name), - pointerLit(external ? externsBottom -= size : globalsBottom -= (size + globalsPadding)) ))); - + if (external) { + decls.push_back(Decl::axiom(Expr::eq( + Expr::id(name), Expr::fn("$add.ref", Expr::id(Naming::GLOBALS_BOTTOM), + pointerLit(externsOffset -= size))))); + } else { + decls.push_back(Decl::axiom(Expr::eq( + Expr::id(name), pointerLit(globalsOffset -= (size + globalsPadding))))); + } globalAllocations[v] = size; return decls; } -const Expr* SmackRep::declareIsExternal(const Expr* e) { - return Expr::fn(Naming::EXTERNAL_ADDR,e); +const Expr *SmackRep::declareIsExternal(const Expr *e) { + return Expr::fn(Naming::EXTERNAL_ADDR, e); } -Decl* SmackRep::memcpyProc(std::string type, unsigned length) { +Decl *SmackRep::memcpyProc(std::string type, unsigned length) { std::stringstream s; std::string name = Naming::MEMCPY + "." + type; @@ -1264,10 +1260,9 @@ Decl* SmackRep::memcpyProc(std::string type, unsigned length) { if (no_quantifiers) name = name + "." + std::to_string(length); - else if (SmackOptions::Warnings) - errs() << "warning: memory intrinsic length exceeds threshold (" - << MEMORY_INTRINSIC_THRESHOLD << "); " - << "adding quantifiers.\n"; + SmackWarnings::warnInfo( + "warning: memory intrinsic length exceeds threshold (" + + std::to_string(MEMORY_INTRINSIC_THRESHOLD) + "adding quantifiers."); s << "procedure " << name << "(" << "M.dst: [ref] " << type << ", " @@ -1278,48 +1273,62 @@ Decl* SmackRep::memcpyProc(std::string type, unsigned length) { << "align: ref, " << "isvolatile: bool" << ") returns (" - << "M.ret: [ref] " << type - << ")"; + << "M.ret: [ref] " << type << ")"; if (no_quantifiers) { - s << "\n" << "{" << "\n"; - s << " M.ret := M.dst;" << "\n"; + s << "\n" + << "{" + << "\n"; + s << " M.ret := M.dst;" + << "\n"; for (unsigned offset = 0; offset < length; ++offset) s << " M.ret[$add.ref(dst," << offset << ")] := " - << "M.src[$add.ref(src," << offset << ")];" << "\n"; - s << "}" << "\n"; + << "M.src[$add.ref(src," << offset << ")];" + << "\n"; + s << "}" + << "\n"; } else if (SmackOptions::MemoryModelImpls) { - s << "\n" << "{" << "\n"; + s << "\n" + << "{" + << "\n"; s << " assume (forall x: ref :: " << "$sle.ref.bool(dst,x) && $slt.ref.bool(x,$add.ref(dst,len)) ==> " << "M.ret[x] == M.src[$add.ref($sub.ref(src,dst),x)]" - << ");" << "\n"; + << ");" + << "\n"; s << " assume (forall x: ref :: " << "$slt.ref.bool(x,dst) ==> M.ret[x] == M.dst[x]" - << ");" << "\n"; + << ");" + << "\n"; s << " assume (forall x: ref :: " << "$sle.ref.bool($add.ref(dst,len),x) ==> M.ret[x] == M.dst[x]" - << ");" << "\n"; - s << "}" << "\n"; + << ");" + << "\n"; + s << "}" + << "\n"; } else { - s << ";" << "\n"; + s << ";" + << "\n"; s << "ensures (forall x: ref :: " << "$sle.ref.bool(dst,x) && $slt.ref.bool(x,$add.ref(dst,len)) ==> " << "M.ret[x] == M.src[$add.ref($sub.ref(src,dst),x)]" - << ");" << "\n"; + << ");" + << "\n"; s << "ensures (forall x: ref :: " << "$slt.ref.bool(x,dst) ==> M.ret[x] == M.dst[x]" - << ");" << "\n"; + << ");" + << "\n"; s << "ensures (forall x: ref :: " << "$sle.ref.bool($add.ref(dst,len),x) ==> M.ret[x] == M.dst[x]" - << ");" << "\n"; + << ");" + << "\n"; } return Decl::code(name, s.str()); } -Decl* SmackRep::memsetProc(std::string type, unsigned length) { +Decl *SmackRep::memsetProc(std::string type, unsigned length) { std::stringstream s; std::string name = Naming::MEMSET + "." + type; @@ -1327,10 +1336,9 @@ Decl* SmackRep::memsetProc(std::string type, unsigned length) { if (no_quantifiers) name = name + "." + std::to_string(length); - else if (SmackOptions::Warnings) - errs() << "warning: memory intrinsic length exceeds threshold (" - << MEMORY_INTRINSIC_THRESHOLD << "); " - << "adding quantifiers.\n"; + SmackWarnings::warnInfo( + "warning: memory intrinsic length exceeds threshold (" + + std::to_string(MEMORY_INTRINSIC_THRESHOLD) + "adding quantifiers."); s << "procedure " << name << "(" << "M: [ref] " << type << ", " @@ -1340,42 +1348,56 @@ Decl* SmackRep::memsetProc(std::string type, unsigned length) { << "align: ref, " << "isvolatile: bool" << ") returns (" - << "M.ret: [ref] " << type - << ")"; + << "M.ret: [ref] " << type << ")"; if (no_quantifiers) { - s << "\n" << "{" << "\n"; - s << "M.ret := M;" << "\n"; + s << "\n" + << "{" + << "\n"; + s << "M.ret := M;" + << "\n"; for (unsigned offset = 0; offset < length; ++offset) - s << " M.ret[$add.ref(dst," << offset << ")] := val;" << "\n"; - s << "}" << "\n"; + s << " M.ret[$add.ref(dst," << offset << ")] := val;" + << "\n"; + s << "}" + << "\n"; } else if (SmackOptions::MemoryModelImpls) { - s << "\n" << "{" << "\n"; + s << "\n" + << "{" + << "\n"; s << " assume (forall x: ref :: " << "$sle.ref.bool(dst,x) && $slt.ref.bool(x,$add.ref(dst,len)) ==> " << "M.ret[x] == val" - << ");" << "\n"; + << ");" + << "\n"; s << " assume (forall x: ref :: " << "$slt.ref.bool(x,dst) ==> M.ret[x] == M[x]" - << ");" << "\n"; + << ");" + << "\n"; s << " assume (forall x: ref :: " << "$sle.ref.bool($add.ref(dst,len),x) ==> M.ret[x] == M[x]" - << ");" << "\n"; - s << "}" << "\n"; + << ");" + << "\n"; + s << "}" + << "\n"; } else { - s << ";" << "\n"; + s << ";" + << "\n"; s << "ensures (forall x: ref :: " << "$sle.ref.bool(dst,x) && $slt.ref.bool(x,$add.ref(dst,len)) ==> " << "M.ret[x] == val" - << ");" << "\n"; + << ");" + << "\n"; s << "ensures (forall x: ref :: " << "$slt.ref.bool(x,dst) ==> M.ret[x] == M[x]" - << ");" << "\n"; + << ");" + << "\n"; s << "ensures (forall x: ref :: " << "$sle.ref.bool($add.ref(dst,len),x) ==> M.ret[x] == M[x]" - << ");" << "\n"; + << ");" + << "\n"; } return Decl::code(name, s.str()); } diff --git a/lib/smack/SmackWarnings.cpp b/lib/smack/SmackWarnings.cpp new file mode 100644 index 000000000..a8408aec9 --- /dev/null +++ b/lib/smack/SmackWarnings.cpp @@ -0,0 +1,98 @@ +#include "llvm/IR/DebugInfoMetadata.h" +#include "llvm/IR/DebugLoc.h" +#include "llvm/Support/raw_ostream.h" + +#include "smack/SmackOptions.h" +#include "smack/SmackWarnings.h" + +#include +#include + +namespace smack { +using namespace llvm; + +std::string buildDebugInfo(const Instruction *i) { + std::stringstream ss; + if (i && i->getMetadata("dbg")) { + const DebugLoc DL = i->getDebugLoc(); + auto *scope = cast(DL.getScope()); + + ss << scope->getFilename().str() << ":" << DL.getLine() << ":" + << DL.getCol() << ": "; + } + return ss.str(); +} + +bool SmackWarnings::isSufficientWarningLevel(WarningLevel level) { + return SmackOptions::WarningLevel >= level; +} + +SmackWarnings::UnsetFlagsT +SmackWarnings::getUnsetFlags(RequiredFlagsT requiredFlags) { + UnsetFlagsT ret; + std::copy_if(requiredFlags.begin(), requiredFlags.end(), + std::inserter(ret, ret.begin()), + [](FlagT *flag) { return !*flag; }); + return ret; +} + +std::string SmackWarnings::getFlagStr(UnsetFlagsT flags) { + std::string ret = ""; + for (auto f : flags) + ret += ("--" + f->ArgStr.str() + " "); + return ret; +} + +void SmackWarnings::warnIfUnsound(std::string name, + RequiredFlagsT requiredFlags, + Block *currBlock, const Instruction *i, + bool ignore) { + auto unsetFlags = getUnsetFlags(requiredFlags); + if (unsetFlags.size()) + warnUnsound(name, unsetFlags, currBlock, i, ignore); +} + +void SmackWarnings::warnUnsound(std::string unmodeledOpName, Block *currBlock, + const Instruction *i, bool ignore) { + warnUnsound("unmodeled operation " + unmodeledOpName, UnsetFlagsT(), + currBlock, i, ignore); +} + +void SmackWarnings::warnUnsound(std::string name, UnsetFlagsT unsetFlags, + Block *currBlock, const Instruction *i, + bool ignore) { + if (!isSufficientWarningLevel(WarningLevel::Unsound)) + return; + std::string beginning = std::string("llvm2bpl: ") + buildDebugInfo(i); + std::string end = + (ignore ? "unsoundly ignoring " : "over-approximating ") + name + ";"; + if (currBlock) + currBlock->addStmt(Stmt::comment(beginning + "warning: " + end)); + std::string hint = ""; + if (unsetFlags.size()) + hint = (" try adding flag(s): " + getFlagStr(unsetFlags)); + errs() << beginning; + (SmackOptions::ColoredWarnings ? errs().changeColor(raw_ostream::MAGENTA) + : errs()) + << "warning: "; + (SmackOptions::ColoredWarnings ? errs().resetColor() : errs()) + << end << hint << "\n"; +} + +void SmackWarnings::warnIfUnsound(std::string name, FlagT &requiredFlag, + Block *currBlock, const Instruction *i) { + warnIfUnsound(name, {&requiredFlag}, currBlock, i); +} + +void SmackWarnings::warnIfUnsound(std::string name, FlagT &requiredFlag1, + FlagT &requiredFlag2, Block *currBlock, + const Instruction *i) { + warnIfUnsound(name, {&requiredFlag1, &requiredFlag2}, currBlock, i); +} + +void SmackWarnings::warnInfo(std::string info) { + if (!isSufficientWarningLevel(WarningLevel::Info)) + return; + errs() << "warning: " << info << "\n"; +} +} diff --git a/lib/smack/SplitAggregateValue.cpp b/lib/smack/SplitAggregateValue.cpp index 8df67e764..4aa57f3ba 100644 --- a/lib/smack/SplitAggregateValue.cpp +++ b/lib/smack/SplitAggregateValue.cpp @@ -8,66 +8,68 @@ namespace smack { using namespace llvm; -std::vector getFirsts(SplitAggregateValue::IndexT lst) { - std::vector ret; - for (auto& p : lst) +std::vector getFirsts(SplitAggregateValue::IndexT lst) { + std::vector ret; + for (auto &p : lst) ret.push_back(std::get<0>(p)); return ret; } std::vector getSeconds(SplitAggregateValue::IndexT lst) { std::vector ret; - for (auto p = lst.begin()+1; p != lst.end(); ++p) + for (auto p = lst.begin() + 1; p != lst.end(); ++p) ret.push_back(std::get<1>(*p)); return ret; } -bool SplitAggregateValue::runOnBasicBlock(BasicBlock& BB) { - std::vector toRemove; - LLVMContext& C = BB.getContext(); - for(Instruction& I : BB) { +bool SplitAggregateValue::runOnBasicBlock(BasicBlock &BB) { + std::vector toRemove; + LLVMContext &C = BB.getContext(); + for (Instruction &I : BB) { IndexT idx; std::vector info; - if (LoadInst* li = dyn_cast(&I)) { + if (LoadInst *li = dyn_cast(&I)) { if (li->getType()->isAggregateType()) { visitAggregateValue(nullptr, li->getType(), idx, info, C); IRBuilder<> irb(li); li->replaceAllUsesWith(splitAggregateLoad(li, info, irb)); toRemove.push_back(li); } - } else if (StoreInst* si = dyn_cast(&I)) { - Value* V = si->getValueOperand(); + } else if (StoreInst *si = dyn_cast(&I)) { + Value *V = si->getValueOperand(); if (V->getType()->isAggregateType()) { - visitAggregateValue(dyn_cast_or_null(V), V->getType(), idx, info, C); + visitAggregateValue(dyn_cast_or_null(V), V->getType(), idx, + info, C); IRBuilder<> irb(si); splitAggregateStore(si, info, irb); toRemove.push_back(si); } - } else if (ReturnInst* ri = dyn_cast(&I)) { - Value* V = ri->getReturnValue(); + } else if (ReturnInst *ri = dyn_cast(&I)) { + Value *V = ri->getReturnValue(); if (isConstantAggregate(V)) { visitAggregateValue(cast(V), V->getType(), idx, info, C); splitConstantReturn(ri, info); } - } else if (CallInst* ci = dyn_cast(&I)) { + } else if (CallInst *ci = dyn_cast(&I)) { for (unsigned i = 0; i < ci->getNumArgOperands(); ++i) { - Value* arg = ci->getArgOperand(i); + Value *arg = ci->getArgOperand(i); if (isConstantAggregate(arg)) { info.clear(); idx.clear(); - visitAggregateValue(cast(arg), arg->getType(), idx, info, C); + visitAggregateValue(cast(arg), arg->getType(), idx, info, + C); splitConstantArg(ci, i, info); } } } } - for (auto& i : toRemove) + for (auto &i : toRemove) i->eraseFromParent(); return true; } -bool SplitAggregateValue::isConstantAggregate(Value* V) { +bool SplitAggregateValue::isConstantAggregate(Value *V) { // we do not want to touch vector type here since there is // special support for it if (V && (V->getType()->isStructTy() || V->getType()->isArrayTy())) @@ -76,75 +78,85 @@ bool SplitAggregateValue::isConstantAggregate(Value* V) { return false; } -Value* SplitAggregateValue::splitAggregateLoad(LoadInst* li, std::vector& info, IRBuilder<>& irb) { - Value* V = UndefValue::get(li->getType()); - Value* P = li->getPointerOperand(); - for (auto& e : info) { +Value *SplitAggregateValue::splitAggregateLoad(LoadInst *li, + std::vector &info, + IRBuilder<> &irb) { + Value *V = UndefValue::get(li->getType()); + Value *P = li->getPointerOperand(); + for (auto &e : info) { IndexT idxs = std::get<0>(e); - V = irb.CreateInsertValue(V, - irb.CreateLoad(irb.CreateGEP(P, ArrayRef(getFirsts(idxs)))), - ArrayRef(getSeconds(idxs))); + V = irb.CreateInsertValue( + V, irb.CreateLoad(irb.CreateGEP(P, ArrayRef(getFirsts(idxs)))), + ArrayRef(getSeconds(idxs))); } return V; } -void SplitAggregateValue::splitAggregateStore(StoreInst* si, std::vector& info, IRBuilder<>& irb) { - Value* P = si->getPointerOperand(); - Value* V = si->getValueOperand(); - for (auto& e : info) { +void SplitAggregateValue::splitAggregateStore(StoreInst *si, + std::vector &info, + IRBuilder<> &irb) { + Value *P = si->getPointerOperand(); + Value *V = si->getValueOperand(); + for (auto &e : info) { IndexT idxs = std::get<0>(e); - Constant* c = std::get<1>(e); - std::vector vidxs = getFirsts(idxs); + Constant *c = std::get<1>(e); + std::vector vidxs = getFirsts(idxs); if (c) - irb.CreateStore(c, irb.CreateGEP(P, ArrayRef(vidxs))); + irb.CreateStore(c, irb.CreateGEP(P, ArrayRef(vidxs))); else - irb.CreateStore(irb.CreateExtractValue( - V, ArrayRef(getSeconds(idxs))), - irb.CreateGEP(P, ArrayRef(vidxs))); + irb.CreateStore( + irb.CreateExtractValue(V, ArrayRef(getSeconds(idxs))), + irb.CreateGEP(P, ArrayRef(vidxs))); } } -Value* SplitAggregateValue::createInsertedValue(IRBuilder<>& irb, Type* T, std::vector& info, Value* V) { - Value* box = irb.CreateAlloca(T); - StoreInst* si = new StoreInst(V, box); - LoadInst* li = new LoadInst(box); +Value *SplitAggregateValue::createInsertedValue(IRBuilder<> &irb, Type *T, + std::vector &info, + Value *V) { + Value *box = irb.CreateAlloca(T); + StoreInst *si = new StoreInst(V, box); + LoadInst *li = new LoadInst(box); splitAggregateStore(si, info, irb); return splitAggregateLoad(li, info, irb); } -void SplitAggregateValue::splitConstantReturn(ReturnInst* ri, std::vector& info) { +void SplitAggregateValue::splitConstantReturn(ReturnInst *ri, + std::vector &info) { IRBuilder<> irb(ri); - Type* T = ri->getReturnValue()->getType(); + Type *T = ri->getReturnValue()->getType(); ri->setOperand(0, createInsertedValue(irb, T, info, ri->getReturnValue())); } -void SplitAggregateValue::splitConstantArg(CallInst* ci, unsigned i, std::vector& info) { +void SplitAggregateValue::splitConstantArg(CallInst *ci, unsigned i, + std::vector &info) { IRBuilder<> irb(ci); - Type* T = ci->getArgOperand(i)->getType(); + Type *T = ci->getArgOperand(i)->getType(); ci->setArgOperand(i, createInsertedValue(irb, T, info, ci->getArgOperand(i))); } -void SplitAggregateValue::visitAggregateValue(Constant* baseVal, Type* T, IndexT idxs, - std::vector& info, LLVMContext& C){ - Constant* newBaseVal = baseVal; +void SplitAggregateValue::visitAggregateValue(Constant *baseVal, Type *T, + IndexT idxs, + std::vector &info, + LLVMContext &C) { + Constant *newBaseVal = baseVal; if (T->isIntegerTy() || T->isFloatingPointTy() || T->isPointerTy()) - info.push_back({idxs, newBaseVal}); - else if (ArrayType* AT = dyn_cast(T)) { + info.push_back({idxs, newBaseVal}); + else if (ArrayType *AT = dyn_cast(T)) { for (unsigned i = 0; i < AT->getNumElements(); ++i) { - newBaseVal = baseVal? baseVal->getAggregateElement(i) : baseVal; + newBaseVal = baseVal ? baseVal->getAggregateElement(i) : baseVal; IndexT lidxs(idxs); if (lidxs.empty()) - lidxs.push_back({ConstantInt::get(Type::getInt32Ty(C),0), 0}); - lidxs.push_back({ConstantInt::get(Type::getInt64Ty(C),i), i}); + lidxs.push_back({ConstantInt::get(Type::getInt32Ty(C), 0), 0}); + lidxs.push_back({ConstantInt::get(Type::getInt64Ty(C), i), i}); visitAggregateValue(newBaseVal, AT->getElementType(), lidxs, info, C); } - } else if (StructType* ST = dyn_cast(T)) { + } else if (StructType *ST = dyn_cast(T)) { for (unsigned i = 0; i < ST->getNumElements(); ++i) { - newBaseVal = baseVal? baseVal->getAggregateElement(i) : baseVal; + newBaseVal = baseVal ? baseVal->getAggregateElement(i) : baseVal; IndexT lidxs(idxs); if (lidxs.empty()) - lidxs.push_back({ConstantInt::get(Type::getInt32Ty(C),0), 0}); - lidxs.push_back({ConstantInt::get(Type::getInt32Ty(C),i), i}); + lidxs.push_back({ConstantInt::get(Type::getInt32Ty(C), 0), 0}); + lidxs.push_back({ConstantInt::get(Type::getInt32Ty(C), i), i}); visitAggregateValue(newBaseVal, ST->getElementType(i), lidxs, info, C); } } else @@ -156,7 +168,6 @@ char SplitAggregateValue::ID = 0; // Register the pass static RegisterPass -X("split-aggregate-values", "Split Load/Store/ConstantReturn of Aggregate Types"); - + X("split-aggregate-values", + "Split Load/Store/ConstantReturn of Aggregate Types"); } - diff --git a/lib/smack/VectorOperations.cpp b/lib/smack/VectorOperations.cpp index f4c93a36a..9a6c7e83f 100644 --- a/lib/smack/VectorOperations.cpp +++ b/lib/smack/VectorOperations.cpp @@ -2,303 +2,305 @@ // This file is distributed under the MIT License. See LICENSE for details. // #define DEBUG_TYPE "vector-ops" -#include "llvm/IR/Instruction.h" -#include "smack/BoogieAst.h" -#include "smack/SmackRep.h" -#include "smack/Regions.h" #include "smack/VectorOperations.h" -#include "smack/Naming.h" #include "smack/Debug.h" +#include "smack/Naming.h" +#include "smack/Regions.h" +#include "llvm/IR/Instruction.h" #include -#include using namespace llvm; namespace smack { - std::string VectorOperations::constructor(Type *T) { - return "mk." + rep->type(T); - } +std::string VectorOperations::constructor(Type *T) { + return "mk." + rep->type(T); +} - std::string VectorOperations::field(Type *T, unsigned idx) { - std::stringstream ss; - ss << "i" << idx; - return ss.str(); - } +std::string VectorOperations::field(Type *T, unsigned idx) { + std::stringstream ss; + ss << "i" << idx; + return ss.str(); +} - std::string VectorOperations::selector(Type *T, unsigned idx) { - return field(T, idx) + "#" + constructor(T); - } +std::string VectorOperations::selector(Type *T, unsigned idx) { + return field(T, idx) + "#" + constructor(T); +} - std::list VectorOperations::type(Type *T) { - auto VT = dyn_cast(T); - assert(VT && "expected vector type"); - std::list decls; +std::list VectorOperations::type(Type *T) { + auto VT = dyn_cast(T); + assert(VT && "expected vector type"); + std::list decls; - std::list< std::pair< std::string, std::string > > args; - for (unsigned i=0; igetNumElements(); i++) - args.push_back({field(T, i), rep->type(VT->getElementType())}); + std::list> args; + for (unsigned i = 0; i < VT->getNumElements(); i++) + args.push_back({field(T, i), rep->type(VT->getElementType())}); - decls.push_back(Decl::typee(rep->type(T), "", {Attr::attr("datatype")})); - decls.push_back(Decl::function(constructor(T), args, rep->type(T), NULL, {Attr::attr("constructor")})); + decls.push_back(Decl::typee(rep->type(T), "", {Attr::attr("datatype")})); + decls.push_back(Decl::function(constructor(T), args, rep->type(T), NULL, + {Attr::attr("constructor")})); - for (auto D : decls) - rep->addAuxiliaryDeclaration(D); - return decls; - } + for (auto D : decls) + rep->addAuxiliaryDeclaration(D); + return decls; +} - const Expr *VectorOperations::constant(const ConstantDataVector *C) { - auto T = C->getType(); - std::list args; - for (unsigned i = 0; i < C->getNumElements(); i++) - args.push_back(rep->expr(C->getElementAsConstant(i))); - return Expr::fn(constructor(T), args); - } +const Expr *VectorOperations::constant(const ConstantDataVector *C) { + auto T = C->getType(); + std::list args; + for (unsigned i = 0; i < C->getNumElements(); i++) + args.push_back(rep->expr(C->getElementAsConstant(i))); + return Expr::fn(constructor(T), args); +} - const Expr *VectorOperations::constant(const ConstantAggregateZero *C) { - auto T = C->getType(); - std::list args; - for (unsigned i = 0; i < C->getNumElements(); i++) - args.push_back(rep->expr(C->getElementValue(i))); - return Expr::fn(constructor(T), args); - } +const Expr *VectorOperations::constant(const ConstantAggregateZero *C) { + auto T = C->getType(); + std::list args; + for (unsigned i = 0; i < C->getNumElements(); i++) + args.push_back(rep->expr(C->getElementValue(i))); + return Expr::fn(constructor(T), args); +} - FuncDecl *VectorOperations::cast(unsigned OpCode, Type *SrcTy, Type *DstTy) { - auto SrcVecTy = dyn_cast(SrcTy); - auto DstVecTy = dyn_cast(DstTy); - assert((SrcVecTy || DstVecTy) && "Expected a vector type"); +FuncDecl *VectorOperations::cast(unsigned OpCode, Type *SrcTy, Type *DstTy) { + auto SrcVecTy = dyn_cast(SrcTy); + auto DstVecTy = dyn_cast(DstTy); + assert((SrcVecTy || DstVecTy) && "Expected a vector type"); - auto FnName = rep->opName(Naming::INSTRUCTION_TABLE.at(OpCode), {SrcTy, DstTy}); - const Expr *Body; + auto FnName = + rep->opName(Naming::INSTRUCTION_TABLE.at(OpCode), {SrcTy, DstTy}); + const Expr *Body; - if (!SrcVecTy && DstVecTy && DstVecTy->getNumElements() == 1) - Body = Expr::fn(constructor(DstVecTy), Expr::id("v")); - else if (SrcVecTy && SrcVecTy->getNumElements() == 1 && !DstVecTy) - Body = Expr::fn(selector(SrcVecTy,0), Expr::id("v")); - else - Body = nullptr; + if (!SrcVecTy && DstVecTy && DstVecTy->getNumElements() == 1) + Body = Expr::fn(constructor(DstVecTy), Expr::id("v")); + else if (SrcVecTy && SrcVecTy->getNumElements() == 1 && !DstVecTy) + Body = Expr::fn(selector(SrcVecTy, 0), Expr::id("v")); + else + Body = nullptr; - return Decl::function(FnName, {{"v", rep->type(SrcTy)}}, rep->type(DstTy), Body); - } + return Decl::function(FnName, {{"v", rep->type(SrcTy)}}, rep->type(DstTy), + Body); +} - Decl *VectorOperations::inverseAxiom(unsigned OpCode, Type *SrcTy, Type *DstTy) { - auto Fn = rep->opName(Naming::INSTRUCTION_TABLE.at(OpCode), {SrcTy, DstTy}); - auto Inv = rep->opName(Naming::INSTRUCTION_TABLE.at(OpCode), {DstTy, SrcTy}); - return Decl::axiom(Expr::forall({{"v", rep->type(SrcTy)}}, Expr::eq( - Expr::fn(Inv, Expr::fn(Fn, Expr::id("v"))), - Expr::id("v")) - ), - Fn + "inverse" - ); - } +Decl *VectorOperations::inverseAxiom(unsigned OpCode, Type *SrcTy, + Type *DstTy) { + auto Fn = rep->opName(Naming::INSTRUCTION_TABLE.at(OpCode), {SrcTy, DstTy}); + auto Inv = rep->opName(Naming::INSTRUCTION_TABLE.at(OpCode), {DstTy, SrcTy}); + return Decl::axiom( + Expr::forall( + {{"v", rep->type(SrcTy)}}, + Expr::eq(Expr::fn(Inv, Expr::fn(Fn, Expr::id("v"))), Expr::id("v"))), + Fn + "inverse"); +} - FuncDecl *VectorOperations::binary(unsigned OpCode, VectorType *T) { - auto FnName = rep->opName(Naming::INSTRUCTION_TABLE.at(OpCode), {T}); - auto FnBase = rep->opName(Naming::INSTRUCTION_TABLE.at(OpCode), {T->getElementType()}); - std::list Args; - for (unsigned i = 0; i < T->getNumElements(); i++) { - Args.push_back(Expr::fn(FnBase, { - Expr::fn(selector(T, i), Expr::id("v1")), - Expr::fn(selector(T, i), Expr::id("v2")) - })); - } - return Decl::function(FnName, - {{"v1", rep->type(T)}, {"v2", rep->type(T)}}, - rep->type(T), - Expr::fn(constructor(T), Args)); +FuncDecl *VectorOperations::binary(unsigned OpCode, VectorType *T) { + auto FnName = rep->opName(Naming::INSTRUCTION_TABLE.at(OpCode), {T}); + auto FnBase = + rep->opName(Naming::INSTRUCTION_TABLE.at(OpCode), {T->getElementType()}); + std::list Args; + for (unsigned i = 0; i < T->getNumElements(); i++) { + Args.push_back(Expr::fn(FnBase, + {Expr::fn(selector(T, i), Expr::id("v1")), + Expr::fn(selector(T, i), Expr::id("v2"))})); } + return Decl::function(FnName, {{"v1", rep->type(T)}, {"v2", rep->type(T)}}, + rep->type(T), Expr::fn(constructor(T), Args)); +} - FuncDecl *VectorOperations::cmp(CmpInst::Predicate P, VectorType *T) { - auto FnName = rep->opName(Naming::CMPINST_TABLE.at(P), {T}); - auto FnBase = rep->opName(Naming::CMPINST_TABLE.at(P), {T->getElementType()}); - std::list Args; - for (unsigned i = 0; i < T->getNumElements(); i++) { - Args.push_back(Expr::fn(FnBase, { - Expr::fn(selector(T, i), Expr::id("v1")), - Expr::fn(selector(T, i), Expr::id("v2")) - })); - } - return Decl::function(FnName, - {{"v1", rep->type(T)}, {"v2", rep->type(T)}}, - rep->type(VectorType::get(IntegerType::get(T->getContext(), 1), T->getNumElements())), - Expr::fn(constructor(T), Args)); +FuncDecl *VectorOperations::cmp(CmpInst::Predicate P, VectorType *T) { + auto FnName = rep->opName(Naming::CMPINST_TABLE.at(P), {T}); + auto FnBase = rep->opName(Naming::CMPINST_TABLE.at(P), {T->getElementType()}); + std::list Args; + for (unsigned i = 0; i < T->getNumElements(); i++) { + Args.push_back(Expr::fn(FnBase, + {Expr::fn(selector(T, i), Expr::id("v1")), + Expr::fn(selector(T, i), Expr::id("v2"))})); } + return Decl::function( + FnName, {{"v1", rep->type(T)}, {"v2", rep->type(T)}}, + rep->type(VectorType::get(IntegerType::get(T->getContext(), 1), + T->getNumElements())), + Expr::fn(constructor(T), Args)); +} - FuncDecl *VectorOperations::cast(CastInst *I) { - DEBUG(errs() << "simd-cast: " << *I << "\n"); - auto F = cast(I->getOpcode(), I->getSrcTy(), I->getDestTy()); - auto G = cast(I->getOpcode(), I->getDestTy(), I->getSrcTy()); - auto A = inverseAxiom(I->getOpcode(), I->getSrcTy(), I->getDestTy()); - auto B = inverseAxiom(I->getOpcode(), I->getDestTy(), I->getSrcTy()); - if (isa(I->getSrcTy())) - type(I->getSrcTy()); - if (isa(I->getDestTy())) - type(I->getDestTy()); - rep->addAuxiliaryDeclaration(F); - rep->addAuxiliaryDeclaration(G); - rep->addAuxiliaryDeclaration(A); - rep->addAuxiliaryDeclaration(B); - return F; - } +FuncDecl *VectorOperations::cast(CastInst *I) { + SDEBUG(errs() << "simd-cast: " << *I << "\n"); + auto F = cast(I->getOpcode(), I->getSrcTy(), I->getDestTy()); + auto G = cast(I->getOpcode(), I->getDestTy(), I->getSrcTy()); + auto A = inverseAxiom(I->getOpcode(), I->getSrcTy(), I->getDestTy()); + auto B = inverseAxiom(I->getOpcode(), I->getDestTy(), I->getSrcTy()); + if (isa(I->getSrcTy())) + type(I->getSrcTy()); + if (isa(I->getDestTy())) + type(I->getDestTy()); + rep->addAuxiliaryDeclaration(F); + rep->addAuxiliaryDeclaration(G); + rep->addAuxiliaryDeclaration(A); + rep->addAuxiliaryDeclaration(B); + return F; +} - FuncDecl *VectorOperations::binary(BinaryOperator *I) { - DEBUG(errs() << "simd-binary: " << *I << "\n"); - auto T = dyn_cast(I->getType()); - assert(T && T == I->getOperand(0)->getType() && "expected equal vector types"); - auto F = binary(I->getOpcode(), T); - type(T); - rep->addAuxiliaryDeclaration(F); - return F; - } +FuncDecl *VectorOperations::binary(BinaryOperator *I) { + SDEBUG(errs() << "simd-binary: " << *I << "\n"); + auto T = dyn_cast(I->getType()); + assert(T && T == I->getOperand(0)->getType() && + "expected equal vector types"); + auto F = binary(I->getOpcode(), T); + type(T); + rep->addAuxiliaryDeclaration(F); + return F; +} + +FuncDecl *VectorOperations::cmp(CmpInst *I) { + SDEBUG(errs() << "simd-binary: " << *I << "\n"); + auto T = dyn_cast(I->getOperand(0)->getType()); + assert(T && "expected vector type"); + auto F = cmp(I->getPredicate(), T); + type(T); + type(VectorType::get(IntegerType::get(T->getContext(), 1), + T->getNumElements())); + rep->addAuxiliaryDeclaration(F); + return F; +} - FuncDecl *VectorOperations::cmp(CmpInst *I) { - DEBUG(errs() << "simd-binary: " << *I << "\n"); - auto T = dyn_cast(I->getOperand(0)->getType()); - assert(T && "expected vector type"); - auto F = cmp(I->getPredicate(), T); - type(T); - type(VectorType::get(IntegerType::get(T->getContext(), 1), T->getNumElements())); - rep->addAuxiliaryDeclaration(F); - return F; +FuncDecl *VectorOperations::shuffle(Type *T, Type *U, std::vector mask) { + auto VT = dyn_cast(T); + assert(VT && "expected vector type"); + assert(isa(U) && "expected vector type"); + type(T); + type(U); + + std::stringstream FN; + FN << rep->opName(Naming::INSTRUCTION_TABLE.at(Instruction::ShuffleVector), + {T}); + for (auto m : mask) + FN << "." << m; + + auto N = VT->getNumElements(); + std::list args; + for (int m : mask) { + if (m < 0) + llvm_unreachable("TODO: handle undefined mask values"); + + auto idx = (unsigned)m; + if (idx < N) + args.push_back(Expr::fn(selector(T, idx), Expr::id("v1"))); + else + args.push_back(Expr::fn(selector(T, idx - N), Expr::id("v2"))); } - FuncDecl *VectorOperations::shuffle(Type *T, Type *U, std::vector mask) { - auto VT = dyn_cast(T); - assert(VT && "expected vector type"); - assert(isa(U) && "expected vector type"); - type(T); - type(U); - - std::stringstream FN; - FN << rep->opName(Naming::INSTRUCTION_TABLE.at(Instruction::ShuffleVector), {T}); - for (auto m : mask) - FN << "." << m; - - auto N = VT->getNumElements(); - std::list args; - for (int m : mask) { - if (m < 0) - llvm_unreachable("TODO: handle undefined mask values"); - - auto idx = (unsigned) m; - if (idx < N) - args.push_back(Expr::fn(selector(T, idx), Expr::id("v1"))); - else - args.push_back(Expr::fn(selector(T, idx - N), Expr::id("v2"))); - } + auto V = rep->type(T); + auto F = Decl::function(FN.str(), {{"v1", V}, {"v2", V}}, rep->type(U), + Expr::fn(constructor(U), args)); + rep->addAuxiliaryDeclaration(F); + return F; +} - auto V = rep->type(T); - auto F = Decl::function(FN.str(), {{"v1", V}, {"v2", V}}, rep->type(U), - Expr::fn(constructor(U), args)); - rep->addAuxiliaryDeclaration(F); - return F; - } +FuncDecl *VectorOperations::insert(Type *T, Type *IT) { + auto VT = dyn_cast(T); + assert(VT && "expected vector type"); + type(T); - FuncDecl *VectorOperations::insert(Type *T, Type *IT) { - auto VT = dyn_cast(T); - assert(VT && "expected vector type"); - type(T); - - auto FN = rep->opName(Naming::INSTRUCTION_TABLE.at(Instruction::InsertElement), {T, IT}); - - auto V = rep->type(T); - auto E = rep->type(VT->getElementType()); - auto I = rep->type(IT); - auto F = Decl::function(FN, {{"v", V}, {"x", E}, {"i", I}}, V); - rep->addAuxiliaryDeclaration(F); - - // A per-index axiomatization - for (unsigned i=0; i < VT->getNumElements(); i++) { - std::stringstream ss; - ss << FN << "(" << i << ")"; - - std::list args; - for (unsigned j=0; j < VT->getNumElements(); j++) { - args.push_back(i == j ? Expr::id("x") : Expr::fn(selector(T,j), Expr::id("v"))); - } - - rep->addAuxiliaryDeclaration(Decl::axiom( - Expr::forall({{"v", V}, {"x", E}}, Expr::eq( - Expr::fn(FN, Expr::id("v"), Expr::id("x"), Expr::lit(i)), - Expr::fn(constructor(T), args) - )), - ss.str() - )); - } + auto FN = rep->opName( + Naming::INSTRUCTION_TABLE.at(Instruction::InsertElement), {T, IT}); - return F; + auto V = rep->type(T); + auto E = rep->type(VT->getElementType()); + auto I = rep->type(IT); + auto F = Decl::function(FN, {{"v", V}, {"x", E}, {"i", I}}, V); + rep->addAuxiliaryDeclaration(F); - std::stringstream procName; - procName << Naming::INSTRUCTION_TABLE.at(Instruction::InsertElement); - procName << "." << rep->type(T); - return nullptr; - } + // A per-index axiomatization + for (unsigned i = 0; i < VT->getNumElements(); i++) { + std::stringstream ss; + ss << FN << "(" << i << ")"; - FuncDecl *VectorOperations::extract(Type *T, Type *IT) { - auto VT = dyn_cast(T); - assert(VT && "expected vector type"); - type(T); - - auto FN = rep->opName(Naming::INSTRUCTION_TABLE.at(Instruction::ExtractElement), {T, IT}); - - auto V = rep->type(T); - auto I = rep->type(IT); - auto E = rep->type(VT->getElementType()); - auto F = Decl::function(FN, {{"v", V}, {"i", I}}, E); - rep->addAuxiliaryDeclaration(F); - - // A per-index axiomatization - for (unsigned i=0; i < VT->getNumElements(); i++) { - std::stringstream ss; - ss << FN << "(" << i << ")"; - rep->addAuxiliaryDeclaration(Decl::axiom( - Expr::forall({{"v", V}}, Expr::eq( - Expr::fn(FN, Expr::id("v"), Expr::lit(i)), - Expr::fn(selector(T, i), Expr::id("v")) - )), - ss.str() - )); + std::list args; + for (unsigned j = 0; j < VT->getNumElements(); j++) { + args.push_back(i == j ? Expr::id("x") + : Expr::fn(selector(T, j), Expr::id("v"))); } - return F; + rep->addAuxiliaryDeclaration(Decl::axiom( + Expr::forall( + {{"v", V}, {"x", E}}, + Expr::eq(Expr::fn(FN, Expr::id("v"), Expr::id("x"), Expr::lit(i)), + Expr::fn(constructor(T), args))), + ss.str())); } - FuncDecl *VectorOperations::load(const Value *V) { - auto PT = dyn_cast(V->getType()); - assert(PT && "expected pointer type"); - auto ET = PT->getElementType(); - type(ET); - - auto R = rep->regions->idx(V); - auto MT = rep->regions->get(R).getType(); - MT || (MT = IntegerType::get(V->getContext(), 8)); - auto FN = rep->opName(Naming::LOAD, {ET, MT}); - auto M = rep->memType(R); - auto P = rep->type(PT); - auto E = rep->type(ET); - auto F = (MT == ET) - ? Decl::function(FN, {{"M", M}, {"p", P}}, E, Expr::sel(Expr::id("M"), Expr::id("p"))) - : Decl::function(FN, {{"M", M}, {"p", P}}, E); - rep->addAuxiliaryDeclaration(F); - return F; - } + return F; + + std::stringstream procName; + procName << Naming::INSTRUCTION_TABLE.at(Instruction::InsertElement); + procName << "." << rep->type(T); + return nullptr; +} + +FuncDecl *VectorOperations::extract(Type *T, Type *IT) { + auto VT = dyn_cast(T); + assert(VT && "expected vector type"); + type(T); + + auto FN = rep->opName( + Naming::INSTRUCTION_TABLE.at(Instruction::ExtractElement), {T, IT}); + + auto V = rep->type(T); + auto I = rep->type(IT); + auto E = rep->type(VT->getElementType()); + auto F = Decl::function(FN, {{"v", V}, {"i", I}}, E); + rep->addAuxiliaryDeclaration(F); - FuncDecl *VectorOperations::store(const Value *V) { - auto PT = dyn_cast(V->getType()); - assert(PT && "expected pointer type"); - auto ET = PT->getElementType(); - type(ET); - - auto R = rep->regions->idx(V); - auto MT = rep->regions->get(R).getType(); - MT || (MT = IntegerType::get(V->getContext(), 8)); - auto FN = rep->opName(Naming::STORE, {ET, MT}); - auto M = rep->memType(R); - auto P = rep->type(PT); - auto E = rep->type(ET); - auto F = (MT == ET) - ? Decl::function(FN, {{"M", M}, {"p", P}, {"v", E}}, M, Expr::upd(Expr::id("M"), Expr::id("p"), Expr::id("v"))) - : Decl::function(FN, {{"M", M}, {"p", P}, {"v", E}}, M); - rep->addAuxiliaryDeclaration(F); - return F; + // A per-index axiomatization + for (unsigned i = 0; i < VT->getNumElements(); i++) { + std::stringstream ss; + ss << FN << "(" << i << ")"; + rep->addAuxiliaryDeclaration(Decl::axiom( + Expr::forall({{"v", V}}, + Expr::eq(Expr::fn(FN, Expr::id("v"), Expr::lit(i)), + Expr::fn(selector(T, i), Expr::id("v")))), + ss.str())); } + + return F; +} + +FuncDecl *VectorOperations::load(const Value *V) { + auto PT = dyn_cast(V->getType()); + assert(PT && "expected pointer type"); + auto ET = PT->getElementType(); + type(ET); + + auto R = rep->regions->idx(V); + auto MT = rep->regions->get(R).getType(); + MT || (MT = IntegerType::get(V->getContext(), 8)); + auto FN = rep->opName(Naming::LOAD, {ET, MT}); + auto M = rep->memType(R); + auto P = rep->type(PT); + auto E = rep->type(ET); + auto F = (MT == ET) ? Decl::function(FN, {{"M", M}, {"p", P}}, E, + Expr::sel(Expr::id("M"), Expr::id("p"))) + : Decl::function(FN, {{"M", M}, {"p", P}}, E); + rep->addAuxiliaryDeclaration(F); + return F; +} + +FuncDecl *VectorOperations::store(const Value *V) { + auto PT = dyn_cast(V->getType()); + assert(PT && "expected pointer type"); + auto ET = PT->getElementType(); + type(ET); + + auto R = rep->regions->idx(V); + auto MT = rep->regions->get(R).getType(); + MT || (MT = IntegerType::get(V->getContext(), 8)); + auto FN = rep->opName(Naming::STORE, {ET, MT}); + auto M = rep->memType(R); + auto P = rep->type(PT); + auto E = rep->type(ET); + auto F = (MT == ET) ? Decl::function(FN, {{"M", M}, {"p", P}, {"v", E}}, M, + Expr::upd(Expr::id("M"), Expr::id("p"), + Expr::id("v"))) + : Decl::function(FN, {{"M", M}, {"p", P}, {"v", E}}, M); + rep->addAuxiliaryDeclaration(F); + return F; +} } diff --git a/lib/smack/VerifierCodeMetadata.cpp b/lib/smack/VerifierCodeMetadata.cpp index 327952340..0b78761fe 100644 --- a/lib/smack/VerifierCodeMetadata.cpp +++ b/lib/smack/VerifierCodeMetadata.cpp @@ -4,10 +4,10 @@ #define DEBUG_TYPE "verifier-code-metadata" -#include "smack/SmackOptions.h" #include "smack/VerifierCodeMetadata.h" -#include "llvm/IR/DataLayout.h" #include "smack/Debug.h" +#include "smack/SmackOptions.h" +#include "llvm/IR/DataLayout.h" #include @@ -16,59 +16,59 @@ namespace smack { using namespace llvm; namespace { - void mark(Instruction &I, bool V = true) { - auto& C = I.getContext(); - I.setMetadata("verifier.code", - MDNode::get(C, ConstantAsMetadata::get( - V ? ConstantInt::getTrue(C) : ConstantInt::getFalse(C) - ))); - } +void mark(Instruction &I, bool V = true) { + auto &C = I.getContext(); + I.setMetadata( + "verifier.code", + MDNode::get(C, ConstantAsMetadata::get(V ? ConstantInt::getTrue(C) + : ConstantInt::getFalse(C)))); +} - bool isVerifierFunctionCall(CallInst &I) { - if (auto F = I.getCalledFunction()) { - auto N = F->getName(); +bool isVerifierFunctionCall(CallInst &I) { + if (auto F = I.getCalledFunction()) { + auto N = F->getName(); - if (N.find("__VERIFIER_") == 0) - return true; + if (N.find("__VERIFIER_") == 0) + return true; - if (N.find("__SMACK_") == 0) - return true; + if (N.find("__SMACK_") == 0) + return true; - if (N.find("__CONTRACT_") == 0) - return true; - } - return false; + if (N.find("__CONTRACT_") == 0) + return true; } + return false; +} - bool onlyVerifierUsers(Instruction &I) { - std::queue users; - std::set known; +bool onlyVerifierUsers(Instruction &I) { + std::queue users; + std::set known; - for (auto U : I.users()) { - users.push(U); - known.insert(U); - } + for (auto U : I.users()) { + users.push(U); + known.insert(U); + } - while (!users.empty()) { - if (auto K = dyn_cast(users.front())) { - if (!VerifierCodeMetadata::isMarked(*K)) - return false; + while (!users.empty()) { + if (auto K = dyn_cast(users.front())) { + if (!VerifierCodeMetadata::isMarked(*K)) + return false; - } else { - for (auto UU : users.front()->users()) { - if (known.count(UU) == 0) { - users.push(UU); - known.insert(UU); - } + } else { + for (auto UU : users.front()->users()) { + if (known.count(UU) == 0) { + users.push(UU); + known.insert(UU); } } - users.pop(); } - return true; + users.pop(); } + return true; +} } -bool VerifierCodeMetadata::isMarked(const Instruction& I) { +bool VerifierCodeMetadata::isMarked(const Instruction &I) { auto *N = I.getMetadata("verifier.code"); assert(N && "expected metadata"); assert(N->getNumOperands() == 1); @@ -79,8 +79,7 @@ bool VerifierCodeMetadata::isMarked(const Instruction& I) { return C->isOne(); } -void VerifierCodeMetadata::getAnalysisUsage(AnalysisUsage &AU) const { -} +void VerifierCodeMetadata::getAnalysisUsage(AnalysisUsage &AU) const {} bool VerifierCodeMetadata::runOnModule(Module &M) { @@ -117,15 +116,12 @@ void VerifierCodeMetadata::visitCallInst(CallInst &I) { mark(I, marked); } -void VerifierCodeMetadata::visitInstruction(Instruction &I) { - mark(I, false); -} +void VerifierCodeMetadata::visitInstruction(Instruction &I) { mark(I, false); } // Pass ID variable char VerifierCodeMetadata::ID = 0; // Register the pass -static RegisterPass -X("verifier-code-metadata", "Verifier Code Metadata"); - +static RegisterPass X("verifier-code-metadata", + "Verifier Code Metadata"); } diff --git a/share/smack/frontend.py b/share/smack/frontend.py index c959467d2..8be250ac1 100644 --- a/share/smack/frontend.py +++ b/share/smack/frontend.py @@ -72,7 +72,7 @@ def default_clang_compile_command(args, lib = False): cmd += args.clang_options.split() cmd += ['-DMEMORY_MODEL_' + args.mem_mod.upper().replace('-','_')] if args.memory_safety: cmd += ['-DMEMORY_SAFETY'] - if args.integer_overflow: cmd += (['-ftrapv', '-fsanitize=shift'] if not lib else ['-DSIGNED_INTEGER_OVERFLOW_CHECK']) + if args.integer_overflow: cmd += (['-fsanitize=signed-integer-overflow,shift'] if not lib else ['-DSIGNED_INTEGER_OVERFLOW_CHECK']) if args.float: cmd += ['-DFLOAT_ENABLED'] if sys.stdout.isatty(): cmd += ['-fcolor-diagnostics'] return cmd @@ -239,7 +239,7 @@ def rust_frontend(input_file, args): def default_build_libs(args): """Generate LLVM bitcodes for SMACK libraries.""" bitcodes = [] - libs = ['smack.c', 'stdlib.c'] + libs = ['smack.c', 'stdlib.c', 'errno.c'] if args.pthread: libs += ['pthread.c'] diff --git a/share/smack/include/bits/gthr-default.h b/share/smack/include/bits/gthr-default.h index efb6c3072..993a288bb 100644 --- a/share/smack/include/bits/gthr-default.h +++ b/share/smack/include/bits/gthr-default.h @@ -4,4 +4,3 @@ // Empty header file to prevent various pthread types from being redefined // when the standard header is included. - diff --git a/share/smack/include/fenv.h b/share/smack/include/fenv.h index bfff6644d..fe481790b 100644 --- a/share/smack/include/fenv.h +++ b/share/smack/include/fenv.h @@ -1,6 +1,6 @@ +// // This file is distributed under the MIT License. See LICENSE for details. // - #ifndef FENV_H #define FENV_H diff --git a/share/smack/include/math.h b/share/smack/include/math.h index 88d35e565..d49ee6d50 100644 --- a/share/smack/include/math.h +++ b/share/smack/include/math.h @@ -1,6 +1,6 @@ +// // This file is distributed under the MIT License. See LICENSE for details. // - #ifndef MATH_H #define MATH_H @@ -10,37 +10,55 @@ #define FP_SUBNORMAL 3 #define FP_NORMAL 4 -#define isnormal(x) (sizeof(x) == sizeof(long double) ? __isnormall(x) : sizeof(x) == sizeof(double) ? __isnormal(x) : __isnormalf(x)) -#define isinf(x) (sizeof(x) == sizeof(long double) ? __isinfl(x) : sizeof(x) == sizeof(double) ? __isinf(x) : __isinff(x)) -#define isnan(x) (sizeof(x) == sizeof(long double) ? __isnanl(x) : sizeof(x) == sizeof(double) ? __isnan(x) : __isnanf(x)) -#define signbit(x) (sizeof(x) == sizeof(long double) ? __signbitl(x) : sizeof(x) == sizeof(double) ? __signbit(x) : __signbitf(x)) -#define fpclassify(x) (sizeof(x) == sizeof(long double) ? __fpclassifyl(x) : sizeof(x) == sizeof(double) ? __fpclassify(x) : __fpclassifyf(x)) -#define isfinite(x) (sizeof(x) == sizeof(long double) ? __isfinitel(x) : sizeof(x) == sizeof(double) ? __finite(x) : __finitef(x)) +#define isnormal(x) \ + (sizeof(x) == sizeof(long double) \ + ? __isnormall(x) \ + : sizeof(x) == sizeof(double) ? __isnormal(x) : __isnormalf(x)) +#define isinf(x) \ + (sizeof(x) == sizeof(long double) \ + ? __isinfl(x) \ + : sizeof(x) == sizeof(double) ? __isinf(x) : __isinff(x)) +#define isnan(x) \ + (sizeof(x) == sizeof(long double) \ + ? __isnanl(x) \ + : sizeof(x) == sizeof(double) ? __isnan(x) : __isnanf(x)) +#define signbit(x) \ + (sizeof(x) == sizeof(long double) \ + ? __signbitl(x) \ + : sizeof(x) == sizeof(double) ? __signbit(x) : __signbitf(x)) +#define fpclassify(x) \ + (sizeof(x) == sizeof(long double) \ + ? __fpclassifyl(x) \ + : sizeof(x) == sizeof(double) ? __fpclassify(x) : __fpclassifyf(x)) +#define isfinite(x) \ + (sizeof(x) == sizeof(long double) \ + ? __finitel(x) \ + : sizeof(x) == sizeof(double) ? __finite(x) : __finitef(x)) typedef union { float f; struct { - unsigned sigAndExp: 31; - unsigned sign: 1; + unsigned sigAndExp : 31; + unsigned sign : 1; } i; } fi; typedef union { double d; struct { - unsigned sigAndExpLower: 32; - unsigned sigAndExpUpper: 31; - unsigned sign: 1; + unsigned sigAndExpLower : 32; + unsigned sigAndExpUpper : 31; + unsigned sign : 1; } i; } di; typedef union { long double l; struct { - unsigned sigAndExpLower: 32; - unsigned sigAndExpMiddle: 32; - unsigned sigAndExpUpper: 15; - unsigned sign: 1; + unsigned sigAndExpLower : 32; + unsigned sigAndExpMiddle : 32; + unsigned sigAndExpUpper : 15; + unsigned sign : 1; } i; } li; @@ -59,9 +77,9 @@ float remainderf(float x, float y); float fminf(float x, float y); float fmaxf(float x, float y); float fmodf(float x, float y); -float modff(float x, float* y); +float modff(float x, float *y); float copysignf(float x, float y); -float nanf(const char* x); +float nanf(const char *x); int __isnormalf(float x); int __issubnormalf(float x); int __iszerof(float x); @@ -87,9 +105,9 @@ double remainder(double x, double y); double fmin(double x, double y); double fmax(double x, double y); double fmod(double x, double y); -double modf(double x, double* y); +double modf(double x, double *y); double copysign(double x, double y); -double nan(const char* x); +double nan(const char *x); int __isnormal(double x); int __issubnormal(double x); int __iszero(double x); @@ -115,9 +133,9 @@ long double remainderl(long double x, long double y); long double fminl(long double x, long double y); long double fmaxl(long double x, long double y); long double fmodl(long double x, long double y); -long double modfl(long double x, long double* y); +long double modfl(long double x, long double *y); long double copysignl(long double x, long double y); -long double nanl(const char* x); +long double nanl(const char *x); int __isnormall(long double x); int __issubnormall(long double x); int __iszerol(long double x); diff --git a/share/smack/include/pthread.h b/share/smack/include/pthread.h index 7c057921e..d93e54ce4 100644 --- a/share/smack/include/pthread.h +++ b/share/smack/include/pthread.h @@ -6,7 +6,7 @@ #include "pthreadtypes.h" -//model mutex: +// model mutex: // 0 = unlocked, // else = locked by thread with matching id @@ -15,9 +15,10 @@ #define INITIALIZED 1 // !!!!! ERROR HERE? - if mutex already initialized, behavior // of initialization should be undefined -#define PTHREAD_MUTEX_INITIALIZER {UNLOCKED, INITIALIZED} +#define PTHREAD_MUTEX_INITIALIZER \ + { UNLOCKED, INITIALIZED } -//Declare corral primitive procedures +// Declare corral primitive procedures //__SMACK_INIT(corral_primitives); // Initialize thread status tracking variables (OS level behavior) @@ -66,8 +67,10 @@ int pthread_cond_broadcast(pthread_cond_t *__cond); int pthread_cond_destroy(pthread_cond_t *__cond); -void __call_wrapper(pthread_t *__restrict __newthread, void *(*__start_routine) (void *), void *__restrict __arg); +void __call_wrapper(pthread_t *__newthread, void *(*__start_routine)(void *), + void *__arg); -int pthread_create(pthread_t *__restrict __newthread, __const pthread_attr_t *__restrict __attr, void *(*__start_routine) (void *), void *__restrict __arg); +int pthread_create(pthread_t *__newthread, __const pthread_attr_t *__attr, + void *(*__start_routine)(void *), void *__arg); #endif // PTHREAD_H diff --git a/share/smack/include/pthreadtypes.h b/share/smack/include/pthreadtypes.h index 56b8e2683..f269bccab 100644 --- a/share/smack/include/pthreadtypes.h +++ b/share/smack/include/pthreadtypes.h @@ -1,10 +1,12 @@ +// +// This file is distributed under the MIT License. See LICENSE for details. +// #ifndef PTHREADTYPES_H #define PTHREADTYPES_H -#define _BITS_PTHREADTYPES_H 1 +#define _BITS_PTHREADTYPES_H 1 /* Mutex types. */ -enum -{ +enum { PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK_NP, @@ -23,18 +25,14 @@ typedef int pthread_t; typedef int pthread_attr_t; #endif -typedef struct{ - int prioceil, proto, pshared, type; -} pthread_mutexattr_t; +typedef struct { int prioceil, proto, pshared, type; } pthread_mutexattr_t; -typedef struct{ +typedef struct { int lock, init; pthread_mutexattr_t attr; } pthread_mutex_t; -typedef struct{ - int cond, init; -} pthread_cond_t; +typedef struct { int cond, init; } pthread_cond_t; typedef int pthread_condattr_t; diff --git a/share/smack/include/smack-macros.h b/share/smack/include/smack-macros.h deleted file mode 100644 index c830d223c..000000000 --- a/share/smack/include/smack-macros.h +++ /dev/null @@ -1,109 +0,0 @@ -// -// This file is distributed under the MIT License. See LICENSE for details. -// - -// shamelessly stole these macro definitions from -// https://github.com/pfultz2/Cloak/wiki/C-Preprocessor-tricks,-tips,-and-idioms -#define PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__ - -#define DEC_BYTE(x) PRIMITIVE_CAT(DEC_BYTE_, x) -#define DEC_BYTE_0 0 -#define DEC_BYTE_8 0 -#define DEC_BYTE_16 8 -#define DEC_BYTE_24 16 -#define DEC_BYTE_32 24 -#define DEC_BYTE_40 32 -#define DEC_BYTE_48 40 -#define DEC_BYTE_56 48 -#define DEC_BYTE_64 56 -#define DEC_BYTE_72 64 -#define DEC_BYTE_80 72 -#define DEC_BYTE_88 80 -#define DEC_BYTE_96 88 -#define DEC_BYTE_104 96 -#define DEC_BYTE_112 104 -#define DEC_BYTE_120 112 -#define DEC_BYTE_128 120 - -#define EVAL(...) EVAL1(EVAL1(EVAL1(__VA_ARGS__))) -#define EVAL1(...) EVAL2(EVAL2(EVAL2(__VA_ARGS__))) -#define EVAL2(...) EVAL3(EVAL3(EVAL3(__VA_ARGS__))) -#define EVAL3(...) EVAL4(EVAL4(EVAL4(__VA_ARGS__))) -#define EVAL4(...) __VA_ARGS__ - -#define IIF(c) PRIMITIVE_CAT(IIF_, c) -#define IIF_0(t, ...) __VA_ARGS__ -#define IIF_1(t, ...) t - -#define CHECK_N(x, n, ...) n -#define CHECK(...) CHECK_N(__VA_ARGS__, 0,) -#define PROBE(x) x, 1, - -#define NOT(x) CHECK(PRIMITIVE_CAT(NOT_, x)) -#define NOT_0 PROBE(~) - -#define COMPL(b) PRIMITIVE_CAT(COMPL_, b) -#define COMPL_0 1 -#define COMPL_1 0 - -#define BOOL(x) COMPL(NOT(x)) -#define IF(c) IIF(BOOL(c)) - -#define EAT(...) -#define EXPAND(...) __VA_ARGS__ -#define WHEN(c) IF(c)(EXPAND, EAT) - -#define EMPTY() -#define DEFER(id) id EMPTY() -#define OBSTRUCT(...) __VA_ARGS__ DEFER(EMPTY)() - -#define BITAND(x) PRIMITIVE_CAT(BITAND_, x) -#define BITAND_0(y) 0 -#define BITAND_1(y) y - -#define BV_TYPE(bw) PRIMITIVE_CAT(bv, bw) - -#define COMBINE(count1, count2, direction, macro) \ - WHEN(BITAND(BOOL(count1))(BOOL(count2))) \ - ( \ - OBSTRUCT(COMBINE_INDIRECT) () \ - ( \ - count1, direction(count2), direction, macro \ - ) \ - OBSTRUCT(macro) \ - ( \ - count1, count2 \ - ) \ - ) \ - WHEN(BITAND(NOT(BOOL(count2)))(BOOL(count1))) \ - ( \ - OBSTRUCT(COMBINE_INDIRECT) () \ - ( \ - direction(count1), direction(direction(count1)), direction, macro \ - ) \ - ) -#define COMBINE_INDIRECT() COMBINE - -#define UNSAFE_LOAD_OP(type,name,body) \ - function {:inline} name.type(M: [ref] bv8, p: ref) returns (type) body - -#define UNSAFE_STORE_OP(type,name,body) \ - function {:inline} name.type(M: [ref] bv8, p: ref, v: type) returns ([ref] bv8) body - -#define DECLARE_UNSAFE_LOAD(bw1,bw2) \ - WHEN(BOOL(DEC_BYTE(bw2))) \ - ( \ - DECLARE(UNSAFE_LOAD_OP, BV_TYPE(bw2), $load.bytes, {$load.bytes.BV_TYPE(DEC_BYTE(bw2))(M, $add.ref(p, $1.ref)) ++ $load.bytes.bv8(M,p)}); \ - ) - -#define DECLARE_UNSAFE_STORE(bw1,bw2) \ - WHEN(BOOL(DEC_BYTE(bw2))) \ - ( \ - DECLARE(UNSAFE_STORE_OP, BV_TYPE(bw2), $store.bytes, {$store.bytes.BV_TYPE(DEC_BYTE(bw2))(M, $add.ref(p, $1.ref), v[bw2:8])[p := v[8:0]]}); \ - ) - -#define DECLARE_UNSAFE_LOADS \ - EVAL(COMBINE(8,128,DEC_BYTE,DECLARE_UNSAFE_LOAD)) - -#define DECLARE_UNSAFE_STORES \ - EVAL(COMBINE(8,128,DEC_BYTE,DECLARE_UNSAFE_STORE)) diff --git a/share/smack/include/smack.h b/share/smack/include/smack.h index 60bf19eb4..71671b210 100644 --- a/share/smack/include/smack.h +++ b/share/smack/include/smack.h @@ -22,7 +22,7 @@ extern "C" { #define __builtin_object_size __builtinx_object_size // For handling of va_start macro -void __builtinx_va_start(char*,char*); +void __builtinx_va_start(char *, char *); #endif void __SMACK_code(const char *fmt, ...); @@ -30,9 +30,9 @@ void __SMACK_mod(const char *fmt, ...); void __SMACK_decl(const char *fmt, ...); void __SMACK_top_decl(const char *fmt, ...); -typedef struct smack_value { void* dummy; }* smack_value_t; +typedef struct smack_value { void *dummy; } * smack_value_t; smack_value_t __SMACK_value(); -smack_value_t __SMACK_values(void* ary, unsigned count); +smack_value_t __SMACK_values(void *ary, unsigned count); smack_value_t __SMACK_return_value(void); // Sugar for __SMACK_init_func_XXX() @@ -41,7 +41,7 @@ smack_value_t __SMACK_return_value(void); #if MEMORY_SAFETY // Inserts memory access checks in form of assert to check null pointer access // and buffer overflow errors -void __SMACK_check_memory_safety(void*, void*) __attribute__((const)); +void __SMACK_check_memory_safety(void *, void *) __attribute__((const)); void __SMACK_check_memory_leak(void); #endif @@ -60,13 +60,13 @@ void __VERIFIER_error(void); #define assume(EX) __VERIFIER_assume(EX) #endif -#define S4(a,b,c,d) a b c d -#define S3(a,b,c) a b c -#define S2(a,b) a b +#define S4(a, b, c, d) a b c d +#define S3(a, b, c) a b c +#define S2(a, b) a b #define S1(a) a -#define U4(a,b,c,d) a ## _ ## b ## _ ## c ## _ ## d -#define U3(a,b,c) a ## _ ## b ## _ ## c -#define U2(a,b) a ## _ ## b +#define U4(a, b, c, d) a##_##b##_##c##_##d +#define U3(a, b, c) a##_##b##_##c +#define U2(a, b) a##_##b #define U1(a) a #define TY(_1, _2, _3, _4, A, ...) A @@ -74,62 +74,62 @@ void __VERIFIER_error(void); #define S(...) TY(__VA_ARGS__, S4, S3, S2, S1)(__VA_ARGS__) #define U(...) TY(__VA_ARGS__, U4, U3, U2, U1)(__VA_ARGS__) -#define NONDET_DECL(P, ty...) S(ty) U(P,U(ty)) (void) - -void* __VERIFIER_nondet(void); -NONDET_DECL(__SMACK_nondet,char); -NONDET_DECL(__SMACK_nondet,signed,char); -NONDET_DECL(__SMACK_nondet,unsigned,char); -NONDET_DECL(__SMACK_nondet,short); -NONDET_DECL(__SMACK_nondet,short,int); -NONDET_DECL(__SMACK_nondet,signed,short); -NONDET_DECL(__SMACK_nondet,signed,short,int); -NONDET_DECL(__SMACK_nondet,unsigned,short); -NONDET_DECL(__SMACK_nondet,unsigned,short,int); -NONDET_DECL(__SMACK_nondet,int); -NONDET_DECL(__SMACK_nondet,signed,int); -NONDET_DECL(__SMACK_nondet,unsigned); -NONDET_DECL(__SMACK_nondet,unsigned,int); -NONDET_DECL(__SMACK_nondet,long); -NONDET_DECL(__SMACK_nondet,long,int); -NONDET_DECL(__SMACK_nondet,signed,long); -NONDET_DECL(__SMACK_nondet,signed,long,int); -NONDET_DECL(__SMACK_nondet,unsigned,long); -NONDET_DECL(__SMACK_nondet,unsigned,long,int); -NONDET_DECL(__SMACK_nondet,long,long); -NONDET_DECL(__SMACK_nondet,long,long,int); -NONDET_DECL(__SMACK_nondet,signed,long,long); -NONDET_DECL(__SMACK_nondet,signed,long,long,int); -NONDET_DECL(__SMACK_nondet,unsigned,long,long); -NONDET_DECL(__SMACK_nondet,unsigned,long,long,int); -NONDET_DECL(__VERIFIER_nondet,char); -NONDET_DECL(__VERIFIER_nondet,signed,char); -NONDET_DECL(__VERIFIER_nondet,unsigned,char); -NONDET_DECL(__VERIFIER_nondet,short); -NONDET_DECL(__VERIFIER_nondet,short,int); -NONDET_DECL(__VERIFIER_nondet,signed,short); -NONDET_DECL(__VERIFIER_nondet,signed,short,int); -NONDET_DECL(__VERIFIER_nondet,unsigned,short); -NONDET_DECL(__VERIFIER_nondet,unsigned,short,int); -NONDET_DECL(__VERIFIER_nondet,int); -NONDET_DECL(__VERIFIER_nondet,signed,int); -NONDET_DECL(__VERIFIER_nondet,unsigned); -NONDET_DECL(__VERIFIER_nondet,unsigned,int); -NONDET_DECL(__VERIFIER_nondet,long); -NONDET_DECL(__VERIFIER_nondet,long,int); -NONDET_DECL(__VERIFIER_nondet,signed,long); -NONDET_DECL(__VERIFIER_nondet,signed,long,int); -NONDET_DECL(__VERIFIER_nondet,unsigned,long); -NONDET_DECL(__VERIFIER_nondet,unsigned,long,int); -NONDET_DECL(__VERIFIER_nondet,long,long); -NONDET_DECL(__VERIFIER_nondet,long,long,int); -NONDET_DECL(__VERIFIER_nondet,signed,long,long); -NONDET_DECL(__VERIFIER_nondet,signed,long,long,int); -NONDET_DECL(__VERIFIER_nondet,unsigned,long,long); -NONDET_DECL(__VERIFIER_nondet,unsigned,long,long,int); -NONDET_DECL(__VERIFIER_nondet,float); -NONDET_DECL(__VERIFIER_nondet,double); -NONDET_DECL(__VERIFIER_nondet,long,double); +#define NONDET_DECL(P, ty...) S(ty) U(P, U(ty))(void) + +void *__VERIFIER_nondet(void); +NONDET_DECL(__SMACK_nondet, char); +NONDET_DECL(__SMACK_nondet, signed, char); +NONDET_DECL(__SMACK_nondet, unsigned, char); +NONDET_DECL(__SMACK_nondet, short); +NONDET_DECL(__SMACK_nondet, short, int); +NONDET_DECL(__SMACK_nondet, signed, short); +NONDET_DECL(__SMACK_nondet, signed, short, int); +NONDET_DECL(__SMACK_nondet, unsigned, short); +NONDET_DECL(__SMACK_nondet, unsigned, short, int); +NONDET_DECL(__SMACK_nondet, int); +NONDET_DECL(__SMACK_nondet, signed, int); +NONDET_DECL(__SMACK_nondet, unsigned); +NONDET_DECL(__SMACK_nondet, unsigned, int); +NONDET_DECL(__SMACK_nondet, long); +NONDET_DECL(__SMACK_nondet, long, int); +NONDET_DECL(__SMACK_nondet, signed, long); +NONDET_DECL(__SMACK_nondet, signed, long, int); +NONDET_DECL(__SMACK_nondet, unsigned, long); +NONDET_DECL(__SMACK_nondet, unsigned, long, int); +NONDET_DECL(__SMACK_nondet, long, long); +NONDET_DECL(__SMACK_nondet, long, long, int); +NONDET_DECL(__SMACK_nondet, signed, long, long); +NONDET_DECL(__SMACK_nondet, signed, long, long, int); +NONDET_DECL(__SMACK_nondet, unsigned, long, long); +NONDET_DECL(__SMACK_nondet, unsigned, long, long, int); +NONDET_DECL(__VERIFIER_nondet, char); +NONDET_DECL(__VERIFIER_nondet, signed, char); +NONDET_DECL(__VERIFIER_nondet, unsigned, char); +NONDET_DECL(__VERIFIER_nondet, short); +NONDET_DECL(__VERIFIER_nondet, short, int); +NONDET_DECL(__VERIFIER_nondet, signed, short); +NONDET_DECL(__VERIFIER_nondet, signed, short, int); +NONDET_DECL(__VERIFIER_nondet, unsigned, short); +NONDET_DECL(__VERIFIER_nondet, unsigned, short, int); +NONDET_DECL(__VERIFIER_nondet, int); +NONDET_DECL(__VERIFIER_nondet, signed, int); +NONDET_DECL(__VERIFIER_nondet, unsigned); +NONDET_DECL(__VERIFIER_nondet, unsigned, int); +NONDET_DECL(__VERIFIER_nondet, long); +NONDET_DECL(__VERIFIER_nondet, long, int); +NONDET_DECL(__VERIFIER_nondet, signed, long); +NONDET_DECL(__VERIFIER_nondet, signed, long, int); +NONDET_DECL(__VERIFIER_nondet, unsigned, long); +NONDET_DECL(__VERIFIER_nondet, unsigned, long, int); +NONDET_DECL(__VERIFIER_nondet, long, long); +NONDET_DECL(__VERIFIER_nondet, long, long, int); +NONDET_DECL(__VERIFIER_nondet, signed, long, long); +NONDET_DECL(__VERIFIER_nondet, signed, long, long, int); +NONDET_DECL(__VERIFIER_nondet, unsigned, long, long); +NONDET_DECL(__VERIFIER_nondet, unsigned, long, long, int); +NONDET_DECL(__VERIFIER_nondet, float); +NONDET_DECL(__VERIFIER_nondet, double); +NONDET_DECL(__VERIFIER_nondet, long, double); #undef S1 #undef S2 @@ -154,8 +154,7 @@ unsigned char __VERIFIER_nondet_uchar(void); unsigned short __VERIFIER_nondet_ushort(void); unsigned __VERIFIER_nondet_uint(void); unsigned long __VERIFIER_nondet_ulong(void); -void* __VERIFIER_nondet_pointer(void); - +void *__VERIFIER_nondet_pointer(void); void __SMACK_decls(void); diff --git a/share/smack/include/string.h b/share/smack/include/string.h new file mode 100644 index 000000000..8c7c6c7c3 --- /dev/null +++ b/share/smack/include/string.h @@ -0,0 +1,28 @@ +// +// This file is distributed under the MIT License. See LICENSE for details. +// +#ifndef STRING_H +#define STRING_H + +#include + +void *memcpy(void *str1, const void *str2, size_t n); +void *memset(void *str, int c, size_t n); + +char *strcpy(char *dest, const char *src); +char *strncpy(char *dest, const char *src, size_t n); +size_t strlen(const char *str); +int strcmp(const char *s1, const char *s2); +int strncmp(const char *s1, const char *s2, size_t n); +char *strcat(char *dest, const char *src); +char *strncat(char *dest, const char *src, size_t n); +char *strchr(const char *src, int c); +char *strrchr(const char *src, int c); +size_t strspn(const char *s1, const char *s2); +size_t strcspn(const char *s1, const char *s2); +char *strpbrk(const char *s1, const char *s2); +char *strstr(const char *haystack, const char *needle); +char *strtok(char *str, const char *delim); +char *strerror(int errnum); + +#endif diff --git a/share/smack/lib/errno.c b/share/smack/lib/errno.c new file mode 100644 index 000000000..eae138a2f --- /dev/null +++ b/share/smack/lib/errno.c @@ -0,0 +1,7 @@ +// +// This file is distributed under the MIT License. See LICENSE for details. +// +#include + +static int errno_global; +int *__errno_location(void) { return &errno_global; } diff --git a/share/smack/lib/fenv.c b/share/smack/lib/fenv.c index 859f4dd00..9af47006b 100644 --- a/share/smack/lib/fenv.c +++ b/share/smack/lib/fenv.c @@ -20,12 +20,20 @@ int fegetround(void) { int fesetround(int rm) { switch (rm) { - case FE_TONEAREST: __SMACK_code("$rmode := RNE;"); break; - case FE_DOWNWARD: __SMACK_code("$rmode := RTN;"); break; - case FE_UPWARD: __SMACK_code("$rmode := RTP;"); break; - case FE_TOWARDZERO: __SMACK_code("$rmode := RTZ;"); break; - default: return 1; + case FE_TONEAREST: + __SMACK_code("$rmode := RNE;"); + break; + case FE_DOWNWARD: + __SMACK_code("$rmode := RTN;"); + break; + case FE_UPWARD: + __SMACK_code("$rmode := RTP;"); + break; + case FE_TOWARDZERO: + __SMACK_code("$rmode := RTZ;"); + break; + default: + return 1; } return 0; } - diff --git a/share/smack/lib/math.c b/share/smack/lib/math.c index 4c3f80216..248cf3da7 100644 --- a/share/smack/lib/math.c +++ b/share/smack/lib/math.c @@ -5,8 +5,8 @@ #include float fabsf(float x) { - double ret = __VERIFIER_nondet_double(); - __SMACK_code("@ := ftd($rmode, $abs.bvfloat(dtf($rmode, @)));", ret, x); + float ret = __VERIFIER_nondet_float(); + __SMACK_code("@f := $abs.bvfloat(@f);", ret, x); return ret; } @@ -14,100 +14,96 @@ float fdimf(float x, float y) { if (__isnanf(x) || __isnanf(y)) { return nanf(0); } - double val = __VERIFIER_nondet_double(); - __SMACK_code("@ := ftd($rmode, $fsub.bvfloat($rmode, dtf($rmode, @), dtf($rmode, @)));", val, x, y); + float val = __VERIFIER_nondet_float(); + __SMACK_code("@f := $fsub.bvfloat($rmode, @f, @f);", val, x, y); return fmaxf(0.0f, val); } float roundf(float x) { - double ret = __VERIFIER_nondet_double(); - __SMACK_code("@ := ftd($rmode, $round.bvfloat(RNA, dtf($rmode, @)));", ret, x); + float ret = __VERIFIER_nondet_float(); + __SMACK_code("@f := $round.bvfloat(RNA, @f);", ret, x); return ret; } -long lroundf(float x) { - return roundf(x); -} +long lroundf(float x) { return roundf(x); } float rintf(float x) { - double ret = __VERIFIER_nondet_double(); - __SMACK_code("@ := ftd($rmode, $round.bvfloat($rmode, dtf($rmode, @)));", ret, x); + float ret = __VERIFIER_nondet_float(); + __SMACK_code("@f := $round.bvfloat($rmode, @f);", ret, x); return ret; } float nearbyintf(float x) { - double ret = __VERIFIER_nondet_double(); - __SMACK_code("@ := ftd($rmode, $round.bvfloat($rmode, dtf($rmode, @)));", ret, x); + float ret = __VERIFIER_nondet_float(); + __SMACK_code("@f := $round.bvfloat($rmode, @f);", ret, x); return ret; } -long lrintf(float x) { - return rintf(x); -} +long lrintf(float x) { return rintf(x); } float floorf(float x) { - double ret = __VERIFIER_nondet_double(); - __SMACK_code("@ := ftd($rmode, $round.bvfloat(RTN, dtf($rmode, @)));", ret, x); + float ret = __VERIFIER_nondet_float(); + __SMACK_code("@f := $round.bvfloat(RTN, @f);", ret, x); return ret; } float ceilf(float x) { - double ret = __VERIFIER_nondet_double(); - __SMACK_code("@ := ftd($rmode, $round.bvfloat(RTP, dtf($rmode, @)));", ret, x); + float ret = __VERIFIER_nondet_float(); + __SMACK_code("@f := $round.bvfloat(RTP, @f);", ret, x); return ret; } float truncf(float x) { - double ret = __VERIFIER_nondet_double(); - __SMACK_code("@ := ftd($rmode, $round.bvfloat(RTZ, dtf($rmode, @)));", ret, x); + float ret = __VERIFIER_nondet_float(); + __SMACK_code("@f := $round.bvfloat(RTZ, @f);", ret, x); return ret; } float sqrtf(float x) { - double ret = __VERIFIER_nondet_double(); - __SMACK_code("@ := ftd($rmode, $sqrt.bvfloat($rmode, dtf($rmode, @)));", ret, x); + float ret = __VERIFIER_nondet_float(); + __SMACK_code("@f := $sqrt.bvfloat($rmode, @f);", ret, x); return ret; } float remainderf(float x, float y) { - double ret = __VERIFIER_nondet_double(); - __SMACK_code("@ := ftd($rmode, $frem.bvfloat(dtf($rmode, @), dtf($rmode, @)));", ret, x, y); + float ret = __VERIFIER_nondet_float(); + __SMACK_code("@f := $frem.bvfloat(@f, @f);", ret, x, y); return ret; } float fminf(float x, float y) { - double ret = __VERIFIER_nondet_double(); - __SMACK_code("@ := ftd($rmode, $min.bvfloat(dtf($rmode, @), dtf($rmode, @)));", ret, x, y); + float ret = __VERIFIER_nondet_float(); + __SMACK_code("@f := $min.bvfloat(@f, @f);", ret, x, y); return ret; } float fmaxf(float x, float y) { - double ret = __VERIFIER_nondet_double(); - __SMACK_code("@ := ftd($rmode, $max.bvfloat(dtf($rmode, @), dtf($rmode, @)));", ret, x, y); + float ret = __VERIFIER_nondet_float(); + __SMACK_code("@f := $max.bvfloat(@f, @f);", ret, x, y); return ret; } float fmodf(float x, float y) { - if (__isnanf(x) || __isnanf(y) || __isinff(x) || __iszerof(y)) { + if (__isnanf(x) || __isnanf(y) || __isinff(x) || __iszerof(y)) { return nanf(0); } - double ret = __VERIFIER_nondet_double(); + float ret = __VERIFIER_nondet_float(); y = fabsf(y); ret = remainderf(fabsf(x), y); if (__signbitf(ret)) { - __SMACK_code("@ := ftd($rmode, $fadd.bvfloat($rmode, dtf($rmode, @), dtf($rmode, @)));", ret, ret, y); + __SMACK_code("@f := $fadd.bvfloat($rmode, @f, @f);", ret, ret, y); } return copysignf(ret, x); } float modff(float x, float *iPart) { - double fPart = __VERIFIER_nondet_double(); + float fPart = __VERIFIER_nondet_float(); if (__isinff(x)) { *iPart = x; fPart = 0.0f; } else { *iPart = truncf(x); - __SMACK_code("@ := ftd($rmode, $fsub.bvfloat($rmode, dtf($rmode, @), dtf($rmode, @)));", fPart, x, *iPart); + __SMACK_code("@f := $fsub.bvfloat($rmode, @f, @f);", fPart, x, *iPart); } if (__iszerof(fPart)) { fPart = __signbitf(x) ? -0.0f : 0.0f; @@ -125,37 +121,36 @@ float copysignf(float x, float y) { return x; } -float nanf(const char *c) { - return 0.0f / 0.0f; -} +float nanf(const char *c) { return 0.0f / 0.0f; } int __isnormalf(float x) { int ret = __VERIFIER_nondet_int(); - __SMACK_code("@ := if $isnormal.bvfloat.bool(dtf($rmode, @)) then $1 else $0;", ret, x); + __SMACK_code("@ := if $isnormal.bvfloat.bool(@f) then $1 else $0;", ret, x); return ret; } int __issubnormalf(float x) { int ret = __VERIFIER_nondet_int(); - __SMACK_code("@ := if $issubnormal.bvfloat.bool(dtf($rmode, @)) then $1 else $0;", ret, x); + __SMACK_code("@ := if $issubnormal.bvfloat.bool(@f) then $1 else $0;", ret, + x); return ret; } int __iszerof(float x) { int ret = __VERIFIER_nondet_int(); - __SMACK_code("@ := if $iszero.bvfloat.bool(dtf($rmode, @)) then $1 else $0;", ret, x); + __SMACK_code("@ := if $iszero.bvfloat.bool(@f) then $1 else $0;", ret, x); return ret; } int __isinff(float x) { int ret = __VERIFIER_nondet_int(); - __SMACK_code("@ := if $isinfinite.bvfloat.bool(dtf($rmode, @)) then $1 else $0;", ret, x); + __SMACK_code("@ := if $isinfinite.bvfloat.bool(@f) then $1 else $0;", ret, x); return ret; } int __isnanf(float x) { int ret = __VERIFIER_nondet_int(); - __SMACK_code("@ := if $isnan.bvfloat.bool(dtf($rmode, @)) then $1 else $0;", ret, x); + __SMACK_code("@ := if $isnan.bvfloat.bool(@f) then $1 else $0;", ret, x); return ret; } @@ -177,9 +172,7 @@ int __fpclassifyf(float x) { return FP_NORMAL; } -int __finitef(float x) { - return !__isinff(x) && !__isnanf(x); -} +int __finitef(float x) { return !__isinff(x) && !__isnanf(x); } double fabs(double x) { double ret = __VERIFIER_nondet_double(); @@ -202,9 +195,7 @@ double round(double x) { return ret; } -long lround(double x) { - return round(x); -} +long lround(double x) { return round(x); } double rint(double x) { double ret = __VERIFIER_nondet_double(); @@ -218,9 +209,7 @@ double nearbyint(double x) { return ret; } -long lrint(double x) { - return rint(x); -} +long lrint(double x) { return rint(x); } double floor(double x) { double ret = __VERIFIER_nondet_double(); @@ -302,9 +291,7 @@ double copysign(double x, double y) { return x; } -double nan(const char *x) { - return 0.0 / 0.0; -} +double nan(const char *x) { return 0.0 / 0.0; } int __isnormal(double x) { int ret = __VERIFIER_nondet_int(); @@ -314,7 +301,8 @@ int __isnormal(double x) { int __issubnormal(double x) { int ret = __VERIFIER_nondet_int(); - __SMACK_code("@ := if $issubnormal.bvdouble.bool(@) then $1 else $0;", ret, x); + __SMACK_code("@ := if $issubnormal.bvdouble.bool(@) then $1 else $0;", ret, + x); return ret; } @@ -354,9 +342,7 @@ int __fpclassify(double x) { return FP_NORMAL; } -int __finite(double x) { - return !__isinf(x) && !__isnan(x); -} +int __finite(double x) { return !__isinf(x) && !__isnan(x); } long double fabsl(long double x) { long double ret = __VERIFIER_nondet_long_double(); @@ -379,9 +365,7 @@ long double roundl(long double x) { return ret; } -long lroundl(long double x) { - return roundl(x); -} +long lroundl(long double x) { return roundl(x); } long double rintl(long double x) { long double ret = __VERIFIER_nondet_long_double(); @@ -395,9 +379,7 @@ long double nearbyintl(long double x) { return ret; } -long lrintl(long double x) { - return rintl(x); -} +long lrintl(long double x) { return rintl(x); } long double floorl(long double x) { long double ret = __VERIFIER_nondet_long_double(); @@ -442,7 +424,7 @@ long double fmaxl(long double x, long double y) { } long double fmodl(long double x, long double y) { - if (__isnanl(x) || __isnanl(y) || __isinfl(x) || __iszerol(y)) { + if (__isnanl(x) || __isnanl(y) || __isinfl(x) || __iszerol(y)) { return nanl(0); } long double ret = __VERIFIER_nondet_long_double(); @@ -479,19 +461,19 @@ long double copysignl(long double x, long double y) { return x; } -long double nanl(const char *c) { - return 0.0l / 0.0l; -} +long double nanl(const char *c) { return 0.0l / 0.0l; } int __isnormall(long double x) { int ret = __VERIFIER_nondet_int(); - __SMACK_code("@ := if $isnormal.bvlongdouble.bool(@) then $1 else $0;", ret, x); + __SMACK_code("@ := if $isnormal.bvlongdouble.bool(@) then $1 else $0;", ret, + x); return ret; } int __issubnormall(long double x) { int ret = __VERIFIER_nondet_int(); - __SMACK_code("@ := if $issubnormal.bvlongdouble.bool(@) then $1 else $0;", ret, x); + __SMACK_code("@ := if $issubnormal.bvlongdouble.bool(@) then $1 else $0;", + ret, x); return ret; } @@ -503,7 +485,8 @@ int __iszerol(long double x) { int __isinfl(long double x) { int ret = __VERIFIER_nondet_int(); - __SMACK_code("@ := if $isinfinite.bvlongdouble.bool(@) then $1 else $0;", ret, x); + __SMACK_code("@ := if $isinfinite.bvlongdouble.bool(@) then $1 else $0;", ret, + x); return ret; } @@ -531,7 +514,4 @@ int __fpclassifyl(long double x) { return FP_NORMAL; } -int __finitel(long double x) { - return !__isinfl(x) && !__isnanl(x); -} - +int __finitel(long double x) { return !__isinfl(x) && !__isnanl(x); } diff --git a/share/smack/lib/pthread.c b/share/smack/lib/pthread.c index beaffaef4..3f87e68a2 100644 --- a/share/smack/lib/pthread.c +++ b/share/smack/lib/pthread.c @@ -5,7 +5,7 @@ #include "smack.h" void __SMACK_init_func_corral_primitives() { - //Declare these, so bpl parsing doesn't complain + // Declare these, so bpl parsing doesn't complain __SMACK_top_decl("procedure corral_getThreadID() returns (x:int);"); __SMACK_top_decl("procedure corral_getChildThreadID() returns (x:int);"); __SMACK_top_decl("procedure corral_atomic_begin();"); @@ -13,7 +13,7 @@ void __SMACK_init_func_corral_primitives() { } void __SMACK_init_func_thread() { - //Array and possible statuses for tracking pthreads + // Array and possible statuses for tracking pthreads __SMACK_top_decl("//dim0=tid, dim1= idx 0 gets status, 1 gets return value"); __SMACK_top_decl("var $pthreadStatus: [int][int]int;"); __SMACK_top_decl("const unique $pthread_uninitialized: int;"); @@ -22,16 +22,13 @@ void __SMACK_init_func_thread() { __SMACK_top_decl("const unique $pthread_running: int;"); __SMACK_top_decl("const unique $pthread_stopped: int;"); // Initialize this array so all threads begin as uninitialized - __SMACK_code("assume (forall i:int :: $pthreadStatus[i][0] == $pthread_uninitialized);"); + __SMACK_code("assume (forall i:int :: $pthreadStatus[i][0] == " + "$pthread_uninitialized);"); } -void __VERIFIER_atomic_begin() { - __SMACK_code("call corral_atomic_begin();"); -} +void __VERIFIER_atomic_begin() { __SMACK_code("call corral_atomic_begin();"); } -void __VERIFIER_atomic_end() { - __SMACK_code("call corral_atomic_end();"); -} +void __VERIFIER_atomic_end() { __SMACK_code("call corral_atomic_end();"); } pthread_t pthread_self(void) { int tmp_tid = __VERIFIER_nondet_int(); @@ -55,19 +52,19 @@ int pthread_join(pthread_t __th, void **__thread_return) { int joining_tid = __th; // Check for self-joining deadlock - if(calling_tid == __th) - return 35; // This is EDEADLK + if (calling_tid == __th) + return 35; // This is EDEADLK // Wait for the thread to terminate __SMACK_code("assume $pthreadStatus[@][0] == $pthread_stopped;", __th); // Get the thread's return value - void* tmp_thread_return_pointer = (void*)__VERIFIER_nondet_long(); + void *tmp_thread_return_pointer = (void *)__VERIFIER_nondet_long(); __SMACK_code("@ := $pthreadStatus[@][1];", tmp_thread_return_pointer, __th); *__thread_return = tmp_thread_return_pointer; // Print return pointer value to SMACK traces - void* actual_thread_return_pointer = *__thread_return; + void *actual_thread_return_pointer = *__thread_return; return 0; } @@ -81,14 +78,14 @@ int pthread_join(pthread_t __th, void **__thread_return) { void pthread_exit(void *retval) { pthread_t tid = pthread_self(); - // Ensure exit hasn't already been called +// Ensure exit hasn't already been called #ifndef DISABLE_PTHREAD_ASSERTS __SMACK_code("assert $pthreadStatus[@][0] == $pthread_running;", tid); #endif __SMACK_code("$pthreadStatus[@][1] := @;", tid, retval); // Set return pointer value for display in SMACK traces - void* pthread_return_pointer = retval; + void *pthread_return_pointer = retval; } int pthread_mutexattr_init(pthread_mutexattr_t *attr) { @@ -101,12 +98,13 @@ int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) { return 0; } -int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) { - // Can't check for already initialized error, +int pthread_mutex_init(pthread_mutex_t *mutex, + const pthread_mutexattr_t *attr) { + // Can't check for already initialized error, // since uninitialized values are nondet and could be INITIALIZED mutex->lock = UNLOCKED; mutex->init = INITIALIZED; - if(attr == 0) { + if (attr == 0) { pthread_mutexattr_init(&mutex->attr); } else { mutex->attr.type = attr->type; @@ -120,18 +118,18 @@ int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) int pthread_mutex_lock(pthread_mutex_t *__mutex) { int tid = (int)pthread_self(); // Ensure mutex is initialized & hasn't already been locked by caller - if(__mutex->attr.type==PTHREAD_MUTEX_NORMAL) { + if (__mutex->attr.type == PTHREAD_MUTEX_NORMAL) { #ifndef DISABLE_PTHREAD_ASSERTS assert(__mutex->init == INITIALIZED); assert(__mutex->lock != tid); #endif - } else if(__mutex->attr.type==PTHREAD_MUTEX_ERRORCHECK) { - if(__mutex->init != INITIALIZED) - return 22; // This is EINVAL - if(__mutex->lock == tid) - return 35; // This is EDEADLK + } else if (__mutex->attr.type == PTHREAD_MUTEX_ERRORCHECK) { + if (__mutex->init != INITIALIZED) + return 22; // This is EINVAL + if (__mutex->lock == tid) + return 35; // This is EDEADLK } else { - // Other types not currently implemented +// Other types not currently implemented #ifndef DISABLE_PTHREAD_ASSERTS assert(0); #endif @@ -147,18 +145,18 @@ int pthread_mutex_lock(pthread_mutex_t *__mutex) { int pthread_mutex_unlock(pthread_mutex_t *__mutex) { int tid = (int)pthread_self(); // Ensure mutex is initialized & caller is current owner - if(__mutex->attr.type==PTHREAD_MUTEX_NORMAL) { + if (__mutex->attr.type == PTHREAD_MUTEX_NORMAL) { #ifndef DISABLE_PTHREAD_ASSERTS assert(__mutex->init == INITIALIZED); assert(__mutex->lock == tid); #endif - } else if(__mutex->attr.type==PTHREAD_MUTEX_ERRORCHECK) { - if(__mutex->init != INITIALIZED) - return 22; // This is EINVAL - if(__mutex->lock != tid) - return 1; // This is EPERM + } else if (__mutex->attr.type == PTHREAD_MUTEX_ERRORCHECK) { + if (__mutex->init != INITIALIZED) + return 22; // This is EINVAL + if (__mutex->lock != tid) + return 1; // This is EPERM } else { - // Other types not currently implemented +// Other types not currently implemented #ifndef DISABLE_PTHREAD_ASSERTS assert(0); #endif @@ -170,7 +168,7 @@ int pthread_mutex_unlock(pthread_mutex_t *__mutex) { } int pthread_mutex_destroy(pthread_mutex_t *__mutex) { - // Make sure the lock is initialized, and unlocked +// Make sure the lock is initialized, and unlocked #ifndef DISABLE_PTHREAD_ASSERTS assert(__mutex->init == INITIALIZED); assert(__mutex->lock == UNLOCKED); @@ -182,22 +180,22 @@ int pthread_mutex_destroy(pthread_mutex_t *__mutex) { } int pthread_cond_init(pthread_cond_t *__cond, pthread_condattr_t *__condattr) { - if(__condattr == 0) { + if (__condattr == 0) { __cond->cond = 0; __cond->init = INITIALIZED; } else { - // Unimplemented - // NOTE: if implemented, attr should be a copy of __condattr passed in - // (spec says changes to condattr doesn't affect initialized conds +// Unimplemented +// NOTE: if implemented, attr should be a copy of __condattr passed in +// (spec says changes to condattr doesn't affect initialized conds #ifndef DISABLE_PTHREAD_ASSERTS assert(0); #endif } - return 0; + return 0; } int pthread_cond_wait(pthread_cond_t *__cond, pthread_mutex_t *__mutex) { - // Ensure conditional var is initialized, and mutex is locked properly +// Ensure conditional var is initialized, and mutex is locked properly #ifndef DISABLE_PTHREAD_ASSERTS assert(__cond->init == INITIALIZED); assert((int)pthread_self() == __mutex->lock); @@ -209,7 +207,7 @@ int pthread_cond_wait(pthread_cond_t *__cond, pthread_mutex_t *__mutex) { // Adding var checks in improves performance - //assume(__cond->cond == 1); + // assume(__cond->cond == 1); //__cond->cond = 0; pthread_mutex_lock(__mutex); return 0; @@ -241,7 +239,7 @@ int pthread_cond_broadcast(pthread_cond_t *__cond) { } int pthread_cond_destroy(pthread_cond_t *__cond) { - // Make sure the cond is initialized +// Make sure the cond is initialized #ifndef DISABLE_PTHREAD_ASSERTS assert(__cond->init == INITIALIZED); #endif @@ -249,9 +247,8 @@ int pthread_cond_destroy(pthread_cond_t *__cond) { return 0; } -void __call_wrapper(pthread_t *__restrict __newthread, - void *(*__start_routine) (void *), - void *__restrict __arg) { +void __call_wrapper(pthread_t *__newthread, void *(*__start_routine)(void *), + void *__arg) { pthread_t ctid = pthread_self(); // Wait for parent to set child's thread ID in original pthread_t struct @@ -265,10 +262,8 @@ void __call_wrapper(pthread_t *__restrict __newthread, __SMACK_code("$pthreadStatus[@][0] := $pthread_stopped;", ctid); } -int pthread_create(pthread_t *__restrict __newthread, - __const pthread_attr_t *__restrict __attr, - void *(*__start_routine) (void *), - void *__restrict __arg) { +int pthread_create(pthread_t *__newthread, __const pthread_attr_t *__attr, + void *(*__start_routine)(void *), void *__arg) { pthread_t tmp = __VERIFIER_nondet_int(); @@ -276,10 +271,10 @@ int pthread_create(pthread_t *__restrict __newthread, // the call to __call_wrapper and performs DSA on it. int x = __VERIFIER_nondet_int(); __VERIFIER_assume(x == 0); - if(x) __call_wrapper(__newthread, __start_routine, __arg); + if (x) + __call_wrapper(__newthread, __start_routine, __arg); - __SMACK_code("async call @(@, @, @);", - __call_wrapper, __newthread, + __SMACK_code("async call @(@, @, @);", __call_wrapper, __newthread, __start_routine, __arg); __SMACK_code("call @ := corral_getChildThreadID();", tmp); *__newthread = tmp; diff --git a/share/smack/lib/smack.c b/share/smack/lib/smack.c index 9df069a5d..23692291a 100644 --- a/share/smack/lib/smack.c +++ b/share/smack/lib/smack.c @@ -1,8 +1,8 @@ // // This file is distributed under the MIT License. See LICENSE for details. // -#include #include +#include #include #include #include @@ -26,19 +26,23 @@ * A > 0 Heap * A = 0 Not allocated (null) * $GLOBALS_BOTTOM <= A < 0 Static (global storage) - * $GLOBALS_BOTTOM - 32768 < A < $GLOBALS_BOTTOM Not allocated (padding) - * A < $GLOBALS_BOTTOM - 32768 External + * $GLOBALS_BOTTOM - 32768 <= A < $GLOBALS_BOTTOM Not allocated (padding) + * $EXTERNS_BOTTOM <= A < $GLOBALS_BOTTOM - 32768 External globals + * A < $EXTERNS_BOTTOM Objects returned from + * external functions * */ void __VERIFIER_assume(int x) { - __SMACK_dummy(x); __SMACK_code("assume @ != $0;", x); + __SMACK_dummy(x); + __SMACK_code("assume @ != $0;", x); } #ifndef CUSTOM_VERIFIER_ASSERT void __VERIFIER_assert(int x) { #if !MEMORY_SAFETY && !SIGNED_INTEGER_OVERFLOW_CHECK - __SMACK_dummy(x); __SMACK_code("assert @ != $0;", x); + __SMACK_dummy(x); + __SMACK_code("assert @ != $0;", x); #endif } #endif @@ -55,7 +59,8 @@ void __VERIFIER_error(void) { } void __SMACK_check_overflow(int flag) { - __SMACK_dummy(flag); __SMACK_code("assert {:overflow} @ == $0;", flag); + __SMACK_dummy(flag); + __SMACK_code("assert {:overflow} @ == $0;", flag); } char __VERIFIER_nondet_char(void) { @@ -241,994 +246,20 @@ unsigned short __VERIFIER_nondet_ushort(void) { unsigned int __VERIFIER_nondet_uint(void) { unsigned int x = __VERIFIER_nondet_unsigned_int(); return x; - } +} unsigned long __VERIFIER_nondet_ulong(void) { unsigned long x = __VERIFIER_nondet_unsigned_long(); return x; } -void* __VERIFIER_nondet_pointer(void) { - return __VERIFIER_nondet(); -} - -void __SMACK_dummy(int v) { - __SMACK_code("assume true;"); -} - -#define LIMIT_1 2 -#define LIMIT_7 128 -#define LIMIT_8 256 -#define LIMIT_15 32768 -#define LIMIT_16 65536 -#define LIMIT_31 2147483648 -#define LIMIT_32 4294967296 -#define LIMIT_63 9223372036854775808 -#define LIMIT_64 18446744073709551616 - -#define xstr(s) str(s) -#define str(s) #s - -#define UNINTERPRETED_UNARY_OP(type,name) \ - function name.type(i: type) returns (type); - -#define UNINTERPRETED_BINARY_OP(type,name) \ - function name.type(i1: type, i2: type) returns (type); - -#define UNINTERPRETED_UNARY_PRED(type,name) \ - function name.type(i: type) returns (i1); - -#define UNINTERPRETED_BINARY_PRED(type,name) \ - function name.type(i1: type, i2: type) returns (i1); - -#define UNINTERPRETED_BINARY_COMP(type,name) \ - function name.type.bool(i1: type, i2: type) returns (bool); - -#define UNINTERPRETED_CONVERSION(t1,t2,name) \ - function name.t1.t2(i: t1) returns (t2); - -#define UNINTERPRETED_RMODE_CONVERSION(t1,t2,name) \ - function name.t1.t2(rm: rmode, i: t1) returns (t2); - -#define UNARY_OP(attrib,type,name,body) \ - function {:attrib} name.type(i: type) returns (type) body - -#define RMODE_UNARY_OP(attrib,type,name,body) \ - function {:attrib} name.type(rm: rmode, i: type) returns (type) body - -#define BINARY_OP(attrib,type,name,body) \ - function {:attrib} name.type(i1: type, i2: type) returns (type) body - -#define RMODE_BINARY_OP(attrib,type,name,body) \ - function {:attrib} name.type(rm: rmode, i1: type, i2: type) returns (type) body - -#define BINARY_COMP(attrib,type,name,cond) \ - function {:attrib} name.type.bool(i1: type, i2: type) returns (bool) cond - -#define INLINE_BINARY_COMP(type,name,cond) \ - BINARY_COMP(inline,type,name,cond) - -#define BUILTIN_CONVERSION(t1,t2,name,prim) \ - function {:builtin xstr(prim)} name.t1.t2(i: t1) returns (t2); - -#define BUILTIN_RMODE_CONVERSION(t1,t2,name,prim) \ - function {:builtin xstr(prim)} name.t1.t2(rm: rmode, i: t1) returns (t2); - -#define INLINE_CONVERSION(t1,t2,name,body) \ - function {:inline} name.t1.t2(i: t1) returns (t2) body - -#define INLINE_RMODE_CONVERSION(t1,t2,name,body) \ - function {:inline} name.t1.t2(rm: rmode, i: t1) returns (t2) body +void *__VERIFIER_nondet_pointer(void) { return __VERIFIER_nondet(); } -#define BUILTIN_UNARY_OP(type,name,prim) \ - UNARY_OP(builtin xstr(prim),type,name,); - -#define BUILTIN_RMODE_UNARY_OP(type,name,prim) \ - RMODE_UNARY_OP(builtin xstr(prim),type,name,); - -#define BUILTIN_UNARY_PRED(type,name,prim) \ - function {:builtin xstr(prim)} name.type.bool(i: type) returns (bool); - -#define BUILTIN_BINARY_COMP(type,name,prim) \ - BINARY_COMP(builtin xstr(prim),type,name,); - -#define BUILTIN_BINARY_OP(type,name,prim) \ - BINARY_OP(builtin xstr(prim),type,name,); - -#define BUILTIN_RMODE_BINARY_OP(type,name,prim) \ - RMODE_BINARY_OP(builtin xstr(prim),type,name,); +void __SMACK_dummy(int v) { __SMACK_code("assume true;"); } #define D(d) __SMACK_top_decl(d) -#define DECLARE(M,args...) \ - D(xstr(M(args))) - -#include "smack-macros.h" - -#define DECLARE_EACH_FLOAT_TYPE(M,args...) \ - D(xstr(M(bvhalf,args))); \ - D(xstr(M(bvfloat,args))); \ - D(xstr(M(bvdouble,args))); \ - D(xstr(M(bvlongdouble,args))); - void __SMACK_decls(void) { - -#if FLOAT_ENABLED - D("var $rmode: rmode;"); -#endif - - DECLARE(INLINE_CONVERSION,ref,ref,$bitcast,{i}); - - // BITVECTOR MODELING - - DECLARE(INLINE_CONVERSION,bv1,bv8,$zext,{if i == 0bv1 then 0bv8 else 1bv8}); - DECLARE(INLINE_CONVERSION,bv1,bv16,$zext,{if i == 0bv1 then 0bv16 else 1bv16}); - DECLARE(INLINE_CONVERSION,bv1,bv24,$zext,{if i == 0bv1 then 0bv24 else 1bv24}); - DECLARE(INLINE_CONVERSION,bv1,bv32,$zext,{if i == 0bv1 then 0bv32 else 1bv32}); - DECLARE(INLINE_CONVERSION,bv1,bv40,$zext,{if i == 0bv1 then 0bv40 else 1bv40}); - DECLARE(INLINE_CONVERSION,bv1,bv48,$zext,{if i == 0bv1 then 0bv48 else 1bv48}); - DECLARE(INLINE_CONVERSION,bv1,bv56,$zext,{if i == 0bv1 then 0bv56 else 1bv56}); - DECLARE(INLINE_CONVERSION,bv1,bv64,$zext,{if i == 0bv1 then 0bv64 else 1bv64}); - DECLARE(INLINE_CONVERSION,bv1,bv80,$zext,{if i == 0bv1 then 0bv80 else 1bv80}); - DECLARE(INLINE_CONVERSION,bv1,bv88,$zext,{if i == 0bv1 then 0bv88 else 1bv88}); - DECLARE(INLINE_CONVERSION,bv1,bv96,$zext,{if i == 0bv1 then 0bv96 else 1bv96}); - DECLARE(INLINE_CONVERSION,bv1,bv128,$zext,{if i == 0bv1 then 0bv128 else 1bv128}); - D("function {:bvbuiltin \"(_ zero_extend 8)\"} $zext.bv8.bv16(i: bv8) returns (bv16);"); - D("function {:bvbuiltin \"(_ zero_extend 16)\"} $zext.bv8.bv24(i: bv8) returns (bv24);"); - D("function {:bvbuiltin \"(_ zero_extend 24)\"} $zext.bv8.bv32(i: bv8) returns (bv32);"); - D("function {:bvbuiltin \"(_ zero_extend 32)\"} $zext.bv8.bv40(i: bv8) returns (bv40);"); - D("function {:bvbuiltin \"(_ zero_extend 40)\"} $zext.bv8.bv48(i: bv8) returns (bv48);"); - D("function {:bvbuiltin \"(_ zero_extend 48)\"} $zext.bv8.bv56(i: bv8) returns (bv56);"); - D("function {:bvbuiltin \"(_ zero_extend 56)\"} $zext.bv8.bv64(i: bv8) returns (bv64);"); - D("function {:bvbuiltin \"(_ zero_extend 72)\"} $zext.bv8.bv80(i: bv8) returns (bv80);"); - D("function {:bvbuiltin \"(_ zero_extend 80)\"} $zext.bv8.bv88(i: bv8) returns (bv88);"); - D("function {:bvbuiltin \"(_ zero_extend 88)\"} $zext.bv8.bv96(i: bv8) returns (bv96);"); - D("function {:bvbuiltin \"(_ zero_extend 120)\"} $zext.bv8.bv128(i: bv8) returns (bv128);"); - D("function {:bvbuiltin \"(_ zero_extend 8)\"} $zext.bv16.bv24(i: bv16) returns (bv24);"); - D("function {:bvbuiltin \"(_ zero_extend 16)\"} $zext.bv16.bv32(i: bv16) returns (bv32);"); - D("function {:bvbuiltin \"(_ zero_extend 24)\"} $zext.bv16.bv40(i: bv16) returns (bv40);"); - D("function {:bvbuiltin \"(_ zero_extend 32)\"} $zext.bv16.bv48(i: bv16) returns (bv48);"); - D("function {:bvbuiltin \"(_ zero_extend 40)\"} $zext.bv16.bv56(i: bv16) returns (bv56);"); - D("function {:bvbuiltin \"(_ zero_extend 48)\"} $zext.bv16.bv64(i: bv16) returns (bv64);"); - D("function {:bvbuiltin \"(_ zero_extend 64)\"} $zext.bv16.bv80(i: bv16) returns (bv80);"); - D("function {:bvbuiltin \"(_ zero_extend 72)\"} $zext.bv16.bv88(i: bv16) returns (bv88);"); - D("function {:bvbuiltin \"(_ zero_extend 80)\"} $zext.bv16.bv96(i: bv16) returns (bv96);"); - D("function {:bvbuiltin \"(_ zero_extend 112)\"} $zext.bv16.bv128(i: bv16) returns (bv128);"); - D("function {:bvbuiltin \"(_ zero_extend 8)\"} $zext.bv24.bv32(i: bv24) returns (bv32);"); - D("function {:bvbuiltin \"(_ zero_extend 16)\"} $zext.bv24.bv40(i: bv24) returns (bv40);"); - D("function {:bvbuiltin \"(_ zero_extend 24)\"} $zext.bv24.bv48(i: bv24) returns (bv48);"); - D("function {:bvbuiltin \"(_ zero_extend 32)\"} $zext.bv24.bv56(i: bv24) returns (bv56);"); - D("function {:bvbuiltin \"(_ zero_extend 40)\"} $zext.bv24.bv64(i: bv24) returns (bv64);"); - D("function {:bvbuiltin \"(_ zero_extend 56)\"} $zext.bv24.bv80(i: bv24) returns (bv80);"); - D("function {:bvbuiltin \"(_ zero_extend 64)\"} $zext.bv24.bv88(i: bv24) returns (bv88);"); - D("function {:bvbuiltin \"(_ zero_extend 72)\"} $zext.bv24.bv96(i: bv24) returns (bv96);"); - D("function {:bvbuiltin \"(_ zero_extend 104)\"} $zext.bv24.bv128(i: bv24) returns (bv128);"); - D("function {:bvbuiltin \"(_ zero_extend 8)\"} $zext.bv32.bv40(i: bv32) returns (bv40);"); - D("function {:bvbuiltin \"(_ zero_extend 16)\"} $zext.bv32.bv48(i: bv32) returns (bv48);"); - D("function {:bvbuiltin \"(_ zero_extend 24)\"} $zext.bv32.bv56(i: bv32) returns (bv56);"); - D("function {:bvbuiltin \"(_ zero_extend 32)\"} $zext.bv32.bv64(i: bv32) returns (bv64);"); - D("function {:bvbuiltin \"(_ zero_extend 48)\"} $zext.bv32.bv80(i: bv32) returns (bv80);"); - D("function {:bvbuiltin \"(_ zero_extend 56)\"} $zext.bv32.bv88(i: bv32) returns (bv88);"); - D("function {:bvbuiltin \"(_ zero_extend 64)\"} $zext.bv32.bv96(i: bv32) returns (bv96);"); - D("function {:bvbuiltin \"(_ zero_extend 96)\"} $zext.bv32.bv128(i: bv32) returns (bv128);"); - D("function {:bvbuiltin \"(_ zero_extend 8)\"} $zext.bv40.bv48(i: bv40) returns (bv48);"); - D("function {:bvbuiltin \"(_ zero_extend 16)\"} $zext.bv40.bv56(i: bv40) returns (bv56);"); - D("function {:bvbuiltin \"(_ zero_extend 24)\"} $zext.bv40.bv64(i: bv40) returns (bv64);"); - D("function {:bvbuiltin \"(_ zero_extend 40)\"} $zext.bv40.bv80(i: bv40) returns (bv80);"); - D("function {:bvbuiltin \"(_ zero_extend 48)\"} $zext.bv40.bv88(i: bv40) returns (bv88);"); - D("function {:bvbuiltin \"(_ zero_extend 56)\"} $zext.bv40.bv96(i: bv40) returns (bv96);"); - D("function {:bvbuiltin \"(_ zero_extend 88)\"} $zext.bv40.bv128(i: bv40) returns (bv128);"); - D("function {:bvbuiltin \"(_ zero_extend 16)\"} $zext.bv48.bv64(i: bv48) returns (bv64);"); - D("function {:bvbuiltin \"(_ zero_extend 32)\"} $zext.bv48.bv80(i: bv48) returns (bv80);"); - D("function {:bvbuiltin \"(_ zero_extend 40)\"} $zext.bv48.bv88(i: bv48) returns (bv88);"); - D("function {:bvbuiltin \"(_ zero_extend 48)\"} $zext.bv48.bv96(i: bv48) returns (bv96);"); - D("function {:bvbuiltin \"(_ zero_extend 80)\"} $zext.bv48.bv128(i: bv48) returns (bv128);"); - D("function {:bvbuiltin \"(_ zero_extend 8)\"} $zext.bv56.bv64(i: bv56) returns (bv64);"); - D("function {:bvbuiltin \"(_ zero_extend 24)\"} $zext.bv56.bv80(i: bv56) returns (bv80);"); - D("function {:bvbuiltin \"(_ zero_extend 32)\"} $zext.bv56.bv88(i: bv56) returns (bv88);"); - D("function {:bvbuiltin \"(_ zero_extend 40)\"} $zext.bv56.bv96(i: bv56) returns (bv96);"); - D("function {:bvbuiltin \"(_ zero_extend 72)\"} $zext.bv56.bv128(i: bv56) returns (bv128);"); - D("function {:bvbuiltin \"(_ zero_extend 16)\"} $zext.bv64.bv80(i: bv64) returns (bv80);"); - D("function {:bvbuiltin \"(_ zero_extend 24)\"} $zext.bv64.bv88(i: bv64) returns (bv88);"); - D("function {:bvbuiltin \"(_ zero_extend 32)\"} $zext.bv64.bv96(i: bv64) returns (bv96);"); - D("function {:bvbuiltin \"(_ zero_extend 64)\"} $zext.bv64.bv128(i: bv64) returns (bv128);"); - D("function {:bvbuiltin \"(_ zero_extend 8)\"} $zext.bv80.bv88(i: bv80) returns (bv88);"); - D("function {:bvbuiltin \"(_ zero_extend 16)\"} $zext.bv80.bv96(i: bv80) returns (bv96);"); - D("function {:bvbuiltin \"(_ zero_extend 48)\"} $zext.bv80.bv128(i: bv80) returns (bv128);"); - D("function {:bvbuiltin \"(_ zero_extend 8)\"} $zext.bv88.bv96(i: bv88) returns (bv96);"); - D("function {:bvbuiltin \"(_ zero_extend 40)\"} $zext.bv88.bv128(i: bv88) returns (bv128);"); - D("function {:bvbuiltin \"(_ zero_extend 32)\"} $zext.bv96.bv128(i: bv96) returns (bv128);"); - - DECLARE(INLINE_CONVERSION,bv1,bv8,$sext,{if i == 0bv1 then 0bv8 else 255bv8}); - DECLARE(INLINE_CONVERSION,bv1,bv16,$sext,{if i == 0bv1 then 0bv16 else 65535bv16}); - DECLARE(INLINE_CONVERSION,bv1,bv24,$sext,{if i == 0bv1 then 0bv24 else 16777215bv24}); - DECLARE(INLINE_CONVERSION,bv1,bv32,$sext,{if i == 0bv1 then 0bv32 else 4294967295bv32}); - DECLARE(INLINE_CONVERSION,bv1,bv40,$sext,{if i == 0bv1 then 0bv40 else 1099511627775bv40}); - DECLARE(INLINE_CONVERSION,bv1,bv48,$sext,{if i == 0bv1 then 0bv48 else 281474976710655bv48}); - DECLARE(INLINE_CONVERSION,bv1,bv56,$sext,{if i == 0bv1 then 0bv56 else 72057594037927935bv56}); - DECLARE(INLINE_CONVERSION,bv1,bv64,$sext,{if i == 0bv1 then 0bv64 else 18446744073709551615bv64}); - DECLARE(INLINE_CONVERSION,bv1,bv80,$sext,{if i == 0bv1 then 0bv80 else 1208925819614629174706175bv80}); - DECLARE(INLINE_CONVERSION,bv1,bv88,$sext,{if i == 0bv1 then 0bv88 else 309485009821345068724781055bv88}); - DECLARE(INLINE_CONVERSION,bv1,bv96,$sext,{if i == 0bv1 then 0bv96 else 79228162514264337593543950335bv96}); - DECLARE(INLINE_CONVERSION,bv1,bv128,$sext,{if i == 0bv1 then 0bv128 else 340282366920938463463374607431768211455bv128}); - D("function {:bvbuiltin \"(_ sign_extend 8)\"} $sext.bv8.bv16(i: bv8) returns (bv16);"); - D("function {:bvbuiltin \"(_ sign_extend 16)\"} $sext.bv8.bv24(i: bv8) returns (bv24);"); - D("function {:bvbuiltin \"(_ sign_extend 24)\"} $sext.bv8.bv32(i: bv8) returns (bv32);"); - D("function {:bvbuiltin \"(_ sign_extend 32)\"} $sext.bv8.bv40(i: bv8) returns (bv40);"); - D("function {:bvbuiltin \"(_ sign_extend 40)\"} $sext.bv8.bv48(i: bv8) returns (bv48);"); - D("function {:bvbuiltin \"(_ sign_extend 48)\"} $sext.bv8.bv56(i: bv8) returns (bv56);"); - D("function {:bvbuiltin \"(_ sign_extend 56)\"} $sext.bv8.bv64(i: bv8) returns (bv64);"); - D("function {:bvbuiltin \"(_ sign_extend 72)\"} $sext.bv8.bv80(i: bv8) returns (bv80);"); - D("function {:bvbuiltin \"(_ sign_extend 80)\"} $sext.bv8.bv88(i: bv8) returns (bv88);"); - D("function {:bvbuiltin \"(_ sign_extend 88)\"} $sext.bv8.bv96(i: bv8) returns (bv96);"); - D("function {:bvbuiltin \"(_ sign_extend 120)\"} $sext.bv8.bv128(i: bv8) returns (bv128);"); - D("function {:bvbuiltin \"(_ sign_extend 8)\"} $sext.bv16.bv24(i: bv16) returns (bv24);"); - D("function {:bvbuiltin \"(_ sign_extend 16)\"} $sext.bv16.bv32(i: bv16) returns (bv32);"); - D("function {:bvbuiltin \"(_ sign_extend 24)\"} $sext.bv16.bv40(i: bv16) returns (bv40);"); - D("function {:bvbuiltin \"(_ sign_extend 32)\"} $sext.bv16.bv48(i: bv16) returns (bv48);"); - D("function {:bvbuiltin \"(_ sign_extend 40)\"} $sext.bv16.bv56(i: bv16) returns (bv56);"); - D("function {:bvbuiltin \"(_ sign_extend 48)\"} $sext.bv16.bv64(i: bv16) returns (bv64);"); - D("function {:bvbuiltin \"(_ sign_extend 64)\"} $sext.bv16.bv80(i: bv16) returns (bv80);"); - D("function {:bvbuiltin \"(_ sign_extend 72)\"} $sext.bv16.bv88(i: bv16) returns (bv88);"); - D("function {:bvbuiltin \"(_ sign_extend 80)\"} $sext.bv16.bv96(i: bv16) returns (bv96);"); - D("function {:bvbuiltin \"(_ sign_extend 112)\"} $sext.bv16.bv128(i: bv16) returns (bv128);"); - D("function {:bvbuiltin \"(_ sign_extend 8)\"} $sext.bv24.bv32(i: bv24) returns (bv32);"); - D("function {:bvbuiltin \"(_ sign_extend 16)\"} $sext.bv24.bv40(i: bv24) returns (bv40);"); - D("function {:bvbuiltin \"(_ sign_extend 24)\"} $sext.bv24.bv48(i: bv24) returns (bv48);"); - D("function {:bvbuiltin \"(_ sign_extend 32)\"} $sext.bv24.bv56(i: bv24) returns (bv56);"); - D("function {:bvbuiltin \"(_ sign_extend 40)\"} $sext.bv24.bv64(i: bv24) returns (bv64);"); - D("function {:bvbuiltin \"(_ sign_extend 56)\"} $sext.bv24.bv80(i: bv24) returns (bv80);"); - D("function {:bvbuiltin \"(_ sign_extend 64)\"} $sext.bv24.bv88(i: bv24) returns (bv88);"); - D("function {:bvbuiltin \"(_ sign_extend 72)\"} $sext.bv24.bv96(i: bv24) returns (bv96);"); - D("function {:bvbuiltin \"(_ sign_extend 104)\"} $sext.bv24.bv128(i: bv24) returns (bv128);"); - D("function {:bvbuiltin \"(_ sign_extend 8)\"} $sext.bv32.bv40(i: bv32) returns (bv40);"); - D("function {:bvbuiltin \"(_ sign_extend 16)\"} $sext.bv32.bv48(i: bv32) returns (bv48);"); - D("function {:bvbuiltin \"(_ sign_extend 24)\"} $sext.bv32.bv56(i: bv32) returns (bv56);"); - D("function {:bvbuiltin \"(_ sign_extend 32)\"} $sext.bv32.bv64(i: bv32) returns (bv64);"); - D("function {:bvbuiltin \"(_ sign_extend 48)\"} $sext.bv32.bv80(i: bv32) returns (bv80);"); - D("function {:bvbuiltin \"(_ sign_extend 56)\"} $sext.bv32.bv88(i: bv32) returns (bv88);"); - D("function {:bvbuiltin \"(_ sign_extend 64)\"} $sext.bv32.bv96(i: bv32) returns (bv96);"); - D("function {:bvbuiltin \"(_ sign_extend 96)\"} $sext.bv32.bv128(i: bv32) returns (bv128);"); - D("function {:bvbuiltin \"(_ sign_extend 8)\"} $sext.bv40.bv48(i: bv40) returns (bv48);"); - D("function {:bvbuiltin \"(_ sign_extend 16)\"} $sext.bv40.bv56(i: bv40) returns (bv56);"); - D("function {:bvbuiltin \"(_ sign_extend 24)\"} $sext.bv40.bv64(i: bv40) returns (bv64);"); - D("function {:bvbuiltin \"(_ sign_extend 40)\"} $sext.bv40.bv80(i: bv40) returns (bv80);"); - D("function {:bvbuiltin \"(_ sign_extend 48)\"} $sext.bv40.bv88(i: bv40) returns (bv88);"); - D("function {:bvbuiltin \"(_ sign_extend 56)\"} $sext.bv40.bv96(i: bv40) returns (bv96);"); - D("function {:bvbuiltin \"(_ sign_extend 88)\"} $sext.bv40.bv128(i: bv40) returns (bv128);"); - D("function {:bvbuiltin \"(_ sign_extend 8)\"} $sext.bv48.bv56(i: bv48) returns (bv56);"); - D("function {:bvbuiltin \"(_ sign_extend 16)\"} $sext.bv48.bv64(i: bv48) returns (bv64);"); - D("function {:bvbuiltin \"(_ sign_extend 32)\"} $sext.bv48.bv80(i: bv48) returns (bv80);"); - D("function {:bvbuiltin \"(_ sign_extend 40)\"} $sext.bv48.bv88(i: bv48) returns (bv88);"); - D("function {:bvbuiltin \"(_ sign_extend 48)\"} $sext.bv48.bv96(i: bv48) returns (bv96);"); - D("function {:bvbuiltin \"(_ sign_extend 80)\"} $sext.bv48.bv128(i: bv48) returns (bv128);"); - D("function {:bvbuiltin \"(_ sign_extend 8)\"} $sext.bv56.bv64(i: bv56) returns (bv64);"); - D("function {:bvbuiltin \"(_ sign_extend 24)\"} $sext.bv56.bv80(i: bv56) returns (bv80);"); - D("function {:bvbuiltin \"(_ sign_extend 32)\"} $sext.bv56.bv88(i: bv56) returns (bv88);"); - D("function {:bvbuiltin \"(_ sign_extend 40)\"} $sext.bv56.bv96(i: bv56) returns (bv96);"); - D("function {:bvbuiltin \"(_ sign_extend 72)\"} $sext.bv56.bv128(i: bv56) returns (bv128);"); - D("function {:bvbuiltin \"(_ sign_extend 16)\"} $sext.bv64.bv80(i: bv64) returns (bv80);"); - D("function {:bvbuiltin \"(_ sign_extend 24)\"} $sext.bv64.bv88(i: bv64) returns (bv88);"); - D("function {:bvbuiltin \"(_ sign_extend 32)\"} $sext.bv64.bv96(i: bv64) returns (bv96);"); - D("function {:bvbuiltin \"(_ sign_extend 64)\"} $sext.bv64.bv128(i: bv64) returns (bv128);"); - D("function {:bvbuiltin \"(_ sign_extend 8)\"} $sext.bv80.bv88(i: bv80) returns (bv88);"); - D("function {:bvbuiltin \"(_ sign_extend 16)\"} $sext.bv80.bv96(i: bv80) returns (bv96);"); - D("function {:bvbuiltin \"(_ sign_extend 48)\"} $sext.bv80.bv128(i: bv80) returns (bv128);"); - D("function {:bvbuiltin \"(_ sign_extend 8)\"} $sext.bv88.bv96(i: bv88) returns (bv96);"); - D("function {:bvbuiltin \"(_ sign_extend 40)\"} $sext.bv88.bv128(i: bv88) returns (bv128);"); - D("function {:bvbuiltin \"(_ sign_extend 32)\"} $sext.bv96.bv128(i: bv96) returns (bv128);"); - - // INTEGER MODELING - - D("function {:builtin \"div\"} $div(i1: int, i2: int) returns (int);"); - D("function {:builtin \"mod\"} $mod(i1: int, i2: int) returns (int);"); - D("function {:builtin \"rem\"} $rem(i1: int, i2: int) returns (int);"); - D("function {:inline} $min(i1: int, i2: int) returns (int) {if i1 < i2 then i1 else i2}"); - D("function {:inline} $max(i1: int, i2: int) returns (int) {if i1 > i2 then i1 else i2}"); - - D("axiom $and.i1(0,0) == 0;"); - D("axiom $and.i1(0,1) == 0;"); - D("axiom $and.i1(1,0) == 0;"); - D("axiom $and.i1(1,1) == 1;"); - D("axiom $or.i1(0,0) == 0;"); - D("axiom $or.i1(0,1) == 1;"); - D("axiom $or.i1(1,0) == 1;"); - D("axiom $or.i1(1,1) == 1;"); - D("axiom $xor.i1(0,0) == 0;"); - D("axiom $xor.i1(0,1) == 1;"); - D("axiom $xor.i1(1,0) == 1;"); - D("axiom $xor.i1(1,1) == 0;"); - D("axiom($and.i32(32, 16) == 0);"); - -#if FLOAT_ENABLED - // Bit-precise modeling of floating-points - - // Floating-point arithmetic - DECLARE_EACH_FLOAT_TYPE(BUILTIN_RMODE_UNARY_OP, $sqrt, fp.sqrt) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_RMODE_UNARY_OP, $round, fp.roundToIntegral) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_RMODE_BINARY_OP, $fadd, fp.add) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_RMODE_BINARY_OP, $fsub, fp.sub) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_RMODE_BINARY_OP, $fmul, fp.mul) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_RMODE_BINARY_OP, $fdiv, fp.div) - - DECLARE_EACH_FLOAT_TYPE(BUILTIN_UNARY_OP, $abs, fp.abs) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_BINARY_OP, $fma, fp.fma) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_BINARY_OP, $frem, fp.rem) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_BINARY_OP, $min, fp.min) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_BINARY_OP, $max, fp.max) - - // Floating-point value predicates - DECLARE_EACH_FLOAT_TYPE(BUILTIN_UNARY_PRED, $isnormal, fp.isNormal) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_UNARY_PRED, $issubnormal, fp.isSubnormal) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_UNARY_PRED, $iszero, fp.isZero) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_UNARY_PRED, $isinfinite, fp.isInfinite) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_UNARY_PRED, $isnan, fp.isNaN) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_UNARY_PRED, $isnegative, fp.isNegative) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_UNARY_PRED, $ispositive, fp.isPositive) - - // Floating-point comparison predicates - // We assume fp.eq is exactly IEEE compareQuietEqual - DECLARE_EACH_FLOAT_TYPE(BUILTIN_BINARY_COMP, $foeq, fp.eq) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_BINARY_COMP, $fole, fp.leq) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_BINARY_COMP, $folt, fp.lt) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_BINARY_COMP, $foge, fp.geq) - DECLARE_EACH_FLOAT_TYPE(BUILTIN_BINARY_COMP, $fogt, fp.gt) - D("function {:inline} $fone.bvhalf.bool(f1:bvhalf, f2:bvhalf) returns (bool) {!$fueq.bvhalf.bool(f1,f2)}"); - D("function {:inline} $fone.bvfloat.bool(f1:bvfloat, f2:bvfloat) returns (bool) {!$fueq.bvfloat.bool(f1,f2)}"); - D("function {:inline} $fone.bvdouble.bool(f1:bvdouble, f2:bvdouble) returns (bool) {!$fueq.bvdouble.bool(f1,f2)}"); - D("function {:inline} $fone.bvlongdouble.bool(f1:bvlongdouble, f2:bvlongdouble) returns (bool) {!$fueq.bvlongdouble.bool(f1,f2)}"); - D("function {:inline} $ford.bvhalf.bool(f1:bvhalf, f2:bvhalf) returns (bool) {!$funo.bvhalf.bool(f1,f2)}"); - D("function {:inline} $ford.bvfloat.bool(f1:bvfloat, f2:bvfloat) returns (bool) {!$funo.bvfloat.bool(f1,f2)}"); - D("function {:inline} $ford.bvdouble.bool(f1:bvdouble, f2:bvdouble) returns (bool) {!$funo.bvdouble.bool(f1,f2)}"); - D("function {:inline} $ford.bvlongdouble.bool(f1:bvlongdouble, f2:bvlongdouble) returns (bool) {!$funo.bvlongdouble.bool(f1,f2)}"); - D("function {:inline} $fueq.bvhalf.bool(f1:bvhalf, f2:bvhalf) returns (bool) {$isnan.bvhalf.bool(f1)||$isnan.bvhalf.bool(f2)||$foeq.bvhalf.bool(f1,f2)}"); - D("function {:inline} $fugt.bvhalf.bool(f1:bvhalf, f2:bvhalf) returns (bool) {$isnan.bvhalf.bool(f1)||$isnan.bvhalf.bool(f2)||$fogt.bvhalf.bool(f1,f2)}"); - D("function {:inline} $fuge.bvhalf.bool(f1:bvhalf, f2:bvhalf) returns (bool) {$isnan.bvhalf.bool(f1)||$isnan.bvhalf.bool(f2)||$foge.bvhalf.bool(f1,f2)}"); - D("function {:inline} $fult.bvhalf.bool(f1:bvhalf, f2:bvhalf) returns (bool) {$isnan.bvhalf.bool(f1)||$isnan.bvhalf.bool(f2)||$folt.bvhalf.bool(f1,f2)}"); - D("function {:inline} $fule.bvhalf.bool(f1:bvhalf, f2:bvhalf) returns (bool) {$isnan.bvhalf.bool(f1)||$isnan.bvhalf.bool(f2)||$fole.bvhalf.bool(f1,f2)}"); - D("function {:inline} $fune.bvhalf.bool(f1:bvhalf, f2:bvhalf) returns (bool) {$isnan.bvhalf.bool(f1)||$isnan.bvhalf.bool(f2)||$fone.bvhalf.bool(f1,f2)}"); - D("function {:inline} $funo.bvhalf.bool(f1:bvhalf, f2:bvhalf) returns (bool) {$isnan.bvhalf.bool(f1)||$isnan.bvhalf.bool(f2)}"); - D("function {:inline} $fueq.bvfloat.bool(f1:bvfloat, f2:bvfloat) returns (bool) {$isnan.bvfloat.bool(f1)||$isnan.bvfloat.bool(f2)||$foeq.bvfloat.bool(f1,f2)}"); - D("function {:inline} $fugt.bvfloat.bool(f1:bvfloat, f2:bvfloat) returns (bool) {$isnan.bvfloat.bool(f1)||$isnan.bvfloat.bool(f2)||$fogt.bvfloat.bool(f1,f2)}"); - D("function {:inline} $fuge.bvfloat.bool(f1:bvfloat, f2:bvfloat) returns (bool) {$isnan.bvfloat.bool(f1)||$isnan.bvfloat.bool(f2)||$foge.bvfloat.bool(f1,f2)}"); - D("function {:inline} $fult.bvfloat.bool(f1:bvfloat, f2:bvfloat) returns (bool) {$isnan.bvfloat.bool(f1)||$isnan.bvfloat.bool(f2)||$folt.bvfloat.bool(f1,f2)}"); - D("function {:inline} $fule.bvfloat.bool(f1:bvfloat, f2:bvfloat) returns (bool) {$isnan.bvfloat.bool(f1)||$isnan.bvfloat.bool(f2)||$fole.bvfloat.bool(f1,f2)}"); - D("function {:inline} $fune.bvfloat.bool(f1:bvfloat, f2:bvfloat) returns (bool) {$isnan.bvfloat.bool(f1)||$isnan.bvfloat.bool(f2)||$fone.bvfloat.bool(f1,f2)}"); - D("function {:inline} $funo.bvfloat.bool(f1:bvfloat, f2:bvfloat) returns (bool) {$isnan.bvfloat.bool(f1)||$isnan.bvfloat.bool(f2)}"); - D("function {:inline} $fueq.bvdouble.bool(f1:bvdouble, f2:bvdouble) returns (bool) {$isnan.bvdouble.bool(f1)||$isnan.bvdouble.bool(f2)||$foeq.bvdouble.bool(f1,f2)}"); - D("function {:inline} $fugt.bvdouble.bool(f1:bvdouble, f2:bvdouble) returns (bool) {$isnan.bvdouble.bool(f1)||$isnan.bvdouble.bool(f2)||$fogt.bvdouble.bool(f1,f2)}"); - D("function {:inline} $fuge.bvdouble.bool(f1:bvdouble, f2:bvdouble) returns (bool) {$isnan.bvdouble.bool(f1)||$isnan.bvdouble.bool(f2)||$foge.bvdouble.bool(f1,f2)}"); - D("function {:inline} $fult.bvdouble.bool(f1:bvdouble, f2:bvdouble) returns (bool) {$isnan.bvdouble.bool(f1)||$isnan.bvdouble.bool(f2)||$folt.bvdouble.bool(f1,f2)}"); - D("function {:inline} $fule.bvdouble.bool(f1:bvdouble, f2:bvdouble) returns (bool) {$isnan.bvdouble.bool(f1)||$isnan.bvdouble.bool(f2)||$fole.bvdouble.bool(f1,f2)}"); - D("function {:inline} $fune.bvdouble.bool(f1:bvdouble, f2:bvdouble) returns (bool) {$isnan.bvdouble.bool(f1)||$isnan.bvdouble.bool(f2)||$fone.bvdouble.bool(f1,f2)}"); - D("function {:inline} $funo.bvdouble.bool(f1:bvdouble, f2:bvdouble) returns (bool) {$isnan.bvdouble.bool(f1)||$isnan.bvdouble.bool(f2)}"); - D("function {:inline} $fueq.bvlongdouble.bool(f1:bvlongdouble, f2:bvlongdouble) returns (bool) {$isnan.bvlongdouble.bool(f1)||$isnan.bvlongdouble.bool(f2)||$foeq.bvlongdouble.bool(f1,f2)}"); - D("function {:inline} $fugt.bvlongdouble.bool(f1:bvlongdouble, f2:bvlongdouble) returns (bool) {$isnan.bvlongdouble.bool(f1)||$isnan.bvlongdouble.bool(f2)||$fogt.bvlongdouble.bool(f1,f2)}"); - D("function {:inline} $fuge.bvlongdouble.bool(f1:bvlongdouble, f2:bvlongdouble) returns (bool) {$isnan.bvlongdouble.bool(f1)||$isnan.bvlongdouble.bool(f2)||$foge.bvlongdouble.bool(f1,f2)}"); - D("function {:inline} $fult.bvlongdouble.bool(f1:bvlongdouble, f2:bvlongdouble) returns (bool) {$isnan.bvlongdouble.bool(f1)||$isnan.bvlongdouble.bool(f2)||$folt.bvlongdouble.bool(f1,f2)}"); - D("function {:inline} $fule.bvlongdouble.bool(f1:bvlongdouble, f2:bvlongdouble) returns (bool) {$isnan.bvlongdouble.bool(f1)||$isnan.bvlongdouble.bool(f2)||$fole.bvlongdouble.bool(f1,f2)}"); - D("function {:inline} $fune.bvlongdouble.bool(f1:bvlongdouble, f2:bvlongdouble) returns (bool) {$isnan.bvlongdouble.bool(f1)||$isnan.bvlongdouble.bool(f2)||$fone.bvlongdouble.bool(f1,f2)}"); - D("function {:inline} $funo.bvlongdouble.bool(f1:bvlongdouble, f2:bvlongdouble) returns (bool) {$isnan.bvlongdouble.bool(f1)||$isnan.bvlongdouble.bool(f2)}"); - DECLARE_EACH_FLOAT_TYPE(INLINE_BINARY_COMP, $ffalse, {false}) - DECLARE_EACH_FLOAT_TYPE(INLINE_BINARY_COMP, $ftrue, {true}) - - D("function {:builtin \"(_ to_fp 8 24)\"} dtf(rmode, bvdouble) returns (bvfloat);"); - D("function {:builtin \"(_ to_fp 11 53)\"} ftd(rmode, bvfloat) returns (bvdouble);"); - D("function {:builtin \"(_ to_fp 8 24)\"} ltf(rmode, bvlongdouble) returns (bvfloat);"); - D("function {:builtin \"(_ to_fp 11 53)\"} ltd(rmode, bvlongdouble) returns (bvdouble);"); - D("function {:builtin \"(_ to_fp 15 65)\"} ftl(rmode, bvfloat) returns (bvlongdouble);"); - D("function {:builtin \"(_ to_fp 15 65)\"} dtl(rmode, bvdouble) returns (bvlongdouble);"); - DECLARE(INLINE_RMODE_CONVERSION,bvdouble,bvfloat,$fptrunc,{dtf(rm, i)}); - DECLARE(INLINE_RMODE_CONVERSION,bvfloat,bvdouble,$fpext,{ftd(rm, i)}); - DECLARE(INLINE_RMODE_CONVERSION,bvlongdouble,bvfloat,$fptrunc,{ltf(rm, i)}); - DECLARE(INLINE_RMODE_CONVERSION,bvlongdouble,bvdouble,$fptrunc,{ltd(rm, i)}); - DECLARE(INLINE_RMODE_CONVERSION,bvfloat,bvlongdouble,$fpext,{ftl(rm, i)}); - DECLARE(INLINE_RMODE_CONVERSION,bvdouble,bvlongdouble,$fpext,{dtl(rm, i)}); - - // Add truncation for default casts to int - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv128,$fp2si,(_ fp.to_sbv 128)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv96,$fp2si,(_ fp.to_sbv 96)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv88,$fp2si,(_ fp.to_sbv 88)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv80,$fp2si,(_ fp.to_sbv 80)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv64,$fp2si,(_ fp.to_sbv 64)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv56,$fp2si,(_ fp.to_sbv 56)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv48,$fp2si,(_ fp.to_sbv 48)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv40,$fp2si,(_ fp.to_sbv 40)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv32,$fp2si,(_ fp.to_sbv 32)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv24,$fp2si,(_ fp.to_sbv 24)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv16,$fp2si,(_ fp.to_sbv 16)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv8,$fp2si,(_ fp.to_sbv 8)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv1,$fp2si,(_ fp.to_sbv 1)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv128,$fp2ui,(_ fp.to_ubv 128)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv96,$fp2ui,(_ fp.to_ubv 96)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv88,$fp2ui,(_ fp.to_ubv 88)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv80,$fp2ui,(_ fp.to_ubv 80)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv64,$fp2ui,(_ fp.to_ubv 64)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv56,$fp2ui,(_ fp.to_ubv 56)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv48,$fp2ui,(_ fp.to_ubv 48)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv40,$fp2ui,(_ fp.to_ubv 40)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv32,$fp2ui,(_ fp.to_ubv 32)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv24,$fp2ui,(_ fp.to_ubv 24)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv16,$fp2ui,(_ fp.to_ubv 16)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv8,$fp2ui,(_ fp.to_ubv 8)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvfloat,bv1,$fp2ui,(_ fp.to_ubv 1)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv128,$fp2si,(_ fp.to_sbv 128)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv96,$fp2si,(_ fp.to_sbv 96)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv88,$fp2si,(_ fp.to_sbv 88)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv80,$fp2si,(_ fp.to_sbv 80)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv64,$fp2si,(_ fp.to_sbv 64)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv56,$fp2si,(_ fp.to_sbv 56)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv48,$fp2si,(_ fp.to_sbv 48)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv40,$fp2si,(_ fp.to_sbv 40)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv32,$fp2si,(_ fp.to_sbv 32)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv24,$fp2si,(_ fp.to_sbv 24)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv16,$fp2si,(_ fp.to_sbv 16)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv8,$fp2si,(_ fp.to_sbv 8)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv1,$fp2si,(_ fp.to_sbv 1)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv128,$fp2ui,(_ fp.to_ubv 128)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv96,$fp2ui,(_ fp.to_ubv 96)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv88,$fp2ui,(_ fp.to_ubv 88)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv80,$fp2ui,(_ fp.to_ubv 80)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv64,$fp2ui,(_ fp.to_ubv 64)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv56,$fp2ui,(_ fp.to_ubv 56)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv48,$fp2ui,(_ fp.to_ubv 48)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv40,$fp2ui,(_ fp.to_ubv 40)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv32,$fp2ui,(_ fp.to_ubv 32)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv24,$fp2ui,(_ fp.to_ubv 24)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv16,$fp2ui,(_ fp.to_ubv 16)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv8,$fp2ui,(_ fp.to_ubv 8)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvdouble,bv1,$fp2ui,(_ fp.to_ubv 1)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv128,$fp2si,(_ fp.to_sbv 128)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv96,$fp2si,(_ fp.to_sbv 96)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv88,$fp2si,(_ fp.to_sbv 88)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv80,$fp2si,(_ fp.to_sbv 80)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv64,$fp2si,(_ fp.to_sbv 64)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv56,$fp2si,(_ fp.to_sbv 56)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv48,$fp2si,(_ fp.to_sbv 48)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv40,$fp2si,(_ fp.to_sbv 40)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv32,$fp2si,(_ fp.to_sbv 32)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv24,$fp2si,(_ fp.to_sbv 24)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv16,$fp2si,(_ fp.to_sbv 16)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv8,$fp2si,(_ fp.to_sbv 8)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv1,$fp2si,(_ fp.to_sbv 1)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv128,$fp2ui,(_ fp.to_ubv 128)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv96,$fp2ui,(_ fp.to_ubv 96)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv88,$fp2ui,(_ fp.to_ubv 88)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv80,$fp2ui,(_ fp.to_ubv 80)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv64,$fp2ui,(_ fp.to_ubv 64)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv56,$fp2ui,(_ fp.to_ubv 56)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv48,$fp2ui,(_ fp.to_ubv 48)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv40,$fp2ui,(_ fp.to_ubv 40)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv32,$fp2ui,(_ fp.to_ubv 32)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv24,$fp2ui,(_ fp.to_ubv 24)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv16,$fp2ui,(_ fp.to_ubv 16)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv8,$fp2ui,(_ fp.to_ubv 8)); - DECLARE(BUILTIN_RMODE_CONVERSION,bvlongdouble,bv1,$fp2ui,(_ fp.to_ubv 1)); - // Warning: do we need bv2int cast here? - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i128,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i96,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i88,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i80,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i64,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i56,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i48,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i40,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i32,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i24,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i16,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i8,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i1,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i128,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i96,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i88,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i80,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i64,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i56,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i48,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i40,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i32,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i24,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i16,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i8,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvfloat,i1,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i128,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i96,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i88,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i80,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i64,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i56,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i48,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i40,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i32,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i24,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i16,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i8,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i1,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i128,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i96,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i88,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i80,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i64,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i56,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i48,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i40,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i32,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i24,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i16,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i8,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvdouble,i1,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i128,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i96,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i88,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i80,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i64,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i56,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i48,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i40,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i32,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i24,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i16,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i8,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i1,$fp2si); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i128,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i96,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i88,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i80,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i64,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i56,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i48,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i40,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i32,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i24,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i16,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i8,$fp2ui); - DECLARE(UNINTERPRETED_RMODE_CONVERSION,bvlongdouble,i1,$fp2ui); - // Warning: undefined behaviors can occur - // https://llvm.org/docs/LangRef.html#uitofp-to-instruction - DECLARE(BUILTIN_RMODE_CONVERSION, bv128, bvfloat, $ui2fp,(_ to_fp_unsigned 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv96, bvfloat, $ui2fp,(_ to_fp_unsigned 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv88, bvfloat, $ui2fp,(_ to_fp_unsigned 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv80, bvfloat, $ui2fp,(_ to_fp_unsigned 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv64, bvfloat, $ui2fp,(_ to_fp_unsigned 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv56, bvfloat, $ui2fp,(_ to_fp_unsigned 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv48, bvfloat, $ui2fp,(_ to_fp_unsigned 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv40, bvfloat, $ui2fp,(_ to_fp_unsigned 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv32, bvfloat, $ui2fp,(_ to_fp_unsigned 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv24, bvfloat, $ui2fp,(_ to_fp_unsigned 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv16, bvfloat, $ui2fp,(_ to_fp_unsigned 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv8, bvfloat, $ui2fp,(_ to_fp_unsigned 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv1, bvfloat, $ui2fp,(_ to_fp_unsigned 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv128, bvfloat, $si2fp,(_ to_fp 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv96, bvfloat, $si2fp,(_ to_fp 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv88, bvfloat, $si2fp,(_ to_fp 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv80, bvfloat, $si2fp,(_ to_fp 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv64, bvfloat, $si2fp,(_ to_fp 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv56, bvfloat, $si2fp,(_ to_fp 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv48, bvfloat, $si2fp,(_ to_fp 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv40, bvfloat, $si2fp,(_ to_fp 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv32, bvfloat, $si2fp,(_ to_fp 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv24, bvfloat, $si2fp,(_ to_fp 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv16, bvfloat, $si2fp,(_ to_fp 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv8, bvfloat, $si2fp,(_ to_fp 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv1, bvfloat, $si2fp,(_ to_fp 8 24)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv128, bvdouble, $ui2fp,(_ to_fp_unsigned 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv96, bvdouble, $ui2fp,(_ to_fp_unsigned 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv88, bvdouble, $ui2fp,(_ to_fp_unsigned 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv80, bvdouble, $ui2fp,(_ to_fp_unsigned 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv64, bvdouble, $ui2fp,(_ to_fp_unsigned 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv56, bvdouble, $ui2fp,(_ to_fp_unsigned 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv48, bvdouble, $ui2fp,(_ to_fp_unsigned 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv40, bvdouble, $ui2fp,(_ to_fp_unsigned 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv32, bvdouble, $ui2fp,(_ to_fp_unsigned 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv24, bvdouble, $ui2fp,(_ to_fp_unsigned 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv16, bvdouble, $ui2fp,(_ to_fp_unsigned 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv8, bvdouble, $ui2fp,(_ to_fp_unsigned 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv1, bvdouble, $ui2fp,(_ to_fp_unsigned 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv128, bvdouble, $si2fp,(_ to_fp 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv96, bvdouble, $si2fp,(_ to_fp 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv88, bvdouble, $si2fp,(_ to_fp 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv80, bvdouble, $si2fp,(_ to_fp 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv64, bvdouble, $si2fp,(_ to_fp 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv56, bvdouble, $si2fp,(_ to_fp 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv48, bvdouble, $si2fp,(_ to_fp 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv40, bvdouble, $si2fp,(_ to_fp 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv32, bvdouble, $si2fp,(_ to_fp 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv24, bvdouble, $si2fp,(_ to_fp 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv16, bvdouble, $si2fp,(_ to_fp 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv8, bvdouble, $si2fp,(_ to_fp 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv1, bvdouble, $si2fp,(_ to_fp 11 53)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv128, bvlongdouble, $ui2fp,(_ to_fp_unsigned 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv96, bvlongdouble, $ui2fp,(_ to_fp_unsigned 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv88, bvlongdouble, $ui2fp,(_ to_fp_unsigned 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv80, bvlongdouble, $ui2fp,(_ to_fp_unsigned 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv64, bvlongdouble, $ui2fp,(_ to_fp_unsigned 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv56, bvlongdouble, $ui2fp,(_ to_fp_unsigned 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv48, bvlongdouble, $ui2fp,(_ to_fp_unsigned 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv40, bvlongdouble, $ui2fp,(_ to_fp_unsigned 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv32, bvlongdouble, $ui2fp,(_ to_fp_unsigned 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv24, bvlongdouble, $ui2fp,(_ to_fp_unsigned 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv16, bvlongdouble, $ui2fp,(_ to_fp_unsigned 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv8, bvlongdouble, $ui2fp,(_ to_fp_unsigned 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv1, bvlongdouble, $ui2fp,(_ to_fp_unsigned 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv128, bvlongdouble, $si2fp,(_ to_fp 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv96, bvlongdouble, $si2fp,(_ to_fp 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv88, bvlongdouble, $si2fp,(_ to_fp 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv80, bvlongdouble, $si2fp,(_ to_fp 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv64, bvlongdouble, $si2fp,(_ to_fp 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv56, bvlongdouble, $si2fp,(_ to_fp 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv48, bvlongdouble, $si2fp,(_ to_fp 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv40, bvlongdouble, $si2fp,(_ to_fp 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv32, bvlongdouble, $si2fp,(_ to_fp 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv24, bvlongdouble, $si2fp,(_ to_fp 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv16, bvlongdouble, $si2fp,(_ to_fp 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv8, bvlongdouble, $si2fp,(_ to_fp 15 65)); - DECLARE(BUILTIN_RMODE_CONVERSION, bv1, bvlongdouble, $si2fp,(_ to_fp 15 65)); - // Warning: integer-encoding fixes needed here - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i128, bvfloat, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i96, bvfloat, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i88, bvfloat, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i80, bvfloat, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i64, bvfloat, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i56, bvfloat, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i48, bvfloat, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i40, bvfloat, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i32, bvfloat, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i24, bvfloat, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i16, bvfloat, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i8, bvfloat, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i1, bvfloat, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i128, bvfloat, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i96, bvfloat, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i88, bvfloat, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i80, bvfloat, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i64, bvfloat, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i56, bvfloat, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i48, bvfloat, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i40, bvfloat, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i32, bvfloat, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i24, bvfloat, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i16, bvfloat, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i8, bvfloat, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i1, bvfloat, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i128, bvdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i96, bvdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i88, bvdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i80, bvdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i64, bvdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i56, bvdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i48, bvdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i40, bvdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i32, bvdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i24, bvdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i16, bvdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i8, bvdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i1, bvdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i128, bvdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i96, bvdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i88, bvdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i80, bvdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i64, bvdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i56, bvdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i48, bvdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i40, bvdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i32, bvdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i24, bvdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i16, bvdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i8, bvdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i1, bvdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i128, bvlongdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i96, bvlongdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i88, bvlongdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i80, bvlongdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i64, bvlongdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i56, bvlongdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i48, bvlongdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i40, bvlongdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i32, bvlongdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i24, bvlongdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i16, bvlongdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i8, bvlongdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i1, bvlongdouble, $ui2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i128, bvlongdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i96, bvlongdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i88, bvlongdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i80, bvlongdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i64, bvlongdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i56, bvlongdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i48, bvlongdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i40, bvlongdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i32, bvlongdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i24, bvlongdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i16, bvlongdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i8, bvlongdouble, $si2fp); - DECLARE(UNINTERPRETED_RMODE_CONVERSION, i1, bvlongdouble, $si2fp); - - #if defined(__LP64__) || defined(_LP64) || defined(_WIN64) - D("function {:builtin \"(_ fp.to_sbv 64)\"} $lround.bvfloat(rmode, bvfloat) returns (bv64);"); - D("function {:builtin \"(_ fp.to_sbv 64)\"} $lround.bvdouble(rmode, bvdouble) returns (bv64);"); - D("function {:builtin \"(_ fp.to_sbv 64)\"} $lround.bvlongdouble(rmode, bvlongdouble) returns (bv64);"); - #else - D("function {:builtin \"(_ fp.to_sbv 32)\"} $lround.bvfloat(rmode, bvfloat) returns (bv32);"); - D("function {:builtin \"(_ fp.to_sbv 32)\"} $lround.bvdouble(rmode, bvdouble) returns (bv32);"); - D("function {:builtin \"(_ fp.to_sbv 32)\"} $lround.bvlongdouble(rmode, bvlongdouble) returns (bv32);"); - #endif - -#else - // Non-bit-precise modeling of floating-points - - D("function $fp(ipart:int, fpart:int, epart:int) returns (float);"); - DECLARE(UNINTERPRETED_BINARY_OP,float,$fadd); - DECLARE(UNINTERPRETED_BINARY_OP,float,$fsub); - DECLARE(UNINTERPRETED_BINARY_OP,float,$fmul); - DECLARE(UNINTERPRETED_BINARY_OP,float,$fdiv); - DECLARE(UNINTERPRETED_BINARY_OP,float,$frem); - DECLARE(INLINE_BINARY_COMP,float,$ffalse,{false}); - DECLARE(INLINE_BINARY_COMP,float,$ftrue,{true}); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$foeq); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$foge); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$fogt); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$fole); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$folt); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$fone); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$ford); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$fueq); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$fuge); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$fugt); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$fule); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$fult); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$fune); - DECLARE(UNINTERPRETED_BINARY_COMP,float,$funo); - - DECLARE(UNINTERPRETED_CONVERSION,float,i128,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,i128,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,i96,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,i96,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,i88,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,i88,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,i80,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,i80,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,i64,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,i64,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,i56,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,i56,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,i48,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,i48,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,i40,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,i40,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,i32,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,i32,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,i24,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,i24,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,i16,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,i16,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,i8,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,i8,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,i1,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,i1,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,i128,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,i128,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,i96,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,i96,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,i88,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,i88,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,i80,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,i80,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,i64,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,i64,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,i56,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,i56,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,i48,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,i48,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,i40,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,i40,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,i32,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,i32,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,i24,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,i24,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,i16,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,i16,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,i8,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,i8,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,i1,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,i1,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,float,bv128,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,bv128,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,bv96,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,bv96,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,bv88,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,bv88,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,bv80,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,bv80,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,bv64,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,bv64,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,bv56,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,bv56,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,bv48,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,bv48,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,bv40,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,bv40,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,bv32,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,bv32,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,bv24,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,bv24,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,bv16,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,bv16,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,bv8,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,bv8,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,float,bv1,$fp2si); - DECLARE(UNINTERPRETED_CONVERSION,float,bv1,$fp2ui); - DECLARE(UNINTERPRETED_CONVERSION,bv128,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv128,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv96,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv96,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv88,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv88,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv80,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv80,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv64,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv64,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv56,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv56,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv48,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv48,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv40,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv40,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv32,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv32,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv24,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv24,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv16,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv16,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv8,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv8,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv1,float,$si2fp); - DECLARE(UNINTERPRETED_CONVERSION,bv1,float,$ui2fp); - DECLARE(UNINTERPRETED_CONVERSION,float,float,$fptrunc); - DECLARE(UNINTERPRETED_CONVERSION,float,float,$fpext); - - DECLARE(UNINTERPRETED_CONVERSION,float,i1,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,float,bv1,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,i1,float,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,bv1,float,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,float,i8,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,float,bv8,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,i8,float,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,bv8,float,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,float,i16,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,float,bv16,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,i16,float,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,bv16,float,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,float,i32,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,float,bv32,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,i32,float,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,bv32,float,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,float,i64,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,float,bv64,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,i64,float,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,bv64,float,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,float,i80,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,float,bv80,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,i80,float,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,bv80,float,$bitcast); - -#ifndef NO_FORALL - D("axiom (forall f1, f2: float :: $foeq.float.bool(f1,f2) <==> !$fune.float.bool(f1,f2));"); - D("axiom (forall f1, f2: float :: $fone.float.bool(f1,f2) <==> !$fueq.float.bool(f1,f2));"); - D("axiom (forall f1, f2: float :: $fogt.float.bool(f1,f2) <==> !$fule.float.bool(f1,f2));"); - D("axiom (forall f1, f2: float :: $foge.float.bool(f1,f2) <==> !$fult.float.bool(f1,f2));"); - D("axiom (forall f1, f2: float :: $folt.float.bool(f1,f2) <==> !$fuge.float.bool(f1,f2));"); - D("axiom (forall f1, f2: float :: $fole.float.bool(f1,f2) <==> !$fugt.float.bool(f1,f2));"); - D("axiom (forall f1, f2: float :: $ford.float.bool(f1,f2) <==> !$funo.float.bool(f1,f2));"); - D("axiom (forall f: float, i: i8 :: $bitcast.float.i8(f) == i <==> $bitcast.i8.float(i) == f);"); - // TODO: add proper axiom for float/bv8 conversions -#endif - -#endif - - // Memory Model - D("const $GLOBALS_BOTTOM: ref;"); - D("const $EXTERNS_BOTTOM: ref;"); - D("const $MALLOC_TOP: ref;"); - D("function {:inline} $isExternal(p: ref) returns (bool) {$slt.ref.bool(p,$EXTERNS_BOTTOM)}"); - - DECLARE_UNSAFE_LOADS - DECLARE(UNSAFE_LOAD_OP, bv8, $load.bytes, { M[p] }); - DECLARE(UNSAFE_LOAD_OP, bv1, $load.bytes, { $trunc.bv8.bv1(M[p]) }); - - DECLARE_UNSAFE_STORES - DECLARE(UNSAFE_STORE_OP, bv8, $store.bytes, {M[p := v]}); - DECLARE(UNSAFE_STORE_OP, bv1, $store.bytes, {M[p := $zext.bv1.bv8(v)]}); - - D("function {:inline} $load.ref(M: [ref] ref, p: ref) returns (ref) { M[p] }"); - D("function {:inline} $store.ref(M: [ref] ref, p: ref, v: ref) returns ([ref] ref) { M[p := v] }"); - -#if FLOAT_ENABLED - DECLARE(UNINTERPRETED_CONVERSION,bvhalf,bv16,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,bvfloat,bv32,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,bvdouble,bv64,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,bvlongdouble,bv80,$bitcast); - DECLARE(BUILTIN_CONVERSION,bv16,bvhalf,$bitcast,(_ to_fp 5 11)); - DECLARE(BUILTIN_CONVERSION,bv32,bvfloat,$bitcast,(_ to_fp 8 24)); - DECLARE(BUILTIN_CONVERSION,bv64,bvdouble,$bitcast,(_ to_fp 11 53)); - DECLARE(BUILTIN_CONVERSION,bv80,bvlongdouble,$bitcast,(_ to_fp 15 65)); - DECLARE(UNINTERPRETED_CONVERSION,bvhalf,i16,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,bvfloat,i32,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,bvdouble,i64,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,bvlongdouble,i80,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,i16,bvhalf,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,i32,bvfloat,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,i64,bvdouble,$bitcast); - DECLARE(UNINTERPRETED_CONVERSION,i80,bvlongdouble,$bitcast); - D("axiom (forall f: bvhalf :: $bitcast.bv16.bvhalf($bitcast.bvhalf.bv16(f)) == f);"); - D("axiom (forall f: bvfloat :: $bitcast.bv32.bvfloat($bitcast.bvfloat.bv32(f)) == f);"); - D("axiom (forall f: bvdouble :: $bitcast.bv64.bvdouble($bitcast.bvdouble.bv64(f)) == f);"); - D("axiom (forall f: bvlongdouble :: $bitcast.bv80.bvlongdouble($bitcast.bvlongdouble.bv80(f)) == f);"); - //D("axiom (forall b: bv16 :: b[15:10] == 31bv5 && b[10:0] != 0bv10 ==> $bitcast.bvhalf.bv16($bitcast.bv16.bvhalf(b)) == b);"); - //D("axiom (forall b: bv32 :: b[31:23] == 255bv8 && b[23:0] != 0bv23 ==> $bitcast.bvfloat.bv32($bitcast.bv32.bvfloat(b)) == b);"); - //D("axiom (forall b: bv64 :: b[63:52] == 2047bv11 && b[52:0] != 0bv52 ==> $bitcast.bvdouble.bv64($bitcast.bv64.bvdouble(b)) == b);"); - //D("axiom (forall b: bv80 :: b[79:64] == 32768bv15 && b[64:0] != 0bv64 ==> $bitcast.bvlongdouble.bv80($bitcast.bv80.bvlongdouble(b)) == b);"); - // TODO: add more constraints - - D("axiom (forall f: bvfloat, rm1: rmode, rm2: rmode :: dtf(rm1, ftd(rm2, f)) == f);"); - D("axiom (forall f: bvlongdouble, rm1: rmode, rm2: rmode :: dtl(rm1, ltd(rm2, f)) == f);"); - - D("axiom (forall f: bvhalf, i: i16 :: $bitcast.bvhalf.i16(f) == i <==> $bitcast.i16.bvhalf(i) == f);"); - D("axiom (forall f: bvfloat, i: i32 :: $bitcast.bvfloat.i32(f) == i <==> $bitcast.i32.bvfloat(i) == f);"); - D("axiom (forall f: bvdouble, i: i64 :: $bitcast.bvdouble.i64(f) == i <==> $bitcast.i64.bvdouble(i) == f);"); - D("axiom (forall f: bvlongdouble, i: i80 :: $bitcast.bvlongdouble.i80(f) == i <==> $bitcast.i80.bvlongdouble(i) == f);"); - - D("function {:inline} $load.bvhalf(M: [ref] bvhalf, p: ref) returns (bvhalf) { M[p] }"); - D("function {:inline} $store.bvhalf(M: [ref] bvhalf, p: ref, v: bvhalf) returns ([ref] bvhalf) { M[p := v] }"); - D("function {:inline} $load.bvfloat(M: [ref] bvfloat, p: ref) returns (bvfloat) { M[p] }"); - D("function {:inline} $store.bvfloat(M: [ref] bvfloat, p: ref, v: bvfloat) returns ([ref] bvfloat) { M[p := v] }"); - D("function {:inline} $load.bvdouble(M: [ref] bvdouble, p: ref) returns (bvdouble) { M[p] }"); - D("function {:inline} $store.bvdouble(M: [ref] bvdouble, p: ref, v: bvdouble) returns ([ref] bvdouble) { M[p := v] }"); - D("function {:inline} $load.bvlongdouble(M: [ref] bvlongdouble, p: ref) returns (bvlongdouble) { M[p] }"); - D("function {:inline} $store.bvlongdouble(M: [ref] bvlongdouble, p: ref, v: bvlongdouble) returns ([ref] bvlongdouble) { M[p := v] }"); - - D("function {:inline} $store.bytes.bvhalf(M:[ref]bv8, p:ref, v:bvhalf) returns ([ref]bv8) {" - "$store.bytes.bv16(M, p, $bitcast.bvhalf.bv16(v))}"); - D("function {:inline} $store.bytes.bvfloat(M:[ref]bv8, p:ref, v:bvfloat) returns ([ref]bv8) {" - "$store.bytes.bv32(M, p, $bitcast.bvfloat.bv32(v))}"); - D("function {:inline} $store.bytes.bvdouble(M:[ref]bv8, p:ref, v:bvdouble) returns ([ref]bv8) {" - "$store.bytes.bv64(M, p, $bitcast.bvdouble.bv64(v))}"); - D("function {:inline} $store.bytes.bvlongdouble(M:[ref]bv8, p:ref, v:bvlongdouble) returns ([ref]bv8) {" - "$store.bytes.bv80(M, p, $bitcast.bvlongdouble.bv80(v))}"); - D("function {:inline} $store.unsafe.bvhalf(M:[ref]i8, p:ref, v:bvhalf) returns ([ref]i8) {" - "$store.i16(M, p, $bitcast.bvhalf.i16(v))}"); - D("function {:inline} $store.unsafe.bvfloat(M:[ref]i8, p:ref, v:bvfloat) returns ([ref]i8) {" - "$store.i32(M, p, $bitcast.bvfloat.i32(v))}"); - D("function {:inline} $store.unsafe.bvdouble(M:[ref]i8, p:ref, v:bvdouble) returns ([ref]i8) {" - "$store.i64(M, p, $bitcast.bvdouble.i64(v))}"); - D("function {:inline} $store.unsafe.bvlongdouble(M:[ref]i8, p:ref, v:bvlongdouble) returns ([ref]i8) {" - "$store.i80(M, p, $bitcast.bvlongdouble.i80(v))}"); - - D("function {:inline} $load.bytes.bvhalf(M: [ref] bv8, p: ref) returns (bvhalf) {" - "$bitcast.bv16.bvhalf($load.bytes.bv16(M, p))}"); - D("function {:inline} $load.bytes.bvfloat(M: [ref] bv8, p: ref) returns (bvfloat) {" - "$bitcast.bv32.bvfloat($load.bytes.bv32(M, p))}"); - D("function {:inline} $load.bytes.bvdouble(M: [ref] bv8, p: ref) returns (bvdouble) {" - "$bitcast.bv64.bvdouble($load.bytes.bv64(M, p))}"); - D("function {:inline} $load.bytes.bvlongdouble(M: [ref] bv8, p: ref) returns (bvlongdouble) {" - "$bitcast.bv80.bvlongdouble($load.bytes.bv80(M, p))}"); - D("function {:inline} $load.unsafe.bvhalf(M: [ref] i8, p: ref) returns (bvhalf) {" - "$bitcast.i16.bvhalf($load.i16(M, p))}"); - D("function {:inline} $load.unsafe.bvfloat(M: [ref] i8, p: ref) returns (bvfloat) {" - "$bitcast.i32.bvfloat($load.i32(M, p))}"); - D("function {:inline} $load.unsafe.bvdouble(M: [ref] i8, p: ref) returns (bvdouble) {" - "$bitcast.i64.bvdouble($load.i64(M, p))}"); - D("function {:inline} $load.unsafe.bvlongdouble(M: [ref] i8, p: ref) returns (bvlongdouble) {" - "$bitcast.i80.bvlongdouble($load.i80(M, p))}"); - -#else - D("function {:inline} $load.float(M: [ref] float, p: ref) returns (float) { M[p] }"); - D("function {:inline} $load.unsafe.float(M: [ref] i8, p: ref) returns (float) { $bitcast.i8.float(M[p]) }"); - D("function {:inline} $store.float(M: [ref] float, p: ref, v: float) returns ([ref] float) { M[p := v] }"); - D("function {:inline} $store.unsafe.float(M: [ref] i8, p: ref, v: float) returns ([ref] i8) { M[p := $bitcast.float.i8(v)] }"); - D("function {:inline} $load.bytes.float(M: [ref] bv8, p: ref) returns (float) { $bitcast.bv8.float(M[p]) }"); - D("function {:inline} $store.bytes.float(M:[ref]bv8, p:ref, v:float) returns ([ref]bv8) {M[p := $bitcast.float.bv8(v)]}"); -#endif - // Memory debugging symbols D("type $mop;"); D("procedure boogie_si_record_mop(m: $mop);"); @@ -1236,7 +267,6 @@ void __SMACK_decls(void) { D("var $exn: bool;"); D("var $exnv: int;"); - D("function $extractvalue(p: int, i: int) returns (int);\n"); D("procedure $alloc(n: ref) returns (p: ref)\n" "{\n" @@ -1244,18 +274,21 @@ void __SMACK_decls(void) { "}\n"); #if MEMORY_SAFETY - __SMACK_dummy((int) __SMACK_check_memory_safety); + __SMACK_dummy((int)__SMACK_check_memory_safety); D("implementation __SMACK_check_memory_safety(p: ref, size: ref)\n" "{\n" " assert {:valid_deref} $Alloc[$base(p)];\n" " assert {:valid_deref} $sle.ref.bool($base(p), p);\n" - #if MEMORY_MODEL_NO_REUSE_IMPLS - " assert {:valid_deref} $sle.ref.bool($add.ref(p, size), $add.ref($base(p), $Size($base(p))));\n" - #elif MEMORY_MODEL_REUSE - " assert {:valid_deref} $sle.ref.bool($add.ref(p, size), $add.ref($base(p), $Size[$base(p)]));\n" - #else - " assert {:valid_deref} $sle.ref.bool($add.ref(p, size), $add.ref($base(p), $Size($base(p))));\n" - #endif +#if MEMORY_MODEL_NO_REUSE_IMPLS + " assert {:valid_deref} $sle.ref.bool($add.ref(p, size), " + "$add.ref($base(p), $Size($base(p))));\n" +#elif MEMORY_MODEL_REUSE + " assert {:valid_deref} $sle.ref.bool($add.ref(p, size), " + "$add.ref($base(p), $Size[$base(p)]));\n" +#else + " assert {:valid_deref} $sle.ref.bool($add.ref(p, size), " + "$add.ref($base(p), $Size($base(p))));\n" +#endif "}\n"); D("function $base(ref) returns (ref);"); @@ -1278,7 +311,9 @@ void __SMACK_decls(void) { D("procedure $galloc(base_addr: ref, size: ref)\n" "{\n" " assume $Size(base_addr) == size;\n" - " assume (forall addr: ref :: {$base(addr)} $sle.ref.bool(base_addr, addr) && $slt.ref.bool(addr, $add.ref(base_addr, size)) ==> $base(addr) == base_addr);\n" + " assume (forall addr: ref :: {$base(addr)} $sle.ref.bool(base_addr, " + "addr) && $slt.ref.bool(addr, $add.ref(base_addr, size)) ==> $base(addr) " + "== base_addr);\n" " $Alloc[base_addr] := true;\n" "}\n"); @@ -1290,9 +325,11 @@ void __SMACK_decls(void) { " p := $CurrAddr;\n" " havoc $CurrAddr;\n" " assume $sge.ref.bool($sub.ref($CurrAddr, n), p);\n" - " assume $sgt.ref.bool($CurrAddr, $0.ref) && $slt.ref.bool($CurrAddr, $MALLOC_TOP);\n" + " assume $sgt.ref.bool($CurrAddr, $0.ref) && $slt.ref.bool($CurrAddr, " + "$MALLOC_TOP);\n" " assume $Size(p) == n;\n" - " assume (forall q: ref :: {$base(q)} $sle.ref.bool(p, q) && $slt.ref.bool(q, $add.ref(p, n)) ==> $base(q) == p);\n" + " assume (forall q: ref :: {$base(q)} $sle.ref.bool(p, q) && " + "$slt.ref.bool(q, $add.ref(p, n)) ==> $base(q) == p);\n" " $Alloc[p] := true;\n" " } else {\n" " p := $0.ref;\n" @@ -1318,31 +355,43 @@ void __SMACK_decls(void) { D("procedure $galloc(base_addr: ref, size: ref);\n" "modifies $Alloc, $Size;\n" "ensures $Size[base_addr] == size;\n" - "ensures (forall addr: ref :: {$base(addr)} $sle.ref.bool(base_addr, addr) && $slt.ref.bool(addr, $add.ref(base_addr, size)) ==> $base(addr) == base_addr);\n" + "ensures (forall addr: ref :: {$base(addr)} $sle.ref.bool(base_addr, addr) " + "&& $slt.ref.bool(addr, $add.ref(base_addr, size)) ==> $base(addr) == " + "base_addr);\n" "ensures $Alloc[base_addr];\n" - "ensures (forall q: ref :: {$Size[q]} q != base_addr ==> $Size[q] == old($Size[q]));\n" - "ensures (forall q: ref :: {$Alloc[q]} q != base_addr ==> $Alloc[q] == old($Alloc[q]));\n"); + "ensures (forall q: ref :: {$Size[q]} q != base_addr ==> $Size[q] == " + "old($Size[q]));\n" + "ensures (forall q: ref :: {$Alloc[q]} q != base_addr ==> $Alloc[q] == " + "old($Alloc[q]));\n"); D("procedure {:inline 1} $$alloc(n: ref) returns (p: ref);\n" "modifies $Alloc, $Size;\n" "ensures $sle.ref.bool($0.ref, n);\n" - "ensures $slt.ref.bool($0.ref, n) ==> $slt.ref.bool($0.ref, p) && $slt.ref.bool(p, $sub.ref($MALLOC_TOP, n));\n" + "ensures $slt.ref.bool($0.ref, n) ==> $slt.ref.bool($0.ref, p) && " + "$slt.ref.bool(p, $sub.ref($MALLOC_TOP, n));\n" "ensures $eq.ref.bool(n, $0.ref) ==> p == $0.ref;\n" "ensures !old($Alloc[p]);\n" - "ensures (forall q: ref :: old($Alloc[q]) ==> ($slt.ref.bool($add.ref(p, n), q) || $slt.ref.bool($add.ref(q, $Size[q]), p)));\n" + "ensures (forall q: ref :: old($Alloc[q]) ==> ($slt.ref.bool($add.ref(p, " + "n), q) || $slt.ref.bool($add.ref(q, $Size[q]), p)));\n" "ensures $Alloc[p];\n" "ensures $Size[p] == n;\n" - "ensures (forall q: ref :: {$Size[q]} q != p ==> $Size[q] == old($Size[q]));\n" - "ensures (forall q: ref :: {$Alloc[q]} q != p ==> $Alloc[q] == old($Alloc[q]));\n" - "ensures (forall q: ref :: {$base(q)} $sle.ref.bool(p, q) && $slt.ref.bool(q, $add.ref(p, n)) ==> $base(q) == p);\n"); + "ensures (forall q: ref :: {$Size[q]} q != p ==> $Size[q] == " + "old($Size[q]));\n" + "ensures (forall q: ref :: {$Alloc[q]} q != p ==> $Alloc[q] == " + "old($Alloc[q]));\n" + "ensures (forall q: ref :: {$base(q)} $sle.ref.bool(p, q) && " + "$slt.ref.bool(q, $add.ref(p, n)) ==> $base(q) == p);\n"); D("procedure $free(p: ref);\n" "modifies $Alloc, $allocatedCounter;\n" - "requires $eq.ref.bool(p, $0.ref) || ($eq.ref.bool($base(p), p) && $Alloc[p]);\n" + "requires $eq.ref.bool(p, $0.ref) || ($eq.ref.bool($base(p), p) && " + "$Alloc[p]);\n" "requires $slt.ref.bool($0.ref, p);\n" "ensures $ne.ref.bool(p, $0.ref) ==> !$Alloc[p];\n" - "ensures $ne.ref.bool(p, $0.ref) ==> (forall q: ref :: {$Alloc[q]} q != p ==> $Alloc[q] == old($Alloc[q]));\n" - "ensures $ne.ref.bool(p, $0.ref) ==> $allocatedCounter == old($allocatedCounter) - 1;\n"); + "ensures $ne.ref.bool(p, $0.ref) ==> (forall q: ref :: {$Alloc[q]} q != p " + "==> $Alloc[q] == old($Alloc[q]));\n" + "ensures $ne.ref.bool(p, $0.ref) ==> $allocatedCounter == " + "old($allocatedCounter) - 1;\n"); #else // NO_REUSE does not reuse previously-allocated addresses D("var $Alloc: [ref] bool;"); @@ -1352,29 +401,41 @@ void __SMACK_decls(void) { D("procedure $galloc(base_addr: ref, size: ref);\n" "modifies $Alloc;\n" "ensures $Size(base_addr) == size;\n" - "ensures (forall addr: ref :: {$base(addr)} $sle.ref.bool(base_addr, addr) && $slt.ref.bool(addr, $add.ref(base_addr, size)) ==> $base(addr) == base_addr);\n" + "ensures (forall addr: ref :: {$base(addr)} $sle.ref.bool(base_addr, addr) " + "&& $slt.ref.bool(addr, $add.ref(base_addr, size)) ==> $base(addr) == " + "base_addr);\n" "ensures $Alloc[base_addr];\n" - "ensures (forall q: ref :: {$Alloc[q]} q != base_addr ==> $Alloc[q] == old($Alloc[q]));\n"); + "ensures (forall q: ref :: {$Alloc[q]} q != base_addr ==> $Alloc[q] == " + "old($Alloc[q]));\n"); D("procedure {:inline 1} $$alloc(n: ref) returns (p: ref);\n" "modifies $Alloc, $CurrAddr;\n" "ensures $sle.ref.bool($0.ref, n);\n" - "ensures $slt.ref.bool($0.ref, n) ==> $sge.ref.bool($sub.ref($CurrAddr, n), old($CurrAddr)) && p == old($CurrAddr);\n" - "ensures $sgt.ref.bool($CurrAddr, $0.ref) && $slt.ref.bool($CurrAddr, $MALLOC_TOP);\n" + "ensures $slt.ref.bool($0.ref, n) ==> $sge.ref.bool($sub.ref($CurrAddr, " + "n), old($CurrAddr)) && p == old($CurrAddr);\n" + "ensures $sgt.ref.bool($CurrAddr, $0.ref) && $slt.ref.bool($CurrAddr, " + "$MALLOC_TOP);\n" "ensures $slt.ref.bool($0.ref, n) ==> $Size(p) == n;\n" - "ensures $slt.ref.bool($0.ref, n) ==> (forall q: ref :: {$base(q)} $sle.ref.bool(p, q) && $slt.ref.bool(q, $add.ref(p, n)) ==> $base(q) == p);\n" + "ensures $slt.ref.bool($0.ref, n) ==> (forall q: ref :: {$base(q)} " + "$sle.ref.bool(p, q) && $slt.ref.bool(q, $add.ref(p, n)) ==> $base(q) == " + "p);\n" "ensures $slt.ref.bool($0.ref, n) ==> $Alloc[p];\n" - "ensures $eq.ref.bool(n, $0.ref) ==> old($CurrAddr) == $CurrAddr && p == $0.ref;\n" + "ensures $eq.ref.bool(n, $0.ref) ==> old($CurrAddr) == $CurrAddr && p == " + "$0.ref;\n" "ensures $eq.ref.bool(n, $0.ref)==> $Alloc[p] == old($Alloc)[p];\n" - "ensures (forall q: ref :: {$Alloc[q]} q != p ==> $Alloc[q] == old($Alloc[q]));\n"); + "ensures (forall q: ref :: {$Alloc[q]} q != p ==> $Alloc[q] == " + "old($Alloc[q]));\n"); D("procedure $free(p: ref);\n" "modifies $Alloc, $allocatedCounter;\n" - "requires $eq.ref.bool(p, $0.ref) || ($eq.ref.bool($base(p), p) && $Alloc[p]);\n" + "requires $eq.ref.bool(p, $0.ref) || ($eq.ref.bool($base(p), p) && " + "$Alloc[p]);\n" "requires $slt.ref.bool($0.ref, p);\n" "ensures $ne.ref.bool(p, $0.ref) ==> !$Alloc[p];\n" - "ensures $ne.ref.bool(p, $0.ref) ==> (forall q: ref :: {$Alloc[q]} q != p ==> $Alloc[q] == old($Alloc[q]));\n" - "ensures $ne.ref.bool(p, $0.ref) ==> $allocatedCounter == old($allocatedCounter) - 1;\n"); + "ensures $ne.ref.bool(p, $0.ref) ==> (forall q: ref :: {$Alloc[q]} q != p " + "==> $Alloc[q] == old($Alloc[q]));\n" + "ensures $ne.ref.bool(p, $0.ref) ==> $allocatedCounter == " + "old($allocatedCounter) - 1;\n"); #endif #else @@ -1394,7 +455,8 @@ void __SMACK_decls(void) { " p := $CurrAddr;\n" " havoc $CurrAddr;\n" " assume $sge.ref.bool($sub.ref($CurrAddr, n), p);\n" - " assume $sgt.ref.bool($CurrAddr, $0.ref) && $slt.ref.bool($CurrAddr, $MALLOC_TOP);\n" + " assume $sgt.ref.bool($CurrAddr, $0.ref) && $slt.ref.bool($CurrAddr, " + "$MALLOC_TOP);\n" " } else {\n" " p := $0.ref;\n" " }\n" @@ -1409,19 +471,24 @@ void __SMACK_decls(void) { D("procedure {:inline 1} $$alloc(n: ref) returns (p: ref);\n" "modifies $Alloc, $Size;\n" "ensures $sle.ref.bool($0.ref, n);\n" - "ensures $slt.ref.bool($0.ref, n) ==> $slt.ref.bool($0.ref, p) && $slt.ref.bool(p, $sub.ref($MALLOC_TOP, n));\n" + "ensures $slt.ref.bool($0.ref, n) ==> $slt.ref.bool($0.ref, p) && " + "$slt.ref.bool(p, $sub.ref($MALLOC_TOP, n));\n" "ensures $eq.ref.bool(n, $0.ref) ==> p == $0.ref;\n" "ensures !old($Alloc[p]);\n" - "ensures (forall q: ref :: old($Alloc[q]) ==> ($slt.ref.bool($add.ref(p, n), q) || $slt.ref.bool($add.ref(q, $Size[q]), p)));\n" + "ensures (forall q: ref :: old($Alloc[q]) ==> ($slt.ref.bool($add.ref(p, " + "n), q) || $slt.ref.bool($add.ref(q, $Size[q]), p)));\n" "ensures $Alloc[p];\n" "ensures $Size[p] == n;\n" - "ensures (forall q: ref :: {$Size[q]} q != p ==> $Size[q] == old($Size[q]));\n" - "ensures (forall q: ref :: {$Alloc[q]} q != p ==> $Alloc[q] == old($Alloc[q]));\n"); + "ensures (forall q: ref :: {$Size[q]} q != p ==> $Size[q] == " + "old($Size[q]));\n" + "ensures (forall q: ref :: {$Alloc[q]} q != p ==> $Alloc[q] == " + "old($Alloc[q]));\n"); D("procedure $free(p: ref);\n" "modifies $Alloc;\n" "ensures !$Alloc[p];\n" - "ensures (forall q: ref :: {$Alloc[q]} q != p ==> $Alloc[q] == old($Alloc[q]));\n"); + "ensures (forall q: ref :: {$Alloc[q]} q != p ==> $Alloc[q] == " + "old($Alloc[q]));\n"); #else // NO_REUSE does not reuse previously-allocated addresses D("var $CurrAddr:ref;\n"); @@ -1429,9 +496,12 @@ void __SMACK_decls(void) { D("procedure {:inline 1} $$alloc(n: ref) returns (p: ref);\n" "modifies $CurrAddr;\n" "ensures $sle.ref.bool($0.ref, n);\n" - "ensures $slt.ref.bool($0.ref, n) ==> $sge.ref.bool($sub.ref($CurrAddr, n), old($CurrAddr)) && p == old($CurrAddr);\n" - "ensures $sgt.ref.bool($CurrAddr, $0.ref) && $slt.ref.bool($CurrAddr, $MALLOC_TOP);\n" - "ensures $eq.ref.bool(n, $0.ref) ==> old($CurrAddr) == $CurrAddr && p == $0.ref;\n"); + "ensures $slt.ref.bool($0.ref, n) ==> $sge.ref.bool($sub.ref($CurrAddr, " + "n), old($CurrAddr)) && p == old($CurrAddr);\n" + "ensures $sgt.ref.bool($CurrAddr, $0.ref) && $slt.ref.bool($CurrAddr, " + "$MALLOC_TOP);\n" + "ensures $eq.ref.bool(n, $0.ref) ==> old($CurrAddr) == $CurrAddr && p == " + "$0.ref;\n"); D("procedure $free(p: ref);\n"); #endif diff --git a/share/smack/lib/smack.cpp b/share/smack/lib/smack.cpp index b6db06b49..53d6e76d5 100644 --- a/share/smack/lib/smack.cpp +++ b/share/smack/lib/smack.cpp @@ -2,12 +2,8 @@ #include extern void *malloc(size_t size); -extern void free(void * p); +extern void free(void *p); -void *operator new(size_t size) throw(std::bad_alloc) { - return malloc(size); -} +void *operator new(size_t size) throw(std::bad_alloc) { return malloc(size); } -void operator delete(void * p) throw() { - free(p); -} +void operator delete(void *p) throw() { free(p); } diff --git a/share/smack/lib/smack.rs b/share/smack/lib/smack.rs index 11ee5cc03..0b3a86b19 100644 --- a/share/smack/lib/smack.rs +++ b/share/smack/lib/smack.rs @@ -97,6 +97,7 @@ make_nondet!(usize, __VERIFIER_nondet_unsigned_long_long); #[cfg(not(verifier = "smack"))] +#[cfg(feature = "std")] #[allow(dead_code)] use std::Vec; /* Vector class. diff --git a/share/smack/lib/stdlib.c b/share/smack/lib/stdlib.c index 7f0eaf7d1..76f8be73a 100644 --- a/share/smack/lib/stdlib.c +++ b/share/smack/lib/stdlib.c @@ -1,20 +1,21 @@ // // This file is distributed under the MIT License. See LICENSE for details. // +#include #include #include -#include void exit(int x) { #if MEMORY_SAFETY __SMACK_code("assert $allocatedCounter == 0;"); #endif __SMACK_code("assume false;"); - while(1); + while (1) + ; } -void* calloc(size_t num, size_t size) { - void* ret; +void *calloc(size_t num, size_t size) { + void *ret; if (__VERIFIER_nondet_int()) { ret = 0; } else { @@ -79,4 +80,3 @@ char *getenv(const char *name) { return env_value_str; } } - diff --git a/share/smack/lib/string.c b/share/smack/lib/string.c index 158f23bc5..8530aa86f 100644 --- a/share/smack/lib/string.c +++ b/share/smack/lib/string.c @@ -1,13 +1,14 @@ // // This file is distributed under the MIT License. See LICENSE for details. // -#include -#include #include +#include +#include char *strcpy(char *dest, const char *src) { char *save = dest; - while ((*dest++ = *src++)); + while ((*dest++ = *src++)) + ; return save; } @@ -16,7 +17,7 @@ char *strncpy(char *dest, const char *src, size_t n) { for (i = 0; i < n && src[i] != '\0'; i++) dest[i] = src[i]; - for ( ; i < n; i++) + for (; i < n; i++) dest[i] = '\0'; return dest; @@ -24,7 +25,8 @@ char *strncpy(char *dest, const char *src, size_t n) { size_t strlen(const char *str) { size_t count = 0; - while (str[count]) count++; + while (str[count]) + count++; return count; } @@ -42,10 +44,10 @@ int strncmp(const char *s1, const char *s2, size_t n) { while (n--) { if (*s1 != *s2) return *s1 - *s2; - s1++; + s1++; s2++; } - + return 0; } @@ -56,7 +58,8 @@ char *strcat(char *dest, const char *src) { while (*dest) dest++; - while ((*dest++ = *src++)) ; + while ((*dest++ = *src++)) + ; return retDest; } @@ -66,9 +69,9 @@ char *strncat(char *dest, const char *src, size_t n) { while (*dest) dest++; - while (n--) + while (n--) *dest++ = *src++; - *dest = '\0'; + *dest = '\0'; return retDest; } @@ -102,8 +105,10 @@ size_t strspn(const char *s1, const char *s2) { size_t n; const char *p; for (n = 0; *s1; s1++, n++) { - for (p = s2; *p && *p != *s1; p++); - if (!*p) break; + for (p = s2; *p && *p != *s1; p++) + ; + if (!*p) + break; } return n; } @@ -112,8 +117,10 @@ size_t strcspn(const char *s1, const char *s2) { size_t n; const char *p; for (n = 0; *s1; s1++, n++) { - for (p = s2; *p && *p != *s1; p++); - if (*p) break; + for (p = s2; *p && *p != *s1; p++) + ; + if (*p) + break; } return n; } @@ -129,7 +136,8 @@ char *strpbrk(const char *s1, const char *s2) { char *strstr(const char *haystack, const char *needle) { for (; *haystack; haystack++) { const char *h, *n; - for (h = haystack, n = needle; *h && *n && (*h == *n); h++, n++); + for (h = haystack, n = needle; *h && *n && (*h == *n); h++, n++) + ; if (*n == '\0') return (char *)haystack; } @@ -137,7 +145,6 @@ char *strstr(const char *haystack, const char *needle) { } static char *olds; - char *strtok(char *str, const char *delim) { if (!str) str = olds; @@ -147,13 +154,13 @@ char *strtok(char *str, const char *delim) { return 0; // skip first delims - str += strspn(str,delim); + str += strspn(str, delim); if (*str == '\0') return 0; char *tok = str; // find end of token - str = strpbrk(str,delim); + str = strpbrk(str, delim); if (!str) // this token finishes the string olds = 0; else { @@ -169,4 +176,3 @@ char *strerror(int errnum) { error_str[1] = __VERIFIER_nondet_char(); return error_str; } - diff --git a/share/smack/prelude.py b/share/smack/prelude.py deleted file mode 100644 index 8d37529dd..000000000 --- a/share/smack/prelude.py +++ /dev/null @@ -1,329 +0,0 @@ -import itertools - -class Attribute: - def __init__(self, name, arguments = []): - self.name = name - self.arguments = arguments - - def __str__(self): - attribute_str = [] - attribute_str += '{:' + self.name - for i, argument in enumerate(self.arguments): - attribute_str += ' ' + str(argument) - if i < len(self.arguments) - 1: - attribute_str += ',' - attribute_str += '}' - return ''.join(attribute_str) - -class Argument: - def __init__(self, name, type): - self.name = name - self.type = type - - def __str__(self): - return self.name + ': ' + self.type - -class Expr: - def __init__(self, op): - self.op = op - - def __str__(self): - return 'i1 ' + self.op + ' i2' - -class Function: - def __init__(self, name, attributes = [], arguments = [], return_type = None, body = None): - self.name = name - self.attributes = attributes - self.arguments = arguments - self.return_type = return_type - self.body = body - - def __str__(self): - function_str = [] - function_str += 'function' - for attribute in self.attributes: - function_str += ' ' + str(attribute) - function_str += ' ' + self.name + '(' - for i, argument in enumerate(self.arguments): - function_str += str(argument) - if i < len(self.arguments) - 1: - function_str += ', ' - function_str += ')' - if self.return_type is not None: - function_str += ' returns (' + self.return_type + ')' - if self.body is not None: - function_str += ' {'+ self.body + '}' - else: - function_str += ';' - function_str += '\n' - return ''.join(function_str) - -def int(width): - return 'i' + str(width) - -def bv(width): - return 'bv' + str(width) - -def mk_args(type, num): - return [Argument('i' + str(i + 1), type) for i in range(num)] - -def uninterpreted_unary_op(width, name): - type = int(width) - return Function( - name = name + '.' + type, - arguments = mk_args(type, 1), - return_type = type, - ) - -def uninterpreted_binary_op(width, name): - type = int(width) - return Function( - name = name + '.' + type, - arguments = mk_args(type, 2), - return_type = type - ) - -def inline_binary_op(width, name, body): - type = int(width) - return Function( - name = name + '.' + type, - attributes = [Attribute('inline')], - arguments = mk_args(type, 2), - return_type = type, - body = body - ) - -def builtin_binary_op(width, builtin_name, name): - type = int(width) - return Function( - name = name + '.' + type, - attributes = [Attribute('builtin', arguments = [builtin_name])], - arguments = mk_args(type, 2), - return_type = type - ) - -def bvbuiltin_unary_op(width, builtin_name, name): - type = bv(width) - return Function( - name = name + '.' + type, - attributes = [Attribute('bvbuiltin', arguments = [builtin_name])], - arguments = mk_args(type, 1), - return_type = type - ) - -def bvbuiltin_binary_op(width, builtin_name, name): - type = bv(width) - return Function( - name = name + '.' + type, - attributes = [Attribute('bvbuiltin', arguments = [builtin_name])], - arguments = mk_args(type, 2), - return_type = type - ) - -def inline_binary_comp(width, name, body): - type = int(width) - return Function( - name = name + '.' + type + '.bool', - attributes = [Attribute('inline')], - arguments = mk_args(type, 2), - return_type = 'bool', - body = body - ) - -def inline_binary_bv_comp(width, name, body): - type = bv(width) - return Function( - name = name + '.' + type + '.bool', - attributes = [Attribute('inline')], - arguments = mk_args(type, 2), - return_type = 'bool', - body = body - ) - -def bvbuiltin_binary_comp(width, builtin_name, name): - type = bv(width) - return Function( - name = name + '.' + type + '.bool', - attributes = [Attribute('bvbuiltin', arguments = [builtin_name])], - arguments = mk_args(type, 2), - return_type = 'bool' - ) - -def inline_binary_pred(width, name): - type = int(width) - return Function( - name = name + '.' + type, - attributes = [Attribute('inline')], - arguments = mk_args(type, 2), - return_type = 'i1', - body = 'if ' + name + '.' + type + '.bool(i1, i2) then 1 else 0' - ) - -def inline_binary_bv_pred(width, name): - type = bv(width) - return Function( - name = name + '.' + type, - attributes = [Attribute('inline')], - arguments = mk_args(type, 2), - return_type = 'bv1', - body = 'if ' + name + '.' + type + '.bool(i1, i2) then 1bv1 else 0bv1' - ) - -def safe_load_op(width, body): - type = int(width) - return Function( - name = '$load.' + type, - attributes = [Attribute('inline')], - arguments = [Argument('M', '[ref] ' + type), Argument('p', 'ref')], - return_type = type, - body = body - ) - -def safe_store_op(width, body): - type = int(width) - return Function( - name = '$store.' + type, - attributes = [Attribute('inline')], - arguments = [Argument('M', '[ref] ' + type), Argument('p', 'ref'), Argument('v', type)], - return_type = '[ref] ' + type, - body = body - ) - -def safe_load_bv_op(width, body): - type = bv(width) - return Function( - name = '$load.' + type, - attributes = [Attribute('inline')], - arguments = [Argument('M', '[ref] ' + type), Argument('p', 'ref')], - return_type = type, - body = body - ) - -def safe_store_bv_op(width, body): - type = bv(width) - return Function( - name = '$store.' + type, - attributes = [Attribute('inline')], - arguments = [Argument('M', '[ref] ' + type), Argument('p', 'ref'), Argument('v', type)], - return_type = '[ref] ' + type, - body = body - ) - -def inline_bvbuiltin_binary_select(width, name, name_2): - type = bv(width) - return Function( - name = name + '.' + type, - attributes = [Attribute('inline')], - arguments = mk_args(type, 2), - return_type = type, - body = 'if ' + name_2 + '.' + type + '.bool(i1, i2) then i1 else i2' - ) - -def inline_bvbuiltin_binary_pred(width, name): - type = bv(width) - return Function( - name = name + '.' + type, - attributes = [Attribute('inline')], - arguments = mk_args(type, 2), - return_type = 'bv1', - body = 'if ' + name + '.' + type + '.bool(i1, i2) then 1bv1 else 0bv1' - ) - -def inline_conversion(width, width_2, name, body): - type = int(width) - type_2 = int(width_2) - return Function( - name = name + '.' + type + '.' + type_2, - attributes = [Attribute('inline')], - arguments = mk_args(type, 1), - return_type = type_2, - body = body - ) - -def trunc_op(width, width_2): - type = int(width) - type_2 = int(width_2) - return Function( - name = '$trunc.' + type + '.' + type_2, - attributes = [Attribute('inline')], - arguments = mk_args(type, 1), - return_type = type_2, - body = 'i1' - ) - -def trunc_bv_op(width, width_2): - type = bv(width) - type_2 = bv(width_2) - return Function( - name = '$trunc.' + type + '.' + type_2, - attributes = [Attribute('inline')], - arguments = mk_args(type, 1), - return_type = type_2, - body = 'i1[' + str(width_2) + ':0]' - ) - -sizes = [1, 8, 16, 24, 32, 40, 48, 56, 64, 80, 88, 96, 128] - -binary_ops = ['add', 'sub', 'mul', 'sdiv', 'smod', 'srem', 'udiv', 'urem', 'shl', 'lshr', 'ashr', 'and', 'or', 'xor', 'nand'] -comp_ops = ['ule', 'ult', 'uge', 'ugt', 'sle', 'slt', 'sge', 'sgt'] -eq_ops = ['eq', 'ne'] - -binary_ops_body = ['+', '-', '*'] -comp_ops_body = ['<=', '<', '>=', '>', '<=', '<', '>=', '>'] -eq_ops_body = ['==', '!='] - -def get_prelude(): - bpl = [] - - for size in sizes: - for i, op in enumerate(binary_ops): - bpl.append(bvbuiltin_binary_op(width = size, builtin_name = '\"bv' + op + '\"', name = '$' + op)) - if 0 <= i <= 2: - bpl.append(inline_binary_op(width = size, name = '$' + op, body = str(Expr(binary_ops_body[i])))) - elif 3 <= i <= 7: - bpl.append(builtin_binary_op(width = size, builtin_name = '\"' + op[1:] + '\"', name = '$' + op)) - else: - bpl.append(uninterpreted_binary_op(width = size, name = '$' + op)) - - for i, op in enumerate(comp_ops): - bpl.append(bvbuiltin_binary_comp(width = size, builtin_name = '\"bv' + op + '\"', name = '$' + op)) - bpl.append(inline_bvbuiltin_binary_pred(width = size, name = '$' + op)) - bpl.append(inline_binary_comp(width = size, name = '$' + op, body = str(Expr(comp_ops_body[i])))) - bpl.append(inline_binary_pred(width = size, name = '$' + op)) - - for i, op in enumerate(eq_ops): - bpl.append(inline_binary_bv_comp(width = size, name = '$' + op, body = str(Expr(eq_ops_body[i])))) - bpl.append(inline_binary_bv_pred(width = size, name = '$' + op)) - bpl.append(inline_binary_comp(width = size, name = '$' + op, body = str(Expr(eq_ops_body[i])))) - bpl.append(inline_binary_pred(width = size, name = '$' + op)) - - bpl.append(inline_bvbuiltin_binary_select(width = size, name = '$min', name_2 = '$slt')) - bpl.append(inline_bvbuiltin_binary_select(width = size, name = '$max', name_2 = '$sgt')) - bpl.append(inline_bvbuiltin_binary_select(width = size, name = '$umin', name_2 = '$ult')) - bpl.append(inline_bvbuiltin_binary_select(width = size, name = '$umax', name_2 = '$ugt')) - - bpl.append(inline_binary_op(width = size, name = '$smin', body = '$min(i1,i2)')) - bpl.append(inline_binary_op(width = size, name = '$smax', body = '$max(i1,i2)')) - bpl.append(inline_binary_op(width = size, name = '$umin', body = '$min(i1,i2)')) - bpl.append(inline_binary_op(width = size, name = '$umax', body = '$max(i1,i2)')) - - bpl.append(bvbuiltin_unary_op(width = size, builtin_name = '\"bvnot\"', name = '$not')) - bpl.append(uninterpreted_unary_op(width = size, name = '$not')) - - bpl.append(safe_load_op(width = size, body = 'M[p]')) - bpl.append(safe_load_bv_op(width = size, body = 'M[p]')) - bpl.append(safe_store_op(width = size, body = 'M[p := v]')) - bpl.append(safe_store_bv_op(width = size, body = 'M[p := v]')) - - for size_pair in itertools.combinations(sizes, 2): - bpl.append(trunc_bv_op(width = size_pair[1], width_2 = size_pair[0])) - bpl.append(trunc_op(width = size_pair[1], width_2 = size_pair[0])) - - bpl.append(inline_conversion(width = size_pair[0], width_2 = size_pair[1], name = '$zext', body = 'i1')) - bpl.append(inline_conversion(width = size_pair[0], width_2 = size_pair[1], name = '$sext', body = 'i1')) - - return ''.join([str(x) for x in bpl]) - -def append_prelude(args): - f = open(args.bpl_file, 'a+') - f.write(get_prelude()) diff --git a/share/smack/reach.py b/share/smack/reach.py index 05482047a..cfeaf692b 100755 --- a/share/smack/reach.py +++ b/share/smack/reach.py @@ -11,7 +11,7 @@ from smackgen import * from smackverify import * -VERSION = '1.9.3' +VERSION = '2.0.0' def reachParser(): parser = argparse.ArgumentParser(add_help=False, parents=[verifyParser()]) diff --git a/share/smack/svcomp/utils.py b/share/smack/svcomp/utils.py index 03cf2a155..2c69c5180 100644 --- a/share/smack/svcomp/utils.py +++ b/share/smack/svcomp/utils.py @@ -54,7 +54,6 @@ def svcomp_frontend(input_file, args): args.clang_options += " -DSVCOMP" args.clang_options += " -DAVOID_NAME_CONFLICTS" args.clang_options += " -DCUSTOM_VERIFIER_ASSERT" - args.clang_options += " -DNO_FORALL" args.clang_options += " -DDISABLE_PTHREAD_ASSERTS" args.clang_options += " -include smack.h" diff --git a/share/smack/top.py b/share/smack/top.py index 891fd5654..b51b5fc59 100755 --- a/share/smack/top.py +++ b/share/smack/top.py @@ -12,10 +12,9 @@ from svcomp.utils import verify_bpl_svcomp from utils import temporary_file, try_command, remove_temp_files from replay import replay_error_trace -from prelude import append_prelude from frontend import link_bc_files, frontends, languages, extra_libs -VERSION = '1.9.3' +VERSION = '2.0.0' def results(args): """A dictionary of the result output messages.""" @@ -111,6 +110,13 @@ def arguments(): noise_group.add_argument('--debug-only', metavar='MODULES', default=None, type=str, help='limit debugging output to given MODULES') + noise_group.add_argument('--warn', default="unsound", + choices=['silent', 'unsound', 'info'], + help='''enable certain type of warning messages + (silent: no warning messages; + unsound: warnings about unsoundness; + info: warnings about unsoundness and translation information) [default: %(default)s]''') + parser.add_argument('-t', '--no-verify', action="store_true", default=False, help='perform only translation, without verification.') @@ -161,13 +167,13 @@ def arguments(): help='enable support for pthread programs') translate_group.add_argument('--bit-precise', action="store_true", default=False, - help='enable bit precision for non-pointer values') + help='model non-pointer values as bit vectors') translate_group.add_argument('--timing-annotations', action="store_true", default=False, help='enable timing annotations') translate_group.add_argument('--bit-precise-pointers', action="store_true", default=False, - help='enable bit precision for pointer values') + help='model pointers and non-pointer values as bit vectors') translate_group.add_argument('--no-byte-access-inference', action="store_true", default=False, help='disable bit-precision-related optimizations with DSA') @@ -198,7 +204,7 @@ def arguments(): verifier_group = parser.add_argument_group('verifier options') verifier_group.add_argument('--verifier', - choices=['boogie', 'corral', 'symbooglix', 'duality', 'svcomp'], default='corral', + choices=['boogie', 'corral', 'symbooglix', 'svcomp'], default='corral', help='back-end verification engine') verifier_group.add_argument('--unroll', metavar='N', default='1', @@ -254,6 +260,9 @@ def arguments(): if args.only_check_valid_deref or args.only_check_valid_free or args.only_check_memleak: args.memory_safety = True + if args.bit_precise_pointers: + args.bit_precise = True + # TODO are we (still) using this? # with open(args.input_file, 'r') as f: # for line in f.readlines(): @@ -320,7 +329,8 @@ def llvm_to_bpl(args): """Translate the LLVM bitcode file to a Boogie source file.""" cmd = ['llvm2bpl', args.linked_bc_file, '-bpl', args.bpl_file] - cmd += ['-warnings'] + cmd += ['-warn-type', args.warn] + if sys.stdout.isatty(): cmd += ['-colored-warnings'] cmd += ['-source-loc-syms'] for ep in args.entry_points: cmd += ['-entry-points', ep] @@ -339,7 +349,6 @@ def llvm_to_bpl(args): if args.float: cmd += ['-float'] if args.modular: cmd += ['-modular'] try_command(cmd, console=True) - append_prelude(args) annotate_bpl(args) property_selection(args) transform_bpl(args) @@ -349,7 +358,7 @@ def procedure_annotation(name, args): return "{:entrypoint}" elif args.modular and re.match("|".join(inlined_procedures()).replace("$","\$"), name): return "{:inline 1}" - elif (not args.modular) and (args.verifier == 'boogie' or args.float): + elif (not args.modular) and args.verifier == 'boogie': return ("{:inline %s}" % args.unroll) else: return "" @@ -470,12 +479,6 @@ def verify_bpl(args): command += ["--timeout=%d" % args.time_limit] command += ["--max-loop-depth=%d" % args.unroll] - else: - # Duality! - command = ["corral", args.bpl_file] - command += ["/tryCTrace", "/noTraceOnDisk", "/useDuality", "/oldStratifiedInlining"] - command += ["/recursionBound:1073741824", "/k:1"] - if (args.bit_precise or args.float) and args.verifier != 'symbooglix': x = "bopt:" if args.verifier != 'boogie' else "" command += ["/%sproverOpt:OPTIMIZE_FOR_BV=true" % x] @@ -525,10 +528,50 @@ def error_step(step): if src: return "%s%s(%s,%s): %s" % (step.group(1), src.group(1), src.group(2), src.group(3), message) else: - return step.group(0) + return corral_error_step(step.group(0)) else: return None +def reformat_assignment(line): + def repl(m): + val = m.group(1) + if 'bv' in val: + return m.group(2)+'UL' + else: + sig_size = int(m.group(7)) + exp_size = int(m.group(8)) + # assume we can only handle double + if sig_size > 53 or exp_size > 11: + return m.group() + + sign_val = -1 if m.group(3) != '' else 1 + sig_val = m.group(4) + exp_sign_val = -1 if m.group(5) != '' else 1 + # note that the exponent base is 16 + exp_val = 2**(4*exp_sign_val*int(m.group(6))) + return str(sign_val*float.fromhex(sig_val)*exp_val) + + # Boogie FP const grammar: (-)0x[sig]e[exp]f[sigSize]e[expSize], where + # sig = hexdigit {hexdigit} '.' hexdigit {hexdigit} + # exp = digit {digit} + # sigSize = digit {digit} + # expSize = digit {digit} + return re.sub('((\d+)bv\d+|(-?)0x([0-9a-fA-F]+\.[0-9a-fA-F]+)e(-?)(\d+)f(\d+)e(\d+))', repl, line.strip()) + +def transform(info): + return ','.join(map(reformat_assignment, filter( + lambda x: not re.search('((CALL|RETURN from)\s+(\$|__SMACK))|Done|ASSERTION', x), info.split(',')))) + +def corral_error_step(step): + m = re.match('([^\s]*)\s+Trace:\s+(Thread=\d+)\s+\((.*)[\)|;]', step) + if m: + path = m.group(1) + tid = m.group(2) + info = transform(m.group(3)) + return '{0}\t{1} {2}'.format(path,tid,info) + else: + return step + def error_trace(verifier_output, args): trace = "" for line in verifier_output.splitlines(True): diff --git a/svcomp/bench/README.md b/svcomp/bench/README.md deleted file mode 100644 index 362baa0a7..000000000 --- a/svcomp/bench/README.md +++ /dev/null @@ -1,2 +0,0 @@ -#SMACKBench -These scripts serve two purposes. The first is to document how the SMACK benchmarking framework is set up to provide preliminary evaluation of SMACK for SVCOMP. The second is to provide a method for automatically deploying this framework. Note that from year to year, these scripts will need to be updated to reflect any changes in dependencies. \ No newline at end of file diff --git a/svcomp/bench/apache_config_examples/000-defaultSMACKBench.conf b/svcomp/bench/apache_config_examples/000-defaultSMACKBench.conf deleted file mode 100644 index 8f5a1d31f..000000000 --- a/svcomp/bench/apache_config_examples/000-defaultSMACKBench.conf +++ /dev/null @@ -1,51 +0,0 @@ -# This example conf file for a SVCOMP results website was made for apache2 on -# Ubuntu, which was installed with apt-get. There were no other websites -# configured on the machine where this was created, so this VirtualHost directive -# is the default site on the server. - -# If using on Ubuntu with apache2 installed using apt-get, simply put this file -# in /etc/apache2/sites-available/, run `sudo a2ensite 000-default1`, and finally -# restart apache with `service apache2 restart` - -# This site definition assumes that apache2 is already properly configured - - - ServerAdmin webmaster@localhost - # Update this path to point to the data folder in your SMACKBench install - # directory - DocumentRoot /home/montgomc/projects/SMACKTune/bench/install/data - - # Update this path to point to the data folder in your SMACKBench install - # directory - - Options Indexes FollowSymLinks ExecCGI - AddHandler cgi-script .py - AllowOverride None - Require all granted - DirectoryIndex index.py - # This causes these files to be downloaded, vs displaying - # directly in browser - - Header set Content-Disposition attachment - ForceType application/octet-stream - - - - # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, - # error, crit, alert, emerg. - # It is also possible to configure the loglevel for particular - # modules, e.g. - #LogLevel info ssl:warn - - ErrorLog ${APACHE_LOG_DIR}/error.log - CustomLog ${APACHE_LOG_DIR}/access.log combined - - # For most configuration files from conf-available/, which are - # enabled or disabled at a global level, it is possible to - # include a line for only one particular virtual host. For example the - # following line enables the CGI configuration for this host only - # after it has been globally disabled with "a2disconf". - #Include conf-available/serve-cgi-bin.conf - - -# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/svcomp/bench/apache_config_examples/README.md b/svcomp/bench/apache_config_examples/README.md deleted file mode 100644 index 07a6eae69..000000000 --- a/svcomp/bench/apache_config_examples/README.md +++ /dev/null @@ -1,7 +0,0 @@ -#Apache configuration - -## As default apache site -See comments in 000-defaultSMACKBench.conf - -## As virtual directory for existing site -See comments in SMACKBench_virtualDirectory.conf \ No newline at end of file diff --git a/svcomp/bench/apache_config_examples/SMACKBench_virtualDirectory.conf b/svcomp/bench/apache_config_examples/SMACKBench_virtualDirectory.conf deleted file mode 100644 index fe9e15683..000000000 --- a/svcomp/bench/apache_config_examples/SMACKBench_virtualDirectory.conf +++ /dev/null @@ -1,32 +0,0 @@ -# This conf file is for setting up a virtual directory in an existing virtual -# host or main site for non-virtual host setups. - -# This file can either be included by the conf file defining the site to which -# this virtual directory can be added -# (add the directive `Include SMACKBench_virtualDirectory.conf` to the site's -# conf file). - -# Alternatively, the directives below can be copy/pasted to the site's conf file - - -# Update this path to point to the data folder in your SMACKBench install -# directory -Alias /SMACKBench /home/shaobo/SMACKTune/bench/install/data - -# Update this path to point to the data folder in your SMACKBench install -# directory - - Options Indexes FollowSymLinks ExecCGI - AddHandler cgi-script .py - AllowOverride None - Require all granted - DirectoryIndex index.py - # This causes these files to be downloaded, vs displaying - # directly in browser - - Header set Content-Disposition attachment - ForceType application/octet-stream - - - -# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/svcomp/bench/setupSMACKBench.sh b/svcomp/bench/setupSMACKBench.sh deleted file mode 100755 index c57d528a3..000000000 --- a/svcomp/bench/setupSMACKBench.sh +++ /dev/null @@ -1,171 +0,0 @@ -#!/bin/bash - -# MAJOR SYSTEM CHANGES: -# -Installs cgroups, modifies grub, requires restart -# -Installs java7, and sets this to be primary java executable -# -Installs ant - -#Default directory is /SMACKBench -INSTALLDIR=../../../SMACKBench -SRCDIR=`pwd` - -#Gets rid of installation -if [[ $1 == "clean" ]] - then - #Check for alternate install dir to clean - if [[ ! -z $2 ]] - then - #Strip trailing slash, if any - INSTALLDIR=${2%/} - fi - rm ${INSTALLDIR} -rf - echo SMACKBench Install Removed - echo - exit -fi - -#Gets rid of everything except sv-benchmarks, since they're big -if [[ $1 == "tidy" ]] - then - #Check for alternate install dir to tidy - if [[ ! -z $2 ]] - then - #Strip trailing slash, if any - INSTALLDIR=${2%/} - fi - rm ${INSTALLDIR}/benchexec/ -rf - rm ${INSTALLDIR}/data/*.py -f - rm ${INSTALLDIR}/data/__pycache__/ -rf - rm ${INSTALLDIR}/inputXMLFiles/ -rf - rm ${INSTALLDIR}/runSMACKBench.sh -f - rm ${INSTALLDIR}/cpachecker/ -rf - echo "SMACKBench Install Removed (except for svcomp benchmarks)" - echo - exit -fi - -#Copies things over again -if [[ $1 == "refresh" ]] - then - #Check for alternate install dir to refresh - if [[ ! -z $2 ]] - then - #Strip trailing slash, if any - INSTALLDIR=${2%/} - fi - cp src/* ${INSTALLDIR} -r - echo SMACKBench Installation Refreshed - echo - exit -fi - -#Compares overlay files with those in target install dir -if [[ $1 == "compare" ]] - then - #Check for alternate install dir to compare - if [[ ! -z $2 ]] - then - #Strip trailing slash, if any - INSTALLDIR=${2%/} - fi - for f in $(cd src; find . -type f; cd ..) - do - echo - echo - echo ---------------------- - echo $f - echo ---------------------- - diff ./src/${f:2} ${INSTALLDIR}/${f:2} -s - done - exit -fi - - -#Set install dir if first argument is not empty string -# (or "clean" or "tidy" or "refresh") -if [[ ! -z $1 ]] -then - #Strip trailing slash, if any - INSTALLDIR=${1%/} -fi - - -########################## -# Setup cgroups -########################## -#In ubuntu 14+, this cgroup-bin seems to properly mount the various -# copies of cgroup for each category. -#sudo apt-get update -#sudo apt-get install cgroup-bin -y -#And then restart -#However, for BenchExec's actual documentation, it says to do the following: -#sudo mount -t cgroup cgroup /sys/fs/cgroup -#sudo chmod o+wt,g+w /sys/fs/cgroup/ -#Also, must add "swapaccount=1" to GRUB_CMDLINE_LINUX option in /etc/default/grub -# Then run -# sudo update-grub -# Then restart -#This is by far the goofiest thing with this setup. I've only done it once, -# and I don't know what other issues will be encountered when done again. - - -########################## -# Setup install folder -########################## -mkdir -p ${INSTALLDIR} - -########################## -# Get svcomp benchmarks -########################## -#Download svcomp benchmarks -#Using export instead of clone so it isn't 6GB of DL (still 3.2GB - is it worth the extra 3 to do checkout?) -#svn export https://svn.sosy-lab.org/software/sv-benchmarks/trunk/c/ ${INSTALLDIR}/data/sv-benchmarks -#Use our copy of benchmarks, instead -git clone https://github.com/smackers/sv-benchmarks.git ${INSTALLDIR}/data/sv-benchmarks -cd ${INSTALLDIR}/data/sv-benchmarks -git filter-branch --subdirectory-filter c -cd ${SRCDIR} - - -########################## -# Prepare benchexec -########################## -#Get BenchExec package -git clone https://github.com/dbeyer/benchexec.git ${INSTALLDIR}/benchexec/ -#git clone https://github.com/MontyCarter/benchexec.git ./install/ -#And its dependency, tempita -wget https://pypi.python.org/packages/3.3/T/Tempita/Tempita-0.5.3dev-py3.3.egg --directory-prefix=${INSTALLDIR} -#The following extracts only the Tempita-0.5.3dev/tempita folder, and when it does so, -# replaces the 'Tempita-0.5.3dev/' portion with 'benchexec/'. -# In other words, it extracts just the module portion of tempita to the benchexec folder -# -n means don't overwrite existing target files, tempita/\* means get only files in tempita dir -unzip -n ${INSTALLDIR}/Tempita-0.5.3dev-py3.3.egg tempita/\* -d ${INSTALLDIR}/benchexec/ -rm ${INSTALLDIR}/Tempita-0.5.3dev-py3.3.egg -#Copy smack's BenchExec wrapper to the benchexec installation -cp src/* ${INSTALLDIR} -r - - -################################ -# Prepare CPAchecker as witness -################################ -#Update this to be the most recent stable tag -svn checkout https://svn.sosy-lab.org/software/cpachecker/tags/cpachecker-1.4/ ${INSTALLDIR}/cpachecker -JAVAVER=`java -version 2>&1 | head -n 1 | awk -F '"' '{print substr($2,0,3)}'` -JAVACVER=`javac -version 2>&1 | head -n 1 | awk -F ' ' '{print substr($2,0,3)}'` -# If java/javac not installed, or java/javac version is less than 1.7, install java 1.7 -if [[ -z `which java` || -z `which javac` || (( ${JAVAVER} < 1.7 )) || (( ${JAVACVER} < 1.7 )) ]] -then - sudo apt-get install openjdk-7-jdk -y - sudo update-alternatives --config java - sudo update-alternatives --config javac -fi -#If ant is not installed, install it -if [[ -z `which ant` ]] -then - sudo apt-get install ant -y -fi - -#Install CPAchecker -cd ${INSTALLDIR}/cpachecker -ant -cd ${SRCDIR} diff --git a/svcomp/bench/src/SMACKBench.py b/svcomp/bench/src/SMACKBench.py deleted file mode 100755 index da9c72f99..000000000 --- a/svcomp/bench/src/SMACKBench.py +++ /dev/null @@ -1,315 +0,0 @@ -#!/usr/bin/env python2 -import sys -sys.dont_write_bytecode = True # prevent creation of .pyc files - -import argparse -import daemon -import json -import os -import signal -import subprocess -import sys -import time -from datetime import datetime -from os import path -from socket import gethostname - -####################################### -### Common functions -####################################### -def get_args(): - parser = argparse.ArgumentParser(description='Executes a SMACKBench jobs queue') - subparsers = parser.add_subparsers(help = 'Sub-command help') - server = subparsers.add_parser('server', - help = 'Start SMACKBench in server mode', - formatter_class=argparse.ArgumentDefaultsHelpFormatter) - server.set_defaults(mode='server') - server.add_argument('-q', '--queue-file', - default='inputFiles/queue', metavar='FILE', - help='The file containing the list of jobs to process') - server.add_argument('-r', '--concurrentRuns', - default='8', metavar='NUM', - help='The number of concurrent benchmarks to run') - server.add_argument('-m', '--memoryPerRun', - default='15000', metavar='NUM', - help='Amount of memory per concurrent run (in MB)') - server.add_argument('-c', '--config-file', - default='inputFiles/config.json', metavar='FILE', - help='The json file with SMACKBench config settings') - server.add_argument('-d', '--description', - default='', metavar='DESC', - help='A description field (identifier) to be associated with each set') - - stop = subparsers.add_parser('stop', - help='Stop all instances of SMACKBench') - stop.set_defaults(mode='stop') - - run = subparsers.add_parser('run', - help='Run SMACKBench on a single svcomp set', - formatter_class=argparse.ArgumentDefaultsHelpFormatter) - run.set_defaults(mode='run') - run.add_argument('-s', '--svcomp-set', required=True, metavar='SET', - help='The svcomp set to execute') - run.add_argument('-x', '--inputXmlFile', required=True, metavar='FILE', - help='The input XML file with which to run svcomp-set') - run.add_argument('-r', '--concurrentRuns', default='8', metavar='NUM', - help='The number of concurrent benchmarks to run') - run.add_argument('-m', '--memoryPerRun', default='15000', metavar='NUM', - help='Amount of memory per concurrent run (in MB)') - run.add_argument('-c', '--config-file', - default='inputFiles/config.json', metavar='FILE', - help='The json file with SMACKBench config settings') - run.add_argument('-d', '--description', - default='', metavar='DESC', - help='A description field (identifier) to be associated with each set') - args = parser.parse_args() - return args - -def get_config(configFile): - with open(configFile, 'r') as f: - cfg = json.load(f) - return cfg - -def handle_sigterm(signum, frame): - #benchexec only runs cleanup routine when it sees - #sigint. To force this to run when receiving a sigterm, - #we'll intercept it and simulate a sigint instead - raise KeyboardInterrupt - -####################################### -## ## -## SMACKBenchServer ## -## ## -####################################### - -####################################### -### SMACKBench Queueing functions -####################################### - -#Creates a lock by making the directory lock_dir (in cwd) -#If directory exists, lock is already being held -def lock(lock_dir): - while True: - try: - os.mkdir(lock_dir) - return - except OSError as e: - if e.errno != 17: - raise - -#Releases a lock by deleting the directory lock_dir (from cwd) -def unlock(lock_dir): - try: - os.rmdir(lock_dir) - except: - pass - -def dequeue(filename, lock_folder): - #Pops and returns a line off the top of the input file - try: - cur = None - lock(lock_folder) - with open(filename,'r+') as f: - lines = f.readlines() - f.seek(0) - if len(lines)==0: - unlock(lock_folder) - return cur - cur = lines[0].strip() - lines = lines[1:] - for line in lines: - f.write(line) - f.truncate() - finally: - unlock(lock_folder) - return cur - -def enqueue(data, filename, lock_folder): - #Pushes a line to the end of the given filename - #(I think this is currently unused) - try: - lock(lock_folder) - with open(filename,'a') as f: - f.write(data + '\n') - finally: - unlock(lock_folder) - -####################################### -### SMACKBench Server -####################################### -def run_server(cfgObj, queueFile, concurRunCnt, memPerRun, desc): - #Register our sigterm handler, so we can catch it and raise - #KeyboardInterrupt instead. This way benchexec's cleanup - #routines run - signal.signal(signal.SIGTERM, handle_sigterm) - lock_folder = 'lck' - while(True): - # Pop a job - job = dequeue(queueFile, lock_folder) - # And run it if it exists (that is, if the queue is not empty) - if job: - # First, clean old .bc, .bpl, and .ll - # Deletes files modified more than 2 hours - cmdPre = ['find', './', '-maxdepth', '1', '-name'] - cmdPost = ['-mmin', '+120', '-delete'] - for ext in ['bpl','bc','ll','i','c','dot']: - subprocess.call(cmdPre + ['"*.' + ext + '"'] + cmdPost); - - job = job.split() #Splits into [, ] - runSMACKBench(cfgObj, job[0], job[1], concurRunCnt, memPerRun, desc) - else: - #If the queue file is empty, wait 10 seconds - time.sleep(10) - -####################################### -## ## -## runSMACKBench ## -## ## -####################################### -def generateOutFolder(cfgObj, svSet): - #Generate output folder name and create new directory - timestamp = datetime.now().strftime("%Y.%m.%d_%H.%M.%S.%f") - outFold = "exec_{0}_{1}".format(timestamp,svSet) - outPath = path.join(cfgObj['runsFolder'], outFold) - os.makedirs(outPath) - return outPath - -def copyInXmlAndInject(cfgObj, outPath, svSet, inXmlFile, memPerRun, desc): - #Deterime the destination input xml file location - dstInXmlFile = path.join(outPath, path.split(inXmlFile)[-1]) - #Read the input xml file template (must use .. since input xml - # file is relative to root, but we changed cwd to dataFolder, - # so we must adjust this path) - with open(path.join('..', inXmlFile), 'r') as inXml: - inXmlStr = inXml.read() - #NOTE: Replacement variables in input xml template that begin - # with a $ are used by benchexec (e.g., ${sourcefile_path}) - # Replacement vars in use by SMACKBench take the form {varname} - #Inject set name - inXmlStr = inXmlStr.replace('{SETNAME}', svSet) - #Inject description (we hijack the benchexec setdefinition_name field to - # contain description. This allows us to avoid changing xml schema of - # benchexec in/out xml files.) - inXmlStr = inXmlStr.replace('{DESCRIPTION}', - '' if not desc else '-'+desc.replace(' ','')) - #Inject memory per concurrent run limit - inXmlStr = inXmlStr.replace('{MEMLIMIT}', memPerRun) - #Inject number of cores allowed for each concurrently run benchmark - inXmlStr = inXmlStr.replace('{CORELIMIT}', cfgObj['coreLimit']) - #Determine the set definition file, relative to the dest input xml file - bmRel = path.relpath(cfgObj['benchmarkRoot'], path.dirname(dstInXmlFile)) - setDefFile = path.join(bmRel, svSet + ".set") - prpDefFile = path.join(bmRel, svSet + ".prp") - #Inject the set definition file (*.set) path (using relative path) - # (benchexec does everything relative to the input xml file) - inXmlStr = inXmlStr.replace('{SETDEFINITIONFILE}', setDefFile) - inXmlStr = inXmlStr.replace('{PROPERTYDEFINITIONFILE}', prpDefFile) - - #Write the input xml file - with open(dstInXmlFile, 'w') as dstXml: - dstXml.write(inXmlStr) - #Return the full file path of the injected input xml file - return dstInXmlFile - -def runBenchExec(cfgObj, inXmlFile, outPath, concurRunCnt, debug): - #This should probably be changed to use the benchexec python modules, - # rather than running as an executable - - #Config file passes benchexecPath as relative to root, but we changed - # cwd to dataFolder, and reference everything from this folder. As - # a result, we must patch the benchexecPath so it is relative to - # dataFolder - cmd = [path.join('..', cfgObj['benchexecPath'], 'benchexec')] - if debug: - cmd += ['-d'] - cmd += [inXmlFile] - #For some reason, benchexec needs to see a / on the end of the string - # to know the last item of the -o value is a folder. - cmd += ['-o', path.join(outPath, 'results') + '/'] - cmd += ['--no-compress'] - cmd += ['-N', concurRunCnt] - - print(cmd) - p = subprocess.Popen(cmd) - try: - p.wait() - except KeyboardInterrupt as e: - #If we get interrupted by a KeyboardInterrupt, pass it on to - # benchexec, so it can do its cleanup - p.send_signal(signal.SIGINT) - raise KeyboardInterrupt - -def witnessCheckingFunc(cfgObj, outPath): - #Get cwd, so we can return afterwards - execDir = os.getcwd() - print(execDir) - #change to root dir - os.chdir('..') - print(os.getcwd()) - cmd = ['./checkWitnesses.py'] - cmd += [os.path.join(cfgObj["dataFolder"], outPath)] - print(cmd) - p = subprocess.Popen(cmd) - try: - p.wait() - except KeyboardInterrupt as e: - #If we get interrupted by a KeyboardInterrupt, pass it on to - # benchexec, so it can do its cleanup - p.send_signal(signal.SIGINT) - raise KeyboardInterrupt - os.chdir(execDir) - -def runSMACKBench(cfgObj, svSet, inXmlFile, concurRunCnt, memPerRun, desc): - #Generate results folder name and create - outPath = generateOutFolder(cfgObj, svSet) - #Copy the input xml file template to the new output directory, - # and inject relevant variables - dstInXml = copyInXmlAndInject(cfgObj, outPath, svSet, inXmlFile, memPerRun, desc) - #Call benchexec - runBenchExec(cfgObj, dstInXml, outPath, concurRunCnt, debug = False) - #Run witness checking - witnessCheckingFunc(cfgObj, outPath) - -if __name__ == '__main__': - args = get_args() - #If stop command is given, stop all instances of SMACKBench - if (args.mode == 'stop'): - #Since only one instance of benchexec can run at a given time, - #we can blindly kill all running SMACKBench.py instances - subprocess.check_call(['pkill','-SIGTERM','-f','SMACKBench.py']) - #Read the config file - cfgObj = get_config(args.config_file) - #EVERYTHING in SMACKBench is relative to dataFolder (internally, that is) - # however, this must be adjusted within this program. (Except for config - # file location) - # Externally, (in config file, for example), paths are relative to root - #As a result, all paths that come as input to this program get adjusted - # from being relative to root to being relative to dataFolder before - # being used - os.chdir(cfgObj['dataFolder']) - #Make sure folders are created - for fold in [cfgObj['runsFolder'], cfgObj['logFolder']]: - try: - os.mkdir(fold) - except OSError: - #Already exists - pass - #If server command given - if(args.mode == 'server'): - #Determine the destination log file - logFile = path.join(cfgObj['logFolder'], gethostname() + '.log') - #Start the run_server function as a daemon, redirecting stderr to - #stdout, and stdout to the log file - print("To see benchexec console outputin real time, run 'tail -f {0}'".format(path.join(cfgObj['dataFolder'],logFile))) - with daemon.DaemonContext(working_directory = os.getcwd(), - stderr=sys.stdout, - stdout=open(logFile, 'a')): - run_server(cfgObj, path.join('..', args.queue_file), - args.concurrentRuns, args.memoryPerRun, args.description) - - else: - #if here, we're in run mode - #signal.signal(signal.SIGTERM, handle_sigterm) - runSMACKBench(cfgObj, args.svcomp_set, args.inputXmlFile, - args.concurrentRuns, args.memoryPerRun, - args.description) diff --git a/svcomp/bench/src/SMACKBenchServer.py b/svcomp/bench/src/SMACKBenchServer.py deleted file mode 100755 index a127499cb..000000000 --- a/svcomp/bench/src/SMACKBenchServer.py +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/python - -import time -import argparse -import os -import subprocess - -def get_args(): - parser = argparse.ArgumentParser(description='Executes a SMACKBench jobs queue') - parser.add_argument('--queue-file', required=True, - help='The file containing the list of jobs to process') - parser.add_argument('--thread-count', required=True, - help='The number of concurrent benchmarks to run') - parser.add_argument('--memory-limit', required=True, - help='The amount of memory to allocate to each concurrent run (in MB)') - return parser.parse_args() - -def lock(lock_dir): - while True: - try: - os.mkdir(lock_dir) - return - except OSError as e: - if e.errno != 17: - raise - -def unlock(lock_dir): - try: - os.rmdir(lock_dir) - except: - pass - -def dequeue(filename, lock_folder): - try: - cur = None - lock(lock_folder) - with open(filename,'r+') as f: - lines = f.readlines() - f.seek(0) - if len(lines)==0: - unlock(lock_folder) - return cur - cur = lines[0].strip() - lines = lines[1:] - for line in lines: - f.write(line) - f.truncate() - finally: - unlock(lock_folder) - return cur - -def enqueue(data, filename, lock_folder): - try: - lock(lock_folder) - with open(filename,'a') as f: - f.write(data + '\n') - finally: - unlock(lock_folder) - -def run_server(): - args = get_args() - lock_folder = 'lck' - while(True): - # Pop a job - cur = dequeue(args.queue_file, lock_folder) - # And run it if it exists - if cur: - # First, clean old .bc, .bpl, and .ll - # Deletes bpl, bc, and ll files that were - # last modified more than 2 hours ago - cmdPre = ['find', './data/', '-name'] - cmdPost = ['-mmin', '+120', '-delete', '-maxdepth', '1'] - for ext in [ ['"*.bpl"'], ['"*.bc"'], ['"*.ll"'] ]: - subprocess.call(cmdPre + ext + cmdPost); - - cur = cur.split() - cmd = ['nohup', './runSMACKBench.sh', cur[0], cur[1]] - cmd += [args.thread_count, args.memory_limit] - print(cmd) - #cmd = ['ls'] - p = subprocess.Popen(cmd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - while p.poll() is None: - print(p.stdout.readline()) - print(p.stdout.read()) - else: - time.sleep(10) - - -run_server() diff --git a/svcomp/bench/src/benchexec/benchexec/tools/smack_benchexec_driver.py b/svcomp/bench/src/benchexec/benchexec/tools/smack_benchexec_driver.py deleted file mode 100644 index fc1013a45..000000000 --- a/svcomp/bench/src/benchexec/benchexec/tools/smack_benchexec_driver.py +++ /dev/null @@ -1,121 +0,0 @@ -import os -import re - -import logging -import xml.etree.ElementTree as ET - -import benchexec.util as util -import benchexec.tools.template -import benchexec.result as result - -""" -This file defines Smack for BenchExec. It defines a class that inherits from -BenchExec's BaseTool class, which declares functions that the BenchExec framework -uses to interact with the tool. - -The 'tool' attribute for the root 'benchmark' nodes of input xml files should be -set to the name of this file without extension, i.e. 'smack_benchexec_driver'. -""" - -class Tool(benchexec.tools.template.BaseTool): - """ - This class subclasses BenchExec's BaseTool, and defines common functions used by - BenchExec to interface with SMACK. - """ - - def executable(self): - """ - Tells BenchExec to search for 'smack' as the main executable to be - called when running SMACK. - """ - return util.find_executable('smack') - - def version(self, executable): - """ - Sets the version number for SMACK, which gets displayed in the "Tool" row - in BenchExec table headers. - """ - return '1.9.3' - - def name(self): - """ - Sets the name for SMACK, which gets displayed in the "Tool" row in - BenchExec table headers. - """ - return 'SMACK' - - def cmdline(self, executable, options, tasks, propertyfile=None, rlimits={}): - """ - Allows us to define special actions to be taken or command line argument - modifications to make just before calling SMACK. - - Currently, we ensure that any referenced output directories exist, and - create them if they do not. - """ - assert len(tasks) == 1 - try: - #If options contains --bpl, get next option element, and its dirname - targetDir = os.path.dirname(options[options.index("--bpl")+1]) - if not os.path.exists(targetDir): - os.makedirs(targetDir) - except: - #If it doesn't contain --bpl, nothing to do... - pass - try: - #If options contains --bc, get next option element, and its dirname - targetDir = os.path.dirname(options[options.index("--bc")+1]) - if not os.path.exists(targetDir): - os.makedirs(targetDir) - except: - #If it doesn't contain --bc, nothing to do... - pass - - return [executable] + options + tasks - - def determine_result(self, returncode, returnsignal, output, isTimeout): - """ - Returns a BenchExec result status based on the output of SMACK - """ - splitout = "\n".join(output) - if re.search(r'SMACK found no errors.', splitout): - return result.RESULT_TRUE_PROP - elif re.search(r'SMACK found an error.*', splitout): - return result.RESULT_FALSE_REACH - else: - return result.RESULT_UNKNOWN - - def get_value_from_output(self, lines, identifier): - """ - This function can be referenced in the input xml files (which can define - additional columns to be displayed in the output tables), and extracts - additional information from tool output (with the idea that extra - statistical information would be extracted from tool output, and included - as a column in the resulting output tables). - - We are using this to generate HTML links for output files, rather than - parsing output and providing additional statistical data about the run. - - This currently generates a drop-down menu item for the .bc, .bpl, - generated witness file, and the output from the witness checking tool. - - However, the witness file and checking links are hidden by default, as - they will not exist if the witness checking pass has not been performed, - or if the benchmark result was true (in which case there is no trace). - The visibility of these must be set to visible when witness checking is - performed for this execution. - """ - #identifier comes from pattern field of input xml node, - # which then has variable substitution performed on it first - #If identifier is the input source file path+name, this will create - # links in the output table for bpl, bc, and witness related files - ret = "" - ret += '
\n' - ret += ' \n' - ret += '
\n' - return ret diff --git a/svcomp/bench/src/benchexec/benchexec/tools/smack_built.py b/svcomp/bench/src/benchexec/benchexec/tools/smack_built.py deleted file mode 100644 index 1a2991b9a..000000000 --- a/svcomp/bench/src/benchexec/benchexec/tools/smack_built.py +++ /dev/null @@ -1,121 +0,0 @@ -import os -import re - -import logging -import xml.etree.ElementTree as ET - -import benchexec.util as util -import benchexec.tools.template -import benchexec.result as result - -""" -This file defines Smack for BenchExec. It defines a class that inherits from -BenchExec's BaseTool class, which declares functions that the BenchExec framework -uses to interact with the tool. - -The 'tool' attribute for the root 'benchmark' nodes of input xml files should be -set to the name of this file without extension, i.e. 'smack_benchexec_driver'. -""" - -class Tool(benchexec.tools.template.BaseTool): - - REQUIRED_PATHS = [ - "corral", - "llvm", - "lockpwn", - "smack" - - ] - - def executable(self): - """ - Tells BenchExec to search for 'smack.py' as the main executable to be - called when running SMACK. - """ - return util.find_executable('smack') - - def version(self, executable): - """ - Sets the version number for SMACK, which gets displayed in the "Tool" row - in BenchExec table headers. - """ - #return self._version_from_tool(executable).split(' ')[2] - return "1.5.2" - - def name(self): - """ - Sets the name for SMACK, which gets displayed in the "Tool" row in - BenchExec table headers. - """ - return 'SMACK+Corral' - - def cmdline(self, executable, options, tasks, propertyfile=None, rlimits= -{}): - """ - Allows us to define special actions to be taken or command line argument - modifications to make just before calling SMACK. - """ - assert len(tasks) == 1 - assert propertyfile is not None - prop = ['--svcomp-property', propertyfile] - return [executable] + options + prop + tasks - - def determine_result(self, returncode, returnsignal, output, isTimeout): - """ - Returns a BenchExec result status based on the output of SMACK - """ - splitout = "\n".join(output) - if 'SMACK found no errors' in splitout: - return result.RESULT_TRUE_PROP - errmsg = re.search(r'SMACK found an error(:\s+([^\.]+))?\.', splitout) - if errmsg: - errtype = errmsg.group(2) - if errtype: - if 'invalid pointer dereference' == errtype: - return result.RESULT_FALSE_DEREF - elif 'invalid memory deallocation' == errtype: - return result.RESULT_FALSE_FREE - elif 'memory leak' == errtype: - return result.RESULT_FALSE_MEMTRACK - elif 'signed integer overflow' == errtype: - return result.RESULT_FALSE_OVERFLOW - else: - return result.RESULT_FALSE_REACH - return result.RESULT_UNKNOWN - - def get_value_from_output(self, lines, identifier): - """ - This function can be referenced in the input xml files (which can define - additional columns to be displayed in the output tables), and extracts - additional information from tool output (with the idea that extra - statistical information would be extracted from tool output, and included - as a column in the resulting output tables). - - We are using this to generate HTML links for output files, rather than - parsing output and providing additional statistical data about the run. - - This currently generates a drop-down menu item for the .bc, .bpl, - generated witness file, and the output from the witness checking tool. - - However, the witness file and checking links are hidden by default, as - they will not exist if the witness checking pass has not been performed, - or if the benchmark result was true (in which case there is no trace). - The visibility of these must be set to visible when witness checking is - performed for this execution. - """ - #identifier comes from pattern field of input xml node, - # which then has variable substitution performed on it first - #If identifier is the input source file path+name, this will create - # links in the output table for bpl, bc, and witness related files - ret = "" - ret += '
\n' - ret += ' \n' - ret += '
\n' - return ret diff --git a/svcomp/bench/src/benchexec/benchexec/tools/smack_packaged.py b/svcomp/bench/src/benchexec/benchexec/tools/smack_packaged.py deleted file mode 100644 index 0ce1de933..000000000 --- a/svcomp/bench/src/benchexec/benchexec/tools/smack_packaged.py +++ /dev/null @@ -1,123 +0,0 @@ -""" -BenchExec is a framework for reliable benchmarking. -This file is part of BenchExec. -Copyright (C) 2007-2015 Dirk Beyer -All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -import benchexec.result as result -import benchexec.util as util -import benchexec.tools.template - -import os -import re - -class Tool(benchexec.tools.template.BaseTool): - - REQUIRED_PATHS = [ - "corral", - "llvm", - "lockpwn", - "smack", - "smack.sh" - ] - - def executable(self): - """ - Tells BenchExec to search for 'smack.sh' as the main executable to be - called when running SMACK. - """ - return util.find_executable('smack.sh') - - def version(self, executable): - """ - Sets the version number for SMACK, which gets displayed in the "Tool" row - in BenchExec table headers. - """ - #return self._version_from_tool(executable).split(' ')[2] - return "1.5.2" - - def name(self): - """ - Sets the name for SMACK, which gets displayed in the "Tool" row in - BenchExec table headers. - """ - return 'SMACK+Corral' - - def cmdline(self, executable, options, tasks, propertyfile=None, rlimits={}): - """ - Allows us to define special actions to be taken or command line argument - modifications to make just before calling SMACK. - """ - assert len(tasks) == 1 - assert propertyfile is not None - prop = ['--svcomp-property', propertyfile] - return [executable] + options + prop + tasks - - def determine_result(self, returncode, returnsignal, output, isTimeout): - """ - Returns a BenchExec result status based on the output of SMACK - """ - splitout = "\n".join(output) - if 'SMACK found no errors' in splitout: - return result.RESULT_TRUE_PROP - errmsg = re.search(r'SMACK found an error(:\s+([^\.]+))?\.', splitout) - if errmsg: - errtype = errmsg.group(2) - if errtype: - if 'invalid pointer dereference' == errtype: - return result.RESULT_FALSE_DEREF - elif 'invalid memory deallocation' == errtype: - return result.RESULT_FALSE_FREE - elif 'memory leak' == errtype: - return result.RESULT_FALSE_MEMTRACK - elif 'signed integer overflow' == errtype: - return result.RESULT_FALSE_OVERFLOW - else: - return result.RESULT_FALSE_REACH - return result.RESULT_UNKNOWN - - def get_value_from_output(self, lines, identifier): - """ - This function can be referenced in the input xml files (which can define - additional columns to be displayed in the output tables), and extracts - additional information from tool output (with the idea that extra - statistical information would be extracted from tool output, and included - as a column in the resulting output tables). - - We are using this to generate HTML links for output files, rather than - parsing output and providing additional statistical data about the run. - - This currently generates a drop-down menu item for the .bc, .bpl, - generated witness file, and the output from the witness checking tool. - - However, the witness file and checking links are hidden by default, as - they will not exist if the witness checking pass has not been performed, - or if the benchmark result was true (in which case there is no trace). - The visibility of these must be set to visible when witness checking is - performed for this execution. - """ - #identifier comes from pattern field of input xml node, - # which then has variable substitution performed on it first - #If identifier is the input source file path+name, this will create - # links in the output table for bpl, bc, and witness related files - ret = "" - ret += '
\n' - ret += ' \n' - ret += '
\n' - return ret diff --git a/svcomp/bench/src/checkWitnesses.py b/svcomp/bench/src/checkWitnesses.py deleted file mode 100755 index e3fea98c6..000000000 --- a/svcomp/bench/src/checkWitnesses.py +++ /dev/null @@ -1,200 +0,0 @@ -#!/usr/bin/env python2 - -import xml.etree.ElementTree as ET -import os -import glob -import time -import subprocess -import re -import sys -sys.dont_write_bytecode = True # prevent creation of .pyc files - -""" -This file takes an execution results directory as an argument, and generates a -list of all output xml results files. For each output xml result file, it runs -cpachecker as a witness checker on each benchmark for which an error was found -(i.e., had a 'false' result). - -The original output xml file is modified in memory to include results statuses -from the witness checker for each benchmark 'false' benchmark, as well as -enabling the witness related output file download links. - -The modified in-memory output xml is then written as a new output xml file, with -the string ".witchecked" injected into the original output xml file name. E.g., -this file will write a file called "a.witchecked.Simple.xml" if it encounters an -original output xml file called "a.Simple.xml". -""" - -if not 2 == len(sys.argv) or not os.path.isdir(sys.argv[1]): - print - print("Usage:\t" + sys.argv[0] + " EXECRESULTDIR") - print - print("EXECRESULTDIR\tA path to a directory containing a SMACKBench") - print("\t\texecution result set, on which to check witnesses") - exit() - -#execDir is folder containing this script, checkWitnesses.py -execDir = os.getcwd() -#targetDir is the run results folder we are trying to witness check -#(example data/runs/exec_2016.10.25._12.04.41.554365_WCTest) -targetDir = sys.argv[1] - -#Append results folder to targetDir -#(example data/runs/exec_2016.10.25._12.04.41.554365_WCTest/results) -targetDir = os.path.join(targetDir, 'results') -#get a list of all results.xml files for this run -outXmls = glob.glob(targetDir + '/*results*.xml') - -for outXml in outXmls: - #The last token when splitting by "." is the set name - #example file = svcomp_m32_witcheck.2016-10-25_1204.results.WCTest-WCTestDescription.WCTest.txt - #The last field here (WCTest) is the set name (coming from the file WCTest.set) - #The second to last field name is the set name + description, separated by a - - baseXml,setName = os.path.splitext(os.path.splitext(outXml)[0]) - # skip certain sets - if 'DeviceDriversLinux64' in setName or 'HeapReach' in setName or 'Concurrency' in setName: - exit() - #outXmlNew will be the new output xml file with the witnesschecked results, - #leaveing the original file intact. - outXmlNew = baseXml + '.witchecked' + setName + '.xml' - tree = ET.parse(outXml) - - root = tree.getroot() - #runName is the setname + description (WCTest-WCTestDescription) - runName = root.get('name') - #benchmarkname is the name of the input xml file, minus the extension - #example = svcomp_m32_witcheck - benchmarkName = root.get('benchmarkname') - runDate = root.get('date') - runDate = time.strptime(runDate, "%Y-%m-%d %H:%M:%S %Z") - #Reformatted runDate example = 2016-10-25_1204 - runDate = "{0:04d}-{1:02d}-{2:02d}_{3:02d}{4:02d}".format(runDate.tm_year, - runDate.tm_mon, - runDate.tm_mday, - runDate.tm_hour, - runDate.tm_min) - runTimelimit = root.get('timelimit') - #witness checking timelimit should be 10% of time limit for tool to solve - witTimelimit = int(runTimelimit.split()[0].replace("s",""))/10 - - #pathPrefix example = svcomp_m32_witcheck.2016-10-25_1204 - pathPrefix = benchmarkName + "." + runDate - #logFolder example = - #../data/runs/exec_2016.10.25_12.04.41.554365_WCTest/results/svcomp_m32_witcheck.2016-10-25_1204.logfiles/ - logFolder = os.path.join(targetDir, pathPrefix + ".logfiles") - #Loop through each benchmark file in the run - for run in root.findall('run'): - #sourcefile is input *.c or *.i file (including path) - sourcefile = run.get('name') - # Get property file from input benchmark folder - propfile = os.path.join(os.path.join('data', os.path.split(os.path.split(sourcefile)[0])[0]), 'PropertyUnreachCall.prp') - #split the sourcefile into its svcomp source path, and the actual filename - #(that is, get rid of the original source path) - _,targetfile = os.path.split(sourcefile) - targetfile = os.path.join(logFolder, runName + "." + targetfile) - - #Get the input and output witness checking file names - witnessfile = targetfile + '.witness.graphml' - #benchexecWitnesscheckOutput will be the console output of whatever witness checking - #tool gets executed (currently the cpachecker web validator). This file will contain - #the running time for the cpachecker web validator. - benchexecWitnesscheckOutput = targetfile + '.witnessCheckOutput' - #webValidatorWitnesscheckOutput will be the log file written by the cpachecker web - #validator. This file will contain the witness checking outcome, such as FALSE, TRUE, - # or TIMEOUT - webValidatorWitnesscheckOutput = targetfile + 'output.log' - categoryCol = run.find('./column[@title="category"]') - statusCol = run.find('./column[@title="status"]') - outputfilesCol = run.find('./column[@title="Output Files"]') - # Make sure columns existed (they don't when runSet was terminated early) - if categoryCol is not None and statusCol is not None: - category = categoryCol.get('value') - status = statusCol.get('value') - # We only need to witness check if we got the answer right - # and the verification result was false - #if 'correct' in category and 'false' in status: - correct = None - if 'false' in status: - correct = False - elif 'true' in status: - correct = True - if correct is not None and os.path.isfile(witnessfile): - # Use runexec to enforce time limit - # cpachecker complains if working directory isn't the cpachecker - # directory, so we have to adjust paths to match this requirement - cmd = ['../../benchexec/bin/runexec'] - cmd += ['--output', '../../' + benchexecWitnesscheckOutput] - #cmd += ['--output', benchexecWitnesscheckOutput] - #cmd = ['./benchexec/bin/runexec'] - #cmd += ['--output', benchexecWitnesscheckOutput] - cmd += ['--timelimit', str(witTimelimit)] - cmd += ['--'] - # Below this point are the witness checking commands - cmd += ['./scripts/cpa.sh'] - ##### Simple CPAchecker Args - if correct: - cmd += ['-correctness-witness-validation'] - cmd += ['-setprop', 'invariantGeneration.kInduction.invariantsAutomatonFile='+os.path.abspath(witnessfile)] - else: - cmd += ['-violation-witness-validation'] - cmd += ['-spec', os.path.abspath(witnessfile)] - cmd += ['-spec', os.path.abspath(propfile)] - cmd += [os.path.abspath('data/' + sourcefile)] - cmd += ['-outputpath', os.path.abspath( targetfile)] - - ##### Complex CPAchecker Args - #cmd += ['-noout'] - #cmd += ['-heap', '16000M'] - #cmd += ['-witness-check'] - #cmd += ['-spec', '../' + witnessfile] - #cmd += ['-spec', '../' + propfile] - #cmd += ['../' + sourcefile] - #os.chdir('cpachecker/CPAchecker-1.6.1-unix') - os.chdir('cpachecker/cpachecker') - - #cmd += ['./witness_validation_web_cloud.py'] - #cmd += ['--program', "../data/" + sourcefile] - #cmd += ['--witness', "../" + witnessfile] - #cmd += ['-o', "../" + targetfile] - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - - #This console output (p.communicate()[0]) is ignored, and is only called to - #block execution until the web validator finishes running. The console output - #here will contain the running time for the web validator script only, not the - #actual running time of the validation, so it gets ignored. - cmdOut = p.communicate()[0] - #print(cmdOut.decode('utf-8')) - #checktime = float(re.search('cputime=(.*)s', cmdOut.decode('utf-8')).group(1)) - os.chdir(execDir) - #cmdOut = "" - with open(benchexecWitnesscheckOutput,"r") as f: - output = f.read() - print(cmdOut) - checktime = float(re.search('cputime=(.*)s', cmdOut).group(1)) + 10 - - witSuccess = False - witTimeout = False - #with open(webValidatorWitnesscheckOutput, 'r') as witout: - # output = witout.read() - witSuccess = re.search('Verification result:\s*FALSE', output) if not correct else re.search('Verification result: TRUE.*', output) - witTimeout = re.search('Verification result: UNKNOWN, incomplete analysis.', output) - witFailure = re.search('Verification result: TRUE.*', output) if not correct else re.search('Verification result:\s*FALSE', output) - if witSuccess: - statusCol.set('value','witness confirmed') - else: - if witTimeout: - statusCol.set('value', 'witness timeout') - categoryCol.set('value', 'error') - else: - if witFailure: - statusCol.set('value', 'witness unconfirmed') - categoryCol.set('value', 'error') - else: - statusCol.set('value', 'something went wrong') - categoryCol.set('value', 'unknown') - if outputfilesCol is not None: - newVal = outputfilesCol.get('value').replace(' hidden','') - outputfilesCol.set('value', newVal) - ET.SubElement(run, 'column', {'title':'time(s)\nfor\nwitness', - 'value':"{0:.3f}s".format(checktime)}) - tree.write(outXmlNew) diff --git a/svcomp/bench/src/data/clean.sh b/svcomp/bench/src/data/clean.sh deleted file mode 100755 index 12cdd71a6..000000000 --- a/svcomp/bench/src/data/clean.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/local/bin/bash - -#Deletes bpl and bc files that were last modified more than 2 hours ago -find . -name "*.bpl" -mmin +120 -delete -find . -name "*.bc" -mmin +120 -delete -find . -name "*.ll" -mmin +120 -delete diff --git a/svcomp/bench/src/data/index.py b/svcomp/bench/src/data/index.py deleted file mode 100755 index 1bbf6eebf..000000000 --- a/svcomp/bench/src/data/index.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python2 -from lib import * -import sys -import cgitb -import cgi -cgitb.enable() -sys.dont_write_bytecode = True # prevent creation of .pyc files - -""" -This file is the landing web page for a SMACKBench instance. It provides an -interface for selecting which benchmark results to display. It allows users to -filter svcomp benchmark sets based on set name and command line options used when -executing SMACK. - -Upon form submission, results.py is called, with filter details passed as cgi -parameters. results.py is responsible for finding matching result sets and -generating a table containing these result sets. -""" - - -runRoot = "." -runFolderPrefix = "exec" -if __name__ == '__main__': - print "Content-Type: text/html" # HTML is following - print # blank line, end of headers - form = cgi.FieldStorage() - - runSets = getAllRunSets(runRoot, runFolderPrefix) - options = getAllOptionsUsed(runSets) - optionKeys = sorted(options.keys()) - for runset in runSets: - if 'witcheck' in runset.outXml: - runSets.remove(runset) - runSets.sort(key=lambda x: x.inXml, reverse=True) - print ''' -

SMACK+CORRAL Benchmark Results


-

Select a set, and select the command line options to include

-

Any option with no selected values will include all values for that option


-
''' - - usedFilesets = getSourcefileSetsUsed(runSets) - print ''' - - ''' - - for key in optionKeys: - print ''' - ''' - - print ''' - - -
Category:
{0}:'''.format(key) - for val in options[key]: - print ''' - {1}'''.format(key, val) - print ''' -
- -
-
- -
-
-
- Or select a specific set to view (ignores filters above):

-
- RunSet: -
-
- ''' diff --git a/svcomp/bench/src/data/lib.py b/svcomp/bench/src/data/lib.py deleted file mode 100644 index fd944c393..000000000 --- a/svcomp/bench/src/data/lib.py +++ /dev/null @@ -1,145 +0,0 @@ -import cgi -import glob -import xml.etree.ElementTree as ET -from os import path -import sys -import re -sys.dont_write_bytecode = True # prevent creation of .pyc files - -""" -This file provides some utility functions that are used by both index.py and -results.py. - -It provides functionality mainly for understanding BenchExec's xml input and -output formats. -""" - -def natural_sort_key(s, _nsre=re.compile('([0-9]+)')): - """ - A sorting function for sorting possible option values as integers rather than - lexigraphically. - """ - return [int(text) if text.isdigit() else text.lower() - for text in re.split(_nsre, s)] - -class RunSet: - """ - A class that represents a BenchExec run set. It contains information - critical to filtering, selecting, and displaying run sets - """ - def __init__(self, outputXml, inputXml): - """ - Creates a RunSet based on a run's input and output xml files - """ - self.inXml = inputXml - self.outXml = outputXml - #self.name = ET.parse(self.outXml).getroot().get("name") - # Avoid parsing all output xml files - reg = re.compile(r'') - with open(self.outXml) as f: - for line in f: - a = reg.match(line) - if a: - self.name = a.group(1) - break - self.options = self.getOptions() - self.fileSet = self.getSetName() - - def getOptions(self): - """ - Gets the command line options used when calling SMACK for this run set. - """ - inRoot = ET.parse(self.inXml).getroot() - #Find rundefinition node with matching name, and get its option children - rundefOptions = inRoot.findall('rundefinition[@name="' + self.name + '"]/option') - options = dict() - for opt in rundefOptions: - options[opt.get("name")] = opt.text - if options[opt.get("name")] == None: - options[opt.get("name")] = "True" - return options - - def getSetName(self): - """ - Gets the svcomp category (or 'Set' name) defining the specific benchmarks - that were executed. - """ - #sourcefile Set name is found as last token before .xml in output filename - #Remove file extension - noExt = path.splitext(self.outXml)[0] - return noExt.split(".")[-1] - -def getAllRunSets(searchRoot, folderPrefix): - """ - Finds all xml files matching the path searchRoot/folderPrefix*/results/*.xml - - Currently, this is set to only find run sets that have already been witness. - This should probably be reconsidered (perhaps a filter option in index.py - that allows users to select all run sets, or only those that have been - witness checked?) - """ - #allOutXml = glob.glob(searchRoot + "/" + folderPrefix + "*/results/*witchecked.*.xml") - allOutXml = glob.glob(searchRoot + "/" + folderPrefix + "*/results/*.xml") - runSets = [] - for outFile in allOutXml: - - - #Get rid of outFile name and results folder - inputPath = path.split(path.split(outFile)[0])[0] - #inputFilename = ET.parse(outFile).getroot().get("benchmarkname") + ".xml" - # Avoid parsing all output XML files - #inputFilename = glob.glob(inputPath + '/*.xml')[0] - #inFile = path.join(inputPath,inputFilename) - inFile = glob.glob(inputPath + '/*.xml')[0] - curRunSet = RunSet(outFile,inFile) - curRunSet.runsetFolder = inputPath[2:] - runSets.append(curRunSet) - - #For each set, if an option isn't used, set it to false. - allOpts = getAllOptionsUsed(runSets) - for runset in runSets: - for opt in allOpts: - if opt not in runset.options: - runset.options[opt] = "False" - - - - return runSets - -def getSourcefileSetsUsed(runSets): - """ - Returns a list of svcomp categories (or "Sets") for which result sets exist. - - This is used to populate the "Category" drop down in index.py. - """ - usedSets = set() - for runset in runSets: - usedSets.add(runset.fileSet) - return sorted(list(usedSets)) - - -def getAllOptionsUsed(runSets): - """ - Returns a list of all options and corresponding values in use in the input - set of result sets. - - This is used by index.py to populate the possible options that can be used to - filter result sets. - """ - possibleOptions = dict() - for runset in runSets: - for opt in runset.options: - if opt in possibleOptions: - possibleOptions[opt].add(runset.options[opt]) - else: - possibleOptions[opt] = set([runset.options[opt]]) - #Convert from set to list and sort - for opt in possibleOptions: - #Add True/False for flag options - if possibleOptions[opt] == {None}: - possibleOptions[opt] = ["True", "False"] - else: - possibleOptions[opt] = sorted(possibleOptions[opt], key=natural_sort_key) - return possibleOptions - - diff --git a/svcomp/bench/src/data/results.py b/svcomp/bench/src/data/results.py deleted file mode 100755 index 0149ba930..000000000 --- a/svcomp/bench/src/data/results.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python2 -from lib import * -import datetime -import subprocess -import sys -import os -import cgitb -import cgi -cgitb.enable() -sys.dont_write_bytecode = True # prevent creation of .pyc files - -""" -This file generates a BenchExec table that includes the BenchExec result sets -that are selected by the filter constraints which are passed in as cgi parameters -to this script. - -It calls BenchExec's 'tablegenerator' on output xml files matching the filter -parameters. The html output from 'tablegenerator' is sent to stdout, which= -causes the dynamically generated webpage to be displayed at the client's browser. -""" - - -runRoot = "." -runFolderPrefix = "exec" -tblGenExe = "../benchexec/bin/table-generator" -scratchDir = "." - -def printError(msg): - """ - Outputs python stack trace as html, for ease of readability in client's web - browser. - """ - print "

Bad results.py query


" - print "

Query failed with the following message:

" - print "

" + msg + "

" - exit() - -def filterResultsByRunsetFolder(runSets, form): - """ - Filters out results that don't have the specified runsetFolder name - """ - ret = [] - for runset in runSets: - if runset.runsetFolder == form['runset'].value: - ret.append(runset) - return ret - -def filterResultsByCategory(runSets, form): - """ - Filters out result sets that don't match the svcomp category (set) given in - the cgi form input parameters. - """ - ret = [] - for runset in runSets: - if runset.fileSet == form['category'].value: - ret.append(runset) - return ret - -def filterResultsByOptions(runSets, form, allOptions): - """ - Filters out result sets that don't match the command line options selected - by the form input parameters. - - For options with no value selected (e.g., none of the --unroll checkboxes - were checked), result sets will not be filtered based on this option (in - other words, it doesn't make sense to return an empty table). - - For options with at least one value selected, only result sets using that - option (with one of the selected values) are included. (This means that - if --unroll 2 and --unroll 4 were checked, result sets that don't specify the - --unroll option are excluded). - - For boolean flags, the 'False' checkbox will include only result sets - generated without the flag being used. When the 'True' checkbox is set, - only result sets generated with the flag specified are included. - """ - badOpts = dict() - #If the option was passed, we'll build a set of negative options, - # based on set difference between allOptions and form passed options - for opt in allOptions.keys(): - if opt in form: - #detect whether single value was passed, or a list - if isinstance(form.getvalue(opt), list): - badOpts[opt] = set(allOptions[opt]) - set(form.getvalue(opt)) - else: - badOpts[opt] = set(allOptions[opt]) - set([form[opt].value]) - #Only keep set if it doesn't have any badopts - ret = [] - for runset in runSets: - keep = True - for opt in badOpts.keys(): - #If option exists for run, and it is in bad list, unkeep it - if opt in runset.options and runset.options[opt] in badOpts[opt]: - keep = False - if keep: - ret.append(runset) - return ret - -def generateTable(runSets): - """ - Calls BenchExec's 'tablegenerator' with the selected run set xml files as - arguments. - - 'tablegenerator' output is sent to stdout, which is sent to the remote client - by apache. - """ - #Get list of output xml files - xmlFiles = [] - for runset in runSets: - xmlFiles.append(runset.outXml) - filenameBase = "results" - - cmd = [tblGenExe, "-o", "-", "-f", "html", "-q", "--no-diff"] + xmlFiles - try: - out = subprocess.check_output(cmd, stderr=subprocess.STDOUT) - print out.decode('utf-8') - except subprocess.CalledProcessError as e: - out = e.output - printError("table-generator failed with the following output:\n
" + out.decode('utf-8') + "
") - - -if __name__ == '__main__': - print "Content-Type: text/html" # HTML is following - print # blank line, end of headers - form = cgi.FieldStorage() - - runSets = getAllRunSets(runRoot, runFolderPrefix) - allOptions = getAllOptionsUsed(runSets) - - if "runset" in form: - runSets = filterResultsByRunsetFolder(runSets, form) - else: - - if not "category" in form: - printError("No category parameter passed") - runSets = filterResultsByCategory(runSets, form) - runSets = filterResultsByOptions(runSets, form, allOptions) - runSets.sort(key=lambda x: x.inXml) - generateTable(runSets) diff --git a/svcomp/bench/src/inputXMLFiles/corral_u8_looplimit1024_tav.xml b/svcomp/bench/src/inputXMLFiles/corral_u8_looplimit1024_tav.xml deleted file mode 100644 index bcab39d23..000000000 --- a/svcomp/bench/src/inputXMLFiles/corral_u8_looplimit1024_tav.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/boogie_u16.xml b/svcomp/bench/src/inputXMLFiles/old/boogie_u16.xml deleted file mode 100644 index 839ddc934..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/boogie_u16.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/boogie_u32.xml b/svcomp/bench/src/inputXMLFiles/old/boogie_u32.xml deleted file mode 100644 index 8a2b4d94c..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/boogie_u32.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/boogie_u8.xml b/svcomp/bench/src/inputXMLFiles/old/boogie_u8.xml deleted file mode 100644 index 76d1ba516..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/boogie_u8.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024.xml deleted file mode 100644 index 2684a55f3..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_bv.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_bv.xml deleted file mode 100644 index 37df66fa8..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_bv.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_bv_tav.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_bv_tav.xml deleted file mode 100644 index 88812dbe2..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_bv_tav.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_bv_tav_si.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_bv_tav_si.xml deleted file mode 100644 index ddbe9af08..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_bv_tav_si.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_tav.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_tav.xml deleted file mode 100644 index 9b18c1288..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_tav.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_tav_si.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_tav_si.xml deleted file mode 100644 index 31dfb49ca..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u16_looplimit1024_tav_si.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u32_looplimit1024_tav.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u32_looplimit1024_tav.xml deleted file mode 100644 index 40663e442..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u32_looplimit1024_tav.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u32_looplimit1024_tav_si.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u32_looplimit1024_tav_si.xml deleted file mode 100644 index caf7a14d8..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u32_looplimit1024_tav_si.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024.xml deleted file mode 100644 index a066b468e..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_bv.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_bv.xml deleted file mode 100644 index f705fb407..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_bv.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_bv_m32.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_bv_m32.xml deleted file mode 100644 index 4b0226044..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_bv_m32.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_bv_tav.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_bv_tav.xml deleted file mode 100644 index a009ebe8f..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_bv_tav.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_bv_tav_si.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_bv_tav_si.xml deleted file mode 100644 index b6280873f..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_bv_tav_si.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_si.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_si.xml deleted file mode 100644 index fb49211c8..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_si.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_tav.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_tav.xml deleted file mode 100644 index bcab39d23..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_tav.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_tav_si.xml b/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_tav_si.xml deleted file mode 100644 index 58e938b76..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/corral_u8_looplimit1024_tav_si.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/old/smack.xml b/svcomp/bench/src/inputXMLFiles/old/smack.xml deleted file mode 100644 index d15ff8eb7..000000000 --- a/svcomp/bench/src/inputXMLFiles/old/smack.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - - - - - - - - - - - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/svcomp_m32.xml b/svcomp/bench/src/inputXMLFiles/svcomp_m32.xml deleted file mode 100644 index 566ca2cdc..000000000 --- a/svcomp/bench/src/inputXMLFiles/svcomp_m32.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/svcomp_m32_witcheck.xml b/svcomp/bench/src/inputXMLFiles/svcomp_m32_witcheck.xml deleted file mode 100644 index 5e164d0e8..000000000 --- a/svcomp/bench/src/inputXMLFiles/svcomp_m32_witcheck.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - {PROPERTYDEFINITIONFILE} - - - - - - - - - - - - {SETDEFINITIONFILE} - - - - - - - - ${logfile_path}/${rundefinition_name}.${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/svcomp_m32_witcheck_packaged.xml b/svcomp/bench/src/inputXMLFiles/svcomp_m32_witcheck_packaged.xml deleted file mode 100644 index 3c9d3bedf..000000000 --- a/svcomp/bench/src/inputXMLFiles/svcomp_m32_witcheck_packaged.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - {PROPERTYDEFINITIONFILE} - - - - - - - - - - {SETDEFINITIONFILE} - - - - - - - - ${logfile_path}/${rundefinition_name}.${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/svcomp_m64.xml b/svcomp/bench/src/inputXMLFiles/svcomp_m64.xml deleted file mode 100644 index c60bb1f69..000000000 --- a/svcomp/bench/src/inputXMLFiles/svcomp_m64.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ${sourcefile_path}/ALL.prp - - - - - - - - ../sv-benchmarks/{SETNAME}.set - - - - - - - - - - - - ${logfile_path}/${rundefinition_name}/${sourcefile_path}/${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/svcomp_m64_witcheck.xml b/svcomp/bench/src/inputXMLFiles/svcomp_m64_witcheck.xml deleted file mode 100644 index 3ad791069..000000000 --- a/svcomp/bench/src/inputXMLFiles/svcomp_m64_witcheck.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - {PROPERTYDEFINITIONFILE} - - - - - - - - - - - - {SETDEFINITIONFILE} - - - - - - - - ${logfile_path}/${rundefinition_name}.${sourcefile_name} - - diff --git a/svcomp/bench/src/inputXMLFiles/svcomp_m64_witcheck_packaged.xml b/svcomp/bench/src/inputXMLFiles/svcomp_m64_witcheck_packaged.xml deleted file mode 100644 index e00248292..000000000 --- a/svcomp/bench/src/inputXMLFiles/svcomp_m64_witcheck_packaged.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - {PROPERTYDEFINITIONFILE} - - - - - - - - - - {SETDEFINITIONFILE} - - - - - - - - ${logfile_path}/${rundefinition_name}.${sourcefile_name} - - diff --git a/svcomp/bench/src/queue b/svcomp/bench/src/queue deleted file mode 100644 index e69de29bb..000000000 diff --git a/svcomp/bench/src/queueStd b/svcomp/bench/src/queueStd deleted file mode 100644 index 061ccb8d1..000000000 --- a/svcomp/bench/src/queueStd +++ /dev/null @@ -1,17 +0,0 @@ -Arrays svcomp_m32_witcheck.xml -BitVectors svcomp_m32_witcheck.xml -BusyBox svcomp_m64_witcheck.xml -Concurrency svcomp_m32_witcheck.xml -ControlFlowInteger svcomp_m32_witcheck.xml -DeviceDrivers64 svcomp_m64_witcheck.xml -ECA svcomp_m32_witcheck.xml -Floats svcomp_m32_witcheck.xml -HeapManipulation svcomp_m32_witcheck.xml -Loops svcomp_m32_witcheck.xml -MemorySafety svcomp_m32_witcheck.xml -Overflows svcomp_m64_witcheck.xml -ProductLines svcomp_m32_witcheck.xml -Recursive svcomp_m32_witcheck.xml -Sequentialized svcomp_m32_witcheck.xml -Simple svcomp_m32_witcheck.xml -Termination-crafted svcomp_m64_witcheck.xml diff --git a/svcomp/bench/src/queueStdBuiltNew b/svcomp/bench/src/queueStdBuiltNew deleted file mode 100644 index 751152a31..000000000 --- a/svcomp/bench/src/queueStdBuiltNew +++ /dev/null @@ -1,23 +0,0 @@ -ArraysMemSafety inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -ArraysReach inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -BitVectorsOverflows inputFiles/inputXMLFiles/svcomp_m64_witcheck.xml -BitVectorsReach inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -BusyBox inputFiles/inputXMLFiles/svcomp_m64_witcheck.xml -ControlFlow inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -Floats inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -HeapMemSafety inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -HeapReach inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -Loops inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -ProductLines inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -Recursive inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -Sequentialized inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -Concurrency inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -DeviceDriversLinux64 inputFiles/inputXMLFiles/svcomp_m64_witcheck.xml -ECA inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -MemSafety-Other inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -MemSafety-LinkedLists inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -Overflows-Other inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml -Systems_BusyBox_Overflows inputFiles/inputXMLFiles/svcomp_m64_witcheck.xml -Termination-MainControlFlow inputFiles/inputXMLFiles/svcomp_m64_witcheck.xml -Termination-MainHeap inputFiles/inputXMLFiles/svcomp_m64_witcheck.xml -Termination-Other inputFiles/inputXMLFiles/svcomp_m32_witcheck.xml diff --git a/svcomp/bench/src/queueStdPackagedNew b/svcomp/bench/src/queueStdPackagedNew deleted file mode 100644 index c90b8cc6e..000000000 --- a/svcomp/bench/src/queueStdPackagedNew +++ /dev/null @@ -1,23 +0,0 @@ -ArraysMemSafety inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -ArraysReach inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -BitVectorsReach inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -BitVectorsOverflows inputFiles/inputXMLFiles/svcomp_m64_witcheck_packaged.xml -BusyBox inputFiles/inputXMLFiles/svcomp_m64_witcheck_packaged.xml -ControlFlow inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -Floats inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -HeapMemSafety inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -HeapReach inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -Loops inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -Recursive inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -Sequentialized inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -ProductLines inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -Concurrency inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -DeviceDriversLinux64 inputFiles/inputXMLFiles/svcomp_m64_witcheck_packaged.xml -ECA inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -MemSafety-Other inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -MemSafety-LinkedLists inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -Overflows-Other inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml -Systems_BusyBox_Overflows inputFiles/inputXMLFiles/svcomp_m64_witcheck_packaged.xml -Termination-MainControlFlow inputFiles/inputXMLFiles/svcomp_m64_witcheck_packaged.xml -Termination-MainHeap inputFiles/inputXMLFiles/svcomp_m64_witcheck_packaged.xml -Termination-Other inputFiles/inputXMLFiles/svcomp_m32_witcheck_packaged.xml diff --git a/svcomp/bench/src/queueold b/svcomp/bench/src/queueold deleted file mode 100644 index 703fded1a..000000000 --- a/svcomp/bench/src/queueold +++ /dev/null @@ -1,17 +0,0 @@ -Arrays -BitVectors -BusyBox -Concurrency -ControlFlowInteger -DeviceDrivers64 -DriverChallenges -ECA -Floats -HeapManipulation -Loops -MemorySafety -ProductLines -Recursive -Sequentialized -Simple svcomp_m32_u8_looplimit1024_tav.xml -Termination-crafted \ No newline at end of file diff --git a/svcomp/bench/src/runSMACKBench.sh b/svcomp/bench/src/runSMACKBench.sh deleted file mode 100755 index f2ff337fc..000000000 --- a/svcomp/bench/src/runSMACKBench.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash - -#This file executes SMACK using BenchExec, on the sv-comp benchmarks. -# -#It creates a folder called data/exec_/, copies input xml file -#smack.xml into this directory, and executes benchexec, passing smack.xml -#as an argument. -# -#With the current configuration of smack.xml, this causes benchexec to execute -#smack on the sv-comp Simple set, using a limit of 4GB of memory and two cores. -#These low limits were set to enable running 4 benchmarks concurrently. -# -#The memory and core limits are set in the input xml file (smack.xml), and the -#number of concurrent threads is set here in this file. These should be modified -#appropriately based on specs of the hardware, as well as desired accuracy of -#benchmark timing (if memory is fully allocated, swapping is likely to occur, -#which can negatively impact benchmark times). -# -#In the future, number of threads and sv-comp benchmark set should be -#parameterized. - -USAGE=" -Usage: - ./runSMACKBench.sh cancel -Kills all SMACKBench instances - or ./runSMACKBench.sh clean -Deletes all SMACKBench results - or ./runSMACKBench.sh SET XMLIN THREADS THREADMEM [debug] -Executes SMACKBench - -Parameters: - SET The svcomp category set to benchmark - XMLIN The input xml file specifying the parameters to run with - THREADS The number of concurrent tests to run - THREADMEM The amount of memory to allocate to each thread - - -Options: - debug Runs BenchExec with the debug option" - -#Gets rid of existing results -if [[ $1 == "clean" ]] - then - rm data/exec* -rf - rm data/*.bc data/*.bpl data/*.c data/*.log -f - rm data/nohup*.out -f - exit -fi - -#Kills all executing instances of BenchExec and smack for -# calling user -if [[ $1 == "cancel" ]] -then - pkill -KILL -u ${USER} -f benchexec - pkill -u ${USER} -f corral - pkill -u ${USER} -f boogie - pkill -u ${USER} -f z3 - exit -fi - -################################ -# Validate input args -################################ -if [[ -z $1 ]] -then - echo "You must specify an svcomp set to benchmark!" - echo "$USAGE" - exit -fi -if [[ -z $2 ]] -then - echo "You must specify an parameter set (input xml file)!" - echo "$USAGE" - exit -fi -if [[ -z $3 ]] -then - echo "You must specify the number of concurrent tests to run!" - echo "$USAGE" - exit -fi -if [[ -z $4 ]] -then - echo "You must specify the number of concurrent tests to run!" - echo "$USAGE" - exit -fi - -cd data - -SETNAME=$1 -INPUTXMLFILE=$2 -THREADCOUNT=$3 -MEMLIMIT=$4 -CORELIMIT=1 - - -BENCHEXECPATH=../benchexec/bin -INPUTXMLPATH=../inputXMLFiles -INPUTXML=${INPUTXMLPATH}/${INPUTXMLFILE} - -################################ -# Generate folder for this run -################################ -OUTFOLDER=`date +%Y.%m.%d_%H.%M.%S.%N` -OUTFOLDER=exec_${OUTFOLDER}_${SETNAME} -mkdir -p ${OUTFOLDER} - -################################ -# Copy over input xml file, -# while replacing {SETNAME} to -# be the target set name -################################ -sed "s/{SETNAME}/${SETNAME}/" ${INPUTXML} > ${OUTFOLDER}/${INPUTXMLFILE} -sed -i "s/{MEMLIMIT}/${MEMLIMIT}/" ${OUTFOLDER}/${INPUTXMLFILE} -sed -i "s/{CORELIMIT}/${CORELIMIT}/" ${OUTFOLDER}/${INPUTXMLFILE} - -if [[ $5 == "debug" ]] -then - ${BENCHEXECPATH}/benchexec -d ${OUTFOLDER}/${INPUTXMLFILE} -o ${OUTFOLDER}/results/ -N ${THREADCOUNT} -else - ${BENCHEXECPATH}/benchexec ${OUTFOLDER}/${INPUTXMLFILE} -o ${OUTFOLDER}/results/ -N ${THREADCOUNT} -fi -cd .. -./checkWitnesses.py data/${OUTFOLDER} - diff --git a/svcomp/bench/src/runServer.sh b/svcomp/bench/src/runServer.sh deleted file mode 100755 index 3512db046..000000000 --- a/svcomp/bench/src/runServer.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -. /mnt/local/smack-project/smack.environment -host=$(hostname) -nohup ./SMACKBenchServer.py --queue-file queue --thread-count 8 --memory-limit 15000 >>${host}.out 2>&1& diff --git a/svcomp/emulabSetup/smackbench_compute1_config.ns b/svcomp/emulabSetup/smackbench_compute1_config.ns deleted file mode 100644 index d3b42f589..000000000 --- a/svcomp/emulabSetup/smackbench_compute1_config.ns +++ /dev/null @@ -1,18 +0,0 @@ -set ns [new Simulator] -source tb_compat.tcl - -#Nodes -set bench1 [$ns node] -tb-set-node-os $bench1 UBUNTU14-64-STD -tb-set-hardware $bench1 d820 -tb-set-node-startcmd $bench1 "/proj/SMACK/scripts/smackbench_compute_buildscript.sh >& /tmp/smackbench_compute_build.out" - -#Local Storage -set bs1 [$ns blockstore] -$bs1 set-class "local" -$bs1 set-placement "sysvol" -$bs1 set-mount-point "/mnt/local" -$bs1 set-node $bench1 - -$ns rtproto Static -$ns run diff --git a/svcomp/emulabSetup/smackbench_compute2_config.ns b/svcomp/emulabSetup/smackbench_compute2_config.ns deleted file mode 100644 index 853743c0f..000000000 --- a/svcomp/emulabSetup/smackbench_compute2_config.ns +++ /dev/null @@ -1,18 +0,0 @@ -set ns [new Simulator] -source tb_compat.tcl - -#Nodes -set bench2 [$ns node] -tb-set-node-os $bench2 UBUNTU14-64-STD -tb-set-hardware $bench2 d820 -tb-set-node-startcmd $bench2 "/proj/SMACK/scripts/smackbench_compute_buildscript.sh >& /tmp/smackbench_compute_build.out" - -#Local Storage -set bs1 [$ns blockstore] -$bs1 set-class "local" -$bs1 set-placement "sysvol" -$bs1 set-mount-point "/mnt/local" -$bs1 set-node $bench2 - -$ns rtproto Static -$ns run diff --git a/svcomp/emulabSetup/smackbench_compute3_config.ns b/svcomp/emulabSetup/smackbench_compute3_config.ns deleted file mode 100644 index 6e97dfa96..000000000 --- a/svcomp/emulabSetup/smackbench_compute3_config.ns +++ /dev/null @@ -1,18 +0,0 @@ -set ns [new Simulator] -source tb_compat.tcl - -#Nodes -set bench3 [$ns node] -tb-set-node-os $bench3 UBUNTU14-64-STD -tb-set-hardware $bench3 d820 -tb-set-node-startcmd $bench3 "/proj/SMACK/scripts/smackbench_compute_buildscript.sh >& /tmp/smackbench_compute_build.out" - -#Local Storage -set bs1 [$ns blockstore] -$bs1 set-class "local" -$bs1 set-placement "sysvol" -$bs1 set-mount-point "/mnt/local" -$bs1 set-node $bench3 - -$ns rtproto Static -$ns run diff --git a/svcomp/emulabSetup/smackbench_compute4_config.ns b/svcomp/emulabSetup/smackbench_compute4_config.ns deleted file mode 100644 index 2ecdc62cc..000000000 --- a/svcomp/emulabSetup/smackbench_compute4_config.ns +++ /dev/null @@ -1,18 +0,0 @@ -set ns [new Simulator] -source tb_compat.tcl - -#Nodes -set bench4 [$ns node] -tb-set-node-os $bench4 UBUNTU14-64-STD -tb-set-hardware $bench4 d820 -tb-set-node-startcmd $bench4 "/proj/SMACK/scripts/smackbench_compute_buildscript.sh >& /tmp/smackbench_compute_build.out" - -#Local Storage -set bs1 [$ns blockstore] -$bs1 set-class "local" -$bs1 set-placement "sysvol" -$bs1 set-mount-point "/mnt/local" -$bs1 set-node $bench4 - -$ns rtproto Static -$ns run diff --git a/svcomp/emulabSetup/smackbench_compute_buildscript.sh b/svcomp/emulabSetup/smackbench_compute_buildscript.sh deleted file mode 100755 index a07cc8898..000000000 --- a/svcomp/emulabSetup/smackbench_compute_buildscript.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -#Install htop -sudo apt-get update -sudo apt-get install htop -y -#Java is needed for running cpachecker -sudo apt-get install openjdk-7-jdk -y -sudo update-alternatives --config java -sudo update-alternatives --config javac -#Ant is needed for installing cpachecker -#(SMACKBench install should be run from compute node, -# since no sudo access on users.emulab.net. However, -# SMACKBench install is not needed on every compute -# node swapin, so this install isn't scripted here.) -sudo apt-get install ant -y - - -#Set permissions on local ephemeral storage, -#so sudo is not needed -sudo chgrp SMACK /mnt/local -sudo chmod g+w /mnt/local - -#Create directory for smack, clone smack, -#checkout develop and enter dir -mkdir -p /mnt/local/smack-project -cd /mnt/local/smack-project -git clone https://github.com/smackers/smack.git -cd smack/bin -git checkout svcomp2016 - -#Make sure add-apt-repository is installed -sudo apt-get update -sudo apt-get install software-properties-common -y - -#Build SMACK (using 64 processors during call to make) -sed -i 's/^ make$/ make -j 64/g' build.sh -sed -i 's/^ sudo make install$/ sudo make install -j 64/g' build.sh -./build.sh - -#Install cgroup support -sudo apt-get install cgroup-bin cgroup-lite cgmanager -y - -#Enable tracking of memory swapping for processes (requires reboot) -sudo sed -i '/GRUB_CMDLINE_LINUX=/ s/^\(.*\)\("\)/\1 swapaccount=1\2/' /etc/default/grub -sudo update-grub - -#Set up boot script to start on reboot -sudo bash -c "echo -e \"su -c '. /mnt/local/smack-project/smack.environment && cd /proj/SMACK/SMACKBenchResults && ./runServer.sh' mcarter &\" >> /etc/rc.local" - -#Upgrade kernel -sudo apt-get install --install-recommends linux-generic-lts-vivid -y - -#And all packages -sudo apt-get update -sudo apt-get upgrade -y -sudo apt-get update -sudo apt-get upgrade -y - -#Reboot -sudo reboot now - diff --git a/svcomp/emulabSetup/smackbench_compute_common_buildscript.sh b/svcomp/emulabSetup/smackbench_compute_common_buildscript.sh deleted file mode 100644 index 41a5672e1..000000000 --- a/svcomp/emulabSetup/smackbench_compute_common_buildscript.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -#Set permissions on local ephemeral storage, -#so sudo is not needed -sudo chgrp SMACK /mnt/local -sudo chmod g+w /mnt/local - -#Change apt-get mirror to local cs.utah.edu mirror (makes it much faster) -sudo sed -i "s|us.archive.ubuntu.com/ubuntu/|ubuntu.cs.utah.edu/ubuntu/|g" /etc/apt/sources.list - -#Install packages -sudo apt-get update -# Packages: -# htop - interactive convenience -# vim - interactive convenience -# cgroup-bin - benchexec (cgroups) -# cgroup-lite - benchexec (cgroups) -# cgmanager - benchexec (cgroups) -# software-properties-common - SMACK buildscript -# python-daemon - SMACKBench Server -# openjdk-7-jre - cpachecker witness checker -sudo apt-get install htop vim cgroup-bin cgroup-lite cgmanager software-properties-common python-daemon libc6-dev-i386 -y - -#Install java8 (required by cpachecker) -sudo add-apt-repository ppa:openjdk-r/ppa -y -sudo apt-get update -y -sudo apt-get install openjdk-8-jdk -y -echo 2 | sudo update-alternatives --config java - -#Upgrade kernel -sudo apt-get install --install-recommends linux-generic-lts-vivid -y - -#And all packages (except grub, because it requires interactive after kernel upgrade) -sudo apt-mark hold grub-common grub-pc grub-pc-bin grub2-common -sudo apt-get upgrade -y -sudo apt-get upgrade -y - -#Enable tracking of memory swapping for processes (requires reboot) -sudo sed -i '/GRUB_CMDLINE_LINUX=/ s/^\(.*\)\("\)/\1 swapaccount=1\2/' /etc/default/grub -sudo update-grub - -#Calling script must reboot after it finishes its portion! diff --git a/svcomp/emulabSetup/smackbench_compute_packaged_buildscript.sh b/svcomp/emulabSetup/smackbench_compute_packaged_buildscript.sh deleted file mode 100755 index 6347ec145..000000000 --- a/svcomp/emulabSetup/smackbench_compute_packaged_buildscript.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -#Call common buildscript -sh /proj/SMACK/scripts/smackbench_compute_common_buildscript.sh - -#Install mono (needed by packaged SMACK) -sudo apt-get install mono-complete -y - -#Set up boot script to start on reboot -sudo bash -c "echo -e \"su -c '. /mnt/local/smack-project/smack.environment && cd /proj/SMACK/SMACKBenchResults && ./runServer.sh' mcarter &\" >> /etc/rc.local" - -#Copy console log of this script off ephemeral storage -cp /tmp/smackbench_compute_build.out /mnt/local/ - -#Reboot -sudo reboot now diff --git a/svcomp/emulabSetup/smackbench_compute_repo_buildscript.sh b/svcomp/emulabSetup/smackbench_compute_repo_buildscript.sh deleted file mode 100755 index 7b730e8fb..000000000 --- a/svcomp/emulabSetup/smackbench_compute_repo_buildscript.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -#Call common buildscript -sh /proj/SMACK/scripts/smackbench_compute_common_buildscript.sh - -export DEBIAN_FRONTEND=noninteractive - -#Create directory for smack, clone smack, -#checkout develop and enter dir -mkdir -p /mnt/local/smack-project -cd /mnt/local/smack-project -git clone https://github.com/smackers/smack.git -cd smack/bin -#git checkout svcomp2016 -git checkout develop -#git checkout llvm-3.7 -#git checkout svcomp2017 -#git checkout avoid-mem-safety-region-collapse - -#Build SMACK (using 64 processors during call to make) -sed -i 's/^ make$/ make -j 64/g' build.sh -sed -i 's/^ sudo make install$/ sudo make install -j 64/g' build.sh -./build.sh - -#Set up boot script to start on reboot -#sudo bash -c "echo -e \"su -c '. /mnt/local/smack-project/smack.environment && cd /proj/SMACK/SMACKBenchResults && ./runServer.sh' mcarter &\" >> /etc/rc.local" - -#Copy console log of this script off ephemeral storage -cp /tmp/smackbench_compute_build.out /mnt/local/ - -#Reboot -sudo reboot now - diff --git a/svcomp/emulabSetup/smackbench_webserver_buildscript.sh b/svcomp/emulabSetup/smackbench_webserver_buildscript.sh deleted file mode 100755 index 7ea2fe2a4..000000000 --- a/svcomp/emulabSetup/smackbench_webserver_buildscript.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -#Install htop -sudo apt-get update -sudo apt-get install htop -y -sudo apt-get install apache2 -y - -#Change document root -sudo sed -i 's,/var/www/html,/proj/SMACK/SMACKBenchResults/data,g' /etc/apache2/sites-available/000-default.conf -#Add directory configuration (inserts after documentroot directive) -sudo awk '/DocumentRoot/ {print; -print " "; -print " Options Indexes FollowSymLinks ExecCGI"; -print " AddHandler cgi-script .py"; -print " AllowOverride None"; -print " Require all granted"; -print " DirectoryIndex index.py"; -print " # This causes these files to be downloaded, vs displaying"; -print " # directly in browser"; -print " "; -print " Header set Content-Disposition attachment"; -print " ForceType application/octet-stream"; -print " "; -print " "; -next}1' /etc/apache2/sites-available/000-default.conf > /tmp/tmp && sudo mv /tmp/tmp /etc/apache2/sites-available/000-default.conf -sudo a2enmod cgi -sudo a2enmod headers -sudo apache2ctl restart -sudo apache2ctl restart diff --git a/svcomp/emulabSetup/smackbench_webserver_config.ns b/svcomp/emulabSetup/smackbench_webserver_config.ns deleted file mode 100644 index 9968ab4d6..000000000 --- a/svcomp/emulabSetup/smackbench_webserver_config.ns +++ /dev/null @@ -1,11 +0,0 @@ -set ns [new Simulator] -source tb_compat.tcl - -#Nodes -set node0 [$ns node] -tb-set-node-os $node0 UBUNTU14-64-STD -tb-set-hardware $node0 pc3000 -tb-set-node-startcmd $node0 "/proj/SMACK/scripts/smackbench_webserver_buildscript.sh >& /tmp/smackbench_webserver_build.out" - -$ns rtproto Static -$ns run \ No newline at end of file diff --git a/test/basic/ase_example.c b/test/basic/ase_example.c index 77987eea8..4cc36d802 100644 --- a/test/basic/ase_example.c +++ b/test/basic/ase_example.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --unroll=11 // @expect verified @@ -10,9 +10,7 @@ typedef struct { int f2; } Elem; -Elem* alloc(int size) { - return (Elem*)malloc(size * sizeof(Elem)); -} +Elem *alloc(int size) { return (Elem *)malloc(size * sizeof(Elem)); } void init(int size) { int i; @@ -33,7 +31,4 @@ void init(int size) { } } -int main(void) { - init(10); -} - +int main(void) { init(10); } diff --git a/test/basic/ase_example_fail.c b/test/basic/ase_example_fail.c index 990f4e7b0..ddb59df68 100644 --- a/test/basic/ase_example_fail.c +++ b/test/basic/ase_example_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --unroll=11 // @expect error @@ -10,9 +10,7 @@ typedef struct { int f2; } Elem; -Elem* alloc(int size) { - return (Elem*)malloc(size * sizeof(Elem)); -} +Elem *alloc(int size) { return (Elem *)malloc(size * sizeof(Elem)); } void init(int size) { int i; @@ -33,7 +31,4 @@ void init(int size) { } } -int main(void) { - init(10); -} - +int main(void) { init(10); } diff --git a/test/basic/atomic_cas.c b/test/basic/atomic_cas.c index 9c7496c9d..8def98678 100644 --- a/test/basic/atomic_cas.c +++ b/test/basic/atomic_cas.c @@ -1,16 +1,15 @@ -#include #include "smack.h" +#include // @expect verified -#define CAS(x,y,z) __atomic_compare_exchange_n(x,&(y),z,true,0,0) +#define CAS(x, y, z) __atomic_compare_exchange_n(x, &(y), z, true, 0, 0) int main(void) { int *x = 0; int y = 0; int *z = x; - CAS(&z,x,&y); // if (z == x) z = &y; + CAS(&z, x, &y); // if (z == x) z = &y; assert(*z == y); return 0; } - diff --git a/test/basic/atomic_cas_fail.c b/test/basic/atomic_cas_fail.c index f01f512b8..bb1d2a5ef 100644 --- a/test/basic/atomic_cas_fail.c +++ b/test/basic/atomic_cas_fail.c @@ -1,16 +1,15 @@ -#include #include "smack.h" +#include // @expect error -#define CAS(x,y,z) __atomic_compare_exchange_n(x,&(y),z,true,0,0) +#define CAS(x, y, z) __atomic_compare_exchange_n(x, &(y), z, true, 0, 0) int main(void) { int *x = 0; int y = 0; int *z = x; - CAS(&z,x,&y); // if (z == x) z = &y; + CAS(&z, x, &y); // if (z == x) z = &y; assert(*z != y); return 0; } - diff --git a/test/basic/big_types.c b/test/basic/big_types.c index f22b0df31..5ac9de22f 100644 --- a/test/basic/big_types.c +++ b/test/basic/big_types.c @@ -1,20 +1,20 @@ +#include #include #include -#include // @expect verified typedef struct { - unsigned a: 32; - unsigned b: 32; - unsigned c: 32; + unsigned a : 32; + unsigned b : 32; + unsigned c : 32; } S1; typedef struct { - unsigned a: 32; - unsigned b: 32; - unsigned c: 32; - unsigned d: 32; + unsigned a : 32; + unsigned b : 32; + unsigned c : 32; + unsigned d : 32; } S2; int main(void) { diff --git a/test/basic/checking.c b/test/basic/checking.c index 2d1525cac..e9e236671 100644 --- a/test/basic/checking.c +++ b/test/basic/checking.c @@ -1,14 +1,12 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error // @checkbpl grep "call foo" -// @checkout grep "checking.c(11,1)" +// @checkout grep "checking.c(12,3)" -void foo(void) { - -} +void foo(void) {} int main(void) { foo(); diff --git a/test/basic/checking_invert_bpl.c b/test/basic/checking_invert_bpl.c index b5249c9ca..6b75b4f97 100644 --- a/test/basic/checking_invert_bpl.c +++ b/test/basic/checking_invert_bpl.c @@ -1,14 +1,12 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error // @checkbpl grep -v "call bar" -// @checkout grep "checking_invert_bpl.c(11,1)" +// @checkout grep "checking_invert_bpl.c(12,3)" -void foo(void) { - -} +void foo(void) {} int main(void) { foo(); diff --git a/test/basic/checking_invert_out.c b/test/basic/checking_invert_out.c index 41b746fca..15c58389c 100644 --- a/test/basic/checking_invert_out.c +++ b/test/basic/checking_invert_out.c @@ -1,14 +1,12 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error // @checkbpl grep "call foo" // @checkout grep -v "checking_invert_out.c(10,1)" -void foo(void) { - -} +void foo(void) {} int main(void) { foo(); diff --git a/test/basic/config.yml b/test/basic/config.yml index 082861c1f..65fa4127a 100644 --- a/test/basic/config.yml +++ b/test/basic/config.yml @@ -1 +1 @@ -skip: false +skip : false diff --git a/test/basic/extern_func.c b/test/basic/extern_func.c index 5ac151553..c10edf64c 100644 --- a/test/basic/extern_func.c +++ b/test/basic/extern_func.c @@ -9,4 +9,3 @@ int main(void) { a = foo(10); return a; } - diff --git a/test/basic/extern_mem.c b/test/basic/extern_mem.c index 67ad831ac..37e633dbf 100644 --- a/test/basic/extern_mem.c +++ b/test/basic/extern_mem.c @@ -1,10 +1,10 @@ -#include #include +#include // @expect verified void foo(); -int* bar(); +int *bar(); int main() { int *x = malloc(4); diff --git a/test/basic/extern_mem_fail.c b/test/basic/extern_mem_fail.c index 42685d025..b2fb4d566 100644 --- a/test/basic/extern_mem_fail.c +++ b/test/basic/extern_mem_fail.c @@ -1,10 +1,10 @@ -#include #include +#include // @expect error void foo(int *); -int* bar(); +int *bar(); int main() { int *x = malloc(4); diff --git a/test/basic/gcd.c b/test/basic/gcd.c index 85fe5af4d..6d0667f6b 100644 --- a/test/basic/gcd.c +++ b/test/basic/gcd.c @@ -6,8 +6,10 @@ int gcd_test(int a, int b) { int t; - if (a < 0) a = -a; - if (b < 0) b = -b; + if (a < 0) + a = -a; + if (b < 0) + b = -b; while (b != 0) { t = b; @@ -29,4 +31,3 @@ int main(void) { return 0; } - diff --git a/test/basic/gcd_1_true.c b/test/basic/gcd_1_true.c index 9c84283e4..cbc929b0e 100644 --- a/test/basic/gcd_1_true.c +++ b/test/basic/gcd_1_true.c @@ -2,34 +2,33 @@ // @expect verified -signed int gcd_test(signed int a, signed int b) -{ - signed int t; - - if (a < 0) a = -a; - if (b < 0) b = -b; - - while (b != 0) { - t = b; - b = a % b; - a = t; - } - return t; +signed int gcd_test(signed int a, signed int b) { + signed int t; + + if (a < 0) + a = -a; + if (b < 0) + b = -b; + + while (b != 0) { + t = b; + b = a % b; + a = t; + } + return t; } +int main() { + // signed int x = __VERIFIER_nondet_int(); + // signed int y = __VERIFIER_nondet_int(); + signed int x = 12; + signed int y = 4; + signed int g; -int main() -{ - //signed int x = __VERIFIER_nondet_int(); - //signed int y = __VERIFIER_nondet_int(); - signed int x = 12; - signed int y = 4; - signed int g; - - if (y > 0 && x % y == 0) { - g = gcd_test(x, y); - assert(g == y); - } + if (y > 0 && x % y == 0) { + g = gcd_test(x, y); + assert(g == y); + } - return 0; + return 0; } diff --git a/test/basic/globals.c b/test/basic/globals.c index 57d111460..3708022cd 100644 --- a/test/basic/globals.c +++ b/test/basic/globals.c @@ -1,17 +1,16 @@ -#include #include "smack.h" +#include // @expect verified int g1; int g2; -int main(void){ - int *x = (int*)malloc(sizeof(int)); +int main(void) { + int *x = (int *)malloc(sizeof(int)); g1 = 3; *x = 4; g2 = 5; assert(g1 == 3 && *x == 4 && g2 == 5); } - diff --git a/test/basic/globals_fail.c b/test/basic/globals_fail.c index eea756b11..9a36c34b9 100644 --- a/test/basic/globals_fail.c +++ b/test/basic/globals_fail.c @@ -1,17 +1,16 @@ -#include #include "smack.h" +#include // @expect error int g1; int g2; -int main(void){ - int *x = (int*)malloc(sizeof(int)); +int main(void) { + int *x = (int *)malloc(sizeof(int)); g1 = 3; *x = 4; g2 = 5; assert(g1 != 3 || *x != 4 || g2 != 5); } - diff --git a/test/basic/init_funcs_example.c b/test/basic/init_funcs_example.c index 91acf133b..5f33bf559 100644 --- a/test/basic/init_funcs_example.c +++ b/test/basic/init_funcs_example.c @@ -11,7 +11,6 @@ // // See share/smack/include/pthread.h for an actual, live example. - // In normal use, these would be listed somewhere in the header file // containing out model (it does not need to be in a __SMACK_INIT call). __SMACK_INIT(defineProcessStates) { @@ -27,11 +26,11 @@ __SMACK_INIT(defineProcessStates) { // since this assumption is not just a declaration/definition. // This definition would also be listed in the model's header file. __SMACK_INIT(initializeProcessStates) { - __SMACK_code("assume (forall x:ref :: $processStatus[x] == $process_uninitialized);"); + __SMACK_code( + "assume (forall x:ref :: $processStatus[x] == $process_uninitialized);"); } int main(void) { - void* idx = __VERIFIER_nondet_pointer(); + void *idx = __VERIFIER_nondet_pointer(); __SMACK_code("assert($processStatus[@] == $process_uninitialized);", idx); } - diff --git a/test/basic/init_funcs_example_fail.c b/test/basic/init_funcs_example_fail.c index 34e68c2b1..1c7aaaad8 100644 --- a/test/basic/init_funcs_example_fail.c +++ b/test/basic/init_funcs_example_fail.c @@ -11,7 +11,6 @@ // // See share/smack/include/pthread.h for an actual, live example. - // In normal use, these would be listed somewhere in the header file // containing out model (it does not need to be in a __SMACK_INIT call). __SMACK_INIT(defineProcessStates) { @@ -27,11 +26,11 @@ __SMACK_INIT(defineProcessStates) { // since this assumption is not just a declaration/definition. // This definition would also be listed in the model's header file. __SMACK_INIT(initializeProcessStates) { - __SMACK_code("assume (forall x:ref :: $processStatus[x] == $process_uninitialized);"); + __SMACK_code( + "assume (forall x:ref :: $processStatus[x] == $process_uninitialized);"); } int main(void) { - void* idx = __VERIFIER_nondet_pointer(); + void *idx = __VERIFIER_nondet_pointer(); __SMACK_code("assert($processStatus[@] != $process_uninitialized);", idx); } - diff --git a/test/basic/init_funcs_global.c b/test/basic/init_funcs_global.c index 59583688a..cd356b457 100644 --- a/test/basic/init_funcs_global.c +++ b/test/basic/init_funcs_global.c @@ -4,15 +4,11 @@ int g = 10; -__SMACK_INIT(g1) { - g = 11; -} +__SMACK_INIT(g1) { g = 11; } -__SMACK_INIT(g2) { - g = 12; -} +__SMACK_INIT(g2) { g = 12; } -void main() { +int main(void) { assert(g == 12); + return 0; } - diff --git a/test/basic/init_funcs_global_fail.c b/test/basic/init_funcs_global_fail.c index 94c4d05ee..8b041e267 100644 --- a/test/basic/init_funcs_global_fail.c +++ b/test/basic/init_funcs_global_fail.c @@ -4,15 +4,11 @@ int g = 10; -__SMACK_INIT(g1) { - g = 11; -} +__SMACK_INIT(g1) { g = 11; } -__SMACK_INIT(g2) { - g = 12; -} +__SMACK_INIT(g2) { g = 12; } -void main() { +int main(void) { assert(g == 0 || g == 10 || g == 11); + return 0; } - diff --git a/test/basic/jain_1_true.c b/test/basic/jain_1_true.c index e335de480..0a35821ae 100644 --- a/test/basic/jain_1_true.c +++ b/test/basic/jain_1_true.c @@ -2,25 +2,12 @@ // @expect verified -/*extern int __VERIFIER_nondet_int(void); -void __VERIFIER_assert(int cond) { - if (!(cond)) { - ERROR: goto ERROR; - } - return; -}*/ -void main() -{ - int y; - - y = 1; - - while(1) - { - y = y +2*__VERIFIER_nondet_int(); +int main(void) { + int y = 1; - - assert (y!=0); - - } + while (1) { + y = y + 2 * __VERIFIER_nondet_int(); + assert(y != 0); + } + return 0; } diff --git a/test/basic/jain_2_true.c b/test/basic/jain_2_true.c index 21612f3d0..0df0d16b3 100644 --- a/test/basic/jain_2_true.c +++ b/test/basic/jain_2_true.c @@ -2,27 +2,13 @@ // @expect verified -/*extern int __VERIFIER_nondet_int(void); -void __VERIFIER_assert(int cond) { - if (!(cond)) { - ERROR: goto ERROR; - } - return; -} -*/ -void main() -{ - int x,y; - - x = 1; - y = 1; +int main(void) { + int x = 1, y = 1; - while(1) - { - x = x +2*__VERIFIER_nondet_int(); - y = y +2*__VERIFIER_nondet_int(); - - - assert(x+y!=1); - } + while (1) { + x = x + 2 * __VERIFIER_nondet_int(); + y = y + 2 * __VERIFIER_nondet_int(); + assert(x + y != 1); + } + return 0; } diff --git a/test/basic/jain_4_true.c b/test/basic/jain_4_true.c index 909985192..b89dac2e7 100644 --- a/test/basic/jain_4_true.c +++ b/test/basic/jain_4_true.c @@ -2,28 +2,14 @@ // @expect verified -/*extern int __VERIFIER_nondet_int(void); -void __VERIFIER_assert(int cond) { - if (!(cond)) { - ERROR: goto ERROR; +int main(void) { + int x = 0, y = 0, z = 0; + + while (1) { + x = x + 4 * __VERIFIER_nondet_int(); + y = y + 4 * __VERIFIER_nondet_int(); + z = z + 8 * __VERIFIER_nondet_int(); + assert(x + y + z != 1); } - return; -} -*/ -void main() -{ - int x,y,z; - - x=0; - y=0; - z=0; - - while(1) - { - x = x +4*__VERIFIER_nondet_int(); - y = y +4*__VERIFIER_nondet_int(); - z = z +8*__VERIFIER_nondet_int(); - - assert(x+y+z!=1); - } + return 0; } diff --git a/test/basic/jain_5_true.c b/test/basic/jain_5_true.c index 0afe1d66c..020116099 100644 --- a/test/basic/jain_5_true.c +++ b/test/basic/jain_5_true.c @@ -2,28 +2,13 @@ // @expect verified -/*extern int __VERIFIER_nondet_int(void); -void __VERIFIER_assert(int cond) { - if (!(cond)) { - ERROR: goto ERROR; - } - return; -} -*/ -void main() -{ - int x,y; - - x=0; - y=4; - +int main(void) { + int x = 0, y = 4; - while(1) - { - x = x + y; - y = y +4; - - - assert(x!=30); - } + while (1) { + x = x + y; + y = y + 4; + assert(x != 30); + } + return 0; } diff --git a/test/basic/limits.c b/test/basic/limits.c index f7ab33414..ccd12e39e 100644 --- a/test/basic/limits.c +++ b/test/basic/limits.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect verified @@ -76,7 +76,7 @@ int main(void) { unsigned long long int x24 = __VERIFIER_nondet_unsigned_long_long_int(); assert(x24 >= 0 && x24 <= ULLONG_MAX); -// Used in SVCCOMP benchmarks + // Used in SVCCOMP benchmarks _Bool x25 = __VERIFIER_nondet_bool(); assert(x25 == 0 || x25 == 1); @@ -94,4 +94,3 @@ int main(void) { return 0; } - diff --git a/test/basic/limits_fail.c b/test/basic/limits_fail.c index ce61725a4..290d27302 100644 --- a/test/basic/limits_fail.c +++ b/test/basic/limits_fail.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect error @@ -76,7 +76,7 @@ int main(void) { unsigned long long int x24 = __VERIFIER_nondet_unsigned_long_long_int(); assert(x24 >= 0 && x24 <= ULLONG_MAX); -// Used in SVCCOMP benchmarks + // Used in SVCCOMP benchmarks _Bool x25 = __VERIFIER_nondet_bool(); assert(x25 == 0 || x25 == 1); @@ -94,4 +94,3 @@ int main(void) { return 0; } - diff --git a/test/basic/list.c b/test/basic/list.c index e987f0494..a23dd14ec 100644 --- a/test/basic/list.c +++ b/test/basic/list.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @flag --unroll=4 // @expect verified @@ -11,16 +11,16 @@ typedef struct list { mlist *head; -mlist* search_list(mlist *l, int k) { +mlist *search_list(mlist *l, int k) { l = head; - while(l != NULL && l->key != k) { + while (l != NULL && l->key != k) { l = l->next; } return l; } void insert_list(mlist *l, int k) { - l = (mlist*)malloc(sizeof(mlist)); + l = (mlist *)malloc(sizeof(mlist)); l->key = k; if (head == NULL) { l->next = NULL; @@ -28,7 +28,7 @@ void insert_list(mlist *l, int k) { l->key = k; l->next = head; } - head = l; + head = l; } int main(void) { @@ -41,4 +41,3 @@ int main(void) { temp = search_list(head, 2); assert(temp->key == 2); } - diff --git a/test/basic/list_fail.c b/test/basic/list_fail.c index 3d85b7fc9..000dd1548 100644 --- a/test/basic/list_fail.c +++ b/test/basic/list_fail.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @flag --unroll=4 // @expect error @@ -11,16 +11,16 @@ typedef struct list { mlist *head; -mlist* search_list(mlist *l, int k) { +mlist *search_list(mlist *l, int k) { l = head; - while(l != NULL && l->key != k) { + while (l != NULL && l->key != k) { l = l->next; } return l; } void insert_list(mlist *l, int k) { - l = (mlist*)malloc(sizeof(mlist)); + l = (mlist *)malloc(sizeof(mlist)); l->key = k; if (head == NULL) { l->next = NULL; @@ -28,7 +28,7 @@ void insert_list(mlist *l, int k) { l->key = k; l->next = head; } - head = l; + head = l; } int main(void) { @@ -41,4 +41,3 @@ int main(void) { temp = search_list(head, 2); assert(temp->key != 2); } - diff --git a/test/basic/lock.c b/test/basic/lock.c index 40ce66452..eba337142 100644 --- a/test/basic/lock.c +++ b/test/basic/lock.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -34,4 +34,3 @@ int main(void) { release_lock(&global_lock); return 0; } - diff --git a/test/basic/lock_fail.c b/test/basic/lock_fail.c index eb3580fd8..9ee483f1a 100644 --- a/test/basic/lock_fail.c +++ b/test/basic/lock_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -34,4 +34,3 @@ int main(void) { acquire_lock(&global_lock); return 0; } - diff --git a/test/basic/loop.c b/test/basic/loop.c index e4cdb9ddb..3cc7155a3 100644 --- a/test/basic/loop.c +++ b/test/basic/loop.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=11 // @flag --unroll=11 @@ -21,4 +21,3 @@ int main() { assert(x == MAXSIZE - 1); return 0; } - diff --git a/test/basic/loop1.c b/test/basic/loop1.c index 2e7cc7913..9a77c310e 100644 --- a/test/basic/loop1.c +++ b/test/basic/loop1.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=11 // @flag --unroll=11 @@ -21,4 +21,3 @@ int main() { assert(x == 1); return 0; } - diff --git a/test/basic/loop1_fail.c b/test/basic/loop1_fail.c index c1778e6c0..ade70f134 100644 --- a/test/basic/loop1_fail.c +++ b/test/basic/loop1_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=11 // @flag --unroll=11 @@ -21,4 +21,3 @@ int main() { assert(x != 1); return 0; } - diff --git a/test/basic/loop_fail.c b/test/basic/loop_fail.c index 6900f4c73..ac62df7e6 100644 --- a/test/basic/loop_fail.c +++ b/test/basic/loop_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=11 // @flag --unroll=11 @@ -21,4 +21,3 @@ int main() { assert(x != MAXSIZE - 1); return 0; } - diff --git a/test/basic/negative_numbers.c b/test/basic/negative_numbers.c index e27d78348..4837204db 100644 --- a/test/basic/negative_numbers.c +++ b/test/basic/negative_numbers.c @@ -2,9 +2,7 @@ // @expect verified -int incr(int x) { - return x + 1; -} +int incr(int x) { return x + 1; } int main(void) { int a = -11; @@ -12,4 +10,3 @@ int main(void) { assert(a == -10); return 0; } - diff --git a/test/basic/negative_numbers_fail.c b/test/basic/negative_numbers_fail.c index 35099b535..edd48ed71 100644 --- a/test/basic/negative_numbers_fail.c +++ b/test/basic/negative_numbers_fail.c @@ -2,9 +2,7 @@ // @expect error -int incr(int x) { - return x + 1; -} +int incr(int x) { return x + 1; } int main(void) { int a = -11; @@ -12,4 +10,3 @@ int main(void) { assert(a == 12); return 0; } - diff --git a/test/basic/nondet.c b/test/basic/nondet.c index 40a9886bf..f7547a3cd 100644 --- a/test/basic/nondet.c +++ b/test/basic/nondet.c @@ -14,4 +14,3 @@ int main(void) { assert(x == 0 || x == 2); return 0; } - diff --git a/test/basic/printfs.c b/test/basic/printfs.c index 10265b1c0..e1683ea44 100644 --- a/test/basic/printfs.c +++ b/test/basic/printfs.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect verified @@ -11,4 +11,3 @@ int main(void) { printf("Hello World %d %d %d\n", 10, 20, 30); printf("Hello World %d %d %d %d\n", 10, 20, 30, 40); } - diff --git a/test/basic/return_label.c b/test/basic/return_label.c index 25e369c92..a12d08672 100644 --- a/test/basic/return_label.c +++ b/test/basic/return_label.c @@ -11,9 +11,8 @@ int main() { goto out; } - out: - return 0; - ERROR: - return 0; +out: + return 0; +ERROR: + return 0; } - diff --git a/test/basic/simple.c b/test/basic/simple.c index afae3a187..3f1eff03f 100644 --- a/test/basic/simple.c +++ b/test/basic/simple.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -14,4 +14,3 @@ int main(void) { assert(b == 3 || a == -1 || b == 0); return a; } - diff --git a/test/basic/simple_fail.c b/test/basic/simple_fail.c index 641957d25..7ca0e570f 100644 --- a/test/basic/simple_fail.c +++ b/test/basic/simple_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -12,4 +12,3 @@ int main(void) { assert(a != -1); return a; } - diff --git a/test/basic/simple_pre.c b/test/basic/simple_pre.c index 52deff886..22ffcc231 100644 --- a/test/basic/simple_pre.c +++ b/test/basic/simple_pre.c @@ -1,12 +1,10 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified -int returnOne() { - return 1; -} +int returnOne() { return 1; } int main(void) { int a; @@ -16,4 +14,3 @@ int main(void) { assert(a == 1); return a; } - diff --git a/test/basic/simple_pre1.c b/test/basic/simple_pre1.c index 75cc785ff..1356968c4 100644 --- a/test/basic/simple_pre1.c +++ b/test/basic/simple_pre1.c @@ -1,12 +1,10 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified -int incr(int x) { - return x; -} +int incr(int x) { return x; } int main(void) { int a; @@ -16,4 +14,3 @@ int main(void) { assert(a == -1); return a; } - diff --git a/test/basic/simple_pre1_fail.c b/test/basic/simple_pre1_fail.c index d19b80fdb..18067a1fa 100644 --- a/test/basic/simple_pre1_fail.c +++ b/test/basic/simple_pre1_fail.c @@ -1,12 +1,10 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error -int incr(int x) { - return ++x; -} +int incr(int x) { return ++x; } int main(void) { int a; @@ -16,4 +14,3 @@ int main(void) { assert(a == -1); return a; } - diff --git a/test/basic/simple_pre2.c b/test/basic/simple_pre2.c index 72ec70bbf..cf1fa13f7 100644 --- a/test/basic/simple_pre2.c +++ b/test/basic/simple_pre2.c @@ -1,12 +1,10 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified -int incr(int x) { - return x + 1; -} +int incr(int x) { return x + 1; } int main(void) { int a; @@ -16,4 +14,3 @@ int main(void) { assert(a == 2); return a; } - diff --git a/test/basic/simple_pre2_fail.c b/test/basic/simple_pre2_fail.c index 562f455d2..aaa56eed2 100644 --- a/test/basic/simple_pre2_fail.c +++ b/test/basic/simple_pre2_fail.c @@ -1,12 +1,10 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error -int incr(int x) { - return x + 1; -} +int incr(int x) { return x + 1; } int main(void) { int a; @@ -16,4 +14,3 @@ int main(void) { assert(a == 1); return a; } - diff --git a/test/basic/simple_pre3.c b/test/basic/simple_pre3.c index 59ea34304..0cfa734c1 100644 --- a/test/basic/simple_pre3.c +++ b/test/basic/simple_pre3.c @@ -1,12 +1,10 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified -int returnOne() { - return 1; -} +int returnOne() { return 1; } int main(void) { int a; @@ -16,4 +14,3 @@ int main(void) { assert(a == 1 || a == 2); return a; } - diff --git a/test/basic/simple_pre3_fail.c b/test/basic/simple_pre3_fail.c index 24d1b7dac..4627f21e4 100644 --- a/test/basic/simple_pre3_fail.c +++ b/test/basic/simple_pre3_fail.c @@ -1,12 +1,10 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error -int returnOne() { - return 1; -} +int returnOne() { return 1; } int main(void) { int a; @@ -16,4 +14,3 @@ int main(void) { assert(a == -1 || a == 2); return a; } - diff --git a/test/basic/simple_pre4.c b/test/basic/simple_pre4.c index 313abc20a..527ecd1f7 100644 --- a/test/basic/simple_pre4.c +++ b/test/basic/simple_pre4.c @@ -1,12 +1,10 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified -short incr(short x) { - return ++x; -} +short incr(short x) { return ++x; } int main(void) { short a; @@ -16,4 +14,3 @@ int main(void) { assert(a > -2); return a; } - diff --git a/test/basic/simple_pre4_fail.c b/test/basic/simple_pre4_fail.c index 4324d36d0..b6da3eb93 100644 --- a/test/basic/simple_pre4_fail.c +++ b/test/basic/simple_pre4_fail.c @@ -1,12 +1,10 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error -short incr(short x) { - return ++x; -} +short incr(short x) { return ++x; } int main(void) { short a; @@ -16,4 +14,3 @@ int main(void) { assert(a > -1); return a; } - diff --git a/test/basic/simple_pre_fail.c b/test/basic/simple_pre_fail.c index 828e576c8..c29563d7b 100644 --- a/test/basic/simple_pre_fail.c +++ b/test/basic/simple_pre_fail.c @@ -1,12 +1,10 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error -int returnOne() { - return 1; -} +int returnOne() { return 1; } int main(void) { int a; @@ -16,4 +14,3 @@ int main(void) { assert(a == -1); return a; } - diff --git a/test/basic/smack_code_call.c b/test/basic/smack_code_call.c index b1c86c4a1..891ded045 100644 --- a/test/basic/smack_code_call.c +++ b/test/basic/smack_code_call.c @@ -1,11 +1,9 @@ -#include #include "smack.h" +#include // @expect verified -void foo(int *x) { - *x = *x + 10; -} +void foo(int *x) { *x = *x + 10; } int main(void) { int *y = malloc(sizeof(int)); @@ -16,9 +14,9 @@ int main(void) { // using a dummy unreachable call, force DSA to analyze foo so // that __SMACK_code works properly assume(tmp == 0); - if (tmp) foo(y); - __SMACK_code("call foo(@);",y); + if (tmp) + foo(y); + __SMACK_code("call foo(@);", y); assert(*y == 20); } - diff --git a/test/basic/smack_code_call_fail.c b/test/basic/smack_code_call_fail.c index b4da3e7f0..d4c266e9a 100644 --- a/test/basic/smack_code_call_fail.c +++ b/test/basic/smack_code_call_fail.c @@ -1,11 +1,9 @@ -#include #include "smack.h" +#include // @expect error -void foo(int *x) { - *x = *x + 10; -} +void foo(int *x) { *x = *x + 10; } int main(void) { int *y = malloc(sizeof(int)); @@ -16,9 +14,9 @@ int main(void) { // using a dummy unreachable call, force DSA to analyze foo so // that __SMACK_code works properly assume(tmp == 0); - if (tmp) foo(y); - __SMACK_code("call foo(@);",y); + if (tmp) + foo(y); + __SMACK_code("call foo(@);", y); assert(*y == 10); } - diff --git a/test/basic/split_aggregate_values_fail.c b/test/basic/split_aggregate_values_fail.c index fa96545b4..9f18d511f 100644 --- a/test/basic/split_aggregate_values_fail.c +++ b/test/basic/split_aggregate_values_fail.c @@ -1,6 +1,6 @@ #include "smack.h" -// @expect error +// @expect error typedef struct { int x; diff --git a/test/basic/strings1.c b/test/basic/strings1.c index 21a62393a..b5a5205eb 100644 --- a/test/basic/strings1.c +++ b/test/basic/strings1.c @@ -7,4 +7,3 @@ int main() { assert(s1[3] == 'd'); return 0; } - diff --git a/test/basic/strings1_fail.c b/test/basic/strings1_fail.c index e7c19034a..966720a2e 100644 --- a/test/basic/strings1_fail.c +++ b/test/basic/strings1_fail.c @@ -7,4 +7,3 @@ int main() { assert(s1[3] == 'f'); return 0; } - diff --git a/test/basic/test_memcpy.c b/test/basic/test_memcpy.c index 0934a0729..e59bbf6ab 100644 --- a/test/basic/test_memcpy.c +++ b/test/basic/test_memcpy.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect verified diff --git a/test/basic/test_memcpy_fail.c b/test/basic/test_memcpy_fail.c index 1389fcf87..b17269bff 100644 --- a/test/basic/test_memcpy_fail.c +++ b/test/basic/test_memcpy_fail.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect error @@ -10,4 +10,3 @@ int main(void) { assert(a != b); return 0; } - diff --git a/test/basic/timing-annotations.c b/test/basic/timing-annotations.c index dcadf7fc8..6b3f50104 100644 --- a/test/basic/timing-annotations.c +++ b/test/basic/timing-annotations.c @@ -1,24 +1,22 @@ +#include "smack.h" #include #include -#include "smack.h" -//This test ensures that the timing-annotations are respected -//and show up in the generated boogie. -//Currently, we just do the simplest thing and make sure that -//there is at least one instruction with expected cost. +// This test ensures that the timing-annotations are respected +// and show up in the generated boogie. +// Currently, we just do the simplest thing and make sure that +// there is at least one instruction with expected cost. // @flag --timing-annotations // @expect verified // @checkbpl grep "smack.InstTimingCost.Int64 1" -int foo(int a, int b) { - return a + b; -} +int foo(int a, int b) { return a + b; } int main(void) { int a = 10; int b = 9; - int c = foo(a,b); + int c = foo(a, b); assert(c != 0); return 0; } diff --git a/test/basic/transform-bpl.c b/test/basic/transform-bpl.c index af998879a..18e2d146b 100644 --- a/test/basic/transform-bpl.c +++ b/test/basic/transform-bpl.c @@ -1,21 +1,17 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified // @flag --transform-bpl "sed 's/\(call .*\) bar/\1 foo/'" -int foo(void) { - return 0; -} +int foo(void) { return 0; } -int bar(void) { - return 1; -} +int bar(void) { return 1; } int main(void) { int x = foo(); int y = bar(); - assert (y == 0); + assert(y == 0); return 0; } diff --git a/test/basic/transform-out.c b/test/basic/transform-out.c index eca04b279..d56756fc9 100644 --- a/test/basic/transform-out.c +++ b/test/basic/transform-out.c @@ -1,11 +1,11 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified // @flag --transform-out "sed -e 's/[[:digit:]]* verified, [[:digit:]]* error/1 verified, 0 errors/' -e 's/can fail/no bugs/'" int main(void) { - assert (0); + assert(0); return 0; } diff --git a/test/basic/uninterpreted.c b/test/basic/uninterpreted.c index a1574153a..5689f8fa0 100644 --- a/test/basic/uninterpreted.c +++ b/test/basic/uninterpreted.c @@ -9,7 +9,6 @@ int foo(int x) { return y; } - int main(void) { int x = foo(42); int y = foo(42); diff --git a/test/basic/uninterpreted_fail.c b/test/basic/uninterpreted_fail.c index 88ff6648c..4af2c8cd0 100644 --- a/test/basic/uninterpreted_fail.c +++ b/test/basic/uninterpreted_fail.c @@ -9,7 +9,6 @@ int foo(int x) { return y; } - int main(void) { int x = foo(42); int y = foo(43); diff --git a/test/basic/vararg.c b/test/basic/vararg.c index 9f54c8aed..88288889f 100644 --- a/test/basic/vararg.c +++ b/test/basic/vararg.c @@ -1,6 +1,6 @@ -#include -#include #include "smack.h" +#include +#include // @expect verified @@ -18,4 +18,3 @@ int main(void) { panic(1, 2); return 0; } - diff --git a/test/basic/vararg_fail.c b/test/basic/vararg_fail.c index e1bbc0d6e..e476c156c 100644 --- a/test/basic/vararg_fail.c +++ b/test/basic/vararg_fail.c @@ -1,6 +1,6 @@ -#include -#include #include "smack.h" +#include +#include // @expect error @@ -18,4 +18,3 @@ int main(void) { panic(2, 2); return 0; } - diff --git a/test/bits/absolute.c b/test/bits/absolute.c index 5052954c3..b78086153 100644 --- a/test/bits/absolute.c +++ b/test/bits/absolute.c @@ -5,7 +5,7 @@ int main(void) { int v = __VERIFIER_nondet_int(); // we want to find the absolute value of v - unsigned int r; // the result goes here + unsigned int r; // the result goes here int mask; assume(v < 0); mask = v >> (sizeof(int) * CHAR_BIT - 1); @@ -14,4 +14,3 @@ int main(void) { assert(r == -v); return 0; } - diff --git a/test/bits/absolute_fail.c b/test/bits/absolute_fail.c index 3742d6750..28791d42d 100644 --- a/test/bits/absolute_fail.c +++ b/test/bits/absolute_fail.c @@ -5,7 +5,7 @@ int main(void) { int v = __VERIFIER_nondet_int(); // we want to find the absolute value of v - unsigned int r; // the result goes here + unsigned int r; // the result goes here int mask; assume(v < 0); mask = v >> (sizeof(int) * CHAR_BIT - 1); @@ -14,4 +14,3 @@ int main(void) { assert(r == v); return 0; } - diff --git a/test/bits/bit_field.c b/test/bits/bit_field.c index 1f8df2e88..964e4e209 100644 --- a/test/bits/bit_field.c +++ b/test/bits/bit_field.c @@ -5,11 +5,11 @@ typedef union { int v; struct { - unsigned a: 8; - unsigned b: 8; - unsigned c: 8; - unsigned d: 8; - } i; + unsigned a : 8; + unsigned b : 8; + unsigned c : 8; + unsigned d : 8; + } i; } bf; int main(void) { @@ -21,4 +21,3 @@ int main(void) { assert(b.i.d == ((b.v >> 24) & 0xff)); return 0; } - diff --git a/test/bits/bit_field_fail.c b/test/bits/bit_field_fail.c index a98f9a3d8..b2040a3ef 100644 --- a/test/bits/bit_field_fail.c +++ b/test/bits/bit_field_fail.c @@ -5,11 +5,11 @@ typedef union { int v; struct { - unsigned a: 8; - unsigned b: 8; - unsigned c: 8; - unsigned d: 8; - } i; + unsigned a : 8; + unsigned b : 8; + unsigned c : 8; + unsigned d : 8; + } i; } bf; int main(void) { @@ -21,4 +21,3 @@ int main(void) { assert(b.i.a == ((b.v >> 24) & 0xff)); return 0; } - diff --git a/test/bits/bit_fields.c b/test/bits/bit_fields.c index 6293f4b05..34f4488e4 100644 --- a/test/bits/bit_fields.c +++ b/test/bits/bit_fields.c @@ -3,11 +3,11 @@ // @expect verified typedef struct { - unsigned int d: 5; - unsigned int m: 4; + unsigned int d : 5; + unsigned int m : 4; unsigned int y; } date; - + int main(void) { date dt = {31, 12, 2014}; assert(dt.d == 31); @@ -15,4 +15,3 @@ int main(void) { assert(dt.y == 2014); return 0; } - diff --git a/test/bits/bit_fields_fail.c b/test/bits/bit_fields_fail.c index b5552dbfa..16d3cc3e2 100644 --- a/test/bits/bit_fields_fail.c +++ b/test/bits/bit_fields_fail.c @@ -3,11 +3,11 @@ // @expect error typedef struct { - unsigned int d: 5; - unsigned int m: 4; + unsigned int d : 5; + unsigned int m : 4; unsigned int y; } date; - + int main(void) { date dt = {31, 11, 2014}; assert(dt.d == 31); @@ -15,4 +15,3 @@ int main(void) { assert(dt.y == 2014); return 0; } - diff --git a/test/bits/bitreverse.c b/test/bits/bitreverse.c new file mode 100644 index 000000000..9b425bd7c --- /dev/null +++ b/test/bits/bitreverse.c @@ -0,0 +1,55 @@ +#include "smack.h" +#include + +// @expect verified + +uint16_t bitreverse16(uint16_t x) { + uint16_t result = 0; + result |= (x & 0x0001) << 15; // 0->15 + result |= (x & 0x0002) << 13; // 1->14 + result |= (x & 0x0004) << 11; // 2->13 + result |= (x & 0x0008) << 9; // 3->12 + result |= (x & 0x0010) << 7; // 4->11 + result |= (x & 0x0020) << 5; // 5->10 + result |= (x & 0x0040) << 3; // 6->9 + result |= (x & 0x0080) << 1; // 7->8 + result |= (x & 0x0100) >> 1; // 8->7 + result |= (x & 0x0200) >> 3; // 9->6 + result |= (x & 0x0400) >> 5; // 10->5 + result |= (x & 0x0800) >> 7; // 11->4 + result |= (x & 0x1000) >> 9; // 12->3 + result |= (x & 0x2000) >> 11; // 13->2 + result |= (x & 0x4000) >> 13; // 14->1 + result |= (x & 0x8000) >> 15; // 15->0 + return result; +} + +uint32_t bitreverse32(uint32_t x) { + uint32_t result = 0; + result |= (x & 0x01) << 31; // 0->31 + result |= (x & 0x02) << 29; // 1->30 + result |= (x & 0x04) << 27; // 2->29 + result |= (x & 0x08) << 25; // 3->28 + result |= (x & 0x10) << 23; // 4->27 + result |= (x & 0x20) << 21; // 5->26 + result |= (x & 0x40) << 19; // 6->25 + result |= (x & 0x80) << 17; // 7->24 + result |= bitreverse16((x >> 8) & 0xFFFF) << 8; + result |= (x & 0x01000000) >> 17; // 24->7 + result |= (x & 0x02000000) >> 19; // 25->6 + result |= (x & 0x04000000) >> 21; // 26->5 + result |= (x & 0x08000000) >> 23; // 27->4 + result |= (x & 0x10000000) >> 25; // 28->3 + result |= (x & 0x20000000) >> 27; // 29->2 + result |= (x & 0x40000000) >> 29; // 30->1 + result |= (x & 0x80000000) >> 31; // 31->0 + return result; +} + +int main(void) { + uint16_t x = __VERIFIER_nondet_unsigned_short(); + uint32_t y = __VERIFIER_nondet_unsigned_int(); + assert(__builtin_bitreverse16(x) == bitreverse16(x)); + assert(__builtin_bitreverse32(y) == bitreverse32(y)); + return 0; +} diff --git a/test/bits/bitreverse_fail.c b/test/bits/bitreverse_fail.c new file mode 100644 index 000000000..ac49d4766 --- /dev/null +++ b/test/bits/bitreverse_fail.c @@ -0,0 +1,55 @@ +#include "smack.h" +#include + +// @expect error + +uint16_t bitreverse16(uint16_t x) { + uint16_t result = 0; + result |= (x & 0x0001) << 15; // 0->15 + result |= (x & 0x0002) << 13; // 1->14 + result |= (x & 0x0004) << 11; // 2->13 + result |= (x & 0x0008) << 9; // 3->12 + result |= (x & 0x0010) << 7; // 4->11 + result |= (x & 0x0020) << 5; // 5->10 + result |= (x & 0x0040) << 3; // 6->9 + result |= (x & 0x0080) << 1; // 7->8 + result |= (x & 0x0100) >> 1; // 8->7 + result |= (x & 0x0200) >> 3; // 9->6 + result |= (x & 0x0400) >> 5; // 10->5 + result |= (x & 0x0800) >> 7; // 11->4 + result |= (x & 0x1000) >> 9; // 12->3 + result |= (x & 0x2000) >> 11; // 13->2 + result |= (x & 0x4000) >> 13; // 14->1 + result |= (x & 0x8000) >> 15; // 15->0 + return result; +} + +uint32_t bitreverse32(uint32_t x) { + uint32_t result = 0; + result |= (x & 0x01) << 31; // 0->31 + result |= (x & 0x02) << 29; // 1->30 + result |= (x & 0x04) << 27; // 2->29 + result |= (x & 0x08) << 25; // 3->28 + result |= (x & 0x10) << 23; // 4->27 + result |= (x & 0x20) << 21; // 5->26 + result |= (x & 0x40) << 19; // 6->25 + result |= (x & 0x80) << 17; // 7->24 + result |= bitreverse16((x >> 8) & 0xFFFF) << 8; + result |= (x & 0x01000000) >> 17; // 24->7 + result |= (x & 0x02000000) >> 19; // 25->6 + result |= (x & 0x04000000) >> 21; // 26->5 + result |= (x & 0x08000000) >> 23; // 27->4 + result |= (x & 0x10000000) >> 25; // 28->3 + result |= (x & 0x20000000) >> 27; // 29->2 + result |= (x & 0x40000000) >> 29; // 30->1 + result |= (x & 0x80000000) >> 31; // 31->0 + return result; +} + +int main(void) { + uint16_t x = __VERIFIER_nondet_unsigned_short(); + uint32_t y = __VERIFIER_nondet_unsigned_int(); + assert(__builtin_bitreverse16(x) != bitreverse16(x) || + __builtin_bitreverse32(y) != bitreverse32(y)); + return 0; +} diff --git a/test/bits/byte_swap.c b/test/bits/byte_swap.c new file mode 100644 index 000000000..c1268c0d9 --- /dev/null +++ b/test/bits/byte_swap.c @@ -0,0 +1,43 @@ +#include "smack.h" +#include + +// @expect verified + +uint16_t bswap16(uint16_t x) { + uint16_t result = 0; + result |= (x & 0x00FF) << 8; + result |= (x & 0xFF00) >> 8; + return result; +} + +uint32_t bswap32(uint32_t x) { + uint32_t result = 0; + result |= (x & 0x000000FF) << 24; + result |= (x & 0x0000FF00) << 8; + result |= (x & 0x00FF0000) >> 8; + result |= (x & 0xFF000000) >> 24; + return result; +} + +uint64_t bswap64(uint64_t x) { + uint64_t result = 0; + result |= (x & 0x00000000000000FF) << 56; + result |= (x & 0x000000000000FF00) << 40; + result |= (x & 0x0000000000FF0000) << 24; + result |= (x & 0x00000000FF000000) << 8; + result |= (x & 0x000000FF00000000) >> 8; + result |= (x & 0x0000FF0000000000) >> 24; + result |= (x & 0x00FF000000000000) >> 40; + result |= (x & 0xFF00000000000000) >> 56; + return result; +} + +int main(void) { + uint16_t x16 = __VERIFIER_nondet_unsigned_short(); + uint32_t x32 = __VERIFIER_nondet_unsigned_int(); + uint64_t x64 = __VERIFIER_nondet_unsigned_long_long(); + assert(__builtin_bswap16(x16) == bswap16(x16)); + assert(__builtin_bswap32(x32) == bswap32(x32)); + assert(__builtin_bswap64(x64) == bswap64(x64)); + return 0; +} diff --git a/test/bits/byte_swap_fail.c b/test/bits/byte_swap_fail.c new file mode 100644 index 000000000..d38969a20 --- /dev/null +++ b/test/bits/byte_swap_fail.c @@ -0,0 +1,43 @@ +#include "smack.h" +#include + +// @expect error + +uint16_t bswap16(uint16_t x) { + uint16_t result = 0; + result |= (x & 0x00FF) << 8; + result |= (x & 0xFF00) >> 8; + return result; +} + +uint32_t bswap32(uint32_t x) { + uint32_t result = 0; + result |= (x & 0x000000FF) << 24; + result |= (x & 0x0000FF00) << 8; + result |= (x & 0x00FF0000) >> 8; + result |= (x & 0xFF000000) >> 24; + return result; +} + +uint64_t bswap64(uint64_t x) { + uint64_t result = 0; + result |= (x & 0x00000000000000FF) << 56; + result |= (x & 0x000000000000FF00) << 40; + result |= (x & 0x0000000000FF0000) << 24; + result |= (x & 0x00000000FF000000) << 8; + result |= (x & 0x000000FF00000000) >> 8; + result |= (x & 0x0000FF0000000000) >> 24; + result |= (x & 0x00FF000000000000) >> 40; + result |= (x & 0xFF00000000000000) >> 56; + return result; +} + +int main(void) { + uint16_t x16 = __VERIFIER_nondet_unsigned_short(); + uint32_t x32 = __VERIFIER_nondet_unsigned_int(); + uint64_t x64 = __VERIFIER_nondet_unsigned_long_long(); + assert(__builtin_bswap16(x16) != bswap16(x16) || + __builtin_bswap32(x32) != bswap32(x32) || + __builtin_bswap64(x64) != bswap64(x64)); + return 0; +} diff --git a/test/bits/countlz.c b/test/bits/countlz.c new file mode 100644 index 000000000..bc992c8f6 --- /dev/null +++ b/test/bits/countlz.c @@ -0,0 +1,79 @@ +#include "smack.h" +#include + +// @expect verified + +uint32_t ctlz32(uint32_t x) { + uint32_t n = 32; + uint32_t y; + + y = x >> 16; + if (y != 0) { + n = n - 16; + x = y; + } + y = x >> 8; + if (y != 0) { + n = n - 8; + x = y; + } + y = x >> 4; + if (y != 0) { + n = n - 4; + x = y; + } + y = x >> 2; + if (y != 0) { + n = n - 2; + x = y; + } + y = x >> 1; + if (y != 0) + return n - 2; + return n - x; +} + +uint64_t ctlz64(uint64_t x) { + uint64_t n = 64; + uint64_t y; + + y = x >> 32; + if (y != 0) { + n = n - 32; + x = y; + } + y = x >> 16; + if (y != 0) { + n = n - 16; + x = y; + } + y = x >> 8; + if (y != 0) { + n = n - 8; + x = y; + } + y = x >> 4; + if (y != 0) { + n = n - 4; + x = y; + } + y = x >> 2; + if (y != 0) { + n = n - 2; + x = y; + } + y = x >> 1; + if (y != 0) + return n - 2; + return n - x; +} + +int main(void) { + uint32_t x32 = __VERIFIER_nondet_unsigned_int(); + assume(x32 != 0); + uint64_t x64 = __VERIFIER_nondet_unsigned_long_long(); + assume(x64 != 0); + assert(__builtin_clz(x32) == ctlz32(x32)); + assert(__builtin_clzll(x64) == ctlz64(x64)); + return 0; +} diff --git a/test/bits/countlz_fail.c b/test/bits/countlz_fail.c new file mode 100644 index 000000000..5b894115b --- /dev/null +++ b/test/bits/countlz_fail.c @@ -0,0 +1,79 @@ +#include "smack.h" +#include + +// @expect error + +uint32_t ctlz32(uint32_t x) { + uint32_t n = 32; + uint32_t y; + + y = x >> 16; + if (y != 0) { + n = n - 16; + x = y; + } + y = x >> 8; + if (y != 0) { + n = n - 8; + x = y; + } + y = x >> 4; + if (y != 0) { + n = n - 4; + x = y; + } + y = x >> 2; + if (y != 0) { + n = n - 2; + x = y; + } + y = x >> 1; + if (y != 0) + return n - 2; + return n - x; +} + +uint64_t ctlz64(uint64_t x) { + uint64_t n = 64; + uint64_t y; + + y = x >> 32; + if (y != 0) { + n = n - 32; + x = y; + } + y = x >> 16; + if (y != 0) { + n = n - 16; + x = y; + } + y = x >> 8; + if (y != 0) { + n = n - 8; + x = y; + } + y = x >> 4; + if (y != 0) { + n = n - 4; + x = y; + } + y = x >> 2; + if (y != 0) { + n = n - 2; + x = y; + } + y = x >> 1; + if (y != 0) + return n - 2; + return n - x; +} + +int main(void) { + uint32_t x32 = __VERIFIER_nondet_unsigned_int(); + assume(x32 != 0); + uint64_t x64 = __VERIFIER_nondet_unsigned_long_long(); + assume(x64 != 0); + assert(__builtin_clz(x32) != ctlz32(x32) || + __builtin_clzll(x64) != ctlz64(x64)); + return 0; +} diff --git a/test/bits/countlz_fail2.c b/test/bits/countlz_fail2.c new file mode 100644 index 000000000..1cd4bcf3c --- /dev/null +++ b/test/bits/countlz_fail2.c @@ -0,0 +1,80 @@ +#include "smack.h" +#include + +// @expect error + +uint32_t ctlz32(uint32_t x) { + uint32_t n = 32; + uint32_t y; + + y = x >> 16; + if (y != 0) { + n = n - 16; + x = y; + } + y = x >> 8; + if (y != 0) { + n = n - 8; + x = y; + } + y = x >> 4; + if (y != 0) { + n = n - 4; + x = y; + } + y = x >> 2; + if (y != 0) { + n = n - 2; + x = y; + } + y = x >> 1; + if (y != 0) + return n - 2; + return n - x; +} + +uint64_t ctlz64(uint64_t x) { + uint64_t n = 64; + uint64_t y; + + y = x >> 32; + if (y != 0) { + n = n - 32; + x = y; + } + y = x >> 16; + if (y != 0) { + n = n - 16; + x = y; + } + y = x >> 8; + if (y != 0) { + n = n - 8; + x = y; + } + y = x >> 4; + if (y != 0) { + n = n - 4; + x = y; + } + y = x >> 2; + if (y != 0) { + n = n - 2; + x = y; + } + y = x >> 1; + if (y != 0) + return n - 2; + return n - x; +} + +int main(void) { + // It appears clang defaults to setting zero arguments + // to ctlz as having undefined results. This test + // should fail if this is true. + uint32_t x32 = __VERIFIER_nondet_unsigned_int(); + uint64_t x64 = __VERIFIER_nondet_unsigned_long_long(); + assert(__builtin_clz(x32) == ctlz32(x32) || + __builtin_clzll(x64) == ctlz64(x64)); + return 0; +} diff --git a/test/bits/countlz_zero_fail.c b/test/bits/countlz_zero_fail.c new file mode 100644 index 000000000..c2aa36422 --- /dev/null +++ b/test/bits/countlz_zero_fail.c @@ -0,0 +1,46 @@ +#include "smack.h" +#include + +// @expect error +// @flag --unroll=3 + +uint32_t ctlz32(uint32_t x) { + uint32_t n = 32; + uint32_t y; + + y = x >> 16; + if (y != 0) { + n = n - 16; + x = y; + } + y = x >> 8; + if (y != 0) { + n = n - 8; + x = y; + } + y = x >> 4; + if (y != 0) { + n = n - 4; + x = y; + } + y = x >> 2; + if (y != 0) { + n = n - 2; + x = y; + } + y = x >> 1; + if (y != 0) + return n - 2; + return n - x; +} + +int main(void) { + uint32_t x32 = 1; + uint32_t leadingZeros = 0; + for (int i = 0; i < 2; ++i) { + leadingZeros = __builtin_ctz(x32); + x32--; + } + assert(leadingZeros <= 32); + return 0; +} diff --git a/test/bits/countpop32.c b/test/bits/countpop32.c new file mode 100644 index 000000000..f150ae6e0 --- /dev/null +++ b/test/bits/countpop32.c @@ -0,0 +1,82 @@ +#include "smack.h" +#include + +// @expect verified + +uint32_t ctpop32(uint32_t x) { + uint32_t result = 0; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + return result; +} + +int main(void) { + uint32_t x = __VERIFIER_nondet_unsigned_int(); + assume(x < 1 << 16); + assert(__builtin_popcount(x) == ctpop32(x)); + uint32_t y = __VERIFIER_nondet_unsigned_int(); + assume(x >= 1 << 16); + assert(__builtin_popcount(y) == ctpop32(y)); + return 0; +} diff --git a/test/bits/countpop32_fail.c b/test/bits/countpop32_fail.c new file mode 100644 index 000000000..db823f566 --- /dev/null +++ b/test/bits/countpop32_fail.c @@ -0,0 +1,78 @@ +#include "smack.h" +#include + +// @expect error + +uint32_t ctpop32(uint32_t x) { + uint32_t result = 0; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + x >>= 1; + result += x & 1; + return result; +} + +int main(void) { + uint32_t x = __VERIFIER_nondet_unsigned_int(); + assert(__builtin_popcount(x) != ctpop32(x)); + return 0; +} diff --git a/test/bits/counttz.c b/test/bits/counttz.c new file mode 100644 index 000000000..69a31bb97 --- /dev/null +++ b/test/bits/counttz.c @@ -0,0 +1,68 @@ +#include "smack.h" +#include + +// @expect verified + +uint32_t cttz32(uint32_t x) { + uint32_t n = 0; /* number of bits */ + + if (!(x & 0x0000FFFF)) { + n += 16; + x >>= 16; + } + if (!(x & 0x000000FF)) { + n += 8; + x >>= 8; + } + if (!(x & 0x0000000F)) { + n += 4; + x >>= 4; + } + if (!(x & 0x00000003)) { + n += 2; + x >>= 2; + } + + n += (x & 1) ^ 1; + + return n; +} + +uint64_t cttz64(uint64_t x) { + uint64_t n = 0; /* number of bits */ + + if (!(x & 0x00000000FFFFFFFF)) { + n += 32; + x >>= 32; + } + if (!(x & 0x000000000000FFFF)) { + n += 16; + x >>= 16; + } + if (!(x & 0x00000000000000FF)) { + n += 8; + x >>= 8; + } + if (!(x & 0x000000000000000F)) { + n += 4; + x >>= 4; + } + if (!(x & 0x0000000000000003)) { + n += 2; + x >>= 2; + } + + n += (x & 1) ^ 1; + + return n; +} + +int main(void) { + uint32_t x32 = __VERIFIER_nondet_unsigned_int(); + assume(x32 != 0); + uint64_t x64 = __VERIFIER_nondet_unsigned_long_long(); + assume(x64 != 0); + assert(__builtin_ctz(x32) == cttz32(x32)); + assert(__builtin_ctzll(x64) == cttz64(x64)); + return 0; +} diff --git a/test/bits/counttz_fail.c b/test/bits/counttz_fail.c new file mode 100644 index 000000000..478e88afe --- /dev/null +++ b/test/bits/counttz_fail.c @@ -0,0 +1,68 @@ +#include "smack.h" +#include + +// @expect error + +uint32_t cttz32(uint32_t x) { + uint32_t n = 0; /* number of bits */ + + if (!(x & 0x0000FFFF)) { + n += 16; + x >>= 16; + } + if (!(x & 0x000000FF)) { + n += 8; + x >>= 8; + } + if (!(x & 0x0000000F)) { + n += 4; + x >>= 4; + } + if (!(x & 0x00000003)) { + n += 2; + x >>= 2; + } + + n += (x & 1) ^ 1; + + return n; +} + +uint64_t cttz64(uint64_t x) { + uint64_t n = 0; /* number of bits */ + + if (!(x & 0x00000000FFFFFFFF)) { + n += 32; + x >>= 32; + } + if (!(x & 0x000000000000FFFF)) { + n += 16; + x >>= 16; + } + if (!(x & 0x00000000000000FF)) { + n += 8; + x >>= 8; + } + if (!(x & 0x000000000000000F)) { + n += 4; + x >>= 4; + } + if (!(x & 0x0000000000000003)) { + n += 2; + x >>= 2; + } + + n += (x & 1) ^ 1; + + return n; +} + +int main(void) { + uint32_t x32 = __VERIFIER_nondet_unsigned_int(); + assume(x32 != 0); + uint64_t x64 = __VERIFIER_nondet_unsigned_long_long(); + assume(x64 != 0); + assert(__builtin_ctz(x32) != cttz32(x32) || + __builtin_ctzll(x64) != cttz64(x64)); + return 0; +} diff --git a/test/bits/counttz_fail2.c b/test/bits/counttz_fail2.c new file mode 100644 index 000000000..974fe4574 --- /dev/null +++ b/test/bits/counttz_fail2.c @@ -0,0 +1,69 @@ +#include "smack.h" +#include + +// @expect error + +uint32_t cttz32(uint32_t x) { + uint32_t n = 0; /* number of bits */ + + if (!(x & 0x0000FFFF)) { + n += 16; + x >>= 16; + } + if (!(x & 0x000000FF)) { + n += 8; + x >>= 8; + } + if (!(x & 0x0000000F)) { + n += 4; + x >>= 4; + } + if (!(x & 0x00000003)) { + n += 2; + x >>= 2; + } + + n += (x & 1) ^ 1; + + return n; +} + +uint64_t cttz64(uint64_t x) { + uint64_t n = 0; /* number of bits */ + + if (!(x & 0x00000000FFFFFFFF)) { + n += 32; + x >>= 32; + } + if (!(x & 0x000000000000FFFF)) { + n += 16; + x >>= 16; + } + if (!(x & 0x00000000000000FF)) { + n += 8; + x >>= 8; + } + if (!(x & 0x000000000000000F)) { + n += 4; + x >>= 4; + } + if (!(x & 0x0000000000000003)) { + n += 2; + x >>= 2; + } + + n += (x & 1) ^ 1; + + return n; +} + +int main(void) { + uint32_t x32 = __VERIFIER_nondet_unsigned_int(); + uint64_t x64 = __VERIFIER_nondet_unsigned_long_long(); + // This is expected to fail since clang appears to set + // the is_zer_undef flag on x86, so zero input values + // can be undefined. + assert(__builtin_ctz(x32) == cttz32(x32) || + __builtin_ctzll(x64) == cttz64(x64)); + return 0; +} diff --git a/test/bits/interleave_bits_fail.c b/test/bits/interleave_bits_fail.c index f68d840b1..6aaf2958a 100644 --- a/test/bits/interleave_bits_fail.c +++ b/test/bits/interleave_bits_fail.c @@ -1,43 +1,43 @@ -/* https://graphics.stanford.edu/~seander/bithacks.html#InterleaveTableObvious */ +/* https://graphics.stanford.edu/~seander/bithacks.html#InterleaveTableObvious + */ #include "smack.h" // @flag --loop-limit=17 // @flag --unroll=17 // @expect error -int main() -{ - /* Interleave bits of x and y, so that all of the */ - /* bits of x are in the even positions and y in the odd; */ - unsigned short x = __VERIFIER_nondet_unsigned_short(); - unsigned short y = __VERIFIER_nondet_unsigned_short(); - - unsigned int xx; - unsigned int yy; - unsigned int zz; - - unsigned int z = 0; /* z gets the resulting Morton Number. */ - unsigned int i = 0; - - while (i < sizeof(x) * 8) { - z |= ((x & (1U << i)) << i) | ((y & (1U << i)) << (i + 1)); - i += 1U; - } - - xx = x; - yy = y; - - xx = (xx | (xx << 8u)) & 16711935U; /* 0x00FF00FF */ - xx = (xx | (xx << 4u)) & 252645135U; /* 0x0F0F0F0F */ - xx = (xx | (xx << 2u)) & 858993459U; /* 0x33333333 */ - xx = (xx | (xx << 1u)) & 1431655765U; /* 0x55555555 */ - - yy = (yy | (yy << 8u)) & 16711935U; /* 0x00FF00FF */ - yy = (yy | (yy << 4u)) & 252645135U; /* 0x0F0F0F0F */ - yy = (yy | (yy << 2u)) & 858993459U; /* 0x33333333 */ - yy = (yy | (yy << 1u)) & 1431655765U; /* 0x55555555 */ - - zz = xx | (yy << 2U); - - assert(z == zz); +int main() { + /* Interleave bits of x and y, so that all of the */ + /* bits of x are in the even positions and y in the odd; */ + unsigned short x = __VERIFIER_nondet_unsigned_short(); + unsigned short y = __VERIFIER_nondet_unsigned_short(); + + unsigned int xx; + unsigned int yy; + unsigned int zz; + + unsigned int z = 0; /* z gets the resulting Morton Number. */ + unsigned int i = 0; + + while (i < sizeof(x) * 8) { + z |= ((x & (1U << i)) << i) | ((y & (1U << i)) << (i + 1)); + i += 1U; + } + + xx = x; + yy = y; + + xx = (xx | (xx << 8u)) & 16711935U; /* 0x00FF00FF */ + xx = (xx | (xx << 4u)) & 252645135U; /* 0x0F0F0F0F */ + xx = (xx | (xx << 2u)) & 858993459U; /* 0x33333333 */ + xx = (xx | (xx << 1u)) & 1431655765U; /* 0x55555555 */ + + yy = (yy | (yy << 8u)) & 16711935U; /* 0x00FF00FF */ + yy = (yy | (yy << 4u)) & 252645135U; /* 0x0F0F0F0F */ + yy = (yy | (yy << 2u)) & 858993459U; /* 0x33333333 */ + yy = (yy | (yy << 1u)) & 1431655765U; /* 0x55555555 */ + + zz = xx | (yy << 2U); + + assert(z == zz); } diff --git a/test/bits/interleave_bits_true.c b/test/bits/interleave_bits_true.c index 6067a6850..43ab27f44 100644 --- a/test/bits/interleave_bits_true.c +++ b/test/bits/interleave_bits_true.c @@ -1,43 +1,43 @@ -/* https://graphics.stanford.edu/~seander/bithacks.html#InterleaveTableObvious */ +/* https://graphics.stanford.edu/~seander/bithacks.html#InterleaveTableObvious + */ #include "smack.h" // @flag --loop-limit=17 // @flag --unroll=17 // @expect verified -int main() -{ - /* Interleave bits of x and y, so that all of the */ - /* bits of x are in the even positions and y in the odd; */ - unsigned short x = __VERIFIER_nondet_unsigned_short(); - unsigned short y = __VERIFIER_nondet_unsigned_short(); - - unsigned int xx; - unsigned int yy; - unsigned int zz; - - unsigned int z = 0; /* z gets the resulting Morton Number. */ - unsigned int i = 0; - - while (i < sizeof(x) * 8) { - z |= ((x & (1U << i)) << i) | ((y & (1U << i)) << (i + 1)); - i += 1U; - } - - xx = x; - yy = y; - - xx = (xx | (xx << 8u)) & 16711935U; /* 0x00FF00FF */ - xx = (xx | (xx << 4u)) & 252645135U; /* 0x0F0F0F0F */ - xx = (xx | (xx << 2u)) & 858993459U; /* 0x33333333 */ - xx = (xx | (xx << 1u)) & 1431655765U; /* 0x55555555 */ - - yy = (yy | (yy << 8u)) & 16711935U; /* 0x00FF00FF */ - yy = (yy | (yy << 4u)) & 252645135U; /* 0x0F0F0F0F */ - yy = (yy | (yy << 2u)) & 858993459U; /* 0x33333333 */ - yy = (yy | (yy << 1u)) & 1431655765U; /* 0x55555555 */ - - zz = xx | (yy << 1U); - - assert(z == zz); +int main() { + /* Interleave bits of x and y, so that all of the */ + /* bits of x are in the even positions and y in the odd; */ + unsigned short x = __VERIFIER_nondet_unsigned_short(); + unsigned short y = __VERIFIER_nondet_unsigned_short(); + + unsigned int xx; + unsigned int yy; + unsigned int zz; + + unsigned int z = 0; /* z gets the resulting Morton Number. */ + unsigned int i = 0; + + while (i < sizeof(x) * 8) { + z |= ((x & (1U << i)) << i) | ((y & (1U << i)) << (i + 1)); + i += 1U; + } + + xx = x; + yy = y; + + xx = (xx | (xx << 8u)) & 16711935U; /* 0x00FF00FF */ + xx = (xx | (xx << 4u)) & 252645135U; /* 0x0F0F0F0F */ + xx = (xx | (xx << 2u)) & 858993459U; /* 0x33333333 */ + xx = (xx | (xx << 1u)) & 1431655765U; /* 0x55555555 */ + + yy = (yy | (yy << 8u)) & 16711935U; /* 0x00FF00FF */ + yy = (yy | (yy << 4u)) & 252645135U; /* 0x0F0F0F0F */ + yy = (yy | (yy << 2u)) & 858993459U; /* 0x33333333 */ + yy = (yy | (yy << 1u)) & 1431655765U; /* 0x55555555 */ + + zz = xx | (yy << 1U); + + assert(z == zz); } diff --git a/test/bits/left_shift_unsigned.c b/test/bits/left_shift_unsigned.c index e3edc1a17..3a79adc16 100644 --- a/test/bits/left_shift_unsigned.c +++ b/test/bits/left_shift_unsigned.c @@ -7,6 +7,6 @@ int main(void) { unsigned int x = __VERIFIER_nondet_unsigned_int(); unsigned int z = __VERIFIER_nondet_unsigned_int(); - assume(z < sizeof(x)*8); + assume(z < sizeof(x) * 8); return x << z; } diff --git a/test/bits/left_shift_unsigned_fail.c b/test/bits/left_shift_unsigned_fail.c index ec7316e04..abe7af378 100644 --- a/test/bits/left_shift_unsigned_fail.c +++ b/test/bits/left_shift_unsigned_fail.c @@ -7,6 +7,6 @@ int main(void) { unsigned int x = __VERIFIER_nondet_unsigned_int(); unsigned int z = __VERIFIER_nondet_unsigned_int(); - assume(z >= sizeof(x)*8); + assume(z >= sizeof(x) * 8); return x << z; } diff --git a/test/bits/malloc_non_alias.c b/test/bits/malloc_non_alias.c index 99ba5fe28..9de350902 100644 --- a/test/bits/malloc_non_alias.c +++ b/test/bits/malloc_non_alias.c @@ -5,9 +5,9 @@ // @expect verified int main(void) { - int* x = (int*)malloc(sizeof(int)); - int* y = (int*)malloc(sizeof(int)); - int* z = (int*)malloc(sizeof(int)); + int *x = (int *)malloc(sizeof(int)); + int *y = (int *)malloc(sizeof(int)); + int *z = (int *)malloc(sizeof(int)); if (x == y) y = z; *y = 1; diff --git a/test/bits/mm.c b/test/bits/mm.c index 8895857b9..e1a653186 100644 --- a/test/bits/mm.c +++ b/test/bits/mm.c @@ -9,25 +9,24 @@ struct bla_s { typedef struct bla_s bla_t; -int get_field(bla_t* bla) { - int f = bla -> b2; +int get_field(bla_t *bla) { + int f = bla->b2; f = f >> 28; f = f & 0xF; return f; } -void set_field(bla_t* bla, int f) { +void set_field(bla_t *bla, int f) { f = f & 0xF; f = f << 28; - bla -> b2 = ((bla -> b2) & 0xFFFFFFF) | f; + bla->b2 = ((bla->b2) & 0xFFFFFFF) | f; } int main(void) { bla_t bla; int f = get_field(&bla); - set_field(&bla, f+1); + set_field(&bla, f + 1); int g = get_field(&bla); - assert( ((f+1) & 0xF) == (g & 0xF) ); + assert(((f + 1) & 0xF) == (g & 0xF)); return 0; } - diff --git a/test/bits/mm_fail.c b/test/bits/mm_fail.c index 2964e8010..6c98a4470 100644 --- a/test/bits/mm_fail.c +++ b/test/bits/mm_fail.c @@ -9,25 +9,24 @@ struct bla_s { typedef struct bla_s bla_t; -int get_field(bla_t* bla) { - int f = bla -> b2; +int get_field(bla_t *bla) { + int f = bla->b2; f = f >> 28; f = f & 0xF; return f; } -void set_field(bla_t* bla, int f) { +void set_field(bla_t *bla, int f) { f = f & 0xF; f = f << 28; - bla -> b2 = ((bla -> b2) & 0xFFFFFFF) | f; + bla->b2 = ((bla->b2) & 0xFFFFFFF) | f; } int main(void) { bla_t bla; int f = get_field(&bla); - set_field(&bla, f+1); + set_field(&bla, f + 1); int g = get_field(&bla); - assert( ((f+2) & 0xF) == (g & 0xF) ); + assert(((f + 2) & 0xF) == (g & 0xF)); return 0; } - diff --git a/test/bits/num_conversion_1_fail.c b/test/bits/num_conversion_1_fail.c index fa7b4a5d7..d791e6859 100644 --- a/test/bits/num_conversion_1_fail.c +++ b/test/bits/num_conversion_1_fail.c @@ -4,24 +4,23 @@ // @flag --unroll=11 // @expect error -int main() -{ - unsigned char x = __VERIFIER_nondet_unsigned_char(); - unsigned char y; - unsigned char c; +int main() { + unsigned char x = __VERIFIER_nondet_unsigned_char(); + unsigned char y; + unsigned char c; - x = 37; - y = 0; - c = 0; - while (c < (unsigned char)8) { - unsigned char i = ((unsigned char)1) << c; - unsigned char bit = x & i; - if (bit != (unsigned char)0) { - y = y + i; - } - c = c + ((unsigned char)1); + x = 37; + y = 0; + c = 0; + while (c < (unsigned char)8) { + unsigned char i = ((unsigned char)1) << c; + unsigned char bit = x & i; + if (bit != (unsigned char)0) { + y = y + i; } - assert(x != y); - - return 0; + c = c + ((unsigned char)1); + } + assert(x != y); + + return 0; } diff --git a/test/bits/num_conversion_1_true.c b/test/bits/num_conversion_1_true.c index 0a7f9f31d..15ac747e4 100644 --- a/test/bits/num_conversion_1_true.c +++ b/test/bits/num_conversion_1_true.c @@ -4,24 +4,23 @@ // @flag --unroll=11 // @expect verified -int main() -{ - unsigned char x = __VERIFIER_nondet_unsigned_char(); - unsigned char y; - unsigned char c; +int main() { + unsigned char x = __VERIFIER_nondet_unsigned_char(); + unsigned char y; + unsigned char c; - x = 37; - y = 0; - c = 0; - while (c < (unsigned char)8) { - unsigned char i = ((unsigned char)1) << c; - unsigned char bit = x & i; - if (bit != (unsigned char)0) { - y = y + i; - } - c = c + ((unsigned char)1); + x = 37; + y = 0; + c = 0; + while (c < (unsigned char)8) { + unsigned char i = ((unsigned char)1) << c; + unsigned char bit = x & i; + if (bit != (unsigned char)0) { + y = y + i; } - assert(x == y); - - return 0; + c = c + ((unsigned char)1); + } + assert(x == y); + + return 0; } diff --git a/test/bits/num_conversion_2_fail.c b/test/bits/num_conversion_2_fail.c index f77b15a1d..c8c9cdd9c 100644 --- a/test/bits/num_conversion_2_fail.c +++ b/test/bits/num_conversion_2_fail.c @@ -4,23 +4,22 @@ // @flag --unroll=11 // @expect error -int main() -{ - unsigned char x = __VERIFIER_nondet_unsigned_char(); - unsigned char y; - unsigned char c; +int main() { + unsigned char x = __VERIFIER_nondet_unsigned_char(); + unsigned char y; + unsigned char c; - y = 0; - c = 0; - while (c < (unsigned char)8) { - unsigned char i = ((unsigned char)1) << c; - unsigned char bit = x & i; - if (bit != (unsigned char)0) { - y = y + i; - } - c = c + ((unsigned char)1); + y = 0; + c = 0; + while (c < (unsigned char)8) { + unsigned char i = ((unsigned char)1) << c; + unsigned char bit = x & i; + if (bit != (unsigned char)0) { + y = y + i; } - assert(x != y); - - return 0; + c = c + ((unsigned char)1); + } + assert(x != y); + + return 0; } diff --git a/test/bits/num_conversion_2_true.c b/test/bits/num_conversion_2_true.c index 4006d2f99..ee83c4d98 100644 --- a/test/bits/num_conversion_2_true.c +++ b/test/bits/num_conversion_2_true.c @@ -4,23 +4,22 @@ // @flag --unroll=11 // @expect verified -int main() -{ - unsigned char x = __VERIFIER_nondet_unsigned_char(); - unsigned char y; - unsigned char c; +int main() { + unsigned char x = __VERIFIER_nondet_unsigned_char(); + unsigned char y; + unsigned char c; - y = 0; - c = 0; - while (c < (unsigned char)8) { - unsigned char i = ((unsigned char)1) << c; - unsigned char bit = x & i; - if (bit != (unsigned char)0) { - y = y + i; - } - c = c + ((unsigned char)1); + y = 0; + c = 0; + while (c < (unsigned char)8) { + unsigned char i = ((unsigned char)1) << c; + unsigned char bit = x & i; + if (bit != (unsigned char)0) { + y = y + i; } - assert(x == y); - - return 0; + c = c + ((unsigned char)1); + } + assert(x == y); + + return 0; } diff --git a/test/bits/pointers4.c b/test/bits/pointers4.c index 4fc009697..a605c8113 100644 --- a/test/bits/pointers4.c +++ b/test/bits/pointers4.c @@ -1,11 +1,11 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified int main() { - int *a = (int*)malloc(sizeof(int)); + int *a = (int *)malloc(sizeof(int)); *a = 256; *((char *)a) = 1; @@ -13,4 +13,3 @@ int main() { free(a); return 0; } - diff --git a/test/bits/pointers4_fail.c b/test/bits/pointers4_fail.c index 9f224c5b0..57fed0b51 100644 --- a/test/bits/pointers4_fail.c +++ b/test/bits/pointers4_fail.c @@ -1,11 +1,11 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error int main() { - int *a = (int*)malloc(sizeof(int)); + int *a = (int *)malloc(sizeof(int)); *a = 256; *((char *)a + 1) = 1; @@ -13,4 +13,3 @@ int main() { free(a); return 0; } - diff --git a/test/bits/pointers7.c b/test/bits/pointers7.c index 19a6c1548..5967f4308 100644 --- a/test/bits/pointers7.c +++ b/test/bits/pointers7.c @@ -19,4 +19,3 @@ int main(void) { assert(x.j == 1); return 0; } - diff --git a/test/bits/pointers7_fail.c b/test/bits/pointers7_fail.c index e9a8f742d..929561af4 100644 --- a/test/bits/pointers7_fail.c +++ b/test/bits/pointers7_fail.c @@ -19,4 +19,3 @@ int main(void) { assert(x.j == 20); return 0; } - diff --git a/test/bits/smack_code_annot.c b/test/bits/smack_code_annot.c new file mode 100644 index 000000000..043c9734a --- /dev/null +++ b/test/bits/smack_code_annot.c @@ -0,0 +1,43 @@ +#include "smack.h" + +// @expect verified + +typedef unsigned int u32; +typedef unsigned short u16; +typedef unsigned char u8; + +u32 u16_to_u32(u16 x) { + u32 ret = __VERIFIER_nondet_unsigned_int(); + __SMACK_code("@i := $zext.bv16.bv32(@h);", ret, x); + return ret; +} + +u32 u8_to_u32(u8 x) { + u32 ret = __VERIFIER_nondet_unsigned_int(); + __SMACK_code("@I := $zext.bv8.bv32(@c);", ret, x); + return ret; +} + +u16 u16_id(u16 x) { + u16 ret = __VERIFIER_nondet_unsigned_short(); + __SMACK_code("@H := @h;", ret, x); + return ret; +} + +u8 u8_id(u8 x) { + u8 ret = __VERIFIER_nondet_unsigned_char(); + __SMACK_code("@b := @B;", ret, x); + return ret; +} + +int main(void) { + u8 x8 = __VERIFIER_nondet_unsigned_char(); + u8 y8 = __VERIFIER_nondet_unsigned_char(); + u16 x16 = __VERIFIER_nondet_unsigned_short(); + u16 y16 = __VERIFIER_nondet_unsigned_short(); + assume(u8_id(x8) > u8_id(y8)); + assume(u16_id(x16) > u16_id(y16)); + assert(u8_to_u32(x8) > u8_to_u32(y8)); + assert(u16_to_u32(x16) > u16_to_u32(y16)); + return 0; +} diff --git a/test/bits/smack_code_annot_fail.c b/test/bits/smack_code_annot_fail.c new file mode 100644 index 000000000..ec4bbf232 --- /dev/null +++ b/test/bits/smack_code_annot_fail.c @@ -0,0 +1,43 @@ +#include "smack.h" + +// @expect error + +typedef unsigned int u32; +typedef unsigned short u16; +typedef unsigned char u8; + +u32 u16_to_u32(u16 x) { + u32 ret = __VERIFIER_nondet_unsigned_int(); + __SMACK_code("@i := $zext.bv16.bv32(@h);", ret, x); + return ret; +} + +u32 u8_to_u32(u8 x) { + u32 ret = __VERIFIER_nondet_unsigned_int(); + __SMACK_code("@i := $zext.bv8.bv32(@c);", ret, x); + return ret; +} + +u16 u16_id(u16 x) { + u16 ret = __VERIFIER_nondet_unsigned_short(); + __SMACK_code("@H := @h;", ret, x); + return ret; +} + +u8 u8_id(u8 x) { + u8 ret = __VERIFIER_nondet_unsigned_char(); + __SMACK_code("@b := @B;", ret, x); + return ret; +} + +int main(void) { + u8 x8 = __VERIFIER_nondet_unsigned_char(); + u8 y8 = __VERIFIER_nondet_unsigned_char(); + u16 x16 = __VERIFIER_nondet_unsigned_short(); + u16 y16 = __VERIFIER_nondet_unsigned_short(); + assume(u8_id(x8) > u8_id(y8)); + assume(u16_id(x16) > u16_id(y16)); + assert(u8_to_u32(x8) < u8_to_u32(y8)); + assert(u16_to_u32(x16) > u16_to_u32(y16)); + return 0; +} diff --git a/test/bits/sync-fetch.c b/test/bits/sync-fetch.c new file mode 100644 index 000000000..822befad9 --- /dev/null +++ b/test/bits/sync-fetch.c @@ -0,0 +1,15 @@ +#include "smack.h" + +// @expect verified + +int main(void) { + int i = 0; + __sync_fetch_and_add(&i, 1); + __sync_fetch_and_sub(&i, 1); + __sync_fetch_and_or(&i, 1); + __sync_fetch_and_and(&i, 1); + __sync_fetch_and_xor(&i, 1); + __sync_fetch_and_nand(&i, 1); + assert(i == -1); + return i; +} diff --git a/test/bits/sync-fetch_fail.c b/test/bits/sync-fetch_fail.c new file mode 100644 index 000000000..1df3ad022 --- /dev/null +++ b/test/bits/sync-fetch_fail.c @@ -0,0 +1,15 @@ +#include "smack.h" + +// @expect error + +int main(void) { + int i = 0; + __sync_fetch_and_add(&i, 1); + __sync_fetch_and_sub(&i, 1); + __sync_fetch_and_or(&i, 1); + __sync_fetch_and_and(&i, 2); + __sync_fetch_and_xor(&i, 999); + __sync_fetch_and_nand(&i, 2); + assert(i == -1); + return i; +} diff --git a/test/bits/unaligned_struct.c b/test/bits/unaligned_struct.c index fbc1b414d..72775349e 100644 --- a/test/bits/unaligned_struct.c +++ b/test/bits/unaligned_struct.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect verified @@ -9,12 +9,11 @@ typedef struct { } a; int main(void) { - a *x = (a*)malloc(sizeof(a)); - long *p = x; + a *x = (a *)malloc(sizeof(a)); + long *p = (long *)x; x->i = 10; x->j = 20; *p = 0; assert(x->j == 0); return 0; } - diff --git a/test/bits/unaligned_struct_fail.c b/test/bits/unaligned_struct_fail.c index 66920f223..7991de6d8 100644 --- a/test/bits/unaligned_struct_fail.c +++ b/test/bits/unaligned_struct_fail.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect error @@ -9,12 +9,11 @@ typedef struct { } a; int main(void) { - a *x = (a*)malloc(sizeof(a)); - long *p = x; + a *x = (a *)malloc(sizeof(a)); + long *p = (long *)x; x->i = 10; x->j = 20; *p = 0; assert(x->j == 20); return 0; } - diff --git a/test/contracts/and.c b/test/contracts/and.c index 7439435bd..55d697af1 100644 --- a/test/contracts/and.c +++ b/test/contracts/and.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect verified diff --git a/test/contracts/and_fail.c b/test/contracts/and_fail.c index 2a7747534..823c3981c 100644 --- a/test/contracts/and_fail.c +++ b/test/contracts/and_fail.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect error diff --git a/test/contracts/array.c b/test/contracts/array.c index 3950ae546..0493bb65e 100644 --- a/test/contracts/array.c +++ b/test/contracts/array.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect verified diff --git a/test/contracts/array_fail.c b/test/contracts/array_fail.c index 0320d0d9f..fd80e9146 100644 --- a/test/contracts/array_fail.c +++ b/test/contracts/array_fail.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect error diff --git a/test/contracts/failing/array_forall.c b/test/contracts/failing/array_forall.c index f1d63eefc..56edd88b7 100644 --- a/test/contracts/failing/array_forall.c +++ b/test/contracts/failing/array_forall.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect verified // @flag --verifier-options=/z3opt:SMT.MBQI=true @@ -10,10 +10,14 @@ int g[SIZE]; void p() { - ensures(forall("i", qvar("i", int) < 0 || qvar("i", int) >= SIZE || g[qvar("i", int)] == qvar("i", int))); + ensures(forall("i", + qvar("i", int) < 0 || qvar("i", int) >= SIZE || + g[qvar("i", int)] == qvar("i", int))); - for (int i=0; i= i || g[qvar("x", int)] == qvar("x", int))); + for (int i = 0; i < SIZE; i++) { + invariant(forall("x", + qvar("x", int) < 0 || qvar("x", int) >= i || + g[qvar("x", int)] == qvar("x", int))); g[i] = i; } } diff --git a/test/contracts/failing/array_forall_fail.c b/test/contracts/failing/array_forall_fail.c index 6f5ab1e2e..1b0f91bb1 100644 --- a/test/contracts/failing/array_forall_fail.c +++ b/test/contracts/failing/array_forall_fail.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect error // @flag --verifier-options=/z3opt:SMT.MBQI=true @@ -10,10 +10,14 @@ int g[SIZE]; void p() { - ensures(forall("i", qvar("i", int) < 0 || qvar("i", int) >= SIZE || g[qvar("i", int)] == qvar("i", int))); + ensures(forall("i", + qvar("i", int) < 0 || qvar("i", int) >= SIZE || + g[qvar("i", int)] == qvar("i", int))); - for (int i=0; i i || g[qvar("x", int)] == qvar("x", int))); + for (int i = 0; i < SIZE; i++) { + invariant(forall("x", + qvar("x", int) < 0 || qvar("x", int) > i || + g[qvar("x", int)] == qvar("x", int))); g[i] = i; } } diff --git a/test/contracts/failing/forall.c b/test/contracts/failing/forall.c index dc483843f..ac0c853eb 100644 --- a/test/contracts/failing/forall.c +++ b/test/contracts/failing/forall.c @@ -1,13 +1,14 @@ +#include +#include #include #include -#include -#include // @expect verified int g[10]; int main(void) { - ensures(forall("x", g[qvar("x", int)] == 0 || qvar("x", int) < 0 || qvar("x", int) > 9)); + ensures(forall( + "x", g[qvar("x", int)] == 0 || qvar("x", int) < 0 || qvar("x", int) > 9)); return 0; } diff --git a/test/contracts/failing/forall_fail.c b/test/contracts/failing/forall_fail.c index ad2b40fb6..4c3c4b096 100644 --- a/test/contracts/failing/forall_fail.c +++ b/test/contracts/failing/forall_fail.c @@ -1,13 +1,15 @@ +#include +#include #include #include -#include -#include // @expect error int g[10]; int main(void) { - ensures(forall("x", g[qvar("x", int)] == 0 || qvar("x", int) < 0 || qvar("x", int) > 10)); + ensures(forall("x", + g[qvar("x", int)] == 0 || qvar("x", int) < 0 || + qvar("x", int) > 10)); return 0; } diff --git a/test/contracts/failing/old.c b/test/contracts/failing/old.c index 278b6ab3c..f61bff197 100644 --- a/test/contracts/failing/old.c +++ b/test/contracts/failing/old.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect verified diff --git a/test/contracts/failing/old_fail.c b/test/contracts/failing/old_fail.c index 7f8a6e0e4..ec03b4859 100644 --- a/test/contracts/failing/old_fail.c +++ b/test/contracts/failing/old_fail.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect error diff --git a/test/contracts/failing/result.c b/test/contracts/failing/result.c index 304172398..327fe9f4d 100644 --- a/test/contracts/failing/result.c +++ b/test/contracts/failing/result.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect verified diff --git a/test/contracts/failing/result_fail.c b/test/contracts/failing/result_fail.c index f4c845b16..ccdc79d1c 100644 --- a/test/contracts/failing/result_fail.c +++ b/test/contracts/failing/result_fail.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect error diff --git a/test/contracts/invariant.c b/test/contracts/invariant.c index dfbb133c7..83f5ff22a 100644 --- a/test/contracts/invariant.c +++ b/test/contracts/invariant.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect verified @@ -9,7 +9,7 @@ int g[10]; int main(void) { - for (int i=0; i<4; i++) { + for (int i = 0; i < 4; i++) { invariant(i <= 4); g[i] = i; } diff --git a/test/contracts/invariant_fail.c b/test/contracts/invariant_fail.c index edc1a09bf..087d95c0d 100644 --- a/test/contracts/invariant_fail.c +++ b/test/contracts/invariant_fail.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect error @@ -9,7 +9,7 @@ int g[10]; int main(void) { - for (int i=0; i<4; i++) { + for (int i = 0; i < 4; i++) { invariant(i < 4); g[i] = i; } diff --git a/test/contracts/requires_const.c b/test/contracts/requires_const.c index f61c03926..27ff41ac9 100644 --- a/test/contracts/requires_const.c +++ b/test/contracts/requires_const.c @@ -1,10 +1,8 @@ +#include +#include #include #include -#include -#include // @expect verified -void p() { - requires(true); -} +void p() { requires(true); } diff --git a/test/contracts/simple.c b/test/contracts/simple.c index 0b18c7bc6..4ee875e3d 100644 --- a/test/contracts/simple.c +++ b/test/contracts/simple.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect verified @@ -10,7 +10,7 @@ int g; void p() { requires(g > 0); ensures(g > 0); - for (int i=0; i < 10; i++) { + for (int i = 0; i < 10; i++) { invariant(g > 0); g++; } @@ -19,7 +19,7 @@ void p() { int main(void) { g = 1; - for (int i=0; i<10; i++) { + for (int i = 0; i < 10; i++) { invariant(g > 0); p(); } diff --git a/test/contracts/simple_fail.c b/test/contracts/simple_fail.c index e5c4f94c5..fc22ad865 100644 --- a/test/contracts/simple_fail.c +++ b/test/contracts/simple_fail.c @@ -1,7 +1,7 @@ +#include +#include #include #include -#include -#include // @expect error @@ -10,7 +10,7 @@ int g; void p() { requires(g > 0); ensures(g > 0); - for (int i=0; i < 10; i++) { + for (int i = 0; i < 10; i++) { invariant(g >= 0); g++; } @@ -19,7 +19,7 @@ void p() { int main(void) { g = 1; - for (int i=0; i<10; i++) { + for (int i = 0; i < 10; i++) { invariant(g > 0); p(); } diff --git a/test/cplusplus/config.yml b/test/cplusplus/config.yml index 2d3fea097..3dd751df4 100644 --- a/test/cplusplus/config.yml +++ b/test/cplusplus/config.yml @@ -1 +1 @@ -skip: true +skip : true diff --git a/test/cplusplus/hello.cc b/test/cplusplus/hello.cc index 053e66d21..818951b39 100644 --- a/test/cplusplus/hello.cc +++ b/test/cplusplus/hello.cc @@ -1,11 +1,10 @@ -#include #include +#include // @expect verified -int main() -{ - std::cout << "Hello, world!" << std::endl; - assert(true); - return 0; +int main() { + std::cout << "Hello, world!" << std::endl; + assert(true); + return 0; } diff --git a/test/cplusplus/hello_fail.cc b/test/cplusplus/hello_fail.cc index b9605d5c7..c1d2194c0 100644 --- a/test/cplusplus/hello_fail.cc +++ b/test/cplusplus/hello_fail.cc @@ -1,11 +1,10 @@ -#include #include - +#include + // @expect error -int main() -{ - std::cout << "Hello, world!" << std::endl; - assert(false); - return 0; +int main() { + std::cout << "Hello, world!" << std::endl; + assert(false); + return 0; } diff --git a/test/data/array.c b/test/data/array.c index d1597ba74..8a0455ab9 100644 --- a/test/data/array.c +++ b/test/data/array.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -8,9 +8,8 @@ #define RESET 0 int main() { - int *a = (int*)malloc(MAXSIZE * sizeof(int)); + int *a = (int *)malloc(MAXSIZE * sizeof(int)); free(a); return 0; } - diff --git a/test/data/array1.c b/test/data/array1.c index 0b80b0d2a..79f4c3f64 100644 --- a/test/data/array1.c +++ b/test/data/array1.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -8,7 +8,7 @@ #define RESET 0 int main() { - int *a = (int*)malloc(MAXSIZE * sizeof(int)); + int *a = (int *)malloc(MAXSIZE * sizeof(int)); a[5] = 10; @@ -17,4 +17,3 @@ int main() { free(a); return 0; } - diff --git a/test/data/array1_fail.c b/test/data/array1_fail.c index 4a15f7126..00561d7f8 100644 --- a/test/data/array1_fail.c +++ b/test/data/array1_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -8,7 +8,7 @@ #define RESET 0 int main() { - int *a = (int*)malloc(MAXSIZE * sizeof(int)); + int *a = (int *)malloc(MAXSIZE * sizeof(int)); a[5] = 10; @@ -17,4 +17,3 @@ int main() { free(a); return 0; } - diff --git a/test/data/array2.c b/test/data/array2.c index 2ab8bc83e..ad787e9a6 100644 --- a/test/data/array2.c +++ b/test/data/array2.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=11 // @flag --unroll=11 @@ -11,7 +11,7 @@ int main() { int i = 0; - int *a = (int*)malloc(MAXSIZE * sizeof(int)); + int *a = (int *)malloc(MAXSIZE * sizeof(int)); for (i = 0; i < MAXSIZE; i++) { a[i] = RESET; @@ -22,4 +22,3 @@ int main() { free(a); return 0; } - diff --git a/test/data/array2_fail.c b/test/data/array2_fail.c index 6407b12c6..8377dd8e1 100644 --- a/test/data/array2_fail.c +++ b/test/data/array2_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=11 // @flag --unroll=11 @@ -11,7 +11,7 @@ int main() { int i = 0; - int *a = (int*)malloc(MAXSIZE * sizeof(int)); + int *a = (int *)malloc(MAXSIZE * sizeof(int)); for (i = 0; i < MAXSIZE - 1; i++) { a[i] = RESET; @@ -22,4 +22,3 @@ int main() { free(a); return 0; } - diff --git a/test/data/array3.c b/test/data/array3.c index eea490f26..37298c8b4 100644 --- a/test/data/array3.c +++ b/test/data/array3.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=11 // @flag --unroll=11 @@ -17,10 +17,9 @@ void initializeArray(int *array) { } } - int main() { int i = 0; - int *array = (int*)malloc(MAXSIZE * sizeof(int)); + int *array = (int *)malloc(MAXSIZE * sizeof(int)); initializeArray(array); @@ -31,4 +30,3 @@ int main() { free(array); return 0; } - diff --git a/test/data/array3_fail.c b/test/data/array3_fail.c index 56a43a3be..60f3d23de 100644 --- a/test/data/array3_fail.c +++ b/test/data/array3_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=11 // @flag --unroll=11 @@ -19,10 +19,9 @@ void initializeArray(int *array) { array[9] = 1; } - int main() { int i = 0; - int *array = (int*)malloc(MAXSIZE * sizeof(int)); + int *array = (int *)malloc(MAXSIZE * sizeof(int)); initializeArray(array); @@ -33,4 +32,3 @@ int main() { free(array); return 0; } - diff --git a/test/data/array4.c b/test/data/array4.c index 17448bbd2..eb64063aa 100644 --- a/test/data/array4.c +++ b/test/data/array4.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=11 // @flag --unroll=11 @@ -25,7 +25,7 @@ void initializeArray(elem *array) { int main() { int i = 0; - elem *array = (elem*)malloc(MAXSIZE * sizeof(elem)); + elem *array = (elem *)malloc(MAXSIZE * sizeof(elem)); initializeArray(array); @@ -36,4 +36,3 @@ int main() { free(array); return 0; } - diff --git a/test/data/array4_fail.c b/test/data/array4_fail.c index 14f801022..2e12c7c83 100644 --- a/test/data/array4_fail.c +++ b/test/data/array4_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=12 // @flag --unroll=12 @@ -25,7 +25,7 @@ void initializeArray(elem *array) { int main() { int i = 0; - elem *array = (elem*)malloc((MAXSIZE + 1) * sizeof(elem)); + elem *array = (elem *)malloc((MAXSIZE + 1) * sizeof(elem)); initializeArray(array); @@ -36,4 +36,3 @@ int main() { free(array); return 0; } - diff --git a/test/data/array_free.c b/test/data/array_free.c index 146859fd3..aef33e244 100644 --- a/test/data/array_free.c +++ b/test/data/array_free.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @flag --loop-limit=11 // @flag --unroll=11 @@ -18,7 +18,7 @@ void free_array() { DATA a[MAXSIZE]; for (i = 0; i < MAXSIZE; i++) { - a[i].f = (int*)malloc(sizeof(int)); + a[i].f = (int *)malloc(sizeof(int)); *(a[i].f) = 1; } @@ -35,4 +35,3 @@ int main() { free_array(); return 0; } - diff --git a/test/data/array_free2.c b/test/data/array_free2.c index 956437981..d2545216d 100644 --- a/test/data/array_free2.c +++ b/test/data/array_free2.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @flag --loop-limit=11 // @flag --unroll=11 @@ -20,7 +20,7 @@ void free_array() { DATA a[MAXSIZE]; for (i = 0; i < MAXSIZE; i++) { - a[i].f = (int*)malloc(sizeof(int)); + a[i].f = (int *)malloc(sizeof(int)); *(a[i].f) = 1; a[i].x = 2; a[i].y = 3; @@ -41,4 +41,3 @@ int main() { free_array(); return 0; } - diff --git a/test/data/array_free2_fail.c b/test/data/array_free2_fail.c index 99fef21a9..d5805fd3f 100644 --- a/test/data/array_free2_fail.c +++ b/test/data/array_free2_fail.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @flag --loop-limit=11 // @flag --unroll=11 @@ -20,7 +20,7 @@ void free_array() { DATA a[MAXSIZE]; for (i = 0; i < MAXSIZE - 1; i++) { - a[i].f = (int*)malloc(sizeof(int)); + a[i].f = (int *)malloc(sizeof(int)); *(a[i].f) = 1; a[i].x = 2; a[i].y = 3; @@ -41,4 +41,3 @@ int main() { free_array(); return 0; } - diff --git a/test/data/array_free_fail.c b/test/data/array_free_fail.c index b23c0db7a..0f38f5d98 100644 --- a/test/data/array_free_fail.c +++ b/test/data/array_free_fail.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @flag --loop-limit=11 // @flag --unroll=11 @@ -18,7 +18,7 @@ void free_array() { DATA a[MAXSIZE]; for (i = 0; i < MAXSIZE - 1; i++) { - a[i].f = (int*)malloc(sizeof(int)); + a[i].f = (int *)malloc(sizeof(int)); *(a[i].f) = 1; } @@ -35,4 +35,3 @@ int main() { free_array(); return 0; } - diff --git a/test/data/extern_func_ptr.c b/test/data/extern_func_ptr.c index e9b8a4a1a..b83578507 100644 --- a/test/data/extern_func_ptr.c +++ b/test/data/extern_func_ptr.c @@ -12,7 +12,6 @@ int main(void) { *y = 2; assert(*x == 1 || *x == 2); - + return 0; } - diff --git a/test/data/extern_func_ptr_fail.c b/test/data/extern_func_ptr_fail.c index cc5a7d265..5e8c8ff0b 100644 --- a/test/data/extern_func_ptr_fail.c +++ b/test/data/extern_func_ptr_fail.c @@ -12,7 +12,6 @@ int main(void) { *y = 2; assert(*x == 1); - + return 0; } - diff --git a/test/data/extern_struct.c b/test/data/extern_struct.c index 6f9cedc90..51bd31f5d 100644 --- a/test/data/extern_struct.c +++ b/test/data/extern_struct.c @@ -9,4 +9,3 @@ int main(void) { assert(0); return 0; } - diff --git a/test/data/free_as_func_ptr.c b/test/data/free_as_func_ptr.c index 21ef5238d..5c630d557 100644 --- a/test/data/free_as_func_ptr.c +++ b/test/data/free_as_func_ptr.c @@ -1,10 +1,10 @@ -#include #include "smack.h" +#include // @expect verified -void free_me(void (*freefun)(void*)) { - int *x = (int*)malloc(sizeof(int)); +void free_me(void (*freefun)(void *)) { + int *x = (int *)malloc(sizeof(int)); freefun(x); } @@ -12,4 +12,3 @@ int main(void) { free_me(free); return 0; } - diff --git a/test/data/func_ptr.c b/test/data/func_ptr.c index 9af903bef..0a6add12d 100644 --- a/test/data/func_ptr.c +++ b/test/data/func_ptr.c @@ -2,13 +2,9 @@ // @expect verified -int incr(int x) { - return ++x; -} +int incr(int x) { return ++x; } -int decr(int x) { - return --x; -} +int decr(int x) { return --x; } int main(void) { int (*fp)(int); @@ -24,4 +20,3 @@ int main(void) { assert(x == 2); return 0; } - diff --git a/test/data/func_ptr1.c b/test/data/func_ptr1.c index d6051e22f..a39cd641c 100644 --- a/test/data/func_ptr1.c +++ b/test/data/func_ptr1.c @@ -1,19 +1,15 @@ -#include #include "smack.h" +#include // @expect verified -void incr(int *x) { - (*x)++; -} +void incr(int *x) { (*x)++; } -void decr(int *x) { - (*x)--; -} +void decr(int *x) { (*x)--; } int main(void) { - void (*fp)(int*); - int *x = (int*)malloc(sizeof(int)); + void (*fp)(int *); + int *x = (int *)malloc(sizeof(int)); int y = 1; *x = 1; @@ -27,4 +23,3 @@ int main(void) { assert(*x == 2); return 0; } - diff --git a/test/data/func_ptr1_fail.c b/test/data/func_ptr1_fail.c index 9590f22c4..c6693587c 100644 --- a/test/data/func_ptr1_fail.c +++ b/test/data/func_ptr1_fail.c @@ -1,19 +1,15 @@ -#include #include "smack.h" +#include // @expect error -void incr(int *x) { - (*x)++; -} +void incr(int *x) { (*x)++; } -void decr(int *x) { - (*x)--; -} +void decr(int *x) { (*x)--; } int main(void) { - void (*fp)(int*); - int *x = (int*)malloc(sizeof(int)); + void (*fp)(int *); + int *x = (int *)malloc(sizeof(int)); int y = 1; *x = 1; @@ -27,4 +23,3 @@ int main(void) { assert(*x == 0 || *x == 1); return 0; } - diff --git a/test/data/func_ptr2.c b/test/data/func_ptr2.c index 516ea71d7..5dbcab424 100644 --- a/test/data/func_ptr2.c +++ b/test/data/func_ptr2.c @@ -1,34 +1,27 @@ -#include #include "smack.h" +#include // @expect verified -int* dll_create_generic(void (*insert_fnc)()) { +int *dll_create_generic(void (*insert_fnc)()) { int *dll = ((void *)0); insert_fnc(&dll); return dll; } void dll_insert_master(int **dll) { - *dll = (int*)malloc(sizeof(int)); + *dll = (int *)malloc(sizeof(int)); **dll = 10; } -int* dll_create_master(void) { - return dll_create_generic(dll_insert_master); -} +int *dll_create_master(void) { return dll_create_generic(dll_insert_master); } -void inspect_base(int *dll) { - assert(*dll == 10); -} +void inspect_base(int *dll) { assert(*dll == 10); } -void inspect_init(int *dll) { - inspect_base(dll); -} +void inspect_init(int *dll) { inspect_base(dll); } int main(void) { int *dll = dll_create_master(); inspect_init(dll); return 0; } - diff --git a/test/data/func_ptr2_fail.c b/test/data/func_ptr2_fail.c index 472335a31..4149c2774 100644 --- a/test/data/func_ptr2_fail.c +++ b/test/data/func_ptr2_fail.c @@ -1,34 +1,27 @@ -#include #include "smack.h" +#include // @expect error -int* dll_create_generic(void (*insert_fnc)()) { +int *dll_create_generic(void (*insert_fnc)()) { int *dll = ((void *)0); insert_fnc(&dll); return dll; } void dll_insert_master(int **dll) { - *dll = (int*)malloc(sizeof(int)); + *dll = (int *)malloc(sizeof(int)); **dll = 10; } -int* dll_create_master(void) { - return dll_create_generic(dll_insert_master); -} +int *dll_create_master(void) { return dll_create_generic(dll_insert_master); } -void inspect_base(int *dll) { - assert(*dll != 10); -} +void inspect_base(int *dll) { assert(*dll != 10); } -void inspect_init(int *dll) { - inspect_base(dll); -} +void inspect_init(int *dll) { inspect_base(dll); } int main(void) { int *dll = dll_create_master(); inspect_init(dll); return 0; } - diff --git a/test/data/func_ptr_alias.c b/test/data/func_ptr_alias.c index c09f58a27..cc2787c06 100644 --- a/test/data/func_ptr_alias.c +++ b/test/data/func_ptr_alias.c @@ -2,14 +2,12 @@ // @expect verified -int __incr(int x) { - return x + 1; -} +int __incr(int x) { return x + 1; } #ifdef __MACH__ int (*incr)(int) = __incr; #else -int incr(int) __attribute__((alias ("__incr"))); +int incr(int) __attribute__((alias("__incr"))); #endif int main(void) { @@ -19,4 +17,3 @@ int main(void) { assert(x == y + 1); return 0; } - diff --git a/test/data/func_ptr_alias1.c b/test/data/func_ptr_alias1.c index 18e77e53e..0ce8473a0 100644 --- a/test/data/func_ptr_alias1.c +++ b/test/data/func_ptr_alias1.c @@ -2,20 +2,16 @@ // @expect verified -int __incr(int x) { - return ++x; -} +int __incr(int x) { return ++x; } -int __decr(int x) { - return --x; -} +int __decr(int x) { return --x; } #ifdef __MACH__ int (*incr)(int) = __incr; int (*decr)(int) = __decr; #else -int incr(int) __attribute__((alias ("__incr"))); -int decr(int) __attribute__((alias ("__decr"))); +int incr(int) __attribute__((alias("__incr"))); +int decr(int) __attribute__((alias("__decr"))); #endif int main(void) { @@ -32,4 +28,3 @@ int main(void) { assert(x == 2); return 0; } - diff --git a/test/data/func_ptr_alias1_fail.c b/test/data/func_ptr_alias1_fail.c index 4c23ac4fe..e39c3526b 100644 --- a/test/data/func_ptr_alias1_fail.c +++ b/test/data/func_ptr_alias1_fail.c @@ -2,20 +2,16 @@ // @expect error -int __incr(int x) { - return ++x; -} +int __incr(int x) { return ++x; } -int __decr(int x) { - return --x; -} +int __decr(int x) { return --x; } #ifdef __MACH__ int (*incr)(int) = __incr; int (*decr)(int) = __decr; #else -int incr(int) __attribute__((alias ("__incr"))); -int decr(int) __attribute__((alias ("__decr"))); +int incr(int) __attribute__((alias("__incr"))); +int decr(int) __attribute__((alias("__decr"))); #endif int main(void) { @@ -32,4 +28,3 @@ int main(void) { assert(x == 0 || x == 1); return 0; } - diff --git a/test/data/func_ptr_alias_fail.c b/test/data/func_ptr_alias_fail.c index 7e4d4a614..7ba6a88fa 100644 --- a/test/data/func_ptr_alias_fail.c +++ b/test/data/func_ptr_alias_fail.c @@ -2,14 +2,12 @@ // @expect error -int __incr(int x) { - return x + 2; -} +int __incr(int x) { return x + 2; } #ifdef __MACH__ int (*incr)(int) = __incr; #else -int incr(int) __attribute__((alias ("__incr"))); +int incr(int) __attribute__((alias("__incr"))); #endif int main(void) { @@ -19,4 +17,3 @@ int main(void) { assert(x == y + 1); return 0; } - diff --git a/test/data/func_ptr_array.c b/test/data/func_ptr_array.c index 6ee3d2f84..80b65a389 100644 --- a/test/data/func_ptr_array.c +++ b/test/data/func_ptr_array.c @@ -5,22 +5,16 @@ void (*fptrs[2])(); int g; -void func2() { - g = 1; -} +void func2() { g = 1; } -void add_func(void (*f)()) { - fptrs[1] = f; -} +void add_func(void (*f)()) { fptrs[1] = f; } -void func1() { - add_func(func2); -} +void func1() { add_func(func2); } int main(void) { fptrs[0] = func1; fptrs[0](); fptrs[1](); - assert (g == 1); + assert(g == 1); return 0; } diff --git a/test/data/func_ptr_array_fail.c b/test/data/func_ptr_array_fail.c index 7e645d4ff..0f7fe4d37 100644 --- a/test/data/func_ptr_array_fail.c +++ b/test/data/func_ptr_array_fail.c @@ -5,22 +5,16 @@ void (*fptrs[2])(); int g; -void func2() { - g = 1; -} +void func2() { g = 1; } -void add_func(void (*f)()) { - fptrs[1] = f; -} +void add_func(void (*f)()) { fptrs[1] = f; } -void func1() { - add_func(func2); -} +void func1() { add_func(func2); } int main(void) { fptrs[0] = func1; fptrs[0](); fptrs[1](); - assert (g == 0); + assert(g == 0); return 0; } diff --git a/test/data/func_ptr_fail.c b/test/data/func_ptr_fail.c index a18ef80e2..7ab49bbe4 100644 --- a/test/data/func_ptr_fail.c +++ b/test/data/func_ptr_fail.c @@ -2,13 +2,9 @@ // @expect error -int incr(int x) { - return ++x; -} +int incr(int x) { return ++x; } -int decr(int x) { - return --x; -} +int decr(int x) { return --x; } int main(void) { int (*fp)(int); @@ -24,4 +20,3 @@ int main(void) { assert(x == 0 || x == 1); return 0; } - diff --git a/test/data/func_ptr_vararg.c b/test/data/func_ptr_vararg.c index 7b1ef61fd..e28ca5c5b 100644 --- a/test/data/func_ptr_vararg.c +++ b/test/data/func_ptr_vararg.c @@ -13,7 +13,6 @@ void (*dprintf)(unsigned char *, ...) = &no_printf; int main(void) { (*dprintf)((unsigned char *)"%d", 10); - assert (g == 1); + assert(g == 1); return 0; } - diff --git a/test/data/func_ptr_vararg_fail.c b/test/data/func_ptr_vararg_fail.c index ef63fe67e..d609ee099 100644 --- a/test/data/func_ptr_vararg_fail.c +++ b/test/data/func_ptr_vararg_fail.c @@ -13,7 +13,6 @@ void (*dprintf)(unsigned char *, ...) = &no_printf; int main(void) { (*dprintf)((unsigned char *)"%d", 10); - assert (g == 0); + assert(g == 0); return 0; } - diff --git a/test/data/global_structs.c b/test/data/global_structs.c index aaa8dc4d8..11530d04a 100644 --- a/test/data/global_structs.c +++ b/test/data/global_structs.c @@ -10,7 +10,7 @@ typedef struct { mutex_t m_inode; mutex_t m_busy; -void mutex_lock(mutex_t* lock) { +void mutex_lock(mutex_t *lock) { assert(lock->init == 0); assert(lock->lock == 0); lock->init = 1; diff --git a/test/data/global_structs_fail.c b/test/data/global_structs_fail.c index adce5f6db..02acd6286 100644 --- a/test/data/global_structs_fail.c +++ b/test/data/global_structs_fail.c @@ -10,7 +10,7 @@ typedef struct { mutex_t m_inode; mutex_t m_busy; -void mutex_lock(mutex_t* lock) { +void mutex_lock(mutex_t *lock) { lock->init = 1; lock->lock = 2; } @@ -18,7 +18,7 @@ void mutex_lock(mutex_t* lock) { int main(void) { mutex_lock(&m_inode); mutex_lock(&m_busy); - assert(m_inode.init == 0 || m_inode.lock == 0 || - m_busy.init == 0 || m_busy.lock == 0); + assert(m_inode.init == 0 || m_inode.lock == 0 || m_busy.init == 0 || + m_busy.lock == 0); return 0; } diff --git a/test/data/globals_func_ptr.c b/test/data/globals_func_ptr.c index c190fef1c..b5e301a25 100644 --- a/test/data/globals_func_ptr.c +++ b/test/data/globals_func_ptr.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -16,25 +16,13 @@ struct ops { struct int_ops *iops; }; -int incr(int x) { - return ++x; -} +int incr(int x) { return ++x; } -int decr(int x) { - return --x; -} +int decr(int x) { return --x; } -struct int_ops my_int_ops = { - .data = 10, - .incr = incr, - .decr = decr -}; +struct int_ops my_int_ops = {.data = 10, .incr = incr, .decr = decr}; -struct ops my_ops = { - .a = 4, - .b = 5, - &my_int_ops -}; +struct ops my_ops = {.a = 4, .b = 5, &my_int_ops}; int main() { int (*fp)(int); @@ -48,4 +36,3 @@ int main() { return 0; } - diff --git a/test/data/globals_func_ptr_fail.c b/test/data/globals_func_ptr_fail.c index 9ad0e58bc..06edc6225 100644 --- a/test/data/globals_func_ptr_fail.c +++ b/test/data/globals_func_ptr_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -16,25 +16,13 @@ struct ops { struct int_ops *iops; }; -int incr(int x) { - return ++x; -} +int incr(int x) { return ++x; } -int decr(int x) { - return --x; -} +int decr(int x) { return --x; } -struct int_ops my_int_ops = { - .data = 10, - .incr = incr, - .decr = decr -}; +struct int_ops my_int_ops = {.data = 10, .incr = incr, .decr = decr}; -struct ops my_ops = { - .a = 4, - .b = 5, - &my_int_ops -}; +struct ops my_ops = {.a = 4, .b = 5, &my_int_ops}; int main() { int (*fp)(int); @@ -48,4 +36,3 @@ int main() { return 0; } - diff --git a/test/data/nested_struct.c b/test/data/nested_struct.c index 2d74441a6..37f0fb2fd 100644 --- a/test/data/nested_struct.c +++ b/test/data/nested_struct.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -44,4 +44,3 @@ int main(void) { return 0; } - diff --git a/test/data/nested_struct1.c b/test/data/nested_struct1.c index dcfd932e7..aa5504ab4 100644 --- a/test/data/nested_struct1.c +++ b/test/data/nested_struct1.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -55,4 +55,3 @@ int main(void) { return 0; } - diff --git a/test/data/nested_struct1_fail.c b/test/data/nested_struct1_fail.c index fe16b3c25..49f349289 100644 --- a/test/data/nested_struct1_fail.c +++ b/test/data/nested_struct1_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -30,9 +30,9 @@ int main(void) { p.y = 2000; elem.point1 = p; - assert(elem.count != 2 || elem.data != 5 || elem.point2.x != 200 || p.x != 1000 || - p.y != 2000 || elem.point1.x != 1000 || elem.point1.y != 2000); + assert(elem.count != 2 || elem.data != 5 || elem.point2.x != 200 || + p.x != 1000 || p.y != 2000 || elem.point1.x != 1000 || + elem.point1.y != 2000); return 0; } - diff --git a/test/data/nested_struct2.c b/test/data/nested_struct2.c index 8aaff1149..924ea5045 100644 --- a/test/data/nested_struct2.c +++ b/test/data/nested_struct2.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -55,4 +55,3 @@ int main(void) { return 0; } - diff --git a/test/data/nested_struct2_fail.c b/test/data/nested_struct2_fail.c index 6c5618b23..97413b5ec 100644 --- a/test/data/nested_struct2_fail.c +++ b/test/data/nested_struct2_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -30,9 +30,9 @@ int main(void) { p.x = 1000; p.y = 2000; - assert(elem.count != 2 || elem.data != 5 || elem.point2.x != 200 || p.x != 1000 || - p.y != 2000 || elem.point1->x != 1000 || elem.point1->y != 2000); + assert(elem.count != 2 || elem.data != 5 || elem.point2.x != 200 || + p.x != 1000 || p.y != 2000 || elem.point1->x != 1000 || + elem.point1->y != 2000); return 0; } - diff --git a/test/data/nested_struct_fail.c b/test/data/nested_struct_fail.c index bdbb351d0..e3cbc2b57 100644 --- a/test/data/nested_struct_fail.c +++ b/test/data/nested_struct_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -27,8 +27,8 @@ int main(void) { elem.data = 5; elem.point2.x = 200; - assert(elem.count != 2 || elem.point1.y != 100 || elem.data != 5 || elem.point2.x != 200); + assert(elem.count != 2 || elem.point1.y != 100 || elem.data != 5 || + elem.point2.x != 200); return 0; } - diff --git a/test/data/nondet_pointer_fail.c b/test/data/nondet_pointer_fail.c index 44baae1ee..b768e0a33 100644 --- a/test/data/nondet_pointer_fail.c +++ b/test/data/nondet_pointer_fail.c @@ -3,9 +3,8 @@ // @expect error int main(void) { - int* a; + int *a; a = __VERIFIER_nondet(); assert(a != 0); return 0; } - diff --git a/test/data/pointers.c b/test/data/pointers.c index e8f17f317..465419a42 100644 --- a/test/data/pointers.c +++ b/test/data/pointers.c @@ -1,16 +1,14 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified -void incr(int *x) { - (*x)++; -} +void incr(int *x) { (*x)++; } int main() { - int *a = (int*)malloc(sizeof(int)); - int *b = (int*)malloc(sizeof(int)); + int *a = (int *)malloc(sizeof(int)); + int *b = (int *)malloc(sizeof(int)); *a = *b = 0; @@ -22,4 +20,3 @@ int main() { return 0; } - diff --git a/test/data/pointers1.c b/test/data/pointers1.c index 7b3500ebd..d016af845 100644 --- a/test/data/pointers1.c +++ b/test/data/pointers1.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -15,7 +15,7 @@ void incr(point *p) { } int main() { - point* p = (point*)malloc(sizeof(int)); + point *p = (point *)malloc(sizeof(int)); p->a = p->b = 0; @@ -26,4 +26,3 @@ int main() { return 0; } - diff --git a/test/data/pointers1_fail.c b/test/data/pointers1_fail.c index 5453c1882..a1945a56a 100644 --- a/test/data/pointers1_fail.c +++ b/test/data/pointers1_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -16,7 +16,7 @@ void incr(point *p) { } int main() { - point* p = (point*)malloc(sizeof(int)); + point *p = (point *)malloc(sizeof(int)); p->a = p->b = 0; @@ -27,4 +27,3 @@ int main() { return 0; } - diff --git a/test/data/pointers2.c b/test/data/pointers2.c index c1131fdf2..6c6f7be7e 100644 --- a/test/data/pointers2.c +++ b/test/data/pointers2.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -32,4 +32,3 @@ int main() { return 0; } - diff --git a/test/data/pointers2_fail.c b/test/data/pointers2_fail.c index 1b6ab867c..96d3c1c43 100644 --- a/test/data/pointers2_fail.c +++ b/test/data/pointers2_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -33,4 +33,3 @@ int main() { return 0; } - diff --git a/test/data/pointers3.c b/test/data/pointers3.c index 67de79723..6fda80645 100644 --- a/test/data/pointers3.c +++ b/test/data/pointers3.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -37,4 +37,3 @@ int main() { bar(); return 0; } - diff --git a/test/data/pointers3_fail.c b/test/data/pointers3_fail.c index 46e9c84a9..8cb2043e7 100644 --- a/test/data/pointers3_fail.c +++ b/test/data/pointers3_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -37,4 +37,3 @@ int main() { bar(); return 0; } - diff --git a/test/data/pointers4.c b/test/data/pointers4.c index 3f1dccdf5..b8a4188c6 100644 --- a/test/data/pointers4.c +++ b/test/data/pointers4.c @@ -2,13 +2,10 @@ // @expect verified -void foo(int *p) { - assert(p[-1] == 0); -} +void foo(int *p) { assert(p[-1] == 0); } int main(void) { int a[3] = {0}; foo(&a[1]); return 0; } - diff --git a/test/data/pointers4_fail.c b/test/data/pointers4_fail.c index a94d13dab..9366aa469 100644 --- a/test/data/pointers4_fail.c +++ b/test/data/pointers4_fail.c @@ -2,13 +2,10 @@ // @expect error -void foo(int *p) { - assert(p[-1] != 0); -} +void foo(int *p) { assert(p[-1] != 0); } int main(void) { int a[3] = {0}; foo(&a[1]); return 0; } - diff --git a/test/timeouts/pointers5.c b/test/data/pointers5.c similarity index 54% rename from test/timeouts/pointers5.c rename to test/data/pointers5.c index cc9c5f601..5c29ae121 100644 --- a/test/timeouts/pointers5.c +++ b/test/data/pointers5.c @@ -1,18 +1,17 @@ +#include "smack.h" +#include #include #include -#include "smack.h" // @expect verified -// @flag --bit-precise-pointers -int main() { - int *a = (int*)malloc(sizeof(int)); - long int b; - - b = (long int)a; +int main(void) { + int *a = (int *)malloc(sizeof(int)); + intptr_t b; + + b = (intptr_t)a; *((int *)b) = 1; assert(*a == 1); free(a); return 0; } - diff --git a/test/data/pointers5_fail.c b/test/data/pointers5_fail.c new file mode 100644 index 000000000..01ed12e9c --- /dev/null +++ b/test/data/pointers5_fail.c @@ -0,0 +1,16 @@ +#include "smack.h" +#include +#include + +// @expect error + +int main(void) { + int *a = (int *)malloc(sizeof(int)); + intptr_t b; + + b = (intptr_t)a; + *((int *)b) = 1; + assert(*a == 2); + free(a); + return 0; +} diff --git a/test/data/pointers8.c b/test/data/pointers8.c index 42ab043f3..6124756a9 100644 --- a/test/data/pointers8.c +++ b/test/data/pointers8.c @@ -9,8 +9,8 @@ // char 3 int main(void) { long int x = 0; - int* pi = (int *)((char *)(&x) + 1); - short* ps = (short *)((char *)(&x) + 2); + int *pi = (int *)((char *)(&x) + 1); + short *ps = (short *)((char *)(&x) + 2); char *pc = (char *)((char *)(&x) + 3); *pi = 0; *ps = 0; @@ -18,4 +18,3 @@ int main(void) { assert(x == 0); return 0; } - diff --git a/test/data/pointers_fail.c b/test/data/pointers_fail.c index a3b55a890..4109b0aaf 100644 --- a/test/data/pointers_fail.c +++ b/test/data/pointers_fail.c @@ -1,16 +1,14 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error -void incr(int *x) { - (*x)++; -} +void incr(int *x) { (*x)++; } int main() { - int *a = (int*)malloc(sizeof(int)); - int *b = (int*)malloc(sizeof(int)); + int *a = (int *)malloc(sizeof(int)); + int *b = (int *)malloc(sizeof(int)); *a = *b = 0; @@ -23,4 +21,3 @@ int main() { return 0; } - diff --git a/test/data/struct_alias.c b/test/data/struct_alias.c index 9fa3dba80..d1a0e9f68 100644 --- a/test/data/struct_alias.c +++ b/test/data/struct_alias.c @@ -12,15 +12,9 @@ struct T { struct S z; }; -void f(struct S *state) -{ - state->w = 0; -} +void f(struct S *state) { state->w = 0; } -void g(struct S *state) -{ - state->w = 1; -} +void g(struct S *state) { state->w = 1; } int main(void) { struct T t; diff --git a/test/data/struct_alias_fail.c b/test/data/struct_alias_fail.c index 086483c36..047891200 100644 --- a/test/data/struct_alias_fail.c +++ b/test/data/struct_alias_fail.c @@ -12,15 +12,9 @@ struct T { struct S z; }; -void f(struct S *state) -{ - state->w = 0; -} +void f(struct S *state) { state->w = 0; } -void g(struct S *state) -{ - state->w = 1; -} +void g(struct S *state) { state->w = 1; } int main(void) { struct T t; diff --git a/test/data/struct_array.c b/test/data/struct_array.c index 4924252c1..1c5b76778 100644 --- a/test/data/struct_array.c +++ b/test/data/struct_array.c @@ -3,8 +3,8 @@ // @expect verified struct S { - short a[3]; - short x; + short a[3]; + short x; }; struct S s; @@ -15,4 +15,3 @@ int main(void) { assert(s.a[1] == 0); return 0; } - diff --git a/test/data/struct_array_fail.c b/test/data/struct_array_fail.c index ebc0ad185..6c65a8663 100644 --- a/test/data/struct_array_fail.c +++ b/test/data/struct_array_fail.c @@ -3,8 +3,8 @@ // @expect error struct S { - short a[3]; - short x; + short a[3]; + short x; }; struct S s; @@ -14,4 +14,3 @@ int main(void) { assert(s.a[0] == 0); return 0; } - diff --git a/test/data/struct_assign.c b/test/data/struct_assign.c index f67de3239..6fb95b14b 100644 --- a/test/data/struct_assign.c +++ b/test/data/struct_assign.c @@ -12,4 +12,3 @@ int main(void) { assert(x.j == 20); return 0; } - diff --git a/test/data/struct_assign_fail.c b/test/data/struct_assign_fail.c index ed631f9c8..aad154a0a 100644 --- a/test/data/struct_assign_fail.c +++ b/test/data/struct_assign_fail.c @@ -12,4 +12,3 @@ int main(void) { assert(x.j == 10); return 0; } - diff --git a/test/data/struct_cast.c b/test/data/struct_cast.c index 007702d70..70b2416a2 100644 --- a/test/data/struct_cast.c +++ b/test/data/struct_cast.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -9,13 +9,11 @@ typedef struct { int b; } S1; -typedef struct { - int x; -} S2; +typedef struct { int x; } S2; int main(void) { S1 s1; - S2* p2 = (S2*)(&s1); + S2 *p2 = (S2 *)(&s1); s1.a = 3; p2->x = 4; @@ -23,4 +21,3 @@ int main(void) { assert(s1.a == 4); return 0; } - diff --git a/test/data/struct_cast1.c b/test/data/struct_cast1.c index e98e4f099..3334729a1 100644 --- a/test/data/struct_cast1.c +++ b/test/data/struct_cast1.c @@ -1,12 +1,10 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified -typedef struct { - int x; -} S1; +typedef struct { int x; } S1; typedef struct { int a; @@ -14,8 +12,8 @@ typedef struct { } S2; int main(void) { - S2* s2 = (S2*)malloc(sizeof(S2)); - S1* s1 = (S1*)s2; + S2 *s2 = (S2 *)malloc(sizeof(S2)); + S1 *s1 = (S1 *)s2; s2->a = 3; s2->b = 5; @@ -24,4 +22,3 @@ int main(void) { assert(s2->a == 4); return 0; } - diff --git a/test/data/struct_cast1_fail.c b/test/data/struct_cast1_fail.c index 6277f1bc1..6e4b9c9ce 100644 --- a/test/data/struct_cast1_fail.c +++ b/test/data/struct_cast1_fail.c @@ -1,12 +1,10 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error -typedef struct { - int x; -} S1; +typedef struct { int x; } S1; typedef struct { int a; @@ -14,8 +12,8 @@ typedef struct { } S2; int main(void) { - S2* s2 = (S2*)malloc(sizeof(S2)); - S1* s1 = (S1*)s2; + S2 *s2 = (S2 *)malloc(sizeof(S2)); + S1 *s1 = (S1 *)s2; s2->a = 3; s2->b = 5; @@ -24,4 +22,3 @@ int main(void) { assert(s2->a == 3); return 0; } - diff --git a/test/data/struct_cast_fail.c b/test/data/struct_cast_fail.c index b4a4c568e..1db838233 100644 --- a/test/data/struct_cast_fail.c +++ b/test/data/struct_cast_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -9,13 +9,11 @@ typedef struct { int b; } S1; -typedef struct { - int x; -} S2; +typedef struct { int x; } S2; int main(void) { S1 s1; - S2* p2 = (S2*)(&s1); + S2 *p2 = (S2 *)(&s1); s1.a = 3; p2->x = 4; @@ -23,4 +21,3 @@ int main(void) { assert(s1.a == 3); return 0; } - diff --git a/test/data/struct_const_return_fail.c b/test/data/struct_const_return_fail.c index 54c48ecb7..8ea6a5a2b 100644 --- a/test/data/struct_const_return_fail.c +++ b/test/data/struct_const_return_fail.c @@ -1,7 +1,7 @@ #include "smack.h" // @flag --clang-options=-O1 -// @expect error +// @expect error typedef struct { int a; diff --git a/test/data/struct_init.c b/test/data/struct_init.c index 519bbaebf..b70a293b4 100644 --- a/test/data/struct_init.c +++ b/test/data/struct_init.c @@ -8,8 +8,7 @@ struct a { }; int main(void) { - struct a x = {0,0}; + struct a x = {0, 0}; assert(x.i == 0 && x.j == 0); return 0; } - diff --git a/test/data/struct_init_fail.c b/test/data/struct_init_fail.c index 90683670a..ba74d0348 100644 --- a/test/data/struct_init_fail.c +++ b/test/data/struct_init_fail.c @@ -8,8 +8,7 @@ struct a { }; int main(void) { - struct a x = {0,0}; + struct a x = {0, 0}; assert(x.j == 1); return 0; } - diff --git a/test/data/struct_return.c b/test/data/struct_return.c index b57270b30..dcde67cd6 100644 --- a/test/data/struct_return.c +++ b/test/data/struct_return.c @@ -20,4 +20,3 @@ int main(void) { assert(x.j == 20); return 0; } - diff --git a/test/data/two_arrays.c b/test/data/two_arrays.c index 97d95e82f..0a42d7f32 100644 --- a/test/data/two_arrays.c +++ b/test/data/two_arrays.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=11 // @flag --unroll=11 @@ -28,8 +28,8 @@ void setArray(int *array) { int main() { int i = 0; - int *arrayOne = (int*)malloc(MAXSIZE * sizeof(int)); - int *arrayTwo = (int*)malloc(MAXSIZE * sizeof(int)); + int *arrayOne = (int *)malloc(MAXSIZE * sizeof(int)); + int *arrayTwo = (int *)malloc(MAXSIZE * sizeof(int)); resetArray(arrayOne); setArray(arrayTwo); @@ -51,4 +51,3 @@ int main() { free(arrayTwo); return 0; } - diff --git a/test/data/two_arrays1.c b/test/data/two_arrays1.c index 82776857f..3b1723306 100644 --- a/test/data/two_arrays1.c +++ b/test/data/two_arrays1.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=11 // @flag --unroll=11 @@ -42,8 +42,8 @@ void initializeCount(elem *array) { int main() { int i = 0; - elem *arrayOne = (elem*)malloc(MAXSIZE * sizeof(elem)); - elem *arrayTwo = (elem*)malloc(MAXSIZE * sizeof(elem)); + elem *arrayOne = (elem *)malloc(MAXSIZE * sizeof(elem)); + elem *arrayTwo = (elem *)malloc(MAXSIZE * sizeof(elem)); resetArray(arrayOne); setArray(arrayTwo); @@ -69,4 +69,3 @@ int main() { free(arrayTwo); return 0; } - diff --git a/test/data/two_arrays1_fail.c b/test/data/two_arrays1_fail.c index af22317e8..801e1ab4d 100644 --- a/test/data/two_arrays1_fail.c +++ b/test/data/two_arrays1_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=11 // @flag --unroll=11 @@ -42,8 +42,8 @@ void initializeCount(elem *array) { int main() { int i = 0; - elem *arrayOne = (elem*)malloc(MAXSIZE * sizeof(elem)); - elem *arrayTwo = (elem*)malloc(MAXSIZE * sizeof(elem)); + elem *arrayOne = (elem *)malloc(MAXSIZE * sizeof(elem)); + elem *arrayTwo = (elem *)malloc(MAXSIZE * sizeof(elem)); resetArray(arrayOne); setArray(arrayTwo); @@ -69,4 +69,3 @@ int main() { free(arrayTwo); return 0; } - diff --git a/test/data/two_arrays2.c b/test/data/two_arrays2.c index 445c445bb..2f8935db9 100644 --- a/test/data/two_arrays2.c +++ b/test/data/two_arrays2.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -45,8 +45,8 @@ int main() { arraySize = __VERIFIER_nondet_int(); assume(arraySize > 0); - elem *arrayOne = (elem*)malloc(arraySize * sizeof(elem)); - elem *arrayTwo = (elem*)malloc(arraySize * sizeof(elem)); + elem *arrayOne = (elem *)malloc(arraySize * sizeof(elem)); + elem *arrayTwo = (elem *)malloc(arraySize * sizeof(elem)); resetArray(arrayOne); setArray(arrayTwo); @@ -72,4 +72,3 @@ int main() { free(arrayTwo); return 0; } - diff --git a/test/data/two_arrays3.c b/test/data/two_arrays3.c index 445c445bb..2f8935db9 100644 --- a/test/data/two_arrays3.c +++ b/test/data/two_arrays3.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -45,8 +45,8 @@ int main() { arraySize = __VERIFIER_nondet_int(); assume(arraySize > 0); - elem *arrayOne = (elem*)malloc(arraySize * sizeof(elem)); - elem *arrayTwo = (elem*)malloc(arraySize * sizeof(elem)); + elem *arrayOne = (elem *)malloc(arraySize * sizeof(elem)); + elem *arrayTwo = (elem *)malloc(arraySize * sizeof(elem)); resetArray(arrayOne); setArray(arrayTwo); @@ -72,4 +72,3 @@ int main() { free(arrayTwo); return 0; } - diff --git a/test/data/two_arrays4.c b/test/data/two_arrays4.c index 445c445bb..2f8935db9 100644 --- a/test/data/two_arrays4.c +++ b/test/data/two_arrays4.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -45,8 +45,8 @@ int main() { arraySize = __VERIFIER_nondet_int(); assume(arraySize > 0); - elem *arrayOne = (elem*)malloc(arraySize * sizeof(elem)); - elem *arrayTwo = (elem*)malloc(arraySize * sizeof(elem)); + elem *arrayOne = (elem *)malloc(arraySize * sizeof(elem)); + elem *arrayTwo = (elem *)malloc(arraySize * sizeof(elem)); resetArray(arrayOne); setArray(arrayTwo); @@ -72,4 +72,3 @@ int main() { free(arrayTwo); return 0; } - diff --git a/test/data/two_arrays5.c b/test/data/two_arrays5.c index 43f1b8063..8198d4e96 100644 --- a/test/data/two_arrays5.c +++ b/test/data/two_arrays5.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -43,8 +43,8 @@ int main() { arraySize = __VERIFIER_nondet_int(); assume(arraySize > 0); - elem *arrayOne = (elem*)malloc(arraySize * sizeof(elem)); - elem *arrayTwo = (elem*)malloc(arraySize * sizeof(elem)); + elem *arrayOne = (elem *)malloc(arraySize * sizeof(elem)); + elem *arrayTwo = (elem *)malloc(arraySize * sizeof(elem)); resetArray(arrayOne); setArray(arrayTwo); @@ -58,4 +58,3 @@ int main() { free(arrayTwo); return 0; } - diff --git a/test/data/two_arrays6.c b/test/data/two_arrays6.c index 978977387..b7d6c81d6 100644 --- a/test/data/two_arrays6.c +++ b/test/data/two_arrays6.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -47,8 +47,8 @@ int main() { arraySize = __VERIFIER_nondet_int(); assume(arraySize > 0); - arrayOne = (elem*)malloc(arraySize * sizeof(elem)); - arrayTwo = (elem*)malloc(arraySize * sizeof(elem)); + arrayOne = (elem *)malloc(arraySize * sizeof(elem)); + arrayTwo = (elem *)malloc(arraySize * sizeof(elem)); resetArray(arrayOne); setArray(arrayTwo); @@ -74,4 +74,3 @@ int main() { free(arrayTwo); return 0; } - diff --git a/test/data/two_arrays6_fail.c b/test/data/two_arrays6_fail.c index 7017dffe4..11ee48184 100644 --- a/test/data/two_arrays6_fail.c +++ b/test/data/two_arrays6_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -47,8 +47,8 @@ int main() { arraySize = __VERIFIER_nondet_int(); assume(arraySize > 0); - arrayOne = (elem*)malloc(arraySize * sizeof(elem)); - arrayTwo = (elem*)malloc(arraySize * sizeof(elem)); + arrayOne = (elem *)malloc(arraySize * sizeof(elem)); + arrayTwo = (elem *)malloc(arraySize * sizeof(elem)); resetArray(arrayOne); setArray(arrayTwo); @@ -65,11 +65,11 @@ int main() { resetArray(arrayTwo); for (i = arraySize - 1; i >= 0; i--) { - assert(arrayOne[i].count != 0 || arrayOne[i].status != SET || arrayTwo[i].status != RESET); + assert(arrayOne[i].count != 0 || arrayOne[i].status != SET || + arrayTwo[i].status != RESET); } free(arrayOne); free(arrayTwo); return 0; } - diff --git a/test/data/two_arrays_fail.c b/test/data/two_arrays_fail.c index 3783aef79..e116fee7f 100644 --- a/test/data/two_arrays_fail.c +++ b/test/data/two_arrays_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @flag --loop-limit=11 // @flag --unroll=11 @@ -28,8 +28,8 @@ void setArray(int *array) { int main() { int i = 0; - int *arrayOne = (int*)malloc(MAXSIZE * sizeof(int)); - int *arrayTwo = (int*)malloc(MAXSIZE * sizeof(int)); + int *arrayOne = (int *)malloc(MAXSIZE * sizeof(int)); + int *arrayTwo = (int *)malloc(MAXSIZE * sizeof(int)); resetArray(arrayOne); setArray(arrayTwo); @@ -51,4 +51,3 @@ int main() { free(arrayTwo); return 0; } - diff --git a/test/failing/exit.c b/test/failing/exit.c index d2f4da74a..f0f67ab4f 100644 --- a/test/failing/exit.c +++ b/test/failing/exit.c @@ -8,11 +8,11 @@ int x = 1; void *t1(void *arg) { x++; - if(x == 2) - pthread_exit((void*)5); + if (x == 2) + pthread_exit((void *)5); // Should never run this line, since called pthread_exit - pthread_exit((void*)6); + pthread_exit((void *)6); } int main() { diff --git a/test/failing/extern_mem2.c b/test/failing/extern_mem2.c index 40a5d0faf..e7088db82 100644 --- a/test/failing/extern_mem2.c +++ b/test/failing/extern_mem2.c @@ -1,10 +1,10 @@ -#include #include +#include // @expect verified -void foo(int*); -int* bar(); +void foo(int *); +int *bar(); int main(void) { int *x = malloc(4); @@ -19,4 +19,3 @@ int main(void) { return 0; } - diff --git a/test/failing/struct_by_value.c b/test/failing/struct_by_value.c index 23ca5ab06..6528d2119 100644 --- a/test/failing/struct_by_value.c +++ b/test/failing/struct_by_value.c @@ -7,16 +7,13 @@ struct S { int y; }; -int eq(struct S p1, struct S p2) { - return p1.y == p2.y; -} +int eq(struct S p1, struct S p2) { return p1.y == p2.y; } int main(void) { struct S p = {0, 0}; struct S q = {1, 1}; p = q; assert(p.y == q.y); - assert(eq(p,q)); + assert(eq(p, q)); return 0; } - diff --git a/test/float/bitcast.c b/test/float/bitcast.c index ceb2e7225..4ec817503 100644 --- a/test/float/bitcast.c +++ b/test/float/bitcast.c @@ -5,8 +5,8 @@ int main(void) { int i = 2; - float f = *((float*) &i); - int i1 = *((int*) &f); - assert (i == i1); + float f = *((float *)&i); + int i1 = *((int *)&f); + assert(i == i1); return 0; } diff --git a/test/float/bitcast_fail.c b/test/float/bitcast_fail.c index 3b28171f4..700b18d44 100644 --- a/test/float/bitcast_fail.c +++ b/test/float/bitcast_fail.c @@ -5,8 +5,8 @@ int main(void) { int i = 2; - float f = *((float*) &i); - int i1 = *((int*) &f); - assert (i != i1); + float f = *((float *)&i); + int i1 = *((int *)&f); + assert(i != i1); return 0; } diff --git a/test/float/change_rm.c b/test/float/change_rm.c index fa4aba764..56217d53d 100644 --- a/test/float/change_rm.c +++ b/test/float/change_rm.c @@ -7,8 +7,9 @@ int main(void) { assert(fegetround() == FE_TONEAREST); int rm = __VERIFIER_nondet_int(); - assume(rm == FE_TONEAREST || rm == FE_DOWNWARD || rm == FE_UPWARD || rm == FE_TOWARDZERO); - + assume(rm == FE_TONEAREST || rm == FE_DOWNWARD || rm == FE_UPWARD || + rm == FE_TOWARDZERO); + assert(!fesetround(rm)); assert(fegetround() == rm); diff --git a/test/float/double_op_fail.c b/test/float/double_op_fail.c old mode 100755 new mode 100644 index c970d87de..8454df824 --- a/test/float/double_op_fail.c +++ b/test/float/double_op_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -13,6 +13,6 @@ int main(void) { b = 50.0; c = (a * b) / b; assert(c == 2.0); - + return 0; } diff --git a/test/float/double_ops.c b/test/float/double_ops.c old mode 100755 new mode 100644 index 9f21e9cb2..f6f00ddab --- a/test/float/double_ops.c +++ b/test/float/double_ops.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -13,17 +13,17 @@ int main(void) { b = 2.25; c = a + b; assert(c == 3.75); - + a = 1.5; b = 2.25; c = a - b; assert(c == -0.75); - + a = 1.5; b = 3.0; c = a * b; assert(c == 4.5); - + a = 3.0; b = 1.5; c = a / b; diff --git a/test/float/float_int_union.c b/test/float/float_int_union.c new file mode 100644 index 000000000..1a4764222 --- /dev/null +++ b/test/float/float_int_union.c @@ -0,0 +1,23 @@ +#include "smack.h" + +// @flag --bit-precise +// @expect verified + +union mix { + float f; + int i; +}; + +int sum_to_int(float a, float b) { + float sum = a + b; + union mix m; + m.f = sum; + return m.i; +} + +int main(void) { + int i; + i = sum_to_int(-0x1.6b890ep+29, 0x1.6b890ep+29); + assert(i == 0); + return 0; +} diff --git a/test/float/float_int_union_fail.c b/test/float/float_int_union_fail.c new file mode 100644 index 000000000..d8228a607 --- /dev/null +++ b/test/float/float_int_union_fail.c @@ -0,0 +1,23 @@ +#include "smack.h" + +// @flag --bit-precise +// @expect error + +union mix { + float f; + int i; +}; + +int sum_to_int(float a, float b) { + float sum = a + b; + union mix m; + m.f = sum; + return m.i; +} + +int main(void) { + int i; + i = sum_to_int(0x1.6b890ep+29, 0x1.6b890ep+29); + assert(i == 0); + return 0; +} diff --git a/test/float/float_op_fail.c b/test/float/float_op_fail.c old mode 100755 new mode 100644 index 1a6165fa2..edb06f59e --- a/test/float/float_op_fail.c +++ b/test/float/float_op_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -13,6 +13,6 @@ int main(void) { b = 2.25f; c = a * (b / a); assert(c == 2.0f); - + return 0; } diff --git a/test/float/float_ops.c b/test/float/float_ops.c old mode 100755 new mode 100644 index 4ff824e23..f4d3555dc --- a/test/float/float_ops.c +++ b/test/float/float_ops.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -13,17 +13,17 @@ int main(void) { b = 2.25f; c = a + b; assert(c == 3.75f); - + a = 1.5f; b = 2.25f; c = a - b; assert(c == -0.75f); - + a = 1.5f; b = 3.0f; c = a * b; assert(c == 4.5f); - + a = 3.0f; b = 1.5f; c = a / b; diff --git a/test/float/floats_in_memory.c b/test/float/floats_in_memory.c index 42aa97e8d..b5ddd173d 100644 --- a/test/float/floats_in_memory.c +++ b/test/float/floats_in_memory.c @@ -3,9 +3,7 @@ // @expect verified void ff1(float f); -void ff2(float *f1, float *f2) { - *f1 = *f2; -} +void ff2(float *f1, float *f2) { *f1 = *f2; } int main(void) { float f1; diff --git a/test/float/floats_in_memory_fail.c b/test/float/floats_in_memory_fail.c index afd8d638c..21ef21bdb 100644 --- a/test/float/floats_in_memory_fail.c +++ b/test/float/floats_in_memory_fail.c @@ -3,9 +3,7 @@ // @expect error void ff1(float f); -void ff2(float *f1, float *f2) { - *f1 = *f2 + 2.0f; -} +void ff2(float *f1, float *f2) { *f1 = *f2 + 2.0f; } int main(void) { float f1; diff --git a/test/float/floor.c b/test/float/floor.c index d01280199..70cb3ab4e 100644 --- a/test/float/floor.c +++ b/test/float/floor.c @@ -9,13 +9,17 @@ int main(void) { assert(floor(-2.7) == -3.0); double c = floor(-0.0); assert(c == -0.0); - assert(sizeof(c) == sizeof(float) ? - __signbitf(c) : sizeof(c) == sizeof(double) ? __signbit(c) : __signbitl(c)); + assert(sizeof(c) == sizeof(float) + ? __signbitf(c) + : sizeof(c) == sizeof(double) ? __signbit(c) : __signbitl(c)); c = floor(-(__builtin_inff())); - assert(sizeof((__builtin_inff())) == sizeof(float) ? __isinff((__builtin_inff())) : - sizeof((__builtin_inff())) == sizeof(double) ? __isinf((__builtin_inff())) : __isinfl((__builtin_inff()))); - assert(sizeof(c) == sizeof(float) ? - __signbitf(c) : sizeof(c) == sizeof(double) ? __signbit(c) : __signbitl(c)); + assert(sizeof((__builtin_inff())) == sizeof(float) + ? __isinff((__builtin_inff())) + : sizeof((__builtin_inff())) == sizeof(double) + ? __isinf((__builtin_inff())) + : __isinfl((__builtin_inff()))); + assert(sizeof(c) == sizeof(float) + ? __signbitf(c) + : sizeof(c) == sizeof(double) ? __signbit(c) : __signbitl(c)); return 0; } - diff --git a/test/float/floor_fail.c b/test/float/floor_fail.c index f484e9db5..833013849 100644 --- a/test/float/floor_fail.c +++ b/test/float/floor_fail.c @@ -9,13 +9,17 @@ int main(void) { assert(floor(-2.7) == -3.0); double c = floor(-0.0); assert(c == -0.0); - assert(sizeof(c) == sizeof(float) ? - __signbitf(c) : sizeof(c) == sizeof(double) ? __signbit(c) : __signbitl(c)); + assert(sizeof(c) == sizeof(float) + ? __signbitf(c) + : sizeof(c) == sizeof(double) ? __signbit(c) : __signbitl(c)); c = floor(__builtin_inff()); - assert(sizeof((__builtin_inff())) == sizeof(float) ? __isinff((__builtin_inff())) : - sizeof((__builtin_inff())) == sizeof(double) ? __isinf((__builtin_inff())) : __isinfl((__builtin_inff()))); - assert(sizeof(c) == sizeof(float) ? - __signbitf(c) : sizeof(c) == sizeof(double) ? __signbit(c) : __signbitl(c)); + assert(sizeof((__builtin_inff())) == sizeof(float) + ? __isinff((__builtin_inff())) + : sizeof((__builtin_inff())) == sizeof(double) + ? __isinf((__builtin_inff())) + : __isinfl((__builtin_inff()))); + assert(sizeof(c) == sizeof(float) + ? __signbitf(c) + : sizeof(c) == sizeof(double) ? __signbit(c) : __signbitl(c)); return 0; } - diff --git a/test/float/get_rm_invalid.c b/test/float/get_rm_invalid.c index ae2043b06..860f65e5c 100644 --- a/test/float/get_rm_invalid.c +++ b/test/float/get_rm_invalid.c @@ -5,7 +5,8 @@ int main(void) { int rm = fegetround(); - assume(rm != FE_TONEAREST && rm != FE_DOWNWARD && rm != FE_UPWARD && rm != FE_TOWARDZERO); + assume(rm != FE_TONEAREST && rm != FE_DOWNWARD && rm != FE_UPWARD && + rm != FE_TOWARDZERO); assert(rm < 0); diff --git a/test/float/half_intrinsics.c b/test/float/half_intrinsics.c new file mode 100644 index 000000000..a789060c3 --- /dev/null +++ b/test/float/half_intrinsics.c @@ -0,0 +1,19 @@ +#include "math.h" +#include "smack.h" + +// @flag --bit-precise +// @expect verified + +int main(void) { + union { + unsigned short u; + __fp16 h; + } uh; + uh.u = 1U; + assert(isnormal((float)uh.h)); + assert(isnormal((double)uh.h)); + uh.h = 66504.0f; + assert(uh.u == 31744U); + uh.h = 66504.0; + assert(uh.u == 31744U); +} diff --git a/test/float/half_intrinsics_fail.c b/test/float/half_intrinsics_fail.c new file mode 100644 index 000000000..39460e032 --- /dev/null +++ b/test/float/half_intrinsics_fail.c @@ -0,0 +1,19 @@ +#include "math.h" +#include "smack.h" + +// @flag --bit-precise +// @expect error + +int main(void) { + union { + unsigned short u; + __fp16 h; + } uh; + uh.u = 1U; + assert(isnormal((float)uh.h)); + assert(isnormal((double)uh.h)); + uh.h = 66504.0f; + assert(uh.u != 31744U); + uh.h = 66504.0; + assert(uh.u == 31744U); +} diff --git a/test/float/intrinsics.c b/test/float/intrinsics.c new file mode 100644 index 000000000..8fecce55b --- /dev/null +++ b/test/float/intrinsics.c @@ -0,0 +1,10 @@ +#include "smack.h" + +// @expect verified + +int main(void) { + float a = __VERIFIER_nondet_float(); + assume(a == -1.0f); + assert(__builtin_fabs(a) == -a); + return 0; +} diff --git a/test/float/intrinsics_fail.c b/test/float/intrinsics_fail.c new file mode 100644 index 000000000..2f6f7ed05 --- /dev/null +++ b/test/float/intrinsics_fail.c @@ -0,0 +1,10 @@ +#include "smack.h" + +// @expect error + +int main(void) { + float a = __VERIFIER_nondet_float(); + assume(a == -1.0f); + assert(__builtin_fabs(a) < -a); + return 0; +} diff --git a/test/float/llvm_intrinsic.c b/test/float/llvm_intrinsic.c new file mode 100644 index 000000000..9c135ecd0 --- /dev/null +++ b/test/float/llvm_intrinsic.c @@ -0,0 +1,11 @@ +#include "smack.h" +#include + +//@expect verified + +int main(void) { + double f = __VERIFIER_nondet_double(); + assume(isfinite(f)); + assert(f + 0.0 == f); + return 0; +} diff --git a/test/float/llvm_intrinsic_fail.c b/test/float/llvm_intrinsic_fail.c new file mode 100644 index 000000000..9b7393640 --- /dev/null +++ b/test/float/llvm_intrinsic_fail.c @@ -0,0 +1,11 @@ +#include "smack.h" +#include + +//@expect error + +int main(void) { + double f = __VERIFIER_nondet_double(); + assume(isfinite(f)); + assert(f + 0.0 != f); + return 0; +} diff --git a/test/float/set_rm_invalid.c b/test/float/set_rm_invalid.c index bd4696c78..74899d727 100644 --- a/test/float/set_rm_invalid.c +++ b/test/float/set_rm_invalid.c @@ -5,7 +5,8 @@ int main(void) { int rm = __VERIFIER_nondet_int(); - assume(rm != FE_TONEAREST && rm != FE_DOWNWARD && rm != FE_UPWARD && rm != FE_TOWARDZERO); + assume(rm != FE_TONEAREST && rm != FE_DOWNWARD && rm != FE_UPWARD && + rm != FE_TOWARDZERO); assert(fesetround(rm)); diff --git a/test/float/simple_double.c b/test/float/simple_double.c old mode 100755 new mode 100644 index 6ec9aa9ef..d547fe906 --- a/test/float/simple_double.c +++ b/test/float/simple_double.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified diff --git a/test/float/simple_double_fail.c b/test/float/simple_double_fail.c old mode 100755 new mode 100644 index 3ad0bb465..1251eafaa --- a/test/float/simple_double_fail.c +++ b/test/float/simple_double_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error diff --git a/test/float/simple_float.c b/test/float/simple_float.c old mode 100755 new mode 100644 index 6e92fa91a..2284a3f25 --- a/test/float/simple_float.c +++ b/test/float/simple_float.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified diff --git a/test/float/simple_float_fail.c b/test/float/simple_float_fail.c old mode 100755 new mode 100644 index cf96cddc9..1ce6d2e9e --- a/test/float/simple_float_fail.c +++ b/test/float/simple_float_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error diff --git a/test/float/smack_code_annot.c b/test/float/smack_code_annot.c new file mode 100644 index 000000000..799977145 --- /dev/null +++ b/test/float/smack_code_annot.c @@ -0,0 +1,14 @@ +#include "smack.h" + +// @expect verified + +double f32_to_f64(float x) { + double ret = __VERIFIER_nondet_double(); + __SMACK_code("@ := $fpext.bvfloat.bvdouble(RNE, @f);", ret, x); + return ret; +} + +int main(void) { + assert(f32_to_f64(2.0f) == 2.0); + return 0; +} diff --git a/test/float/smack_code_annot_fail.c b/test/float/smack_code_annot_fail.c new file mode 100644 index 000000000..451c1ba37 --- /dev/null +++ b/test/float/smack_code_annot_fail.c @@ -0,0 +1,14 @@ +#include "smack.h" + +// @expect error + +double f32_to_f64(float x) { + double ret = __VERIFIER_nondet_double(); + __SMACK_code("@ := $fpext.bvfloat.bvdouble(RNE, @f);", ret, x); + return ret; +} + +int main(void) { + assert(f32_to_f64(2.0f) != 2.0); + return 0; +} diff --git a/test/locks/test_locks_10_true.c b/test/locks/test_locks_10_true.c index d87040809..27586b720 100644 --- a/test/locks/test_locks_10_true.c +++ b/test/locks/test_locks_10_true.c @@ -3,164 +3,190 @@ // @expect verified extern int __VERIFIER_nondet_int(); -int main() -{ - int p1 = __VERIFIER_nondet_int(); // condition variable - int lk1; // lock variable +int main() { + int p1 = __VERIFIER_nondet_int(); // condition variable + int lk1; // lock variable - int p2 = __VERIFIER_nondet_int(); // condition variable - int lk2; // lock variable + int p2 = __VERIFIER_nondet_int(); // condition variable + int lk2; // lock variable - int p3 = __VERIFIER_nondet_int(); // condition variable - int lk3; // lock variable + int p3 = __VERIFIER_nondet_int(); // condition variable + int lk3; // lock variable - int p4 = __VERIFIER_nondet_int(); // condition variable - int lk4; // lock variable + int p4 = __VERIFIER_nondet_int(); // condition variable + int lk4; // lock variable - int p5 = __VERIFIER_nondet_int(); // condition variable - int lk5; // lock variable + int p5 = __VERIFIER_nondet_int(); // condition variable + int lk5; // lock variable - int p6 = __VERIFIER_nondet_int(); // condition variable - int lk6; // lock variable + int p6 = __VERIFIER_nondet_int(); // condition variable + int lk6; // lock variable - int p7 = __VERIFIER_nondet_int(); // condition variable - int lk7; // lock variable + int p7 = __VERIFIER_nondet_int(); // condition variable + int lk7; // lock variable - int p8 = __VERIFIER_nondet_int(); // condition variable - int lk8; // lock variable + int p8 = __VERIFIER_nondet_int(); // condition variable + int lk8; // lock variable - int p9 = __VERIFIER_nondet_int(); // condition variable - int lk9; // lock variable + int p9 = __VERIFIER_nondet_int(); // condition variable + int lk9; // lock variable - int p10 = __VERIFIER_nondet_int(); // condition variable - int lk10; // lock variable + int p10 = __VERIFIER_nondet_int(); // condition variable + int lk10; // lock variable + int cond; - int cond; + while (1) { + cond = __VERIFIER_nondet_int(); + if (cond == 0) { + goto out; + } else { + } + lk1 = 0; // initially lock is open + + lk2 = 0; // initially lock is open - while(1) { - cond = __VERIFIER_nondet_int(); - if (cond == 0) { - goto out; - } else {} - lk1 = 0; // initially lock is open + lk3 = 0; // initially lock is open - lk2 = 0; // initially lock is open + lk4 = 0; // initially lock is open - lk3 = 0; // initially lock is open + lk5 = 0; // initially lock is open - lk4 = 0; // initially lock is open + lk6 = 0; // initially lock is open - lk5 = 0; // initially lock is open + lk7 = 0; // initially lock is open - lk6 = 0; // initially lock is open + lk8 = 0; // initially lock is open - lk7 = 0; // initially lock is open + lk9 = 0; // initially lock is open - lk8 = 0; // initially lock is open + lk10 = 0; // initially lock is open - lk9 = 0; // initially lock is open + // lock phase + if (p1 != 0) { + lk1 = 1; // acquire lock + } else { + } - lk10 = 0; // initially lock is open + if (p2 != 0) { + lk2 = 1; // acquire lock + } else { + } + if (p3 != 0) { + lk3 = 1; // acquire lock + } else { + } - // lock phase - if (p1 != 0) { - lk1 = 1; // acquire lock - } else {} + if (p4 != 0) { + lk4 = 1; // acquire lock + } else { + } + + if (p5 != 0) { + lk5 = 1; // acquire lock + } else { + } + + if (p6 != 0) { + lk6 = 1; // acquire lock + } else { + } + + if (p7 != 0) { + lk7 = 1; // acquire lock + } else { + } + + if (p8 != 0) { + lk8 = 1; // acquire lock + } else { + } - if (p2 != 0) { - lk2 = 1; // acquire lock - } else {} + if (p9 != 0) { + lk9 = 1; // acquire lock + } else { + } + + if (p10 != 0) { + lk10 = 1; // acquire lock + } else { + } - if (p3 != 0) { - lk3 = 1; // acquire lock - } else {} + // unlock phase + if (p1 != 0) { + if (lk1 != 1) + goto ERROR; // assertion failure + lk1 = 0; + } else { + } - if (p4 != 0) { - lk4 = 1; // acquire lock - } else {} + if (p2 != 0) { + if (lk2 != 1) + goto ERROR; // assertion failure + lk2 = 0; + } else { + } - if (p5 != 0) { - lk5 = 1; // acquire lock - } else {} + if (p3 != 0) { + if (lk3 != 1) + goto ERROR; // assertion failure + lk3 = 0; + } else { + } - if (p6 != 0) { - lk6 = 1; // acquire lock - } else {} + if (p4 != 0) { + if (lk4 != 1) + goto ERROR; // assertion failure + lk4 = 0; + } else { + } - if (p7 != 0) { - lk7 = 1; // acquire lock - } else {} + if (p5 != 0) { + if (lk5 != 1) + goto ERROR; // assertion failure + lk5 = 0; + } else { + } - if (p8 != 0) { - lk8 = 1; // acquire lock - } else {} + if (p6 != 0) { + if (lk6 != 1) + goto ERROR; // assertion failure + lk6 = 0; + } else { + } - if (p9 != 0) { - lk9 = 1; // acquire lock - } else {} + if (p7 != 0) { + if (lk7 != 1) + goto ERROR; // assertion failure + lk7 = 0; + } else { + } - if (p10 != 0) { - lk10 = 1; // acquire lock - } else {} + if (p8 != 0) { + if (lk8 != 1) + goto ERROR; // assertion failure + lk8 = 0; + } else { + } + if (p9 != 0) { + if (lk9 != 1) + goto ERROR; // assertion failure + lk9 = 0; + } else { + } - // unlock phase - if (p1 != 0) { - if (lk1 != 1) goto ERROR; // assertion failure - lk1 = 0; - } else {} - - if (p2 != 0) { - if (lk2 != 1) goto ERROR; // assertion failure - lk2 = 0; - } else {} - - if (p3 != 0) { - if (lk3 != 1) goto ERROR; // assertion failure - lk3 = 0; - } else {} - - if (p4 != 0) { - if (lk4 != 1) goto ERROR; // assertion failure - lk4 = 0; - } else {} - - if (p5 != 0) { - if (lk5 != 1) goto ERROR; // assertion failure - lk5 = 0; - } else {} - - if (p6 != 0) { - if (lk6 != 1) goto ERROR; // assertion failure - lk6 = 0; - } else {} - - if (p7 != 0) { - if (lk7 != 1) goto ERROR; // assertion failure - lk7 = 0; - } else {} - - if (p8 != 0) { - if (lk8 != 1) goto ERROR; // assertion failure - lk8 = 0; - } else {} - - if (p9 != 0) { - if (lk9 != 1) goto ERROR; // assertion failure - lk9 = 0; - } else {} - - if (p10 != 0) { - if (lk10 != 1) goto ERROR; // assertion failure - lk10 = 0; - } else {} - - } - out: - return 0; - ERROR: assert(0); - return 0; + if (p10 != 0) { + if (lk10 != 1) + goto ERROR; // assertion failure + lk10 = 0; + } else { + } + } +out: + return 0; +ERROR: + assert(0); + return 0; } - diff --git a/test/locks/test_locks_11_true.c b/test/locks/test_locks_11_true.c index 9d3bdd1c3..6390b9c86 100644 --- a/test/locks/test_locks_11_true.c +++ b/test/locks/test_locks_11_true.c @@ -3,178 +3,207 @@ // @expect verified extern int __VERIFIER_nondet_int(); -int main() -{ - int p1 = __VERIFIER_nondet_int(); // condition variable - int lk1; // lock variable +int main() { + int p1 = __VERIFIER_nondet_int(); // condition variable + int lk1; // lock variable - int p2 = __VERIFIER_nondet_int(); // condition variable - int lk2; // lock variable + int p2 = __VERIFIER_nondet_int(); // condition variable + int lk2; // lock variable - int p3 = __VERIFIER_nondet_int(); // condition variable - int lk3; // lock variable + int p3 = __VERIFIER_nondet_int(); // condition variable + int lk3; // lock variable - int p4 = __VERIFIER_nondet_int(); // condition variable - int lk4; // lock variable + int p4 = __VERIFIER_nondet_int(); // condition variable + int lk4; // lock variable - int p5 = __VERIFIER_nondet_int(); // condition variable - int lk5; // lock variable + int p5 = __VERIFIER_nondet_int(); // condition variable + int lk5; // lock variable - int p6 = __VERIFIER_nondet_int(); // condition variable - int lk6; // lock variable + int p6 = __VERIFIER_nondet_int(); // condition variable + int lk6; // lock variable - int p7 = __VERIFIER_nondet_int(); // condition variable - int lk7; // lock variable + int p7 = __VERIFIER_nondet_int(); // condition variable + int lk7; // lock variable - int p8 = __VERIFIER_nondet_int(); // condition variable - int lk8; // lock variable + int p8 = __VERIFIER_nondet_int(); // condition variable + int lk8; // lock variable - int p9 = __VERIFIER_nondet_int(); // condition variable - int lk9; // lock variable + int p9 = __VERIFIER_nondet_int(); // condition variable + int lk9; // lock variable - int p10 = __VERIFIER_nondet_int(); // condition variable - int lk10; // lock variable + int p10 = __VERIFIER_nondet_int(); // condition variable + int lk10; // lock variable - int p11 = __VERIFIER_nondet_int(); // condition variable - int lk11; // lock variable + int p11 = __VERIFIER_nondet_int(); // condition variable + int lk11; // lock variable + int cond; - int cond; + while (1) { + cond = __VERIFIER_nondet_int(); + if (cond == 0) { + goto out; + } else { + } + lk1 = 0; // initially lock is open - while(1) { - cond = __VERIFIER_nondet_int(); - if (cond == 0) { - goto out; - } else {} - lk1 = 0; // initially lock is open + lk2 = 0; // initially lock is open - lk2 = 0; // initially lock is open + lk3 = 0; // initially lock is open - lk3 = 0; // initially lock is open + lk4 = 0; // initially lock is open - lk4 = 0; // initially lock is open + lk5 = 0; // initially lock is open - lk5 = 0; // initially lock is open + lk6 = 0; // initially lock is open - lk6 = 0; // initially lock is open + lk7 = 0; // initially lock is open - lk7 = 0; // initially lock is open + lk8 = 0; // initially lock is open - lk8 = 0; // initially lock is open + lk9 = 0; // initially lock is open - lk9 = 0; // initially lock is open + lk10 = 0; // initially lock is open - lk10 = 0; // initially lock is open + lk11 = 0; // initially lock is open - lk11 = 0; // initially lock is open + // lock phase + if (p1 != 0) { + lk1 = 1; // acquire lock + } else { + } + if (p2 != 0) { + lk2 = 1; // acquire lock + } else { + } - // lock phase - if (p1 != 0) { - lk1 = 1; // acquire lock - } else {} + if (p3 != 0) { + lk3 = 1; // acquire lock + } else { + } - if (p2 != 0) { - lk2 = 1; // acquire lock - } else {} + if (p4 != 0) { + lk4 = 1; // acquire lock + } else { + } - if (p3 != 0) { - lk3 = 1; // acquire lock - } else {} + if (p5 != 0) { + lk5 = 1; // acquire lock + } else { + } - if (p4 != 0) { - lk4 = 1; // acquire lock - } else {} + if (p6 != 0) { + lk6 = 1; // acquire lock + } else { + } - if (p5 != 0) { - lk5 = 1; // acquire lock - } else {} + if (p7 != 0) { + lk7 = 1; // acquire lock + } else { + } - if (p6 != 0) { - lk6 = 1; // acquire lock - } else {} + if (p8 != 0) { + lk8 = 1; // acquire lock + } else { + } - if (p7 != 0) { - lk7 = 1; // acquire lock - } else {} + if (p9 != 0) { + lk9 = 1; // acquire lock + } else { + } - if (p8 != 0) { - lk8 = 1; // acquire lock - } else {} + if (p10 != 0) { + lk10 = 1; // acquire lock + } else { + } - if (p9 != 0) { - lk9 = 1; // acquire lock - } else {} + if (p11 != 0) { + lk11 = 1; // acquire lock + } else { + } - if (p10 != 0) { - lk10 = 1; // acquire lock - } else {} + // unlock phase + if (p1 != 0) { + if (lk1 != 1) + goto ERROR; // assertion failure + lk1 = 0; + } else { + } - if (p11 != 0) { - lk11 = 1; // acquire lock - } else {} + if (p2 != 0) { + if (lk2 != 1) + goto ERROR; // assertion failure + lk2 = 0; + } else { + } + if (p3 != 0) { + if (lk3 != 1) + goto ERROR; // assertion failure + lk3 = 0; + } else { + } - // unlock phase - if (p1 != 0) { - if (lk1 != 1) goto ERROR; // assertion failure - lk1 = 0; - } else {} - - if (p2 != 0) { - if (lk2 != 1) goto ERROR; // assertion failure - lk2 = 0; - } else {} - - if (p3 != 0) { - if (lk3 != 1) goto ERROR; // assertion failure - lk3 = 0; - } else {} - - if (p4 != 0) { - if (lk4 != 1) goto ERROR; // assertion failure - lk4 = 0; - } else {} - - if (p5 != 0) { - if (lk5 != 1) goto ERROR; // assertion failure - lk5 = 0; - } else {} - - if (p6 != 0) { - if (lk6 != 1) goto ERROR; // assertion failure - lk6 = 0; - } else {} - - if (p7 != 0) { - if (lk7 != 1) goto ERROR; // assertion failure - lk7 = 0; - } else {} - - if (p8 != 0) { - if (lk8 != 1) goto ERROR; // assertion failure - lk8 = 0; - } else {} - - if (p9 != 0) { - if (lk9 != 1) goto ERROR; // assertion failure - lk9 = 0; - } else {} - - if (p10 != 0) { - if (lk10 != 1) goto ERROR; // assertion failure - lk10 = 0; - } else {} - - if (p11 != 0) { - if (lk11 != 1) goto ERROR; // assertion failure - lk11 = 0; - } else {} - - } - out: - return 0; - ERROR: assert(0); - return 0; -} + if (p4 != 0) { + if (lk4 != 1) + goto ERROR; // assertion failure + lk4 = 0; + } else { + } + + if (p5 != 0) { + if (lk5 != 1) + goto ERROR; // assertion failure + lk5 = 0; + } else { + } + + if (p6 != 0) { + if (lk6 != 1) + goto ERROR; // assertion failure + lk6 = 0; + } else { + } + + if (p7 != 0) { + if (lk7 != 1) + goto ERROR; // assertion failure + lk7 = 0; + } else { + } + if (p8 != 0) { + if (lk8 != 1) + goto ERROR; // assertion failure + lk8 = 0; + } else { + } + + if (p9 != 0) { + if (lk9 != 1) + goto ERROR; // assertion failure + lk9 = 0; + } else { + } + + if (p10 != 0) { + if (lk10 != 1) + goto ERROR; // assertion failure + lk10 = 0; + } else { + } + + if (p11 != 0) { + if (lk11 != 1) + goto ERROR; // assertion failure + lk11 = 0; + } else { + } + } +out: + return 0; +ERROR: + assert(0); + return 0; +} diff --git a/test/locks/test_locks_12_true.c b/test/locks/test_locks_12_true.c index 7351f1e14..6823548a3 100644 --- a/test/locks/test_locks_12_true.c +++ b/test/locks/test_locks_12_true.c @@ -3,192 +3,224 @@ // @expect verified extern int __VERIFIER_nondet_int(); -int main() -{ - int p1 = __VERIFIER_nondet_int(); // condition variable - int lk1; // lock variable +int main() { + int p1 = __VERIFIER_nondet_int(); // condition variable + int lk1; // lock variable - int p2 = __VERIFIER_nondet_int(); // condition variable - int lk2; // lock variable + int p2 = __VERIFIER_nondet_int(); // condition variable + int lk2; // lock variable - int p3 = __VERIFIER_nondet_int(); // condition variable - int lk3; // lock variable + int p3 = __VERIFIER_nondet_int(); // condition variable + int lk3; // lock variable - int p4 = __VERIFIER_nondet_int(); // condition variable - int lk4; // lock variable + int p4 = __VERIFIER_nondet_int(); // condition variable + int lk4; // lock variable - int p5 = __VERIFIER_nondet_int(); // condition variable - int lk5; // lock variable + int p5 = __VERIFIER_nondet_int(); // condition variable + int lk5; // lock variable - int p6 = __VERIFIER_nondet_int(); // condition variable - int lk6; // lock variable + int p6 = __VERIFIER_nondet_int(); // condition variable + int lk6; // lock variable - int p7 = __VERIFIER_nondet_int(); // condition variable - int lk7; // lock variable + int p7 = __VERIFIER_nondet_int(); // condition variable + int lk7; // lock variable - int p8 = __VERIFIER_nondet_int(); // condition variable - int lk8; // lock variable + int p8 = __VERIFIER_nondet_int(); // condition variable + int lk8; // lock variable - int p9 = __VERIFIER_nondet_int(); // condition variable - int lk9; // lock variable + int p9 = __VERIFIER_nondet_int(); // condition variable + int lk9; // lock variable - int p10 = __VERIFIER_nondet_int(); // condition variable - int lk10; // lock variable + int p10 = __VERIFIER_nondet_int(); // condition variable + int lk10; // lock variable - int p11 = __VERIFIER_nondet_int(); // condition variable - int lk11; // lock variable + int p11 = __VERIFIER_nondet_int(); // condition variable + int lk11; // lock variable - int p12 = __VERIFIER_nondet_int(); // condition variable - int lk12; // lock variable + int p12 = __VERIFIER_nondet_int(); // condition variable + int lk12; // lock variable + int cond; - int cond; + while (1) { + cond = __VERIFIER_nondet_int(); + if (cond == 0) { + goto out; + } else { + } + lk1 = 0; // initially lock is open - while(1) { - cond = __VERIFIER_nondet_int(); - if (cond == 0) { - goto out; - } else {} - lk1 = 0; // initially lock is open + lk2 = 0; // initially lock is open - lk2 = 0; // initially lock is open + lk3 = 0; // initially lock is open - lk3 = 0; // initially lock is open + lk4 = 0; // initially lock is open - lk4 = 0; // initially lock is open + lk5 = 0; // initially lock is open - lk5 = 0; // initially lock is open + lk6 = 0; // initially lock is open - lk6 = 0; // initially lock is open + lk7 = 0; // initially lock is open - lk7 = 0; // initially lock is open + lk8 = 0; // initially lock is open - lk8 = 0; // initially lock is open + lk9 = 0; // initially lock is open - lk9 = 0; // initially lock is open + lk10 = 0; // initially lock is open - lk10 = 0; // initially lock is open + lk11 = 0; // initially lock is open - lk11 = 0; // initially lock is open + lk12 = 0; // initially lock is open - lk12 = 0; // initially lock is open + // lock phase + if (p1 != 0) { + lk1 = 1; // acquire lock + } else { + } + if (p2 != 0) { + lk2 = 1; // acquire lock + } else { + } - // lock phase - if (p1 != 0) { - lk1 = 1; // acquire lock - } else {} + if (p3 != 0) { + lk3 = 1; // acquire lock + } else { + } + + if (p4 != 0) { + lk4 = 1; // acquire lock + } else { + } + + if (p5 != 0) { + lk5 = 1; // acquire lock + } else { + } + + if (p6 != 0) { + lk6 = 1; // acquire lock + } else { + } + + if (p7 != 0) { + lk7 = 1; // acquire lock + } else { + } + + if (p8 != 0) { + lk8 = 1; // acquire lock + } else { + } + + if (p9 != 0) { + lk9 = 1; // acquire lock + } else { + } + + if (p10 != 0) { + lk10 = 1; // acquire lock + } else { + } - if (p2 != 0) { - lk2 = 1; // acquire lock - } else {} + if (p11 != 0) { + lk11 = 1; // acquire lock + } else { + } - if (p3 != 0) { - lk3 = 1; // acquire lock - } else {} + if (p12 != 0) { + lk12 = 1; // acquire lock + } else { + } - if (p4 != 0) { - lk4 = 1; // acquire lock - } else {} + // unlock phase + if (p1 != 0) { + if (lk1 != 1) + goto ERROR; // assertion failure + lk1 = 0; + } else { + } - if (p5 != 0) { - lk5 = 1; // acquire lock - } else {} + if (p2 != 0) { + if (lk2 != 1) + goto ERROR; // assertion failure + lk2 = 0; + } else { + } - if (p6 != 0) { - lk6 = 1; // acquire lock - } else {} + if (p3 != 0) { + if (lk3 != 1) + goto ERROR; // assertion failure + lk3 = 0; + } else { + } - if (p7 != 0) { - lk7 = 1; // acquire lock - } else {} + if (p4 != 0) { + if (lk4 != 1) + goto ERROR; // assertion failure + lk4 = 0; + } else { + } - if (p8 != 0) { - lk8 = 1; // acquire lock - } else {} + if (p5 != 0) { + if (lk5 != 1) + goto ERROR; // assertion failure + lk5 = 0; + } else { + } - if (p9 != 0) { - lk9 = 1; // acquire lock - } else {} + if (p6 != 0) { + if (lk6 != 1) + goto ERROR; // assertion failure + lk6 = 0; + } else { + } - if (p10 != 0) { - lk10 = 1; // acquire lock - } else {} + if (p7 != 0) { + if (lk7 != 1) + goto ERROR; // assertion failure + lk7 = 0; + } else { + } - if (p11 != 0) { - lk11 = 1; // acquire lock - } else {} + if (p8 != 0) { + if (lk8 != 1) + goto ERROR; // assertion failure + lk8 = 0; + } else { + } - if (p12 != 0) { - lk12 = 1; // acquire lock - } else {} + if (p9 != 0) { + if (lk9 != 1) + goto ERROR; // assertion failure + lk9 = 0; + } else { + } + if (p10 != 0) { + if (lk10 != 1) + goto ERROR; // assertion failure + lk10 = 0; + } else { + } - // unlock phase - if (p1 != 0) { - if (lk1 != 1) goto ERROR; // assertion failure - lk1 = 0; - } else {} - - if (p2 != 0) { - if (lk2 != 1) goto ERROR; // assertion failure - lk2 = 0; - } else {} - - if (p3 != 0) { - if (lk3 != 1) goto ERROR; // assertion failure - lk3 = 0; - } else {} - - if (p4 != 0) { - if (lk4 != 1) goto ERROR; // assertion failure - lk4 = 0; - } else {} - - if (p5 != 0) { - if (lk5 != 1) goto ERROR; // assertion failure - lk5 = 0; - } else {} - - if (p6 != 0) { - if (lk6 != 1) goto ERROR; // assertion failure - lk6 = 0; - } else {} - - if (p7 != 0) { - if (lk7 != 1) goto ERROR; // assertion failure - lk7 = 0; - } else {} - - if (p8 != 0) { - if (lk8 != 1) goto ERROR; // assertion failure - lk8 = 0; - } else {} - - if (p9 != 0) { - if (lk9 != 1) goto ERROR; // assertion failure - lk9 = 0; - } else {} - - if (p10 != 0) { - if (lk10 != 1) goto ERROR; // assertion failure - lk10 = 0; - } else {} - - if (p11 != 0) { - if (lk11 != 1) goto ERROR; // assertion failure - lk11 = 0; - } else {} - - if (p12 != 0) { - if (lk12 != 1) goto ERROR; // assertion failure - lk12 = 0; - } else {} - - } - out: - return 0; - ERROR: assert(0); - return 0; -} + if (p11 != 0) { + if (lk11 != 1) + goto ERROR; // assertion failure + lk11 = 0; + } else { + } + if (p12 != 0) { + if (lk12 != 1) + goto ERROR; // assertion failure + lk12 = 0; + } else { + } + } +out: + return 0; +ERROR: + assert(0); + return 0; +} diff --git a/test/locks/test_locks_13_true.c b/test/locks/test_locks_13_true.c index 0d4aa060b..641905e20 100644 --- a/test/locks/test_locks_13_true.c +++ b/test/locks/test_locks_13_true.c @@ -3,206 +3,241 @@ // @expect verified extern int __VERIFIER_nondet_int(); -int main() -{ - int p1 = __VERIFIER_nondet_int(); // condition variable - int lk1; // lock variable +int main() { + int p1 = __VERIFIER_nondet_int(); // condition variable + int lk1; // lock variable - int p2 = __VERIFIER_nondet_int(); // condition variable - int lk2; // lock variable + int p2 = __VERIFIER_nondet_int(); // condition variable + int lk2; // lock variable - int p3 = __VERIFIER_nondet_int(); // condition variable - int lk3; // lock variable + int p3 = __VERIFIER_nondet_int(); // condition variable + int lk3; // lock variable - int p4 = __VERIFIER_nondet_int(); // condition variable - int lk4; // lock variable + int p4 = __VERIFIER_nondet_int(); // condition variable + int lk4; // lock variable - int p5 = __VERIFIER_nondet_int(); // condition variable - int lk5; // lock variable + int p5 = __VERIFIER_nondet_int(); // condition variable + int lk5; // lock variable - int p6 = __VERIFIER_nondet_int(); // condition variable - int lk6; // lock variable + int p6 = __VERIFIER_nondet_int(); // condition variable + int lk6; // lock variable - int p7 = __VERIFIER_nondet_int(); // condition variable - int lk7; // lock variable + int p7 = __VERIFIER_nondet_int(); // condition variable + int lk7; // lock variable - int p8 = __VERIFIER_nondet_int(); // condition variable - int lk8; // lock variable + int p8 = __VERIFIER_nondet_int(); // condition variable + int lk8; // lock variable - int p9 = __VERIFIER_nondet_int(); // condition variable - int lk9; // lock variable + int p9 = __VERIFIER_nondet_int(); // condition variable + int lk9; // lock variable - int p10 = __VERIFIER_nondet_int(); // condition variable - int lk10; // lock variable + int p10 = __VERIFIER_nondet_int(); // condition variable + int lk10; // lock variable - int p11 = __VERIFIER_nondet_int(); // condition variable - int lk11; // lock variable + int p11 = __VERIFIER_nondet_int(); // condition variable + int lk11; // lock variable - int p12 = __VERIFIER_nondet_int(); // condition variable - int lk12; // lock variable + int p12 = __VERIFIER_nondet_int(); // condition variable + int lk12; // lock variable - int p13 = __VERIFIER_nondet_int(); // condition variable - int lk13; // lock variable + int p13 = __VERIFIER_nondet_int(); // condition variable + int lk13; // lock variable + int cond; - int cond; + while (1) { + cond = __VERIFIER_nondet_int(); + if (cond == 0) { + goto out; + } else { + } + lk1 = 0; // initially lock is open - while(1) { - cond = __VERIFIER_nondet_int(); - if (cond == 0) { - goto out; - } else {} - lk1 = 0; // initially lock is open + lk2 = 0; // initially lock is open - lk2 = 0; // initially lock is open + lk3 = 0; // initially lock is open - lk3 = 0; // initially lock is open + lk4 = 0; // initially lock is open - lk4 = 0; // initially lock is open + lk5 = 0; // initially lock is open - lk5 = 0; // initially lock is open + lk6 = 0; // initially lock is open - lk6 = 0; // initially lock is open + lk7 = 0; // initially lock is open - lk7 = 0; // initially lock is open + lk8 = 0; // initially lock is open - lk8 = 0; // initially lock is open + lk9 = 0; // initially lock is open - lk9 = 0; // initially lock is open + lk10 = 0; // initially lock is open - lk10 = 0; // initially lock is open + lk11 = 0; // initially lock is open - lk11 = 0; // initially lock is open + lk12 = 0; // initially lock is open - lk12 = 0; // initially lock is open + lk13 = 0; // initially lock is open - lk13 = 0; // initially lock is open + // lock phase + if (p1 != 0) { + lk1 = 1; // acquire lock + } else { + } + if (p2 != 0) { + lk2 = 1; // acquire lock + } else { + } - // lock phase - if (p1 != 0) { - lk1 = 1; // acquire lock - } else {} + if (p3 != 0) { + lk3 = 1; // acquire lock + } else { + } - if (p2 != 0) { - lk2 = 1; // acquire lock - } else {} + if (p4 != 0) { + lk4 = 1; // acquire lock + } else { + } - if (p3 != 0) { - lk3 = 1; // acquire lock - } else {} + if (p5 != 0) { + lk5 = 1; // acquire lock + } else { + } - if (p4 != 0) { - lk4 = 1; // acquire lock - } else {} + if (p6 != 0) { + lk6 = 1; // acquire lock + } else { + } - if (p5 != 0) { - lk5 = 1; // acquire lock - } else {} + if (p7 != 0) { + lk7 = 1; // acquire lock + } else { + } - if (p6 != 0) { - lk6 = 1; // acquire lock - } else {} + if (p8 != 0) { + lk8 = 1; // acquire lock + } else { + } - if (p7 != 0) { - lk7 = 1; // acquire lock - } else {} + if (p9 != 0) { + lk9 = 1; // acquire lock + } else { + } - if (p8 != 0) { - lk8 = 1; // acquire lock - } else {} + if (p10 != 0) { + lk10 = 1; // acquire lock + } else { + } - if (p9 != 0) { - lk9 = 1; // acquire lock - } else {} + if (p11 != 0) { + lk11 = 1; // acquire lock + } else { + } - if (p10 != 0) { - lk10 = 1; // acquire lock - } else {} + if (p12 != 0) { + lk12 = 1; // acquire lock + } else { + } - if (p11 != 0) { - lk11 = 1; // acquire lock - } else {} + if (p13 != 0) { + lk13 = 1; // acquire lock + } else { + } - if (p12 != 0) { - lk12 = 1; // acquire lock - } else {} + // unlock phase + if (p1 != 0) { + if (lk1 != 1) + goto ERROR; // assertion failure + lk1 = 0; + } else { + } - if (p13 != 0) { - lk13 = 1; // acquire lock - } else {} + if (p2 != 0) { + if (lk2 != 1) + goto ERROR; // assertion failure + lk2 = 0; + } else { + } + if (p3 != 0) { + if (lk3 != 1) + goto ERROR; // assertion failure + lk3 = 0; + } else { + } - // unlock phase - if (p1 != 0) { - if (lk1 != 1) goto ERROR; // assertion failure - lk1 = 0; - } else {} - - if (p2 != 0) { - if (lk2 != 1) goto ERROR; // assertion failure - lk2 = 0; - } else {} - - if (p3 != 0) { - if (lk3 != 1) goto ERROR; // assertion failure - lk3 = 0; - } else {} - - if (p4 != 0) { - if (lk4 != 1) goto ERROR; // assertion failure - lk4 = 0; - } else {} - - if (p5 != 0) { - if (lk5 != 1) goto ERROR; // assertion failure - lk5 = 0; - } else {} - - if (p6 != 0) { - if (lk6 != 1) goto ERROR; // assertion failure - lk6 = 0; - } else {} - - if (p7 != 0) { - if (lk7 != 1) goto ERROR; // assertion failure - lk7 = 0; - } else {} - - if (p8 != 0) { - if (lk8 != 1) goto ERROR; // assertion failure - lk8 = 0; - } else {} - - if (p9 != 0) { - if (lk9 != 1) goto ERROR; // assertion failure - lk9 = 0; - } else {} - - if (p10 != 0) { - if (lk10 != 1) goto ERROR; // assertion failure - lk10 = 0; - } else {} - - if (p11 != 0) { - if (lk11 != 1) goto ERROR; // assertion failure - lk11 = 0; - } else {} - - if (p12 != 0) { - if (lk12 != 1) goto ERROR; // assertion failure - lk12 = 0; - } else {} - - if (p13 != 0) { - if (lk13 != 1) goto ERROR; // assertion failure - lk13 = 0; - } else {} - - } - out: - return 0; - ERROR: assert(0); - return 0; -} + if (p4 != 0) { + if (lk4 != 1) + goto ERROR; // assertion failure + lk4 = 0; + } else { + } + + if (p5 != 0) { + if (lk5 != 1) + goto ERROR; // assertion failure + lk5 = 0; + } else { + } + + if (p6 != 0) { + if (lk6 != 1) + goto ERROR; // assertion failure + lk6 = 0; + } else { + } + + if (p7 != 0) { + if (lk7 != 1) + goto ERROR; // assertion failure + lk7 = 0; + } else { + } + + if (p8 != 0) { + if (lk8 != 1) + goto ERROR; // assertion failure + lk8 = 0; + } else { + } + if (p9 != 0) { + if (lk9 != 1) + goto ERROR; // assertion failure + lk9 = 0; + } else { + } + + if (p10 != 0) { + if (lk10 != 1) + goto ERROR; // assertion failure + lk10 = 0; + } else { + } + + if (p11 != 0) { + if (lk11 != 1) + goto ERROR; // assertion failure + lk11 = 0; + } else { + } + + if (p12 != 0) { + if (lk12 != 1) + goto ERROR; // assertion failure + lk12 = 0; + } else { + } + + if (p13 != 0) { + if (lk13 != 1) + goto ERROR; // assertion failure + lk13 = 0; + } else { + } + } +out: + return 0; +ERROR: + assert(0); + return 0; +} diff --git a/test/locks/test_locks_14_false.c b/test/locks/test_locks_14_false.c index cc4e47df7..1d4963d9d 100644 --- a/test/locks/test_locks_14_false.c +++ b/test/locks/test_locks_14_false.c @@ -3,220 +3,260 @@ // @expect error extern int __VERIFIER_nondet_int(); -int main() -{ - int p1 = __VERIFIER_nondet_int(); // condition variable - int lk1; // lock variable +int main() { + int p1 = __VERIFIER_nondet_int(); // condition variable + int lk1; // lock variable - int p2 = __VERIFIER_nondet_int(); // condition variable - int lk2; // lock variable + int p2 = __VERIFIER_nondet_int(); // condition variable + int lk2; // lock variable - int p3 = __VERIFIER_nondet_int(); // condition variable - int lk3; // lock variable + int p3 = __VERIFIER_nondet_int(); // condition variable + int lk3; // lock variable - int p4 = __VERIFIER_nondet_int(); // condition variable - int lk4; // lock variable + int p4 = __VERIFIER_nondet_int(); // condition variable + int lk4; // lock variable - int p5 = __VERIFIER_nondet_int(); // condition variable - int lk5; // lock variable + int p5 = __VERIFIER_nondet_int(); // condition variable + int lk5; // lock variable - int p6 = __VERIFIER_nondet_int(); // condition variable - int lk6; // lock variable + int p6 = __VERIFIER_nondet_int(); // condition variable + int lk6; // lock variable - int p7 = __VERIFIER_nondet_int(); // condition variable - int lk7; // lock variable + int p7 = __VERIFIER_nondet_int(); // condition variable + int lk7; // lock variable - int p8 = __VERIFIER_nondet_int(); // condition variable - int lk8; // lock variable + int p8 = __VERIFIER_nondet_int(); // condition variable + int lk8; // lock variable - int p9 = __VERIFIER_nondet_int(); // condition variable - int lk9; // lock variable + int p9 = __VERIFIER_nondet_int(); // condition variable + int lk9; // lock variable - int p10 = __VERIFIER_nondet_int(); // condition variable - int lk10; // lock variable + int p10 = __VERIFIER_nondet_int(); // condition variable + int lk10; // lock variable - int p11 = __VERIFIER_nondet_int(); // condition variable - int lk11; // lock variable + int p11 = __VERIFIER_nondet_int(); // condition variable + int lk11; // lock variable - int p12 = __VERIFIER_nondet_int(); // condition variable - int lk12; // lock variable + int p12 = __VERIFIER_nondet_int(); // condition variable + int lk12; // lock variable - int p13 = __VERIFIER_nondet_int(); // condition variable - int lk13; // lock variable + int p13 = __VERIFIER_nondet_int(); // condition variable + int lk13; // lock variable - int p14 = __VERIFIER_nondet_int(); // condition variable - int lk14; // lock variable + int p14 = __VERIFIER_nondet_int(); // condition variable + int lk14; // lock variable + int cond; - int cond; + while (1) { + cond = __VERIFIER_nondet_int(); + if (cond == 0) { + goto out; + } else { + } + lk1 = 0; // initially lock is open - while(1) { - cond = __VERIFIER_nondet_int(); - if (cond == 0) { - goto out; - } else {} - lk1 = 0; // initially lock is open + lk2 = 0; // initially lock is open - lk2 = 0; // initially lock is open + lk3 = 0; // initially lock is open - lk3 = 0; // initially lock is open + lk4 = 0; // initially lock is open - lk4 = 0; // initially lock is open + lk5 = 0; // initially lock is open - lk5 = 0; // initially lock is open + lk6 = 0; // initially lock is open - lk6 = 0; // initially lock is open + lk7 = 0; // initially lock is open - lk7 = 0; // initially lock is open + lk8 = 0; // initially lock is open - lk8 = 0; // initially lock is open + lk9 = 0; // initially lock is open - lk9 = 0; // initially lock is open + lk10 = 0; // initially lock is open - lk10 = 0; // initially lock is open + lk11 = 0; // initially lock is open - lk11 = 0; // initially lock is open + lk12 = 0; // initially lock is open - lk12 = 0; // initially lock is open + lk13 = 0; // initially lock is open - lk13 = 0; // initially lock is open + lk14 = 0; // initially lock is open - lk14 = 0; // initially lock is open + // lock phase + if (p1 != 0) { + lk1 = 1; // acquire lock + } else { + } + if (p2 != 0) { + lk2 = 1; // acquire lock + } else { + } - // lock phase - if (p1 != 0) { - lk1 = 1; // acquire lock - } else {} + if (p3 != 0) { + lk3 = 1; // acquire lock + } else { + } - if (p2 != 0) { - lk2 = 1; // acquire lock - } else {} + if (p4 != 0) { + lk4 = 1; // acquire lock + } else { + } - if (p3 != 0) { - lk3 = 1; // acquire lock - } else {} + if (p5 != 0) { + lk5 = 1; // acquire lock + } else { + } - if (p4 != 0) { - lk4 = 1; // acquire lock - } else {} + if (p6 != 0) { + lk6 = 1; // acquire lock + } else { + } - if (p5 != 0) { - lk5 = 1; // acquire lock - } else {} + if (p7 != 0) { + lk7 = 1; // acquire lock + } else { + } - if (p6 != 0) { - lk6 = 1; // acquire lock - } else {} + if (p8 != 0) { + lk8 = 1; // acquire lock + } else { + } - if (p7 != 0) { - lk7 = 1; // acquire lock - } else {} + if (p9 != 0) { + lk9 = 1; // acquire lock + } else { + } - if (p8 != 0) { - lk8 = 1; // acquire lock - } else {} + if (p10 != 0) { + lk10 = 1; // acquire lock + } else { + } - if (p9 != 0) { - lk9 = 1; // acquire lock - } else {} + if (p11 != 0) { + lk11 = 1; // acquire lock + } else { + } - if (p10 != 0) { - lk10 = 1; // acquire lock - } else {} + if (p12 != 0) { + lk12 = 1; // acquire lock + } else { + } - if (p11 != 0) { - lk11 = 1; // acquire lock - } else {} + if (p13 != 0) { + lk13 = 1; // acquire lock + } else { + } - if (p12 != 0) { - lk12 = 1; // acquire lock - } else {} + if (p14 != 0) { + lk14 = 1; // acquire lock + } else { + } - if (p13 != 0) { - lk13 = 1; // acquire lock - } else {} + // unlock phase + if (p1 != 0) { + if (lk1 != 1) + goto ERROR; // assertion failure + lk1 = 0; + } else { + } - if (p14 != 0) { - lk14 = 1; // acquire lock - } else {} + if (p2 != 0) { + if (lk2 != 1) + goto ERROR; // assertion failure + lk2 = 0; + } else { + goto ERROR; + } + if (p3 != 0) { + if (lk3 != 1) + goto ERROR; // assertion failure + lk3 = 0; + } else { + } - // unlock phase - if (p1 != 0) { - if (lk1 != 1) goto ERROR; // assertion failure - lk1 = 0; - } else {} - - if (p2 != 0) { - if (lk2 != 1) goto ERROR; // assertion failure - lk2 = 0; - } else {goto ERROR;} - - if (p3 != 0) { - if (lk3 != 1) goto ERROR; // assertion failure - lk3 = 0; - } else {} - - if (p4 != 0) { - if (lk4 != 1) goto ERROR; // assertion failure - lk4 = 0; - } else {} - - if (p5 != 0) { - if (lk5 != 1) goto ERROR; // assertion failure - lk5 = 0; - } else {} - - if (p6 != 0) { - if (lk6 != 1) goto ERROR; // assertion failure - lk6 = 0; - } else {} - - if (p7 != 0) { - if (lk7 != 1) goto ERROR; // assertion failure - lk7 = 0; - } else {} - - if (p8 != 0) { - if (lk8 != 1) goto ERROR; // assertion failure - lk8 = 0; - } else {} - - if (p9 != 0) { - if (lk9 != 1) goto ERROR; // assertion failure - lk9 = 0; - } else {} - - if (p10 != 0) { - if (lk10 != 1) goto ERROR; // assertion failure - lk10 = 0; - } else {} - - if (p11 != 0) { - if (lk11 != 1) goto ERROR; // assertion failure - lk11 = 0; - } else {} - - if (p12 != 0) { - if (lk12 != 1) goto ERROR; // assertion failure - lk12 = 0; - } else {} - - if (p13 != 0) { - if (lk13 != 1) goto ERROR; // assertion failure - lk13 = 0; - } else {} - - if (p14 != 0) { - if (lk14 != 1) goto ERROR; // assertion failure - lk14 = 0; - } else {goto ERROR;} - - } - out: - return 0; - ERROR: assert(0); - return 0; -} + if (p4 != 0) { + if (lk4 != 1) + goto ERROR; // assertion failure + lk4 = 0; + } else { + } + + if (p5 != 0) { + if (lk5 != 1) + goto ERROR; // assertion failure + lk5 = 0; + } else { + } + + if (p6 != 0) { + if (lk6 != 1) + goto ERROR; // assertion failure + lk6 = 0; + } else { + } + + if (p7 != 0) { + if (lk7 != 1) + goto ERROR; // assertion failure + lk7 = 0; + } else { + } + + if (p8 != 0) { + if (lk8 != 1) + goto ERROR; // assertion failure + lk8 = 0; + } else { + } + + if (p9 != 0) { + if (lk9 != 1) + goto ERROR; // assertion failure + lk9 = 0; + } else { + } + + if (p10 != 0) { + if (lk10 != 1) + goto ERROR; // assertion failure + lk10 = 0; + } else { + } + if (p11 != 0) { + if (lk11 != 1) + goto ERROR; // assertion failure + lk11 = 0; + } else { + } + + if (p12 != 0) { + if (lk12 != 1) + goto ERROR; // assertion failure + lk12 = 0; + } else { + } + + if (p13 != 0) { + if (lk13 != 1) + goto ERROR; // assertion failure + lk13 = 0; + } else { + } + + if (p14 != 0) { + if (lk14 != 1) + goto ERROR; // assertion failure + lk14 = 0; + } else { + goto ERROR; + } + } +out: + return 0; +ERROR: + assert(0); + return 0; +} diff --git a/test/locks/test_locks_14_true.c b/test/locks/test_locks_14_true.c index 0445b5ac1..a4d600377 100644 --- a/test/locks/test_locks_14_true.c +++ b/test/locks/test_locks_14_true.c @@ -3,220 +3,258 @@ // @expect verified extern int __VERIFIER_nondet_int(); -int main() -{ - int p1 = __VERIFIER_nondet_int(); // condition variable - int lk1; // lock variable +int main() { + int p1 = __VERIFIER_nondet_int(); // condition variable + int lk1; // lock variable - int p2 = __VERIFIER_nondet_int(); // condition variable - int lk2; // lock variable + int p2 = __VERIFIER_nondet_int(); // condition variable + int lk2; // lock variable - int p3 = __VERIFIER_nondet_int(); // condition variable - int lk3; // lock variable + int p3 = __VERIFIER_nondet_int(); // condition variable + int lk3; // lock variable - int p4 = __VERIFIER_nondet_int(); // condition variable - int lk4; // lock variable + int p4 = __VERIFIER_nondet_int(); // condition variable + int lk4; // lock variable - int p5 = __VERIFIER_nondet_int(); // condition variable - int lk5; // lock variable + int p5 = __VERIFIER_nondet_int(); // condition variable + int lk5; // lock variable - int p6 = __VERIFIER_nondet_int(); // condition variable - int lk6; // lock variable + int p6 = __VERIFIER_nondet_int(); // condition variable + int lk6; // lock variable - int p7 = __VERIFIER_nondet_int(); // condition variable - int lk7; // lock variable + int p7 = __VERIFIER_nondet_int(); // condition variable + int lk7; // lock variable - int p8 = __VERIFIER_nondet_int(); // condition variable - int lk8; // lock variable + int p8 = __VERIFIER_nondet_int(); // condition variable + int lk8; // lock variable - int p9 = __VERIFIER_nondet_int(); // condition variable - int lk9; // lock variable + int p9 = __VERIFIER_nondet_int(); // condition variable + int lk9; // lock variable - int p10 = __VERIFIER_nondet_int(); // condition variable - int lk10; // lock variable + int p10 = __VERIFIER_nondet_int(); // condition variable + int lk10; // lock variable - int p11 = __VERIFIER_nondet_int(); // condition variable - int lk11; // lock variable + int p11 = __VERIFIER_nondet_int(); // condition variable + int lk11; // lock variable - int p12 = __VERIFIER_nondet_int(); // condition variable - int lk12; // lock variable + int p12 = __VERIFIER_nondet_int(); // condition variable + int lk12; // lock variable - int p13 = __VERIFIER_nondet_int(); // condition variable - int lk13; // lock variable + int p13 = __VERIFIER_nondet_int(); // condition variable + int lk13; // lock variable - int p14 = __VERIFIER_nondet_int(); // condition variable - int lk14; // lock variable + int p14 = __VERIFIER_nondet_int(); // condition variable + int lk14; // lock variable + int cond; - int cond; + while (1) { + cond = __VERIFIER_nondet_int(); + if (cond == 0) { + goto out; + } else { + } + lk1 = 0; // initially lock is open - while(1) { - cond = __VERIFIER_nondet_int(); - if (cond == 0) { - goto out; - } else {} - lk1 = 0; // initially lock is open + lk2 = 0; // initially lock is open - lk2 = 0; // initially lock is open + lk3 = 0; // initially lock is open - lk3 = 0; // initially lock is open + lk4 = 0; // initially lock is open - lk4 = 0; // initially lock is open + lk5 = 0; // initially lock is open - lk5 = 0; // initially lock is open + lk6 = 0; // initially lock is open - lk6 = 0; // initially lock is open + lk7 = 0; // initially lock is open - lk7 = 0; // initially lock is open + lk8 = 0; // initially lock is open - lk8 = 0; // initially lock is open + lk9 = 0; // initially lock is open - lk9 = 0; // initially lock is open + lk10 = 0; // initially lock is open - lk10 = 0; // initially lock is open + lk11 = 0; // initially lock is open - lk11 = 0; // initially lock is open + lk12 = 0; // initially lock is open - lk12 = 0; // initially lock is open + lk13 = 0; // initially lock is open - lk13 = 0; // initially lock is open + lk14 = 0; // initially lock is open - lk14 = 0; // initially lock is open + // lock phase + if (p1 != 0) { + lk1 = 1; // acquire lock + } else { + } + if (p2 != 0) { + lk2 = 1; // acquire lock + } else { + } - // lock phase - if (p1 != 0) { - lk1 = 1; // acquire lock - } else {} + if (p3 != 0) { + lk3 = 1; // acquire lock + } else { + } - if (p2 != 0) { - lk2 = 1; // acquire lock - } else {} + if (p4 != 0) { + lk4 = 1; // acquire lock + } else { + } - if (p3 != 0) { - lk3 = 1; // acquire lock - } else {} + if (p5 != 0) { + lk5 = 1; // acquire lock + } else { + } - if (p4 != 0) { - lk4 = 1; // acquire lock - } else {} + if (p6 != 0) { + lk6 = 1; // acquire lock + } else { + } - if (p5 != 0) { - lk5 = 1; // acquire lock - } else {} + if (p7 != 0) { + lk7 = 1; // acquire lock + } else { + } - if (p6 != 0) { - lk6 = 1; // acquire lock - } else {} + if (p8 != 0) { + lk8 = 1; // acquire lock + } else { + } - if (p7 != 0) { - lk7 = 1; // acquire lock - } else {} + if (p9 != 0) { + lk9 = 1; // acquire lock + } else { + } - if (p8 != 0) { - lk8 = 1; // acquire lock - } else {} + if (p10 != 0) { + lk10 = 1; // acquire lock + } else { + } - if (p9 != 0) { - lk9 = 1; // acquire lock - } else {} + if (p11 != 0) { + lk11 = 1; // acquire lock + } else { + } - if (p10 != 0) { - lk10 = 1; // acquire lock - } else {} + if (p12 != 0) { + lk12 = 1; // acquire lock + } else { + } - if (p11 != 0) { - lk11 = 1; // acquire lock - } else {} + if (p13 != 0) { + lk13 = 1; // acquire lock + } else { + } - if (p12 != 0) { - lk12 = 1; // acquire lock - } else {} + if (p14 != 0) { + lk14 = 1; // acquire lock + } else { + } - if (p13 != 0) { - lk13 = 1; // acquire lock - } else {} + // unlock phase + if (p1 != 0) { + if (lk1 != 1) + goto ERROR; // assertion failure + lk1 = 0; + } else { + } - if (p14 != 0) { - lk14 = 1; // acquire lock - } else {} + if (p2 != 0) { + if (lk2 != 1) + goto ERROR; // assertion failure + lk2 = 0; + } else { + } + if (p3 != 0) { + if (lk3 != 1) + goto ERROR; // assertion failure + lk3 = 0; + } else { + } - // unlock phase - if (p1 != 0) { - if (lk1 != 1) goto ERROR; // assertion failure - lk1 = 0; - } else {} - - if (p2 != 0) { - if (lk2 != 1) goto ERROR; // assertion failure - lk2 = 0; - } else {} - - if (p3 != 0) { - if (lk3 != 1) goto ERROR; // assertion failure - lk3 = 0; - } else {} - - if (p4 != 0) { - if (lk4 != 1) goto ERROR; // assertion failure - lk4 = 0; - } else {} - - if (p5 != 0) { - if (lk5 != 1) goto ERROR; // assertion failure - lk5 = 0; - } else {} - - if (p6 != 0) { - if (lk6 != 1) goto ERROR; // assertion failure - lk6 = 0; - } else {} - - if (p7 != 0) { - if (lk7 != 1) goto ERROR; // assertion failure - lk7 = 0; - } else {} - - if (p8 != 0) { - if (lk8 != 1) goto ERROR; // assertion failure - lk8 = 0; - } else {} - - if (p9 != 0) { - if (lk9 != 1) goto ERROR; // assertion failure - lk9 = 0; - } else {} - - if (p10 != 0) { - if (lk10 != 1) goto ERROR; // assertion failure - lk10 = 0; - } else {} - - if (p11 != 0) { - if (lk11 != 1) goto ERROR; // assertion failure - lk11 = 0; - } else {} - - if (p12 != 0) { - if (lk12 != 1) goto ERROR; // assertion failure - lk12 = 0; - } else {} - - if (p13 != 0) { - if (lk13 != 1) goto ERROR; // assertion failure - lk13 = 0; - } else {} - - if (p14 != 0) { - if (lk14 != 1) goto ERROR; // assertion failure - lk14 = 0; - } else {} - - } - out: - return 0; - ERROR: assert(0); - return 0; -} + if (p4 != 0) { + if (lk4 != 1) + goto ERROR; // assertion failure + lk4 = 0; + } else { + } + + if (p5 != 0) { + if (lk5 != 1) + goto ERROR; // assertion failure + lk5 = 0; + } else { + } + + if (p6 != 0) { + if (lk6 != 1) + goto ERROR; // assertion failure + lk6 = 0; + } else { + } + + if (p7 != 0) { + if (lk7 != 1) + goto ERROR; // assertion failure + lk7 = 0; + } else { + } + + if (p8 != 0) { + if (lk8 != 1) + goto ERROR; // assertion failure + lk8 = 0; + } else { + } + + if (p9 != 0) { + if (lk9 != 1) + goto ERROR; // assertion failure + lk9 = 0; + } else { + } + + if (p10 != 0) { + if (lk10 != 1) + goto ERROR; // assertion failure + lk10 = 0; + } else { + } + if (p11 != 0) { + if (lk11 != 1) + goto ERROR; // assertion failure + lk11 = 0; + } else { + } + + if (p12 != 0) { + if (lk12 != 1) + goto ERROR; // assertion failure + lk12 = 0; + } else { + } + + if (p13 != 0) { + if (lk13 != 1) + goto ERROR; // assertion failure + lk13 = 0; + } else { + } + + if (p14 != 0) { + if (lk14 != 1) + goto ERROR; // assertion failure + lk14 = 0; + } else { + } + } +out: + return 0; +ERROR: + assert(0); + return 0; +} diff --git a/test/locks/test_locks_15_false.c b/test/locks/test_locks_15_false.c index bc2ec0895..ea5ff730e 100644 --- a/test/locks/test_locks_15_false.c +++ b/test/locks/test_locks_15_false.c @@ -3,234 +3,277 @@ // @expect error extern int __VERIFIER_nondet_int(); -int main() -{ - int p1 = __VERIFIER_nondet_int(); // condition variable - int lk1; // lock variable +int main() { + int p1 = __VERIFIER_nondet_int(); // condition variable + int lk1; // lock variable - int p2 = __VERIFIER_nondet_int(); // condition variable - int lk2; // lock variable + int p2 = __VERIFIER_nondet_int(); // condition variable + int lk2; // lock variable - int p3 = __VERIFIER_nondet_int(); // condition variable - int lk3; // lock variable + int p3 = __VERIFIER_nondet_int(); // condition variable + int lk3; // lock variable - int p4 = __VERIFIER_nondet_int(); // condition variable - int lk4; // lock variable + int p4 = __VERIFIER_nondet_int(); // condition variable + int lk4; // lock variable - int p5 = __VERIFIER_nondet_int(); // condition variable - int lk5; // lock variable + int p5 = __VERIFIER_nondet_int(); // condition variable + int lk5; // lock variable - int p6 = __VERIFIER_nondet_int(); // condition variable - int lk6; // lock variable + int p6 = __VERIFIER_nondet_int(); // condition variable + int lk6; // lock variable - int p7 = __VERIFIER_nondet_int(); // condition variable - int lk7; // lock variable + int p7 = __VERIFIER_nondet_int(); // condition variable + int lk7; // lock variable - int p8 = __VERIFIER_nondet_int(); // condition variable - int lk8; // lock variable + int p8 = __VERIFIER_nondet_int(); // condition variable + int lk8; // lock variable - int p9 = __VERIFIER_nondet_int(); // condition variable - int lk9; // lock variable + int p9 = __VERIFIER_nondet_int(); // condition variable + int lk9; // lock variable - int p10 = __VERIFIER_nondet_int(); // condition variable - int lk10; // lock variable + int p10 = __VERIFIER_nondet_int(); // condition variable + int lk10; // lock variable - int p11 = __VERIFIER_nondet_int(); // condition variable - int lk11; // lock variable + int p11 = __VERIFIER_nondet_int(); // condition variable + int lk11; // lock variable - int p12 = __VERIFIER_nondet_int(); // condition variable - int lk12; // lock variable + int p12 = __VERIFIER_nondet_int(); // condition variable + int lk12; // lock variable - int p13 = __VERIFIER_nondet_int(); // condition variable - int lk13; // lock variable + int p13 = __VERIFIER_nondet_int(); // condition variable + int lk13; // lock variable - int p14 = __VERIFIER_nondet_int(); // condition variable - int lk14; // lock variable + int p14 = __VERIFIER_nondet_int(); // condition variable + int lk14; // lock variable - int p15 = __VERIFIER_nondet_int(); // condition variable - int lk15; // lock variable + int p15 = __VERIFIER_nondet_int(); // condition variable + int lk15; // lock variable + int cond; - int cond; + while (1) { + cond = __VERIFIER_nondet_int(); + if (cond == 0) { + goto out; + } else { + } + lk1 = 0; // initially lock is open - while(1) { - cond = __VERIFIER_nondet_int(); - if (cond == 0) { - goto out; - } else {} - lk1 = 0; // initially lock is open + lk2 = 0; // initially lock is open - lk2 = 0; // initially lock is open + lk3 = 0; // initially lock is open - lk3 = 0; // initially lock is open + lk4 = 0; // initially lock is open - lk4 = 0; // initially lock is open + lk5 = 0; // initially lock is open - lk5 = 0; // initially lock is open + lk6 = 0; // initially lock is open - lk6 = 0; // initially lock is open + lk7 = 0; // initially lock is open - lk7 = 0; // initially lock is open + lk8 = 0; // initially lock is open - lk8 = 0; // initially lock is open + lk9 = 0; // initially lock is open - lk9 = 0; // initially lock is open + lk10 = 0; // initially lock is open - lk10 = 0; // initially lock is open + lk11 = 0; // initially lock is open - lk11 = 0; // initially lock is open + lk12 = 0; // initially lock is open - lk12 = 0; // initially lock is open + lk13 = 0; // initially lock is open - lk13 = 0; // initially lock is open + lk14 = 0; // initially lock is open - lk14 = 0; // initially lock is open + lk15 = 0; // initially lock is open - lk15 = 0; // initially lock is open + // lock phase + if (p1 != 0) { + lk1 = 1; // acquire lock + } else { + } + if (p2 != 0) { + lk2 = 1; // acquire lock + } else { + } - // lock phase - if (p1 != 0) { - lk1 = 1; // acquire lock - } else {} + if (p3 != 0) { + lk3 = 1; // acquire lock + } else { + } - if (p2 != 0) { - lk2 = 1; // acquire lock - } else {} + if (p4 != 0) { + lk4 = 1; // acquire lock + } else { + } - if (p3 != 0) { - lk3 = 1; // acquire lock - } else {} + if (p5 != 0) { + lk5 = 1; // acquire lock + } else { + } - if (p4 != 0) { - lk4 = 1; // acquire lock - } else {} + if (p6 != 0) { + lk6 = 1; // acquire lock + } else { + } - if (p5 != 0) { - lk5 = 1; // acquire lock - } else {} + if (p7 != 0) { + lk7 = 1; // acquire lock + } else { + } - if (p6 != 0) { - lk6 = 1; // acquire lock - } else {} + if (p8 != 0) { + lk8 = 1; // acquire lock + } else { + } - if (p7 != 0) { - lk7 = 1; // acquire lock - } else {} + if (p9 != 0) { + lk9 = 1; // acquire lock + } else { + } - if (p8 != 0) { - lk8 = 1; // acquire lock - } else {} + if (p10 != 0) { + lk10 = 1; // acquire lock + } else { + } - if (p9 != 0) { - lk9 = 1; // acquire lock - } else {} + if (p11 != 0) { + lk11 = 1; // acquire lock + } else { + } - if (p10 != 0) { - lk10 = 1; // acquire lock - } else {} + if (p12 != 0) { + lk12 = 1; // acquire lock + } else { + } - if (p11 != 0) { - lk11 = 1; // acquire lock - } else {} + if (p13 != 0) { + lk13 = 1; // acquire lock + } else { + } - if (p12 != 0) { - lk12 = 1; // acquire lock - } else {} + if (p14 != 0) { + lk14 = 1; // acquire lock + } else { + } - if (p13 != 0) { - lk13 = 1; // acquire lock - } else {} + if (p15 != 0) { + lk15 = 1; // acquire lock + } else { + } - if (p14 != 0) { - lk14 = 1; // acquire lock - } else {} + // unlock phase + if (p1 != 0) { + if (lk1 != 1) + goto ERROR; // assertion failure + lk1 = 0; + } else { + } - if (p15 != 0) { - lk15 = 1; // acquire lock - } else {} + if (p2 != 0) { + if (lk2 != 1) + goto ERROR; // assertion failure + lk2 = 0; + } else { + goto ERROR; + } + if (p3 != 0) { + if (lk3 != 1) + goto ERROR; // assertion failure + lk3 = 0; + } else { + } - // unlock phase - if (p1 != 0) { - if (lk1 != 1) goto ERROR; // assertion failure - lk1 = 0; - } else {} - - if (p2 != 0) { - if (lk2 != 1) goto ERROR; // assertion failure - lk2 = 0; - } else { goto ERROR; } - - if (p3 != 0) { - if (lk3 != 1) goto ERROR; // assertion failure - lk3 = 0; - } else {} - - if (p4 != 0) { - if (lk4 != 1) goto ERROR; // assertion failure - lk4 = 0; - } else {} - - if (p5 != 0) { - if (lk5 != 1) goto ERROR; // assertion failure - lk5 = 0; - } else {} - - if (p6 != 0) { - if (lk6 != 1) goto ERROR; // assertion failure - lk6 = 0; - } else {} - - if (p7 != 0) { - if (lk7 != 1) goto ERROR; // assertion failure - lk7 = 0; - } else {} - - if (p8 != 0) { - if (lk8 != 1) goto ERROR; // assertion failure - lk8 = 0; - } else {} - - if (p9 != 0) { - if (lk9 != 1) goto ERROR; // assertion failure - lk9 = 0; - } else {} - - if (p10 != 0) { - if (lk10 != 1) goto ERROR; // assertion failure - lk10 = 0; - } else {} - - if (p11 != 0) { - if (lk11 != 1) goto ERROR; // assertion failure - lk11 = 0; - } else {} - - if (p12 != 0) { - if (lk12 != 1) goto ERROR; // assertion failure - lk12 = 0; - } else {} - - if (p13 != 0) { - if (lk13 != 1) goto ERROR; // assertion failure - lk13 = 0; - } else {} - - if (p14 != 0) { - if (lk14 != 1) goto ERROR; // assertion failure - lk14 = 0; - } else { goto ERROR; } - - if (p15 != 0) { - if (lk15 != 1) goto ERROR; // assertion failure - lk15 = 0; - } else {} - - } - out: - return 0; - ERROR: assert(0); - return 0; -} + if (p4 != 0) { + if (lk4 != 1) + goto ERROR; // assertion failure + lk4 = 0; + } else { + } + + if (p5 != 0) { + if (lk5 != 1) + goto ERROR; // assertion failure + lk5 = 0; + } else { + } + + if (p6 != 0) { + if (lk6 != 1) + goto ERROR; // assertion failure + lk6 = 0; + } else { + } + + if (p7 != 0) { + if (lk7 != 1) + goto ERROR; // assertion failure + lk7 = 0; + } else { + } + + if (p8 != 0) { + if (lk8 != 1) + goto ERROR; // assertion failure + lk8 = 0; + } else { + } + if (p9 != 0) { + if (lk9 != 1) + goto ERROR; // assertion failure + lk9 = 0; + } else { + } + + if (p10 != 0) { + if (lk10 != 1) + goto ERROR; // assertion failure + lk10 = 0; + } else { + } + + if (p11 != 0) { + if (lk11 != 1) + goto ERROR; // assertion failure + lk11 = 0; + } else { + } + + if (p12 != 0) { + if (lk12 != 1) + goto ERROR; // assertion failure + lk12 = 0; + } else { + } + + if (p13 != 0) { + if (lk13 != 1) + goto ERROR; // assertion failure + lk13 = 0; + } else { + } + + if (p14 != 0) { + if (lk14 != 1) + goto ERROR; // assertion failure + lk14 = 0; + } else { + goto ERROR; + } + + if (p15 != 0) { + if (lk15 != 1) + goto ERROR; // assertion failure + lk15 = 0; + } else { + } + } +out: + return 0; +ERROR: + assert(0); + return 0; +} diff --git a/test/locks/test_locks_15_true.c b/test/locks/test_locks_15_true.c index 187e86b01..dbda3eec5 100644 --- a/test/locks/test_locks_15_true.c +++ b/test/locks/test_locks_15_true.c @@ -3,234 +3,275 @@ // @expect verified extern int __VERIFIER_nondet_int(); -int main() -{ - int p1 = __VERIFIER_nondet_int(); // condition variable - int lk1; // lock variable +int main() { + int p1 = __VERIFIER_nondet_int(); // condition variable + int lk1; // lock variable - int p2 = __VERIFIER_nondet_int(); // condition variable - int lk2; // lock variable + int p2 = __VERIFIER_nondet_int(); // condition variable + int lk2; // lock variable - int p3 = __VERIFIER_nondet_int(); // condition variable - int lk3; // lock variable + int p3 = __VERIFIER_nondet_int(); // condition variable + int lk3; // lock variable - int p4 = __VERIFIER_nondet_int(); // condition variable - int lk4; // lock variable + int p4 = __VERIFIER_nondet_int(); // condition variable + int lk4; // lock variable - int p5 = __VERIFIER_nondet_int(); // condition variable - int lk5; // lock variable + int p5 = __VERIFIER_nondet_int(); // condition variable + int lk5; // lock variable - int p6 = __VERIFIER_nondet_int(); // condition variable - int lk6; // lock variable + int p6 = __VERIFIER_nondet_int(); // condition variable + int lk6; // lock variable - int p7 = __VERIFIER_nondet_int(); // condition variable - int lk7; // lock variable + int p7 = __VERIFIER_nondet_int(); // condition variable + int lk7; // lock variable - int p8 = __VERIFIER_nondet_int(); // condition variable - int lk8; // lock variable + int p8 = __VERIFIER_nondet_int(); // condition variable + int lk8; // lock variable - int p9 = __VERIFIER_nondet_int(); // condition variable - int lk9; // lock variable + int p9 = __VERIFIER_nondet_int(); // condition variable + int lk9; // lock variable - int p10 = __VERIFIER_nondet_int(); // condition variable - int lk10; // lock variable + int p10 = __VERIFIER_nondet_int(); // condition variable + int lk10; // lock variable - int p11 = __VERIFIER_nondet_int(); // condition variable - int lk11; // lock variable + int p11 = __VERIFIER_nondet_int(); // condition variable + int lk11; // lock variable - int p12 = __VERIFIER_nondet_int(); // condition variable - int lk12; // lock variable + int p12 = __VERIFIER_nondet_int(); // condition variable + int lk12; // lock variable - int p13 = __VERIFIER_nondet_int(); // condition variable - int lk13; // lock variable + int p13 = __VERIFIER_nondet_int(); // condition variable + int lk13; // lock variable - int p14 = __VERIFIER_nondet_int(); // condition variable - int lk14; // lock variable + int p14 = __VERIFIER_nondet_int(); // condition variable + int lk14; // lock variable - int p15 = __VERIFIER_nondet_int(); // condition variable - int lk15; // lock variable + int p15 = __VERIFIER_nondet_int(); // condition variable + int lk15; // lock variable + int cond; - int cond; + while (1) { + cond = __VERIFIER_nondet_int(); + if (cond == 0) { + goto out; + } else { + } + lk1 = 0; // initially lock is open - while(1) { - cond = __VERIFIER_nondet_int(); - if (cond == 0) { - goto out; - } else {} - lk1 = 0; // initially lock is open + lk2 = 0; // initially lock is open - lk2 = 0; // initially lock is open + lk3 = 0; // initially lock is open - lk3 = 0; // initially lock is open + lk4 = 0; // initially lock is open - lk4 = 0; // initially lock is open + lk5 = 0; // initially lock is open - lk5 = 0; // initially lock is open + lk6 = 0; // initially lock is open - lk6 = 0; // initially lock is open + lk7 = 0; // initially lock is open - lk7 = 0; // initially lock is open + lk8 = 0; // initially lock is open - lk8 = 0; // initially lock is open + lk9 = 0; // initially lock is open - lk9 = 0; // initially lock is open + lk10 = 0; // initially lock is open - lk10 = 0; // initially lock is open + lk11 = 0; // initially lock is open - lk11 = 0; // initially lock is open + lk12 = 0; // initially lock is open - lk12 = 0; // initially lock is open + lk13 = 0; // initially lock is open - lk13 = 0; // initially lock is open + lk14 = 0; // initially lock is open - lk14 = 0; // initially lock is open + lk15 = 0; // initially lock is open - lk15 = 0; // initially lock is open + // lock phase + if (p1 != 0) { + lk1 = 1; // acquire lock + } else { + } + if (p2 != 0) { + lk2 = 1; // acquire lock + } else { + } - // lock phase - if (p1 != 0) { - lk1 = 1; // acquire lock - } else {} + if (p3 != 0) { + lk3 = 1; // acquire lock + } else { + } - if (p2 != 0) { - lk2 = 1; // acquire lock - } else {} + if (p4 != 0) { + lk4 = 1; // acquire lock + } else { + } - if (p3 != 0) { - lk3 = 1; // acquire lock - } else {} + if (p5 != 0) { + lk5 = 1; // acquire lock + } else { + } - if (p4 != 0) { - lk4 = 1; // acquire lock - } else {} + if (p6 != 0) { + lk6 = 1; // acquire lock + } else { + } - if (p5 != 0) { - lk5 = 1; // acquire lock - } else {} + if (p7 != 0) { + lk7 = 1; // acquire lock + } else { + } - if (p6 != 0) { - lk6 = 1; // acquire lock - } else {} + if (p8 != 0) { + lk8 = 1; // acquire lock + } else { + } - if (p7 != 0) { - lk7 = 1; // acquire lock - } else {} + if (p9 != 0) { + lk9 = 1; // acquire lock + } else { + } - if (p8 != 0) { - lk8 = 1; // acquire lock - } else {} + if (p10 != 0) { + lk10 = 1; // acquire lock + } else { + } - if (p9 != 0) { - lk9 = 1; // acquire lock - } else {} + if (p11 != 0) { + lk11 = 1; // acquire lock + } else { + } - if (p10 != 0) { - lk10 = 1; // acquire lock - } else {} + if (p12 != 0) { + lk12 = 1; // acquire lock + } else { + } - if (p11 != 0) { - lk11 = 1; // acquire lock - } else {} + if (p13 != 0) { + lk13 = 1; // acquire lock + } else { + } - if (p12 != 0) { - lk12 = 1; // acquire lock - } else {} + if (p14 != 0) { + lk14 = 1; // acquire lock + } else { + } - if (p13 != 0) { - lk13 = 1; // acquire lock - } else {} + if (p15 != 0) { + lk15 = 1; // acquire lock + } else { + } - if (p14 != 0) { - lk14 = 1; // acquire lock - } else {} + // unlock phase + if (p1 != 0) { + if (lk1 != 1) + goto ERROR; // assertion failure + lk1 = 0; + } else { + } - if (p15 != 0) { - lk15 = 1; // acquire lock - } else {} + if (p2 != 0) { + if (lk2 != 1) + goto ERROR; // assertion failure + lk2 = 0; + } else { + } + if (p3 != 0) { + if (lk3 != 1) + goto ERROR; // assertion failure + lk3 = 0; + } else { + } - // unlock phase - if (p1 != 0) { - if (lk1 != 1) goto ERROR; // assertion failure - lk1 = 0; - } else {} - - if (p2 != 0) { - if (lk2 != 1) goto ERROR; // assertion failure - lk2 = 0; - } else {} - - if (p3 != 0) { - if (lk3 != 1) goto ERROR; // assertion failure - lk3 = 0; - } else {} - - if (p4 != 0) { - if (lk4 != 1) goto ERROR; // assertion failure - lk4 = 0; - } else {} - - if (p5 != 0) { - if (lk5 != 1) goto ERROR; // assertion failure - lk5 = 0; - } else {} - - if (p6 != 0) { - if (lk6 != 1) goto ERROR; // assertion failure - lk6 = 0; - } else {} - - if (p7 != 0) { - if (lk7 != 1) goto ERROR; // assertion failure - lk7 = 0; - } else {} - - if (p8 != 0) { - if (lk8 != 1) goto ERROR; // assertion failure - lk8 = 0; - } else {} - - if (p9 != 0) { - if (lk9 != 1) goto ERROR; // assertion failure - lk9 = 0; - } else {} - - if (p10 != 0) { - if (lk10 != 1) goto ERROR; // assertion failure - lk10 = 0; - } else {} - - if (p11 != 0) { - if (lk11 != 1) goto ERROR; // assertion failure - lk11 = 0; - } else {} - - if (p12 != 0) { - if (lk12 != 1) goto ERROR; // assertion failure - lk12 = 0; - } else {} - - if (p13 != 0) { - if (lk13 != 1) goto ERROR; // assertion failure - lk13 = 0; - } else {} - - if (p14 != 0) { - if (lk14 != 1) goto ERROR; // assertion failure - lk14 = 0; - } else {} - - if (p15 != 0) { - if (lk15 != 1) goto ERROR; // assertion failure - lk15 = 0; - } else {} - - } - out: - return 0; - ERROR: assert(0); - return 0; -} + if (p4 != 0) { + if (lk4 != 1) + goto ERROR; // assertion failure + lk4 = 0; + } else { + } + + if (p5 != 0) { + if (lk5 != 1) + goto ERROR; // assertion failure + lk5 = 0; + } else { + } + + if (p6 != 0) { + if (lk6 != 1) + goto ERROR; // assertion failure + lk6 = 0; + } else { + } + + if (p7 != 0) { + if (lk7 != 1) + goto ERROR; // assertion failure + lk7 = 0; + } else { + } + + if (p8 != 0) { + if (lk8 != 1) + goto ERROR; // assertion failure + lk8 = 0; + } else { + } + if (p9 != 0) { + if (lk9 != 1) + goto ERROR; // assertion failure + lk9 = 0; + } else { + } + + if (p10 != 0) { + if (lk10 != 1) + goto ERROR; // assertion failure + lk10 = 0; + } else { + } + + if (p11 != 0) { + if (lk11 != 1) + goto ERROR; // assertion failure + lk11 = 0; + } else { + } + + if (p12 != 0) { + if (lk12 != 1) + goto ERROR; // assertion failure + lk12 = 0; + } else { + } + + if (p13 != 0) { + if (lk13 != 1) + goto ERROR; // assertion failure + lk13 = 0; + } else { + } + + if (p14 != 0) { + if (lk14 != 1) + goto ERROR; // assertion failure + lk14 = 0; + } else { + } + + if (p15 != 0) { + if (lk15 != 1) + goto ERROR; // assertion failure + lk15 = 0; + } else { + } + } +out: + return 0; +ERROR: + assert(0); + return 0; +} diff --git a/test/locks/test_locks_5_true.c b/test/locks/test_locks_5_true.c index 3ece94bc6..10a06a4e9 100644 --- a/test/locks/test_locks_5_true.c +++ b/test/locks/test_locks_5_true.c @@ -3,94 +3,105 @@ // @expect verified extern int __VERIFIER_nondet_int(); -int main() -{ - int p1 = __VERIFIER_nondet_int(); // condition variable - int lk1; // lock variable +int main() { + int p1 = __VERIFIER_nondet_int(); // condition variable + int lk1; // lock variable - int p2 = __VERIFIER_nondet_int(); // condition variable - int lk2; // lock variable + int p2 = __VERIFIER_nondet_int(); // condition variable + int lk2; // lock variable - int p3 = __VERIFIER_nondet_int(); // condition variable - int lk3; // lock variable + int p3 = __VERIFIER_nondet_int(); // condition variable + int lk3; // lock variable - int p4 = __VERIFIER_nondet_int(); // condition variable - int lk4; // lock variable + int p4 = __VERIFIER_nondet_int(); // condition variable + int lk4; // lock variable - int p5 = __VERIFIER_nondet_int(); // condition variable - int lk5; // lock variable + int p5 = __VERIFIER_nondet_int(); // condition variable + int lk5; // lock variable + int cond; - int cond; + while (1) { + cond = __VERIFIER_nondet_int(); + if (cond == 0) { + goto out; + } else { + } + lk1 = 0; // initially lock is open - while(1) { - cond = __VERIFIER_nondet_int(); - if (cond == 0) { - goto out; - } else {} - lk1 = 0; // initially lock is open + lk2 = 0; // initially lock is open - lk2 = 0; // initially lock is open + lk3 = 0; // initially lock is open - lk3 = 0; // initially lock is open + lk4 = 0; // initially lock is open - lk4 = 0; // initially lock is open + lk5 = 0; // initially lock is open - lk5 = 0; // initially lock is open + // lock phase + if (p1 != 0) { + lk1 = 1; // acquire lock + } else { + } + if (p2 != 0) { + lk2 = 1; // acquire lock + } else { + } - // lock phase - if (p1 != 0) { - lk1 = 1; // acquire lock - } else {} + if (p3 != 0) { + lk3 = 1; // acquire lock + } else { + } - if (p2 != 0) { - lk2 = 1; // acquire lock - } else {} + if (p4 != 0) { + lk4 = 1; // acquire lock + } else { + } - if (p3 != 0) { - lk3 = 1; // acquire lock - } else {} + if (p5 != 0) { + lk5 = 1; // acquire lock + } else { + } - if (p4 != 0) { - lk4 = 1; // acquire lock - } else {} + // unlock phase + if (p1 != 0) { + if (lk1 != 1) + goto ERROR; // assertion failure + lk1 = 0; + } else { + } - if (p5 != 0) { - lk5 = 1; // acquire lock - } else {} + if (p2 != 0) { + if (lk2 != 1) + goto ERROR; // assertion failure + lk2 = 0; + } else { + } + if (p3 != 0) { + if (lk3 != 1) + goto ERROR; // assertion failure + lk3 = 0; + } else { + } - // unlock phase - if (p1 != 0) { - if (lk1 != 1) goto ERROR; // assertion failure - lk1 = 0; - } else {} - - if (p2 != 0) { - if (lk2 != 1) goto ERROR; // assertion failure - lk2 = 0; - } else {} - - if (p3 != 0) { - if (lk3 != 1) goto ERROR; // assertion failure - lk3 = 0; - } else {} - - if (p4 != 0) { - if (lk4 != 1) goto ERROR; // assertion failure - lk4 = 0; - } else {} - - if (p5 != 0) { - if (lk5 != 1) goto ERROR; // assertion failure - lk5 = 0; - } else {} + if (p4 != 0) { + if (lk4 != 1) + goto ERROR; // assertion failure + lk4 = 0; + } else { + } + if (p5 != 0) { + if (lk5 != 1) + goto ERROR; // assertion failure + lk5 = 0; + } else { } - out: - return 0; - ERROR: assert(0); - return 0; + } +out: + return 0; +ERROR: + assert(0); + return 0; } - diff --git a/test/locks/test_locks_6_true.c b/test/locks/test_locks_6_true.c index 6d432d896..b4a11ea13 100644 --- a/test/locks/test_locks_6_true.c +++ b/test/locks/test_locks_6_true.c @@ -3,108 +3,122 @@ // @expect verified extern int __VERIFIER_nondet_int(); -int main() -{ - int p1 = __VERIFIER_nondet_int(); // condition variable - int lk1; // lock variable +int main() { + int p1 = __VERIFIER_nondet_int(); // condition variable + int lk1; // lock variable - int p2 = __VERIFIER_nondet_int(); // condition variable - int lk2; // lock variable + int p2 = __VERIFIER_nondet_int(); // condition variable + int lk2; // lock variable - int p3 = __VERIFIER_nondet_int(); // condition variable - int lk3; // lock variable + int p3 = __VERIFIER_nondet_int(); // condition variable + int lk3; // lock variable - int p4 = __VERIFIER_nondet_int(); // condition variable - int lk4; // lock variable + int p4 = __VERIFIER_nondet_int(); // condition variable + int lk4; // lock variable - int p5 = __VERIFIER_nondet_int(); // condition variable - int lk5; // lock variable + int p5 = __VERIFIER_nondet_int(); // condition variable + int lk5; // lock variable - int p6 = __VERIFIER_nondet_int(); // condition variable - int lk6; // lock variable + int p6 = __VERIFIER_nondet_int(); // condition variable + int lk6; // lock variable + int cond; - int cond; + while (1) { + cond = __VERIFIER_nondet_int(); + if (cond == 0) { + goto out; + } else { + } + lk1 = 0; // initially lock is open - while(1) { - cond = __VERIFIER_nondet_int(); - if (cond == 0) { - goto out; - } else {} - lk1 = 0; // initially lock is open + lk2 = 0; // initially lock is open - lk2 = 0; // initially lock is open + lk3 = 0; // initially lock is open - lk3 = 0; // initially lock is open + lk4 = 0; // initially lock is open - lk4 = 0; // initially lock is open + lk5 = 0; // initially lock is open - lk5 = 0; // initially lock is open + lk6 = 0; // initially lock is open - lk6 = 0; // initially lock is open + // lock phase + if (p1 != 0) { + lk1 = 1; // acquire lock + } else { + } + if (p2 != 0) { + lk2 = 1; // acquire lock + } else { + } - // lock phase - if (p1 != 0) { - lk1 = 1; // acquire lock - } else {} + if (p3 != 0) { + lk3 = 1; // acquire lock + } else { + } + + if (p4 != 0) { + lk4 = 1; // acquire lock + } else { + } - if (p2 != 0) { - lk2 = 1; // acquire lock - } else {} + if (p5 != 0) { + lk5 = 1; // acquire lock + } else { + } - if (p3 != 0) { - lk3 = 1; // acquire lock - } else {} + if (p6 != 0) { + lk6 = 1; // acquire lock + } else { + } - if (p4 != 0) { - lk4 = 1; // acquire lock - } else {} + // unlock phase + if (p1 != 0) { + if (lk1 != 1) + goto ERROR; // assertion failure + lk1 = 0; + } else { + } - if (p5 != 0) { - lk5 = 1; // acquire lock - } else {} + if (p2 != 0) { + if (lk2 != 1) + goto ERROR; // assertion failure + lk2 = 0; + } else { + } - if (p6 != 0) { - lk6 = 1; // acquire lock - } else {} + if (p3 != 0) { + if (lk3 != 1) + goto ERROR; // assertion failure + lk3 = 0; + } else { + } + if (p4 != 0) { + if (lk4 != 1) + goto ERROR; // assertion failure + lk4 = 0; + } else { + } - // unlock phase - if (p1 != 0) { - if (lk1 != 1) goto ERROR; // assertion failure - lk1 = 0; - } else {} - - if (p2 != 0) { - if (lk2 != 1) goto ERROR; // assertion failure - lk2 = 0; - } else {} - - if (p3 != 0) { - if (lk3 != 1) goto ERROR; // assertion failure - lk3 = 0; - } else {} - - if (p4 != 0) { - if (lk4 != 1) goto ERROR; // assertion failure - lk4 = 0; - } else {} - - if (p5 != 0) { - if (lk5 != 1) goto ERROR; // assertion failure - lk5 = 0; - } else {} - - if (p6 != 0) { - if (lk6 != 1) goto ERROR; // assertion failure - lk6 = 0; - } else {} + if (p5 != 0) { + if (lk5 != 1) + goto ERROR; // assertion failure + lk5 = 0; + } else { + } + if (p6 != 0) { + if (lk6 != 1) + goto ERROR; // assertion failure + lk6 = 0; + } else { } - out: - return 0; - ERROR: assert(0); - return 0; + } +out: + return 0; +ERROR: + assert(0); + return 0; } - diff --git a/test/locks/test_locks_7_true.c b/test/locks/test_locks_7_true.c index bd2033e31..da56aac93 100644 --- a/test/locks/test_locks_7_true.c +++ b/test/locks/test_locks_7_true.c @@ -3,122 +3,139 @@ // @expect verified extern int __VERIFIER_nondet_int(); -int main() -{ - int p1 = __VERIFIER_nondet_int(); // condition variable - int lk1; // lock variable +int main() { + int p1 = __VERIFIER_nondet_int(); // condition variable + int lk1; // lock variable - int p2 = __VERIFIER_nondet_int(); // condition variable - int lk2; // lock variable + int p2 = __VERIFIER_nondet_int(); // condition variable + int lk2; // lock variable - int p3 = __VERIFIER_nondet_int(); // condition variable - int lk3; // lock variable + int p3 = __VERIFIER_nondet_int(); // condition variable + int lk3; // lock variable - int p4 = __VERIFIER_nondet_int(); // condition variable - int lk4; // lock variable + int p4 = __VERIFIER_nondet_int(); // condition variable + int lk4; // lock variable - int p5 = __VERIFIER_nondet_int(); // condition variable - int lk5; // lock variable + int p5 = __VERIFIER_nondet_int(); // condition variable + int lk5; // lock variable - int p6 = __VERIFIER_nondet_int(); // condition variable - int lk6; // lock variable + int p6 = __VERIFIER_nondet_int(); // condition variable + int lk6; // lock variable - int p7 = __VERIFIER_nondet_int(); // condition variable - int lk7; // lock variable + int p7 = __VERIFIER_nondet_int(); // condition variable + int lk7; // lock variable + int cond; - int cond; + while (1) { + cond = __VERIFIER_nondet_int(); + if (cond == 0) { + goto out; + } else { + } + lk1 = 0; // initially lock is open - while(1) { - cond = __VERIFIER_nondet_int(); - if (cond == 0) { - goto out; - } else {} - lk1 = 0; // initially lock is open + lk2 = 0; // initially lock is open - lk2 = 0; // initially lock is open + lk3 = 0; // initially lock is open - lk3 = 0; // initially lock is open + lk4 = 0; // initially lock is open - lk4 = 0; // initially lock is open + lk5 = 0; // initially lock is open - lk5 = 0; // initially lock is open + lk6 = 0; // initially lock is open - lk6 = 0; // initially lock is open + lk7 = 0; // initially lock is open - lk7 = 0; // initially lock is open + // lock phase + if (p1 != 0) { + lk1 = 1; // acquire lock + } else { + } + if (p2 != 0) { + lk2 = 1; // acquire lock + } else { + } - // lock phase - if (p1 != 0) { - lk1 = 1; // acquire lock - } else {} + if (p3 != 0) { + lk3 = 1; // acquire lock + } else { + } - if (p2 != 0) { - lk2 = 1; // acquire lock - } else {} + if (p4 != 0) { + lk4 = 1; // acquire lock + } else { + } - if (p3 != 0) { - lk3 = 1; // acquire lock - } else {} + if (p5 != 0) { + lk5 = 1; // acquire lock + } else { + } - if (p4 != 0) { - lk4 = 1; // acquire lock - } else {} + if (p6 != 0) { + lk6 = 1; // acquire lock + } else { + } - if (p5 != 0) { - lk5 = 1; // acquire lock - } else {} + if (p7 != 0) { + lk7 = 1; // acquire lock + } else { + } - if (p6 != 0) { - lk6 = 1; // acquire lock - } else {} + // unlock phase + if (p1 != 0) { + if (lk1 != 1) + goto ERROR; // assertion failure + lk1 = 0; + } else { + } - if (p7 != 0) { - lk7 = 1; // acquire lock - } else {} + if (p2 != 0) { + if (lk2 != 1) + goto ERROR; // assertion failure + lk2 = 0; + } else { + } + if (p3 != 0) { + if (lk3 != 1) + goto ERROR; // assertion failure + lk3 = 0; + } else { + } - // unlock phase - if (p1 != 0) { - if (lk1 != 1) goto ERROR; // assertion failure - lk1 = 0; - } else {} - - if (p2 != 0) { - if (lk2 != 1) goto ERROR; // assertion failure - lk2 = 0; - } else {} - - if (p3 != 0) { - if (lk3 != 1) goto ERROR; // assertion failure - lk3 = 0; - } else {} - - if (p4 != 0) { - if (lk4 != 1) goto ERROR; // assertion failure - lk4 = 0; - } else {} - - if (p5 != 0) { - if (lk5 != 1) goto ERROR; // assertion failure - lk5 = 0; - } else {} - - if (p6 != 0) { - if (lk6 != 1) goto ERROR; // assertion failure - lk6 = 0; - } else {} - - if (p7 != 0) { - if (lk7 != 1) goto ERROR; // assertion failure - lk7 = 0; - } else {} + if (p4 != 0) { + if (lk4 != 1) + goto ERROR; // assertion failure + lk4 = 0; + } else { + } + if (p5 != 0) { + if (lk5 != 1) + goto ERROR; // assertion failure + lk5 = 0; + } else { + } + + if (p6 != 0) { + if (lk6 != 1) + goto ERROR; // assertion failure + lk6 = 0; + } else { } - out: - return 0; - ERROR: assert(0); - return 0; -} + if (p7 != 0) { + if (lk7 != 1) + goto ERROR; // assertion failure + lk7 = 0; + } else { + } + } +out: + return 0; +ERROR: + assert(0); + return 0; +} diff --git a/test/locks/test_locks_8_true.c b/test/locks/test_locks_8_true.c index 5bb275c85..4fba2615c 100644 --- a/test/locks/test_locks_8_true.c +++ b/test/locks/test_locks_8_true.c @@ -3,136 +3,156 @@ // @expect verified extern int __VERIFIER_nondet_int(); -int main() -{ - int p1 = __VERIFIER_nondet_int(); // condition variable - int lk1; // lock variable +int main() { + int p1 = __VERIFIER_nondet_int(); // condition variable + int lk1; // lock variable - int p2 = __VERIFIER_nondet_int(); // condition variable - int lk2; // lock variable + int p2 = __VERIFIER_nondet_int(); // condition variable + int lk2; // lock variable - int p3 = __VERIFIER_nondet_int(); // condition variable - int lk3; // lock variable + int p3 = __VERIFIER_nondet_int(); // condition variable + int lk3; // lock variable - int p4 = __VERIFIER_nondet_int(); // condition variable - int lk4; // lock variable + int p4 = __VERIFIER_nondet_int(); // condition variable + int lk4; // lock variable - int p5 = __VERIFIER_nondet_int(); // condition variable - int lk5; // lock variable + int p5 = __VERIFIER_nondet_int(); // condition variable + int lk5; // lock variable - int p6 = __VERIFIER_nondet_int(); // condition variable - int lk6; // lock variable + int p6 = __VERIFIER_nondet_int(); // condition variable + int lk6; // lock variable - int p7 = __VERIFIER_nondet_int(); // condition variable - int lk7; // lock variable + int p7 = __VERIFIER_nondet_int(); // condition variable + int lk7; // lock variable - int p8 = __VERIFIER_nondet_int(); // condition variable - int lk8; // lock variable + int p8 = __VERIFIER_nondet_int(); // condition variable + int lk8; // lock variable + int cond; - int cond; + while (1) { + cond = __VERIFIER_nondet_int(); + if (cond == 0) { + goto out; + } else { + } + lk1 = 0; // initially lock is open - while(1) { - cond = __VERIFIER_nondet_int(); - if (cond == 0) { - goto out; - } else {} - lk1 = 0; // initially lock is open + lk2 = 0; // initially lock is open - lk2 = 0; // initially lock is open + lk3 = 0; // initially lock is open - lk3 = 0; // initially lock is open + lk4 = 0; // initially lock is open - lk4 = 0; // initially lock is open + lk5 = 0; // initially lock is open - lk5 = 0; // initially lock is open + lk6 = 0; // initially lock is open - lk6 = 0; // initially lock is open + lk7 = 0; // initially lock is open - lk7 = 0; // initially lock is open + lk8 = 0; // initially lock is open - lk8 = 0; // initially lock is open + // lock phase + if (p1 != 0) { + lk1 = 1; // acquire lock + } else { + } + if (p2 != 0) { + lk2 = 1; // acquire lock + } else { + } - // lock phase - if (p1 != 0) { - lk1 = 1; // acquire lock - } else {} + if (p3 != 0) { + lk3 = 1; // acquire lock + } else { + } + + if (p4 != 0) { + lk4 = 1; // acquire lock + } else { + } + + if (p5 != 0) { + lk5 = 1; // acquire lock + } else { + } + + if (p6 != 0) { + lk6 = 1; // acquire lock + } else { + } + + if (p7 != 0) { + lk7 = 1; // acquire lock + } else { + } - if (p2 != 0) { - lk2 = 1; // acquire lock - } else {} + if (p8 != 0) { + lk8 = 1; // acquire lock + } else { + } - if (p3 != 0) { - lk3 = 1; // acquire lock - } else {} + // unlock phase + if (p1 != 0) { + if (lk1 != 1) + goto ERROR; // assertion failure + lk1 = 0; + } else { + } - if (p4 != 0) { - lk4 = 1; // acquire lock - } else {} + if (p2 != 0) { + if (lk2 != 1) + goto ERROR; // assertion failure + lk2 = 0; + } else { + } - if (p5 != 0) { - lk5 = 1; // acquire lock - } else {} + if (p3 != 0) { + if (lk3 != 1) + goto ERROR; // assertion failure + lk3 = 0; + } else { + } - if (p6 != 0) { - lk6 = 1; // acquire lock - } else {} + if (p4 != 0) { + if (lk4 != 1) + goto ERROR; // assertion failure + lk4 = 0; + } else { + } - if (p7 != 0) { - lk7 = 1; // acquire lock - } else {} + if (p5 != 0) { + if (lk5 != 1) + goto ERROR; // assertion failure + lk5 = 0; + } else { + } - if (p8 != 0) { - lk8 = 1; // acquire lock - } else {} + if (p6 != 0) { + if (lk6 != 1) + goto ERROR; // assertion failure + lk6 = 0; + } else { + } + if (p7 != 0) { + if (lk7 != 1) + goto ERROR; // assertion failure + lk7 = 0; + } else { + } - // unlock phase - if (p1 != 0) { - if (lk1 != 1) goto ERROR; // assertion failure - lk1 = 0; - } else {} - - if (p2 != 0) { - if (lk2 != 1) goto ERROR; // assertion failure - lk2 = 0; - } else {} - - if (p3 != 0) { - if (lk3 != 1) goto ERROR; // assertion failure - lk3 = 0; - } else {} - - if (p4 != 0) { - if (lk4 != 1) goto ERROR; // assertion failure - lk4 = 0; - } else {} - - if (p5 != 0) { - if (lk5 != 1) goto ERROR; // assertion failure - lk5 = 0; - } else {} - - if (p6 != 0) { - if (lk6 != 1) goto ERROR; // assertion failure - lk6 = 0; - } else {} - - if (p7 != 0) { - if (lk7 != 1) goto ERROR; // assertion failure - lk7 = 0; - } else {} - - if (p8 != 0) { - if (lk8 != 1) goto ERROR; // assertion failure - lk8 = 0; - } else {} - - } - out: - return 0; - ERROR: assert(0); - return 0; + if (p8 != 0) { + if (lk8 != 1) + goto ERROR; // assertion failure + lk8 = 0; + } else { + } + } +out: + return 0; +ERROR: + assert(0); + return 0; } - diff --git a/test/locks/test_locks_9_true.c b/test/locks/test_locks_9_true.c index 3e1486a68..9704c2d93 100644 --- a/test/locks/test_locks_9_true.c +++ b/test/locks/test_locks_9_true.c @@ -3,150 +3,173 @@ // @expect verified extern int __VERIFIER_nondet_int(); -int main() -{ - int p1 = __VERIFIER_nondet_int(); // condition variable - int lk1; // lock variable +int main() { + int p1 = __VERIFIER_nondet_int(); // condition variable + int lk1; // lock variable - int p2 = __VERIFIER_nondet_int(); // condition variable - int lk2; // lock variable + int p2 = __VERIFIER_nondet_int(); // condition variable + int lk2; // lock variable - int p3 = __VERIFIER_nondet_int(); // condition variable - int lk3; // lock variable + int p3 = __VERIFIER_nondet_int(); // condition variable + int lk3; // lock variable - int p4 = __VERIFIER_nondet_int(); // condition variable - int lk4; // lock variable + int p4 = __VERIFIER_nondet_int(); // condition variable + int lk4; // lock variable - int p5 = __VERIFIER_nondet_int(); // condition variable - int lk5; // lock variable + int p5 = __VERIFIER_nondet_int(); // condition variable + int lk5; // lock variable - int p6 = __VERIFIER_nondet_int(); // condition variable - int lk6; // lock variable + int p6 = __VERIFIER_nondet_int(); // condition variable + int lk6; // lock variable - int p7 = __VERIFIER_nondet_int(); // condition variable - int lk7; // lock variable + int p7 = __VERIFIER_nondet_int(); // condition variable + int lk7; // lock variable - int p8 = __VERIFIER_nondet_int(); // condition variable - int lk8; // lock variable + int p8 = __VERIFIER_nondet_int(); // condition variable + int lk8; // lock variable - int p9 = __VERIFIER_nondet_int(); // condition variable - int lk9; // lock variable + int p9 = __VERIFIER_nondet_int(); // condition variable + int lk9; // lock variable + int cond; - int cond; + while (1) { + cond = __VERIFIER_nondet_int(); + if (cond == 0) { + goto out; + } else { + } + lk1 = 0; // initially lock is open - while(1) { - cond = __VERIFIER_nondet_int(); - if (cond == 0) { - goto out; - } else {} - lk1 = 0; // initially lock is open + lk2 = 0; // initially lock is open - lk2 = 0; // initially lock is open + lk3 = 0; // initially lock is open - lk3 = 0; // initially lock is open + lk4 = 0; // initially lock is open - lk4 = 0; // initially lock is open + lk5 = 0; // initially lock is open - lk5 = 0; // initially lock is open + lk6 = 0; // initially lock is open - lk6 = 0; // initially lock is open + lk7 = 0; // initially lock is open - lk7 = 0; // initially lock is open + lk8 = 0; // initially lock is open - lk8 = 0; // initially lock is open + lk9 = 0; // initially lock is open - lk9 = 0; // initially lock is open + // lock phase + if (p1 != 0) { + lk1 = 1; // acquire lock + } else { + } + if (p2 != 0) { + lk2 = 1; // acquire lock + } else { + } - // lock phase - if (p1 != 0) { - lk1 = 1; // acquire lock - } else {} + if (p3 != 0) { + lk3 = 1; // acquire lock + } else { + } - if (p2 != 0) { - lk2 = 1; // acquire lock - } else {} + if (p4 != 0) { + lk4 = 1; // acquire lock + } else { + } - if (p3 != 0) { - lk3 = 1; // acquire lock - } else {} + if (p5 != 0) { + lk5 = 1; // acquire lock + } else { + } - if (p4 != 0) { - lk4 = 1; // acquire lock - } else {} + if (p6 != 0) { + lk6 = 1; // acquire lock + } else { + } - if (p5 != 0) { - lk5 = 1; // acquire lock - } else {} + if (p7 != 0) { + lk7 = 1; // acquire lock + } else { + } - if (p6 != 0) { - lk6 = 1; // acquire lock - } else {} + if (p8 != 0) { + lk8 = 1; // acquire lock + } else { + } - if (p7 != 0) { - lk7 = 1; // acquire lock - } else {} + if (p9 != 0) { + lk9 = 1; // acquire lock + } else { + } - if (p8 != 0) { - lk8 = 1; // acquire lock - } else {} + // unlock phase + if (p1 != 0) { + if (lk1 != 1) + goto ERROR; // assertion failure + lk1 = 0; + } else { + } - if (p9 != 0) { - lk9 = 1; // acquire lock - } else {} + if (p2 != 0) { + if (lk2 != 1) + goto ERROR; // assertion failure + lk2 = 0; + } else { + } + if (p3 != 0) { + if (lk3 != 1) + goto ERROR; // assertion failure + lk3 = 0; + } else { + } - // unlock phase - if (p1 != 0) { - if (lk1 != 1) goto ERROR; // assertion failure - lk1 = 0; - } else {} - - if (p2 != 0) { - if (lk2 != 1) goto ERROR; // assertion failure - lk2 = 0; - } else {} - - if (p3 != 0) { - if (lk3 != 1) goto ERROR; // assertion failure - lk3 = 0; - } else {} - - if (p4 != 0) { - if (lk4 != 1) goto ERROR; // assertion failure - lk4 = 0; - } else {} - - if (p5 != 0) { - if (lk5 != 1) goto ERROR; // assertion failure - lk5 = 0; - } else {} - - if (p6 != 0) { - if (lk6 != 1) goto ERROR; // assertion failure - lk6 = 0; - } else {} - - if (p7 != 0) { - if (lk7 != 1) goto ERROR; // assertion failure - lk7 = 0; - } else {} - - if (p8 != 0) { - if (lk8 != 1) goto ERROR; // assertion failure - lk8 = 0; - } else {} - - if (p9 != 0) { - if (lk9 != 1) goto ERROR; // assertion failure - lk9 = 0; - } else {} - - } - out: - return 0; - ERROR: assert(0); - return 0; -} + if (p4 != 0) { + if (lk4 != 1) + goto ERROR; // assertion failure + lk4 = 0; + } else { + } + + if (p5 != 0) { + if (lk5 != 1) + goto ERROR; // assertion failure + lk5 = 0; + } else { + } + + if (p6 != 0) { + if (lk6 != 1) + goto ERROR; // assertion failure + lk6 = 0; + } else { + } + + if (p7 != 0) { + if (lk7 != 1) + goto ERROR; // assertion failure + lk7 = 0; + } else { + } + if (p8 != 0) { + if (lk8 != 1) + goto ERROR; // assertion failure + lk8 = 0; + } else { + } + + if (p9 != 0) { + if (lk9 != 1) + goto ERROR; // assertion failure + lk9 = 0; + } else { + } + } +out: + return 0; +ERROR: + assert(0); + return 0; +} diff --git a/test/mathc/ceil.c b/test/mathc/ceil.c index 219afe7ac..0908b2923 100644 --- a/test/mathc/ceil.c +++ b/test/mathc/ceil.c @@ -30,4 +30,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/ceil_fail.c b/test/mathc/ceil_fail.c index 986c8e6d7..43c3dae98 100644 --- a/test/mathc/ceil_fail.c +++ b/test/mathc/ceil_fail.c @@ -28,4 +28,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/ceilf.c b/test/mathc/ceilf.c index f8b44c9d1..a541b6fcc 100644 --- a/test/mathc/ceilf.c +++ b/test/mathc/ceilf.c @@ -30,4 +30,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/ceilf_fail.c b/test/mathc/ceilf_fail.c index 28512dd57..6bd4a3124 100644 --- a/test/mathc/ceilf_fail.c +++ b/test/mathc/ceilf_fail.c @@ -28,4 +28,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/ceill.c b/test/mathc/ceill.c index cab2964d0..b91831b91 100644 --- a/test/mathc/ceill.c +++ b/test/mathc/ceill.c @@ -29,4 +29,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/ceill_fail.c b/test/mathc/ceill_fail.c index ef36130f7..f5b60c3a1 100644 --- a/test/mathc/ceill_fail.c +++ b/test/mathc/ceill_fail.c @@ -27,4 +27,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/floor.c b/test/mathc/floor.c index 170a74c45..8674e62af 100644 --- a/test/mathc/floor.c +++ b/test/mathc/floor.c @@ -30,4 +30,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/floor_fail.c b/test/mathc/floor_fail.c index f458c1bc8..71162268a 100644 --- a/test/mathc/floor_fail.c +++ b/test/mathc/floor_fail.c @@ -28,4 +28,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/floorf.c b/test/mathc/floorf.c index 990947ad3..d66322946 100644 --- a/test/mathc/floorf.c +++ b/test/mathc/floorf.c @@ -30,4 +30,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/floorf_fail.c b/test/mathc/floorf_fail.c index 799e1fe44..d0f615704 100644 --- a/test/mathc/floorf_fail.c +++ b/test/mathc/floorf_fail.c @@ -28,4 +28,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/floorl.c b/test/mathc/floorl.c index a04bf7ad4..a852e2e02 100644 --- a/test/mathc/floorl.c +++ b/test/mathc/floorl.c @@ -29,4 +29,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/floorl_fail.c b/test/mathc/floorl_fail.c index d7d06e9c2..5450c5d4c 100644 --- a/test/mathc/floorl_fail.c +++ b/test/mathc/floorl_fail.c @@ -27,4 +27,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/fmod.c b/test/mathc/fmod.c index 1c19c2bf5..b83a47be6 100644 --- a/test/mathc/fmod.c +++ b/test/mathc/fmod.c @@ -27,19 +27,18 @@ int main(void) { assert(__isnan(fmod(x, -0.0))); } - if (!__isnan(x) && !__isinf(x)) { assert(fmod(x, Inf) == x); assert(fmod(x, negInf) == x); } - + if (!__isnan(y) && !__iszero(y)) { assert(fmod(0.0, y) == 0.0); assert(fmod(-0.0, y) == -0.0); int isNeg = __signbit(fmod(-0.0, y)); assert(isNeg); } - + assert(__isnan(fmod(NaN, y))); assert(__isnan(fmod(x, NaN))); diff --git a/test/mathc/fmod_fail.c b/test/mathc/fmod_fail.c index 651456d8c..2636cb9de 100644 --- a/test/mathc/fmod_fail.c +++ b/test/mathc/fmod_fail.c @@ -27,19 +27,18 @@ int main(void) { assert(__isnan(fmod(x, -0.0))); } - if (!__isnan(x) && !__isinf(x)) { assert(fmod(x, Inf) == x); assert(fmod(x, negInf) == x); } - + if (!__isnan(y) && !__iszero(y)) { assert(fmod(0.0, y) == 0.0); assert(fmod(-0.0, y) == -0.0); int isNeg = __signbit(fmod(-0.0, y)); assert(isNeg); } - + assert(__isnan(fmod(NaN, y))); assert(__isnan(fmod(x, NaN))); diff --git a/test/mathc/fmodf.c b/test/mathc/fmodf.c index e5f6152e2..600ca8836 100644 --- a/test/mathc/fmodf.c +++ b/test/mathc/fmodf.c @@ -27,19 +27,18 @@ int main(void) { assert(__isnanf(fmodf(x, -0.0f))); } - if (!__isnanf(x) && !__isinff(x)) { assert(fmodf(x, Inf) == x); assert(fmodf(x, negInf) == x); } - + if (!__isnanf(y) && !__iszerof(y)) { assert(fmodf(0.0f, y) == 0.0f); assert(fmodf(-0.0f, y) == -0.0f); int isNeg = __signbitf(fmodf(-0.0f, y)); assert(isNeg); } - + assert(__isnanf(fmodf(NaN, y))); assert(__isnanf(fmodf(x, NaN))); diff --git a/test/mathc/fmodf_fail.c b/test/mathc/fmodf_fail.c index 3d54eb422..da2c277c8 100644 --- a/test/mathc/fmodf_fail.c +++ b/test/mathc/fmodf_fail.c @@ -27,19 +27,18 @@ int main(void) { assert(__isnanf(fmodf(x, -0.0f))); } - if (!__isnanf(x) && !__isinff(x)) { assert(fmodf(x, Inf) == x); assert(fmodf(x, negInf) == x); } - + if (!__isnanf(y) && !__iszerof(y)) { assert(fmodf(0.0f, y) == 0.0f); assert(fmodf(-0.0f, y) == -0.0f); int isNeg = __signbitf(fmodf(-0.0f, y)); assert(isNeg); } - + assert(__isnanf(fmodf(NaN, y))); assert(__isnanf(fmodf(x, NaN))); diff --git a/test/mathc/fmodl.c b/test/mathc/fmodl.c index be028d4fa..3fae0b0a9 100644 --- a/test/mathc/fmodl.c +++ b/test/mathc/fmodl.c @@ -26,19 +26,18 @@ int main(void) { assert(__isnanl(fmodl(x, -0.0l))); } - if (!__isnanl(x) && !__isinfl(x)) { assert(fmodl(x, Inf) == x); assert(fmodl(x, negInf) == x); } - + if (!__isnanl(y) && !__iszerol(y)) { assert(fmodl(0.0l, y) == 0.0l); assert(fmodl(-0.0l, y) == -0.0l); int isNeg = __signbitl(fmodl(-0.0l, y)); assert(isNeg); } - + assert(__isnanl(fmodl(NaN, y))); assert(__isnanl(fmodl(x, NaN))); diff --git a/test/mathc/fmodl_fail.c b/test/mathc/fmodl_fail.c index bbcd891d2..30574a6f2 100644 --- a/test/mathc/fmodl_fail.c +++ b/test/mathc/fmodl_fail.c @@ -26,19 +26,18 @@ int main(void) { assert(__isnanl(fmodl(x, -0.0l))); } - if (!__isnanl(x) && !__isinfl(x)) { assert(fmodl(x, Inf) == x); assert(fmodl(x, negInf) == x); } - + if (!__isnanl(y) && !__iszerol(y)) { assert(fmodl(0.0l, y) == 0.0l); assert(fmodl(-0.0l, y) == -0.0l); int isNeg = __signbitl(fmodl(-0.0l, y)); assert(isNeg); } - + assert(__isnanl(fmodl(NaN, y))); assert(__isnanl(fmodl(x, NaN))); diff --git a/test/mathc/issue_198.c b/test/mathc/issue_198.c index 692f21baa..3f810dca0 100644 --- a/test/mathc/issue_198.c +++ b/test/mathc/issue_198.c @@ -1,4 +1,4 @@ -#include smack.h" +#include smack.h " #include // @expect verified diff --git a/test/mathc/issue_198_fail.c b/test/mathc/issue_198_fail.c index b5ff69b3d..c7d37fe7b 100644 --- a/test/mathc/issue_198_fail.c +++ b/test/mathc/issue_198_fail.c @@ -1,4 +1,4 @@ -#include smack.h" +#include smack.h " #include // @expect error diff --git a/test/mathc/issue_244.c b/test/mathc/issue_244.c index 4703226dd..37189651f 100644 --- a/test/mathc/issue_244.c +++ b/test/mathc/issue_244.c @@ -4,7 +4,4 @@ // @expect verified // @flag --bit-precise -int main(void) -{ - assert(!__signbit(remainder(0.0, 1.0))); -} +int main(void) { assert(!__signbit(remainder(0.0, 1.0))); } diff --git a/test/mathc/issue_244_fail.c b/test/mathc/issue_244_fail.c index 284f4b843..16bd801ee 100644 --- a/test/mathc/issue_244_fail.c +++ b/test/mathc/issue_244_fail.c @@ -4,7 +4,4 @@ // @expect error // @flag --bit-precise -int main(void) -{ - assert(__signbit(remainder(0.0, 1.0))); -} +int main(void) { assert(__signbit(remainder(0.0, 1.0))); } diff --git a/test/mathc/lrint.c b/test/mathc/lrint.c index 8ba258a4b..29e331799 100644 --- a/test/mathc/lrint.c +++ b/test/mathc/lrint.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect verified // @flag --bit-precise @@ -44,4 +44,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/lrint_fail.c b/test/mathc/lrint_fail.c index 2d673c92d..dcdc00742 100644 --- a/test/mathc/lrint_fail.c +++ b/test/mathc/lrint_fail.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect error // @flag --bit-precise @@ -44,4 +44,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/lrintf.c b/test/mathc/lrintf.c index 02525fec6..13d223d4d 100644 --- a/test/mathc/lrintf.c +++ b/test/mathc/lrintf.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect verified // @flag --bit-precise @@ -44,4 +44,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/lrintf_fail.c b/test/mathc/lrintf_fail.c index de757de6a..58756948b 100644 --- a/test/mathc/lrintf_fail.c +++ b/test/mathc/lrintf_fail.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect error // @flag --bit-precise @@ -44,4 +44,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/lrintl.c b/test/mathc/lrintl.c index 3e8d2324f..863856f92 100644 --- a/test/mathc/lrintl.c +++ b/test/mathc/lrintl.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect verified @@ -43,4 +43,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/lrintl_fail.c b/test/mathc/lrintl_fail.c index 6c6882a2d..268e6efcc 100644 --- a/test/mathc/lrintl_fail.c +++ b/test/mathc/lrintl_fail.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect error @@ -43,4 +43,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/lround.c b/test/mathc/lround.c index fcdc3897b..f449d099c 100644 --- a/test/mathc/lround.c +++ b/test/mathc/lround.c @@ -8,7 +8,7 @@ int main(void) { double NaN = 0.0 / 0.0; double Inf = 1.0 / 0.0; double negInf = -1.0 / 0.0; - + double a = -1.5; double b = -1.49999999999999999; double c = 3.5; @@ -26,4 +26,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/lround_fail.c b/test/mathc/lround_fail.c index 798b1e27f..7231a6391 100644 --- a/test/mathc/lround_fail.c +++ b/test/mathc/lround_fail.c @@ -8,7 +8,7 @@ int main(void) { double NaN = 0.0 / 0.0; double Inf = 1.0 / 0.0; double negInf = -1.0 / 0.0; - + double a = -1.5; double b = -1.49999999999999999; double c = 3.5; @@ -26,4 +26,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/lroundf.c b/test/mathc/lroundf.c index cfaf48a67..633104306 100644 --- a/test/mathc/lroundf.c +++ b/test/mathc/lroundf.c @@ -8,7 +8,7 @@ int main(void) { float NaN = 0.0f / 0.0f; float Inf = 1.0f / 0.0f; float negInf = -1.0f / 0.0f; - + float a = -1.5f; float b = -1.49999999999999999f; float c = 3.5f; @@ -26,4 +26,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/lroundf_fail.c b/test/mathc/lroundf_fail.c index 591d7cac0..833100618 100644 --- a/test/mathc/lroundf_fail.c +++ b/test/mathc/lroundf_fail.c @@ -8,7 +8,7 @@ int main(void) { float NaN = 0.0f / 0.0f; float Inf = 1.0f / 0.0f; float negInf = -1.0f / 0.0f; - + float a = -1.5f; float b = -1.49999999999999999f; float c = 3.5f; @@ -26,4 +26,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/lroundl.c b/test/mathc/lroundl.c index d301f688c..27a436670 100644 --- a/test/mathc/lroundl.c +++ b/test/mathc/lroundl.c @@ -7,7 +7,7 @@ int main(void) { long double NaN = 0.0l / 0.0l; long double Inf = 1.0l / 0.0l; long double negInf = -1.0l / 0.0l; - + long double a = -1.5l; long double b = -1.49999999999999999l; long double c = 3.5l; @@ -25,4 +25,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/lroundl_fail.c b/test/mathc/lroundl_fail.c index e5f86bcc8..700b80946 100644 --- a/test/mathc/lroundl_fail.c +++ b/test/mathc/lroundl_fail.c @@ -7,7 +7,7 @@ int main(void) { long double NaN = 0.0l / 0.0l; long double Inf = 1.0l / 0.0l; long double negInf = -1.0l / 0.0l; - + long double a = -1.5l; long double b = -1.49999999999999999l; long double c = 3.5l; @@ -25,4 +25,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/modf.c b/test/mathc/modf.c index b4ee8d698..cb66a51f7 100644 --- a/test/mathc/modf.c +++ b/test/mathc/modf.c @@ -12,7 +12,7 @@ int main(void) { double x = __VERIFIER_nondet_double(); double fPart, iPart; - + if (!__isnan(x) && !__isinf(x) && !__iszero(x)) { fPart = modf(x, &iPart); if (x < 0) { @@ -26,7 +26,7 @@ int main(void) { fPart = modf(0.0, &iPart); assert(iPart == 0.0 && fPart == 0.0); - + fPart = modf(-0.0, &iPart); assert(iPart == -0.0 && fPart == -0.0); diff --git a/test/mathc/modf_fail.c b/test/mathc/modf_fail.c index 95733cc5f..70d1def75 100644 --- a/test/mathc/modf_fail.c +++ b/test/mathc/modf_fail.c @@ -12,7 +12,7 @@ int main(void) { double x = __VERIFIER_nondet_double(); double fPart, iPart; - + if (!__isnan(x) && !__isinf(x) && !__iszero(x)) { fPart = modf(x, &iPart); if (x < 0) { @@ -26,7 +26,7 @@ int main(void) { fPart = modf(0.0, &iPart); assert(iPart == 0.0 && fPart == 0.0); - + fPart = modf(-0.0, &iPart); assert(iPart == -0.0 && fPart == -0.0); diff --git a/test/mathc/modff.c b/test/mathc/modff.c index 251417bac..a4d802d74 100644 --- a/test/mathc/modff.c +++ b/test/mathc/modff.c @@ -12,7 +12,7 @@ int main(void) { float x = __VERIFIER_nondet_float(); float fPart, iPart; - + if (!__isnanf(x) && !__isinff(x) && !__iszerof(x)) { fPart = modff(x, &iPart); if (x < 0) { @@ -26,7 +26,7 @@ int main(void) { fPart = modff(0.0f, &iPart); assert(iPart == 0.0f && fPart == 0.0f); - + fPart = modff(-0.0f, &iPart); assert(iPart == -0.0f && fPart == -0.0f); diff --git a/test/mathc/modff_fail.c b/test/mathc/modff_fail.c index 432882754..c1fd9fde0 100644 --- a/test/mathc/modff_fail.c +++ b/test/mathc/modff_fail.c @@ -12,7 +12,7 @@ int main(void) { float x = __VERIFIER_nondet_float(); float fPart, iPart; - + if (!__isnanf(x) && !__isinff(x) && !__iszerof(x)) { fPart = modff(x, &iPart); if (x < 0) { @@ -26,7 +26,7 @@ int main(void) { fPart = modff(0.0f, &iPart); assert(iPart == 0.0f && fPart == 0.0f); - + fPart = modff(-0.0f, &iPart); assert(iPart == -0.0f && fPart == -0.0f); diff --git a/test/mathc/modfl.c b/test/mathc/modfl.c index b79a96278..358fc6c4e 100644 --- a/test/mathc/modfl.c +++ b/test/mathc/modfl.c @@ -11,7 +11,7 @@ int main(void) { long double x = __VERIFIER_nondet_long_double(); long double fPart, iPart; - + if (!__isnanl(x) && !__isinfl(x) && !__iszerol(x)) { fPart = modfl(x, &iPart); if (x < 0) { @@ -25,7 +25,7 @@ int main(void) { fPart = modfl(0.0l, &iPart); assert(iPart == 0.0l && fPart == 0.0l); - + fPart = modfl(-0.0l, &iPart); assert(iPart == -0.0l && fPart == -0.0l); diff --git a/test/mathc/modfl_fail.c b/test/mathc/modfl_fail.c index 7cb23d474..72b489359 100644 --- a/test/mathc/modfl_fail.c +++ b/test/mathc/modfl_fail.c @@ -11,7 +11,7 @@ int main(void) { long double x = __VERIFIER_nondet_long_double(); long double fPart, iPart; - + if (!__isnanl(x) && !__isinfl(x) && !__iszerol(x)) { fPart = modfl(x, &iPart); if (x < 0) { @@ -25,7 +25,7 @@ int main(void) { fPart = modfl(0.0l, &iPart); assert(iPart == 0.0l && fPart == 0.0l); - + fPart = modfl(-0.0l, &iPart); assert(iPart == -0.0l && fPart == -0.0l); diff --git a/test/mathc/nearbyint.c b/test/mathc/nearbyint.c index 7e4abf769..68fc5cea8 100644 --- a/test/mathc/nearbyint.c +++ b/test/mathc/nearbyint.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect verified // @flag --bit-precise @@ -51,4 +51,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/nearbyint_fail.c b/test/mathc/nearbyint_fail.c index cf441e29e..6ff2a84e5 100644 --- a/test/mathc/nearbyint_fail.c +++ b/test/mathc/nearbyint_fail.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect error // @flag --bit-precise @@ -51,4 +51,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/nearbyintf.c b/test/mathc/nearbyintf.c index 836ff666d..93a1adfb4 100644 --- a/test/mathc/nearbyintf.c +++ b/test/mathc/nearbyintf.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect verified // @flag --bit-precise @@ -51,4 +51,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/nearbyintf_fail.c b/test/mathc/nearbyintf_fail.c index 7984e8fc0..b832869e0 100644 --- a/test/mathc/nearbyintf_fail.c +++ b/test/mathc/nearbyintf_fail.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect error // @flag --bit-precise @@ -51,4 +51,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/nearbyintl.c b/test/mathc/nearbyintl.c index c947e9d25..fec4c00a6 100644 --- a/test/mathc/nearbyintl.c +++ b/test/mathc/nearbyintl.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect verified @@ -50,4 +50,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/nearbyintl_fail.c b/test/mathc/nearbyintl_fail.c index 6feca401e..fd22afd7e 100644 --- a/test/mathc/nearbyintl_fail.c +++ b/test/mathc/nearbyintl_fail.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect error @@ -50,4 +50,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/remainder.c b/test/mathc/remainder.c index 2ac1b5e91..1114f41b8 100644 --- a/test/mathc/remainder.c +++ b/test/mathc/remainder.c @@ -19,7 +19,7 @@ int main(void) { assert(__isnan(remainder(Inf, y))); assert(__isnan(remainder(negInf, y))); } - + if (!__isnan(x)) { assert(__isnan(remainder(x, 0.0))); assert(__isnan(remainder(x, -0.0))); diff --git a/test/mathc/remainderf.c b/test/mathc/remainderf.c index 61347c7e2..af44d2347 100644 --- a/test/mathc/remainderf.c +++ b/test/mathc/remainderf.c @@ -19,7 +19,7 @@ int main(void) { assert(__isnanf(remainderf(Inf, y))); assert(__isnanf(remainderf(negInf, y))); } - + if (!__isnanf(x)) { assert(__isnanf(remainderf(x, 0.0f))); assert(__isnanf(remainderf(x, -0.0f))); diff --git a/test/mathc/remainderf_fail.c b/test/mathc/remainderf_fail.c index b0bedc68a..ec9321795 100644 --- a/test/mathc/remainderf_fail.c +++ b/test/mathc/remainderf_fail.c @@ -19,7 +19,7 @@ int main(void) { assert(__isnanf(remainderf(Inf, y))); assert(__isnanf(remainderf(negInf, y))); } - + if (!__isnanf(x)) { assert(__isnanf(remainderf(x, 0.0f))); assert(__isnanf(remainderf(x, -0.0f))); diff --git a/test/mathc/remainderl.c b/test/mathc/remainderl.c index 7f2a20d5a..a8c7a1876 100644 --- a/test/mathc/remainderl.c +++ b/test/mathc/remainderl.c @@ -19,7 +19,7 @@ int main(void) { assert(__isnanl(remainderl(Inf, y))); assert(__isnanl(remainderl(negInf, y))); } - + if (!__isnanl(x)) { assert(__isnanl(remainderl(x, 0.0l))); assert(__isnanl(remainderl(x, -0.0l))); diff --git a/test/mathc/remainderl_fail.c b/test/mathc/remainderl_fail.c index 6c5c4ba6e..d5ac1e26c 100644 --- a/test/mathc/remainderl_fail.c +++ b/test/mathc/remainderl_fail.c @@ -19,7 +19,7 @@ int main(void) { assert(__isnanl(remainderl(Inf, y))); assert(__isnanl(remainderl(negInf, y))); } - + if (!__isnanl(x)) { assert(__isnanl(remainderl(x, 0.0l))); assert(__isnanl(remainderl(x, -0.0l))); diff --git a/test/mathc/rint.c b/test/mathc/rint.c index 2534e8f58..c89e3e28c 100644 --- a/test/mathc/rint.c +++ b/test/mathc/rint.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect verified // @flag --bit-precise @@ -51,4 +51,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/rint_fail.c b/test/mathc/rint_fail.c index d5ab4e936..0529afcbe 100644 --- a/test/mathc/rint_fail.c +++ b/test/mathc/rint_fail.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect error // @flag --bit-precise @@ -51,4 +51,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/rintf.c b/test/mathc/rintf.c index 81185d377..2ff91d707 100644 --- a/test/mathc/rintf.c +++ b/test/mathc/rintf.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect verified // @flag --bit-precise @@ -51,4 +51,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/rintf_fail.c b/test/mathc/rintf_fail.c index 7fe99fd4e..6c72fea46 100644 --- a/test/mathc/rintf_fail.c +++ b/test/mathc/rintf_fail.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect error // @flag --bit-precise @@ -51,4 +51,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/rintl.c b/test/mathc/rintl.c index 870b853cf..270e076d8 100644 --- a/test/mathc/rintl.c +++ b/test/mathc/rintl.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect verified @@ -50,4 +50,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/rintl_fail.c b/test/mathc/rintl_fail.c index 1004ac4bd..6ff5a32ba 100644 --- a/test/mathc/rintl_fail.c +++ b/test/mathc/rintl_fail.c @@ -1,6 +1,6 @@ #include "smack.h" -#include #include +#include // @expect error @@ -50,4 +50,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/round.c b/test/mathc/round.c index 6753e050b..e3d8195db 100644 --- a/test/mathc/round.c +++ b/test/mathc/round.c @@ -28,4 +28,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/round_fail.c b/test/mathc/round_fail.c index aaad7f85a..fbf567af1 100644 --- a/test/mathc/round_fail.c +++ b/test/mathc/round_fail.c @@ -28,4 +28,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/roundf.c b/test/mathc/roundf.c index 5e427c4fe..58c2e1b95 100644 --- a/test/mathc/roundf.c +++ b/test/mathc/roundf.c @@ -28,4 +28,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/roundf_fail.c b/test/mathc/roundf_fail.c index 7fa86de5b..cfa86d159 100644 --- a/test/mathc/roundf_fail.c +++ b/test/mathc/roundf_fail.c @@ -28,4 +28,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/roundl.c b/test/mathc/roundl.c index 038d65b64..0de5f04ef 100644 --- a/test/mathc/roundl.c +++ b/test/mathc/roundl.c @@ -27,4 +27,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/roundl_fail.c b/test/mathc/roundl_fail.c index 06172174c..9321c69be 100644 --- a/test/mathc/roundl_fail.c +++ b/test/mathc/roundl_fail.c @@ -27,4 +27,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/trunc.c b/test/mathc/trunc.c index 394270e1c..96e5ba89b 100644 --- a/test/mathc/trunc.c +++ b/test/mathc/trunc.c @@ -31,4 +31,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/trunc_fail.c b/test/mathc/trunc_fail.c index b9ea11a25..8a9dfb241 100644 --- a/test/mathc/trunc_fail.c +++ b/test/mathc/trunc_fail.c @@ -31,4 +31,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/truncf.c b/test/mathc/truncf.c index ffec69511..83b02f8f1 100644 --- a/test/mathc/truncf.c +++ b/test/mathc/truncf.c @@ -31,4 +31,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/truncf_fail.c b/test/mathc/truncf_fail.c index d88bcf975..692b11740 100644 --- a/test/mathc/truncf_fail.c +++ b/test/mathc/truncf_fail.c @@ -31,4 +31,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/truncl.c b/test/mathc/truncl.c index 0f80c1f6f..500d6da1b 100644 --- a/test/mathc/truncl.c +++ b/test/mathc/truncl.c @@ -30,4 +30,3 @@ int main(void) { return 0; } - diff --git a/test/mathc/truncl_fail.c b/test/mathc/truncl_fail.c index 82460dbc9..02cd824f9 100644 --- a/test/mathc/truncl_fail.c +++ b/test/mathc/truncl_fail.c @@ -30,4 +30,3 @@ int main(void) { return 0; } - diff --git a/test/memory-safety/adjacent.c b/test/memory-safety/adjacent.c index 9d64bb0af..7ea9c05a8 100644 --- a/test/memory-safety/adjacent.c +++ b/test/memory-safety/adjacent.c @@ -1,14 +1,13 @@ -#include #include "smack.h" +#include // @expect verified int main(void) { - int* a = malloc(10*sizeof(int)); - int* b = malloc(10*sizeof(int)); + int *a = malloc(10 * sizeof(int)); + int *b = malloc(10 * sizeof(int)); int c = a[9]; free(b); free(a); return c; } - diff --git a/test/memory-safety/adjacent_fail.c b/test/memory-safety/adjacent_fail.c index d31c11178..3bb2817ed 100644 --- a/test/memory-safety/adjacent_fail.c +++ b/test/memory-safety/adjacent_fail.c @@ -1,14 +1,13 @@ -#include #include "smack.h" +#include // @expect error int main(void) { - int* a = malloc(10*sizeof(int)); - int* b = malloc(10*sizeof(int)); + int *a = malloc(10 * sizeof(int)); + int *b = malloc(10 * sizeof(int)); int c = a[10]; free(b); free(a); return c; } - diff --git a/test/memory-safety/adjacent_global.c b/test/memory-safety/adjacent_global.c index d300d74ae..9dc9566e9 100644 --- a/test/memory-safety/adjacent_global.c +++ b/test/memory-safety/adjacent_global.c @@ -1,12 +1,11 @@ -#include #include "smack.h" +#include // @expect verified int x; int main(void) { - int* a = &x; + int *a = &x; int c = a[0]; return c; } - diff --git a/test/memory-safety/adjacent_global_fail.c b/test/memory-safety/adjacent_global_fail.c index b0071d05a..f557ed2c7 100644 --- a/test/memory-safety/adjacent_global_fail.c +++ b/test/memory-safety/adjacent_global_fail.c @@ -1,12 +1,11 @@ -#include #include "smack.h" +#include // @expect error int x; int main(void) { - int* a = &x; + int *a = &x; int c = a[1]; return c; } - diff --git a/test/memory-safety/array1.c b/test/memory-safety/array1.c index 3d22b1c99..01063382b 100644 --- a/test/memory-safety/array1.c +++ b/test/memory-safety/array1.c @@ -1,12 +1,11 @@ -#include #include "smack.h" +#include // @expect verified int main(void) { - int* a = malloc(10*sizeof(int)); + int *a = malloc(10 * sizeof(int)); int b = a[9]; free(a); return b; } - diff --git a/test/memory-safety/array1_fail.c b/test/memory-safety/array1_fail.c index 4128426c7..d9ecd1e9a 100644 --- a/test/memory-safety/array1_fail.c +++ b/test/memory-safety/array1_fail.c @@ -1,12 +1,11 @@ -#include #include "smack.h" +#include // @expect error int main(void) { - int* a = malloc(10*sizeof(int)); + int *a = malloc(10 * sizeof(int)); int b = a[10]; free(a); return b; } - diff --git a/test/memory-safety/array2_free_fail.c b/test/memory-safety/array2_free_fail.c index 18e3065a9..c721b990e 100644 --- a/test/memory-safety/array2_free_fail.c +++ b/test/memory-safety/array2_free_fail.c @@ -1,17 +1,14 @@ -#include #include "smack.h" +#include // @expect error -void freeMemory(int* pointer) { - free(pointer); -} +void freeMemory(int *pointer) { free(pointer); } int main(void) { - int* a = malloc(10*sizeof(int)); + int *a = malloc(10 * sizeof(int)); int b; freeMemory(a); b = a[9]; return b; } - diff --git a/test/memory-safety/array_free1.c b/test/memory-safety/array_free1.c index 50aa1022f..7bc5f2fb7 100644 --- a/test/memory-safety/array_free1.c +++ b/test/memory-safety/array_free1.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @flag --unroll=6 // @expect verified @@ -18,7 +18,7 @@ void free_array() { DATA a[MAXSIZE]; for (i = 0; i < MAXSIZE; i++) { - a[i].f = (int*)malloc(sizeof(int)); + a[i].f = (int *)malloc(sizeof(int)); *(a[i].f) = 1; a[i].x = 2; } @@ -35,4 +35,3 @@ int main() { free_array(); return 0; } - diff --git a/test/memory-safety/array_free1_fail.c b/test/memory-safety/array_free1_fail.c index 9a71a7a25..4a4f6ef46 100644 --- a/test/memory-safety/array_free1_fail.c +++ b/test/memory-safety/array_free1_fail.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @flag --unroll=6 // @expect error @@ -18,7 +18,7 @@ void free_array() { DATA a[MAXSIZE]; for (i = 0; i < MAXSIZE - 1; i++) { - a[i].f = (int*)malloc(sizeof(int)); + a[i].f = (int *)malloc(sizeof(int)); *(a[i].f) = 1; a[i].x = 2; } @@ -35,4 +35,3 @@ int main() { free_array(); return 0; } - diff --git a/test/memory-safety/array_free1_fail1.c b/test/memory-safety/array_free1_fail1.c index f02f35041..b1abc3e10 100644 --- a/test/memory-safety/array_free1_fail1.c +++ b/test/memory-safety/array_free1_fail1.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @flag --unroll=6 // @expect error @@ -18,7 +18,7 @@ void free_array() { DATA a[MAXSIZE]; for (i = 0; i < MAXSIZE; i++) { - a[i].f = (int*)malloc(sizeof(int)); + a[i].f = (int *)malloc(sizeof(int)); *(a[i].f) = 1; a[i].x = 2; } @@ -35,4 +35,3 @@ int main() { free_array(); return 0; } - diff --git a/test/memory-safety/errno_test.c b/test/memory-safety/errno_test.c new file mode 100644 index 000000000..89aa30f6d --- /dev/null +++ b/test/memory-safety/errno_test.c @@ -0,0 +1,6 @@ +#include "smack.h" +#include + +// @expect verified + +int main() { return errno; } diff --git a/test/memory-safety/global_alloc.c b/test/memory-safety/global_alloc.c index d77b87304..90d9e5708 100644 --- a/test/memory-safety/global_alloc.c +++ b/test/memory-safety/global_alloc.c @@ -6,7 +6,7 @@ int x; int main(void) { - int* a = &x; + int *a = &x; int c = a[0]; return c; } diff --git a/test/memory-safety/global_alloc_fail_free.c b/test/memory-safety/global_alloc_fail_free.c index 93589d2a1..7fe6e45d5 100644 --- a/test/memory-safety/global_alloc_fail_free.c +++ b/test/memory-safety/global_alloc_fail_free.c @@ -6,7 +6,7 @@ int x; int main(void) { - int* a = &x; + int *a = &x; int c = a[0]; free(a); return c; diff --git a/test/memory-safety/global_and_heap_alloc.c b/test/memory-safety/global_and_heap_alloc.c index 7bff4ec37..eab8100a7 100644 --- a/test/memory-safety/global_and_heap_alloc.c +++ b/test/memory-safety/global_and_heap_alloc.c @@ -6,8 +6,8 @@ int x; int main(void) { - int* a = &x; - int* b = malloc(4); + int *a = &x; + int *b = malloc(4); int c = a[0]; free(b); return c; diff --git a/test/memory-safety/global_and_heap_alloc_fail_free.c b/test/memory-safety/global_and_heap_alloc_fail_free.c index 1c90bc764..3bfcbf872 100644 --- a/test/memory-safety/global_and_heap_alloc_fail_free.c +++ b/test/memory-safety/global_and_heap_alloc_fail_free.c @@ -6,8 +6,8 @@ int x; int main(void) { - int* a = &x; - int* b = malloc(4); + int *a = &x; + int *b = malloc(4); int c = a[0]; free(b); free(a); diff --git a/test/memory-safety/global_and_heap_alloc_fail_no_free.c b/test/memory-safety/global_and_heap_alloc_fail_no_free.c index 1258294c6..a4b18b6b0 100644 --- a/test/memory-safety/global_and_heap_alloc_fail_no_free.c +++ b/test/memory-safety/global_and_heap_alloc_fail_no_free.c @@ -6,8 +6,8 @@ int x; int main(void) { - int* a = &x; - int* b = malloc(4); + int *a = &x; + int *b = malloc(4); int c = a[0]; return c; } diff --git a/test/memory-safety/malloc_nondet.c b/test/memory-safety/malloc_nondet.c index f4a2b3729..fd29f42e6 100644 --- a/test/memory-safety/malloc_nondet.c +++ b/test/memory-safety/malloc_nondet.c @@ -1,15 +1,14 @@ -#include #include "smack.h" +#include // @expect verified int main(void) { int x = __VERIFIER_nondet_int(); - char *p = (char*)malloc(x); + char *p = (char *)malloc(x); if (p != NULL) { - p[x-1] = x; + p[x - 1] = x; free(p); } return 0; } - diff --git a/test/memory-safety/malloc_nondet_fail.c b/test/memory-safety/malloc_nondet_fail.c index 7060b42fd..24fb37f76 100644 --- a/test/memory-safety/malloc_nondet_fail.c +++ b/test/memory-safety/malloc_nondet_fail.c @@ -1,15 +1,14 @@ -#include #include "smack.h" +#include // @expect error int main(void) { int x = __VERIFIER_nondet_int(); - char *p = (char*)malloc(x); + char *p = (char *)malloc(x); if (p != NULL) { p[x] = x; free(p); } return 0; } - diff --git a/test/memory-safety/null_dereference_fail.c b/test/memory-safety/null_dereference_fail.c index 385369c21..3b4ceaad5 100644 --- a/test/memory-safety/null_dereference_fail.c +++ b/test/memory-safety/null_dereference_fail.c @@ -1,11 +1,10 @@ -#include #include "smack.h" +#include // @expect error int main(void) { - int* a; + int *a; int b = a[0]; return b; } - diff --git a/test/memory-safety/simple_double_free.c b/test/memory-safety/simple_double_free.c index a5ecbb80b..11107c889 100644 --- a/test/memory-safety/simple_double_free.c +++ b/test/memory-safety/simple_double_free.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect error @@ -7,10 +7,9 @@ #define RESET 0 int main() { - int *a = (int*)malloc(MAXSIZE * sizeof(int)); + int *a = (int *)malloc(MAXSIZE * sizeof(int)); free(a); free(a); return 0; } - diff --git a/test/memory-safety/structure1.c b/test/memory-safety/structure1.c index 0354d8fa6..0d42dc29a 100644 --- a/test/memory-safety/structure1.c +++ b/test/memory-safety/structure1.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect verified @@ -10,9 +10,8 @@ typedef struct _strct { } strct; int main(void) { - strct* s = malloc(sizeof(strct)); - int x = s->a[11]; + strct *s = malloc(sizeof(strct)); + int x = *((int *)s + 11); free(s); return x; } - diff --git a/test/memory-safety/structure1_fail.c b/test/memory-safety/structure1_fail.c index 6d3a2a8bb..d960ff9c7 100644 --- a/test/memory-safety/structure1_fail.c +++ b/test/memory-safety/structure1_fail.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect error @@ -10,9 +10,8 @@ typedef struct _strct { } strct; int main(void) { - strct* s = malloc(sizeof(strct)); - int x = s->a[22]; + strct *s = malloc(sizeof(strct)); + int x = *((int *)s + 22); free(s); return x; } - diff --git a/test/ntdrivers-simplified/cdaudio_simpl1_false.cil.c b/test/ntdrivers-simplified/cdaudio_simpl1_false.cil.c index 12cf5cdb1..136b23ccd 100644 --- a/test/ntdrivers-simplified/cdaudio_simpl1_false.cil.c +++ b/test/ntdrivers-simplified/cdaudio_simpl1_false.cil.c @@ -6,2946 +6,3135 @@ extern char __VERIFIER_nondet_char(void); extern int __VERIFIER_nondet_int(void); extern long __VERIFIER_nondet_long(void); extern void *__VERIFIER_nondet_pointer(void); -void IofCompleteRequest(int Irp , int PriorityBoost ) ; -int __VERIFIER_nondet_int() ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -int compFptr ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -int routine ; -int myStatus ; -int pirp ; -int Executive ; -int Suspended ; -int KernelMode ; -int DeviceUsageTypePaging ; +void IofCompleteRequest(int Irp, int PriorityBoost); +int __VERIFIER_nondet_int(); +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +int compFptr; +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +int routine; +int myStatus; +int pirp; +int Executive; +int Suspended; +int KernelMode; +int DeviceUsageTypePaging; -void errorFn(void) -{ +void errorFn(void) { { - goto ERROR; - ERROR: assert(0); + goto ERROR; + ERROR: + assert(0); #line 60 - return; -} + return; + } } #line 63 "cdaudio_simpl1.cil.c" -void _BLAST_init(void) -{ +void _BLAST_init(void) { { #line 67 - UNLOADED = 0; + UNLOADED = 0; #line 68 - NP = 1; + NP = 1; #line 69 - DC = 2; + DC = 2; #line 70 - SKIP1 = 3; + SKIP1 = 3; #line 71 - SKIP2 = 4; + SKIP2 = 4; #line 72 - MPR1 = 5; + MPR1 = 5; #line 73 - MPR3 = 6; + MPR3 = 6; #line 74 - IPC = 7; + IPC = 7; #line 75 - s = UNLOADED; + s = UNLOADED; #line 76 - pended = 0; + pended = 0; #line 77 - compFptr = 0; + compFptr = 0; #line 78 - compRegistered = 0; + compRegistered = 0; #line 79 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 80 - setEventCalled = 0; + setEventCalled = 0; #line 81 - customIrp = 0; + customIrp = 0; #line 82 - return; -} + return; + } } #line 85 "cdaudio_simpl1.cil.c" -int SendSrbSynchronous(int Extension , int Srb , int Buffer , int BufferLength ) -{ int ioStatus__Status = __VERIFIER_nondet_int() ; - int ioctl ; - int event = __VERIFIER_nondet_int() ; - int irp ; - int status = __VERIFIER_nondet_int() ; - int __cil_tmp10 ; - int __cil_tmp11 ; - int __cil_tmp12 ; - int __cil_tmp13 ; - int __cil_tmp14 ; - int __cil_tmp15 ; - int __cil_tmp16 ; - int __cil_tmp17 ; - long __cil_tmp18 ; +int SendSrbSynchronous(int Extension, int Srb, int Buffer, int BufferLength) { + int ioStatus__Status = __VERIFIER_nondet_int(); + int ioctl; + int event = __VERIFIER_nondet_int(); + int irp; + int status = __VERIFIER_nondet_int(); + int __cil_tmp10; + int __cil_tmp11; + int __cil_tmp12; + int __cil_tmp13; + int __cil_tmp14; + int __cil_tmp15; + int __cil_tmp16; + int __cil_tmp17; + long __cil_tmp18; { #line 93 - irp = 0; + irp = 0; #line 94 - if (Buffer) { + if (Buffer) { #line 95 - __cil_tmp10 = 4116; + __cil_tmp10 = 4116; #line 95 - __cil_tmp11 = 49152; + __cil_tmp11 = 49152; #line 95 - __cil_tmp12 = 262144; + __cil_tmp12 = 262144; #line 95 - __cil_tmp13 = 311296; + __cil_tmp13 = 311296; #line 95 - ioctl = 315412; - } else { + ioctl = 315412; + } else { #line 97 - __cil_tmp14 = 4100; + __cil_tmp14 = 4100; #line 97 - __cil_tmp15 = 49152; + __cil_tmp15 = 49152; #line 97 - __cil_tmp16 = 262144; + __cil_tmp16 = 262144; #line 97 - __cil_tmp17 = 311296; + __cil_tmp17 = 311296; #line 97 - ioctl = 315396; - } + ioctl = 315396; + } #line 99 - if (! irp) { + if (!irp) { #line 100 - return (-1073741670); - } - { + return (-1073741670); + } + { #line 104 - __cil_tmp18 = (long )status; + __cil_tmp18 = (long)status; #line 104 - if (__cil_tmp18 == 259L) { - { + if (__cil_tmp18 == 259L) { + { #line 106 - KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); + KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); #line 107 - status = ioStatus__Status; + status = ioStatus__Status; + } + } } - } - } #line 112 - return (status); -} + return (status); + } } #line 115 "cdaudio_simpl1.cil.c" -int CdAudioSignalCompletion(int DeviceObject , int Irp , int Event ) -{ +int CdAudioSignalCompletion(int DeviceObject, int Irp, int Event) { { - { + { #line 120 - KeSetEvent(Event, 0, 0); - } + KeSetEvent(Event, 0, 0); + } #line 122 - return (-1073741802); -} + return (-1073741802); + } } #line 125 "cdaudio_simpl1.cil.c" -int CdAudioStartDevice(int DeviceObject , int Irp ) -{ int deviceExtension__Active = __VERIFIER_nondet_int() ; - int deviceExtension = __VERIFIER_nondet_int() ; - int status ; - int srb = __VERIFIER_nondet_int() ; - int srb__Cdb = __VERIFIER_nondet_int() ; - int cdb ; - int inquiryDataPtr ; - int attempt ; - int tmp ; - int deviceParameterHandle = __VERIFIER_nondet_int() ; - int keyValue ; - { +int CdAudioStartDevice(int DeviceObject, int Irp) { + int deviceExtension__Active = __VERIFIER_nondet_int(); + int deviceExtension = __VERIFIER_nondet_int(); + int status; + int srb = __VERIFIER_nondet_int(); + int srb__Cdb = __VERIFIER_nondet_int(); + int cdb; + int inquiryDataPtr; + int attempt; + int tmp; + int deviceParameterHandle = __VERIFIER_nondet_int(); + int keyValue; { + { #line 140 - status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); - } - { + status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); + } + { #line 142 #line 142 - if (status < 0) { + if (status < 0) { #line 143 - return (status); - } - } + return (status); + } + } #line 147 - if (deviceExtension__Active == 255) { + if (deviceExtension__Active == 255) { #line 148 - cdb = srb__Cdb; + cdb = srb__Cdb; #line 149 - inquiryDataPtr = 0; + inquiryDataPtr = 0; #line 150 - attempt = 0; + attempt = 0; #line 151 - if (! inquiryDataPtr) { + if (!inquiryDataPtr) { #line 152 - deviceExtension__Active = 0; + deviceExtension__Active = 0; #line 153 - return (0); - } + return (0); + } #line 157 - status = -1073741823; - { + status = -1073741823; + { #line 159 - while (1) { - while_0_continue: /* CIL Label */ ; + while (1) { + while_0_continue: /* CIL Label */; - { + { #line 161 #line 161 - if (status < 0) { + if (status < 0) { #line 162 - tmp = attempt; + tmp = attempt; #line 163 - attempt ++; + attempt++; #line 164 - if (tmp >= 4) { - goto while_0_break_1; + if (tmp >= 4) { + goto while_0_break_1; + } + } else { + goto while_0_break_1; + } + } + { +#line 173 + status = + SendSrbSynchronous(deviceExtension, srb, inquiryDataPtr, 36); + } } - } else { - goto while_0_break_1; - } + while_0_break: /* CIL Label */; } + while_0_break_1:; { -#line 173 - status = SendSrbSynchronous(deviceExtension, srb, inquiryDataPtr, 36); - } - } - while_0_break: /* CIL Label */ ; - } - while_0_break_1: ; - { #line 178 #line 178 - if (status < 0) { + if (status < 0) { #line 179 - deviceExtension__Active = 0; + deviceExtension__Active = 0; #line 180 - return (0); - } - } + return (0); + } + } #line 184 - deviceExtension__Active = 0; - } + deviceExtension__Active = 0; + } #line 188 - keyValue = deviceExtension__Active; - { + keyValue = deviceExtension__Active; + { #line 189 #line 189 - if (status < 0) { + if (status < 0) { #line 190 - return (0); - } - } - { + return (0); + } + } + { #line 194 #line 194 - if (status < 0) { - - } - } - { + if (status < 0) { + } + } + { #line 200 - ZwClose(deviceParameterHandle); - } + ZwClose(deviceParameterHandle); + } #line 202 - return (0); -} + return (0); + } } #line 205 "cdaudio_simpl1.cil.c" -int CdAudioPnp(int DeviceObject , int Irp ) -{ int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int irpSp__MinorFunction = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int irpSp__Parameters__UsageNotification__Type = __VERIFIER_nondet_int() ; - int deviceExtension__PagingPathCountEvent = __VERIFIER_nondet_int() ; - int irpSp__Parameters__UsageNotification__InPath = __VERIFIER_nondet_int() ; - int deviceExtension__PagingPathCount = __VERIFIER_nondet_int() ; - int DeviceObject__Flags ; - int irpSp ; - int status ; - int setPagable ; - int tmp ; - int tmp___0 ; +int CdAudioPnp(int DeviceObject, int Irp) { + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int irpSp__MinorFunction = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int irpSp__Parameters__UsageNotification__Type = __VERIFIER_nondet_int(); + int deviceExtension__PagingPathCountEvent = __VERIFIER_nondet_int(); + int irpSp__Parameters__UsageNotification__InPath = __VERIFIER_nondet_int(); + int deviceExtension__PagingPathCount = __VERIFIER_nondet_int(); + int DeviceObject__Flags; + int irpSp; + int status; + int setPagable; + int tmp; + int tmp___0; { #line 221 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = Irp__Tail__Overlay__CurrentStackLocation; #line 222 - status = -1073741637; + status = -1073741637; #line 223 - if (irpSp__MinorFunction == 0) { - goto switch_1_0; - } else { -#line 226 - if (irpSp__MinorFunction == 22) { - goto switch_1_22; + if (irpSp__MinorFunction == 0) { + goto switch_1_0; } else { - goto switch_1_default; +#line 226 + if (irpSp__MinorFunction == 22) { + goto switch_1_22; + } else { + goto switch_1_default; #line 231 - if (0) { - switch_1_0: - { + if (0) { + switch_1_0 : { #line 234 - status = CdAudioStartDevice(DeviceObject, Irp); + status = CdAudioStartDevice(DeviceObject, Irp); #line 235 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = status; #line 236 - myStatus = status; + myStatus = status; #line 237 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); } #line 239 - return (status); - switch_1_22: ; + return (status); + switch_1_22:; #line 241 - if (irpSp__Parameters__UsageNotification__Type != DeviceUsageTypePaging) { - { + if (irpSp__Parameters__UsageNotification__Type != + DeviceUsageTypePaging) { + { #line 243 - tmp = CdAudioSendToNextDriver(DeviceObject, Irp); - } + tmp = CdAudioSendToNextDriver(DeviceObject, Irp); + } #line 245 - return (tmp); - } - { + return (tmp); + } + { #line 250 - status = KeWaitForSingleObject(deviceExtension__PagingPathCountEvent, Executive, - KernelMode, 0, 0); + status = + KeWaitForSingleObject(deviceExtension__PagingPathCountEvent, + Executive, KernelMode, 0, 0); #line 252 - setPagable = 0; - } + setPagable = 0; + } #line 254 - if (irpSp__Parameters__UsageNotification__InPath) { + if (irpSp__Parameters__UsageNotification__InPath) { #line 255 - if (deviceExtension__PagingPathCount != 1) { - goto _L; - } - } else { - _L: + if (deviceExtension__PagingPathCount != 1) { + goto _L; + } + } else { + _L: #line 262 - if (status == status) { + if (status == status) { #line 265 - //DeviceObject__Flags |= 8192; +// DeviceObject__Flags |= 8192; #line 266 - setPagable = 1; + setPagable = 1; + } } - } - { + { #line 270 - status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); - } + status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); + } #line 272 - if (status >= 0) { + if (status >= 0) { #line 273 - if (irpSp__Parameters__UsageNotification__InPath) { - - } + if (irpSp__Parameters__UsageNotification__InPath) { + } #line 278 - if (irpSp__Parameters__UsageNotification__InPath) { + if (irpSp__Parameters__UsageNotification__InPath) { #line 279 - if (deviceExtension__PagingPathCount == 1) { + if (deviceExtension__PagingPathCount == 1) { #line 280 - //DeviceObject__Flags &= -8193; + // DeviceObject__Flags &= -8193; + } } - } - } else { + } else { #line 288 - if (setPagable == 1) { + if (setPagable == 1) { #line 289 - //DeviceObject__Flags &= -8193; +// DeviceObject__Flags &= -8193; #line 290 - setPagable = 0; + setPagable = 0; + } } - } - { + { #line 296 - KeSetEvent(deviceExtension__PagingPathCountEvent, 0, 0); + KeSetEvent(deviceExtension__PagingPathCountEvent, 0, 0); #line 297 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 299 - return (status); - goto switch_1_break; - switch_1_default: - { + return (status); + goto switch_1_break; + switch_1_default : { #line 303 - tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); + tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); } #line 305 - return (tmp___0); - } else { - switch_1_break: ; + return (tmp___0); + } else { + switch_1_break:; + } } } - } #line 312 - return (0); -} + return (0); + } } #line 315 "cdaudio_simpl1.cil.c" -int CdAudioDeviceControl(int DeviceObject , int Irp ) -{ int deviceExtension__Active = __VERIFIER_nondet_int() ; - int status ; +int CdAudioDeviceControl(int DeviceObject, int Irp) { + int deviceExtension__Active = __VERIFIER_nondet_int(); + int status; { #line 320 - if (deviceExtension__Active == 2) { - goto switch_2_2; - } else { -#line 323 - if (deviceExtension__Active == 3) { - goto switch_2_3; + if (deviceExtension__Active == 2) { + goto switch_2_2; } else { -#line 326 - if (deviceExtension__Active == 1) { - goto switch_2_1; +#line 323 + if (deviceExtension__Active == 3) { + goto switch_2_3; } else { -#line 329 - if (deviceExtension__Active == 7) { - goto switch_2_7; +#line 326 + if (deviceExtension__Active == 1) { + goto switch_2_1; } else { - goto switch_2_default; +#line 329 + if (deviceExtension__Active == 7) { + goto switch_2_7; + } else { + goto switch_2_default; #line 334 - if (0) { - switch_2_2: - { + if (0) { + switch_2_2 : { #line 337 - status = CdAudio535DeviceControl(DeviceObject, Irp); + status = CdAudio535DeviceControl(DeviceObject, Irp); } - goto switch_2_break; - switch_2_3: - { + goto switch_2_break; + switch_2_3 : { #line 342 - status = CdAudio435DeviceControl(DeviceObject, Irp); + status = CdAudio435DeviceControl(DeviceObject, Irp); } - goto switch_2_break; - switch_2_1: - { + goto switch_2_break; + switch_2_1 : { #line 347 - status = CdAudioAtapiDeviceControl(DeviceObject, Irp); + status = CdAudioAtapiDeviceControl(DeviceObject, Irp); } - goto switch_2_break; - switch_2_7: - { + goto switch_2_break; + switch_2_7 : { #line 352 - status = CdAudioHPCdrDeviceControl(DeviceObject, Irp); + status = CdAudioHPCdrDeviceControl(DeviceObject, Irp); } - goto switch_2_break; - switch_2_default: - { + goto switch_2_break; + switch_2_default : { #line 357 - deviceExtension__Active = 0; + deviceExtension__Active = 0; #line 358 - status = CdAudioSendToNextDriver(DeviceObject, Irp); + status = CdAudioSendToNextDriver(DeviceObject, Irp); + } + } else { + switch_2_break:; } - } else { - switch_2_break: ; } } } } - } #line 368 - return (status); -} + return (status); + } } #line 371 "cdaudio_simpl1.cil.c" -int CdAudioSendToNextDriver(int DeviceObject , int Irp ) -{ int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int tmp ; +int CdAudioSendToNextDriver(int DeviceObject, int Irp) { + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int tmp; { #line 378 - if (s == NP) { + if (s == NP) { #line 379 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 382 - errorFn(); + errorFn(); + } } - } - { + { #line 386 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 387 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 388 - tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); - } + tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); + } #line 390 - return (tmp); -} + return (tmp); + } } #line 393 "cdaudio_simpl1.cil.c" -int CdAudioIsPlayActive(int DeviceObject ) -{ int deviceExtension__PlayActive = __VERIFIER_nondet_int() ; - int ioStatus__Status = __VERIFIER_nondet_int() ; - int currentBuffer__Header__AudioStatus = __VERIFIER_nondet_int() ; - int irp_CdAudioIsPlayActive = __VERIFIER_nondet_int() ; - int event = __VERIFIER_nondet_int() ; - int status = __VERIFIER_nondet_int() ; - int currentBuffer = __VERIFIER_nondet_int() ; - int returnValue ; - long __cil_tmp10 ; - int __cil_tmp11 ; +int CdAudioIsPlayActive(int DeviceObject) { + int deviceExtension__PlayActive = __VERIFIER_nondet_int(); + int ioStatus__Status = __VERIFIER_nondet_int(); + int currentBuffer__Header__AudioStatus = __VERIFIER_nondet_int(); + int irp_CdAudioIsPlayActive = __VERIFIER_nondet_int(); + int event = __VERIFIER_nondet_int(); + int status = __VERIFIER_nondet_int(); + int currentBuffer = __VERIFIER_nondet_int(); + int returnValue; + long __cil_tmp10; + int __cil_tmp11; { #line 404 - if (! deviceExtension__PlayActive) { + if (!deviceExtension__PlayActive) { #line 405 - return (0); - } + return (0); + } #line 409 - if (currentBuffer == 0) { + if (currentBuffer == 0) { #line 410 - return (0); - } + return (0); + } #line 414 - if (irp_CdAudioIsPlayActive == 0) { + if (irp_CdAudioIsPlayActive == 0) { #line 415 - return (0); - } - { + return (0); + } + { #line 419 - __cil_tmp10 = (long )status; + __cil_tmp10 = (long)status; #line 419 - if (__cil_tmp10 == 259L) { - { + if (__cil_tmp10 == 259L) { + { #line 421 - KeWaitForSingleObject(event, Suspended, KernelMode, 0, 0); + KeWaitForSingleObject(event, Suspended, KernelMode, 0, 0); #line 422 - status = ioStatus__Status; + status = ioStatus__Status; + } + } } - } - } - { + { #line 427 #line 427 - if (status < 0) { + if (status < 0) { #line 428 - return (0); - } - } + return (0); + } + } #line 432 - if (currentBuffer__Header__AudioStatus == 17) { + if (currentBuffer__Header__AudioStatus == 17) { #line 433 - returnValue = 1; - } else { + returnValue = 1; + } else { #line 435 - returnValue = 0; + returnValue = 0; #line 436 - deviceExtension__PlayActive = 0; - } + deviceExtension__PlayActive = 0; + } #line 438 - return (returnValue); -} + return (returnValue); + } } #line 441 "cdaudio_simpl1.cil.c" -int CdAudio535DeviceControl(int DeviceObject , int Irp ) -{ int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int() ; - int srb__Cdb = __VERIFIER_nondet_int() ; - int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Information ; - int currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength = __VERIFIER_nondet_int() ; - int currentIrpStack__Parameters__DeviceIoControl__InputBufferLength = __VERIFIER_nondet_int() ; - int srb__CdbLength ; - int cdb__CDB10__OperationCode ; - int srb__TimeOutValue ; - int sizeof__READ_CAPACITY_DATA = __VERIFIER_nondet_int() ; - int lastSession__LogicalBlockAddress = __VERIFIER_nondet_int() ; - int cdaudioDataOut__FirstTrack = __VERIFIER_nondet_int() ; - int cdaudioDataOut__LastTrack = __VERIFIER_nondet_int() ; - int sizeof__CDROM_TOC = __VERIFIER_nondet_int() ; - int sizeof__SUB_Q_CURRENT_POSITION = __VERIFIER_nondet_int() ; - int userPtr__Format = __VERIFIER_nondet_int() ; - int sizeof__CDROM_PLAY_AUDIO_MSF = __VERIFIER_nondet_int() ; - int inputBuffer__StartingM = __VERIFIER_nondet_int() ; - int inputBuffer__EndingM = __VERIFIER_nondet_int() ; - int inputBuffer__StartingS = __VERIFIER_nondet_int() ; - int inputBuffer__EndingS = __VERIFIER_nondet_int() ; - int inputBuffer__StartingF = __VERIFIER_nondet_int() ; - int inputBuffer__EndingF = __VERIFIER_nondet_int() ; - int cdb__PLAY_AUDIO_MSF__OperationCode = __VERIFIER_nondet_int() ; - int sizeof__CDROM_SEEK_AUDIO_MSF = __VERIFIER_nondet_int() ; - int currentIrpStack ; - int deviceExtension ; - int cdaudioDataOut ; - int srb = __VERIFIER_nondet_int() ; - int lastSession = __VERIFIER_nondet_int() ; - int cdb ; - int status ; - int i = __VERIFIER_nondet_int() ; - int bytesTransfered = __VERIFIER_nondet_int() ; - int Toc = __VERIFIER_nondet_int() ; - int tmp ; - int tmp___0 ; - int tmp___1 ; - int tmp___2 ; - int tmp___3 ; - int tmp___4 ; - int tracksToReturn ; - int tracksOnCd ; - int tracksInBuffer ; - int userPtr ; - int SubQPtr = __VERIFIER_nondet_int() ; - int tmp___5 ; - int tmp___6 ; - int inputBuffer ; - int inputBuffer___0 ; - int tmp___7 ; - int tmp___8 ; - int __cil_tmp58 ; - int __cil_tmp59 ; - int __cil_tmp60 ; - int __cil_tmp61 ; - int __cil_tmp62 ; - int __cil_tmp63 ; - int __cil_tmp64 ; - int __cil_tmp65 ; - int __cil_tmp66 ; - int __cil_tmp67 ; - int __cil_tmp68 ; - int __cil_tmp69 ; - int __cil_tmp70 ; - int __cil_tmp71 ; - int __cil_tmp72 ; - int __cil_tmp73 ; - int __cil_tmp74 ; - int __cil_tmp75 ; - int __cil_tmp76 ; - int __cil_tmp77 ; - int __cil_tmp78 ; - int __cil_tmp79 ; - int __cil_tmp80 ; - int __cil_tmp81 ; - int __cil_tmp82 ; - int __cil_tmp83 ; - int __cil_tmp84 ; - int __cil_tmp85 ; - int __cil_tmp86 ; - int __cil_tmp87 ; - int __cil_tmp88 ; - int __cil_tmp89 ; - int __cil_tmp90 ; - int __cil_tmp91 ; - int __cil_tmp92 ; - int __cil_tmp93 ; - int __cil_tmp94 ; - int __cil_tmp95 ; - int __cil_tmp96 ; - int __cil_tmp97 ; - int __cil_tmp98 ; - int __cil_tmp99 ; - int __cil_tmp100 ; - int __cil_tmp101 ; - int __cil_tmp102 ; - int __cil_tmp103 ; - int __cil_tmp104 ; - int __cil_tmp105 ; - int __cil_tmp106 ; - unsigned long __cil_tmp107 ; - unsigned long __cil_tmp108 ; - int __cil_tmp109 ; - int __cil_tmp110 ; +int CdAudio535DeviceControl(int DeviceObject, int Irp) { + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int(); + int srb__Cdb = __VERIFIER_nondet_int(); + int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = + __VERIFIER_nondet_int(); + int Irp__IoStatus__Information; + int currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength = + __VERIFIER_nondet_int(); + int currentIrpStack__Parameters__DeviceIoControl__InputBufferLength = + __VERIFIER_nondet_int(); + int srb__CdbLength; + int cdb__CDB10__OperationCode; + int srb__TimeOutValue; + int sizeof__READ_CAPACITY_DATA = __VERIFIER_nondet_int(); + int lastSession__LogicalBlockAddress = __VERIFIER_nondet_int(); + int cdaudioDataOut__FirstTrack = __VERIFIER_nondet_int(); + int cdaudioDataOut__LastTrack = __VERIFIER_nondet_int(); + int sizeof__CDROM_TOC = __VERIFIER_nondet_int(); + int sizeof__SUB_Q_CURRENT_POSITION = __VERIFIER_nondet_int(); + int userPtr__Format = __VERIFIER_nondet_int(); + int sizeof__CDROM_PLAY_AUDIO_MSF = __VERIFIER_nondet_int(); + int inputBuffer__StartingM = __VERIFIER_nondet_int(); + int inputBuffer__EndingM = __VERIFIER_nondet_int(); + int inputBuffer__StartingS = __VERIFIER_nondet_int(); + int inputBuffer__EndingS = __VERIFIER_nondet_int(); + int inputBuffer__StartingF = __VERIFIER_nondet_int(); + int inputBuffer__EndingF = __VERIFIER_nondet_int(); + int cdb__PLAY_AUDIO_MSF__OperationCode = __VERIFIER_nondet_int(); + int sizeof__CDROM_SEEK_AUDIO_MSF = __VERIFIER_nondet_int(); + int currentIrpStack; + int deviceExtension; + int cdaudioDataOut; + int srb = __VERIFIER_nondet_int(); + int lastSession = __VERIFIER_nondet_int(); + int cdb; + int status; + int i = __VERIFIER_nondet_int(); + int bytesTransfered = __VERIFIER_nondet_int(); + int Toc = __VERIFIER_nondet_int(); + int tmp; + int tmp___0; + int tmp___1; + int tmp___2; + int tmp___3; + int tmp___4; + int tracksToReturn; + int tracksOnCd; + int tracksInBuffer; + int userPtr; + int SubQPtr = __VERIFIER_nondet_int(); + int tmp___5; + int tmp___6; + int inputBuffer; + int inputBuffer___0; + int tmp___7; + int tmp___8; + int __cil_tmp58; + int __cil_tmp59; + int __cil_tmp60; + int __cil_tmp61; + int __cil_tmp62; + int __cil_tmp63; + int __cil_tmp64; + int __cil_tmp65; + int __cil_tmp66; + int __cil_tmp67; + int __cil_tmp68; + int __cil_tmp69; + int __cil_tmp70; + int __cil_tmp71; + int __cil_tmp72; + int __cil_tmp73; + int __cil_tmp74; + int __cil_tmp75; + int __cil_tmp76; + int __cil_tmp77; + int __cil_tmp78; + int __cil_tmp79; + int __cil_tmp80; + int __cil_tmp81; + int __cil_tmp82; + int __cil_tmp83; + int __cil_tmp84; + int __cil_tmp85; + int __cil_tmp86; + int __cil_tmp87; + int __cil_tmp88; + int __cil_tmp89; + int __cil_tmp90; + int __cil_tmp91; + int __cil_tmp92; + int __cil_tmp93; + int __cil_tmp94; + int __cil_tmp95; + int __cil_tmp96; + int __cil_tmp97; + int __cil_tmp98; + int __cil_tmp99; + int __cil_tmp100; + int __cil_tmp101; + int __cil_tmp102; + int __cil_tmp103; + int __cil_tmp104; + int __cil_tmp105; + int __cil_tmp106; + unsigned long __cil_tmp107; + unsigned long __cil_tmp108; + int __cil_tmp109; + int __cil_tmp110; { #line 499 - currentIrpStack = Irp__Tail__Overlay__CurrentStackLocation; + currentIrpStack = Irp__Tail__Overlay__CurrentStackLocation; #line 500 - deviceExtension = DeviceObject__DeviceExtension; + deviceExtension = DeviceObject__DeviceExtension; #line 501 - cdaudioDataOut = Irp__AssociatedIrp__SystemBuffer; + cdaudioDataOut = Irp__AssociatedIrp__SystemBuffer; #line 502 - cdb = srb__Cdb; - { + cdb = srb__Cdb; + { #line 503 - __cil_tmp58 = 56; + __cil_tmp58 = 56; #line 503 - __cil_tmp59 = 16384; + __cil_tmp59 = 16384; #line 503 - __cil_tmp60 = 131072; + __cil_tmp60 = 131072; #line 503 - __cil_tmp61 = 147456; + __cil_tmp61 = 147456; #line 503 - __cil_tmp62 = 147512; + __cil_tmp62 = 147512; #line 503 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp62) { - goto switch_3_exp_0; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp62) { + goto switch_3_exp_0; + } else { + { #line 506 - __cil_tmp63 = 16384; + __cil_tmp63 = 16384; #line 506 - __cil_tmp64 = 131072; + __cil_tmp64 = 131072; #line 506 - __cil_tmp65 = 147456; + __cil_tmp65 = 147456; #line 506 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp65) { - goto switch_3_exp_1; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp65) { + goto switch_3_exp_1; + } else { + { #line 509 - __cil_tmp66 = 44; + __cil_tmp66 = 44; #line 509 - __cil_tmp67 = 16384; + __cil_tmp67 = 16384; #line 509 - __cil_tmp68 = 131072; + __cil_tmp68 = 131072; #line 509 - __cil_tmp69 = 147456; + __cil_tmp69 = 147456; #line 509 - __cil_tmp70 = 147500; + __cil_tmp70 = 147500; #line 509 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp70) { - goto switch_3_exp_2; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp70) { + goto switch_3_exp_2; + } else { + { #line 512 - __cil_tmp71 = 24; + __cil_tmp71 = 24; #line 512 - __cil_tmp72 = 16384; + __cil_tmp72 = 16384; #line 512 - __cil_tmp73 = 131072; + __cil_tmp73 = 131072; #line 512 - __cil_tmp74 = 147456; + __cil_tmp74 = 147456; #line 512 - __cil_tmp75 = 147480; + __cil_tmp75 = 147480; #line 512 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp75) { - goto switch_3_exp_3; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp75) { + goto switch_3_exp_3; + } else { + { #line 515 - __cil_tmp76 = 4; + __cil_tmp76 = 4; #line 515 - __cil_tmp77 = 16384; + __cil_tmp77 = 16384; #line 515 - __cil_tmp78 = 131072; + __cil_tmp78 = 131072; #line 515 - __cil_tmp79 = 147456; + __cil_tmp79 = 147456; #line 515 - __cil_tmp80 = 147460; + __cil_tmp80 = 147460; #line 515 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp80) { - goto switch_3_exp_4; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp80) { + goto switch_3_exp_4; + } else { + { #line 518 - __cil_tmp81 = 2056; + __cil_tmp81 = 2056; #line 518 - __cil_tmp82 = 16384; + __cil_tmp82 = 16384; #line 518 - __cil_tmp83 = 131072; + __cil_tmp83 = 131072; #line 518 - __cil_tmp84 = 147456; + __cil_tmp84 = 147456; #line 518 - __cil_tmp85 = 149512; + __cil_tmp85 = 149512; #line 518 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp85) { - goto switch_3_exp_5; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp85) { + goto switch_3_exp_5; + } else { + { #line 521 - __cil_tmp86 = 52; + __cil_tmp86 = 52; #line 521 - __cil_tmp87 = 16384; + __cil_tmp87 = 16384; #line 521 - __cil_tmp88 = 131072; + __cil_tmp88 = 131072; #line 521 - __cil_tmp89 = 147456; + __cil_tmp89 = 147456; #line 521 - __cil_tmp90 = 147508; + __cil_tmp90 = 147508; #line 521 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp90) { - goto switch_3_exp_6; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp90) { + goto switch_3_exp_6; + } else { + { #line 524 - __cil_tmp91 = 20; + __cil_tmp91 = 20; #line 524 - __cil_tmp92 = 16384; + __cil_tmp92 = 16384; #line 524 - __cil_tmp93 = 131072; + __cil_tmp93 = 131072; #line 524 - __cil_tmp94 = 147456; + __cil_tmp94 = 147456; #line 524 - __cil_tmp95 = 147476; + __cil_tmp95 = 147476; #line 524 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp95) { - goto switch_3_exp_7; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp95) { + goto switch_3_exp_7; + } else { + { #line 527 - __cil_tmp96 = 40; + __cil_tmp96 = 40; #line 527 - __cil_tmp97 = 16384; + __cil_tmp97 = 16384; #line 527 - __cil_tmp98 = 131072; + __cil_tmp98 = 131072; #line 527 - __cil_tmp99 = 147456; + __cil_tmp99 = 147456; #line 527 - __cil_tmp100 = 147496; + __cil_tmp100 = 147496; #line 527 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp100) { - goto switch_3_exp_8; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp100) { + goto switch_3_exp_8; + } else { + { #line 530 - __cil_tmp101 = 2048; + __cil_tmp101 = 2048; #line 530 - __cil_tmp102 = 16384; + __cil_tmp102 = 16384; #line 530 - __cil_tmp103 = 131072; + __cil_tmp103 = 131072; #line 530 - __cil_tmp104 = 147456; + __cil_tmp104 = 147456; #line 530 - __cil_tmp105 = 149504; + __cil_tmp105 = 149504; #line 530 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp105) { - goto switch_3_exp_9; - } else { - goto switch_3_default; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp105) { + goto switch_3_exp_9; + } else { + goto switch_3_default; #line 535 - if (0) { - switch_3_exp_0: - { + if (0) { + switch_3_exp_0 : { #line 538 - tmp = CdAudioIsPlayActive(DeviceObject); - } + tmp = CdAudioIsPlayActive( + DeviceObject); + } #line 540 - if (tmp) { + if (tmp) { #line 541 - status = -2147483631; + status = -2147483631; #line 542 - Irp__IoStatus__Information = 0; - goto switch_3_break; - } + Irp__IoStatus__Information = 0; + goto switch_3_break; + } #line 547 - if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength) { + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength) { #line 548 - status = -1073741789; + status = -1073741789; #line 549 - Irp__IoStatus__Information = 0; - goto switch_3_break; - } + Irp__IoStatus__Information = 0; + goto switch_3_break; + } #line 554 - if (lastSession == 0) { - { + if (lastSession == 0) { + { #line 556 - status = -1073741670; + status = -1073741670; #line 557 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 558 - tmp___0 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___0 = AG_SetStatusAndReturn( + status, Irp, + deviceExtension__TargetDeviceObject); + } #line 560 - return (tmp___0); - } - { + return (tmp___0); + } + { #line 565 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 566 - cdb__CDB10__OperationCode = 38; + cdb__CDB10__OperationCode = 38; #line 567 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 568 - status = SendSrbSynchronous(deviceExtension, srb, lastSession, + status = SendSrbSynchronous( + deviceExtension, srb, + lastSession, sizeof__READ_CAPACITY_DATA); - } - { + } + { #line 571 #line 571 - if (status < 0) { - { + if (status < 0) { + { #line 573 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 574 - tmp___1 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___1 = AG_SetStatusAndReturn( + status, Irp, + deviceExtension__TargetDeviceObject); + } #line 576 - return (tmp___1); - } else { + return (tmp___1); + } else { #line 578 - status = 0; - } - } + status = 0; + } + } #line 580 - Irp__IoStatus__Information = bytesTransfered; + Irp__IoStatus__Information = + bytesTransfered; #line 581 - if (lastSession__LogicalBlockAddress == 0) { - goto switch_3_break; - } + if (lastSession__LogicalBlockAddress == + 0) { + goto switch_3_break; + } #line 586 - cdaudioDataOut__FirstTrack = 1; + cdaudioDataOut__FirstTrack = 1; #line 587 - cdaudioDataOut__LastTrack = 2; - goto switch_3_break; - switch_3_exp_1: ; + cdaudioDataOut__LastTrack = 2; + goto switch_3_break; + switch_3_exp_1:; #line 590 - if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength) { + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength) { #line 591 - status = -1073741789; + status = -1073741789; #line 592 - Irp__IoStatus__Information = 0; - goto switch_3_break; - } - { + Irp__IoStatus__Information = 0; + goto switch_3_break; + } + { #line 598 - tmp___2 = CdAudioIsPlayActive(DeviceObject); - } + tmp___2 = CdAudioIsPlayActive( + DeviceObject); + } #line 600 - if (tmp___2) { + if (tmp___2) { #line 601 - status = -2147483631; + status = -2147483631; #line 602 - Irp__IoStatus__Information = 0; - goto switch_3_break; - } + Irp__IoStatus__Information = 0; + goto switch_3_break; + } #line 607 - if (Toc == 0) { - { + if (Toc == 0) { + { #line 609 - status = -1073741670; + status = -1073741670; #line 610 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 611 - tmp___3 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___3 = AG_SetStatusAndReturn( + status, Irp, + deviceExtension__TargetDeviceObject); + } #line 613 - return (tmp___3); - } - { + return (tmp___3); + } + { #line 618 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 619 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 620 - status = SendSrbSynchronous(deviceExtension, srb, Toc, sizeof__CDROM_TOC); - } + status = SendSrbSynchronous( + deviceExtension, srb, Toc, + sizeof__CDROM_TOC); + } #line 622 - if (status >= 0) { - { + if (status >= 0) { + { #line 623 - __cil_tmp107 = (unsigned long )status; + __cil_tmp107 = + (unsigned long)status; #line 623 - if (__cil_tmp107 != -1073741764) { + if (__cil_tmp107 != + -1073741764) { #line 624 - status = 0; - } else { - goto _L; - } - } - } else { - _L: - { + status = 0; + } else { + goto _L; + } + } + } else { + _L : { #line 630 - __cil_tmp108 = (unsigned long )status; + __cil_tmp108 = + (unsigned long)status; #line 630 - if (__cil_tmp108 != -1073741764) { - { + if (__cil_tmp108 != + -1073741764) { + { #line 632 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 633 - tmp___4 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___4 = AG_SetStatusAndReturn( + status, Irp, + deviceExtension__TargetDeviceObject); + } #line 635 - return (tmp___4); - } - } - } + return (tmp___4); + } + } + } #line 640 - __cil_tmp109 = cdaudioDataOut__LastTrack - cdaudioDataOut__FirstTrack; + __cil_tmp109 = + cdaudioDataOut__LastTrack - + cdaudioDataOut__FirstTrack; #line 640 - tracksOnCd = __cil_tmp109 + 1; + tracksOnCd = __cil_tmp109 + 1; #line 641 - tracksInBuffer = currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength; + tracksInBuffer = + currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength; #line 642 - if (tracksInBuffer < tracksOnCd) { + if (tracksInBuffer < tracksOnCd) { #line 643 - tracksToReturn = tracksInBuffer; - } else { + tracksToReturn = tracksInBuffer; + } else { #line 645 - tracksToReturn = tracksOnCd; - } + tracksToReturn = tracksOnCd; + } #line 647 - if (tracksInBuffer > tracksOnCd) { + if (tracksInBuffer > tracksOnCd) { #line 648 - i ++; - } - goto switch_3_break; - switch_3_exp_2: + i++; + } + goto switch_3_break; + switch_3_exp_2: #line 654 - userPtr = Irp__AssociatedIrp__SystemBuffer; + userPtr = + Irp__AssociatedIrp__SystemBuffer; #line 655 - if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < sizeof__SUB_Q_CURRENT_POSITION) { + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < + sizeof__SUB_Q_CURRENT_POSITION) { #line 656 - status = -1073741789; + status = -1073741789; #line 657 - Irp__IoStatus__Information = 0; - goto switch_3_break; - } + Irp__IoStatus__Information = 0; + goto switch_3_break; + } #line 662 - if (SubQPtr == 0) { - { + if (SubQPtr == 0) { + { #line 664 - status = -1073741670; + status = -1073741670; #line 665 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 666 - tmp___5 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___5 = AG_SetStatusAndReturn( + status, Irp, + deviceExtension__TargetDeviceObject); + } #line 668 - return (tmp___5); - } + return (tmp___5); + } #line 672 - if (userPtr__Format != 1) { - { + if (userPtr__Format != 1) { + { #line 674 - status = -1073741823; + status = -1073741823; #line 675 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 676 - tmp___6 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___6 = AG_SetStatusAndReturn( + status, Irp, + deviceExtension__TargetDeviceObject); + } #line 678 - return (tmp___6); - } - { + return (tmp___6); + } + { #line 683 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 684 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 685 - status = SendSrbSynchronous(deviceExtension, srb, SubQPtr, + status = SendSrbSynchronous( + deviceExtension, srb, + SubQPtr, sizeof__SUB_Q_CURRENT_POSITION); - } + } #line 688 - if (status >= 0) { + if (status >= 0) { #line 689 - Irp__IoStatus__Information = sizeof__SUB_Q_CURRENT_POSITION; - } else { + Irp__IoStatus__Information = + sizeof__SUB_Q_CURRENT_POSITION; + } else { #line 691 - Irp__IoStatus__Information = 0; - } - goto switch_3_break; - switch_3_exp_3: + Irp__IoStatus__Information = 0; + } + goto switch_3_break; + switch_3_exp_3: #line 695 - inputBuffer = Irp__AssociatedIrp__SystemBuffer; + inputBuffer = + Irp__AssociatedIrp__SystemBuffer; #line 696 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 697 - if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CDROM_PLAY_AUDIO_MSF) { + if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < + sizeof__CDROM_PLAY_AUDIO_MSF) { #line 698 - status = -1073741820; - goto switch_3_break; - } + status = -1073741820; + goto switch_3_break; + } #line 703 - if (inputBuffer__StartingM == inputBuffer__EndingM) { + if (inputBuffer__StartingM == + inputBuffer__EndingM) { #line 704 - if (inputBuffer__StartingS == inputBuffer__EndingS) { + if (inputBuffer__StartingS == + inputBuffer__EndingS) { #line 705 - if (inputBuffer__StartingF == inputBuffer__EndingF) { - - } - } - } - { + if (inputBuffer__StartingF == + inputBuffer__EndingF) { + } + } + } + { #line 717 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 718 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 719 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } + status = SendSrbSynchronous( + deviceExtension, srb, 0, 0); + } #line 721 - if (status >= 0) { + if (status >= 0) { #line 722 - if (cdb__PLAY_AUDIO_MSF__OperationCode == 71) { - - } - } - goto switch_3_break; - switch_3_exp_4: + if (cdb__PLAY_AUDIO_MSF__OperationCode == + 71) { + } + } + goto switch_3_break; + switch_3_exp_4: #line 732 - inputBuffer___0 = Irp__AssociatedIrp__SystemBuffer; + inputBuffer___0 = + Irp__AssociatedIrp__SystemBuffer; #line 733 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 734 - if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CDROM_SEEK_AUDIO_MSF) { + if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < + sizeof__CDROM_SEEK_AUDIO_MSF) { #line 735 - status = -1073741820; - goto switch_3_break; - } - { + status = -1073741820; + goto switch_3_break; + } + { #line 741 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 742 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 743 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } - { + status = SendSrbSynchronous( + deviceExtension, srb, 0, 0); + } + { #line 745 #line 745 - if (status < 0) { - - } - } - goto switch_3_break; - switch_3_exp_5: - { + if (status < 0) { + } + } + goto switch_3_break; + switch_3_exp_5 : { #line 753 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 754 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 755 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 756 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } - goto switch_3_break; - switch_3_exp_6: ; - switch_3_exp_7: ; - switch_3_exp_8: + status = SendSrbSynchronous( + deviceExtension, srb, 0, 0); + } + goto switch_3_break; + switch_3_exp_6:; + switch_3_exp_7:; + switch_3_exp_8: #line 762 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 763 - status = -1073741808; - goto switch_3_break; - switch_3_exp_9: - { + status = -1073741808; + goto switch_3_break; + switch_3_exp_9 : { #line 767 - CdAudioIsPlayActive(DeviceObject); - } - switch_3_default: - { + CdAudioIsPlayActive(DeviceObject); + } + switch_3_default : { #line 771 - tmp___7 = CdAudioSendToNextDriver(DeviceObject, Irp); - } + tmp___7 = CdAudioSendToNextDriver( + DeviceObject, Irp); + } #line 773 - return (tmp___7); - goto switch_3_break; - } else { - switch_3_break: ; + return (tmp___7); + goto switch_3_break; + } else { + switch_3_break:; + } + } + } + } + } + } + } + } + } + } + } } } - } } - } - } } } - } - } } } - } - } } } - } - } } - } - } - { + { #line 790 - tmp___8 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___8 = AG_SetStatusAndReturn(status, Irp, + deviceExtension__TargetDeviceObject); + } #line 792 - return (tmp___8); -} + return (tmp___8); + } } #line 795 "cdaudio_simpl1.cil.c" -int AG_SetStatusAndReturn(int status , int Irp , int deviceExtension__TargetDeviceObject ) -{ unsigned long __cil_tmp4 ; +int AG_SetStatusAndReturn(int status, int Irp, + int deviceExtension__TargetDeviceObject) { + unsigned long __cil_tmp4; { - { + { #line 799 - __cil_tmp4 = (unsigned long )status; + __cil_tmp4 = (unsigned long)status; #line 799 - if (__cil_tmp4 == -2147483626) { - - } - } - { + if (__cil_tmp4 == -2147483626) { + } + } + { #line 805 - myStatus = status; + myStatus = status; #line 806 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 808 - return (status); -} + return (status); + } } #line 811 "cdaudio_simpl1.cil.c" -int CdAudio435DeviceControl(int DeviceObject , int Irp ) -{ int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; - int currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength = __VERIFIER_nondet_int() ; - int currentIrpStack__Parameters__DeviceIoControl__InputBufferLength = __VERIFIER_nondet_int() ; - int TrackData__0 = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Information ; - int srb__TimeOutValue ; - int srb__CdbLength ; - int sizeof__CDROM_TOC = __VERIFIER_nondet_int() ; - int cdaudioDataOut__LastTrack = __VERIFIER_nondet_int() ; - int cdaudioDataOut__FirstTrack = __VERIFIER_nondet_int() ; - int sizeof__CDROM_PLAY_AUDIO_MSF = __VERIFIER_nondet_int() ; - int sizeof__CDROM_SEEK_AUDIO_MSF = __VERIFIER_nondet_int() ; - int deviceExtension__Paused = __VERIFIER_nondet_int() ; - int deviceExtension__PlayActive ; - int sizeof__SUB_Q_CHANNEL_DATA = __VERIFIER_nondet_int() ; - int sizeof__SUB_Q_CURRENT_POSITION = __VERIFIER_nondet_int() ; - int deviceExtension = __VERIFIER_nondet_int() ; - int srb = __VERIFIER_nondet_int() ; - int status ; - int i = __VERIFIER_nondet_int() ; - int bytesTransfered ; - int Toc = __VERIFIER_nondet_int() ; - int tmp ; - int tracksToReturn ; - int tracksOnCd ; - int tracksInBuffer ; - int SubQPtr = __VERIFIER_nondet_int() ; - int userPtr__Format = __VERIFIER_nondet_int() ; - int SubQPtr___0 = __VERIFIER_nondet_int() ; - int tmp___0 ; - int tmp___1 ; - int tmp___2 ; - int __cil_tmp35 ; - int __cil_tmp36 ; - int __cil_tmp37 ; - int __cil_tmp38 ; - int __cil_tmp39 ; - int __cil_tmp40 ; - int __cil_tmp41 ; - int __cil_tmp42 ; - int __cil_tmp43 ; - int __cil_tmp44 ; - int __cil_tmp45 ; - int __cil_tmp46 ; - int __cil_tmp47 ; - int __cil_tmp48 ; - int __cil_tmp49 ; - int __cil_tmp50 ; - int __cil_tmp51 ; - int __cil_tmp52 ; - int __cil_tmp53 ; - int __cil_tmp54 ; - int __cil_tmp55 ; - int __cil_tmp56 ; - int __cil_tmp57 ; - int __cil_tmp58 ; - int __cil_tmp59 ; - int __cil_tmp60 ; - int __cil_tmp61 ; - int __cil_tmp62 ; - int __cil_tmp63 ; - int __cil_tmp64 ; - int __cil_tmp65 ; - int __cil_tmp66 ; - int __cil_tmp67 ; - int __cil_tmp68 ; - int __cil_tmp69 ; - int __cil_tmp70 ; - int __cil_tmp71 ; - int __cil_tmp72 ; - int __cil_tmp73 ; - int __cil_tmp74 ; - int __cil_tmp75 ; - int __cil_tmp76 ; - int __cil_tmp77 ; - int __cil_tmp78 ; - int __cil_tmp79 ; - int __cil_tmp80 ; - int __cil_tmp81 ; - int __cil_tmp82 ; - int __cil_tmp83 ; - int __cil_tmp84 ; - int __cil_tmp85 ; - int __cil_tmp86 ; - int __cil_tmp87 ; - int __cil_tmp88 ; - int __cil_tmp89 ; - int __cil_tmp90 ; - int __cil_tmp91 ; - int __cil_tmp92 ; - unsigned long __cil_tmp93 ; - int __cil_tmp94 ; - unsigned long __cil_tmp95 ; - unsigned long __cil_tmp96 ; - unsigned long __cil_tmp97 ; - int __cil_tmp98 ; - int __cil_tmp99 ; - int __cil_tmp100 ; - int __cil_tmp101 ; - int __cil_tmp102 ; - int __cil_tmp103 ; - unsigned long __cil_tmp104 ; - unsigned long __cil_tmp105 ; - unsigned long __cil_tmp106 ; - unsigned long __cil_tmp107 ; - int __cil_tmp108 ; - unsigned long __cil_tmp109 ; - int __cil_tmp110 ; - unsigned long __cil_tmp111 ; - unsigned long __cil_tmp112 ; - unsigned long __cil_tmp113 ; - unsigned long __cil_tmp114 ; - unsigned long __cil_tmp115 ; - unsigned long __cil_tmp116 ; +int CdAudio435DeviceControl(int DeviceObject, int Irp) { + int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = + __VERIFIER_nondet_int(); + int currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength = + __VERIFIER_nondet_int(); + int currentIrpStack__Parameters__DeviceIoControl__InputBufferLength = + __VERIFIER_nondet_int(); + int TrackData__0 = __VERIFIER_nondet_int(); + int Irp__IoStatus__Information; + int srb__TimeOutValue; + int srb__CdbLength; + int sizeof__CDROM_TOC = __VERIFIER_nondet_int(); + int cdaudioDataOut__LastTrack = __VERIFIER_nondet_int(); + int cdaudioDataOut__FirstTrack = __VERIFIER_nondet_int(); + int sizeof__CDROM_PLAY_AUDIO_MSF = __VERIFIER_nondet_int(); + int sizeof__CDROM_SEEK_AUDIO_MSF = __VERIFIER_nondet_int(); + int deviceExtension__Paused = __VERIFIER_nondet_int(); + int deviceExtension__PlayActive; + int sizeof__SUB_Q_CHANNEL_DATA = __VERIFIER_nondet_int(); + int sizeof__SUB_Q_CURRENT_POSITION = __VERIFIER_nondet_int(); + int deviceExtension = __VERIFIER_nondet_int(); + int srb = __VERIFIER_nondet_int(); + int status; + int i = __VERIFIER_nondet_int(); + int bytesTransfered; + int Toc = __VERIFIER_nondet_int(); + int tmp; + int tracksToReturn; + int tracksOnCd; + int tracksInBuffer; + int SubQPtr = __VERIFIER_nondet_int(); + int userPtr__Format = __VERIFIER_nondet_int(); + int SubQPtr___0 = __VERIFIER_nondet_int(); + int tmp___0; + int tmp___1; + int tmp___2; + int __cil_tmp35; + int __cil_tmp36; + int __cil_tmp37; + int __cil_tmp38; + int __cil_tmp39; + int __cil_tmp40; + int __cil_tmp41; + int __cil_tmp42; + int __cil_tmp43; + int __cil_tmp44; + int __cil_tmp45; + int __cil_tmp46; + int __cil_tmp47; + int __cil_tmp48; + int __cil_tmp49; + int __cil_tmp50; + int __cil_tmp51; + int __cil_tmp52; + int __cil_tmp53; + int __cil_tmp54; + int __cil_tmp55; + int __cil_tmp56; + int __cil_tmp57; + int __cil_tmp58; + int __cil_tmp59; + int __cil_tmp60; + int __cil_tmp61; + int __cil_tmp62; + int __cil_tmp63; + int __cil_tmp64; + int __cil_tmp65; + int __cil_tmp66; + int __cil_tmp67; + int __cil_tmp68; + int __cil_tmp69; + int __cil_tmp70; + int __cil_tmp71; + int __cil_tmp72; + int __cil_tmp73; + int __cil_tmp74; + int __cil_tmp75; + int __cil_tmp76; + int __cil_tmp77; + int __cil_tmp78; + int __cil_tmp79; + int __cil_tmp80; + int __cil_tmp81; + int __cil_tmp82; + int __cil_tmp83; + int __cil_tmp84; + int __cil_tmp85; + int __cil_tmp86; + int __cil_tmp87; + int __cil_tmp88; + int __cil_tmp89; + int __cil_tmp90; + int __cil_tmp91; + int __cil_tmp92; + unsigned long __cil_tmp93; + int __cil_tmp94; + unsigned long __cil_tmp95; + unsigned long __cil_tmp96; + unsigned long __cil_tmp97; + int __cil_tmp98; + int __cil_tmp99; + int __cil_tmp100; + int __cil_tmp101; + int __cil_tmp102; + int __cil_tmp103; + unsigned long __cil_tmp104; + unsigned long __cil_tmp105; + unsigned long __cil_tmp106; + unsigned long __cil_tmp107; + int __cil_tmp108; + unsigned long __cil_tmp109; + int __cil_tmp110; + unsigned long __cil_tmp111; + unsigned long __cil_tmp112; + unsigned long __cil_tmp113; + unsigned long __cil_tmp114; + unsigned long __cil_tmp115; + unsigned long __cil_tmp116; { - { + { #line 846 - __cil_tmp35 = 16384; + __cil_tmp35 = 16384; #line 846 - __cil_tmp36 = 131072; + __cil_tmp36 = 131072; #line 846 - __cil_tmp37 = 147456; + __cil_tmp37 = 147456; #line 846 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp37) { - goto switch_4_exp_10; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp37) { + goto switch_4_exp_10; + } else { + { #line 849 - __cil_tmp38 = 24; + __cil_tmp38 = 24; #line 849 - __cil_tmp39 = 16384; + __cil_tmp39 = 16384; #line 849 - __cil_tmp40 = 131072; + __cil_tmp40 = 131072; #line 849 - __cil_tmp41 = 147456; + __cil_tmp41 = 147456; #line 849 - __cil_tmp42 = 147480; + __cil_tmp42 = 147480; #line 849 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp42) { - goto switch_4_exp_11; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp42) { + goto switch_4_exp_11; + } else { + { #line 852 - __cil_tmp43 = 8; + __cil_tmp43 = 8; #line 852 - __cil_tmp44 = 16384; + __cil_tmp44 = 16384; #line 852 - __cil_tmp45 = 131072; + __cil_tmp45 = 131072; #line 852 - __cil_tmp46 = 147456; + __cil_tmp46 = 147456; #line 852 - __cil_tmp47 = 147464; + __cil_tmp47 = 147464; #line 852 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp47) { - goto switch_4_exp_12; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp47) { + goto switch_4_exp_12; + } else { + { #line 855 - __cil_tmp48 = 4; + __cil_tmp48 = 4; #line 855 - __cil_tmp49 = 16384; + __cil_tmp49 = 16384; #line 855 - __cil_tmp50 = 131072; + __cil_tmp50 = 131072; #line 855 - __cil_tmp51 = 147456; + __cil_tmp51 = 147456; #line 855 - __cil_tmp52 = 147460; + __cil_tmp52 = 147460; #line 855 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp52) { - goto switch_4_exp_13; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp52) { + goto switch_4_exp_13; + } else { + { #line 858 - __cil_tmp53 = 12; + __cil_tmp53 = 12; #line 858 - __cil_tmp54 = 16384; + __cil_tmp54 = 16384; #line 858 - __cil_tmp55 = 131072; + __cil_tmp55 = 131072; #line 858 - __cil_tmp56 = 147456; + __cil_tmp56 = 147456; #line 858 - __cil_tmp57 = 147468; + __cil_tmp57 = 147468; #line 858 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp57) { - goto switch_4_exp_14; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp57) { + goto switch_4_exp_14; + } else { + { #line 861 - __cil_tmp58 = 16; + __cil_tmp58 = 16; #line 861 - __cil_tmp59 = 16384; + __cil_tmp59 = 16384; #line 861 - __cil_tmp60 = 131072; + __cil_tmp60 = 131072; #line 861 - __cil_tmp61 = 147456; + __cil_tmp61 = 147456; #line 861 - __cil_tmp62 = 147472; + __cil_tmp62 = 147472; #line 861 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp62) { - goto switch_4_exp_15; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp62) { + goto switch_4_exp_15; + } else { + { #line 864 - __cil_tmp63 = 44; + __cil_tmp63 = 44; #line 864 - __cil_tmp64 = 16384; + __cil_tmp64 = 16384; #line 864 - __cil_tmp65 = 131072; + __cil_tmp65 = 131072; #line 864 - __cil_tmp66 = 147456; + __cil_tmp66 = 147456; #line 864 - __cil_tmp67 = 147500; + __cil_tmp67 = 147500; #line 864 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp67) { - goto switch_4_exp_16; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp67) { + goto switch_4_exp_16; + } else { + { #line 867 - __cil_tmp68 = 2056; + __cil_tmp68 = 2056; #line 867 - __cil_tmp69 = 16384; + __cil_tmp69 = 16384; #line 867 - __cil_tmp70 = 131072; + __cil_tmp70 = 131072; #line 867 - __cil_tmp71 = 147456; + __cil_tmp71 = 147456; #line 867 - __cil_tmp72 = 149512; + __cil_tmp72 = 149512; #line 867 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp72) { - goto switch_4_exp_17; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp72) { + goto switch_4_exp_17; + } else { + { #line 870 - __cil_tmp73 = 52; + __cil_tmp73 = 52; #line 870 - __cil_tmp74 = 16384; + __cil_tmp74 = 16384; #line 870 - __cil_tmp75 = 131072; + __cil_tmp75 = 131072; #line 870 - __cil_tmp76 = 147456; + __cil_tmp76 = 147456; #line 870 - __cil_tmp77 = 147508; + __cil_tmp77 = 147508; #line 870 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp77) { - goto switch_4_exp_18; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp77) { + goto switch_4_exp_18; + } else { + { #line 873 - __cil_tmp78 = 20; + __cil_tmp78 = 20; #line 873 - __cil_tmp79 = 16384; + __cil_tmp79 = 16384; #line 873 - __cil_tmp80 = 131072; + __cil_tmp80 = 131072; #line 873 - __cil_tmp81 = 147456; + __cil_tmp81 = 147456; #line 873 - __cil_tmp82 = 147476; + __cil_tmp82 = 147476; #line 873 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp82) { - goto switch_4_exp_19; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp82) { + goto switch_4_exp_19; + } else { + { #line 876 - __cil_tmp83 = 40; + __cil_tmp83 = 40; #line 876 - __cil_tmp84 = 16384; + __cil_tmp84 = 16384; #line 876 - __cil_tmp85 = 131072; + __cil_tmp85 = 131072; #line 876 - __cil_tmp86 = 147456; + __cil_tmp86 = 147456; #line 876 - __cil_tmp87 = 147496; + __cil_tmp87 = 147496; #line 876 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp87) { - goto switch_4_exp_20; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp87) { + goto switch_4_exp_20; + } else { + { #line 879 - __cil_tmp88 = 2048; + __cil_tmp88 = 2048; #line 879 - __cil_tmp89 = 16384; + __cil_tmp89 = 16384; #line 879 - __cil_tmp90 = 131072; + __cil_tmp90 = 131072; #line 879 - __cil_tmp91 = 147456; + __cil_tmp91 = 147456; #line 879 - __cil_tmp92 = 149504; + __cil_tmp92 = 149504; #line 879 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp92) { - goto switch_4_exp_21; - } else { - goto switch_4_default; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp92) { + goto switch_4_exp_21; + } else { + goto switch_4_default; #line 884 - if (0) { - switch_4_exp_10: ; + if (0) { + switch_4_exp_10:; #line 886 - if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < TrackData__0) { + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < + TrackData__0) { #line 887 - status = -1073741789; + status = -1073741789; #line 888 - Irp__IoStatus__Information = 0; - goto switch_4_break; - } - { + Irp__IoStatus__Information = + 0; + goto switch_4_break; + } + { #line 894 - tmp = CdAudioIsPlayActive(DeviceObject); - } + tmp = + CdAudioIsPlayActive( + DeviceObject); + } #line 896 - if (tmp) { + if (tmp) { #line 897 - status = -2147483631; + status = -2147483631; #line 898 - Irp__IoStatus__Information = 0; - goto switch_4_break; - } + Irp__IoStatus__Information = + 0; + goto switch_4_break; + } #line 903 - if (Toc == 0) { + if (Toc == 0) { #line 904 - status = -1073741670; + status = -1073741670; #line 905 - Irp__IoStatus__Information = 0; - { + Irp__IoStatus__Information = + 0; + { #line 906 - __cil_tmp93 = (unsigned long )status; + __cil_tmp93 = + (unsigned long) + status; #line 906 - if (__cil_tmp93 == -2147483626) { + if (__cil_tmp93 == + -2147483626) { #line 907 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 912 - myStatus = status; + myStatus = status; #line 913 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 915 - return (status); - } - { + return (status); + } + { #line 920 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 921 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 922 - status = SendSrbSynchronous(deviceExtension, srb, Toc, - sizeof__CDROM_TOC); - } - { + status = + SendSrbSynchronous( + deviceExtension, + srb, Toc, + sizeof__CDROM_TOC); + } + { #line 925 #line 925 - if (status < 0) { - { + if (status < 0) { + { #line 926 - __cil_tmp95 = (unsigned long )status; + __cil_tmp95 = + (unsigned long) + status; #line 926 - if (__cil_tmp95 != -1073741764) { - { + if (__cil_tmp95 != + -1073741764) { + { #line 927 - __cil_tmp96 = (unsigned long )status; + __cil_tmp96 = + (unsigned long) + status; #line 927 - if (__cil_tmp96 != -1073741764) { - { + if (__cil_tmp96 != + -1073741764) { + { #line 928 - __cil_tmp97 = (unsigned long )status; + __cil_tmp97 = + (unsigned long) + status; #line 928 - if (__cil_tmp97 == -2147483626) { + if (__cil_tmp97 == + -2147483626) { #line 929 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 934 - myStatus = status; + myStatus = + status; #line 935 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 937 - return (status); - } - } - } else { + return ( + status); + } + } + } else { #line 942 - status = 0; - } - } - } else { + status = 0; + } + } + } else { #line 945 - status = 0; - } - } + status = 0; + } + } #line 947 - if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength > sizeof__CDROM_TOC) { + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength > + sizeof__CDROM_TOC) { #line 948 - bytesTransfered = sizeof__CDROM_TOC; - } else { + bytesTransfered = + sizeof__CDROM_TOC; + } else { #line 950 - bytesTransfered = currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength; - } + bytesTransfered = + currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength; + } #line 952 - __cil_tmp98 = cdaudioDataOut__LastTrack - cdaudioDataOut__FirstTrack; + __cil_tmp98 = + cdaudioDataOut__LastTrack - + cdaudioDataOut__FirstTrack; #line 952 - tracksOnCd = __cil_tmp98 + 1; + tracksOnCd = + __cil_tmp98 + 1; #line 953 - tracksInBuffer = currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength - TrackData__0; + tracksInBuffer = + currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength - + TrackData__0; #line 954 - if (tracksInBuffer < tracksOnCd) { + if (tracksInBuffer < + tracksOnCd) { #line 955 - tracksToReturn = tracksInBuffer; - } else { + tracksToReturn = + tracksInBuffer; + } else { #line 957 - tracksToReturn = tracksOnCd; - } + tracksToReturn = + tracksOnCd; + } #line 959 - if (tracksInBuffer > tracksOnCd) { + if (tracksInBuffer > + tracksOnCd) { #line 960 - i ++; - } - goto switch_4_break; - switch_4_exp_11: ; - switch_4_exp_12: - { + i++; + } + goto switch_4_break; + switch_4_exp_11:; + switch_4_exp_12 : { #line 968 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 969 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 970 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 971 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } + status = + SendSrbSynchronous( + deviceExtension, + srb, 0, 0); + } #line 973 - if (status >= 0) { - - } - { + if (status >= 0) { + } + { #line 978 - __cil_tmp99 = 8; + __cil_tmp99 = 8; #line 978 - __cil_tmp100 = 16384; + __cil_tmp100 = 16384; #line 978 - __cil_tmp101 = 131072; + __cil_tmp101 = 131072; #line 978 - __cil_tmp102 = 147456; + __cil_tmp102 = 147456; #line 978 - __cil_tmp103 = 147464; + __cil_tmp103 = 147464; #line 978 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp103) { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp103) { + { #line 979 - __cil_tmp104 = (unsigned long )status; + __cil_tmp104 = + (unsigned long) + status; #line 979 - if (__cil_tmp104 == -2147483626) { + if (__cil_tmp104 == + -2147483626) { #line 980 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 985 - myStatus = status; + myStatus = status; #line 986 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 988 - return (status); - } - } + return (status); + } + } #line 992 - if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CDROM_PLAY_AUDIO_MSF) { + if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < + sizeof__CDROM_PLAY_AUDIO_MSF) { #line 993 - status = -1073741820; - goto switch_4_break; - } - { + status = -1073741820; + goto switch_4_break; + } + { #line 999 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1000 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1001 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } + status = + SendSrbSynchronous( + deviceExtension, + srb, 0, 0); + } #line 1003 - if (status >= 0) { - - } - goto switch_4_break; - switch_4_exp_13: + if (status >= 0) { + } + goto switch_4_break; + switch_4_exp_13: #line 1010 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 1011 - if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CDROM_SEEK_AUDIO_MSF) { + if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < + sizeof__CDROM_SEEK_AUDIO_MSF) { #line 1012 - status = -1073741820; - goto switch_4_break; - } - { + status = -1073741820; + goto switch_4_break; + } + { #line 1018 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1019 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1020 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } + status = + SendSrbSynchronous( + deviceExtension, + srb, 0, 0); + } #line 1022 - if (status < 0) { - { + if (status < 0) { + { #line 1025 - __cil_tmp105 = (unsigned long )status; + __cil_tmp105 = + (unsigned long) + status; #line 1025 - if (__cil_tmp105 == -1073741808) { + if (__cil_tmp105 == + -1073741808) { #line 1026 - status = -1073741803; - } - } - } - goto switch_4_break; - switch_4_exp_14: + status = + -1073741803; + } + } + } + goto switch_4_break; + switch_4_exp_14: #line 1033 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 1034 - if (SubQPtr == 0) { + if (SubQPtr == 0) { #line 1035 - status = -1073741670; - { + status = -1073741670; + { #line 1036 - __cil_tmp106 = (unsigned long )status; + __cil_tmp106 = + (unsigned long) + status; #line 1036 - if (__cil_tmp106 == -2147483626) { + if (__cil_tmp106 == + -2147483626) { #line 1037 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1042 - myStatus = status; + myStatus = status; #line 1043 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1045 - return (status); - } + return (status); + } #line 1049 - if (deviceExtension__Paused == 1) { + if (deviceExtension__Paused == + 1) { #line 1050 - status = 0; - { + status = 0; + { #line 1051 - __cil_tmp107 = (unsigned long )status; + __cil_tmp107 = + (unsigned long) + status; #line 1051 - if (__cil_tmp107 == -2147483626) { + if (__cil_tmp107 == + -2147483626) { #line 1052 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1057 - myStatus = status; + myStatus = status; #line 1058 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1060 - return (status); - } - { + return (status); + } + { #line 1065 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1066 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1067 - status = SendSrbSynchronous(deviceExtension, srb, SubQPtr, - sizeof__SUB_Q_CHANNEL_DATA); - } - { + status = SendSrbSynchronous( + deviceExtension, + srb, SubQPtr, + sizeof__SUB_Q_CHANNEL_DATA); + } + { #line 1070 #line 1070 - if (status < 0) { - { + if (status < 0) { + { #line 1071 - __cil_tmp109 = (unsigned long )status; + __cil_tmp109 = + (unsigned long) + status; #line 1071 - if (__cil_tmp109 == -2147483626) { + if (__cil_tmp109 == + -2147483626) { #line 1072 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1077 - myStatus = status; + myStatus = status; #line 1078 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1080 - return (status); - } - } - { + return (status); + } + } + { #line 1085 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1086 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1087 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } - { + status = + SendSrbSynchronous( + deviceExtension, + srb, 0, 0); + } + { #line 1089 #line 1089 - if (status < 0) { - { + if (status < 0) { + { #line 1090 - __cil_tmp111 = (unsigned long )status; + __cil_tmp111 = + (unsigned long) + status; #line 1090 - if (__cil_tmp111 == -2147483626) { + if (__cil_tmp111 == + -2147483626) { #line 1091 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1096 - myStatus = status; + myStatus = status; #line 1097 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1099 - return (status); - } - } - goto switch_4_break; - switch_4_exp_15: + return (status); + } + } + goto switch_4_break; + switch_4_exp_15: #line 1105 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 1106 - if (deviceExtension__Paused == 0) { + if (deviceExtension__Paused == + 0) { #line 1107 - status = -1073741823; - { + status = -1073741823; + { #line 1108 - __cil_tmp112 = (unsigned long )status; + __cil_tmp112 = + (unsigned long) + status; #line 1108 - if (__cil_tmp112 == -2147483626) { + if (__cil_tmp112 == + -2147483626) { #line 1109 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1114 - myStatus = status; + myStatus = status; #line 1115 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1117 - return (status); - } - { + return (status); + } + { #line 1122 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1123 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1124 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } + status = + SendSrbSynchronous( + deviceExtension, + srb, 0, 0); + } #line 1126 - if (status >= 0) { + if (status >= 0) { #line 1127 - deviceExtension__PlayActive = 1; + deviceExtension__PlayActive = + 1; #line 1128 - deviceExtension__Paused = 0; - } - goto switch_4_break; - switch_4_exp_16: ; + deviceExtension__Paused = + 0; + } + goto switch_4_break; + switch_4_exp_16:; #line 1134 - if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < sizeof__SUB_Q_CURRENT_POSITION) { + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < + sizeof__SUB_Q_CURRENT_POSITION) { #line 1135 - status = -1073741789; + status = -1073741789; #line 1136 - Irp__IoStatus__Information = 0; - goto switch_4_break; - } + Irp__IoStatus__Information = + 0; + goto switch_4_break; + } #line 1141 - if (SubQPtr___0 == 0) { + if (SubQPtr___0 == 0) { #line 1142 - status = -1073741670; + status = -1073741670; #line 1143 - Irp__IoStatus__Information = 0; - { + Irp__IoStatus__Information = + 0; + { #line 1144 - __cil_tmp113 = (unsigned long )status; + __cil_tmp113 = + (unsigned long) + status; #line 1144 - if (__cil_tmp113 == -2147483626) { + if (__cil_tmp113 == + -2147483626) { #line 1145 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1150 - myStatus = status; + myStatus = status; #line 1151 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1153 - return (status); - } + return (status); + } #line 1157 - if (userPtr__Format != 1) { + if (userPtr__Format != + 1) { #line 1158 - status = -1073741823; + status = -1073741823; #line 1159 - Irp__IoStatus__Information = 0; - { + Irp__IoStatus__Information = + 0; + { #line 1160 - __cil_tmp114 = (unsigned long )status; + __cil_tmp114 = + (unsigned long) + status; #line 1160 - if (__cil_tmp114 == -2147483626) { + if (__cil_tmp114 == + -2147483626) { #line 1161 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1166 - myStatus = status; + myStatus = status; #line 1167 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1169 - return (status); - } - { + return (status); + } + { #line 1174 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1175 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1176 - status = SendSrbSynchronous(deviceExtension, srb, SubQPtr___0, - sizeof__SUB_Q_CHANNEL_DATA); - } + status = SendSrbSynchronous( + deviceExtension, + srb, SubQPtr___0, + sizeof__SUB_Q_CHANNEL_DATA); + } #line 1179 - if (status >= 0) { + if (status >= 0) { #line 1180 - if (deviceExtension__Paused == 1) { + if (deviceExtension__Paused == + 1) { #line 1181 - deviceExtension__PlayActive = 0; - } + deviceExtension__PlayActive = + 0; + } #line 1185 - Irp__IoStatus__Information = sizeof__SUB_Q_CURRENT_POSITION; - } else { + Irp__IoStatus__Information = + sizeof__SUB_Q_CURRENT_POSITION; + } else { #line 1187 - Irp__IoStatus__Information = 0; - } - goto switch_4_break; - switch_4_exp_17: - { + Irp__IoStatus__Information = + 0; + } + goto switch_4_break; + switch_4_exp_17 : { #line 1192 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 1193 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1194 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1195 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } - goto switch_4_break; - switch_4_exp_18: ; - switch_4_exp_19: ; - switch_4_exp_20: + status = + SendSrbSynchronous( + deviceExtension, + srb, 0, 0); + } + goto switch_4_break; + switch_4_exp_18:; + switch_4_exp_19:; + switch_4_exp_20: #line 1201 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 1202 - status = -1073741808; - goto switch_4_break; - switch_4_exp_21: - { + status = -1073741808; + goto switch_4_break; + switch_4_exp_21 : { #line 1206 - tmp___1 = CdAudioIsPlayActive(DeviceObject); - } + tmp___1 = + CdAudioIsPlayActive( + DeviceObject); + } #line 1208 - if (tmp___1 == 1) { + if (tmp___1 == 1) { #line 1209 - deviceExtension__PlayActive = 1; + deviceExtension__PlayActive = + 1; #line 1210 - status = 0; + status = 0; #line 1211 - Irp__IoStatus__Information = 0; - { + Irp__IoStatus__Information = + 0; + { #line 1212 - __cil_tmp115 = (unsigned long )status; + __cil_tmp115 = + (unsigned long) + status; #line 1212 - if (__cil_tmp115 == -2147483626) { + if (__cil_tmp115 == + -2147483626) { #line 1213 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1218 - myStatus = status; + myStatus = status; #line 1219 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1221 - return (status); - } else { - { + return (status); + } else { + { #line 1224 - deviceExtension__PlayActive = 0; + deviceExtension__PlayActive = + 0; #line 1225 - tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); - } + tmp___0 = + CdAudioSendToNextDriver( + DeviceObject, + Irp); + } #line 1227 - return (tmp___0); - } - goto switch_4_break; - switch_4_default: - { + return (tmp___0); + } + goto switch_4_break; + switch_4_default : { #line 1232 - tmp___2 = CdAudioSendToNextDriver(DeviceObject, Irp); - } + tmp___2 = + CdAudioSendToNextDriver( + DeviceObject, + Irp); + } #line 1234 - return (tmp___2); - goto switch_4_break; - } else { - switch_4_break: ; + return (tmp___2); + goto switch_4_break; + } else { + switch_4_break:; + } + } + } + } + } + } + } + } + } + } + } + } + } } } - } - } } } - } - } } } - } - } } } - } - } } } - } - } } } - } - } - } - { + { #line 1252 - __cil_tmp116 = (unsigned long )status; + __cil_tmp116 = (unsigned long)status; #line 1252 - if (__cil_tmp116 == -2147483626) { + if (__cil_tmp116 == -2147483626) { #line 1253 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = 0; + } + } + { #line 1258 - myStatus = status; + myStatus = status; #line 1259 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 1261 - return (status); -} + return (status); + } } #line 1264 "cdaudio_simpl1.cil.c" -int CdAudioAtapiDeviceControl(int DeviceObject , int Irp ) -{ int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Information ; - int deviceExtension__PlayActive ; - int srb__CdbLength ; - int srb__TimeOutValue ; - int Irp__IoStatus__Status ; - int status ; - int deviceExtension = __VERIFIER_nondet_int() ; - int srb = __VERIFIER_nondet_int() ; - int tmp ; - int __cil_tmp13 ; - int __cil_tmp14 ; - int __cil_tmp15 ; - int __cil_tmp16 ; - int __cil_tmp17 ; - int __cil_tmp18 ; +int CdAudioAtapiDeviceControl(int DeviceObject, int Irp) { + int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = + __VERIFIER_nondet_int(); + int Irp__IoStatus__Information; + int deviceExtension__PlayActive; + int srb__CdbLength; + int srb__TimeOutValue; + int Irp__IoStatus__Status; + int status; + int deviceExtension = __VERIFIER_nondet_int(); + int srb = __VERIFIER_nondet_int(); + int tmp; + int __cil_tmp13; + int __cil_tmp14; + int __cil_tmp15; + int __cil_tmp16; + int __cil_tmp17; + int __cil_tmp18; { - { + { #line 1277 - __cil_tmp13 = 8; + __cil_tmp13 = 8; #line 1277 - __cil_tmp14 = 16384; + __cil_tmp14 = 16384; #line 1277 - __cil_tmp15 = 131072; + __cil_tmp15 = 131072; #line 1277 - __cil_tmp16 = 147456; + __cil_tmp16 = 147456; #line 1277 - __cil_tmp17 = 147464; + __cil_tmp17 = 147464; #line 1277 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp17) { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp17) { + { #line 1279 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 1280 - deviceExtension__PlayActive = 0; + deviceExtension__PlayActive = 0; #line 1281 - srb__CdbLength = 12; + srb__CdbLength = 12; #line 1282 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1283 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } - { + status = SendSrbSynchronous(deviceExtension, srb, 0, 0); + } + { #line 1285 #line 1285 - if (status < 0) { - { + if (status < 0) { + { #line 1287 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = status; #line 1288 - myStatus = status; + myStatus = status; #line 1289 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 1291 - return (status); - } - } - } else { - { + return (status); + } + } + } else { + { #line 1297 - tmp = CdAudioSendToNextDriver(DeviceObject, Irp); - } + tmp = CdAudioSendToNextDriver(DeviceObject, Irp); + } #line 1299 - return (tmp); - } - } - { + return (tmp); + } + } + { #line 1302 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = status; #line 1303 - myStatus = status; + myStatus = status; #line 1304 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 1306 - return (status); -} + return (status); + } } #line 1309 "cdaudio_simpl1.cil.c" -void HpCdrProcessLastSession(int Toc ) -{ int index = __VERIFIER_nondet_int() ; +void HpCdrProcessLastSession(int Toc) { + int index = __VERIFIER_nondet_int(); { #line 1313 - if (index) { + if (index) { #line 1314 - index --; - } + index--; + } #line 1318 - return; -} + return; + } } #line 1321 "cdaudio_simpl1.cil.c" -int HPCdrCompletion(int DeviceObject , int Irp , int Context ) -{ int Irp__PendingReturned = __VERIFIER_nondet_int() ; - int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int() ; +int HPCdrCompletion(int DeviceObject, int Irp, int Context) { + int Irp__PendingReturned = __VERIFIER_nondet_int(); + int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int(); { #line 1326 - if (Irp__PendingReturned) { + if (Irp__PendingReturned) { #line 1327 - if (pended == 0) { + if (pended == 0) { #line 1328 - pended = 1; - } else { - { + pended = 1; + } else { + { #line 1331 - errorFn(); + errorFn(); + } } } - } #line 1337 - if (myStatus >= 0) { - { + if (myStatus >= 0) { + { #line 1339 - HpCdrProcessLastSession(Irp__AssociatedIrp__SystemBuffer); + HpCdrProcessLastSession(Irp__AssociatedIrp__SystemBuffer); + } } - } #line 1344 - return (myStatus); -} + return (myStatus); + } } #line 1347 "cdaudio_simpl1.cil.c" -int CdAudioHPCdrDeviceControl(int DeviceObject , int Irp ) -{ int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int irpSp__Control ; - int tmp ; - int tmp___0 ; - int __cil_tmp8 ; - int __cil_tmp9 ; - int __cil_tmp10 ; - int __cil_tmp11 ; - int __cil_tmp12 ; +int CdAudioHPCdrDeviceControl(int DeviceObject, int Irp) { + int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = + __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int irpSp__Control; + int tmp; + int tmp___0; + int __cil_tmp8; + int __cil_tmp9; + int __cil_tmp10; + int __cil_tmp11; + int __cil_tmp12; { - { + { #line 1355 - __cil_tmp8 = 56; + __cil_tmp8 = 56; #line 1355 - __cil_tmp9 = 16384; + __cil_tmp9 = 16384; #line 1355 - __cil_tmp10 = 131072; + __cil_tmp10 = 131072; #line 1355 - __cil_tmp11 = 147456; + __cil_tmp11 = 147456; #line 1355 - __cil_tmp12 = 147512; + __cil_tmp12 = 147512; #line 1355 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp12) { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp12) { #line 1356 - if (s != NP) { - { + if (s != NP) { + { #line 1358 - errorFn(); - } - } else { + errorFn(); + } + } else { #line 1361 - if (compRegistered != 0) { - { + if (compRegistered != 0) { + { #line 1363 - errorFn(); - } - } else { + errorFn(); + } + } else { #line 1366 - compRegistered = 1; + compRegistered = 1; #line 1367 - routine = 0; - } - } - { + routine = 0; + } + } + { #line 1371 - irpSp__Control = 224; + irpSp__Control = 224; #line 1375 - tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); - } + tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); + } #line 1377 - return (tmp); - } else { - { + return (tmp); + } else { + { #line 1380 - tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); - } + tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); + } #line 1382 - return (tmp___0); - } - } + return (tmp___0); + } + } #line 1384 - return (-1073741823); -} + return (-1073741823); + } } #line 1387 "cdaudio_simpl1.cil.c" -int CdAudioForwardIrpSynchronous(int DeviceObject , int Irp ) -{ int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int event = __VERIFIER_nondet_int() ; - int status ; - int irpSp__Control ; +int CdAudioForwardIrpSynchronous(int DeviceObject, int Irp) { + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int event = __VERIFIER_nondet_int(); + int status; + int irpSp__Control; { #line 1394 - if (s != NP) { - { -#line 1396 - errorFn(); - } - } else { -#line 1399 - if (compRegistered != 0) { + if (s != NP) { { -#line 1401 - errorFn(); +#line 1396 + errorFn(); } } else { +#line 1399 + if (compRegistered != 0) { + { +#line 1401 + errorFn(); + } + } else { #line 1404 - compRegistered = 1; + compRegistered = 1; #line 1405 - routine = 1; + routine = 1; + } } - } - { + { #line 1409 - irpSp__Control = 224; + irpSp__Control = 224; #line 1413 - status = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); + status = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); #line 1414 - status = 259; - } + status = 259; + } #line 1416 - if (status) { - { + if (status) { + { #line 1418 - KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); + KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); #line 1419 - status = myStatus; + status = myStatus; + } } - } #line 1424 - return (status); -} + return (status); + } } #line 1427 "cdaudio_simpl1.cil.c" -void CdAudioUnload(int DriverObject ) -{ +void CdAudioUnload(int DriverObject) { { #line 1431 - return; -} + return; + } } #line 1434 "cdaudio_simpl1.cil.c" -int CdAudioPower(int DeviceObject , int Irp ) -{ int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int tmp ; +int CdAudioPower(int DeviceObject, int Irp) { + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int tmp; { #line 1441 - if (s == NP) { + if (s == NP) { #line 1442 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 1445 - errorFn(); + errorFn(); + } } - } - { + { #line 1449 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 1450 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 1451 - tmp = PoCallDriver(deviceExtension__TargetDeviceObject, Irp); - } + tmp = PoCallDriver(deviceExtension__TargetDeviceObject, Irp); + } #line 1453 - return (tmp); -} + return (tmp); + } } #line 1456 "cdaudio_simpl1.cil.c" -void stub_driver_init(void) -{ +void stub_driver_init(void) { { #line 1460 - s = NP; + s = NP; #line 1461 - customIrp = 0; + customIrp = 0; #line 1462 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 1463 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 1464 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 1465 - compFptr = compRegistered; + compFptr = compRegistered; #line 1466 - pended = compFptr; + pended = compFptr; #line 1467 - return; -} + return; + } } #line 1470 "cdaudio_simpl1.cil.c" -int main(void) -{ int pirp__IoStatus__Status ; - int d = __VERIFIER_nondet_int() ; - int status = __VERIFIER_nondet_int() ; - int irp = __VERIFIER_nondet_int() ; - int we_should_unload = __VERIFIER_nondet_int() ; - int irp_choice = __VERIFIER_nondet_int() ; - int devobj = __VERIFIER_nondet_int() ; - int __cil_tmp9 ; +int main(void) { + int pirp__IoStatus__Status; + int d = __VERIFIER_nondet_int(); + int status = __VERIFIER_nondet_int(); + int irp = __VERIFIER_nondet_int(); + int we_should_unload = __VERIFIER_nondet_int(); + int irp_choice = __VERIFIER_nondet_int(); + int devobj = __VERIFIER_nondet_int(); + int __cil_tmp9; { - { - - s = 0; - UNLOADED = 0; - NP = 0; - DC = 0; - SKIP1 = 0; - SKIP2 = 0; - MPR1 = 0; - MPR3 = 0; - IPC = 0; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - routine = 0; - myStatus = 0; - pirp = 0; - Executive = 0; - Suspended = 5; - KernelMode = 0; - DeviceUsageTypePaging = 1; + { + s = 0; + UNLOADED = 0; + NP = 0; + DC = 0; + SKIP1 = 0; + SKIP2 = 0; + MPR1 = 0; + MPR3 = 0; + IPC = 0; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + routine = 0; + myStatus = 0; + pirp = 0; + Executive = 0; + Suspended = 5; + KernelMode = 0; + DeviceUsageTypePaging = 1; #line 1482 - pirp = irp; + pirp = irp; #line 1483 - _BLAST_init(); - } + _BLAST_init(); + } #line 1485 - if (status >= 0) { + if (status >= 0) { #line 1486 - s = NP; + s = NP; #line 1487 - customIrp = 0; + customIrp = 0; #line 1488 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 1489 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 1490 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 1491 - compFptr = compRegistered; + compFptr = compRegistered; #line 1492 - pended = compFptr; + pended = compFptr; #line 1493 - pirp__IoStatus__Status = 0; + pirp__IoStatus__Status = 0; #line 1494 - myStatus = 0; + myStatus = 0; #line 1495 - if (irp_choice == 0) { + if (irp_choice == 0) { #line 1496 - pirp__IoStatus__Status = -1073741637; + pirp__IoStatus__Status = -1073741637; #line 1497 - myStatus = -1073741637; - } - { + myStatus = -1073741637; + } + { #line 1502 - stub_driver_init(); - } - { + stub_driver_init(); + } + { #line 1504 #line 1504 - if (status < 0) { + if (status < 0) { #line 1505 - return (-1); - } - } + return (-1); + } + } #line 1509 - int tmp_ndt_1; - tmp_ndt_1 = __VERIFIER_nondet_int(); - if (tmp_ndt_1 == 2) { - goto switch_5_2; - } else { -#line 1512 - int tmp_ndt_2; - tmp_ndt_2 = __VERIFIER_nondet_int(); - if (tmp_ndt_2 == 3) { - goto switch_5_3; + int tmp_ndt_1; + tmp_ndt_1 = __VERIFIER_nondet_int(); + if (tmp_ndt_1 == 2) { + goto switch_5_2; } else { -#line 1515 - int tmp_ndt_3; - tmp_ndt_3 = __VERIFIER_nondet_int(); - if (tmp_ndt_3 == 4) { - goto switch_5_4; +#line 1512 + int tmp_ndt_2; + tmp_ndt_2 = __VERIFIER_nondet_int(); + if (tmp_ndt_2 == 3) { + goto switch_5_3; } else { - goto switch_5_default; +#line 1515 + int tmp_ndt_3; + tmp_ndt_3 = __VERIFIER_nondet_int(); + if (tmp_ndt_3 == 4) { + goto switch_5_4; + } else { + goto switch_5_default; #line 1520 - if (0) { - switch_5_2: - { + if (0) { + switch_5_2 : { #line 1523 - status = CdAudioDeviceControl(devobj, pirp); + status = CdAudioDeviceControl(devobj, pirp); } - goto switch_5_break; - switch_5_3: - { + goto switch_5_break; + switch_5_3 : { #line 1528 - status = CdAudioPnp(devobj, pirp); + status = CdAudioPnp(devobj, pirp); } - goto switch_5_break; - switch_5_4: - { + goto switch_5_break; + switch_5_4 : { #line 1533 - status = CdAudioPower(devobj, pirp); + status = CdAudioPower(devobj, pirp); } - goto switch_5_break; - switch_5_default: ; + goto switch_5_break; + switch_5_default:; #line 1537 - return (-1); - } else { - switch_5_break: ; + return (-1); + } else { + switch_5_break:; + } } } } - } #line 1545 - if (we_should_unload) { - { + if (we_should_unload) { + { #line 1547 - CdAudioUnload(d); + CdAudioUnload(d); + } } } - } #line 1555 - if (pended == 1) { + if (pended == 1) { #line 1556 - if (s == NP) { + if (s == NP) { #line 1557 - s = NP; + s = NP; + } else { + goto _L___2; + } } else { - goto _L___2; - } - } else { - _L___2: + _L___2: #line 1563 - if (pended == 1) { + if (pended == 1) { #line 1564 - if (s == MPR3) { + if (s == MPR3) { #line 1565 - s = MPR3; + s = MPR3; + } else { + goto _L___1; + } } else { - goto _L___1; - } - } else { - _L___1: + _L___1: #line 1571 - if (s != UNLOADED) { + if (s != UNLOADED) { #line 1574 - if (status != -1) { + if (status != -1) { #line 1577 - if (s != SKIP2) { + if (s != SKIP2) { #line 1578 - if (s != IPC) { + if (s != IPC) { #line 1579 - if (s != DC) { - { + if (s != DC) { + { #line 1581 - errorFn(); + errorFn(); + } + } else { + goto _L___0; } } else { goto _L___0; } } else { - goto _L___0; - } - } else { - _L___0: + _L___0: #line 1591 - if (pended != 1) { + if (pended != 1) { #line 1594 - if (s == DC) { + if (s == DC) { #line 1595 - if (status == 259) { - errorFn(); - } - } else { + if (status == 259) { + errorFn(); + } + } else { #line 1603 - if (status != lowerDriverReturn) { - errorFn(); - } - } - } - else { - if (status != 259) { - { - errorFn(); + if (status != lowerDriverReturn) { + errorFn(); + } } } else { - + if (status != 259) { + { errorFn(); } + } else { + } } } } } } } - } #line 1617 - return (status); -} + return (status); + } } #line 1620 "cdaudio_simpl1.cil.c" -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { #line 1624 - if (s == NP) { + if (s == NP) { #line 1625 - s = MPR1; - } else { - { + s = MPR1; + } else { + { #line 1628 - errorFn(); + errorFn(); + } } - } #line 1631 - return; -} + return; + } } #line 1634 "cdaudio_simpl1.cil.c" -int IofCallDriver(int DeviceObject , int Irp ) -{ int Irp__PendingReturned = __VERIFIER_nondet_int() ; - int returnVal2 ; - int compRetStatus ; - int lcontext = __VERIFIER_nondet_int() ; - unsigned long __cil_tmp8 ; +int IofCallDriver(int DeviceObject, int Irp) { + int Irp__PendingReturned = __VERIFIER_nondet_int(); + int returnVal2; + int compRetStatus; + int lcontext = __VERIFIER_nondet_int(); + unsigned long __cil_tmp8; { #line 1642 - if (compRegistered) { + if (compRegistered) { #line 1643 - if (routine == 0) { - { + if (routine == 0) { + { #line 1645 - compRetStatus = HPCdrCompletion(DeviceObject, Irp, lcontext); - } - } else { + compRetStatus = HPCdrCompletion(DeviceObject, Irp, lcontext); + } + } else { #line 1648 - if (routine == 1) { - { + if (routine == 1) { + { #line 1650 - compRetStatus = CdAudioSignalCompletion(DeviceObject, Irp, lcontext); + compRetStatus = + CdAudioSignalCompletion(DeviceObject, Irp, lcontext); + } } } - } - { + { #line 1656 - __cil_tmp8 = (unsigned long )compRetStatus; + __cil_tmp8 = (unsigned long)compRetStatus; #line 1656 - if (__cil_tmp8 == -1073741802) { - { + if (__cil_tmp8 == -1073741802) { + { #line 1658 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 1666 - if (Irp__PendingReturned) { + if (Irp__PendingReturned) { #line 1667 - returnVal2 = 259; - } else { -#line 1669 - int tmp_ndt_4; - tmp_ndt_4 = __VERIFIER_nondet_int(); - if (tmp_ndt_4 == 0) { - goto switch_6_0; + returnVal2 = 259; } else { -#line 1672 - int tmp_ndt_5; - tmp_ndt_5 = __VERIFIER_nondet_int(); - if (tmp_ndt_5 == 1) { - goto switch_6_1; +#line 1669 + int tmp_ndt_4; + tmp_ndt_4 = __VERIFIER_nondet_int(); + if (tmp_ndt_4 == 0) { + goto switch_6_0; } else { - goto switch_6_default; +#line 1672 + int tmp_ndt_5; + tmp_ndt_5 = __VERIFIER_nondet_int(); + if (tmp_ndt_5 == 1) { + goto switch_6_1; + } else { + goto switch_6_default; #line 1677 - if (0) { - switch_6_0: + if (0) { + switch_6_0: #line 1679 - returnVal2 = 0; - goto switch_6_break; - switch_6_1: + returnVal2 = 0; + goto switch_6_break; + switch_6_1: #line 1682 - returnVal2 = -1073741823; - goto switch_6_break; - switch_6_default: + returnVal2 = -1073741823; + goto switch_6_break; + switch_6_default: #line 1685 - returnVal2 = 259; - goto switch_6_break; - } else { - switch_6_break: ; + returnVal2 = 259; + goto switch_6_break; + } else { + switch_6_break:; + } } } } - } #line 1694 - if (s == NP) { + if (s == NP) { #line 1695 - s = IPC; + s = IPC; #line 1696 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 1698 - if (s == MPR1) { + if (s == MPR1) { #line 1699 - if (returnVal2 == 259) { + if (returnVal2 == 259) { #line 1700 - s = MPR3; + s = MPR3; #line 1701 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 1703 - s = NP; + s = NP; #line 1704 - lowerDriverReturn = returnVal2; - } - } else { + lowerDriverReturn = returnVal2; + } + } else { #line 1707 - if (s == SKIP1) { + if (s == SKIP1) { #line 1708 - s = SKIP2; + s = SKIP2; #line 1709 - lowerDriverReturn = returnVal2; - } else { - { + lowerDriverReturn = returnVal2; + } else { + { #line 1712 - errorFn(); + errorFn(); + } } } } - } #line 1717 - return (returnVal2); -} + return (returnVal2); + } } #line 1720 "cdaudio_simpl1.cil.c" -void IofCompleteRequest(int Irp , int PriorityBoost ) -{ +void IofCompleteRequest(int Irp, int PriorityBoost) { { #line 1724 - if (s == NP) { + if (s == NP) { #line 1725 - s = DC; - } else { - { + s = DC; + } else { + { #line 1728 - errorFn(); + errorFn(); + } } - } #line 1731 - return; -} + return; + } } #line 1734 "cdaudio_simpl1.cil.c" -int KeSetEvent(int Event , int Increment , int Wait ) -{ int l = __VERIFIER_nondet_int() ; +int KeSetEvent(int Event, int Increment, int Wait) { + int l = __VERIFIER_nondet_int(); { #line 1738 - setEventCalled = 1; + setEventCalled = 1; #line 1739 - return (l); -} + return (l); + } } #line 1742 "cdaudio_simpl1.cil.c" -int KeWaitForSingleObject(int Object , int WaitReason , int WaitMode , int Alertable , - int Timeout ) -{ +int KeWaitForSingleObject(int Object, int WaitReason, int WaitMode, + int Alertable, int Timeout) { { #line 1747 - if (s == MPR3) { + if (s == MPR3) { #line 1748 - if (setEventCalled == 1) { + if (setEventCalled == 1) { #line 1749 - s = NP; + s = NP; #line 1750 - setEventCalled = 0; + setEventCalled = 0; + } else { + goto _L; + } } else { - goto _L; - } - } else { - _L: + _L: #line 1756 - if (customIrp == 1) { + if (customIrp == 1) { #line 1757 - s = NP; + s = NP; #line 1758 - customIrp = 0; - } else { + customIrp = 0; + } else { #line 1760 - if (s == MPR3) { - { + if (s == MPR3) { + { #line 1762 - errorFn(); + errorFn(); + } } } } - } #line 1769 - int tmp_ndt_6; - tmp_ndt_6 = __VERIFIER_nondet_int(); - if (tmp_ndt_6 == 0) { - goto switch_7_0; - } else { - goto switch_7_default; + int tmp_ndt_6; + tmp_ndt_6 = __VERIFIER_nondet_int(); + if (tmp_ndt_6 == 0) { + goto switch_7_0; + } else { + goto switch_7_default; #line 1774 - if (0) { - switch_7_0: ; + if (0) { + switch_7_0:; #line 1776 - return (0); - switch_7_default: ; + return (0); + switch_7_default:; #line 1778 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1786 "cdaudio_simpl1.cil.c" -int PoCallDriver(int DeviceObject , int Irp ) -{ - int compRetStatus ; - int returnVal ; - int lcontext = __VERIFIER_nondet_int() ; - unsigned long __cil_tmp7 ; - long __cil_tmp8 ; +int PoCallDriver(int DeviceObject, int Irp) { + int compRetStatus; + int returnVal; + int lcontext = __VERIFIER_nondet_int(); + unsigned long __cil_tmp7; + long __cil_tmp8; { #line 1793 - if (compRegistered) { + if (compRegistered) { #line 1794 - if (routine == 0) { - { + if (routine == 0) { + { #line 1796 - compRetStatus = HPCdrCompletion(DeviceObject, Irp, lcontext); - } - } else { + compRetStatus = HPCdrCompletion(DeviceObject, Irp, lcontext); + } + } else { #line 1799 - if (routine == 1) { - { + if (routine == 1) { + { #line 1801 - compRetStatus = CdAudioSignalCompletion(DeviceObject, Irp, lcontext); + compRetStatus = + CdAudioSignalCompletion(DeviceObject, Irp, lcontext); + } } } - } - { + { #line 1807 - __cil_tmp7 = (unsigned long )compRetStatus; + __cil_tmp7 = (unsigned long)compRetStatus; #line 1807 - if (__cil_tmp7 == -1073741802) { - { + if (__cil_tmp7 == -1073741802) { + { #line 1809 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 1817 - int tmp_ndt_7; - tmp_ndt_7 = __VERIFIER_nondet_int(); - if (tmp_ndt_7 == 0) { - goto switch_8_0; - } else { -#line 1820 - int tmp_ndt_8; - tmp_ndt_8 = __VERIFIER_nondet_int(); - if (tmp_ndt_8 == 1) { - goto switch_8_1; + int tmp_ndt_7; + tmp_ndt_7 = __VERIFIER_nondet_int(); + if (tmp_ndt_7 == 0) { + goto switch_8_0; } else { - goto switch_8_default; +#line 1820 + int tmp_ndt_8; + tmp_ndt_8 = __VERIFIER_nondet_int(); + if (tmp_ndt_8 == 1) { + goto switch_8_1; + } else { + goto switch_8_default; #line 1825 - if (0) { - switch_8_0: + if (0) { + switch_8_0: #line 1827 - returnVal = 0; - goto switch_8_break; - switch_8_1: + returnVal = 0; + goto switch_8_break; + switch_8_1: #line 1830 - returnVal = -1073741823; - goto switch_8_break; - switch_8_default: + returnVal = -1073741823; + goto switch_8_break; + switch_8_default: #line 1833 - returnVal = 259; - goto switch_8_break; - } else { - switch_8_break: ; + returnVal = 259; + goto switch_8_break; + } else { + switch_8_break:; + } } } - } #line 1841 - if (s == NP) { + if (s == NP) { #line 1842 - s = IPC; + s = IPC; #line 1843 - lowerDriverReturn = returnVal; - } else { + lowerDriverReturn = returnVal; + } else { #line 1845 - if (s == MPR1) { - { + if (s == MPR1) { + { #line 1846 - __cil_tmp8 = (long )returnVal; + __cil_tmp8 = (long)returnVal; #line 1846 - if (__cil_tmp8 == 259L) { + if (__cil_tmp8 == 259L) { #line 1847 - s = MPR3; + s = MPR3; #line 1848 - lowerDriverReturn = returnVal; - } else { + lowerDriverReturn = returnVal; + } else { #line 1850 - s = NP; + s = NP; #line 1851 - lowerDriverReturn = returnVal; - } - } - } else { + lowerDriverReturn = returnVal; + } + } + } else { #line 1854 - if (s == SKIP1) { + if (s == SKIP1) { #line 1855 - s = SKIP2; + s = SKIP2; #line 1856 - lowerDriverReturn = returnVal; - } else { - { + lowerDriverReturn = returnVal; + } else { + { #line 1859 - errorFn(); + errorFn(); + } } } } - } #line 1864 - return (returnVal); -} + return (returnVal); + } } #line 1867 "cdaudio_simpl1.cil.c" -int ZwClose(int Handle ) -{ +int ZwClose(int Handle) { { #line 1871 - int tmp_ndt_9; - tmp_ndt_9 = __VERIFIER_nondet_int(); - if (tmp_ndt_9 == 0) { - goto switch_9_0; - } else { - goto switch_9_default; + int tmp_ndt_9; + tmp_ndt_9 = __VERIFIER_nondet_int(); + if (tmp_ndt_9 == 0) { + goto switch_9_0; + } else { + goto switch_9_default; #line 1876 - if (0) { - switch_9_0: ; + if (0) { + switch_9_0:; #line 1878 - return (0); - switch_9_default: ; + return (0); + switch_9_default:; #line 1880 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} diff --git a/test/ntdrivers-simplified/cdaudio_simpl1_true.cil.c b/test/ntdrivers-simplified/cdaudio_simpl1_true.cil.c index 12fe4bba2..9f58e78d9 100644 --- a/test/ntdrivers-simplified/cdaudio_simpl1_true.cil.c +++ b/test/ntdrivers-simplified/cdaudio_simpl1_true.cil.c @@ -6,2571 +6,2770 @@ extern char __VERIFIER_nondet_char(void); extern int __VERIFIER_nondet_int(void); extern long __VERIFIER_nondet_long(void); extern void *__VERIFIER_nondet_pointer(void); -void IofCompleteRequest(int Irp , int PriorityBoost ); -int __VERIFIER_nondet_int() ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -int compFptr ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -int routine ; -int myStatus ; -int pirp ; -int Executive ; -int Suspended ; -int KernelMode ; -int DeviceUsageTypePaging ; +void IofCompleteRequest(int Irp, int PriorityBoost); +int __VERIFIER_nondet_int(); +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +int compFptr; +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +int routine; +int myStatus; +int pirp; +int Executive; +int Suspended; +int KernelMode; +int DeviceUsageTypePaging; -void errorFn(void) -{ +void errorFn(void) { { - goto ERROR; - ERROR: assert(0); + goto ERROR; + ERROR: + assert(0); #line 60 - return; -} + return; + } } #line 63 "cdaudio_simpl1.cil.c" -void _BLAST_init(void) -{ +void _BLAST_init(void) { { #line 67 - UNLOADED = 0; + UNLOADED = 0; #line 68 - NP = 1; + NP = 1; #line 69 - DC = 2; + DC = 2; #line 70 - SKIP1 = 3; + SKIP1 = 3; #line 71 - SKIP2 = 4; + SKIP2 = 4; #line 72 - MPR1 = 5; + MPR1 = 5; #line 73 - MPR3 = 6; + MPR3 = 6; #line 74 - IPC = 7; + IPC = 7; #line 75 - s = UNLOADED; + s = UNLOADED; #line 76 - pended = 0; + pended = 0; #line 77 - compFptr = 0; + compFptr = 0; #line 78 - compRegistered = 0; + compRegistered = 0; #line 79 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 80 - setEventCalled = 0; + setEventCalled = 0; #line 81 - customIrp = 0; + customIrp = 0; #line 82 - return; -} + return; + } } #line 85 "cdaudio_simpl1.cil.c" -int SendSrbSynchronous(int Extension , int Srb , int Buffer , int BufferLength ) -{ int ioStatus__Status = __VERIFIER_nondet_int() ; - int ioctl ; - int event = __VERIFIER_nondet_int() ; - int irp ; - int status = __VERIFIER_nondet_int() ; - int __cil_tmp10 ; - int __cil_tmp11 ; - int __cil_tmp12 ; - int __cil_tmp13 ; - int __cil_tmp14 ; - int __cil_tmp15 ; - int __cil_tmp16 ; - int __cil_tmp17 ; - long __cil_tmp18 ; +int SendSrbSynchronous(int Extension, int Srb, int Buffer, int BufferLength) { + int ioStatus__Status = __VERIFIER_nondet_int(); + int ioctl; + int event = __VERIFIER_nondet_int(); + int irp; + int status = __VERIFIER_nondet_int(); + int __cil_tmp10; + int __cil_tmp11; + int __cil_tmp12; + int __cil_tmp13; + int __cil_tmp14; + int __cil_tmp15; + int __cil_tmp16; + int __cil_tmp17; + long __cil_tmp18; { #line 93 - irp = 0; + irp = 0; #line 94 - if (Buffer) { + if (Buffer) { #line 95 - __cil_tmp10 = 4116; + __cil_tmp10 = 4116; #line 95 - __cil_tmp11 = 49152; + __cil_tmp11 = 49152; #line 95 - __cil_tmp12 = 262144; + __cil_tmp12 = 262144; #line 95 - __cil_tmp13 = 311296; + __cil_tmp13 = 311296; #line 95 - ioctl = 315412; - } else { + ioctl = 315412; + } else { #line 97 - __cil_tmp14 = 4100; + __cil_tmp14 = 4100; #line 97 - __cil_tmp15 = 49152; + __cil_tmp15 = 49152; #line 97 - __cil_tmp16 = 262144; + __cil_tmp16 = 262144; #line 97 - __cil_tmp17 = 311296; + __cil_tmp17 = 311296; #line 97 - ioctl = 315396; - } + ioctl = 315396; + } #line 99 - if (! irp) { + if (!irp) { #line 100 - return (-1073741670); - } - { + return (-1073741670); + } + { #line 104 - __cil_tmp18 = (long )status; + __cil_tmp18 = (long)status; #line 104 - if (__cil_tmp18 == 259L) { - { + if (__cil_tmp18 == 259L) { + { #line 106 - KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); + KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); #line 107 - status = ioStatus__Status; + status = ioStatus__Status; + } + } } - } - } #line 112 - return (status); -} + return (status); + } } #line 115 "cdaudio_simpl1.cil.c" -int CdAudioSignalCompletion(int DeviceObject , int Irp , int Event ) -{ +int CdAudioSignalCompletion(int DeviceObject, int Irp, int Event) { { - { + { #line 120 - KeSetEvent(Event, 0, 0); - } + KeSetEvent(Event, 0, 0); + } #line 122 - return (-1073741802); -} + return (-1073741802); + } } #line 125 "cdaudio_simpl1.cil.c" -int CdAudioStartDevice(int DeviceObject , int Irp ) -{ int deviceExtension__Active = __VERIFIER_nondet_int() ; - int deviceExtension = __VERIFIER_nondet_int() ; - int status ; - int srb = __VERIFIER_nondet_int() ; - int srb__Cdb = __VERIFIER_nondet_int() ; - int cdb ; - int inquiryDataPtr ; - int attempt ; - int tmp ; - int deviceParameterHandle = __VERIFIER_nondet_int() ; - int keyValue ; - { +int CdAudioStartDevice(int DeviceObject, int Irp) { + int deviceExtension__Active = __VERIFIER_nondet_int(); + int deviceExtension = __VERIFIER_nondet_int(); + int status; + int srb = __VERIFIER_nondet_int(); + int srb__Cdb = __VERIFIER_nondet_int(); + int cdb; + int inquiryDataPtr; + int attempt; + int tmp; + int deviceParameterHandle = __VERIFIER_nondet_int(); + int keyValue; { + { #line 140 - status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); - } - { + status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); + } + { #line 142 #line 142 - if (status < 0) { + if (status < 0) { #line 143 - return (status); - } - } + return (status); + } + } #line 147 - if (deviceExtension__Active == 255) { + if (deviceExtension__Active == 255) { #line 148 - cdb = srb__Cdb; + cdb = srb__Cdb; #line 149 - inquiryDataPtr = 0; + inquiryDataPtr = 0; #line 150 - attempt = 0; + attempt = 0; #line 151 - if (! inquiryDataPtr) { + if (!inquiryDataPtr) { #line 152 - deviceExtension__Active = 0; + deviceExtension__Active = 0; #line 153 - return (0); - } + return (0); + } #line 157 - status = -1073741823; - { + status = -1073741823; + { #line 159 - while (1) { - while_0_continue: /* CIL Label */ ; + while (1) { + while_0_continue: /* CIL Label */; - { + { #line 161 #line 161 - if (status < 0) { + if (status < 0) { #line 162 - tmp = attempt; + tmp = attempt; #line 163 - attempt ++; + attempt++; #line 164 - if (tmp >= 4) { - goto while_0_break_1; + if (tmp >= 4) { + goto while_0_break_1; + } + } else { + goto while_0_break_1; + } + } + { +#line 173 + status = + SendSrbSynchronous(deviceExtension, srb, inquiryDataPtr, 36); + } } - } else { - goto while_0_break_1; - } + while_0_break: /* CIL Label */; } + while_0_break_1:; { -#line 173 - status = SendSrbSynchronous(deviceExtension, srb, inquiryDataPtr, 36); - } - } - while_0_break: /* CIL Label */ ; - } - while_0_break_1: ; - { #line 178 #line 178 - if (status < 0) { + if (status < 0) { #line 179 - deviceExtension__Active = 0; + deviceExtension__Active = 0; #line 180 - return (0); - } - } + return (0); + } + } #line 184 - deviceExtension__Active = 0; - } + deviceExtension__Active = 0; + } #line 188 - keyValue = deviceExtension__Active; - { + keyValue = deviceExtension__Active; + { #line 189 #line 189 - if (status < 0) { + if (status < 0) { #line 190 - return (0); - } - } - { + return (0); + } + } + { #line 194 #line 194 - if (status < 0) { - - } - } - { + if (status < 0) { + } + } + { #line 200 - ZwClose(deviceParameterHandle); - } + ZwClose(deviceParameterHandle); + } #line 202 - return (0); -} + return (0); + } } #line 205 "cdaudio_simpl1.cil.c" -int CdAudioPnp(int DeviceObject , int Irp ) -{ int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int irpSp__MinorFunction = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int irpSp__Parameters__UsageNotification__Type = __VERIFIER_nondet_int() ; - int deviceExtension__PagingPathCountEvent = __VERIFIER_nondet_int() ; - int irpSp__Parameters__UsageNotification__InPath = __VERIFIER_nondet_int() ; - int deviceExtension__PagingPathCount = __VERIFIER_nondet_int() ; - int DeviceObject__Flags ; - int irpSp ; - int status ; - int setPagable ; - int tmp ; - int tmp___0 ; +int CdAudioPnp(int DeviceObject, int Irp) { + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int irpSp__MinorFunction = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int irpSp__Parameters__UsageNotification__Type = __VERIFIER_nondet_int(); + int deviceExtension__PagingPathCountEvent = __VERIFIER_nondet_int(); + int irpSp__Parameters__UsageNotification__InPath = __VERIFIER_nondet_int(); + int deviceExtension__PagingPathCount = __VERIFIER_nondet_int(); + int DeviceObject__Flags; + int irpSp; + int status; + int setPagable; + int tmp; + int tmp___0; { #line 221 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = Irp__Tail__Overlay__CurrentStackLocation; #line 222 - status = -1073741637; + status = -1073741637; #line 223 - if (irpSp__MinorFunction == 0) { - goto switch_1_0; - } else { -#line 226 - if (irpSp__MinorFunction == 22) { - goto switch_1_22; + if (irpSp__MinorFunction == 0) { + goto switch_1_0; } else { - goto switch_1_default; +#line 226 + if (irpSp__MinorFunction == 22) { + goto switch_1_22; + } else { + goto switch_1_default; #line 231 - if (0) { - switch_1_0: - { + if (0) { + switch_1_0 : { #line 234 - status = CdAudioStartDevice(DeviceObject, Irp); + status = CdAudioStartDevice(DeviceObject, Irp); #line 235 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = status; #line 236 - myStatus = status; + myStatus = status; #line 237 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); } #line 239 - return (status); - switch_1_22: ; + return (status); + switch_1_22:; #line 241 - if (irpSp__Parameters__UsageNotification__Type != DeviceUsageTypePaging) { - { + if (irpSp__Parameters__UsageNotification__Type != + DeviceUsageTypePaging) { + { #line 243 - tmp = CdAudioSendToNextDriver(DeviceObject, Irp); - } + tmp = CdAudioSendToNextDriver(DeviceObject, Irp); + } #line 245 - return (tmp); - } - { + return (tmp); + } + { #line 250 - status = KeWaitForSingleObject(deviceExtension__PagingPathCountEvent, Executive, - KernelMode, 0, 0); + status = + KeWaitForSingleObject(deviceExtension__PagingPathCountEvent, + Executive, KernelMode, 0, 0); #line 252 - setPagable = 0; - } + setPagable = 0; + } #line 254 - if (irpSp__Parameters__UsageNotification__InPath) { + if (irpSp__Parameters__UsageNotification__InPath) { #line 255 - if (deviceExtension__PagingPathCount != 1) { - goto _L; - } - } else { - _L: + if (deviceExtension__PagingPathCount != 1) { + goto _L; + } + } else { + _L: #line 262 - if (status == status) { + if (status == status) { #line 265 - //DeviceObject__Flags |= 8192; +// DeviceObject__Flags |= 8192; #line 266 - setPagable = 1; + setPagable = 1; + } } - } - { + { #line 270 - status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); - } + status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); + } #line 272 - if (status >= 0) { + if (status >= 0) { #line 273 - if (irpSp__Parameters__UsageNotification__InPath) { - - } + if (irpSp__Parameters__UsageNotification__InPath) { + } #line 278 - if (irpSp__Parameters__UsageNotification__InPath) { + if (irpSp__Parameters__UsageNotification__InPath) { #line 279 - if (deviceExtension__PagingPathCount == 1) { + if (deviceExtension__PagingPathCount == 1) { #line 280 - //DeviceObject__Flags &= -8193; + // DeviceObject__Flags &= -8193; + } } - } - } else { + } else { #line 288 - if (setPagable == 1) { + if (setPagable == 1) { #line 289 - //DeviceObject__Flags &= -8193; +// DeviceObject__Flags &= -8193; #line 290 - setPagable = 0; + setPagable = 0; + } } - } - { + { #line 296 - KeSetEvent(deviceExtension__PagingPathCountEvent, 0, 0); + KeSetEvent(deviceExtension__PagingPathCountEvent, 0, 0); #line 297 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 299 - return (status); - goto switch_1_break; - switch_1_default: - { + return (status); + goto switch_1_break; + switch_1_default : { #line 303 - tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); + tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); } #line 305 - return (tmp___0); - } else { - switch_1_break: ; + return (tmp___0); + } else { + switch_1_break:; + } } } - } #line 312 - return (0); -} + return (0); + } } #line 315 "cdaudio_simpl1.cil.c" -int CdAudioDeviceControl(int DeviceObject , int Irp ) -{ int deviceExtension__Active = __VERIFIER_nondet_int() ; - int status ; +int CdAudioDeviceControl(int DeviceObject, int Irp) { + int deviceExtension__Active = __VERIFIER_nondet_int(); + int status; { #line 320 - if (deviceExtension__Active == 2) { - goto switch_2_2; - } else { -#line 323 - if (deviceExtension__Active == 3) { - goto switch_2_3; + if (deviceExtension__Active == 2) { + goto switch_2_2; } else { -#line 326 - if (deviceExtension__Active == 1) { - goto switch_2_1; +#line 323 + if (deviceExtension__Active == 3) { + goto switch_2_3; } else { -#line 329 - if (deviceExtension__Active == 7) { - goto switch_2_7; +#line 326 + if (deviceExtension__Active == 1) { + goto switch_2_1; } else { - goto switch_2_default; +#line 329 + if (deviceExtension__Active == 7) { + goto switch_2_7; + } else { + goto switch_2_default; #line 334 - if (0) { - switch_2_2: - { + if (0) { + switch_2_2 : { #line 337 - status = CdAudio535DeviceControl(DeviceObject, Irp); + status = CdAudio535DeviceControl(DeviceObject, Irp); } - goto switch_2_break; - switch_2_3: - { + goto switch_2_break; + switch_2_3 : { #line 342 - status = CdAudio435DeviceControl(DeviceObject, Irp); + status = CdAudio435DeviceControl(DeviceObject, Irp); } - goto switch_2_break; - switch_2_1: - { + goto switch_2_break; + switch_2_1 : { #line 347 - status = CdAudioAtapiDeviceControl(DeviceObject, Irp); + status = CdAudioAtapiDeviceControl(DeviceObject, Irp); } - goto switch_2_break; - switch_2_7: - { + goto switch_2_break; + switch_2_7 : { #line 352 - status = CdAudioHPCdrDeviceControl(DeviceObject, Irp); + status = CdAudioHPCdrDeviceControl(DeviceObject, Irp); } - goto switch_2_break; - switch_2_default: - { + goto switch_2_break; + switch_2_default : { #line 357 - deviceExtension__Active = 0; + deviceExtension__Active = 0; #line 358 - status = CdAudioSendToNextDriver(DeviceObject, Irp); + status = CdAudioSendToNextDriver(DeviceObject, Irp); + } + } else { + switch_2_break:; } - } else { - switch_2_break: ; } } } } - } #line 368 - return (status); -} + return (status); + } } #line 371 "cdaudio_simpl1.cil.c" -int CdAudioSendToNextDriver(int DeviceObject , int Irp ) -{ int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int tmp ; +int CdAudioSendToNextDriver(int DeviceObject, int Irp) { + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int tmp; { #line 378 - if (s == NP) { + if (s == NP) { #line 379 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 382 - errorFn(); + errorFn(); + } } - } - { + { #line 386 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 387 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 388 - tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); - } + tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); + } #line 390 - return (tmp); -} + return (tmp); + } } #line 393 "cdaudio_simpl1.cil.c" -int CdAudioIsPlayActive(int DeviceObject ) -{ int deviceExtension__PlayActive = __VERIFIER_nondet_int() ; - int ioStatus__Status = __VERIFIER_nondet_int() ; - int currentBuffer__Header__AudioStatus = __VERIFIER_nondet_int() ; - int irp_CdAudioIsPlayActive = __VERIFIER_nondet_int() ; - int event = __VERIFIER_nondet_int() ; - int status = __VERIFIER_nondet_int() ; - int currentBuffer = __VERIFIER_nondet_int() ; - int returnValue ; - long __cil_tmp10 ; - int __cil_tmp11 ; +int CdAudioIsPlayActive(int DeviceObject) { + int deviceExtension__PlayActive = __VERIFIER_nondet_int(); + int ioStatus__Status = __VERIFIER_nondet_int(); + int currentBuffer__Header__AudioStatus = __VERIFIER_nondet_int(); + int irp_CdAudioIsPlayActive = __VERIFIER_nondet_int(); + int event = __VERIFIER_nondet_int(); + int status = __VERIFIER_nondet_int(); + int currentBuffer = __VERIFIER_nondet_int(); + int returnValue; + long __cil_tmp10; + int __cil_tmp11; { #line 404 - if (! deviceExtension__PlayActive) { + if (!deviceExtension__PlayActive) { #line 405 - return (0); - } + return (0); + } #line 409 - if (currentBuffer == 0) { + if (currentBuffer == 0) { #line 410 - return (0); - } + return (0); + } #line 414 - if (irp_CdAudioIsPlayActive == 0) { + if (irp_CdAudioIsPlayActive == 0) { #line 415 - return (0); - } - { + return (0); + } + { #line 419 - __cil_tmp10 = (long )status; + __cil_tmp10 = (long)status; #line 419 - if (__cil_tmp10 == 259L) { - { + if (__cil_tmp10 == 259L) { + { #line 421 - KeWaitForSingleObject(event, Suspended, KernelMode, 0, 0); + KeWaitForSingleObject(event, Suspended, KernelMode, 0, 0); #line 422 - status = ioStatus__Status; + status = ioStatus__Status; + } + } } - } - } - { + { #line 427 #line 427 - if (status < 0) { + if (status < 0) { #line 428 - return (0); - } - } + return (0); + } + } #line 432 - if (currentBuffer__Header__AudioStatus == 17) { + if (currentBuffer__Header__AudioStatus == 17) { #line 433 - returnValue = 1; - } else { + returnValue = 1; + } else { #line 435 - returnValue = 0; + returnValue = 0; #line 436 - deviceExtension__PlayActive = 0; - } + deviceExtension__PlayActive = 0; + } #line 438 - return (returnValue); -} + return (returnValue); + } } #line 441 "cdaudio_simpl1.cil.c" -int CdAudio535DeviceControl(int DeviceObject , int Irp ) -{ int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int() ; - int srb__Cdb = __VERIFIER_nondet_int() ; - int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Information ; - int currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength = __VERIFIER_nondet_int() ; - int currentIrpStack__Parameters__DeviceIoControl__InputBufferLength = __VERIFIER_nondet_int() ; - int srb__CdbLength ; - int cdb__CDB10__OperationCode ; - int srb__TimeOutValue ; - int sizeof__READ_CAPACITY_DATA = __VERIFIER_nondet_int() ; - int lastSession__LogicalBlockAddress = __VERIFIER_nondet_int() ; - int cdaudioDataOut__FirstTrack = __VERIFIER_nondet_int() ; - int cdaudioDataOut__LastTrack = __VERIFIER_nondet_int() ; - int sizeof__CDROM_TOC = __VERIFIER_nondet_int() ; - int sizeof__SUB_Q_CURRENT_POSITION = __VERIFIER_nondet_int() ; - int userPtr__Format = __VERIFIER_nondet_int() ; - int sizeof__CDROM_PLAY_AUDIO_MSF = __VERIFIER_nondet_int() ; - int inputBuffer__StartingM = __VERIFIER_nondet_int() ; - int inputBuffer__EndingM = __VERIFIER_nondet_int() ; - int inputBuffer__StartingS = __VERIFIER_nondet_int() ; - int inputBuffer__EndingS = __VERIFIER_nondet_int() ; - int inputBuffer__StartingF = __VERIFIER_nondet_int() ; - int inputBuffer__EndingF = __VERIFIER_nondet_int() ; - int cdb__PLAY_AUDIO_MSF__OperationCode = __VERIFIER_nondet_int() ; - int sizeof__CDROM_SEEK_AUDIO_MSF = __VERIFIER_nondet_int() ; - int currentIrpStack ; - int deviceExtension ; - int cdaudioDataOut ; - int srb = __VERIFIER_nondet_int() ; - int lastSession = __VERIFIER_nondet_int() ; - int cdb ; - int status ; - int i = __VERIFIER_nondet_int() ; - int bytesTransfered = __VERIFIER_nondet_int() ; - int Toc = __VERIFIER_nondet_int() ; - int tmp ; - int tmp___0 ; - int tmp___1 ; - int tmp___2 ; - int tmp___3 ; - int tmp___4 ; - int tracksToReturn ; - int tracksOnCd ; - int tracksInBuffer ; - int userPtr ; - int SubQPtr = __VERIFIER_nondet_int() ; - int tmp___5 ; - int tmp___6 ; - int inputBuffer ; - int inputBuffer___0 ; - int tmp___7 ; - int tmp___8 ; - int __cil_tmp58 ; - int __cil_tmp59 ; - int __cil_tmp60 ; - int __cil_tmp61 ; - int __cil_tmp62 ; - int __cil_tmp63 ; - int __cil_tmp64 ; - int __cil_tmp65 ; - int __cil_tmp66 ; - int __cil_tmp67 ; - int __cil_tmp68 ; - int __cil_tmp69 ; - int __cil_tmp70 ; - int __cil_tmp71 ; - int __cil_tmp72 ; - int __cil_tmp73 ; - int __cil_tmp74 ; - int __cil_tmp75 ; - int __cil_tmp76 ; - int __cil_tmp77 ; - int __cil_tmp78 ; - int __cil_tmp79 ; - int __cil_tmp80 ; - int __cil_tmp81 ; - int __cil_tmp82 ; - int __cil_tmp83 ; - int __cil_tmp84 ; - int __cil_tmp85 ; - int __cil_tmp86 ; - int __cil_tmp87 ; - int __cil_tmp88 ; - int __cil_tmp89 ; - int __cil_tmp90 ; - int __cil_tmp91 ; - int __cil_tmp92 ; - int __cil_tmp93 ; - int __cil_tmp94 ; - int __cil_tmp95 ; - int __cil_tmp96 ; - int __cil_tmp97 ; - int __cil_tmp98 ; - int __cil_tmp99 ; - int __cil_tmp100 ; - int __cil_tmp101 ; - int __cil_tmp102 ; - int __cil_tmp103 ; - int __cil_tmp104 ; - int __cil_tmp105 ; - int __cil_tmp106 ; - unsigned long __cil_tmp107 ; - unsigned long __cil_tmp108 ; - int __cil_tmp109 ; - int __cil_tmp110 ; +int CdAudio535DeviceControl(int DeviceObject, int Irp) { + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int(); + int srb__Cdb = __VERIFIER_nondet_int(); + int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = + __VERIFIER_nondet_int(); + int Irp__IoStatus__Information; + int currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength = + __VERIFIER_nondet_int(); + int currentIrpStack__Parameters__DeviceIoControl__InputBufferLength = + __VERIFIER_nondet_int(); + int srb__CdbLength; + int cdb__CDB10__OperationCode; + int srb__TimeOutValue; + int sizeof__READ_CAPACITY_DATA = __VERIFIER_nondet_int(); + int lastSession__LogicalBlockAddress = __VERIFIER_nondet_int(); + int cdaudioDataOut__FirstTrack = __VERIFIER_nondet_int(); + int cdaudioDataOut__LastTrack = __VERIFIER_nondet_int(); + int sizeof__CDROM_TOC = __VERIFIER_nondet_int(); + int sizeof__SUB_Q_CURRENT_POSITION = __VERIFIER_nondet_int(); + int userPtr__Format = __VERIFIER_nondet_int(); + int sizeof__CDROM_PLAY_AUDIO_MSF = __VERIFIER_nondet_int(); + int inputBuffer__StartingM = __VERIFIER_nondet_int(); + int inputBuffer__EndingM = __VERIFIER_nondet_int(); + int inputBuffer__StartingS = __VERIFIER_nondet_int(); + int inputBuffer__EndingS = __VERIFIER_nondet_int(); + int inputBuffer__StartingF = __VERIFIER_nondet_int(); + int inputBuffer__EndingF = __VERIFIER_nondet_int(); + int cdb__PLAY_AUDIO_MSF__OperationCode = __VERIFIER_nondet_int(); + int sizeof__CDROM_SEEK_AUDIO_MSF = __VERIFIER_nondet_int(); + int currentIrpStack; + int deviceExtension; + int cdaudioDataOut; + int srb = __VERIFIER_nondet_int(); + int lastSession = __VERIFIER_nondet_int(); + int cdb; + int status; + int i = __VERIFIER_nondet_int(); + int bytesTransfered = __VERIFIER_nondet_int(); + int Toc = __VERIFIER_nondet_int(); + int tmp; + int tmp___0; + int tmp___1; + int tmp___2; + int tmp___3; + int tmp___4; + int tracksToReturn; + int tracksOnCd; + int tracksInBuffer; + int userPtr; + int SubQPtr = __VERIFIER_nondet_int(); + int tmp___5; + int tmp___6; + int inputBuffer; + int inputBuffer___0; + int tmp___7; + int tmp___8; + int __cil_tmp58; + int __cil_tmp59; + int __cil_tmp60; + int __cil_tmp61; + int __cil_tmp62; + int __cil_tmp63; + int __cil_tmp64; + int __cil_tmp65; + int __cil_tmp66; + int __cil_tmp67; + int __cil_tmp68; + int __cil_tmp69; + int __cil_tmp70; + int __cil_tmp71; + int __cil_tmp72; + int __cil_tmp73; + int __cil_tmp74; + int __cil_tmp75; + int __cil_tmp76; + int __cil_tmp77; + int __cil_tmp78; + int __cil_tmp79; + int __cil_tmp80; + int __cil_tmp81; + int __cil_tmp82; + int __cil_tmp83; + int __cil_tmp84; + int __cil_tmp85; + int __cil_tmp86; + int __cil_tmp87; + int __cil_tmp88; + int __cil_tmp89; + int __cil_tmp90; + int __cil_tmp91; + int __cil_tmp92; + int __cil_tmp93; + int __cil_tmp94; + int __cil_tmp95; + int __cil_tmp96; + int __cil_tmp97; + int __cil_tmp98; + int __cil_tmp99; + int __cil_tmp100; + int __cil_tmp101; + int __cil_tmp102; + int __cil_tmp103; + int __cil_tmp104; + int __cil_tmp105; + int __cil_tmp106; + unsigned long __cil_tmp107; + unsigned long __cil_tmp108; + int __cil_tmp109; + int __cil_tmp110; { #line 499 - currentIrpStack = Irp__Tail__Overlay__CurrentStackLocation; + currentIrpStack = Irp__Tail__Overlay__CurrentStackLocation; #line 500 - deviceExtension = DeviceObject__DeviceExtension; + deviceExtension = DeviceObject__DeviceExtension; #line 501 - cdaudioDataOut = Irp__AssociatedIrp__SystemBuffer; + cdaudioDataOut = Irp__AssociatedIrp__SystemBuffer; #line 502 - cdb = srb__Cdb; - { + cdb = srb__Cdb; + { #line 503 - __cil_tmp58 = 56; + __cil_tmp58 = 56; #line 503 - __cil_tmp59 = 16384; + __cil_tmp59 = 16384; #line 503 - __cil_tmp60 = 131072; + __cil_tmp60 = 131072; #line 503 - __cil_tmp61 = 147456; + __cil_tmp61 = 147456; #line 503 - __cil_tmp62 = 147512; + __cil_tmp62 = 147512; #line 503 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp62) { - goto switch_3_exp_0; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp62) { + goto switch_3_exp_0; + } else { + { #line 506 - __cil_tmp63 = 16384; + __cil_tmp63 = 16384; #line 506 - __cil_tmp64 = 131072; + __cil_tmp64 = 131072; #line 506 - __cil_tmp65 = 147456; + __cil_tmp65 = 147456; #line 506 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp65) { - goto switch_3_exp_1; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp65) { + goto switch_3_exp_1; + } else { + { #line 509 - __cil_tmp66 = 44; + __cil_tmp66 = 44; #line 509 - __cil_tmp67 = 16384; + __cil_tmp67 = 16384; #line 509 - __cil_tmp68 = 131072; + __cil_tmp68 = 131072; #line 509 - __cil_tmp69 = 147456; + __cil_tmp69 = 147456; #line 509 - __cil_tmp70 = 147500; + __cil_tmp70 = 147500; #line 509 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp70) { - goto switch_3_exp_2; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp70) { + goto switch_3_exp_2; + } else { + { #line 512 - __cil_tmp71 = 24; + __cil_tmp71 = 24; #line 512 - __cil_tmp72 = 16384; + __cil_tmp72 = 16384; #line 512 - __cil_tmp73 = 131072; + __cil_tmp73 = 131072; #line 512 - __cil_tmp74 = 147456; + __cil_tmp74 = 147456; #line 512 - __cil_tmp75 = 147480; + __cil_tmp75 = 147480; #line 512 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp75) { - goto switch_3_exp_3; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp75) { + goto switch_3_exp_3; + } else { + { #line 515 - __cil_tmp76 = 4; + __cil_tmp76 = 4; #line 515 - __cil_tmp77 = 16384; + __cil_tmp77 = 16384; #line 515 - __cil_tmp78 = 131072; + __cil_tmp78 = 131072; #line 515 - __cil_tmp79 = 147456; + __cil_tmp79 = 147456; #line 515 - __cil_tmp80 = 147460; + __cil_tmp80 = 147460; #line 515 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp80) { - goto switch_3_exp_4; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp80) { + goto switch_3_exp_4; + } else { + { #line 518 - __cil_tmp81 = 2056; + __cil_tmp81 = 2056; #line 518 - __cil_tmp82 = 16384; + __cil_tmp82 = 16384; #line 518 - __cil_tmp83 = 131072; + __cil_tmp83 = 131072; #line 518 - __cil_tmp84 = 147456; + __cil_tmp84 = 147456; #line 518 - __cil_tmp85 = 149512; + __cil_tmp85 = 149512; #line 518 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp85) { - goto switch_3_exp_5; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp85) { + goto switch_3_exp_5; + } else { + { #line 521 - __cil_tmp86 = 52; + __cil_tmp86 = 52; #line 521 - __cil_tmp87 = 16384; + __cil_tmp87 = 16384; #line 521 - __cil_tmp88 = 131072; + __cil_tmp88 = 131072; #line 521 - __cil_tmp89 = 147456; + __cil_tmp89 = 147456; #line 521 - __cil_tmp90 = 147508; + __cil_tmp90 = 147508; #line 521 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp90) { - goto switch_3_exp_6; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp90) { + goto switch_3_exp_6; + } else { + { #line 524 - __cil_tmp91 = 20; + __cil_tmp91 = 20; #line 524 - __cil_tmp92 = 16384; + __cil_tmp92 = 16384; #line 524 - __cil_tmp93 = 131072; + __cil_tmp93 = 131072; #line 524 - __cil_tmp94 = 147456; + __cil_tmp94 = 147456; #line 524 - __cil_tmp95 = 147476; + __cil_tmp95 = 147476; #line 524 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp95) { - goto switch_3_exp_7; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp95) { + goto switch_3_exp_7; + } else { + { #line 527 - __cil_tmp96 = 40; + __cil_tmp96 = 40; #line 527 - __cil_tmp97 = 16384; + __cil_tmp97 = 16384; #line 527 - __cil_tmp98 = 131072; + __cil_tmp98 = 131072; #line 527 - __cil_tmp99 = 147456; + __cil_tmp99 = 147456; #line 527 - __cil_tmp100 = 147496; + __cil_tmp100 = 147496; #line 527 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp100) { - goto switch_3_exp_8; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp100) { + goto switch_3_exp_8; + } else { + { #line 530 - __cil_tmp101 = 2048; + __cil_tmp101 = 2048; #line 530 - __cil_tmp102 = 16384; + __cil_tmp102 = 16384; #line 530 - __cil_tmp103 = 131072; + __cil_tmp103 = 131072; #line 530 - __cil_tmp104 = 147456; + __cil_tmp104 = 147456; #line 530 - __cil_tmp105 = 149504; + __cil_tmp105 = 149504; #line 530 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp105) { - goto switch_3_exp_9; - } else { - goto switch_3_default; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp105) { + goto switch_3_exp_9; + } else { + goto switch_3_default; #line 535 - if (0) { - switch_3_exp_0: - { + if (0) { + switch_3_exp_0 : { #line 538 - tmp = CdAudioIsPlayActive(DeviceObject); - } + tmp = CdAudioIsPlayActive( + DeviceObject); + } #line 540 - if (tmp) { + if (tmp) { #line 541 - status = -2147483631; + status = -2147483631; #line 542 - Irp__IoStatus__Information = 0; - goto switch_3_break; - } + Irp__IoStatus__Information = 0; + goto switch_3_break; + } #line 547 - if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength) { + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength) { #line 548 - status = -1073741789; + status = -1073741789; #line 549 - Irp__IoStatus__Information = 0; - goto switch_3_break; - } + Irp__IoStatus__Information = 0; + goto switch_3_break; + } #line 554 - if (lastSession == 0) { - { + if (lastSession == 0) { + { #line 556 - status = -1073741670; + status = -1073741670; #line 557 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 558 - tmp___0 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___0 = AG_SetStatusAndReturn( + status, Irp, + deviceExtension__TargetDeviceObject); + } #line 560 - return (tmp___0); - } - { + return (tmp___0); + } + { #line 565 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 566 - cdb__CDB10__OperationCode = 38; + cdb__CDB10__OperationCode = 38; #line 567 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 568 - status = SendSrbSynchronous(deviceExtension, srb, lastSession, + status = SendSrbSynchronous( + deviceExtension, srb, + lastSession, sizeof__READ_CAPACITY_DATA); - } - { + } + { #line 571 #line 571 - if (status < 0) { - { + if (status < 0) { + { #line 573 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 574 - tmp___1 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___1 = AG_SetStatusAndReturn( + status, Irp, + deviceExtension__TargetDeviceObject); + } #line 576 - return (tmp___1); - } else { + return (tmp___1); + } else { #line 578 - status = 0; - } - } + status = 0; + } + } #line 580 - Irp__IoStatus__Information = bytesTransfered; + Irp__IoStatus__Information = + bytesTransfered; #line 581 - if (lastSession__LogicalBlockAddress == 0) { - goto switch_3_break; - } + if (lastSession__LogicalBlockAddress == + 0) { + goto switch_3_break; + } #line 586 - cdaudioDataOut__FirstTrack = 1; + cdaudioDataOut__FirstTrack = 1; #line 587 - cdaudioDataOut__LastTrack = 2; - goto switch_3_break; - switch_3_exp_1: ; + cdaudioDataOut__LastTrack = 2; + goto switch_3_break; + switch_3_exp_1:; #line 590 - if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength) { + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength) { #line 591 - status = -1073741789; + status = -1073741789; #line 592 - Irp__IoStatus__Information = 0; - goto switch_3_break; - } - { + Irp__IoStatus__Information = 0; + goto switch_3_break; + } + { #line 598 - tmp___2 = CdAudioIsPlayActive(DeviceObject); - } + tmp___2 = CdAudioIsPlayActive( + DeviceObject); + } #line 600 - if (tmp___2) { + if (tmp___2) { #line 601 - status = -2147483631; + status = -2147483631; #line 602 - Irp__IoStatus__Information = 0; - goto switch_3_break; - } + Irp__IoStatus__Information = 0; + goto switch_3_break; + } #line 607 - if (Toc == 0) { - { + if (Toc == 0) { + { #line 609 - status = -1073741670; + status = -1073741670; #line 610 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 611 - tmp___3 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___3 = AG_SetStatusAndReturn( + status, Irp, + deviceExtension__TargetDeviceObject); + } #line 613 - return (tmp___3); - } - { + return (tmp___3); + } + { #line 618 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 619 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 620 - status = SendSrbSynchronous(deviceExtension, srb, Toc, sizeof__CDROM_TOC); - } + status = SendSrbSynchronous( + deviceExtension, srb, Toc, + sizeof__CDROM_TOC); + } #line 622 - if (status >= 0) { - { + if (status >= 0) { + { #line 623 - __cil_tmp107 = (unsigned long )status; + __cil_tmp107 = + (unsigned long)status; #line 623 - if (__cil_tmp107 != -1073741764) { + if (__cil_tmp107 != + -1073741764) { #line 624 - status = 0; - } else { - goto _L; - } - } - } else { - _L: - { + status = 0; + } else { + goto _L; + } + } + } else { + _L : { #line 630 - __cil_tmp108 = (unsigned long )status; + __cil_tmp108 = + (unsigned long)status; #line 630 - if (__cil_tmp108 != -1073741764) { - { + if (__cil_tmp108 != + -1073741764) { + { #line 632 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 633 - tmp___4 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___4 = AG_SetStatusAndReturn( + status, Irp, + deviceExtension__TargetDeviceObject); + } #line 635 - return (tmp___4); - } - } - } + return (tmp___4); + } + } + } #line 640 - __cil_tmp109 = cdaudioDataOut__LastTrack - cdaudioDataOut__FirstTrack; + __cil_tmp109 = + cdaudioDataOut__LastTrack - + cdaudioDataOut__FirstTrack; #line 640 - tracksOnCd = __cil_tmp109 + 1; + tracksOnCd = __cil_tmp109 + 1; #line 641 - tracksInBuffer = currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength; + tracksInBuffer = + currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength; #line 642 - if (tracksInBuffer < tracksOnCd) { + if (tracksInBuffer < tracksOnCd) { #line 643 - tracksToReturn = tracksInBuffer; - } else { + tracksToReturn = tracksInBuffer; + } else { #line 645 - tracksToReturn = tracksOnCd; - } + tracksToReturn = tracksOnCd; + } #line 647 - if (tracksInBuffer > tracksOnCd) { + if (tracksInBuffer > tracksOnCd) { #line 648 - i ++; - } - goto switch_3_break; - switch_3_exp_2: + i++; + } + goto switch_3_break; + switch_3_exp_2: #line 654 - userPtr = Irp__AssociatedIrp__SystemBuffer; + userPtr = + Irp__AssociatedIrp__SystemBuffer; #line 655 - if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < sizeof__SUB_Q_CURRENT_POSITION) { + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < + sizeof__SUB_Q_CURRENT_POSITION) { #line 656 - status = -1073741789; + status = -1073741789; #line 657 - Irp__IoStatus__Information = 0; - goto switch_3_break; - } + Irp__IoStatus__Information = 0; + goto switch_3_break; + } #line 662 - if (SubQPtr == 0) { - { + if (SubQPtr == 0) { + { #line 664 - status = -1073741670; + status = -1073741670; #line 665 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 666 - tmp___5 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___5 = AG_SetStatusAndReturn( + status, Irp, + deviceExtension__TargetDeviceObject); + } #line 668 - return (tmp___5); - } + return (tmp___5); + } #line 672 - if (userPtr__Format != 1) { - { + if (userPtr__Format != 1) { + { #line 674 - status = -1073741823; + status = -1073741823; #line 675 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 676 - tmp___6 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___6 = AG_SetStatusAndReturn( + status, Irp, + deviceExtension__TargetDeviceObject); + } #line 678 - return (tmp___6); - } - { + return (tmp___6); + } + { #line 683 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 684 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 685 - status = SendSrbSynchronous(deviceExtension, srb, SubQPtr, + status = SendSrbSynchronous( + deviceExtension, srb, + SubQPtr, sizeof__SUB_Q_CURRENT_POSITION); - } + } #line 688 - if (status >= 0) { + if (status >= 0) { #line 689 - Irp__IoStatus__Information = sizeof__SUB_Q_CURRENT_POSITION; - } else { + Irp__IoStatus__Information = + sizeof__SUB_Q_CURRENT_POSITION; + } else { #line 691 - Irp__IoStatus__Information = 0; - } - goto switch_3_break; - switch_3_exp_3: + Irp__IoStatus__Information = 0; + } + goto switch_3_break; + switch_3_exp_3: #line 695 - inputBuffer = Irp__AssociatedIrp__SystemBuffer; + inputBuffer = + Irp__AssociatedIrp__SystemBuffer; #line 696 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 697 - if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CDROM_PLAY_AUDIO_MSF) { + if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < + sizeof__CDROM_PLAY_AUDIO_MSF) { #line 698 - status = -1073741820; - goto switch_3_break; - } + status = -1073741820; + goto switch_3_break; + } #line 703 - if (inputBuffer__StartingM == inputBuffer__EndingM) { + if (inputBuffer__StartingM == + inputBuffer__EndingM) { #line 704 - if (inputBuffer__StartingS == inputBuffer__EndingS) { + if (inputBuffer__StartingS == + inputBuffer__EndingS) { #line 705 - if (inputBuffer__StartingF == inputBuffer__EndingF) { - - } - } - } - { + if (inputBuffer__StartingF == + inputBuffer__EndingF) { + } + } + } + { #line 717 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 718 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 719 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } + status = SendSrbSynchronous( + deviceExtension, srb, 0, 0); + } #line 721 - if (status >= 0) { + if (status >= 0) { #line 722 - if (cdb__PLAY_AUDIO_MSF__OperationCode == 71) { - - } - } - goto switch_3_break; - switch_3_exp_4: + if (cdb__PLAY_AUDIO_MSF__OperationCode == + 71) { + } + } + goto switch_3_break; + switch_3_exp_4: #line 732 - inputBuffer___0 = Irp__AssociatedIrp__SystemBuffer; + inputBuffer___0 = + Irp__AssociatedIrp__SystemBuffer; #line 733 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 734 - if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CDROM_SEEK_AUDIO_MSF) { + if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < + sizeof__CDROM_SEEK_AUDIO_MSF) { #line 735 - status = -1073741820; - goto switch_3_break; - } - { + status = -1073741820; + goto switch_3_break; + } + { #line 741 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 742 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 743 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } - { + status = SendSrbSynchronous( + deviceExtension, srb, 0, 0); + } + { #line 745 #line 745 - if (status < 0) { - - } - } - goto switch_3_break; - switch_3_exp_5: - { + if (status < 0) { + } + } + goto switch_3_break; + switch_3_exp_5 : { #line 753 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 754 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 755 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 756 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } - goto switch_3_break; - switch_3_exp_6: ; - switch_3_exp_7: ; - switch_3_exp_8: + status = SendSrbSynchronous( + deviceExtension, srb, 0, 0); + } + goto switch_3_break; + switch_3_exp_6:; + switch_3_exp_7:; + switch_3_exp_8: #line 762 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 763 - status = -1073741808; - goto switch_3_break; - switch_3_exp_9: - { + status = -1073741808; + goto switch_3_break; + switch_3_exp_9 : { #line 767 - CdAudioIsPlayActive(DeviceObject); - } - switch_3_default: - { + CdAudioIsPlayActive(DeviceObject); + } + switch_3_default : { #line 771 - tmp___7 = CdAudioSendToNextDriver(DeviceObject, Irp); - } + tmp___7 = CdAudioSendToNextDriver( + DeviceObject, Irp); + } #line 773 - return (tmp___7); - goto switch_3_break; - } else { - switch_3_break: ; + return (tmp___7); + goto switch_3_break; + } else { + switch_3_break:; + } + } + } + } + } + } + } + } + } + } + } } } - } } - } - } } } - } - } } } - } - } } } - } - } } - } - } - { + { #line 790 - tmp___8 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); - } + tmp___8 = AG_SetStatusAndReturn(status, Irp, + deviceExtension__TargetDeviceObject); + } #line 792 - return (tmp___8); -} + return (tmp___8); + } } #line 795 "cdaudio_simpl1.cil.c" -int AG_SetStatusAndReturn(int status , int Irp , int deviceExtension__TargetDeviceObject ) -{ unsigned long __cil_tmp4 ; +int AG_SetStatusAndReturn(int status, int Irp, + int deviceExtension__TargetDeviceObject) { + unsigned long __cil_tmp4; { - { + { #line 799 - __cil_tmp4 = (unsigned long )status; + __cil_tmp4 = (unsigned long)status; #line 799 - if (__cil_tmp4 == -2147483626) { - - } - } - { + if (__cil_tmp4 == -2147483626) { + } + } + { #line 805 - myStatus = status; + myStatus = status; #line 806 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 808 - return (status); -} + return (status); + } } #line 811 "cdaudio_simpl1.cil.c" -int CdAudio435DeviceControl(int DeviceObject , int Irp ) -{ int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; - int currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength = __VERIFIER_nondet_int() ; - int currentIrpStack__Parameters__DeviceIoControl__InputBufferLength = __VERIFIER_nondet_int() ; - int TrackData__0 = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Information ; - int srb__TimeOutValue ; - int srb__CdbLength ; - int sizeof__CDROM_TOC = __VERIFIER_nondet_int() ; - int cdaudioDataOut__LastTrack = __VERIFIER_nondet_int() ; - int cdaudioDataOut__FirstTrack = __VERIFIER_nondet_int() ; - int sizeof__CDROM_PLAY_AUDIO_MSF = __VERIFIER_nondet_int() ; - int sizeof__CDROM_SEEK_AUDIO_MSF = __VERIFIER_nondet_int() ; - int deviceExtension__Paused = __VERIFIER_nondet_int() ; - int deviceExtension__PlayActive ; - int sizeof__SUB_Q_CHANNEL_DATA = __VERIFIER_nondet_int() ; - int sizeof__SUB_Q_CURRENT_POSITION = __VERIFIER_nondet_int() ; - int deviceExtension = __VERIFIER_nondet_int() ; - int srb = __VERIFIER_nondet_int() ; - int status ; - int i = __VERIFIER_nondet_int() ; - int bytesTransfered ; - int Toc = __VERIFIER_nondet_int() ; - int tmp ; - int tracksToReturn ; - int tracksOnCd ; - int tracksInBuffer ; - int SubQPtr = __VERIFIER_nondet_int() ; - int userPtr__Format = __VERIFIER_nondet_int() ; - int SubQPtr___0 = __VERIFIER_nondet_int() ; - int tmp___0 ; - int tmp___1 ; - int tmp___2 ; - int __cil_tmp35 ; - int __cil_tmp36 ; - int __cil_tmp37 ; - int __cil_tmp38 ; - int __cil_tmp39 ; - int __cil_tmp40 ; - int __cil_tmp41 ; - int __cil_tmp42 ; - int __cil_tmp43 ; - int __cil_tmp44 ; - int __cil_tmp45 ; - int __cil_tmp46 ; - int __cil_tmp47 ; - int __cil_tmp48 ; - int __cil_tmp49 ; - int __cil_tmp50 ; - int __cil_tmp51 ; - int __cil_tmp52 ; - int __cil_tmp53 ; - int __cil_tmp54 ; - int __cil_tmp55 ; - int __cil_tmp56 ; - int __cil_tmp57 ; - int __cil_tmp58 ; - int __cil_tmp59 ; - int __cil_tmp60 ; - int __cil_tmp61 ; - int __cil_tmp62 ; - int __cil_tmp63 ; - int __cil_tmp64 ; - int __cil_tmp65 ; - int __cil_tmp66 ; - int __cil_tmp67 ; - int __cil_tmp68 ; - int __cil_tmp69 ; - int __cil_tmp70 ; - int __cil_tmp71 ; - int __cil_tmp72 ; - int __cil_tmp73 ; - int __cil_tmp74 ; - int __cil_tmp75 ; - int __cil_tmp76 ; - int __cil_tmp77 ; - int __cil_tmp78 ; - int __cil_tmp79 ; - int __cil_tmp80 ; - int __cil_tmp81 ; - int __cil_tmp82 ; - int __cil_tmp83 ; - int __cil_tmp84 ; - int __cil_tmp85 ; - int __cil_tmp86 ; - int __cil_tmp87 ; - int __cil_tmp88 ; - int __cil_tmp89 ; - int __cil_tmp90 ; - int __cil_tmp91 ; - int __cil_tmp92 ; - unsigned long __cil_tmp93 ; - int __cil_tmp94 ; - unsigned long __cil_tmp95 ; - unsigned long __cil_tmp96 ; - unsigned long __cil_tmp97 ; - int __cil_tmp98 ; - int __cil_tmp99 ; - int __cil_tmp100 ; - int __cil_tmp101 ; - int __cil_tmp102 ; - int __cil_tmp103 ; - unsigned long __cil_tmp104 ; - unsigned long __cil_tmp105 ; - unsigned long __cil_tmp106 ; - unsigned long __cil_tmp107 ; - int __cil_tmp108 ; - unsigned long __cil_tmp109 ; - int __cil_tmp110 ; - unsigned long __cil_tmp111 ; - unsigned long __cil_tmp112 ; - unsigned long __cil_tmp113 ; - unsigned long __cil_tmp114 ; - unsigned long __cil_tmp115 ; - unsigned long __cil_tmp116 ; +int CdAudio435DeviceControl(int DeviceObject, int Irp) { + int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = + __VERIFIER_nondet_int(); + int currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength = + __VERIFIER_nondet_int(); + int currentIrpStack__Parameters__DeviceIoControl__InputBufferLength = + __VERIFIER_nondet_int(); + int TrackData__0 = __VERIFIER_nondet_int(); + int Irp__IoStatus__Information; + int srb__TimeOutValue; + int srb__CdbLength; + int sizeof__CDROM_TOC = __VERIFIER_nondet_int(); + int cdaudioDataOut__LastTrack = __VERIFIER_nondet_int(); + int cdaudioDataOut__FirstTrack = __VERIFIER_nondet_int(); + int sizeof__CDROM_PLAY_AUDIO_MSF = __VERIFIER_nondet_int(); + int sizeof__CDROM_SEEK_AUDIO_MSF = __VERIFIER_nondet_int(); + int deviceExtension__Paused = __VERIFIER_nondet_int(); + int deviceExtension__PlayActive; + int sizeof__SUB_Q_CHANNEL_DATA = __VERIFIER_nondet_int(); + int sizeof__SUB_Q_CURRENT_POSITION = __VERIFIER_nondet_int(); + int deviceExtension = __VERIFIER_nondet_int(); + int srb = __VERIFIER_nondet_int(); + int status; + int i = __VERIFIER_nondet_int(); + int bytesTransfered; + int Toc = __VERIFIER_nondet_int(); + int tmp; + int tracksToReturn; + int tracksOnCd; + int tracksInBuffer; + int SubQPtr = __VERIFIER_nondet_int(); + int userPtr__Format = __VERIFIER_nondet_int(); + int SubQPtr___0 = __VERIFIER_nondet_int(); + int tmp___0; + int tmp___1; + int tmp___2; + int __cil_tmp35; + int __cil_tmp36; + int __cil_tmp37; + int __cil_tmp38; + int __cil_tmp39; + int __cil_tmp40; + int __cil_tmp41; + int __cil_tmp42; + int __cil_tmp43; + int __cil_tmp44; + int __cil_tmp45; + int __cil_tmp46; + int __cil_tmp47; + int __cil_tmp48; + int __cil_tmp49; + int __cil_tmp50; + int __cil_tmp51; + int __cil_tmp52; + int __cil_tmp53; + int __cil_tmp54; + int __cil_tmp55; + int __cil_tmp56; + int __cil_tmp57; + int __cil_tmp58; + int __cil_tmp59; + int __cil_tmp60; + int __cil_tmp61; + int __cil_tmp62; + int __cil_tmp63; + int __cil_tmp64; + int __cil_tmp65; + int __cil_tmp66; + int __cil_tmp67; + int __cil_tmp68; + int __cil_tmp69; + int __cil_tmp70; + int __cil_tmp71; + int __cil_tmp72; + int __cil_tmp73; + int __cil_tmp74; + int __cil_tmp75; + int __cil_tmp76; + int __cil_tmp77; + int __cil_tmp78; + int __cil_tmp79; + int __cil_tmp80; + int __cil_tmp81; + int __cil_tmp82; + int __cil_tmp83; + int __cil_tmp84; + int __cil_tmp85; + int __cil_tmp86; + int __cil_tmp87; + int __cil_tmp88; + int __cil_tmp89; + int __cil_tmp90; + int __cil_tmp91; + int __cil_tmp92; + unsigned long __cil_tmp93; + int __cil_tmp94; + unsigned long __cil_tmp95; + unsigned long __cil_tmp96; + unsigned long __cil_tmp97; + int __cil_tmp98; + int __cil_tmp99; + int __cil_tmp100; + int __cil_tmp101; + int __cil_tmp102; + int __cil_tmp103; + unsigned long __cil_tmp104; + unsigned long __cil_tmp105; + unsigned long __cil_tmp106; + unsigned long __cil_tmp107; + int __cil_tmp108; + unsigned long __cil_tmp109; + int __cil_tmp110; + unsigned long __cil_tmp111; + unsigned long __cil_tmp112; + unsigned long __cil_tmp113; + unsigned long __cil_tmp114; + unsigned long __cil_tmp115; + unsigned long __cil_tmp116; { - { + { #line 846 - __cil_tmp35 = 16384; + __cil_tmp35 = 16384; #line 846 - __cil_tmp36 = 131072; + __cil_tmp36 = 131072; #line 846 - __cil_tmp37 = 147456; + __cil_tmp37 = 147456; #line 846 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp37) { - goto switch_4_exp_10; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp37) { + goto switch_4_exp_10; + } else { + { #line 849 - __cil_tmp38 = 24; + __cil_tmp38 = 24; #line 849 - __cil_tmp39 = 16384; + __cil_tmp39 = 16384; #line 849 - __cil_tmp40 = 131072; + __cil_tmp40 = 131072; #line 849 - __cil_tmp41 = 147456; + __cil_tmp41 = 147456; #line 849 - __cil_tmp42 = 147480; + __cil_tmp42 = 147480; #line 849 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp42) { - goto switch_4_exp_11; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp42) { + goto switch_4_exp_11; + } else { + { #line 852 - __cil_tmp43 = 8; + __cil_tmp43 = 8; #line 852 - __cil_tmp44 = 16384; + __cil_tmp44 = 16384; #line 852 - __cil_tmp45 = 131072; + __cil_tmp45 = 131072; #line 852 - __cil_tmp46 = 147456; + __cil_tmp46 = 147456; #line 852 - __cil_tmp47 = 147464; + __cil_tmp47 = 147464; #line 852 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp47) { - goto switch_4_exp_12; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp47) { + goto switch_4_exp_12; + } else { + { #line 855 - __cil_tmp48 = 4; + __cil_tmp48 = 4; #line 855 - __cil_tmp49 = 16384; + __cil_tmp49 = 16384; #line 855 - __cil_tmp50 = 131072; + __cil_tmp50 = 131072; #line 855 - __cil_tmp51 = 147456; + __cil_tmp51 = 147456; #line 855 - __cil_tmp52 = 147460; + __cil_tmp52 = 147460; #line 855 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp52) { - goto switch_4_exp_13; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp52) { + goto switch_4_exp_13; + } else { + { #line 858 - __cil_tmp53 = 12; + __cil_tmp53 = 12; #line 858 - __cil_tmp54 = 16384; + __cil_tmp54 = 16384; #line 858 - __cil_tmp55 = 131072; + __cil_tmp55 = 131072; #line 858 - __cil_tmp56 = 147456; + __cil_tmp56 = 147456; #line 858 - __cil_tmp57 = 147468; + __cil_tmp57 = 147468; #line 858 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp57) { - goto switch_4_exp_14; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp57) { + goto switch_4_exp_14; + } else { + { #line 861 - __cil_tmp58 = 16; + __cil_tmp58 = 16; #line 861 - __cil_tmp59 = 16384; + __cil_tmp59 = 16384; #line 861 - __cil_tmp60 = 131072; + __cil_tmp60 = 131072; #line 861 - __cil_tmp61 = 147456; + __cil_tmp61 = 147456; #line 861 - __cil_tmp62 = 147472; + __cil_tmp62 = 147472; #line 861 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp62) { - goto switch_4_exp_15; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp62) { + goto switch_4_exp_15; + } else { + { #line 864 - __cil_tmp63 = 44; + __cil_tmp63 = 44; #line 864 - __cil_tmp64 = 16384; + __cil_tmp64 = 16384; #line 864 - __cil_tmp65 = 131072; + __cil_tmp65 = 131072; #line 864 - __cil_tmp66 = 147456; + __cil_tmp66 = 147456; #line 864 - __cil_tmp67 = 147500; + __cil_tmp67 = 147500; #line 864 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp67) { - goto switch_4_exp_16; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp67) { + goto switch_4_exp_16; + } else { + { #line 867 - __cil_tmp68 = 2056; + __cil_tmp68 = 2056; #line 867 - __cil_tmp69 = 16384; + __cil_tmp69 = 16384; #line 867 - __cil_tmp70 = 131072; + __cil_tmp70 = 131072; #line 867 - __cil_tmp71 = 147456; + __cil_tmp71 = 147456; #line 867 - __cil_tmp72 = 149512; + __cil_tmp72 = 149512; #line 867 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp72) { - goto switch_4_exp_17; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp72) { + goto switch_4_exp_17; + } else { + { #line 870 - __cil_tmp73 = 52; + __cil_tmp73 = 52; #line 870 - __cil_tmp74 = 16384; + __cil_tmp74 = 16384; #line 870 - __cil_tmp75 = 131072; + __cil_tmp75 = 131072; #line 870 - __cil_tmp76 = 147456; + __cil_tmp76 = 147456; #line 870 - __cil_tmp77 = 147508; + __cil_tmp77 = 147508; #line 870 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp77) { - goto switch_4_exp_18; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp77) { + goto switch_4_exp_18; + } else { + { #line 873 - __cil_tmp78 = 20; + __cil_tmp78 = 20; #line 873 - __cil_tmp79 = 16384; + __cil_tmp79 = 16384; #line 873 - __cil_tmp80 = 131072; + __cil_tmp80 = 131072; #line 873 - __cil_tmp81 = 147456; + __cil_tmp81 = 147456; #line 873 - __cil_tmp82 = 147476; + __cil_tmp82 = 147476; #line 873 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp82) { - goto switch_4_exp_19; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp82) { + goto switch_4_exp_19; + } else { + { #line 876 - __cil_tmp83 = 40; + __cil_tmp83 = 40; #line 876 - __cil_tmp84 = 16384; + __cil_tmp84 = 16384; #line 876 - __cil_tmp85 = 131072; + __cil_tmp85 = 131072; #line 876 - __cil_tmp86 = 147456; + __cil_tmp86 = 147456; #line 876 - __cil_tmp87 = 147496; + __cil_tmp87 = 147496; #line 876 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp87) { - goto switch_4_exp_20; - } else { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp87) { + goto switch_4_exp_20; + } else { + { #line 879 - __cil_tmp88 = 2048; + __cil_tmp88 = 2048; #line 879 - __cil_tmp89 = 16384; + __cil_tmp89 = 16384; #line 879 - __cil_tmp90 = 131072; + __cil_tmp90 = 131072; #line 879 - __cil_tmp91 = 147456; + __cil_tmp91 = 147456; #line 879 - __cil_tmp92 = 149504; + __cil_tmp92 = 149504; #line 879 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp92) { - goto switch_4_exp_21; - } else { - goto switch_4_default; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp92) { + goto switch_4_exp_21; + } else { + goto switch_4_default; #line 884 - if (0) { - switch_4_exp_10: ; + if (0) { + switch_4_exp_10:; #line 886 - if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < TrackData__0) { + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < + TrackData__0) { #line 887 - status = -1073741789; + status = -1073741789; #line 888 - Irp__IoStatus__Information = 0; - goto switch_4_break; - } - { + Irp__IoStatus__Information = + 0; + goto switch_4_break; + } + { #line 894 - tmp = CdAudioIsPlayActive(DeviceObject); - } + tmp = + CdAudioIsPlayActive( + DeviceObject); + } #line 896 - if (tmp) { + if (tmp) { #line 897 - status = -2147483631; + status = -2147483631; #line 898 - Irp__IoStatus__Information = 0; - goto switch_4_break; - } + Irp__IoStatus__Information = + 0; + goto switch_4_break; + } #line 903 - if (Toc == 0) { + if (Toc == 0) { #line 904 - status = -1073741670; + status = -1073741670; #line 905 - Irp__IoStatus__Information = 0; - { + Irp__IoStatus__Information = + 0; + { #line 906 - __cil_tmp93 = (unsigned long )status; + __cil_tmp93 = + (unsigned long) + status; #line 906 - if (__cil_tmp93 == -2147483626) { + if (__cil_tmp93 == + -2147483626) { #line 907 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 912 - myStatus = status; + myStatus = status; #line 913 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 915 - return (status); - } - { + return (status); + } + { #line 920 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 921 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 922 - status = SendSrbSynchronous(deviceExtension, srb, Toc, - sizeof__CDROM_TOC); - } - { + status = + SendSrbSynchronous( + deviceExtension, + srb, Toc, + sizeof__CDROM_TOC); + } + { #line 925 #line 925 - if (status < 0) { - { + if (status < 0) { + { #line 926 - __cil_tmp95 = (unsigned long )status; + __cil_tmp95 = + (unsigned long) + status; #line 926 - if (__cil_tmp95 != -1073741764) { - { + if (__cil_tmp95 != + -1073741764) { + { #line 927 - __cil_tmp96 = (unsigned long )status; + __cil_tmp96 = + (unsigned long) + status; #line 927 - if (__cil_tmp96 != -1073741764) { - { + if (__cil_tmp96 != + -1073741764) { + { #line 928 - __cil_tmp97 = (unsigned long )status; + __cil_tmp97 = + (unsigned long) + status; #line 928 - if (__cil_tmp97 == -2147483626) { + if (__cil_tmp97 == + -2147483626) { #line 929 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 934 - myStatus = status; + myStatus = + status; #line 935 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 937 - return (status); - } - } - } else { + return ( + status); + } + } + } else { #line 942 - status = 0; - } - } - } else { + status = 0; + } + } + } else { #line 945 - status = 0; - } - } + status = 0; + } + } #line 947 - if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength > sizeof__CDROM_TOC) { + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength > + sizeof__CDROM_TOC) { #line 948 - bytesTransfered = sizeof__CDROM_TOC; - } else { + bytesTransfered = + sizeof__CDROM_TOC; + } else { #line 950 - bytesTransfered = currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength; - } + bytesTransfered = + currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength; + } #line 952 - __cil_tmp98 = cdaudioDataOut__LastTrack - cdaudioDataOut__FirstTrack; + __cil_tmp98 = + cdaudioDataOut__LastTrack - + cdaudioDataOut__FirstTrack; #line 952 - tracksOnCd = __cil_tmp98 + 1; + tracksOnCd = + __cil_tmp98 + 1; #line 953 - tracksInBuffer = currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength - TrackData__0; + tracksInBuffer = + currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength - + TrackData__0; #line 954 - if (tracksInBuffer < tracksOnCd) { + if (tracksInBuffer < + tracksOnCd) { #line 955 - tracksToReturn = tracksInBuffer; - } else { + tracksToReturn = + tracksInBuffer; + } else { #line 957 - tracksToReturn = tracksOnCd; - } + tracksToReturn = + tracksOnCd; + } #line 959 - if (tracksInBuffer > tracksOnCd) { + if (tracksInBuffer > + tracksOnCd) { #line 960 - i ++; - } - goto switch_4_break; - switch_4_exp_11: ; - switch_4_exp_12: - { + i++; + } + goto switch_4_break; + switch_4_exp_11:; + switch_4_exp_12 : { #line 968 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 969 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 970 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 971 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } + status = + SendSrbSynchronous( + deviceExtension, + srb, 0, 0); + } #line 973 - if (status >= 0) { - - } - { + if (status >= 0) { + } + { #line 978 - __cil_tmp99 = 8; + __cil_tmp99 = 8; #line 978 - __cil_tmp100 = 16384; + __cil_tmp100 = 16384; #line 978 - __cil_tmp101 = 131072; + __cil_tmp101 = 131072; #line 978 - __cil_tmp102 = 147456; + __cil_tmp102 = 147456; #line 978 - __cil_tmp103 = 147464; + __cil_tmp103 = 147464; #line 978 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp103) { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp103) { + { #line 979 - __cil_tmp104 = (unsigned long )status; + __cil_tmp104 = + (unsigned long) + status; #line 979 - if (__cil_tmp104 == -2147483626) { + if (__cil_tmp104 == + -2147483626) { #line 980 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 985 - myStatus = status; + myStatus = status; #line 986 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 988 - return (status); - } - } + return (status); + } + } #line 992 - if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CDROM_PLAY_AUDIO_MSF) { + if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < + sizeof__CDROM_PLAY_AUDIO_MSF) { #line 993 - status = -1073741820; - goto switch_4_break; - } - { + status = -1073741820; + goto switch_4_break; + } + { #line 999 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1000 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1001 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } + status = + SendSrbSynchronous( + deviceExtension, + srb, 0, 0); + } #line 1003 - if (status >= 0) { - - } - goto switch_4_break; - switch_4_exp_13: + if (status >= 0) { + } + goto switch_4_break; + switch_4_exp_13: #line 1010 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 1011 - if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CDROM_SEEK_AUDIO_MSF) { + if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < + sizeof__CDROM_SEEK_AUDIO_MSF) { #line 1012 - status = -1073741820; - goto switch_4_break; - } - { + status = -1073741820; + goto switch_4_break; + } + { #line 1018 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1019 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1020 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } + status = + SendSrbSynchronous( + deviceExtension, + srb, 0, 0); + } #line 1022 - if (status < 0) { - { + if (status < 0) { + { #line 1025 - __cil_tmp105 = (unsigned long )status; + __cil_tmp105 = + (unsigned long) + status; #line 1025 - if (__cil_tmp105 == -1073741808) { + if (__cil_tmp105 == + -1073741808) { #line 1026 - status = -1073741803; - } - } - } - goto switch_4_break; - switch_4_exp_14: + status = + -1073741803; + } + } + } + goto switch_4_break; + switch_4_exp_14: #line 1033 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 1034 - if (SubQPtr == 0) { + if (SubQPtr == 0) { #line 1035 - status = -1073741670; - { + status = -1073741670; + { #line 1036 - __cil_tmp106 = (unsigned long )status; + __cil_tmp106 = + (unsigned long) + status; #line 1036 - if (__cil_tmp106 == -2147483626) { + if (__cil_tmp106 == + -2147483626) { #line 1037 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1042 - myStatus = status; + myStatus = status; #line 1043 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1045 - return (status); - } + return (status); + } #line 1049 - if (deviceExtension__Paused == 1) { + if (deviceExtension__Paused == + 1) { #line 1050 - status = 0; - { + status = 0; + { #line 1051 - __cil_tmp107 = (unsigned long )status; + __cil_tmp107 = + (unsigned long) + status; #line 1051 - if (__cil_tmp107 == -2147483626) { + if (__cil_tmp107 == + -2147483626) { #line 1052 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1057 - myStatus = status; + myStatus = status; #line 1058 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1060 - return (status); - } - { + return (status); + } + { #line 1065 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1066 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1067 - status = SendSrbSynchronous(deviceExtension, srb, SubQPtr, - sizeof__SUB_Q_CHANNEL_DATA); - } - { + status = SendSrbSynchronous( + deviceExtension, + srb, SubQPtr, + sizeof__SUB_Q_CHANNEL_DATA); + } + { #line 1070 #line 1070 - if (status < 0) { - { + if (status < 0) { + { #line 1071 - __cil_tmp109 = (unsigned long )status; + __cil_tmp109 = + (unsigned long) + status; #line 1071 - if (__cil_tmp109 == -2147483626) { + if (__cil_tmp109 == + -2147483626) { #line 1072 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1077 - myStatus = status; + myStatus = status; #line 1078 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1080 - return (status); - } - } - { + return (status); + } + } + { #line 1085 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1086 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1087 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } - { + status = + SendSrbSynchronous( + deviceExtension, + srb, 0, 0); + } + { #line 1089 #line 1089 - if (status < 0) { - { + if (status < 0) { + { #line 1090 - __cil_tmp111 = (unsigned long )status; + __cil_tmp111 = + (unsigned long) + status; #line 1090 - if (__cil_tmp111 == -2147483626) { + if (__cil_tmp111 == + -2147483626) { #line 1091 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1096 - myStatus = status; + myStatus = status; #line 1097 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1099 - return (status); - } - } - goto switch_4_break; - switch_4_exp_15: + return (status); + } + } + goto switch_4_break; + switch_4_exp_15: #line 1105 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 1106 - if (deviceExtension__Paused == 0) { + if (deviceExtension__Paused == + 0) { #line 1107 - status = -1073741823; - { + status = -1073741823; + { #line 1108 - __cil_tmp112 = (unsigned long )status; + __cil_tmp112 = + (unsigned long) + status; #line 1108 - if (__cil_tmp112 == -2147483626) { + if (__cil_tmp112 == + -2147483626) { #line 1109 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1114 - myStatus = status; + myStatus = status; #line 1115 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1117 - return (status); - } - { + return (status); + } + { #line 1122 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1123 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1124 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } + status = + SendSrbSynchronous( + deviceExtension, + srb, 0, 0); + } #line 1126 - if (status >= 0) { + if (status >= 0) { #line 1127 - deviceExtension__PlayActive = 1; + deviceExtension__PlayActive = + 1; #line 1128 - deviceExtension__Paused = 0; - } - goto switch_4_break; - switch_4_exp_16: ; + deviceExtension__Paused = + 0; + } + goto switch_4_break; + switch_4_exp_16:; #line 1134 - if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < sizeof__SUB_Q_CURRENT_POSITION) { + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < + sizeof__SUB_Q_CURRENT_POSITION) { #line 1135 - status = -1073741789; + status = -1073741789; #line 1136 - Irp__IoStatus__Information = 0; - goto switch_4_break; - } + Irp__IoStatus__Information = + 0; + goto switch_4_break; + } #line 1141 - if (SubQPtr___0 == 0) { + if (SubQPtr___0 == 0) { #line 1142 - status = -1073741670; + status = -1073741670; #line 1143 - Irp__IoStatus__Information = 0; - { + Irp__IoStatus__Information = + 0; + { #line 1144 - __cil_tmp113 = (unsigned long )status; + __cil_tmp113 = + (unsigned long) + status; #line 1144 - if (__cil_tmp113 == -2147483626) { + if (__cil_tmp113 == + -2147483626) { #line 1145 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1150 - myStatus = status; + myStatus = status; #line 1151 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1153 - return (status); - } + return (status); + } #line 1157 - if (userPtr__Format != 1) { + if (userPtr__Format != + 1) { #line 1158 - status = -1073741823; + status = -1073741823; #line 1159 - Irp__IoStatus__Information = 0; - { + Irp__IoStatus__Information = + 0; + { #line 1160 - __cil_tmp114 = (unsigned long )status; + __cil_tmp114 = + (unsigned long) + status; #line 1160 - if (__cil_tmp114 == -2147483626) { + if (__cil_tmp114 == + -2147483626) { #line 1161 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1166 - myStatus = status; + myStatus = status; #line 1167 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1169 - return (status); - } - { + return (status); + } + { #line 1174 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1175 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1176 - status = SendSrbSynchronous(deviceExtension, srb, SubQPtr___0, - sizeof__SUB_Q_CHANNEL_DATA); - } + status = SendSrbSynchronous( + deviceExtension, + srb, SubQPtr___0, + sizeof__SUB_Q_CHANNEL_DATA); + } #line 1179 - if (status >= 0) { + if (status >= 0) { #line 1180 - if (deviceExtension__Paused == 1) { + if (deviceExtension__Paused == + 1) { #line 1181 - deviceExtension__PlayActive = 0; - } + deviceExtension__PlayActive = + 0; + } #line 1185 - Irp__IoStatus__Information = sizeof__SUB_Q_CURRENT_POSITION; - } else { + Irp__IoStatus__Information = + sizeof__SUB_Q_CURRENT_POSITION; + } else { #line 1187 - Irp__IoStatus__Information = 0; - } - goto switch_4_break; - switch_4_exp_17: - { + Irp__IoStatus__Information = + 0; + } + goto switch_4_break; + switch_4_exp_17 : { #line 1192 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 1193 - srb__CdbLength = 10; + srb__CdbLength = 10; #line 1194 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1195 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } - goto switch_4_break; - switch_4_exp_18: ; - switch_4_exp_19: ; - switch_4_exp_20: + status = + SendSrbSynchronous( + deviceExtension, + srb, 0, 0); + } + goto switch_4_break; + switch_4_exp_18:; + switch_4_exp_19:; + switch_4_exp_20: #line 1201 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 1202 - status = -1073741808; - goto switch_4_break; - switch_4_exp_21: - { + status = -1073741808; + goto switch_4_break; + switch_4_exp_21 : { #line 1206 - tmp___1 = CdAudioIsPlayActive(DeviceObject); - } + tmp___1 = + CdAudioIsPlayActive( + DeviceObject); + } #line 1208 - if (tmp___1 == 1) { + if (tmp___1 == 1) { #line 1209 - deviceExtension__PlayActive = 1; + deviceExtension__PlayActive = + 1; #line 1210 - status = 0; + status = 0; #line 1211 - Irp__IoStatus__Information = 0; - { + Irp__IoStatus__Information = + 0; + { #line 1212 - __cil_tmp115 = (unsigned long )status; + __cil_tmp115 = + (unsigned long) + status; #line 1212 - if (__cil_tmp115 == -2147483626) { + if (__cil_tmp115 == + -2147483626) { #line 1213 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = + 0; + } + } + { #line 1218 - myStatus = status; + myStatus = status; #line 1219 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest( + Irp, 0); + } #line 1221 - return (status); - } else { - { + return (status); + } else { + { #line 1224 - deviceExtension__PlayActive = 0; + deviceExtension__PlayActive = + 0; #line 1225 - tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); - } + tmp___0 = + CdAudioSendToNextDriver( + DeviceObject, + Irp); + } #line 1227 - return (tmp___0); - } - goto switch_4_break; - switch_4_default: - { + return (tmp___0); + } + goto switch_4_break; + switch_4_default : { #line 1232 - tmp___2 = CdAudioSendToNextDriver(DeviceObject, Irp); - } + tmp___2 = + CdAudioSendToNextDriver( + DeviceObject, + Irp); + } #line 1234 - return (tmp___2); - goto switch_4_break; - } else { - switch_4_break: ; + return (tmp___2); + goto switch_4_break; + } else { + switch_4_break:; + } + } + } + } + } + } + } + } + } + } + } + } + } } } - } - } } } - } - } } } - } - } } } - } - } } } - } - } } } - } - } - } - { + { #line 1252 - __cil_tmp116 = (unsigned long )status; + __cil_tmp116 = (unsigned long)status; #line 1252 - if (__cil_tmp116 == -2147483626) { + if (__cil_tmp116 == -2147483626) { #line 1253 - Irp__IoStatus__Information = 0; - } - } - { + Irp__IoStatus__Information = 0; + } + } + { #line 1258 - myStatus = status; + myStatus = status; #line 1259 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 1261 - return (status); -} + return (status); + } } #line 1264 "cdaudio_simpl1.cil.c" -int CdAudioAtapiDeviceControl(int DeviceObject , int Irp ) -{ int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Information ; - int deviceExtension__PlayActive ; - int srb__CdbLength ; - int srb__TimeOutValue ; - int Irp__IoStatus__Status ; - int status ; - int deviceExtension = __VERIFIER_nondet_int() ; - int srb = __VERIFIER_nondet_int() ; - int tmp ; - int __cil_tmp13 ; - int __cil_tmp14 ; - int __cil_tmp15 ; - int __cil_tmp16 ; - int __cil_tmp17 ; - int __cil_tmp18 ; +int CdAudioAtapiDeviceControl(int DeviceObject, int Irp) { + int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = + __VERIFIER_nondet_int(); + int Irp__IoStatus__Information; + int deviceExtension__PlayActive; + int srb__CdbLength; + int srb__TimeOutValue; + int Irp__IoStatus__Status; + int status; + int deviceExtension = __VERIFIER_nondet_int(); + int srb = __VERIFIER_nondet_int(); + int tmp; + int __cil_tmp13; + int __cil_tmp14; + int __cil_tmp15; + int __cil_tmp16; + int __cil_tmp17; + int __cil_tmp18; { - { + { #line 1277 - __cil_tmp13 = 8; + __cil_tmp13 = 8; #line 1277 - __cil_tmp14 = 16384; + __cil_tmp14 = 16384; #line 1277 - __cil_tmp15 = 131072; + __cil_tmp15 = 131072; #line 1277 - __cil_tmp16 = 147456; + __cil_tmp16 = 147456; #line 1277 - __cil_tmp17 = 147464; + __cil_tmp17 = 147464; #line 1277 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp17) { - { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp17) { + { #line 1279 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 1280 - deviceExtension__PlayActive = 0; + deviceExtension__PlayActive = 0; #line 1281 - srb__CdbLength = 12; + srb__CdbLength = 12; #line 1282 - srb__TimeOutValue = 10; + srb__TimeOutValue = 10; #line 1283 - status = SendSrbSynchronous(deviceExtension, srb, 0, 0); - } - { + status = SendSrbSynchronous(deviceExtension, srb, 0, 0); + } + { #line 1285 #line 1285 - if (status < 0) { - { + if (status < 0) { + { #line 1287 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = status; #line 1288 - myStatus = status; + myStatus = status; #line 1289 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 1291 - return (status); - } - } - } else { - { + return (status); + } + } + } else { + { #line 1297 - tmp = CdAudioSendToNextDriver(DeviceObject, Irp); - } + tmp = CdAudioSendToNextDriver(DeviceObject, Irp); + } #line 1299 - return (tmp); - } - } - { + return (tmp); + } + } + { #line 1302 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = status; #line 1303 - myStatus = status; + myStatus = status; #line 1304 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 1306 - return (status); -} + return (status); + } } #line 1309 "cdaudio_simpl1.cil.c" -void HpCdrProcessLastSession(int Toc ) -{ int index = __VERIFIER_nondet_int() ; +void HpCdrProcessLastSession(int Toc) { + int index = __VERIFIER_nondet_int(); { #line 1313 - if (index) { + if (index) { #line 1314 - index --; - } + index--; + } #line 1318 - return; -} + return; + } } #line 1321 "cdaudio_simpl1.cil.c" -int HPCdrCompletion(int DeviceObject , int Irp , int Context ) -{ int Irp__PendingReturned = __VERIFIER_nondet_int() ; - int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int() ; +int HPCdrCompletion(int DeviceObject, int Irp, int Context) { + int Irp__PendingReturned = __VERIFIER_nondet_int(); + int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int(); { #line 1326 - if (Irp__PendingReturned) { + if (Irp__PendingReturned) { #line 1327 - if (pended == 0) { + if (pended == 0) { #line 1328 - pended = 1; - } else { - { + pended = 1; + } else { + { #line 1331 - errorFn(); + errorFn(); + } } } - } #line 1337 - if (myStatus >= 0) { - { + if (myStatus >= 0) { + { #line 1339 - HpCdrProcessLastSession(Irp__AssociatedIrp__SystemBuffer); + HpCdrProcessLastSession(Irp__AssociatedIrp__SystemBuffer); + } } - } #line 1344 - return (myStatus); -} + return (myStatus); + } } #line 1347 "cdaudio_simpl1.cil.c" -int CdAudioHPCdrDeviceControl(int DeviceObject , int Irp ) -{ int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int irpSp__Control ; - int tmp ; - int tmp___0 ; - int __cil_tmp8 ; - int __cil_tmp9 ; - int __cil_tmp10 ; - int __cil_tmp11 ; - int __cil_tmp12 ; +int CdAudioHPCdrDeviceControl(int DeviceObject, int Irp) { + int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = + __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int irpSp__Control; + int tmp; + int tmp___0; + int __cil_tmp8; + int __cil_tmp9; + int __cil_tmp10; + int __cil_tmp11; + int __cil_tmp12; { - { + { #line 1355 - __cil_tmp8 = 56; + __cil_tmp8 = 56; #line 1355 - __cil_tmp9 = 16384; + __cil_tmp9 = 16384; #line 1355 - __cil_tmp10 = 131072; + __cil_tmp10 = 131072; #line 1355 - __cil_tmp11 = 147456; + __cil_tmp11 = 147456; #line 1355 - __cil_tmp12 = 147512; + __cil_tmp12 = 147512; #line 1355 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp12) { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp12) { #line 1356 - if (s != NP) { - { + if (s != NP) { + { #line 1358 - errorFn(); - } - } else { + errorFn(); + } + } else { #line 1361 - if (compRegistered != 0) { - { + if (compRegistered != 0) { + { #line 1363 - errorFn(); - } - } else { + errorFn(); + } + } else { #line 1366 - compRegistered = 1; + compRegistered = 1; #line 1367 - routine = 0; - } - } - { + routine = 0; + } + } + { #line 1371 - irpSp__Control = 224; + irpSp__Control = 224; #line 1375 - tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); - } + tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); + } #line 1377 - return (tmp); - } else { - { + return (tmp); + } else { + { #line 1380 - tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); - } + tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); + } #line 1382 - return (tmp___0); - } - } + return (tmp___0); + } + } #line 1384 - return (-1073741823); -} + return (-1073741823); + } } #line 1387 "cdaudio_simpl1.cil.c" -int CdAudioForwardIrpSynchronous(int DeviceObject , int Irp ) -{ int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int event = __VERIFIER_nondet_int() ; - int status ; - int irpSp__Control ; +int CdAudioForwardIrpSynchronous(int DeviceObject, int Irp) { + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int event = __VERIFIER_nondet_int(); + int status; + int irpSp__Control; { #line 1394 - if (s != NP) { - { -#line 1396 - errorFn(); - } - } else { -#line 1399 - if (compRegistered != 0) { + if (s != NP) { { -#line 1401 - errorFn(); +#line 1396 + errorFn(); } } else { +#line 1399 + if (compRegistered != 0) { + { +#line 1401 + errorFn(); + } + } else { #line 1404 - compRegistered = 1; + compRegistered = 1; #line 1405 - routine = 1; + routine = 1; + } } - } - { + { #line 1409 - irpSp__Control = 224; + irpSp__Control = 224; #line 1413 - status = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); + status = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); #line 1414 - status = 259; - } + status = 259; + } #line 1416 - if (status) { - { + if (status) { + { #line 1418 - KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); + KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); #line 1419 - status = myStatus; + status = myStatus; + } } - } #line 1424 - return (status); -} + return (status); + } } #line 1427 "cdaudio_simpl1.cil.c" -void CdAudioUnload(int DriverObject ) -{ +void CdAudioUnload(int DriverObject) { { #line 1431 - return; -} + return; + } } #line 1434 "cdaudio_simpl1.cil.c" -int CdAudioPower(int DeviceObject , int Irp ) -{ int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int tmp ; +int CdAudioPower(int DeviceObject, int Irp) { + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int tmp; { #line 1441 - if (s == NP) { + if (s == NP) { #line 1442 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 1445 - errorFn(); + errorFn(); + } } - } - { + { #line 1449 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 1450 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 1451 - tmp = PoCallDriver(deviceExtension__TargetDeviceObject, Irp); - } + tmp = PoCallDriver(deviceExtension__TargetDeviceObject, Irp); + } #line 1453 - return (tmp); -} + return (tmp); + } } #line 1456 "cdaudio_simpl1.cil.c" -void stub_driver_init(void) -{ +void stub_driver_init(void) { { #line 1460 - s = NP; + s = NP; #line 1461 - customIrp = 0; + customIrp = 0; #line 1462 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 1463 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 1464 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 1465 - compFptr = compRegistered; + compFptr = compRegistered; #line 1466 - pended = compFptr; + pended = compFptr; #line 1467 - return; -} + return; + } } #line 1470 "cdaudio_simpl1.cil.c" -int main(void) -{ int pirp__IoStatus__Status ; - int d = __VERIFIER_nondet_int() ; - int status = __VERIFIER_nondet_int() ; - int irp = __VERIFIER_nondet_int() ; - int we_should_unload = __VERIFIER_nondet_int() ; - int irp_choice = __VERIFIER_nondet_int() ; - int devobj = __VERIFIER_nondet_int() ; - int __cil_tmp9 ; +int main(void) { + int pirp__IoStatus__Status; + int d = __VERIFIER_nondet_int(); + int status = __VERIFIER_nondet_int(); + int irp = __VERIFIER_nondet_int(); + int we_should_unload = __VERIFIER_nondet_int(); + int irp_choice = __VERIFIER_nondet_int(); + int devobj = __VERIFIER_nondet_int(); + int __cil_tmp9; { - { - - s = 0; - UNLOADED = 0; - NP = 0; - DC = 0; - SKIP1 = 0; - SKIP2 = 0; - MPR1 = 0; - MPR3 = 0; - IPC = 0; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - routine = 0; - myStatus = 0; - pirp = 0; - Executive = 0; - Suspended = 5; - KernelMode = 0; - DeviceUsageTypePaging = 1; + { + s = 0; + UNLOADED = 0; + NP = 0; + DC = 0; + SKIP1 = 0; + SKIP2 = 0; + MPR1 = 0; + MPR3 = 0; + IPC = 0; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + routine = 0; + myStatus = 0; + pirp = 0; + Executive = 0; + Suspended = 5; + KernelMode = 0; + DeviceUsageTypePaging = 1; #line 1482 - pirp = irp; + pirp = irp; #line 1483 - _BLAST_init(); - } + _BLAST_init(); + } #line 1485 - if (status >= 0) { + if (status >= 0) { #line 1486 - s = NP; + s = NP; #line 1487 - customIrp = 0; + customIrp = 0; #line 1488 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 1489 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 1490 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 1491 - compFptr = compRegistered; + compFptr = compRegistered; #line 1492 - pended = compFptr; + pended = compFptr; #line 1493 - pirp__IoStatus__Status = 0; + pirp__IoStatus__Status = 0; #line 1494 - myStatus = 0; + myStatus = 0; #line 1495 - if (irp_choice == 0) { + if (irp_choice == 0) { #line 1496 - pirp__IoStatus__Status = -1073741637; + pirp__IoStatus__Status = -1073741637; #line 1497 - myStatus = -1073741637; - } - { + myStatus = -1073741637; + } + { #line 1502 - stub_driver_init(); - } - { + stub_driver_init(); + } + { #line 1504 #line 1504 - if (status < 0) { + if (status < 0) { #line 1505 - return (-1); - } - } + return (-1); + } + } #line 1509 - int tmp_ndt_1; - tmp_ndt_1 = __VERIFIER_nondet_int(); - if (tmp_ndt_1 == 2) { - goto switch_5_2; - } else { -#line 1512 - int tmp_ndt_2; - tmp_ndt_2 = __VERIFIER_nondet_int(); - if (tmp_ndt_2 == 3) { - goto switch_5_3; + int tmp_ndt_1; + tmp_ndt_1 = __VERIFIER_nondet_int(); + if (tmp_ndt_1 == 2) { + goto switch_5_2; } else { -#line 1515 - int tmp_ndt_3; - tmp_ndt_3 = __VERIFIER_nondet_int(); - if (tmp_ndt_3 == 4) { - goto switch_5_4; +#line 1512 + int tmp_ndt_2; + tmp_ndt_2 = __VERIFIER_nondet_int(); + if (tmp_ndt_2 == 3) { + goto switch_5_3; } else { - goto switch_5_default; +#line 1515 + int tmp_ndt_3; + tmp_ndt_3 = __VERIFIER_nondet_int(); + if (tmp_ndt_3 == 4) { + goto switch_5_4; + } else { + goto switch_5_default; #line 1520 - if (0) { - switch_5_2: - { + if (0) { + switch_5_2 : { #line 1523 - status = CdAudioDeviceControl(devobj, pirp); + status = CdAudioDeviceControl(devobj, pirp); } - goto switch_5_break; - switch_5_3: - { + goto switch_5_break; + switch_5_3 : { #line 1528 - status = CdAudioPnp(devobj, pirp); + status = CdAudioPnp(devobj, pirp); } - goto switch_5_break; - switch_5_4: - { + goto switch_5_break; + switch_5_4 : { #line 1533 - status = CdAudioPower(devobj, pirp); + status = CdAudioPower(devobj, pirp); } - goto switch_5_break; - switch_5_default: ; + goto switch_5_break; + switch_5_default:; #line 1537 - return (-1); - } else { - switch_5_break: ; + return (-1); + } else { + switch_5_break:; + } } } } - } #line 1545 - if (we_should_unload) { - { + if (we_should_unload) { + { #line 1547 - CdAudioUnload(d); + CdAudioUnload(d); + } } } - } #line 1555 - if (pended == 1) { + if (pended == 1) { #line 1556 - if (s == NP) { + if (s == NP) { #line 1557 - s = NP; + s = NP; + } else { + goto _L___2; + } } else { - goto _L___2; - } - } else { - _L___2: + _L___2: #line 1563 - if (pended == 1) { + if (pended == 1) { #line 1564 - if (s == MPR3) { + if (s == MPR3) { #line 1565 - s = MPR3; + s = MPR3; + } else { + goto _L___1; + } } else { - goto _L___1; - } - } else { - _L___1: + _L___1: #line 1571 - if (s != UNLOADED) { + if (s != UNLOADED) { #line 1574 - if (status != -1) { + if (status != -1) { #line 1577 - if (s != SKIP2) { + if (s != SKIP2) { #line 1578 - if (s != IPC) { + if (s != IPC) { #line 1579 - if (s != DC) { - { + if (s != DC) { + { #line 1581 - errorFn(); + errorFn(); + } + } else { + goto _L___0; } } else { goto _L___0; } } else { - goto _L___0; - } - } else { - _L___0: + _L___0: #line 1591 - if (pended != 1) { + if (pended != 1) { #line 1594 - if (s == DC) { + if (s == DC) { #line 1595 - if (status == 259) { - { + if (status == 259) { + { #line 1597 - errorFn(); + errorFn(); + } } - } - } else { + } else { #line 1603 - if (status != lowerDriverReturn) { - { + if (status != lowerDriverReturn) { + { #line 1605 - errorFn(); + errorFn(); + } } } } @@ -2579,370 +2778,364 @@ int main(void) } } } - } #line 1617 - return (status); -} + return (status); + } } #line 1620 "cdaudio_simpl1.cil.c" -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { #line 1624 - if (s == NP) { + if (s == NP) { #line 1625 - s = MPR1; - } else { - { + s = MPR1; + } else { + { #line 1628 - errorFn(); + errorFn(); + } } - } #line 1631 - return; -} + return; + } } #line 1634 "cdaudio_simpl1.cil.c" -int IofCallDriver(int DeviceObject , int Irp ) -{ int Irp__PendingReturned = __VERIFIER_nondet_int() ; - int returnVal2 ; - int compRetStatus ; - int lcontext = __VERIFIER_nondet_int() ; - unsigned long __cil_tmp8 ; +int IofCallDriver(int DeviceObject, int Irp) { + int Irp__PendingReturned = __VERIFIER_nondet_int(); + int returnVal2; + int compRetStatus; + int lcontext = __VERIFIER_nondet_int(); + unsigned long __cil_tmp8; { #line 1642 - if (compRegistered) { + if (compRegistered) { #line 1643 - if (routine == 0) { - { + if (routine == 0) { + { #line 1645 - compRetStatus = HPCdrCompletion(DeviceObject, Irp, lcontext); - } - } else { + compRetStatus = HPCdrCompletion(DeviceObject, Irp, lcontext); + } + } else { #line 1648 - if (routine == 1) { - { + if (routine == 1) { + { #line 1650 - compRetStatus = CdAudioSignalCompletion(DeviceObject, Irp, lcontext); + compRetStatus = + CdAudioSignalCompletion(DeviceObject, Irp, lcontext); + } } } - } - { + { #line 1656 - __cil_tmp8 = (unsigned long )compRetStatus; + __cil_tmp8 = (unsigned long)compRetStatus; #line 1656 - if (__cil_tmp8 == -1073741802) { - { + if (__cil_tmp8 == -1073741802) { + { #line 1658 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 1666 - if (Irp__PendingReturned) { + if (Irp__PendingReturned) { #line 1667 - returnVal2 = 259; - } else { -#line 1669 - int tmp_ndt_5; - tmp_ndt_5 = __VERIFIER_nondet_int(); - if (tmp_ndt_5 == 0) { - goto switch_6_0; + returnVal2 = 259; } else { -#line 1672 - int tmp_ndt_6; - tmp_ndt_6 = __VERIFIER_nondet_int(); - if (tmp_ndt_6 == 1) { - goto switch_6_1; +#line 1669 + int tmp_ndt_5; + tmp_ndt_5 = __VERIFIER_nondet_int(); + if (tmp_ndt_5 == 0) { + goto switch_6_0; } else { - goto switch_6_default; +#line 1672 + int tmp_ndt_6; + tmp_ndt_6 = __VERIFIER_nondet_int(); + if (tmp_ndt_6 == 1) { + goto switch_6_1; + } else { + goto switch_6_default; #line 1677 - if (0) { - switch_6_0: + if (0) { + switch_6_0: #line 1679 - returnVal2 = 0; - goto switch_6_break; - switch_6_1: + returnVal2 = 0; + goto switch_6_break; + switch_6_1: #line 1682 - returnVal2 = -1073741823; - goto switch_6_break; - switch_6_default: + returnVal2 = -1073741823; + goto switch_6_break; + switch_6_default: #line 1685 - returnVal2 = 259; - goto switch_6_break; - } else { - switch_6_break: ; + returnVal2 = 259; + goto switch_6_break; + } else { + switch_6_break:; + } } } } - } #line 1694 - if (s == NP) { + if (s == NP) { #line 1695 - s = IPC; + s = IPC; #line 1696 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 1698 - if (s == MPR1) { + if (s == MPR1) { #line 1699 - if (returnVal2 == 259) { + if (returnVal2 == 259) { #line 1700 - s = MPR3; + s = MPR3; #line 1701 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 1703 - s = NP; + s = NP; #line 1704 - lowerDriverReturn = returnVal2; - } - } else { + lowerDriverReturn = returnVal2; + } + } else { #line 1707 - if (s == SKIP1) { + if (s == SKIP1) { #line 1708 - s = SKIP2; + s = SKIP2; #line 1709 - lowerDriverReturn = returnVal2; - } else { - { + lowerDriverReturn = returnVal2; + } else { + { #line 1712 - errorFn(); + errorFn(); + } } } } - } #line 1717 - return (returnVal2); -} + return (returnVal2); + } } #line 1720 "cdaudio_simpl1.cil.c" -void IofCompleteRequest(int Irp , int PriorityBoost ) -{ +void IofCompleteRequest(int Irp, int PriorityBoost) { { #line 1724 - if (s == NP) { + if (s == NP) { #line 1725 - s = DC; - } else { - { + s = DC; + } else { + { #line 1728 - errorFn(); + errorFn(); + } } - } #line 1731 - return; -} + return; + } } #line 1734 "cdaudio_simpl1.cil.c" -int KeSetEvent(int Event , int Increment , int Wait ) -{ int l = __VERIFIER_nondet_int() ; +int KeSetEvent(int Event, int Increment, int Wait) { + int l = __VERIFIER_nondet_int(); { #line 1738 - setEventCalled = 1; + setEventCalled = 1; #line 1739 - return (l); -} + return (l); + } } #line 1742 "cdaudio_simpl1.cil.c" -int KeWaitForSingleObject(int Object , int WaitReason , int WaitMode , int Alertable , - int Timeout ) -{ +int KeWaitForSingleObject(int Object, int WaitReason, int WaitMode, + int Alertable, int Timeout) { { #line 1747 - if (s == MPR3) { + if (s == MPR3) { #line 1748 - if (setEventCalled == 1) { + if (setEventCalled == 1) { #line 1749 - s = NP; + s = NP; #line 1750 - setEventCalled = 0; + setEventCalled = 0; + } else { + goto _L; + } } else { - goto _L; - } - } else { - _L: + _L: #line 1756 - if (customIrp == 1) { + if (customIrp == 1) { #line 1757 - s = NP; + s = NP; #line 1758 - customIrp = 0; - } else { + customIrp = 0; + } else { #line 1760 - if (s == MPR3) { - { + if (s == MPR3) { + { #line 1762 - errorFn(); + errorFn(); + } } } } - } #line 1769 - int tmp_ndt_7; - tmp_ndt_7 = __VERIFIER_nondet_int(); - if (tmp_ndt_7 == 0) { - goto switch_7_0; - } else { - goto switch_7_default; + int tmp_ndt_7; + tmp_ndt_7 = __VERIFIER_nondet_int(); + if (tmp_ndt_7 == 0) { + goto switch_7_0; + } else { + goto switch_7_default; #line 1774 - if (0) { - switch_7_0: ; + if (0) { + switch_7_0:; #line 1776 - return (0); - switch_7_default: ; + return (0); + switch_7_default:; #line 1778 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1786 "cdaudio_simpl1.cil.c" -int PoCallDriver(int DeviceObject , int Irp ) -{ - int compRetStatus ; - int returnVal ; - int lcontext = __VERIFIER_nondet_int() ; - unsigned long __cil_tmp7 ; - long __cil_tmp8 ; +int PoCallDriver(int DeviceObject, int Irp) { + int compRetStatus; + int returnVal; + int lcontext = __VERIFIER_nondet_int(); + unsigned long __cil_tmp7; + long __cil_tmp8; { #line 1793 - if (compRegistered) { + if (compRegistered) { #line 1794 - if (routine == 0) { - { + if (routine == 0) { + { #line 1796 - compRetStatus = HPCdrCompletion(DeviceObject, Irp, lcontext); - } - } else { + compRetStatus = HPCdrCompletion(DeviceObject, Irp, lcontext); + } + } else { #line 1799 - if (routine == 1) { - { + if (routine == 1) { + { #line 1801 - compRetStatus = CdAudioSignalCompletion(DeviceObject, Irp, lcontext); + compRetStatus = + CdAudioSignalCompletion(DeviceObject, Irp, lcontext); + } } } - } - { + { #line 1807 - __cil_tmp7 = (unsigned long )compRetStatus; + __cil_tmp7 = (unsigned long)compRetStatus; #line 1807 - if (__cil_tmp7 == -1073741802) { - { + if (__cil_tmp7 == -1073741802) { + { #line 1809 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 1817 - int tmp_ndt_8; - tmp_ndt_8 = __VERIFIER_nondet_int(); - if (tmp_ndt_8 == 0) { - goto switch_8_0; - } else { -#line 1820 - int tmp_ndt_9; - tmp_ndt_9 = __VERIFIER_nondet_int(); - if (tmp_ndt_9 == 1) { - goto switch_8_1; + int tmp_ndt_8; + tmp_ndt_8 = __VERIFIER_nondet_int(); + if (tmp_ndt_8 == 0) { + goto switch_8_0; } else { - goto switch_8_default; +#line 1820 + int tmp_ndt_9; + tmp_ndt_9 = __VERIFIER_nondet_int(); + if (tmp_ndt_9 == 1) { + goto switch_8_1; + } else { + goto switch_8_default; #line 1825 - if (0) { - switch_8_0: + if (0) { + switch_8_0: #line 1827 - returnVal = 0; - goto switch_8_break; - switch_8_1: + returnVal = 0; + goto switch_8_break; + switch_8_1: #line 1830 - returnVal = -1073741823; - goto switch_8_break; - switch_8_default: + returnVal = -1073741823; + goto switch_8_break; + switch_8_default: #line 1833 - returnVal = 259; - goto switch_8_break; - } else { - switch_8_break: ; + returnVal = 259; + goto switch_8_break; + } else { + switch_8_break:; + } } } - } #line 1841 - if (s == NP) { + if (s == NP) { #line 1842 - s = IPC; + s = IPC; #line 1843 - lowerDriverReturn = returnVal; - } else { + lowerDriverReturn = returnVal; + } else { #line 1845 - if (s == MPR1) { - { + if (s == MPR1) { + { #line 1846 - __cil_tmp8 = (long )returnVal; + __cil_tmp8 = (long)returnVal; #line 1846 - if (__cil_tmp8 == 259L) { + if (__cil_tmp8 == 259L) { #line 1847 - s = MPR3; + s = MPR3; #line 1848 - lowerDriverReturn = returnVal; - } else { + lowerDriverReturn = returnVal; + } else { #line 1850 - s = NP; + s = NP; #line 1851 - lowerDriverReturn = returnVal; - } - } - } else { + lowerDriverReturn = returnVal; + } + } + } else { #line 1854 - if (s == SKIP1) { + if (s == SKIP1) { #line 1855 - s = SKIP2; + s = SKIP2; #line 1856 - lowerDriverReturn = returnVal; - } else { - { + lowerDriverReturn = returnVal; + } else { + { #line 1859 - errorFn(); + errorFn(); + } } } } - } #line 1864 - return (returnVal); -} + return (returnVal); + } } #line 1867 "cdaudio_simpl1.cil.c" -int ZwClose(int Handle ) -{ +int ZwClose(int Handle) { { #line 1871 - int tmp_ndt_10; - tmp_ndt_10 = __VERIFIER_nondet_int(); - if (tmp_ndt_10 == 0) { - goto switch_9_0; - } else { - goto switch_9_default; + int tmp_ndt_10; + tmp_ndt_10 = __VERIFIER_nondet_int(); + if (tmp_ndt_10 == 0) { + goto switch_9_0; + } else { + goto switch_9_default; #line 1876 - if (0) { - switch_9_0: ; + if (0) { + switch_9_0:; #line 1878 - return (0); - switch_9_default: ; + return (0); + switch_9_default:; #line 1880 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} diff --git a/test/ntdrivers-simplified/diskperf_simpl1_true.cil.c b/test/ntdrivers-simplified/diskperf_simpl1_true.cil.c index 8fb40e6a8..ff59132f3 100644 --- a/test/ntdrivers-simplified/diskperf_simpl1_true.cil.c +++ b/test/ntdrivers-simplified/diskperf_simpl1_true.cil.c @@ -6,1083 +6,1075 @@ extern char __VERIFIER_nondet_char(void); extern int __VERIFIER_nondet_int(void); extern long __VERIFIER_nondet_long(void); extern void *__VERIFIER_nondet_pointer(void); -void IofCompleteRequest(int Irp , int PriorityBoost ); -int __VERIFIER_nondet_int() ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -int compFptr ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -int myStatus ; -int routine ; -int pirp ; -int Executive ; -int KernelMode ; +void IofCompleteRequest(int Irp, int PriorityBoost); +int __VERIFIER_nondet_int(); +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +int compFptr; +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +int myStatus; +int routine; +int pirp; +int Executive; +int KernelMode; -void errorFn(void) -{ +void errorFn(void) { { - goto ERROR; - ERROR: assert(0); + goto ERROR; + ERROR: + assert(0); #line 58 - return; -} + return; + } } #line 61 "diskperf_simpl1.cil.c" -void _BLAST_init(void) -{ +void _BLAST_init(void) { { #line 65 - UNLOADED = 0; + UNLOADED = 0; #line 66 - NP = 1; + NP = 1; #line 67 - DC = 2; + DC = 2; #line 68 - SKIP1 = 3; + SKIP1 = 3; #line 69 - SKIP2 = 4; + SKIP2 = 4; #line 70 - MPR1 = 5; + MPR1 = 5; #line 71 - MPR3 = 6; + MPR3 = 6; #line 72 - IPC = 7; + IPC = 7; #line 73 - s = UNLOADED; + s = UNLOADED; #line 74 - pended = 0; + pended = 0; #line 75 - compFptr = 0; + compFptr = 0; #line 76 - compRegistered = 0; + compRegistered = 0; #line 77 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 78 - setEventCalled = 0; + setEventCalled = 0; #line 79 - customIrp = 0; + customIrp = 0; #line 80 - return; -} + return; + } } #line 83 "diskperf_simpl1.cil.c" -void DiskPerfSyncFilterWithTarget(int FilterDevice , int TargetDevice ) -{ int FilterDevice__Flags ; - int TargetDevice__Characteristics ; - int FilterDevice__Characteristics ; - int propFlags ; +void DiskPerfSyncFilterWithTarget(int FilterDevice, int TargetDevice) { + int FilterDevice__Flags; + int TargetDevice__Characteristics; + int FilterDevice__Characteristics; + int propFlags; { #line 90 - //propFlags = 0; +// propFlags = 0; #line 91 - //FilterDevice__Flags |= propFlags; +// FilterDevice__Flags |= propFlags; #line 92 - //propFlags = TargetDevice__Characteristics & 7; +// propFlags = TargetDevice__Characteristics & 7; #line 93 - //FilterDevice__Characteristics |= propFlags; +// FilterDevice__Characteristics |= propFlags; #line 94 - return; -} + return; + } } #line 97 "diskperf_simpl1.cil.c" -int DiskPerfDispatchPnp(int DeviceObject , int Irp ) -{ int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int irpSp__MinorFunction = __VERIFIER_nondet_int() ; - int irpSp ; - int status ; - int tmp ; +int DiskPerfDispatchPnp(int DeviceObject, int Irp) { + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int irpSp__MinorFunction = __VERIFIER_nondet_int(); + int irpSp; + int status; + int tmp; { #line 105 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = Irp__Tail__Overlay__CurrentStackLocation; #line 106 - if (irpSp__MinorFunction == 0) { - goto switch_0_0; - } else { -#line 109 - if (irpSp__MinorFunction == 2) { - goto switch_0_2; + if (irpSp__MinorFunction == 0) { + goto switch_0_0; } else { - goto switch_0_default; +#line 109 + if (irpSp__MinorFunction == 2) { + goto switch_0_2; + } else { + goto switch_0_default; #line 114 - if (0) { - switch_0_0: - { + if (0) { + switch_0_0 : { #line 117 - status = DiskPerfStartDevice(DeviceObject, Irp); + status = DiskPerfStartDevice(DeviceObject, Irp); } - goto switch_0_break; - switch_0_2: - { + goto switch_0_break; + switch_0_2 : { #line 122 - status = DiskPerfRemoveDevice(DeviceObject, Irp); + status = DiskPerfRemoveDevice(DeviceObject, Irp); } - goto switch_0_break; - switch_0_default: - { + goto switch_0_break; + switch_0_default : { #line 127 - tmp = DiskPerfSendToNextDriver(DeviceObject, Irp); + tmp = DiskPerfSendToNextDriver(DeviceObject, Irp); } #line 129 - return (tmp); - } else { - switch_0_break: ; + return (tmp); + } else { + switch_0_break:; + } } } - } #line 136 - return (status); -} + return (status); + } } #line 139 "diskperf_simpl1.cil.c" -int DiskPerfIrpCompletion(int DeviceObject , int Irp , int Context ) -{ int Event ; +int DiskPerfIrpCompletion(int DeviceObject, int Irp, int Context) { + int Event; { - { + { #line 144 - Event = Context; + Event = Context; #line 145 - KeSetEvent(Event, 0, 0); - } + KeSetEvent(Event, 0, 0); + } #line 147 - return (-1073741802); -} + return (-1073741802); + } } #line 150 "diskperf_simpl1.cil.c" -int DiskPerfStartDevice(int DeviceObject , int Irp ) -{ int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int deviceExtension ; - int status ; +int DiskPerfStartDevice(int DeviceObject, int Irp) { + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int deviceExtension; + int status; { - { + { #line 159 - deviceExtension = DeviceObject__DeviceExtension; + deviceExtension = DeviceObject__DeviceExtension; #line 160 - status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp); + status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp); #line 161 - DiskPerfSyncFilterWithTarget(DeviceObject, deviceExtension__TargetDeviceObject); + DiskPerfSyncFilterWithTarget(DeviceObject, + deviceExtension__TargetDeviceObject); #line 162 - DiskPerfRegisterDevice(DeviceObject); + DiskPerfRegisterDevice(DeviceObject); #line 163 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = status; #line 164 - myStatus = status; + myStatus = status; #line 165 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 167 - return (status); -} + return (status); + } } #line 170 "diskperf_simpl1.cil.c" -int DiskPerfRemoveDevice(int DeviceObject , int Irp ) -{ int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int deviceExtension__WmilibContext = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int status ; - int deviceExtension ; - int wmilibContext ; +int DiskPerfRemoveDevice(int DeviceObject, int Irp) { + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int deviceExtension__WmilibContext = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int status; + int deviceExtension; + int wmilibContext; { - { + { #line 180 - deviceExtension = DeviceObject__DeviceExtension; + deviceExtension = DeviceObject__DeviceExtension; #line 181 - wmilibContext = deviceExtension__WmilibContext; + wmilibContext = deviceExtension__WmilibContext; #line 182 - status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp); + status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp); #line 183 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = status; #line 184 - myStatus = status; + myStatus = status; #line 185 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 187 - return (status); -} + return (status); + } } #line 190 "diskperf_simpl1.cil.c" -int DiskPerfSendToNextDriver(int DeviceObject , int Irp ) -{ int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int deviceExtension ; - int tmp ; +int DiskPerfSendToNextDriver(int DeviceObject, int Irp) { + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int deviceExtension; + int tmp; { #line 199 - if (s == NP) { + if (s == NP) { #line 200 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 203 - errorFn(); + errorFn(); + } } - } - { + { #line 207 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 208 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 209 - deviceExtension = DeviceObject__DeviceExtension; + deviceExtension = DeviceObject__DeviceExtension; #line 210 - tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); - } + tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); + } #line 212 - return (tmp); -} + return (tmp); + } } #line 215 "diskperf_simpl1.cil.c" -int DiskPerfDispatchPower(int DeviceObject , int Irp ) -{ int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int deviceExtension ; - int tmp ; +int DiskPerfDispatchPower(int DeviceObject, int Irp) { + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int deviceExtension; + int tmp; { #line 224 - if (s == NP) { + if (s == NP) { #line 225 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 228 - errorFn(); + errorFn(); + } } - } - { + { #line 232 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 233 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 234 - deviceExtension = DeviceObject__DeviceExtension; + deviceExtension = DeviceObject__DeviceExtension; #line 235 - tmp = PoCallDriver(deviceExtension__TargetDeviceObject, Irp); - } + tmp = PoCallDriver(deviceExtension__TargetDeviceObject, Irp); + } #line 237 - return (tmp); -} + return (tmp); + } } #line 240 "diskperf_simpl1.cil.c" -int DiskPerfForwardIrpSynchronous(int DeviceObject , int Irp ) -{ int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int deviceExtension ; - int event = __VERIFIER_nondet_int() ; - int status ; - int nextIrpSp__Control ; - int irpSp ; - int nextIrpSp ; - int irpSp__Context ; - int irpSp__Control ; - int irpSp___0 ; - long __cil_tmp15 ; +int DiskPerfForwardIrpSynchronous(int DeviceObject, int Irp) { + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int deviceExtension; + int event = __VERIFIER_nondet_int(); + int status; + int nextIrpSp__Control; + int irpSp; + int nextIrpSp; + int irpSp__Context; + int irpSp__Control; + int irpSp___0; + long __cil_tmp15; { #line 255 - deviceExtension = DeviceObject__DeviceExtension; + deviceExtension = DeviceObject__DeviceExtension; #line 256 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = Irp__Tail__Overlay__CurrentStackLocation; #line 257 - nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; + nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 258 - nextIrpSp__Control = 0; + nextIrpSp__Control = 0; #line 259 - if (s != NP) { - { -#line 261 - errorFn(); - } - } else { -#line 264 - if (compRegistered != 0) { + if (s != NP) { { -#line 266 - errorFn(); +#line 261 + errorFn(); } } else { +#line 264 + if (compRegistered != 0) { + { +#line 266 + errorFn(); + } + } else { #line 269 - compRegistered = 1; + compRegistered = 1; #line 270 - routine = 0; + routine = 0; + } } - } - { + { #line 274 - irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation - 1; + irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 275 - irpSp__Context = event; + irpSp__Context = event; #line 276 - irpSp__Control = 224; + irpSp__Control = 224; #line 280 - status = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); - } - { + status = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); + } + { #line 282 - __cil_tmp15 = (long )status; + __cil_tmp15 = (long)status; #line 282 - if (__cil_tmp15 == 259L) { - { + if (__cil_tmp15 == 259L) { + { #line 284 - KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); + KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); #line 285 - status = myStatus; + status = myStatus; + } + } } - } - } #line 290 - return (status); -} + return (status); + } } #line 293 "diskperf_simpl1.cil.c" -int DiskPerfCreate(int DeviceObject , int Irp ) -{ +int DiskPerfCreate(int DeviceObject, int Irp) { { - { + { #line 298 - myStatus = 0; + myStatus = 0; #line 299 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 301 - return (0); -} + return (0); + } } #line 304 "diskperf_simpl1.cil.c" -int DiskPerfIoCompletion(int DeviceObject , int Irp , int Context ) -{ int irpStack__MajorFunction = __VERIFIER_nondet_int() ; - int partitionCounters__BytesRead__QuadPart = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Information = __VERIFIER_nondet_int() ; - int partitionCounters__ReadCount = __VERIFIER_nondet_int() ; - int partitionCounters__ReadTime__QuadPart = __VERIFIER_nondet_int() ; - int difference__QuadPart = __VERIFIER_nondet_int() ; - int partitionCounters__BytesWritten__QuadPart = __VERIFIER_nondet_int() ; - int partitionCounters__WriteCount = __VERIFIER_nondet_int() ; - int partitionCounters__WriteTime__QuadPart = __VERIFIER_nondet_int() ; - int Irp__Flags = __VERIFIER_nondet_int() ; - int partitionCounters__SplitCount = __VERIFIER_nondet_int() ; - int Irp__PendingReturned = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation__Control ; - int partitionCounters = __VERIFIER_nondet_int() ; - int queueLen = __VERIFIER_nondet_int() ; +int DiskPerfIoCompletion(int DeviceObject, int Irp, int Context) { + int irpStack__MajorFunction = __VERIFIER_nondet_int(); + int partitionCounters__BytesRead__QuadPart = __VERIFIER_nondet_int(); + int Irp__IoStatus__Information = __VERIFIER_nondet_int(); + int partitionCounters__ReadCount = __VERIFIER_nondet_int(); + int partitionCounters__ReadTime__QuadPart = __VERIFIER_nondet_int(); + int difference__QuadPart = __VERIFIER_nondet_int(); + int partitionCounters__BytesWritten__QuadPart = __VERIFIER_nondet_int(); + int partitionCounters__WriteCount = __VERIFIER_nondet_int(); + int partitionCounters__WriteTime__QuadPart = __VERIFIER_nondet_int(); + int Irp__Flags = __VERIFIER_nondet_int(); + int partitionCounters__SplitCount = __VERIFIER_nondet_int(); + int Irp__PendingReturned = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation__Control; + int partitionCounters = __VERIFIER_nondet_int(); + int queueLen = __VERIFIER_nondet_int(); { #line 322 - if (partitionCounters == 0) { + if (partitionCounters == 0) { #line 323 - return (0); - } + return (0); + } #line 327 - if (queueLen < 0) { - - } + if (queueLen < 0) { + } #line 332 - if (queueLen == 0) { - - } + if (queueLen == 0) { + } #line 337 - if (irpStack__MajorFunction == 3) { + if (irpStack__MajorFunction == 3) { #line 338 - partitionCounters__BytesRead__QuadPart += Irp__IoStatus__Information; + partitionCounters__BytesRead__QuadPart += Irp__IoStatus__Information; #line 339 - partitionCounters__ReadCount ++; + partitionCounters__ReadCount++; #line 340 - partitionCounters__ReadTime__QuadPart += difference__QuadPart; - } else { + partitionCounters__ReadTime__QuadPart += difference__QuadPart; + } else { #line 342 - partitionCounters__BytesWritten__QuadPart += Irp__IoStatus__Information; + partitionCounters__BytesWritten__QuadPart += Irp__IoStatus__Information; #line 343 - partitionCounters__WriteCount ++; + partitionCounters__WriteCount++; #line 344 - partitionCounters__WriteTime__QuadPart += difference__QuadPart; - } + partitionCounters__WriteTime__QuadPart += difference__QuadPart; + } #line 346 - if (Irp__Flags != 8) { + if (Irp__Flags != 8) { #line 347 - partitionCounters__SplitCount ++; - } - else { - } + partitionCounters__SplitCount++; + } else { + } #line 351 - if (Irp__PendingReturned) { + if (Irp__PendingReturned) { #line 352 - if (pended == 0) { + if (pended == 0) { #line 353 - pended = 1; - } else { - { + pended = 1; + } else { + { #line 356 - errorFn(); + errorFn(); + } } - } #line 359 - //Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; - } + // Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; + } #line 363 - return (0); -} + return (0); + } } #line 366 "diskperf_simpl1.cil.c" -int DiskPerfDeviceControl(int DeviceObject , int Irp ) -{ int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; - int currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength = __VERIFIER_nondet_int() ; - int sizeof__DISK_PERFORMANCE = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Information ; - int deviceExtension__DiskCounters = __VERIFIER_nondet_int() ; - int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int() ; - int deviceExtension__Processors = __VERIFIER_nondet_int() ; - int totalCounters__QueueDepth ; - int deviceExtension__QueueDepth = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int deviceExtension ; - int currentIrpStack ; - int status ; - int i ; - int totalCounters ; - int diskCounters ; - int tmp ; - int __cil_tmp24 ; - int __cil_tmp25 ; - int __cil_tmp26 ; +int DiskPerfDeviceControl(int DeviceObject, int Irp) { + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = + __VERIFIER_nondet_int(); + int currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength = + __VERIFIER_nondet_int(); + int sizeof__DISK_PERFORMANCE = __VERIFIER_nondet_int(); + int Irp__IoStatus__Information; + int deviceExtension__DiskCounters = __VERIFIER_nondet_int(); + int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int(); + int deviceExtension__Processors = __VERIFIER_nondet_int(); + int totalCounters__QueueDepth; + int deviceExtension__QueueDepth = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int deviceExtension; + int currentIrpStack; + int status; + int i; + int totalCounters; + int diskCounters; + int tmp; + int __cil_tmp24; + int __cil_tmp25; + int __cil_tmp26; { #line 390 - deviceExtension = DeviceObject__DeviceExtension; + deviceExtension = DeviceObject__DeviceExtension; #line 391 - currentIrpStack = Irp__Tail__Overlay__CurrentStackLocation; - { + currentIrpStack = Irp__Tail__Overlay__CurrentStackLocation; + { #line 392 - __cil_tmp24 = 32; + __cil_tmp24 = 32; #line 392 - __cil_tmp25 = 458752; + __cil_tmp25 = 458752; #line 392 - __cil_tmp26 = 458784; + __cil_tmp26 = 458784; #line 392 - if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp26) { + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp26) { #line 393 - if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < sizeof__DISK_PERFORMANCE) { + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < + sizeof__DISK_PERFORMANCE) { #line 394 - status = -1073741789; + status = -1073741789; #line 395 - Irp__IoStatus__Information = 0; - } else { + Irp__IoStatus__Information = 0; + } else { #line 397 - diskCounters = deviceExtension__DiskCounters; + diskCounters = deviceExtension__DiskCounters; #line 398 - if (diskCounters == 0) { - { + if (diskCounters == 0) { + { #line 400 - Irp__IoStatus__Status = -1073741823; + Irp__IoStatus__Status = -1073741823; #line 401 - myStatus = -1073741823; + myStatus = -1073741823; #line 402 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 404 - return (-1073741823); - } + return (-1073741823); + } #line 408 - totalCounters = Irp__AssociatedIrp__SystemBuffer; + totalCounters = Irp__AssociatedIrp__SystemBuffer; #line 409 - i = 0; - { + i = 0; + { #line 411 - while (1) { - while_0_continue: /* CIL Label */ ; + while (1) { + while_0_continue: /* CIL Label */; #line 413 - if (i >= deviceExtension__Processors) { - goto while_1_break; - } + if (i >= deviceExtension__Processors) { + goto while_1_break; + } #line 418 - i ++; - } - while_0_break: /* CIL Label */ ; - } - while_1_break: + i++; + } + while_0_break: /* CIL Label */; + } + while_1_break: #line 422 - totalCounters__QueueDepth = deviceExtension__QueueDepth; + totalCounters__QueueDepth = deviceExtension__QueueDepth; #line 423 - status = 0; + status = 0; #line 424 - Irp__IoStatus__Information = sizeof__DISK_PERFORMANCE; - } - { + Irp__IoStatus__Information = sizeof__DISK_PERFORMANCE; + } + { #line 427 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = status; #line 428 - myStatus = status; + myStatus = status; #line 429 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 431 - return (status); - } else { - { + return (status); + } else { + { #line 434 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 435 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 436 - tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); - } + tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); + } #line 438 - return (tmp); - } + return (tmp); + } + } } } -} #line 442 "diskperf_simpl1.cil.c" -int DiskPerfShutdownFlush(int DeviceObject , int Irp ) -{ int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int deviceExtension ; - int tmp ; +int DiskPerfShutdownFlush(int DeviceObject, int Irp) { + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int deviceExtension; + int tmp; { - { + { #line 452 - deviceExtension = DeviceObject__DeviceExtension; + deviceExtension = DeviceObject__DeviceExtension; #line 453 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 454 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 455 - tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); - } + tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); + } #line 457 - return (tmp); -} + return (tmp); + } } #line 460 "diskperf_simpl1.cil.c" -void DiskPerfUnload(int DriverObject ) -{ +void DiskPerfUnload(int DriverObject) { { #line 464 - return; -} + return; + } } #line 467 "diskperf_simpl1.cil.c" -int DiskPerfRegisterDevice(int DeviceObject ) -{ int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; - int sizeof__number = __VERIFIER_nondet_int() ; - int ioStatus__Status = __VERIFIER_nondet_int() ; - int sizeof__VOLUME_NUMBER = __VERIFIER_nondet_int() ; - int volumeNumber__VolumeManagerName__0 = __VERIFIER_nondet_int() ; - int status ; - int ioStatus = __VERIFIER_nondet_int() ; - int event = __VERIFIER_nondet_int() ; - int deviceExtension ; - int irp ; - int number = __VERIFIER_nondet_int() ; - int registrationFlag ; - int sizeof__MOUNTDEV_NAME = __VERIFIER_nondet_int() ; - int output__NameLength = __VERIFIER_nondet_int() ; - int outputSize ; - int output = __VERIFIER_nondet_int() ; - int volumeNumber = __VERIFIER_nondet_int() ; - int __cil_tmp20 ; - int __cil_tmp21 ; - int __cil_tmp22 ; - long __cil_tmp23 ; - int __cil_tmp24 ; - int __cil_tmp25 ; - int __cil_tmp26 ; - long __cil_tmp27 ; - unsigned long __cil_tmp28 ; - int __cil_tmp29 ; - int __cil_tmp30 ; - int __cil_tmp31 ; - long __cil_tmp32 ; - int __cil_tmp33 ; - int __cil_tmp34 ; - int __cil_tmp35 ; - int __cil_tmp36 ; - long __cil_tmp37 ; - int __cil_tmp38 ; - int __cil_tmp39 ; +int DiskPerfRegisterDevice(int DeviceObject) { + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int(); + int sizeof__number = __VERIFIER_nondet_int(); + int ioStatus__Status = __VERIFIER_nondet_int(); + int sizeof__VOLUME_NUMBER = __VERIFIER_nondet_int(); + int volumeNumber__VolumeManagerName__0 = __VERIFIER_nondet_int(); + int status; + int ioStatus = __VERIFIER_nondet_int(); + int event = __VERIFIER_nondet_int(); + int deviceExtension; + int irp; + int number = __VERIFIER_nondet_int(); + int registrationFlag; + int sizeof__MOUNTDEV_NAME = __VERIFIER_nondet_int(); + int output__NameLength = __VERIFIER_nondet_int(); + int outputSize; + int output = __VERIFIER_nondet_int(); + int volumeNumber = __VERIFIER_nondet_int(); + int __cil_tmp20; + int __cil_tmp21; + int __cil_tmp22; + long __cil_tmp23; + int __cil_tmp24; + int __cil_tmp25; + int __cil_tmp26; + long __cil_tmp27; + unsigned long __cil_tmp28; + int __cil_tmp29; + int __cil_tmp30; + int __cil_tmp31; + long __cil_tmp32; + int __cil_tmp33; + int __cil_tmp34; + int __cil_tmp35; + int __cil_tmp36; + long __cil_tmp37; + int __cil_tmp38; + int __cil_tmp39; { - { + { #line 489 - registrationFlag = 0; + registrationFlag = 0; #line 490 - deviceExtension = DeviceObject__DeviceExtension; + deviceExtension = DeviceObject__DeviceExtension; #line 491 - __cil_tmp20 = 4224; + __cil_tmp20 = 4224; #line 491 - __cil_tmp21 = 2949120; + __cil_tmp21 = 2949120; #line 491 - __cil_tmp22 = 2953344; + __cil_tmp22 = 2953344; #line 491 - irp = IoBuildDeviceIoControlRequest(__cil_tmp22, deviceExtension__TargetDeviceObject, - 0, 0, number, sizeof__number, 0, event, ioStatus); - } + irp = IoBuildDeviceIoControlRequest( + __cil_tmp22, deviceExtension__TargetDeviceObject, 0, 0, number, + sizeof__number, 0, event, ioStatus); + } #line 494 - if (! irp) { + if (!irp) { #line 495 - return (-1073741670); - } - { + return (-1073741670); + } + { #line 500 - status = IofCallDriver(deviceExtension__TargetDeviceObject, irp); - } - { + status = IofCallDriver(deviceExtension__TargetDeviceObject, irp); + } + { #line 502 - __cil_tmp23 = (long )status; + __cil_tmp23 = (long)status; #line 502 - if (__cil_tmp23 == 259L) { - { + if (__cil_tmp23 == 259L) { + { #line 504 - KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); + KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); #line 505 - status = ioStatus__Status; + status = ioStatus__Status; + } + } } - } - } #line 510 - if (status < 0) { + if (status < 0) { #line 513 - outputSize = sizeof__MOUNTDEV_NAME; + outputSize = sizeof__MOUNTDEV_NAME; #line 514 - if (! output) { + if (!output) { #line 515 - return (-1073741670); - } - { + return (-1073741670); + } + { #line 520 - __cil_tmp24 = 8; + __cil_tmp24 = 8; #line 520 - __cil_tmp25 = 5046272; + __cil_tmp25 = 5046272; #line 520 - __cil_tmp26 = 5046280; + __cil_tmp26 = 5046280; #line 520 - irp = IoBuildDeviceIoControlRequest(__cil_tmp26, deviceExtension__TargetDeviceObject, - 0, 0, output, outputSize, 0, event, ioStatus); - } + irp = IoBuildDeviceIoControlRequest( + __cil_tmp26, deviceExtension__TargetDeviceObject, 0, 0, output, + outputSize, 0, event, ioStatus); + } #line 523 - if (! irp) { + if (!irp) { #line 524 - return (-1073741670); - } - { + return (-1073741670); + } + { #line 529 - status = IofCallDriver(deviceExtension__TargetDeviceObject, irp); - } - { + status = IofCallDriver(deviceExtension__TargetDeviceObject, irp); + } + { #line 531 - __cil_tmp27 = (long )status; + __cil_tmp27 = (long)status; #line 531 - if (__cil_tmp27 == 259L) { - { + if (__cil_tmp27 == 259L) { + { #line 533 - KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); + KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); #line 534 - status = ioStatus__Status; + status = ioStatus__Status; + } + } } - } - } - { + { #line 539 - __cil_tmp28 = (unsigned long )status; + __cil_tmp28 = (unsigned long)status; #line 539 - if (__cil_tmp28 == -2147483643) { + if (__cil_tmp28 == -2147483643) { #line 540 - outputSize = sizeof__MOUNTDEV_NAME + output__NameLength; + outputSize = sizeof__MOUNTDEV_NAME + output__NameLength; #line 541 - if (! output) { + if (!output) { #line 542 - return (-1073741670); - } - { + return (-1073741670); + } + { #line 547 - __cil_tmp29 = 8; + __cil_tmp29 = 8; #line 547 - __cil_tmp30 = 5046272; + __cil_tmp30 = 5046272; #line 547 - __cil_tmp31 = 5046280; + __cil_tmp31 = 5046280; #line 547 - irp = IoBuildDeviceIoControlRequest(__cil_tmp31, deviceExtension__TargetDeviceObject, - 0, 0, output, outputSize, 0, event, ioStatus); - } + irp = IoBuildDeviceIoControlRequest( + __cil_tmp31, deviceExtension__TargetDeviceObject, 0, 0, output, + outputSize, 0, event, ioStatus); + } #line 550 - if (! irp) { + if (!irp) { #line 551 - return (-1073741670); - } - { + return (-1073741670); + } + { #line 556 - status = IofCallDriver(deviceExtension__TargetDeviceObject, irp); - } - { + status = IofCallDriver(deviceExtension__TargetDeviceObject, irp); + } + { #line 558 - __cil_tmp32 = (long )status; + __cil_tmp32 = (long)status; #line 558 - if (__cil_tmp32 == 259L) { - { + if (__cil_tmp32 == 259L) { + { #line 560 - KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); + KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); #line 561 - status = ioStatus__Status; + status = ioStatus__Status; + } + } + } } } - } - } - } - { + { #line 569 - if (status < 0) { + if (status < 0) { #line 570 - return (status); - } - } - { + return (status); + } + } + { #line 575 - __cil_tmp34 = 28; + __cil_tmp34 = 28; #line 575 - __cil_tmp35 = 5636096; + __cil_tmp35 = 5636096; #line 575 - __cil_tmp36 = 5636124; + __cil_tmp36 = 5636124; #line 575 - irp = IoBuildDeviceIoControlRequest(__cil_tmp36, deviceExtension__TargetDeviceObject, - 0, 0, volumeNumber, sizeof__VOLUME_NUMBER, - 0, event, ioStatus); - } + irp = IoBuildDeviceIoControlRequest( + __cil_tmp36, deviceExtension__TargetDeviceObject, 0, 0, + volumeNumber, sizeof__VOLUME_NUMBER, 0, event, ioStatus); + } #line 579 - if (! irp) { + if (!irp) { #line 580 - return (-1073741670); - } - { + return (-1073741670); + } + { #line 585 - status = IofCallDriver(deviceExtension__TargetDeviceObject, irp); - } - { + status = IofCallDriver(deviceExtension__TargetDeviceObject, irp); + } + { #line 587 - __cil_tmp37 = (long )status; + __cil_tmp37 = (long)status; #line 587 - if (__cil_tmp37 == 259L) { - { + if (__cil_tmp37 == 259L) { + { #line 589 - KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); + KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); #line 590 - status = ioStatus__Status; + status = ioStatus__Status; + } + } } - } - } - { + { #line 595 - if (status < 0) { - goto _L; - } else { + if (status < 0) { + goto _L; + } else { #line 598 - if (volumeNumber__VolumeManagerName__0 == 0) { - _L: + if (volumeNumber__VolumeManagerName__0 == 0) { + _L: #line 600 - if (status >= 0) { - + if (status >= 0) { + } + } } } } - } - } - { + { #line 610 #line 610 - if (status < 0) { - - } - } + if (status < 0) { + } + } #line 615 - return (status); -} + return (status); + } } #line 618 "diskperf_simpl1.cil.c" -void stub_driver_init(void) -{ +void stub_driver_init(void) { { #line 622 - s = NP; + s = NP; #line 623 - customIrp = 0; + customIrp = 0; #line 624 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 625 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 626 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 627 - compFptr = compRegistered; + compFptr = compRegistered; #line 628 - pended = compFptr; + pended = compFptr; #line 629 - return; -} + return; + } } #line 632 "diskperf_simpl1.cil.c" -int main(void) -{ int d = __VERIFIER_nondet_int() ; - int status = __VERIFIER_nondet_int() ; - int we_should_unload = __VERIFIER_nondet_int() ; - int irp = __VERIFIER_nondet_int() ; - int pirp__IoStatus__Status ; - int irp_choice = __VERIFIER_nondet_int() ; - int devobj = __VERIFIER_nondet_int() ; - int __cil_tmp9 ; +int main(void) { + int d = __VERIFIER_nondet_int(); + int status = __VERIFIER_nondet_int(); + int we_should_unload = __VERIFIER_nondet_int(); + int irp = __VERIFIER_nondet_int(); + int pirp__IoStatus__Status; + int irp_choice = __VERIFIER_nondet_int(); + int devobj = __VERIFIER_nondet_int(); + int __cil_tmp9; - s = 0; - UNLOADED = 0; - NP = 0; - DC = 0; - SKIP1 = 0; - SKIP2 = 0; - MPR1 = 0; - MPR3 = 0; - IPC = 0; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - myStatus = 0; - routine = 0; - pirp = 0; - Executive = 0; - KernelMode = 0; + s = 0; + UNLOADED = 0; + NP = 0; + DC = 0; + SKIP1 = 0; + SKIP2 = 0; + MPR1 = 0; + MPR3 = 0; + IPC = 0; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + myStatus = 0; + routine = 0; + pirp = 0; + Executive = 0; + KernelMode = 0; { - { + { #line 644 - pirp = irp; + pirp = irp; #line 645 - _BLAST_init(); - } + _BLAST_init(); + } #line 647 - if (status >= 0) { + if (status >= 0) { #line 648 - s = NP; + s = NP; #line 649 - customIrp = 0; + customIrp = 0; #line 650 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 651 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 652 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 653 - compFptr = compRegistered; + compFptr = compRegistered; #line 654 - pended = compFptr; + pended = compFptr; #line 655 - pirp__IoStatus__Status = 0; + pirp__IoStatus__Status = 0; #line 656 - myStatus = 0; + myStatus = 0; #line 657 - if (irp_choice == 0) { + if (irp_choice == 0) { #line 658 - pirp__IoStatus__Status = -1073741637; + pirp__IoStatus__Status = -1073741637; #line 659 - myStatus = -1073741637; - } - { + myStatus = -1073741637; + } + { #line 664 - stub_driver_init(); - } - { + stub_driver_init(); + } + { #line 666 - if (status < 0) { + if (status < 0) { #line 667 - return (-1); - } - } + return (-1); + } + } #line 671 - int tmp_ndt_1; - tmp_ndt_1 = __VERIFIER_nondet_int(); - if (tmp_ndt_1 == 0) { - goto switch_2_0; - } else { -#line 674 - int tmp_ndt_2; - tmp_ndt_2 = __VERIFIER_nondet_int(); - if (tmp_ndt_2 == 2) { - goto switch_2_2; + int tmp_ndt_1; + tmp_ndt_1 = __VERIFIER_nondet_int(); + if (tmp_ndt_1 == 0) { + goto switch_2_0; } else { -#line 677 - int tmp_ndt_3; - tmp_ndt_3 = __VERIFIER_nondet_int(); - if (tmp_ndt_3 == 3) { - goto switch_2_3; +#line 674 + int tmp_ndt_2; + tmp_ndt_2 = __VERIFIER_nondet_int(); + if (tmp_ndt_2 == 2) { + goto switch_2_2; } else { -#line 680 - int tmp_ndt_4; - tmp_ndt_4 = __VERIFIER_nondet_int(); - if (tmp_ndt_4 == 4) { - goto switch_2_4; +#line 677 + int tmp_ndt_3; + tmp_ndt_3 = __VERIFIER_nondet_int(); + if (tmp_ndt_3 == 3) { + goto switch_2_3; } else { -#line 683 - int tmp_ndt_5; - tmp_ndt_5 = __VERIFIER_nondet_int(); - if (tmp_ndt_5 == 12) { - goto switch_2_12; +#line 680 + int tmp_ndt_4; + tmp_ndt_4 = __VERIFIER_nondet_int(); + if (tmp_ndt_4 == 4) { + goto switch_2_4; } else { - goto switch_2_default; +#line 683 + int tmp_ndt_5; + tmp_ndt_5 = __VERIFIER_nondet_int(); + if (tmp_ndt_5 == 12) { + goto switch_2_12; + } else { + goto switch_2_default; #line 688 - if (0) { - switch_2_0: - { + if (0) { + switch_2_0 : { #line 691 - status = DiskPerfCreate(devobj, pirp); + status = DiskPerfCreate(devobj, pirp); } - goto switch_2_break; - switch_2_2: - { + goto switch_2_break; + switch_2_2 : { #line 696 - status = DiskPerfDeviceControl(devobj, pirp); + status = DiskPerfDeviceControl(devobj, pirp); } - goto switch_2_break; - switch_2_3: - { + goto switch_2_break; + switch_2_3 : { #line 701 - status = DiskPerfDispatchPnp(devobj, pirp); + status = DiskPerfDispatchPnp(devobj, pirp); } - goto switch_2_break; - switch_2_4: - { + goto switch_2_break; + switch_2_4 : { #line 706 - status = DiskPerfDispatchPower(devobj, pirp); + status = DiskPerfDispatchPower(devobj, pirp); } - goto switch_2_break; - switch_2_12: - { + goto switch_2_break; + switch_2_12 : { #line 711 - status = DiskPerfShutdownFlush(devobj, pirp); + status = DiskPerfShutdownFlush(devobj, pirp); } - goto switch_2_break; - switch_2_default: ; + goto switch_2_break; + switch_2_default:; #line 715 - return (-1); - } else { - switch_2_break: ; + return (-1); + } else { + switch_2_break:; + } } } } } } - } #line 725 - if (we_should_unload) { - { + if (we_should_unload) { + { #line 727 - DiskPerfUnload(d); + DiskPerfUnload(d); + } } } - } #line 735 - if (pended == 1) { + if (pended == 1) { #line 736 - if (s == NP) { + if (s == NP) { #line 737 - s = NP; + s = NP; + } else { + goto _L___2; + } } else { - goto _L___2; - } - } else { - _L___2: + _L___2: #line 743 - if (pended == 1) { + if (pended == 1) { #line 744 - if (s == MPR3) { + if (s == MPR3) { #line 745 - s = MPR3; + s = MPR3; + } else { + goto _L___1; + } } else { - goto _L___1; - } - } else { - _L___1: + _L___1: #line 751 - if (s != UNLOADED) { + if (s != UNLOADED) { #line 754 - if (status != -1) { + if (status != -1) { #line 757 - if (s != SKIP2) { + if (s != SKIP2) { #line 758 - if (s != IPC) { + if (s != IPC) { #line 759 - if (s != DC) { - { + if (s != DC) { + { #line 761 - errorFn(); + errorFn(); + } + } else { + goto _L___0; } } else { goto _L___0; } } else { - goto _L___0; - } - } else { - _L___0: + _L___0: #line 771 - if (pended == 1) { + if (pended == 1) { #line 772 - if (status != 259) { - { + if (status != 259) { + { #line 774 - errorFn(); + errorFn(); + } } - } - } else { + } else { #line 780 - if (s == DC) { + if (s == DC) { #line 781 - if (status == 259) { - { + if (status == 259) { + { #line 783 - errorFn(); + errorFn(); + } } - } - } else { + } else { #line 789 - if (status != lowerDriverReturn) { - { + if (status != lowerDriverReturn) { + { #line 791 - errorFn(); + errorFn(); + } } } } @@ -1091,366 +1083,359 @@ int main(void) } } } - } #line 803 - return (status); -} + return (status); + } } #line 806 "diskperf_simpl1.cil.c" -int IoBuildDeviceIoControlRequest(int IoControlCode , int DeviceObject , int InputBuffer , - int InputBufferLength , int OutputBuffer , int OutputBufferLength , - int InternalDeviceIoControl , int Event , int IoStatusBlock ) -{ - int malloc_ret = __VERIFIER_nondet_int() ; +int IoBuildDeviceIoControlRequest(int IoControlCode, int DeviceObject, + int InputBuffer, int InputBufferLength, + int OutputBuffer, int OutputBufferLength, + int InternalDeviceIoControl, int Event, + int IoStatusBlock) { + int malloc_ret = __VERIFIER_nondet_int(); { #line 813 - customIrp = 1; + customIrp = 1; #line 814 - int tmp_ndt_7; - tmp_ndt_7 = __VERIFIER_nondet_int(); - if (tmp_ndt_7 == 0) { - goto switch_3_0; - } else { - goto switch_3_default; + int tmp_ndt_7; + tmp_ndt_7 = __VERIFIER_nondet_int(); + if (tmp_ndt_7 == 0) { + goto switch_3_0; + } else { + goto switch_3_default; #line 819 - if (0) { - switch_3_0: ; + if (0) { + switch_3_0:; #line 821 - return (malloc_ret); - switch_3_default: ; + return (malloc_ret); + switch_3_default:; #line 823 - return (0); - } else { - + return (0); + } else { + } } } } -} #line 831 "diskperf_simpl1.cil.c" -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { #line 835 - if (s == NP) { + if (s == NP) { #line 836 - s = MPR1; - } else { - { + s = MPR1; + } else { + { #line 839 - errorFn(); + errorFn(); + } } - } #line 842 - return; -} + return; + } } #line 845 "diskperf_simpl1.cil.c" -int IofCallDriver(int DeviceObject , int Irp ) -{ - int returnVal2 ; - int compRetStatus ; - int lcontext = __VERIFIER_nondet_int() ; - unsigned long __cil_tmp7 ; +int IofCallDriver(int DeviceObject, int Irp) { + int returnVal2; + int compRetStatus; + int lcontext = __VERIFIER_nondet_int(); + unsigned long __cil_tmp7; { #line 852 - if (compRegistered) { + if (compRegistered) { #line 853 - if (routine == 0) { - { + if (routine == 0) { + { #line 855 - compRetStatus = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext); - } - } else { - { + compRetStatus = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext); + } + } else { + { #line 859 - compRetStatus = DiskPerfIoCompletion(DeviceObject, Irp, lcontext); + compRetStatus = DiskPerfIoCompletion(DeviceObject, Irp, lcontext); + } } - } - { + { #line 862 - __cil_tmp7 = (unsigned long )compRetStatus; + __cil_tmp7 = (unsigned long)compRetStatus; #line 862 - if (__cil_tmp7 == -1073741802) { - { + if (__cil_tmp7 == -1073741802) { + { #line 864 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 872 - int tmp_ndt_8; - tmp_ndt_8 = __VERIFIER_nondet_int(); - if (tmp_ndt_8 == 0) { - goto switch_4_0; - } else { -#line 875 - int tmp_ndt_9; - tmp_ndt_9 = __VERIFIER_nondet_int(); - if (tmp_ndt_9 == 1) { - goto switch_4_1; + int tmp_ndt_8; + tmp_ndt_8 = __VERIFIER_nondet_int(); + if (tmp_ndt_8 == 0) { + goto switch_4_0; } else { - goto switch_4_default; +#line 875 + int tmp_ndt_9; + tmp_ndt_9 = __VERIFIER_nondet_int(); + if (tmp_ndt_9 == 1) { + goto switch_4_1; + } else { + goto switch_4_default; #line 880 - if (0) { - switch_4_0: + if (0) { + switch_4_0: #line 882 - returnVal2 = 0; - goto switch_4_break; - switch_4_1: + returnVal2 = 0; + goto switch_4_break; + switch_4_1: #line 885 - returnVal2 = -1073741823; - goto switch_4_break; - switch_4_default: + returnVal2 = -1073741823; + goto switch_4_break; + switch_4_default: #line 888 - returnVal2 = 259; - goto switch_4_break; - } else { - switch_4_break: ; + returnVal2 = 259; + goto switch_4_break; + } else { + switch_4_break:; + } } } - } #line 896 - if (s == NP) { + if (s == NP) { #line 897 - s = IPC; + s = IPC; #line 898 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 900 - if (s == MPR1) { + if (s == MPR1) { #line 901 - if (returnVal2 == 259) { + if (returnVal2 == 259) { #line 902 - s = MPR3; + s = MPR3; #line 903 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 905 - s = NP; + s = NP; #line 906 - lowerDriverReturn = returnVal2; - } - } else { + lowerDriverReturn = returnVal2; + } + } else { #line 909 - if (s == SKIP1) { + if (s == SKIP1) { #line 910 - s = SKIP2; + s = SKIP2; #line 911 - lowerDriverReturn = returnVal2; - } else { - { + lowerDriverReturn = returnVal2; + } else { + { #line 914 - errorFn(); + errorFn(); + } } } } - } #line 919 - return (returnVal2); -} + return (returnVal2); + } } #line 922 "diskperf_simpl1.cil.c" -void IofCompleteRequest(int Irp , int PriorityBoost ) -{ +void IofCompleteRequest(int Irp, int PriorityBoost) { { #line 926 - if (s == NP) { + if (s == NP) { #line 927 - s = DC; - } else { - { + s = DC; + } else { + { #line 930 - errorFn(); + errorFn(); + } } - } #line 933 - return; -} + return; + } } #line 936 "diskperf_simpl1.cil.c" -int KeSetEvent(int Event , int Increment , int Wait ) -{ int l = __VERIFIER_nondet_int() ; +int KeSetEvent(int Event, int Increment, int Wait) { + int l = __VERIFIER_nondet_int(); { #line 940 - setEventCalled = 1; + setEventCalled = 1; #line 941 - return (l); -} + return (l); + } } #line 944 "diskperf_simpl1.cil.c" -int KeWaitForSingleObject(int Object , int WaitReason , int WaitMode , int Alertable , - int Timeout ) -{ +int KeWaitForSingleObject(int Object, int WaitReason, int WaitMode, + int Alertable, int Timeout) { { #line 949 - if (s == MPR3) { + if (s == MPR3) { #line 950 - if (setEventCalled == 1) { + if (setEventCalled == 1) { #line 951 - s = NP; + s = NP; #line 952 - setEventCalled = 0; + setEventCalled = 0; + } else { + goto _L; + } } else { - goto _L; - } - } else { - _L: + _L: #line 958 - if (customIrp == 1) { + if (customIrp == 1) { #line 959 - s = NP; + s = NP; #line 960 - customIrp = 0; - } else { + customIrp = 0; + } else { #line 962 - if (s == MPR3) { - { + if (s == MPR3) { + { #line 964 - errorFn(); + errorFn(); + } } } } - } #line 971 - int tmp_ndt_10; - tmp_ndt_10 = __VERIFIER_nondet_int(); - if (tmp_ndt_10 == 0) { - goto switch_5_0; - } else { - goto switch_5_default; + int tmp_ndt_10; + tmp_ndt_10 = __VERIFIER_nondet_int(); + if (tmp_ndt_10 == 0) { + goto switch_5_0; + } else { + goto switch_5_default; #line 976 - if (0) { - switch_5_0: ; + if (0) { + switch_5_0:; #line 978 - return (0); - switch_5_default: ; + return (0); + switch_5_default:; #line 980 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 988 "diskperf_simpl1.cil.c" -int PoCallDriver(int DeviceObject , int Irp ) -{ - int compRetStatus ; - int returnVal ; - int lcontext = __VERIFIER_nondet_int() ; - unsigned long __cil_tmp7 ; - long __cil_tmp8 ; +int PoCallDriver(int DeviceObject, int Irp) { + int compRetStatus; + int returnVal; + int lcontext = __VERIFIER_nondet_int(); + unsigned long __cil_tmp7; + long __cil_tmp8; { #line 995 - if (compRegistered) { + if (compRegistered) { #line 996 - if (routine == 0) { - { + if (routine == 0) { + { #line 998 - compRetStatus = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext); - } - } else { + compRetStatus = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext); + } + } else { #line 1001 - if (routine == 1) { - { + if (routine == 1) { + { #line 1003 - compRetStatus = DiskPerfIoCompletion(DeviceObject, Irp, lcontext); + compRetStatus = DiskPerfIoCompletion(DeviceObject, Irp, lcontext); + } } } - } - { + { #line 1009 - __cil_tmp7 = (unsigned long )compRetStatus; + __cil_tmp7 = (unsigned long)compRetStatus; #line 1009 - if (__cil_tmp7 == -1073741802) { - { + if (__cil_tmp7 == -1073741802) { + { #line 1011 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 1019 - int tmp_ndt_11; - tmp_ndt_11 = __VERIFIER_nondet_int(); - if (tmp_ndt_11 == 0) { - goto switch_6_0; - } else { -#line 1022 - int tmp_ndt_12; - tmp_ndt_12 = __VERIFIER_nondet_int(); - if (tmp_ndt_12 == 1) { - goto switch_6_1; + int tmp_ndt_11; + tmp_ndt_11 = __VERIFIER_nondet_int(); + if (tmp_ndt_11 == 0) { + goto switch_6_0; } else { - goto switch_6_default; +#line 1022 + int tmp_ndt_12; + tmp_ndt_12 = __VERIFIER_nondet_int(); + if (tmp_ndt_12 == 1) { + goto switch_6_1; + } else { + goto switch_6_default; #line 1027 - if (0) { - switch_6_0: + if (0) { + switch_6_0: #line 1029 - returnVal = 0; - goto switch_6_break; - switch_6_1: + returnVal = 0; + goto switch_6_break; + switch_6_1: #line 1032 - returnVal = -1073741823; - goto switch_6_break; - switch_6_default: + returnVal = -1073741823; + goto switch_6_break; + switch_6_default: #line 1035 - returnVal = 259; - goto switch_6_break; - } else { - switch_6_break: ; + returnVal = 259; + goto switch_6_break; + } else { + switch_6_break:; + } } } - } #line 1043 - if (s == NP) { + if (s == NP) { #line 1044 - s = IPC; + s = IPC; #line 1045 - lowerDriverReturn = returnVal; - } else { + lowerDriverReturn = returnVal; + } else { #line 1047 - if (s == MPR1) { - { + if (s == MPR1) { + { #line 1048 - __cil_tmp8 = (long )returnVal; + __cil_tmp8 = (long)returnVal; #line 1048 - if (__cil_tmp8 == 259L) { + if (__cil_tmp8 == 259L) { #line 1049 - s = MPR3; + s = MPR3; #line 1050 - lowerDriverReturn = returnVal; - } else { + lowerDriverReturn = returnVal; + } else { #line 1052 - s = NP; + s = NP; #line 1053 - lowerDriverReturn = returnVal; - } - } - } else { + lowerDriverReturn = returnVal; + } + } + } else { #line 1056 - if (s == SKIP1) { + if (s == SKIP1) { #line 1057 - s = SKIP2; + s = SKIP2; #line 1058 - lowerDriverReturn = returnVal; - } else { - { + lowerDriverReturn = returnVal; + } else { + { #line 1061 - errorFn(); + errorFn(); + } } } } - } #line 1066 - return (returnVal); -} + return (returnVal); + } } diff --git a/test/ntdrivers-simplified/floppy_simpl3_false.cil.c b/test/ntdrivers-simplified/floppy_simpl3_false.cil.c index 47141a52a..fbbbfaf8d 100644 --- a/test/ntdrivers-simplified/floppy_simpl3_false.cil.c +++ b/test/ntdrivers-simplified/floppy_simpl3_false.cil.c @@ -6,556 +6,557 @@ extern char __VERIFIER_nondet_char(void); extern int __VERIFIER_nondet_int(void); extern long __VERIFIER_nondet_long(void); extern void *__VERIFIER_nondet_pointer(void); -void IofCompleteRequest(int Irp , int PriorityBoost ); +void IofCompleteRequest(int Irp, int PriorityBoost); extern int __VERIFIER_nondet_int(); -int FloppyThread ; -int KernelMode ; -int Suspended ; -int Executive ; -int DiskController ; -int FloppyDiskPeripheral ; -int FlConfigCallBack ; -int MaximumInterfaceType ; -int MOUNTDEV_MOUNTED_DEVICE_GUID ; -int myStatus ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; +int FloppyThread; +int KernelMode; +int Suspended; +int Executive; +int DiskController; +int FloppyDiskPeripheral; +int FlConfigCallBack; +int MaximumInterfaceType; +int MOUNTDEV_MOUNTED_DEVICE_GUID; +int myStatus; +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; -void errorFn(void) -{ +void errorFn(void) { { - goto ERROR; - ERROR: assert(0); - return; -} + goto ERROR; + ERROR: + assert(0); + return; + } } -void _BLAST_init(void) -{ +void _BLAST_init(void) { { #line 73 - UNLOADED = 0; + UNLOADED = 0; #line 74 - NP = 1; + NP = 1; #line 75 - DC = 2; + DC = 2; #line 76 - SKIP1 = 3; + SKIP1 = 3; #line 77 - SKIP2 = 4; + SKIP2 = 4; #line 78 - MPR1 = 5; + MPR1 = 5; #line 79 - MPR3 = 6; + MPR3 = 6; #line 80 - IPC = 7; + IPC = 7; #line 81 - s = UNLOADED; + s = UNLOADED; #line 82 - pended = 0; + pended = 0; #line 83 - compRegistered = 0; + compRegistered = 0; #line 84 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 85 - setEventCalled = 0; + setEventCalled = 0; #line 86 - customIrp = 0; + customIrp = 0; #line 87 - return; -} + return; + } } #line 90 "floppy_simpl3.cil.c" -int PagingReferenceCount = 0; +int PagingReferenceCount = 0; #line 91 "floppy_simpl3.cil.c" -int PagingMutex = 0; +int PagingMutex = 0; #line 92 "floppy_simpl3.cil.c" -int FlAcpiConfigureFloppy(int DisketteExtension , int FdcInfo ) -{ +int FlAcpiConfigureFloppy(int DisketteExtension, int FdcInfo) { { #line 96 - return (0); -} + return (0); + } } #line 99 "floppy_simpl3.cil.c" -int FlQueueIrpToThread(int Irp , int DisketteExtension ) -{ int status ; - int threadHandle = __VERIFIER_nondet_int() ; - int DisketteExtension__PoweringDown = __VERIFIER_nondet_int() ; - int DisketteExtension__ThreadReferenceCount = __VERIFIER_nondet_int() ; - int DisketteExtension__FloppyThread = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int Irp__IoStatus__Information ; - int Irp__Tail__Overlay__CurrentStackLocation__Control ; - int ObjAttributes = __VERIFIER_nondet_int() ; - int __cil_tmp12 ; - int __cil_tmp13 ; +int FlQueueIrpToThread(int Irp, int DisketteExtension) { + int status; + int threadHandle = __VERIFIER_nondet_int(); + int DisketteExtension__PoweringDown = __VERIFIER_nondet_int(); + int DisketteExtension__ThreadReferenceCount = __VERIFIER_nondet_int(); + int DisketteExtension__FloppyThread = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int Irp__IoStatus__Information; + int Irp__Tail__Overlay__CurrentStackLocation__Control; + int ObjAttributes = __VERIFIER_nondet_int(); + int __cil_tmp12; + int __cil_tmp13; { #line 111 - if (DisketteExtension__PoweringDown == 1) { + if (DisketteExtension__PoweringDown == 1) { #line 112 - myStatus = -1073741101; + myStatus = -1073741101; #line 113 - Irp__IoStatus__Status = -1073741101; + Irp__IoStatus__Status = -1073741101; #line 114 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 115 - return (-1073741101); - } + return (-1073741101); + } #line 119 - DisketteExtension__ThreadReferenceCount ++; + DisketteExtension__ThreadReferenceCount++; #line 120 - if (DisketteExtension__ThreadReferenceCount == 0) { + if (DisketteExtension__ThreadReferenceCount == 0) { #line 121 - DisketteExtension__ThreadReferenceCount ++; + DisketteExtension__ThreadReferenceCount++; #line 122 - PagingReferenceCount ++; + PagingReferenceCount++; #line 123 - if (PagingReferenceCount == 1) { - - } - { + if (PagingReferenceCount == 1) { + } + { #line 129 - status = PsCreateSystemThread(threadHandle, 0, ObjAttributes, 0, 0, FloppyThread, - DisketteExtension); - } - { + status = PsCreateSystemThread(threadHandle, 0, ObjAttributes, 0, 0, + FloppyThread, DisketteExtension); + } + { #line 132 #line 132 - if (status < 0) { + if (status < 0) { #line 133 - DisketteExtension__ThreadReferenceCount = -1; + DisketteExtension__ThreadReferenceCount = -1; #line 134 - PagingReferenceCount --; + PagingReferenceCount--; #line 135 - if (PagingReferenceCount == 0) { - - } + if (PagingReferenceCount == 0) { + } #line 140 - return (status); - } - } - { + return (status); + } + } + { #line 145 - status = ObReferenceObjectByHandle(threadHandle, 1048576, 0, KernelMode, DisketteExtension__FloppyThread, - 0); + status = ObReferenceObjectByHandle(threadHandle, 1048576, 0, KernelMode, + DisketteExtension__FloppyThread, 0); #line 147 - ZwClose(threadHandle); - } - { + ZwClose(threadHandle); + } + { #line 149 #line 149 - if (status < 0) { + if (status < 0) { #line 150 - return (status); - } + return (status); + } + } } - } #line 157 - // Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; +// Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; #line 158 - if (pended == 0) { + if (pended == 0) { #line 159 - pended = 1; - } else { - { + pended = 1; + } else { + { #line 162 - errorFn(); + errorFn(); + } } - } #line 165 - return (259); -} + return (259); + } } #line 168 "floppy_simpl3.cil.c" -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 ; +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; + ntStatus = 0; #line 198 - PagingReferenceCount ++; + PagingReferenceCount++; #line 199 - if (PagingReferenceCount == 1) { - - } + if (PagingReferenceCount == 1) { + } #line 204 - disketteExtension = DeviceObject__DeviceExtension; + disketteExtension = DeviceObject__DeviceExtension; #line 205 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = Irp__Tail__Overlay__CurrentStackLocation; #line 206 - if (disketteExtension__IsRemoved) { - { + if (disketteExtension__IsRemoved) { + { #line 208 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 209 - Irp__IoStatus__Status = -1073741738; + Irp__IoStatus__Status = -1073741738; #line 210 - myStatus = -1073741738; + myStatus = -1073741738; #line 211 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 213 - return (-1073741738); - } + return (-1073741738); + } #line 217 - if (irpSp__MinorFunction == 0) { - goto switch_0_0; - } else { -#line 220 - if (irpSp__MinorFunction == 5) { - goto switch_0_5; + if (irpSp__MinorFunction == 0) { + goto switch_0_0; } else { -#line 223 - if (irpSp__MinorFunction == 1) { +#line 220 + if (irpSp__MinorFunction == 5) { goto switch_0_5; } else { -#line 226 - if (irpSp__MinorFunction == 6) { - goto switch_0_6; +#line 223 + if (irpSp__MinorFunction == 1) { + goto switch_0_5; } else { -#line 229 - if (irpSp__MinorFunction == 3) { +#line 226 + if (irpSp__MinorFunction == 6) { goto switch_0_6; } else { -#line 232 - if (irpSp__MinorFunction == 4) { - goto switch_0_4; +#line 229 + if (irpSp__MinorFunction == 3) { + goto switch_0_6; } else { -#line 235 - if (irpSp__MinorFunction == 2) { - goto switch_0_2; +#line 232 + if (irpSp__MinorFunction == 4) { + goto switch_0_4; } else { - goto switch_0_default; +#line 235 + if (irpSp__MinorFunction == 2) { + goto switch_0_2; + } else { + goto switch_0_default; #line 240 - if (0) { - switch_0_0: - { + if (0) { + switch_0_0 : { #line 243 - ntStatus = FloppyStartDevice(DeviceObject, Irp); + ntStatus = FloppyStartDevice(DeviceObject, Irp); } - goto switch_0_break; - switch_0_5: + goto switch_0_break; + switch_0_5: #line 248 - if (irpSp__MinorFunction == 5) { - - } + if (irpSp__MinorFunction == 5) { + } #line 253 - if (! disketteExtension__IsStarted) { + if (!disketteExtension__IsStarted) { #line 254 - if (s == NP) { + if (s == NP) { #line 255 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 258 - errorFn(); + errorFn(); + } } - } - { + { #line 262 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 263 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 264 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } #line 266 - return (ntStatus); - } - { + return (ntStatus); + } + { #line 271 - disketteExtension__HoldNewRequests = 1; + disketteExtension__HoldNewRequests = 1; #line 272 - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - { + ntStatus = FlQueueIrpToThread(Irp, disketteExtension); + } + { #line 274 - __cil_tmp29 = (long )ntStatus; + __cil_tmp29 = (long)ntStatus; #line 274 - if (__cil_tmp29 == 259L) { - { + if (__cil_tmp29 == 259L) { + { #line 276 - KeWaitForSingleObject(disketteExtension__FloppyThread, Executive, - KernelMode, 0, 0); - } + KeWaitForSingleObject(disketteExtension__FloppyThread, + Executive, KernelMode, 0, 0); + } #line 279 - if (disketteExtension__FloppyThread != 0) { - - } + if (disketteExtension__FloppyThread != 0) { + } #line 284 - disketteExtension__FloppyThread = 0; + disketteExtension__FloppyThread = 0; #line 285 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 286 - myStatus = 0; + myStatus = 0; #line 287 - if (s == NP) { + if (s == NP) { #line 288 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 291 - errorFn(); - } - } - { + errorFn(); + } + } + { #line 295 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 296 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 297 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - } else { - { + ntStatus = IofCallDriver( + disketteExtension__TargetObject, Irp); + } + } else { + { #line 301 - ntStatus = -1073741823; + ntStatus = -1073741823; #line 302 - Irp__IoStatus__Status = ntStatus; + Irp__IoStatus__Status = ntStatus; #line 303 - myStatus = ntStatus; + myStatus = ntStatus; #line 304 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 305 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); + } + } } - } - } - goto switch_0_break; - switch_0_6: + goto switch_0_break; + switch_0_6: #line 311 - if (irpSp__MinorFunction == 6) { - - } + if (irpSp__MinorFunction == 6) { + } #line 316 - if (! disketteExtension__IsStarted) { + if (!disketteExtension__IsStarted) { #line 317 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 318 - myStatus = 0; + myStatus = 0; #line 319 - if (s == NP) { + if (s == NP) { #line 320 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 323 - errorFn(); + errorFn(); + } } - } - { + { #line 327 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 328 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 329 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - } else { + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + } else { #line 332 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 333 - myStatus = 0; + myStatus = 0; #line 334 - irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; + irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; #line 335 - nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; + nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 336 - nextIrpSp__Control = 0; + nextIrpSp__Control = 0; #line 337 - if (s != NP) { - { -#line 339 - errorFn(); - } - } else { -#line 342 - if (compRegistered != 0) { + if (s != NP) { { -#line 344 - errorFn(); +#line 339 + errorFn(); } } else { +#line 342 + if (compRegistered != 0) { + { +#line 344 + errorFn(); + } + } else { #line 347 - compRegistered = 1; + compRegistered = 1; + } } - } - { + { #line 351 - irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1; + irpSp___1 = + Irp__Tail__Overlay__CurrentStackLocation - 1; #line 352 - irpSp__Context = doneEvent; + irpSp__Context = doneEvent; #line 353 - irpSp__Control = 224; + irpSp__Control = 224; #line 357 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - { + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + { #line 359 - __cil_tmp30 = (long )ntStatus; + __cil_tmp30 = (long)ntStatus; #line 359 - if (__cil_tmp30 == 259L) { - { + if (__cil_tmp30 == 259L) { + { #line 361 - KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0); + KeWaitForSingleObject(doneEvent, Executive, + KernelMode, 0, 0); #line 362 - ntStatus = myStatus; + ntStatus = myStatus; + } + } } - } - } - { + { #line 368 - disketteExtension__HoldNewRequests = 0; + disketteExtension__HoldNewRequests = 0; #line 369 - Irp__IoStatus__Status = ntStatus; + Irp__IoStatus__Status = ntStatus; #line 370 - myStatus = ntStatus; + myStatus = ntStatus; #line 371 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 372 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); + } } - } - goto switch_0_break; - switch_0_4: + goto switch_0_break; + switch_0_4: #line 377 - disketteExtension__IsStarted = 0; + disketteExtension__IsStarted = 0; #line 378 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 379 - myStatus = 0; + myStatus = 0; #line 380 - if (s == NP) { + if (s == NP) { #line 381 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 384 - errorFn(); + errorFn(); + } } - } - { + { #line 388 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 389 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 390 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - goto switch_0_break; - switch_0_2: + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + goto switch_0_break; + switch_0_2: #line 394 - disketteExtension__HoldNewRequests = 0; + disketteExtension__HoldNewRequests = 0; #line 395 - disketteExtension__IsStarted = 0; + disketteExtension__IsStarted = 0; #line 396 - disketteExtension__IsRemoved = 1; + disketteExtension__IsRemoved = 1; #line 397 - if (s == NP) { + if (s == NP) { #line 398 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 401 - errorFn(); + errorFn(); + } } - } - { + { #line 405 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 406 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 407 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 408 - myStatus = 0; + myStatus = 0; #line 409 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } #line 411 - if (disketteExtension__InterfaceString__Buffer != 0) { - { + if (disketteExtension__InterfaceString__Buffer != 0) { + { #line 413 - IoSetDeviceInterfaceState(disketteExtension__InterfaceString, - 0); + IoSetDeviceInterfaceState( + disketteExtension__InterfaceString, 0); + } } - } #line 419 - if (disketteExtension__ArcName__Length != 0) { - { + if (disketteExtension__ArcName__Length != 0) { + { #line 421 - IoDeleteSymbolicLink(disketteExtension__ArcName); + IoDeleteSymbolicLink(disketteExtension__ArcName); + } } - } #line 426 - IoGetConfigurationInformation__FloppyCount --; - goto switch_0_break; - switch_0_default: ; + IoGetConfigurationInformation__FloppyCount--; + goto switch_0_break; + switch_0_default:; #line 429 - if (s == NP) { + if (s == NP) { #line 430 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 433 - errorFn(); + errorFn(); + } } - } - { + { #line 437 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 438 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 439 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + } else { + switch_0_break:; } - } else { - switch_0_break: ; } } } @@ -563,508 +564,509 @@ int FloppyPnp(int DeviceObject , int Irp ) } } } - } #line 452 - PagingReferenceCount --; + PagingReferenceCount--; #line 453 - if (PagingReferenceCount == 0) { - - } + if (PagingReferenceCount == 0) { + } #line 458 - return (ntStatus); -} + return (ntStatus); + } } #line 461 "floppy_simpl3.cil.c" -int FloppyStartDevice(int DeviceObject , int Irp ) -{ int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int disketteExtension__TargetObject = __VERIFIER_nondet_int() ; - int disketteExtension__MaxTransferSize ; - int disketteExtension__DriveType = __VERIFIER_nondet_int() ; - int disketteExtension__PerpendicularMode ; - int disketteExtension__DeviceUnit ; - int disketteExtension__DriveOnValue ; - int disketteExtension__UnderlyingPDO = __VERIFIER_nondet_int() ; - int disketteExtension__InterfaceString = __VERIFIER_nondet_int() ; - int disketteExtension__IsStarted ; - int disketteExtension__HoldNewRequests ; - int ntStatus ; - int pnpStatus ; - int doneEvent = __VERIFIER_nondet_int() ; - int fdcInfo = __VERIFIER_nondet_int() ; - int fdcInfo__BufferCount ; - int fdcInfo__BufferSize ; - int fdcInfo__MaxTransferSize = __VERIFIER_nondet_int() ; - int fdcInfo__AcpiBios = __VERIFIER_nondet_int() ; - int fdcInfo__AcpiFdiSupported = __VERIFIER_nondet_int() ; - int fdcInfo__PeripheralNumber = __VERIFIER_nondet_int() ; - int fdcInfo__BusType ; - int fdcInfo__ControllerNumber = __VERIFIER_nondet_int() ; - int fdcInfo__UnitNumber = __VERIFIER_nondet_int() ; - int fdcInfo__BusNumber = __VERIFIER_nondet_int() ; - int Dc ; - int Fp ; - int disketteExtension ; - int irpSp ; - int irpSp___0 ; - int nextIrpSp ; - int nextIrpSp__Control ; - int irpSp___1 ; - int irpSp__Control ; - int irpSp__Context ; - int InterfaceType ; - int KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 = __VERIFIER_nondet_int() ; - long __cil_tmp42 ; - int __cil_tmp43 ; - int __cil_tmp44 ; - int __cil_tmp45 ; - int __cil_tmp46 ; - int __cil_tmp47 ; - int __cil_tmp48 ; - int __cil_tmp49 ; +int FloppyStartDevice(int DeviceObject, int Irp) { + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int disketteExtension__TargetObject = __VERIFIER_nondet_int(); + int disketteExtension__MaxTransferSize; + int disketteExtension__DriveType = __VERIFIER_nondet_int(); + int disketteExtension__PerpendicularMode; + int disketteExtension__DeviceUnit; + int disketteExtension__DriveOnValue; + int disketteExtension__UnderlyingPDO = __VERIFIER_nondet_int(); + int disketteExtension__InterfaceString = __VERIFIER_nondet_int(); + int disketteExtension__IsStarted; + int disketteExtension__HoldNewRequests; + int ntStatus; + int pnpStatus; + int doneEvent = __VERIFIER_nondet_int(); + int fdcInfo = __VERIFIER_nondet_int(); + int fdcInfo__BufferCount; + int fdcInfo__BufferSize; + int fdcInfo__MaxTransferSize = __VERIFIER_nondet_int(); + int fdcInfo__AcpiBios = __VERIFIER_nondet_int(); + int fdcInfo__AcpiFdiSupported = __VERIFIER_nondet_int(); + int fdcInfo__PeripheralNumber = __VERIFIER_nondet_int(); + int fdcInfo__BusType; + int fdcInfo__ControllerNumber = __VERIFIER_nondet_int(); + int fdcInfo__UnitNumber = __VERIFIER_nondet_int(); + int fdcInfo__BusNumber = __VERIFIER_nondet_int(); + int Dc; + int Fp; + int disketteExtension; + int irpSp; + int irpSp___0; + int nextIrpSp; + int nextIrpSp__Control; + int irpSp___1; + int irpSp__Control; + int irpSp__Context; + int InterfaceType; + int KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 = + __VERIFIER_nondet_int(); + long __cil_tmp42; + int __cil_tmp43; + int __cil_tmp44; + int __cil_tmp45; + int __cil_tmp46; + int __cil_tmp47; + int __cil_tmp48; + int __cil_tmp49; { #line 503 - Dc = DiskController; + Dc = DiskController; #line 504 - Fp = FloppyDiskPeripheral; + Fp = FloppyDiskPeripheral; #line 505 - disketteExtension = DeviceObject__DeviceExtension; + disketteExtension = DeviceObject__DeviceExtension; #line 506 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = Irp__Tail__Overlay__CurrentStackLocation; #line 507 - irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; + irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; #line 508 - nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; + nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 509 - nextIrpSp__Control = 0; + nextIrpSp__Control = 0; #line 510 - if (s != NP) { - { -#line 512 - errorFn(); - } - } else { -#line 515 - if (compRegistered != 0) { + if (s != NP) { { -#line 517 - errorFn(); +#line 512 + errorFn(); } } else { +#line 515 + if (compRegistered != 0) { + { +#line 517 + errorFn(); + } + } else { #line 520 - compRegistered = 1; + compRegistered = 1; + } } - } - { + { #line 524 - irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1; + irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 525 - irpSp__Context = doneEvent; + irpSp__Context = doneEvent; #line 526 - irpSp__Control = 224; + irpSp__Control = 224; #line 530 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - { + ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); + } + { #line 532 - __cil_tmp42 = (long )ntStatus; + __cil_tmp42 = (long)ntStatus; #line 532 - if (__cil_tmp42 == 259L) { - { + if (__cil_tmp42 == 259L) { + { #line 534 - ntStatus = KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0); + ntStatus = + KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0); #line 535 - ntStatus = myStatus; + ntStatus = myStatus; + } + } } - } - } - { + { #line 541 - fdcInfo__BufferCount = 0; + fdcInfo__BufferCount = 0; #line 542 - fdcInfo__BufferSize = 0; + fdcInfo__BufferSize = 0; #line 543 - __cil_tmp43 = 3080; + __cil_tmp43 = 3080; #line 543 - __cil_tmp44 = 458752; + __cil_tmp44 = 458752; #line 543 - __cil_tmp45 = 461832; + __cil_tmp45 = 461832; #line 543 - __cil_tmp46 = 461835; + __cil_tmp46 = 461835; #line 543 - ntStatus = FlFdcDeviceIo(disketteExtension__TargetObject, __cil_tmp46, fdcInfo); - } + ntStatus = + FlFdcDeviceIo(disketteExtension__TargetObject, __cil_tmp46, fdcInfo); + } #line 546 - if (ntStatus >= 0) { + if (ntStatus >= 0) { #line 547 - disketteExtension__MaxTransferSize = fdcInfo__MaxTransferSize; + disketteExtension__MaxTransferSize = fdcInfo__MaxTransferSize; #line 548 - if (fdcInfo__AcpiBios) { + if (fdcInfo__AcpiBios) { #line 549 - if (fdcInfo__AcpiFdiSupported) { - { + if (fdcInfo__AcpiFdiSupported) { + { #line 551 - ntStatus = FlAcpiConfigureFloppy(disketteExtension, fdcInfo); - } + ntStatus = FlAcpiConfigureFloppy(disketteExtension, fdcInfo); + } #line 553 - if (disketteExtension__DriveType == 4) { + if (disketteExtension__DriveType == 4) { #line 554 - //__cil_tmp47 = uninf1(); +//__cil_tmp47 = uninf1(); #line 554 - //disketteExtension__PerpendicularMode |= __cil_tmp47; + // disketteExtension__PerpendicularMode |= __cil_tmp47; + } + } else { + goto _L; } } else { - goto _L; - } - } else { - _L: + _L: #line 563 - if (disketteExtension__DriveType == 4) { + if (disketteExtension__DriveType == 4) { #line 564 - //__cil_tmp48 = uninf1(); +//__cil_tmp48 = uninf1(); #line 564 - //disketteExtension__PerpendicularMode |= __cil_tmp48; - } + // disketteExtension__PerpendicularMode |= __cil_tmp48; + } #line 568 - InterfaceType = 0; - { + InterfaceType = 0; + { #line 570 - while (1) { - while_0_continue: /* CIL Label */ ; + while (1) { + while_0_continue: /* CIL Label */; #line 572 - if (InterfaceType >= MaximumInterfaceType) { - goto while_1_break; - } - { + if (InterfaceType >= MaximumInterfaceType) { + goto while_1_break; + } + { #line 578 - fdcInfo__BusType = InterfaceType; + fdcInfo__BusType = InterfaceType; #line 579 - ntStatus = IoQueryDeviceDescription(fdcInfo__BusType, fdcInfo__BusNumber, - Dc, fdcInfo__ControllerNumber, Fp, fdcInfo__PeripheralNumber, - FlConfigCallBack, disketteExtension); - } + ntStatus = IoQueryDeviceDescription( + fdcInfo__BusType, fdcInfo__BusNumber, Dc, + fdcInfo__ControllerNumber, Fp, fdcInfo__PeripheralNumber, + FlConfigCallBack, disketteExtension); + } #line 583 - if (ntStatus >= 0) { - goto while_1_break; - } + if (ntStatus >= 0) { + goto while_1_break; + } #line 588 - InterfaceType ++; - } - while_0_break: /* CIL Label */ ; + InterfaceType++; + } + while_0_break: /* CIL Label */; + } + while_1_break:; } - while_1_break: ; - } #line 593 - if (ntStatus >= 0) { + if (ntStatus >= 0) { #line 594 - if (KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 != 0) { + if (KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 != 0) { #line 595 - disketteExtension__DeviceUnit = fdcInfo__UnitNumber; + disketteExtension__DeviceUnit = fdcInfo__UnitNumber; #line 596 - //disketteExtension__DriveOnValue = fdcInfo__UnitNumber; - } else { + // disketteExtension__DriveOnValue = fdcInfo__UnitNumber; + } else { #line 598 - disketteExtension__DeviceUnit = fdcInfo__PeripheralNumber; + disketteExtension__DeviceUnit = fdcInfo__PeripheralNumber; #line 599 - //__cil_tmp49 = 16 << fdcInfo__PeripheralNumber; +//__cil_tmp49 = 16 << fdcInfo__PeripheralNumber; #line 599 - //disketteExtension__DriveOnValue = fdcInfo__PeripheralNumber | __cil_tmp49; - } - { + // disketteExtension__DriveOnValue = fdcInfo__PeripheralNumber | + // __cil_tmp49; + } + { #line 602 - pnpStatus = IoRegisterDeviceInterface(disketteExtension__UnderlyingPDO, MOUNTDEV_MOUNTED_DEVICE_GUID, - 0, disketteExtension__InterfaceString); - } + pnpStatus = IoRegisterDeviceInterface( + disketteExtension__UnderlyingPDO, MOUNTDEV_MOUNTED_DEVICE_GUID, 0, + disketteExtension__InterfaceString); + } #line 605 - if (pnpStatus >= 0) { - { + if (pnpStatus >= 0) { + { #line 607 - pnpStatus = IoSetDeviceInterfaceState(disketteExtension__InterfaceString, - 1); + pnpStatus = IoSetDeviceInterfaceState( + disketteExtension__InterfaceString, 1); + } } - } #line 613 - disketteExtension__IsStarted = 1; + disketteExtension__IsStarted = 1; #line 614 - disketteExtension__HoldNewRequests = 0; + disketteExtension__HoldNewRequests = 0; + } } - } - { + { #line 622 - Irp__IoStatus__Status = ntStatus; + Irp__IoStatus__Status = ntStatus; #line 623 - myStatus = ntStatus; + myStatus = ntStatus; #line 624 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 626 - return (ntStatus); -} + return (ntStatus); + } } #line 629 "floppy_simpl3.cil.c" -int FloppyPnpComplete(int DeviceObject , int Irp , int Context ) -{ +int FloppyPnpComplete(int DeviceObject, int Irp, int Context) { { - { + { #line 634 - KeSetEvent(Context, 1, 0); - } + KeSetEvent(Context, 1, 0); + } #line 636 - return (-1073741802); -} + return (-1073741802); + } } #line 639 "floppy_simpl3.cil.c" -int FlFdcDeviceIo(int DeviceObject , int Ioctl , int Data ) -{ int ntStatus ; - int irp ; - int irpStack ; - int doneEvent = __VERIFIER_nondet_int() ; - int ioStatus = __VERIFIER_nondet_int() ; - int irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int irpStack__Parameters__DeviceIoControl__Type3InputBuffer ; - long __cil_tmp11 ; +int FlFdcDeviceIo(int DeviceObject, int Ioctl, int Data) { + int ntStatus; + int irp; + int irpStack; + int doneEvent = __VERIFIER_nondet_int(); + int ioStatus = __VERIFIER_nondet_int(); + int irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int irpStack__Parameters__DeviceIoControl__Type3InputBuffer; + long __cil_tmp11; { - { + { #line 650 - irp = IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, 0, 0, 0, 0, 1, doneEvent, - ioStatus); - } + irp = IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, 0, 0, 0, 0, 1, + doneEvent, ioStatus); + } #line 653 - if (irp == 0) { + if (irp == 0) { #line 654 - return (-1073741670); - } - { + return (-1073741670); + } + { #line 659 - irpStack = irp__Tail__Overlay__CurrentStackLocation - 1; + irpStack = irp__Tail__Overlay__CurrentStackLocation - 1; #line 660 - irpStack__Parameters__DeviceIoControl__Type3InputBuffer = Data; + irpStack__Parameters__DeviceIoControl__Type3InputBuffer = Data; #line 661 - ntStatus = IofCallDriver(DeviceObject, irp); - } - { + ntStatus = IofCallDriver(DeviceObject, irp); + } + { #line 663 - __cil_tmp11 = (long )ntStatus; + __cil_tmp11 = (long)ntStatus; #line 663 - if (__cil_tmp11 == 259L) { - { + if (__cil_tmp11 == 259L) { + { #line 665 - KeWaitForSingleObject(doneEvent, Suspended, KernelMode, 0, 0); + KeWaitForSingleObject(doneEvent, Suspended, KernelMode, 0, 0); #line 666 - ntStatus = myStatus; + ntStatus = myStatus; + } + } } - } - } #line 671 - return (ntStatus); -} + return (ntStatus); + } } #line 674 "floppy_simpl3.cil.c" -void FloppyProcessQueuedRequests(int DisketteExtension ) -{ +void FloppyProcessQueuedRequests(int DisketteExtension) { { #line 678 - return; -} + return; + } } #line 681 "floppy_simpl3.cil.c" -void stub_driver_init(void) -{ +void stub_driver_init(void) { { #line 685 - s = NP; + s = NP; #line 686 - pended = 0; + pended = 0; #line 687 - compRegistered = 0; + compRegistered = 0; #line 688 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 689 - setEventCalled = 0; + setEventCalled = 0; #line 690 - customIrp = 0; + customIrp = 0; #line 691 - return; -} + return; + } } #line 694 "floppy_simpl3.cil.c" -int main(void) -{ int status ; - int irp = __VERIFIER_nondet_int() ; - int pirp ; - int pirp__IoStatus__Status ; - int irp_choice = __VERIFIER_nondet_int() ; - int devobj = __VERIFIER_nondet_int() ; - int __cil_tmp8 ; +int main(void) { + int status; + int irp = __VERIFIER_nondet_int(); + int pirp; + int pirp__IoStatus__Status; + int irp_choice = __VERIFIER_nondet_int(); + int devobj = __VERIFIER_nondet_int(); + int __cil_tmp8; - FloppyThread = 0; - KernelMode = 0; - Suspended = 0; - Executive = 0; - DiskController = 0; - FloppyDiskPeripheral = 0; - FlConfigCallBack = 0; - MaximumInterfaceType = 0; - MOUNTDEV_MOUNTED_DEVICE_GUID = 0; - myStatus = 0; - s = 0; - UNLOADED = 0; - NP = 0; - DC = 0; - SKIP1 = 0; - SKIP2 = 0; - MPR1 = 0; - MPR3 = 0; - IPC = 0; - pended = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; + FloppyThread = 0; + KernelMode = 0; + Suspended = 0; + Executive = 0; + DiskController = 0; + FloppyDiskPeripheral = 0; + FlConfigCallBack = 0; + MaximumInterfaceType = 0; + MOUNTDEV_MOUNTED_DEVICE_GUID = 0; + myStatus = 0; + s = 0; + UNLOADED = 0; + NP = 0; + DC = 0; + SKIP1 = 0; + SKIP2 = 0; + MPR1 = 0; + MPR3 = 0; + IPC = 0; + pended = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; { - { + { #line 705 - status = 0; + status = 0; #line 706 - pirp = irp; + pirp = irp; #line 707 - _BLAST_init(); - } + _BLAST_init(); + } #line 709 - if (status >= 0) { + if (status >= 0) { #line 710 - s = NP; + s = NP; #line 711 - customIrp = 0; + customIrp = 0; #line 712 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 713 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 714 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 715 - pended = compRegistered; + pended = compRegistered; #line 716 - pirp__IoStatus__Status = 0; + pirp__IoStatus__Status = 0; #line 717 - myStatus = 0; + myStatus = 0; #line 718 - if (irp_choice == 0) { + if (irp_choice == 0) { #line 719 - pirp__IoStatus__Status = -1073741637; + pirp__IoStatus__Status = -1073741637; #line 720 - myStatus = -1073741637; - } - { + myStatus = -1073741637; + } + { #line 725 - stub_driver_init(); - } - { + stub_driver_init(); + } + { #line 727 #line 727 - if (status < 0) { + if (status < 0) { #line 728 - return (-1); - } - } + return (-1); + } + } #line 732 - int tmp_ndt_1; - tmp_ndt_1 = __VERIFIER_nondet_int(); - if (tmp_ndt_1 == 3) { - goto switch_2_3; - } else { - goto switch_2_default; + int tmp_ndt_1; + tmp_ndt_1 = __VERIFIER_nondet_int(); + if (tmp_ndt_1 == 3) { + goto switch_2_3; + } else { + goto switch_2_default; #line 737 - if (0) { - switch_2_3: - { + if (0) { + switch_2_3 : { #line 740 - status = FloppyPnp(devobj, pirp); + status = FloppyPnp(devobj, pirp); } - goto switch_2_break; - switch_2_default: ; + goto switch_2_break; + switch_2_default:; #line 744 - return (-1); - } else { - switch_2_break: ; + return (-1); + } else { + switch_2_break:; + } } } - } #line 753 - if (pended == 1) { + if (pended == 1) { #line 754 - if (s == NP) { + if (s == NP) { #line 755 - s = NP; + s = NP; + } else { + goto _L___2; + } } else { - goto _L___2; - } - } else { - _L___2: + _L___2: #line 761 - if (pended == 1) { + if (pended == 1) { #line 762 - if (s == MPR3) { + if (s == MPR3) { #line 763 - s = MPR3; + s = MPR3; + } else { + goto _L___1; + } } else { - goto _L___1; - } - } else { - _L___1: + _L___1: #line 769 - if (s != UNLOADED) { + if (s != UNLOADED) { #line 772 - if (status != -1) { + if (status != -1) { #line 775 - if (s != SKIP2) { + if (s != SKIP2) { #line 776 - if (s != IPC) { + if (s != IPC) { #line 777 - if (s != DC) { - { + if (s != DC) { + { #line 779 - errorFn(); + errorFn(); + } + } else { + goto _L___0; } } else { goto _L___0; } } else { - goto _L___0; - } - } else { - _L___0: + _L___0: #line 789 - if (pended == 1) { + if (pended == 1) { #line 790 - if (status != 259) { + if (status != 259) { #line 791 - errorFn(); - } - } else { + errorFn(); + } + } else { #line 796 - if (s == DC) { + if (s == DC) { #line 797 - if (status == 259) { - { + if (status == 259) { + { #line 799 - errorFn(); + errorFn(); + } } - } - } else { + } else { #line 805 - if (status != lowerDriverReturn) { - { + if (status != lowerDriverReturn) { + { #line 807 - errorFn(); + errorFn(); + } } } } @@ -1073,432 +1075,415 @@ int main(void) } } } - } #line 819 - status = 0; + status = 0; #line 820 - return (status); -} + return (status); + } } #line 823 "floppy_simpl3.cil.c" -int IoBuildDeviceIoControlRequest(int IoControlCode , int DeviceObject , int InputBuffer , - int InputBufferLength , int OutputBuffer , int OutputBufferLength , - int InternalDeviceIoControl , int Event , int IoStatusBlock ) -{ - int malloc = __VERIFIER_nondet_int() ; +int IoBuildDeviceIoControlRequest(int IoControlCode, int DeviceObject, + int InputBuffer, int InputBufferLength, + int OutputBuffer, int OutputBufferLength, + int InternalDeviceIoControl, int Event, + int IoStatusBlock) { + int malloc = __VERIFIER_nondet_int(); { #line 830 - customIrp = 1; + customIrp = 1; #line 831 - int tmp_ndt_2; - tmp_ndt_2 = __VERIFIER_nondet_int(); - if (tmp_ndt_2 == 0) { - goto switch_3_0; - } else { - goto switch_3_default; + int tmp_ndt_2; + tmp_ndt_2 = __VERIFIER_nondet_int(); + if (tmp_ndt_2 == 0) { + goto switch_3_0; + } else { + goto switch_3_default; #line 836 - if (0) { - switch_3_0: + if (0) { + switch_3_0: #line 838 - return (malloc); - switch_3_default: ; + return (malloc); + switch_3_default:; #line 840 - return (0); - } else { - + return (0); + } else { + } } } } -} #line 848 "floppy_simpl3.cil.c" -int IoDeleteSymbolicLink(int SymbolicLinkName ) -{ +int IoDeleteSymbolicLink(int SymbolicLinkName) { { #line 852 - int tmp_ndt_3; - tmp_ndt_3 = __VERIFIER_nondet_int(); - if (tmp_ndt_3 == 0) { - goto switch_4_0; - } else { - goto switch_4_default; + int tmp_ndt_3; + tmp_ndt_3 = __VERIFIER_nondet_int(); + if (tmp_ndt_3 == 0) { + goto switch_4_0; + } else { + goto switch_4_default; #line 857 - if (0) { - switch_4_0: + if (0) { + switch_4_0: #line 859 - return (0); - switch_4_default: ; + return (0); + switch_4_default:; #line 861 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 869 "floppy_simpl3.cil.c" -int IoQueryDeviceDescription(int BusType , int BusNumber , int ControllerType , int ControllerNumber , - int PeripheralType , int PeripheralNumber , int CalloutRoutine , - int Context ) -{ +int IoQueryDeviceDescription(int BusType, int BusNumber, int ControllerType, + int ControllerNumber, int PeripheralType, + int PeripheralNumber, int CalloutRoutine, + int Context) { { #line 875 - int tmp_ndt_4; - tmp_ndt_4 = __VERIFIER_nondet_int(); - if (tmp_ndt_4 == 0) { - goto switch_5_0; - } else { - goto switch_5_default; + int tmp_ndt_4; + tmp_ndt_4 = __VERIFIER_nondet_int(); + if (tmp_ndt_4 == 0) { + goto switch_5_0; + } else { + goto switch_5_default; #line 880 - if (0) { - switch_5_0: + if (0) { + switch_5_0: #line 882 - return (0); - switch_5_default: ; + return (0); + switch_5_default:; #line 884 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 892 "floppy_simpl3.cil.c" -int IoRegisterDeviceInterface(int PhysicalDeviceObject , int InterfaceClassGuid , - int ReferenceString , int SymbolicLinkName ) -{ +int IoRegisterDeviceInterface(int PhysicalDeviceObject, int InterfaceClassGuid, + int ReferenceString, int SymbolicLinkName) { { #line 897 - int tmp_ndt_5; - tmp_ndt_5 = __VERIFIER_nondet_int(); - if (tmp_ndt_5 == 0) { - goto switch_6_0; - } else { - goto switch_6_default; + int tmp_ndt_5; + tmp_ndt_5 = __VERIFIER_nondet_int(); + if (tmp_ndt_5 == 0) { + goto switch_6_0; + } else { + goto switch_6_default; #line 902 - if (0) { - switch_6_0: + if (0) { + switch_6_0: #line 904 - return (0); - switch_6_default: ; + return (0); + switch_6_default:; #line 906 - return (-1073741808); - } else { - + return (-1073741808); + } else { + } } } } -} #line 914 "floppy_simpl3.cil.c" -int IoSetDeviceInterfaceState(int SymbolicLinkName , int Enable ) -{ +int IoSetDeviceInterfaceState(int SymbolicLinkName, int Enable) { { #line 918 - int tmp_ndt_6; - tmp_ndt_6 = __VERIFIER_nondet_int(); - if (tmp_ndt_6 == 0) { - goto switch_7_0; - } else { - goto switch_7_default; + int tmp_ndt_6; + tmp_ndt_6 = __VERIFIER_nondet_int(); + if (tmp_ndt_6 == 0) { + goto switch_7_0; + } else { + goto switch_7_default; #line 923 - if (0) { - switch_7_0: + if (0) { + switch_7_0: #line 925 - return (0); - switch_7_default: ; + return (0); + switch_7_default:; #line 927 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 935 "floppy_simpl3.cil.c" -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { #line 939 - if (s == NP) { + if (s == NP) { #line 940 - s = MPR1; - } else { - { + s = MPR1; + } else { + { #line 943 - errorFn(); + errorFn(); + } } - } #line 946 - return; -} + return; + } } #line 949 "floppy_simpl3.cil.c" -int IofCallDriver(int DeviceObject , int Irp ) -{ - int returnVal2 ; - int compRetStatus1 ; - int lcontext = __VERIFIER_nondet_int() ; - unsigned long __cil_tmp7 ; +int IofCallDriver(int DeviceObject, int Irp) { + int returnVal2; + int compRetStatus1; + int lcontext = __VERIFIER_nondet_int(); + unsigned long __cil_tmp7; { #line 956 - if (compRegistered) { - { + if (compRegistered) { + { #line 958 - compRetStatus1 = FloppyPnpComplete(DeviceObject, Irp, lcontext); - } - { + compRetStatus1 = FloppyPnpComplete(DeviceObject, Irp, lcontext); + } + { #line 960 - __cil_tmp7 = (unsigned long )compRetStatus1; + __cil_tmp7 = (unsigned long)compRetStatus1; #line 960 - if (__cil_tmp7 == -1073741802) { - { + if (__cil_tmp7 == -1073741802) { + { #line 962 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 970 - int tmp_ndt_12; - tmp_ndt_12 = __VERIFIER_nondet_int(); - if (tmp_ndt_12 == 0) { - goto switch_8_0; - } else { -#line 973 - int tmp_ndt_7; - tmp_ndt_7 = __VERIFIER_nondet_int(); - if (tmp_ndt_7 == 1) { - goto switch_8_1; + int tmp_ndt_12; + tmp_ndt_12 = __VERIFIER_nondet_int(); + if (tmp_ndt_12 == 0) { + goto switch_8_0; } else { - goto switch_8_default; +#line 973 + int tmp_ndt_7; + tmp_ndt_7 = __VERIFIER_nondet_int(); + if (tmp_ndt_7 == 1) { + goto switch_8_1; + } else { + goto switch_8_default; #line 978 - if (0) { - switch_8_0: + if (0) { + switch_8_0: #line 980 - returnVal2 = 0; - goto switch_8_break; - switch_8_1: + returnVal2 = 0; + goto switch_8_break; + switch_8_1: #line 983 - returnVal2 = -1073741823; - goto switch_8_break; - switch_8_default: + returnVal2 = -1073741823; + goto switch_8_break; + switch_8_default: #line 986 - returnVal2 = 259; - goto switch_8_break; - } else { - switch_8_break: ; + returnVal2 = 259; + goto switch_8_break; + } else { + switch_8_break:; + } } } - } #line 994 - if (s == NP) { + if (s == NP) { #line 995 - s = IPC; + s = IPC; #line 996 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 998 - if (s == MPR1) { + if (s == MPR1) { #line 999 - if (returnVal2 == 259) { + if (returnVal2 == 259) { #line 1000 - s = MPR3; + s = MPR3; #line 1001 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 1003 - s = NP; + s = NP; #line 1004 - lowerDriverReturn = returnVal2; - } - } else { + lowerDriverReturn = returnVal2; + } + } else { #line 1007 - if (s == SKIP1) { + if (s == SKIP1) { #line 1008 - s = SKIP2; + s = SKIP2; #line 1009 - lowerDriverReturn = returnVal2; - } else { - { + lowerDriverReturn = returnVal2; + } else { + { #line 1012 - errorFn(); + errorFn(); + } } } } - } #line 1017 - return (returnVal2); -} + return (returnVal2); + } } #line 1020 "floppy_simpl3.cil.c" -void IofCompleteRequest(int Irp , int PriorityBoost ) -{ +void IofCompleteRequest(int Irp, int PriorityBoost) { { #line 1024 - if (s == NP) { + if (s == NP) { #line 1025 - s = DC; - } else { - { + s = DC; + } else { + { #line 1028 - errorFn(); + errorFn(); + } } - } #line 1031 - return; -} + return; + } } #line 1034 "floppy_simpl3.cil.c" -int KeSetEvent(int Event , int Increment , int Wait ) -{ int l = __VERIFIER_nondet_int() ; +int KeSetEvent(int Event, int Increment, int Wait) { + int l = __VERIFIER_nondet_int(); { #line 1038 - setEventCalled = 1; + setEventCalled = 1; #line 1039 - return (l); -} + return (l); + } } #line 1042 "floppy_simpl3.cil.c" -int KeWaitForSingleObject(int Object , int WaitReason , int WaitMode , int Alertable , - int Timeout ) -{ +int KeWaitForSingleObject(int Object, int WaitReason, int WaitMode, + int Alertable, int Timeout) { { #line 1047 - if (s == MPR3) { + if (s == MPR3) { #line 1048 - if (setEventCalled == 1) { + if (setEventCalled == 1) { #line 1049 - s = NP; + s = NP; #line 1050 - setEventCalled = 0; + setEventCalled = 0; + } else { + goto _L; + } } else { - goto _L; - } - } else { - _L: + _L: #line 1056 - if (customIrp == 1) { + if (customIrp == 1) { #line 1057 - s = NP; + s = NP; #line 1058 - customIrp = 0; - } else { + customIrp = 0; + } else { #line 1060 - if (s == MPR3) { - { + if (s == MPR3) { + { #line 1062 - errorFn(); + errorFn(); + } } } } - } #line 1069 - int tmp_ndt_8; - tmp_ndt_8 = __VERIFIER_nondet_int(); - if (tmp_ndt_8 == 0) { - goto switch_9_0; - } else { - goto switch_9_default; + int tmp_ndt_8; + tmp_ndt_8 = __VERIFIER_nondet_int(); + if (tmp_ndt_8 == 0) { + goto switch_9_0; + } else { + goto switch_9_default; #line 1074 - if (0) { - switch_9_0: + if (0) { + switch_9_0: #line 1076 - return (0); - switch_9_default: ; + return (0); + switch_9_default:; #line 1078 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1086 "floppy_simpl3.cil.c" -int ObReferenceObjectByHandle(int Handle , int DesiredAccess , int ObjectType , int AccessMode , - int Object , int HandleInformation ) -{ +int ObReferenceObjectByHandle(int Handle, int DesiredAccess, int ObjectType, + int AccessMode, int Object, + int HandleInformation) { { #line 1091 - int tmp_ndt_9; - tmp_ndt_9 = __VERIFIER_nondet_int(); - if (tmp_ndt_9 == 0) { - goto switch_10_0; - } else { - goto switch_10_default; + int tmp_ndt_9; + tmp_ndt_9 = __VERIFIER_nondet_int(); + if (tmp_ndt_9 == 0) { + goto switch_10_0; + } else { + goto switch_10_default; #line 1096 - if (0) { - switch_10_0: + if (0) { + switch_10_0: #line 1098 - return (0); - switch_10_default: ; + return (0); + switch_10_default:; #line 1100 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1108 "floppy_simpl3.cil.c" -int PsCreateSystemThread(int ThreadHandle , int DesiredAccess , int ObjectAttributes , - int ProcessHandle , int ClientId , int StartRoutine , int StartContext ) -{ +int PsCreateSystemThread(int ThreadHandle, int DesiredAccess, + int ObjectAttributes, int ProcessHandle, int ClientId, + int StartRoutine, int StartContext) { { #line 1113 - int tmp_ndt_10; - tmp_ndt_10 = __VERIFIER_nondet_int(); - if (tmp_ndt_10 == 0) { - goto switch_11_0; - } else { - goto switch_11_default; + int tmp_ndt_10; + tmp_ndt_10 = __VERIFIER_nondet_int(); + if (tmp_ndt_10 == 0) { + goto switch_11_0; + } else { + goto switch_11_default; #line 1118 - if (0) { - switch_11_0: + if (0) { + switch_11_0: #line 1120 - return (0); - switch_11_default: ; + return (0); + switch_11_default:; #line 1122 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1130 "floppy_simpl3.cil.c" -int ZwClose(int Handle ) -{ +int ZwClose(int Handle) { { #line 1134 - int tmp_ndt_11; - tmp_ndt_11 = __VERIFIER_nondet_int(); - if (tmp_ndt_11 == 0) { - goto switch_12_0; - } else { - goto switch_12_default; + int tmp_ndt_11; + tmp_ndt_11 = __VERIFIER_nondet_int(); + if (tmp_ndt_11 == 0) { + goto switch_12_0; + } else { + goto switch_12_default; #line 1139 - if (0) { - switch_12_0: + if (0) { + switch_12_0: #line 1141 - return (0); - switch_12_default: ; + return (0); + switch_12_default:; #line 1143 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} diff --git a/test/ntdrivers-simplified/floppy_simpl3_true.cil.c b/test/ntdrivers-simplified/floppy_simpl3_true.cil.c index 6287e16a8..19ccf425d 100644 --- a/test/ntdrivers-simplified/floppy_simpl3_true.cil.c +++ b/test/ntdrivers-simplified/floppy_simpl3_true.cil.c @@ -6,556 +6,557 @@ extern char __VERIFIER_nondet_char(void); extern int __VERIFIER_nondet_int(void); extern long __VERIFIER_nondet_long(void); extern void *__VERIFIER_nondet_pointer(void); -void IofCompleteRequest(int Irp , int PriorityBoost ); +void IofCompleteRequest(int Irp, int PriorityBoost); extern int __VERIFIER_nondet_int(); -int FloppyThread ; -int KernelMode ; -int Suspended ; -int Executive ; -int DiskController ; -int FloppyDiskPeripheral ; -int FlConfigCallBack ; -int MaximumInterfaceType ; -int MOUNTDEV_MOUNTED_DEVICE_GUID ; -int myStatus ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; +int FloppyThread; +int KernelMode; +int Suspended; +int Executive; +int DiskController; +int FloppyDiskPeripheral; +int FlConfigCallBack; +int MaximumInterfaceType; +int MOUNTDEV_MOUNTED_DEVICE_GUID; +int myStatus; +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; -void errorFn(void) -{ +void errorFn(void) { { - goto ERROR; - ERROR: assert(0); - return; -} + goto ERROR; + ERROR: + assert(0); + return; + } } -void _BLAST_init(void) -{ +void _BLAST_init(void) { { #line 73 - UNLOADED = 0; + UNLOADED = 0; #line 74 - NP = 1; + NP = 1; #line 75 - DC = 2; + DC = 2; #line 76 - SKIP1 = 3; + SKIP1 = 3; #line 77 - SKIP2 = 4; + SKIP2 = 4; #line 78 - MPR1 = 5; + MPR1 = 5; #line 79 - MPR3 = 6; + MPR3 = 6; #line 80 - IPC = 7; + IPC = 7; #line 81 - s = UNLOADED; + s = UNLOADED; #line 82 - pended = 0; + pended = 0; #line 83 - compRegistered = 0; + compRegistered = 0; #line 84 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 85 - setEventCalled = 0; + setEventCalled = 0; #line 86 - customIrp = 0; + customIrp = 0; #line 87 - return; -} + return; + } } #line 90 "floppy_simpl3.cil.c" -int PagingReferenceCount = 0; +int PagingReferenceCount = 0; #line 91 "floppy_simpl3.cil.c" -int PagingMutex = 0; +int PagingMutex = 0; #line 92 "floppy_simpl3.cil.c" -int FlAcpiConfigureFloppy(int DisketteExtension , int FdcInfo ) -{ +int FlAcpiConfigureFloppy(int DisketteExtension, int FdcInfo) { { #line 96 - return (0); -} + return (0); + } } #line 99 "floppy_simpl3.cil.c" -int FlQueueIrpToThread(int Irp , int DisketteExtension ) -{ int status ; - int threadHandle = __VERIFIER_nondet_int() ; - int DisketteExtension__PoweringDown = __VERIFIER_nondet_int() ; - int DisketteExtension__ThreadReferenceCount = __VERIFIER_nondet_int() ; - int DisketteExtension__FloppyThread = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int Irp__IoStatus__Information ; - int Irp__Tail__Overlay__CurrentStackLocation__Control ; - int ObjAttributes = __VERIFIER_nondet_int() ; - int __cil_tmp12 ; - int __cil_tmp13 ; +int FlQueueIrpToThread(int Irp, int DisketteExtension) { + int status; + int threadHandle = __VERIFIER_nondet_int(); + int DisketteExtension__PoweringDown = __VERIFIER_nondet_int(); + int DisketteExtension__ThreadReferenceCount = __VERIFIER_nondet_int(); + int DisketteExtension__FloppyThread = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int Irp__IoStatus__Information; + int Irp__Tail__Overlay__CurrentStackLocation__Control; + int ObjAttributes = __VERIFIER_nondet_int(); + int __cil_tmp12; + int __cil_tmp13; { #line 111 - if (DisketteExtension__PoweringDown == 1) { + if (DisketteExtension__PoweringDown == 1) { #line 112 - myStatus = -1073741101; + myStatus = -1073741101; #line 113 - Irp__IoStatus__Status = -1073741101; + Irp__IoStatus__Status = -1073741101; #line 114 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 115 - return (-1073741101); - } + return (-1073741101); + } #line 119 - DisketteExtension__ThreadReferenceCount ++; + DisketteExtension__ThreadReferenceCount++; #line 120 - if (DisketteExtension__ThreadReferenceCount == 0) { + if (DisketteExtension__ThreadReferenceCount == 0) { #line 121 - DisketteExtension__ThreadReferenceCount ++; + DisketteExtension__ThreadReferenceCount++; #line 122 - PagingReferenceCount ++; + PagingReferenceCount++; #line 123 - if (PagingReferenceCount == 1) { - - } - { + if (PagingReferenceCount == 1) { + } + { #line 129 - status = PsCreateSystemThread(threadHandle, 0, ObjAttributes, 0, 0, FloppyThread, - DisketteExtension); - } - { + status = PsCreateSystemThread(threadHandle, 0, ObjAttributes, 0, 0, + FloppyThread, DisketteExtension); + } + { #line 132 #line 132 - if (status < 0) { + if (status < 0) { #line 133 - DisketteExtension__ThreadReferenceCount = -1; + DisketteExtension__ThreadReferenceCount = -1; #line 134 - PagingReferenceCount --; + PagingReferenceCount--; #line 135 - if (PagingReferenceCount == 0) { - - } + if (PagingReferenceCount == 0) { + } #line 140 - return (status); - } - } - { + return (status); + } + } + { #line 145 - status = ObReferenceObjectByHandle(threadHandle, 1048576, 0, KernelMode, DisketteExtension__FloppyThread, - 0); + status = ObReferenceObjectByHandle(threadHandle, 1048576, 0, KernelMode, + DisketteExtension__FloppyThread, 0); #line 147 - ZwClose(threadHandle); - } - { + ZwClose(threadHandle); + } + { #line 149 #line 149 - if (status < 0) { + if (status < 0) { #line 150 - return (status); - } + return (status); + } + } } - } #line 157 - // Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; +// Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; #line 158 - if (pended == 0) { + if (pended == 0) { #line 159 - pended = 1; - } else { - { + pended = 1; + } else { + { #line 162 - errorFn(); + errorFn(); + } } - } #line 165 - return (259); -} + return (259); + } } #line 168 "floppy_simpl3.cil.c" -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 ; +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; + ntStatus = 0; #line 198 - PagingReferenceCount ++; + PagingReferenceCount++; #line 199 - if (PagingReferenceCount == 1) { - - } + if (PagingReferenceCount == 1) { + } #line 204 - disketteExtension = DeviceObject__DeviceExtension; + disketteExtension = DeviceObject__DeviceExtension; #line 205 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = Irp__Tail__Overlay__CurrentStackLocation; #line 206 - if (disketteExtension__IsRemoved) { - { + if (disketteExtension__IsRemoved) { + { #line 208 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 209 - Irp__IoStatus__Status = -1073741738; + Irp__IoStatus__Status = -1073741738; #line 210 - myStatus = -1073741738; + myStatus = -1073741738; #line 211 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 213 - return (-1073741738); - } + return (-1073741738); + } #line 217 - if (irpSp__MinorFunction == 0) { - goto switch_0_0; - } else { -#line 220 - if (irpSp__MinorFunction == 5) { - goto switch_0_5; + if (irpSp__MinorFunction == 0) { + goto switch_0_0; } else { -#line 223 - if (irpSp__MinorFunction == 1) { +#line 220 + if (irpSp__MinorFunction == 5) { goto switch_0_5; } else { -#line 226 - if (irpSp__MinorFunction == 6) { - goto switch_0_6; +#line 223 + if (irpSp__MinorFunction == 1) { + goto switch_0_5; } else { -#line 229 - if (irpSp__MinorFunction == 3) { +#line 226 + if (irpSp__MinorFunction == 6) { goto switch_0_6; } else { -#line 232 - if (irpSp__MinorFunction == 4) { - goto switch_0_4; +#line 229 + if (irpSp__MinorFunction == 3) { + goto switch_0_6; } else { -#line 235 - if (irpSp__MinorFunction == 2) { - goto switch_0_2; +#line 232 + if (irpSp__MinorFunction == 4) { + goto switch_0_4; } else { - goto switch_0_default; +#line 235 + if (irpSp__MinorFunction == 2) { + goto switch_0_2; + } else { + goto switch_0_default; #line 240 - if (0) { - switch_0_0: - { + if (0) { + switch_0_0 : { #line 243 - ntStatus = FloppyStartDevice(DeviceObject, Irp); + ntStatus = FloppyStartDevice(DeviceObject, Irp); } - goto switch_0_break; - switch_0_5: + goto switch_0_break; + switch_0_5: #line 248 - if (irpSp__MinorFunction == 5) { - - } + if (irpSp__MinorFunction == 5) { + } #line 253 - if (! disketteExtension__IsStarted) { + if (!disketteExtension__IsStarted) { #line 254 - if (s == NP) { + if (s == NP) { #line 255 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 258 - errorFn(); + errorFn(); + } } - } - { + { #line 262 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 263 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 264 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } #line 266 - return (ntStatus); - } - { + return (ntStatus); + } + { #line 271 - disketteExtension__HoldNewRequests = 1; + disketteExtension__HoldNewRequests = 1; #line 272 - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - { + ntStatus = FlQueueIrpToThread(Irp, disketteExtension); + } + { #line 274 - __cil_tmp29 = (long )ntStatus; + __cil_tmp29 = (long)ntStatus; #line 274 - if (__cil_tmp29 == 259L) { - { + if (__cil_tmp29 == 259L) { + { #line 276 - KeWaitForSingleObject(disketteExtension__FloppyThread, Executive, - KernelMode, 0, 0); - } + KeWaitForSingleObject(disketteExtension__FloppyThread, + Executive, KernelMode, 0, 0); + } #line 279 - if (disketteExtension__FloppyThread != 0) { - - } + if (disketteExtension__FloppyThread != 0) { + } #line 284 - disketteExtension__FloppyThread = 0; + disketteExtension__FloppyThread = 0; #line 285 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 286 - myStatus = 0; + myStatus = 0; #line 287 - if (s == NP) { + if (s == NP) { #line 288 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 291 - errorFn(); - } - } - { + errorFn(); + } + } + { #line 295 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 296 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 297 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - } else { - { + ntStatus = IofCallDriver( + disketteExtension__TargetObject, Irp); + } + } else { + { #line 301 - ntStatus = -1073741823; + ntStatus = -1073741823; #line 302 - Irp__IoStatus__Status = ntStatus; + Irp__IoStatus__Status = ntStatus; #line 303 - myStatus = ntStatus; + myStatus = ntStatus; #line 304 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 305 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); + } + } } - } - } - goto switch_0_break; - switch_0_6: + goto switch_0_break; + switch_0_6: #line 311 - if (irpSp__MinorFunction == 6) { - - } + if (irpSp__MinorFunction == 6) { + } #line 316 - if (! disketteExtension__IsStarted) { + if (!disketteExtension__IsStarted) { #line 317 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 318 - myStatus = 0; + myStatus = 0; #line 319 - if (s == NP) { + if (s == NP) { #line 320 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 323 - errorFn(); + errorFn(); + } } - } - { + { #line 327 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 328 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 329 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - } else { + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + } else { #line 332 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 333 - myStatus = 0; + myStatus = 0; #line 334 - irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; + irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; #line 335 - nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; + nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 336 - nextIrpSp__Control = 0; + nextIrpSp__Control = 0; #line 337 - if (s != NP) { - { -#line 339 - errorFn(); - } - } else { -#line 342 - if (compRegistered != 0) { + if (s != NP) { { -#line 344 - errorFn(); +#line 339 + errorFn(); } } else { +#line 342 + if (compRegistered != 0) { + { +#line 344 + errorFn(); + } + } else { #line 347 - compRegistered = 1; + compRegistered = 1; + } } - } - { + { #line 351 - irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1; + irpSp___1 = + Irp__Tail__Overlay__CurrentStackLocation - 1; #line 352 - irpSp__Context = doneEvent; + irpSp__Context = doneEvent; #line 353 - irpSp__Control = 224; + irpSp__Control = 224; #line 357 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - { + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + { #line 359 - __cil_tmp30 = (long )ntStatus; + __cil_tmp30 = (long)ntStatus; #line 359 - if (__cil_tmp30 == 259L) { - { + if (__cil_tmp30 == 259L) { + { #line 361 - KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0); + KeWaitForSingleObject(doneEvent, Executive, + KernelMode, 0, 0); #line 362 - ntStatus = myStatus; + ntStatus = myStatus; + } + } } - } - } - { + { #line 368 - disketteExtension__HoldNewRequests = 0; + disketteExtension__HoldNewRequests = 0; #line 369 - Irp__IoStatus__Status = ntStatus; + Irp__IoStatus__Status = ntStatus; #line 370 - myStatus = ntStatus; + myStatus = ntStatus; #line 371 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 372 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); + } } - } - goto switch_0_break; - switch_0_4: + goto switch_0_break; + switch_0_4: #line 377 - disketteExtension__IsStarted = 0; + disketteExtension__IsStarted = 0; #line 378 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 379 - myStatus = 0; + myStatus = 0; #line 380 - if (s == NP) { + if (s == NP) { #line 381 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 384 - errorFn(); + errorFn(); + } } - } - { + { #line 388 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 389 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 390 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - goto switch_0_break; - switch_0_2: + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + goto switch_0_break; + switch_0_2: #line 394 - disketteExtension__HoldNewRequests = 0; + disketteExtension__HoldNewRequests = 0; #line 395 - disketteExtension__IsStarted = 0; + disketteExtension__IsStarted = 0; #line 396 - disketteExtension__IsRemoved = 1; + disketteExtension__IsRemoved = 1; #line 397 - if (s == NP) { + if (s == NP) { #line 398 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 401 - errorFn(); + errorFn(); + } } - } - { + { #line 405 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 406 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 407 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 408 - myStatus = 0; + myStatus = 0; #line 409 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } #line 411 - if (disketteExtension__InterfaceString__Buffer != 0) { - { + if (disketteExtension__InterfaceString__Buffer != 0) { + { #line 413 - IoSetDeviceInterfaceState(disketteExtension__InterfaceString, - 0); + IoSetDeviceInterfaceState( + disketteExtension__InterfaceString, 0); + } } - } #line 419 - if (disketteExtension__ArcName__Length != 0) { - { + if (disketteExtension__ArcName__Length != 0) { + { #line 421 - IoDeleteSymbolicLink(disketteExtension__ArcName); + IoDeleteSymbolicLink(disketteExtension__ArcName); + } } - } #line 426 - IoGetConfigurationInformation__FloppyCount --; - goto switch_0_break; - switch_0_default: ; + IoGetConfigurationInformation__FloppyCount--; + goto switch_0_break; + switch_0_default:; #line 429 - if (s == NP) { + if (s == NP) { #line 430 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 433 - errorFn(); + errorFn(); + } } - } - { + { #line 437 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 438 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 439 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + } else { + switch_0_break:; } - } else { - switch_0_break: ; } } } @@ -563,508 +564,509 @@ int FloppyPnp(int DeviceObject , int Irp ) } } } - } #line 452 - PagingReferenceCount --; + PagingReferenceCount--; #line 453 - if (PagingReferenceCount == 0) { - - } + if (PagingReferenceCount == 0) { + } #line 458 - return (ntStatus); -} + return (ntStatus); + } } #line 461 "floppy_simpl3.cil.c" -int FloppyStartDevice(int DeviceObject , int Irp ) -{ int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int disketteExtension__TargetObject = __VERIFIER_nondet_int() ; - int disketteExtension__MaxTransferSize ; - int disketteExtension__DriveType = __VERIFIER_nondet_int() ; - int disketteExtension__PerpendicularMode ; - int disketteExtension__DeviceUnit ; - int disketteExtension__DriveOnValue ; - int disketteExtension__UnderlyingPDO = __VERIFIER_nondet_int() ; - int disketteExtension__InterfaceString = __VERIFIER_nondet_int() ; - int disketteExtension__IsStarted ; - int disketteExtension__HoldNewRequests ; - int ntStatus ; - int pnpStatus ; - int doneEvent = __VERIFIER_nondet_int() ; - int fdcInfo = __VERIFIER_nondet_int() ; - int fdcInfo__BufferCount ; - int fdcInfo__BufferSize ; - int fdcInfo__MaxTransferSize = __VERIFIER_nondet_int() ; - int fdcInfo__AcpiBios = __VERIFIER_nondet_int() ; - int fdcInfo__AcpiFdiSupported = __VERIFIER_nondet_int() ; - int fdcInfo__PeripheralNumber = __VERIFIER_nondet_int() ; - int fdcInfo__BusType ; - int fdcInfo__ControllerNumber = __VERIFIER_nondet_int() ; - int fdcInfo__UnitNumber = __VERIFIER_nondet_int() ; - int fdcInfo__BusNumber = __VERIFIER_nondet_int() ; - int Dc ; - int Fp ; - int disketteExtension ; - int irpSp ; - int irpSp___0 ; - int nextIrpSp ; - int nextIrpSp__Control ; - int irpSp___1 ; - int irpSp__Control ; - int irpSp__Context ; - int InterfaceType ; - int KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 = __VERIFIER_nondet_int() ; - long __cil_tmp42 ; - int __cil_tmp43 ; - int __cil_tmp44 ; - int __cil_tmp45 ; - int __cil_tmp46 ; - int __cil_tmp47 ; - int __cil_tmp48 ; - int __cil_tmp49 ; +int FloppyStartDevice(int DeviceObject, int Irp) { + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int disketteExtension__TargetObject = __VERIFIER_nondet_int(); + int disketteExtension__MaxTransferSize; + int disketteExtension__DriveType = __VERIFIER_nondet_int(); + int disketteExtension__PerpendicularMode; + int disketteExtension__DeviceUnit; + int disketteExtension__DriveOnValue; + int disketteExtension__UnderlyingPDO = __VERIFIER_nondet_int(); + int disketteExtension__InterfaceString = __VERIFIER_nondet_int(); + int disketteExtension__IsStarted; + int disketteExtension__HoldNewRequests; + int ntStatus; + int pnpStatus; + int doneEvent = __VERIFIER_nondet_int(); + int fdcInfo = __VERIFIER_nondet_int(); + int fdcInfo__BufferCount; + int fdcInfo__BufferSize; + int fdcInfo__MaxTransferSize = __VERIFIER_nondet_int(); + int fdcInfo__AcpiBios = __VERIFIER_nondet_int(); + int fdcInfo__AcpiFdiSupported = __VERIFIER_nondet_int(); + int fdcInfo__PeripheralNumber = __VERIFIER_nondet_int(); + int fdcInfo__BusType; + int fdcInfo__ControllerNumber = __VERIFIER_nondet_int(); + int fdcInfo__UnitNumber = __VERIFIER_nondet_int(); + int fdcInfo__BusNumber = __VERIFIER_nondet_int(); + int Dc; + int Fp; + int disketteExtension; + int irpSp; + int irpSp___0; + int nextIrpSp; + int nextIrpSp__Control; + int irpSp___1; + int irpSp__Control; + int irpSp__Context; + int InterfaceType; + int KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 = + __VERIFIER_nondet_int(); + long __cil_tmp42; + int __cil_tmp43; + int __cil_tmp44; + int __cil_tmp45; + int __cil_tmp46; + int __cil_tmp47; + int __cil_tmp48; + int __cil_tmp49; { #line 503 - Dc = DiskController; + Dc = DiskController; #line 504 - Fp = FloppyDiskPeripheral; + Fp = FloppyDiskPeripheral; #line 505 - disketteExtension = DeviceObject__DeviceExtension; + disketteExtension = DeviceObject__DeviceExtension; #line 506 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = Irp__Tail__Overlay__CurrentStackLocation; #line 507 - irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; + irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; #line 508 - nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; + nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 509 - nextIrpSp__Control = 0; + nextIrpSp__Control = 0; #line 510 - if (s != NP) { - { -#line 512 - errorFn(); - } - } else { -#line 515 - if (compRegistered != 0) { + if (s != NP) { { -#line 517 - errorFn(); +#line 512 + errorFn(); } } else { +#line 515 + if (compRegistered != 0) { + { +#line 517 + errorFn(); + } + } else { #line 520 - compRegistered = 1; + compRegistered = 1; + } } - } - { + { #line 524 - irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1; + irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 525 - irpSp__Context = doneEvent; + irpSp__Context = doneEvent; #line 526 - irpSp__Control = 224; + irpSp__Control = 224; #line 530 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - { + ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); + } + { #line 532 - __cil_tmp42 = (long )ntStatus; + __cil_tmp42 = (long)ntStatus; #line 532 - if (__cil_tmp42 == 259L) { - { + if (__cil_tmp42 == 259L) { + { #line 534 - ntStatus = KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0); + ntStatus = + KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0); #line 535 - ntStatus = myStatus; + ntStatus = myStatus; + } + } } - } - } - { + { #line 541 - fdcInfo__BufferCount = 0; + fdcInfo__BufferCount = 0; #line 542 - fdcInfo__BufferSize = 0; + fdcInfo__BufferSize = 0; #line 543 - __cil_tmp43 = 3080; + __cil_tmp43 = 3080; #line 543 - __cil_tmp44 = 458752; + __cil_tmp44 = 458752; #line 543 - __cil_tmp45 = 461832; + __cil_tmp45 = 461832; #line 543 - __cil_tmp46 = 461835; + __cil_tmp46 = 461835; #line 543 - ntStatus = FlFdcDeviceIo(disketteExtension__TargetObject, __cil_tmp46, fdcInfo); - } + ntStatus = + FlFdcDeviceIo(disketteExtension__TargetObject, __cil_tmp46, fdcInfo); + } #line 546 - if (ntStatus >= 0) { + if (ntStatus >= 0) { #line 547 - disketteExtension__MaxTransferSize = fdcInfo__MaxTransferSize; + disketteExtension__MaxTransferSize = fdcInfo__MaxTransferSize; #line 548 - if (fdcInfo__AcpiBios) { + if (fdcInfo__AcpiBios) { #line 549 - if (fdcInfo__AcpiFdiSupported) { - { + if (fdcInfo__AcpiFdiSupported) { + { #line 551 - ntStatus = FlAcpiConfigureFloppy(disketteExtension, fdcInfo); - } + ntStatus = FlAcpiConfigureFloppy(disketteExtension, fdcInfo); + } #line 553 - if (disketteExtension__DriveType == 4) { + if (disketteExtension__DriveType == 4) { #line 554 - //__cil_tmp47 = uninf1(); +//__cil_tmp47 = uninf1(); #line 554 - //disketteExtension__PerpendicularMode |= __cil_tmp47; + // disketteExtension__PerpendicularMode |= __cil_tmp47; + } + } else { + goto _L; } } else { - goto _L; - } - } else { - _L: + _L: #line 563 - if (disketteExtension__DriveType == 4) { + if (disketteExtension__DriveType == 4) { #line 564 - //__cil_tmp48 = uninf1(); +//__cil_tmp48 = uninf1(); #line 564 - //disketteExtension__PerpendicularMode |= __cil_tmp48; - } + // disketteExtension__PerpendicularMode |= __cil_tmp48; + } #line 568 - InterfaceType = 0; - { + InterfaceType = 0; + { #line 570 - while (1) { - while_0_continue: /* CIL Label */ ; + while (1) { + while_0_continue: /* CIL Label */; #line 572 - if (InterfaceType >= MaximumInterfaceType) { - goto while_1_break; - } - { + if (InterfaceType >= MaximumInterfaceType) { + goto while_1_break; + } + { #line 578 - fdcInfo__BusType = InterfaceType; + fdcInfo__BusType = InterfaceType; #line 579 - ntStatus = IoQueryDeviceDescription(fdcInfo__BusType, fdcInfo__BusNumber, - Dc, fdcInfo__ControllerNumber, Fp, fdcInfo__PeripheralNumber, - FlConfigCallBack, disketteExtension); - } + ntStatus = IoQueryDeviceDescription( + fdcInfo__BusType, fdcInfo__BusNumber, Dc, + fdcInfo__ControllerNumber, Fp, fdcInfo__PeripheralNumber, + FlConfigCallBack, disketteExtension); + } #line 583 - if (ntStatus >= 0) { - goto while_1_break; - } + if (ntStatus >= 0) { + goto while_1_break; + } #line 588 - InterfaceType ++; - } - while_0_break: /* CIL Label */ ; + InterfaceType++; + } + while_0_break: /* CIL Label */; + } + while_1_break:; } - while_1_break: ; - } #line 593 - if (ntStatus >= 0) { + if (ntStatus >= 0) { #line 594 - if (KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 != 0) { + if (KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 != 0) { #line 595 - disketteExtension__DeviceUnit = fdcInfo__UnitNumber; + disketteExtension__DeviceUnit = fdcInfo__UnitNumber; #line 596 - //disketteExtension__DriveOnValue = fdcInfo__UnitNumber; - } else { + // disketteExtension__DriveOnValue = fdcInfo__UnitNumber; + } else { #line 598 - disketteExtension__DeviceUnit = fdcInfo__PeripheralNumber; + disketteExtension__DeviceUnit = fdcInfo__PeripheralNumber; #line 599 - //__cil_tmp49 = 16 << fdcInfo__PeripheralNumber; +//__cil_tmp49 = 16 << fdcInfo__PeripheralNumber; #line 599 - //disketteExtension__DriveOnValue = fdcInfo__PeripheralNumber | __cil_tmp49; - } - { + // disketteExtension__DriveOnValue = fdcInfo__PeripheralNumber | + // __cil_tmp49; + } + { #line 602 - pnpStatus = IoRegisterDeviceInterface(disketteExtension__UnderlyingPDO, MOUNTDEV_MOUNTED_DEVICE_GUID, - 0, disketteExtension__InterfaceString); - } + pnpStatus = IoRegisterDeviceInterface( + disketteExtension__UnderlyingPDO, MOUNTDEV_MOUNTED_DEVICE_GUID, 0, + disketteExtension__InterfaceString); + } #line 605 - if (pnpStatus >= 0) { - { + if (pnpStatus >= 0) { + { #line 607 - pnpStatus = IoSetDeviceInterfaceState(disketteExtension__InterfaceString, - 1); + pnpStatus = IoSetDeviceInterfaceState( + disketteExtension__InterfaceString, 1); + } } - } #line 613 - disketteExtension__IsStarted = 1; + disketteExtension__IsStarted = 1; #line 614 - disketteExtension__HoldNewRequests = 0; + disketteExtension__HoldNewRequests = 0; + } } - } - { + { #line 622 - Irp__IoStatus__Status = ntStatus; + Irp__IoStatus__Status = ntStatus; #line 623 - myStatus = ntStatus; + myStatus = ntStatus; #line 624 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 626 - return (ntStatus); -} + return (ntStatus); + } } #line 629 "floppy_simpl3.cil.c" -int FloppyPnpComplete(int DeviceObject , int Irp , int Context ) -{ +int FloppyPnpComplete(int DeviceObject, int Irp, int Context) { { - { + { #line 634 - KeSetEvent(Context, 1, 0); - } + KeSetEvent(Context, 1, 0); + } #line 636 - return (-1073741802); -} + return (-1073741802); + } } #line 639 "floppy_simpl3.cil.c" -int FlFdcDeviceIo(int DeviceObject , int Ioctl , int Data ) -{ int ntStatus ; - int irp ; - int irpStack ; - int doneEvent = __VERIFIER_nondet_int() ; - int ioStatus = __VERIFIER_nondet_int() ; - int irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int irpStack__Parameters__DeviceIoControl__Type3InputBuffer ; - long __cil_tmp11 ; +int FlFdcDeviceIo(int DeviceObject, int Ioctl, int Data) { + int ntStatus; + int irp; + int irpStack; + int doneEvent = __VERIFIER_nondet_int(); + int ioStatus = __VERIFIER_nondet_int(); + int irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int irpStack__Parameters__DeviceIoControl__Type3InputBuffer; + long __cil_tmp11; { - { + { #line 650 - irp = IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, 0, 0, 0, 0, 1, doneEvent, - ioStatus); - } + irp = IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, 0, 0, 0, 0, 1, + doneEvent, ioStatus); + } #line 653 - if (irp == 0) { + if (irp == 0) { #line 654 - return (-1073741670); - } - { + return (-1073741670); + } + { #line 659 - irpStack = irp__Tail__Overlay__CurrentStackLocation - 1; + irpStack = irp__Tail__Overlay__CurrentStackLocation - 1; #line 660 - irpStack__Parameters__DeviceIoControl__Type3InputBuffer = Data; + irpStack__Parameters__DeviceIoControl__Type3InputBuffer = Data; #line 661 - ntStatus = IofCallDriver(DeviceObject, irp); - } - { + ntStatus = IofCallDriver(DeviceObject, irp); + } + { #line 663 - __cil_tmp11 = (long )ntStatus; + __cil_tmp11 = (long)ntStatus; #line 663 - if (__cil_tmp11 == 259L) { - { + if (__cil_tmp11 == 259L) { + { #line 665 - KeWaitForSingleObject(doneEvent, Suspended, KernelMode, 0, 0); + KeWaitForSingleObject(doneEvent, Suspended, KernelMode, 0, 0); #line 666 - ntStatus = myStatus; + ntStatus = myStatus; + } + } } - } - } #line 671 - return (ntStatus); -} + return (ntStatus); + } } #line 674 "floppy_simpl3.cil.c" -void FloppyProcessQueuedRequests(int DisketteExtension ) -{ +void FloppyProcessQueuedRequests(int DisketteExtension) { { #line 678 - return; -} + return; + } } #line 681 "floppy_simpl3.cil.c" -void stub_driver_init(void) -{ +void stub_driver_init(void) { { #line 685 - s = NP; + s = NP; #line 686 - pended = 0; + pended = 0; #line 687 - compRegistered = 0; + compRegistered = 0; #line 688 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 689 - setEventCalled = 0; + setEventCalled = 0; #line 690 - customIrp = 0; + customIrp = 0; #line 691 - return; -} + return; + } } #line 694 "floppy_simpl3.cil.c" -int main(void) -{ int status ; - int irp = __VERIFIER_nondet_int() ; - int pirp ; - int pirp__IoStatus__Status ; - int irp_choice = __VERIFIER_nondet_int() ; - int devobj = __VERIFIER_nondet_int() ; - int __cil_tmp8 ; +int main(void) { + int status; + int irp = __VERIFIER_nondet_int(); + int pirp; + int pirp__IoStatus__Status; + int irp_choice = __VERIFIER_nondet_int(); + int devobj = __VERIFIER_nondet_int(); + int __cil_tmp8; - FloppyThread = 0; - KernelMode = 0; - Suspended = 0; - Executive = 0; - DiskController = 0; - FloppyDiskPeripheral = 0; - FlConfigCallBack = 0; - MaximumInterfaceType = 0; - MOUNTDEV_MOUNTED_DEVICE_GUID = 0; - myStatus = 0; - s = 0; - UNLOADED = 0; - NP = 0; - DC = 0; - SKIP1 = 0; - SKIP2 = 0; - MPR1 = 0; - MPR3 = 0; - IPC = 0; - pended = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; + FloppyThread = 0; + KernelMode = 0; + Suspended = 0; + Executive = 0; + DiskController = 0; + FloppyDiskPeripheral = 0; + FlConfigCallBack = 0; + MaximumInterfaceType = 0; + MOUNTDEV_MOUNTED_DEVICE_GUID = 0; + myStatus = 0; + s = 0; + UNLOADED = 0; + NP = 0; + DC = 0; + SKIP1 = 0; + SKIP2 = 0; + MPR1 = 0; + MPR3 = 0; + IPC = 0; + pended = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; { - { + { #line 705 - status = 0; + status = 0; #line 706 - pirp = irp; + pirp = irp; #line 707 - _BLAST_init(); - } + _BLAST_init(); + } #line 709 - if (status >= 0) { + if (status >= 0) { #line 710 - s = NP; + s = NP; #line 711 - customIrp = 0; + customIrp = 0; #line 712 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 713 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 714 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 715 - pended = compRegistered; + pended = compRegistered; #line 716 - pirp__IoStatus__Status = 0; + pirp__IoStatus__Status = 0; #line 717 - myStatus = 0; + myStatus = 0; #line 718 - if (irp_choice == 0) { + if (irp_choice == 0) { #line 719 - pirp__IoStatus__Status = -1073741637; + pirp__IoStatus__Status = -1073741637; #line 720 - myStatus = -1073741637; - } - { + myStatus = -1073741637; + } + { #line 725 - stub_driver_init(); - } - { + stub_driver_init(); + } + { #line 727 #line 727 - if (status < 0) { + if (status < 0) { #line 728 - return (-1); - } - } + return (-1); + } + } #line 732 - int tmp_ndt_1; - tmp_ndt_1 = __VERIFIER_nondet_int(); - if (tmp_ndt_1 == 3) { - goto switch_2_3; - } else { - goto switch_2_default; + int tmp_ndt_1; + tmp_ndt_1 = __VERIFIER_nondet_int(); + if (tmp_ndt_1 == 3) { + goto switch_2_3; + } else { + goto switch_2_default; #line 737 - if (0) { - switch_2_3: - { + if (0) { + switch_2_3 : { #line 740 - status = FloppyPnp(devobj, pirp); + status = FloppyPnp(devobj, pirp); } - goto switch_2_break; - switch_2_default: ; + goto switch_2_break; + switch_2_default:; #line 744 - return (-1); - } else { - switch_2_break: ; + return (-1); + } else { + switch_2_break:; + } } } - } #line 753 - if (pended == 1) { + if (pended == 1) { #line 754 - if (s == NP) { + if (s == NP) { #line 755 - s = NP; + s = NP; + } else { + goto _L___2; + } } else { - goto _L___2; - } - } else { - _L___2: + _L___2: #line 761 - if (pended == 1) { + if (pended == 1) { #line 762 - if (s == MPR3) { + if (s == MPR3) { #line 763 - s = MPR3; + s = MPR3; + } else { + goto _L___1; + } } else { - goto _L___1; - } - } else { - _L___1: + _L___1: #line 769 - if (s != UNLOADED) { + if (s != UNLOADED) { #line 772 - if (status != -1) { + if (status != -1) { #line 775 - if (s != SKIP2) { + if (s != SKIP2) { #line 776 - if (s != IPC) { + if (s != IPC) { #line 777 - if (s != DC) { - { + if (s != DC) { + { #line 779 - errorFn(); + errorFn(); + } + } else { + goto _L___0; } } else { goto _L___0; } } else { - goto _L___0; - } - } else { - _L___0: + _L___0: #line 789 - if (pended == 1) { + if (pended == 1) { #line 790 - if (status != 259) { + if (status != 259) { #line 791 - status = 0; - } - } else { + status = 0; + } + } else { #line 796 - if (s == DC) { + if (s == DC) { #line 797 - if (status == 259) { - { + if (status == 259) { + { #line 799 - errorFn(); + errorFn(); + } } - } - } else { + } else { #line 805 - if (status != lowerDriverReturn) { - { + if (status != lowerDriverReturn) { + { #line 807 - errorFn(); + errorFn(); + } } } } @@ -1073,452 +1075,435 @@ int main(void) } } } - } #line 819 - status = 0; + status = 0; #line 820 - return (status); -} + return (status); + } } #line 823 "floppy_simpl3.cil.c" -int IoBuildDeviceIoControlRequest(int IoControlCode , int DeviceObject , int InputBuffer , - int InputBufferLength , int OutputBuffer , int OutputBufferLength , - int InternalDeviceIoControl , int Event , int IoStatusBlock ) -{ - int malloc = __VERIFIER_nondet_int() ; +int IoBuildDeviceIoControlRequest(int IoControlCode, int DeviceObject, + int InputBuffer, int InputBufferLength, + int OutputBuffer, int OutputBufferLength, + int InternalDeviceIoControl, int Event, + int IoStatusBlock) { + int malloc = __VERIFIER_nondet_int(); { #line 830 - customIrp = 1; + customIrp = 1; #line 831 - int tmp_ndt_2; - tmp_ndt_2 = __VERIFIER_nondet_int(); - if (tmp_ndt_2 == 0) { - goto switch_3_0; - } else { - goto switch_3_default; + int tmp_ndt_2; + tmp_ndt_2 = __VERIFIER_nondet_int(); + if (tmp_ndt_2 == 0) { + goto switch_3_0; + } else { + goto switch_3_default; #line 836 - if (0) { - switch_3_0: + if (0) { + switch_3_0: #line 838 - return (malloc); - switch_3_default: ; + return (malloc); + switch_3_default:; #line 840 - return (0); - } else { - + return (0); + } else { + } } } } -} #line 848 "floppy_simpl3.cil.c" -int IoDeleteSymbolicLink(int SymbolicLinkName ) -{ +int IoDeleteSymbolicLink(int SymbolicLinkName) { { #line 852 - int tmp_ndt_3; - tmp_ndt_3 = __VERIFIER_nondet_int(); - if (tmp_ndt_3 == 0) { - goto switch_4_0; - } else { - goto switch_4_default; + int tmp_ndt_3; + tmp_ndt_3 = __VERIFIER_nondet_int(); + if (tmp_ndt_3 == 0) { + goto switch_4_0; + } else { + goto switch_4_default; #line 857 - if (0) { - switch_4_0: + if (0) { + switch_4_0: #line 859 - return (0); - switch_4_default: ; + return (0); + switch_4_default:; #line 861 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 869 "floppy_simpl3.cil.c" -int IoQueryDeviceDescription(int BusType , int BusNumber , int ControllerType , int ControllerNumber , - int PeripheralType , int PeripheralNumber , int CalloutRoutine , - int Context ) -{ +int IoQueryDeviceDescription(int BusType, int BusNumber, int ControllerType, + int ControllerNumber, int PeripheralType, + int PeripheralNumber, int CalloutRoutine, + int Context) { { #line 875 - int tmp_ndt_4; - tmp_ndt_4 = __VERIFIER_nondet_int(); - if (tmp_ndt_4 == 0) { - goto switch_5_0; - } else { - goto switch_5_default; + int tmp_ndt_4; + tmp_ndt_4 = __VERIFIER_nondet_int(); + if (tmp_ndt_4 == 0) { + goto switch_5_0; + } else { + goto switch_5_default; #line 880 - if (0) { - switch_5_0: + if (0) { + switch_5_0: #line 882 - return (0); - switch_5_default: ; + return (0); + switch_5_default:; #line 884 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 892 "floppy_simpl3.cil.c" -int IoRegisterDeviceInterface(int PhysicalDeviceObject , int InterfaceClassGuid , - int ReferenceString , int SymbolicLinkName ) -{ +int IoRegisterDeviceInterface(int PhysicalDeviceObject, int InterfaceClassGuid, + int ReferenceString, int SymbolicLinkName) { { #line 897 - int tmp_ndt_5; - tmp_ndt_5 = __VERIFIER_nondet_int(); - if (tmp_ndt_5 == 0) { - goto switch_6_0; - } else { - goto switch_6_default; + int tmp_ndt_5; + tmp_ndt_5 = __VERIFIER_nondet_int(); + if (tmp_ndt_5 == 0) { + goto switch_6_0; + } else { + goto switch_6_default; #line 902 - if (0) { - switch_6_0: + if (0) { + switch_6_0: #line 904 - return (0); - switch_6_default: ; + return (0); + switch_6_default:; #line 906 - return (-1073741808); - } else { - + return (-1073741808); + } else { + } } } } -} #line 914 "floppy_simpl3.cil.c" -int IoSetDeviceInterfaceState(int SymbolicLinkName , int Enable ) -{ +int IoSetDeviceInterfaceState(int SymbolicLinkName, int Enable) { { #line 918 - int tmp_ndt_6; - tmp_ndt_6 = __VERIFIER_nondet_int(); - if (tmp_ndt_6 == 0) { - goto switch_7_0; - } else { - goto switch_7_default; + int tmp_ndt_6; + tmp_ndt_6 = __VERIFIER_nondet_int(); + if (tmp_ndt_6 == 0) { + goto switch_7_0; + } else { + goto switch_7_default; #line 923 - if (0) { - switch_7_0: + if (0) { + switch_7_0: #line 925 - return (0); - switch_7_default: ; + return (0); + switch_7_default:; #line 927 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 935 "floppy_simpl3.cil.c" -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { #line 939 - if (s == NP) { + if (s == NP) { #line 940 - s = MPR1; - } else { - { + s = MPR1; + } else { + { #line 943 - errorFn(); + errorFn(); + } } - } #line 946 - return; -} + return; + } } #line 949 "floppy_simpl3.cil.c" -int IofCallDriver(int DeviceObject , int Irp ) -{ - int returnVal2 ; - int compRetStatus1 ; - int lcontext = __VERIFIER_nondet_int() ; - unsigned long __cil_tmp7 ; +int IofCallDriver(int DeviceObject, int Irp) { + int returnVal2; + int compRetStatus1; + int lcontext = __VERIFIER_nondet_int(); + unsigned long __cil_tmp7; { #line 956 - if (compRegistered) { - { + if (compRegistered) { + { #line 958 - compRetStatus1 = FloppyPnpComplete(DeviceObject, Irp, lcontext); - } - { + compRetStatus1 = FloppyPnpComplete(DeviceObject, Irp, lcontext); + } + { #line 960 - __cil_tmp7 = (unsigned long )compRetStatus1; + __cil_tmp7 = (unsigned long)compRetStatus1; #line 960 - if (__cil_tmp7 == -1073741802) { - { + if (__cil_tmp7 == -1073741802) { + { #line 962 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 970 - int tmp_ndt_7; - tmp_ndt_7 = __VERIFIER_nondet_int(); - if (tmp_ndt_7 == 0) { - goto switch_8_0; - } else { -#line 973 - int tmp_ndt_8; - tmp_ndt_8 = __VERIFIER_nondet_int(); - if (tmp_ndt_8 == 1) { - goto switch_8_1; + int tmp_ndt_7; + tmp_ndt_7 = __VERIFIER_nondet_int(); + if (tmp_ndt_7 == 0) { + goto switch_8_0; } else { - goto switch_8_default; +#line 973 + int tmp_ndt_8; + tmp_ndt_8 = __VERIFIER_nondet_int(); + if (tmp_ndt_8 == 1) { + goto switch_8_1; + } else { + goto switch_8_default; #line 978 - if (0) { - switch_8_0: + if (0) { + switch_8_0: #line 980 - returnVal2 = 0; - goto switch_8_break; - switch_8_1: + returnVal2 = 0; + goto switch_8_break; + switch_8_1: #line 983 - returnVal2 = -1073741823; - goto switch_8_break; - switch_8_default: + returnVal2 = -1073741823; + goto switch_8_break; + switch_8_default: #line 986 - returnVal2 = 259; - goto switch_8_break; - } else { - switch_8_break: ; + returnVal2 = 259; + goto switch_8_break; + } else { + switch_8_break:; + } } } - } #line 994 - if (s == NP) { + if (s == NP) { #line 995 - s = IPC; + s = IPC; #line 996 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 998 - if (s == MPR1) { + if (s == MPR1) { #line 999 - if (returnVal2 == 259) { + if (returnVal2 == 259) { #line 1000 - s = MPR3; + s = MPR3; #line 1001 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 1003 - s = NP; + s = NP; #line 1004 - lowerDriverReturn = returnVal2; - } - } else { + lowerDriverReturn = returnVal2; + } + } else { #line 1007 - if (s == SKIP1) { + if (s == SKIP1) { #line 1008 - s = SKIP2; + s = SKIP2; #line 1009 - lowerDriverReturn = returnVal2; - } else { - { + lowerDriverReturn = returnVal2; + } else { + { #line 1012 - errorFn(); + errorFn(); + } } } } - } #line 1017 - return (returnVal2); -} + return (returnVal2); + } } #line 1020 "floppy_simpl3.cil.c" -void IofCompleteRequest(int Irp , int PriorityBoost ) -{ +void IofCompleteRequest(int Irp, int PriorityBoost) { { #line 1024 - if (s == NP) { + if (s == NP) { #line 1025 - s = DC; - } else { - { + s = DC; + } else { + { #line 1028 - errorFn(); + errorFn(); + } } - } #line 1031 - return; -} + return; + } } #line 1034 "floppy_simpl3.cil.c" -int KeSetEvent(int Event , int Increment , int Wait ) -{ int l = __VERIFIER_nondet_int() ; +int KeSetEvent(int Event, int Increment, int Wait) { + int l = __VERIFIER_nondet_int(); { #line 1038 - setEventCalled = 1; + setEventCalled = 1; #line 1039 - return (l); -} + return (l); + } } #line 1042 "floppy_simpl3.cil.c" -int KeWaitForSingleObject(int Object , int WaitReason , int WaitMode , int Alertable , - int Timeout ) -{ +int KeWaitForSingleObject(int Object, int WaitReason, int WaitMode, + int Alertable, int Timeout) { { #line 1047 - if (s == MPR3) { + if (s == MPR3) { #line 1048 - if (setEventCalled == 1) { + if (setEventCalled == 1) { #line 1049 - s = NP; + s = NP; #line 1050 - setEventCalled = 0; + setEventCalled = 0; + } else { + goto _L; + } } else { - goto _L; - } - } else { - _L: + _L: #line 1056 - if (customIrp == 1) { + if (customIrp == 1) { #line 1057 - s = NP; + s = NP; #line 1058 - customIrp = 0; - } else { + customIrp = 0; + } else { #line 1060 - if (s == MPR3) { - { + if (s == MPR3) { + { #line 1062 - errorFn(); + errorFn(); + } } } } - } #line 1069 - int tmp_ndt_9; - tmp_ndt_9 = __VERIFIER_nondet_int(); - if (tmp_ndt_9 == 0) { - goto switch_9_0; - } else { - goto switch_9_default; + int tmp_ndt_9; + tmp_ndt_9 = __VERIFIER_nondet_int(); + if (tmp_ndt_9 == 0) { + goto switch_9_0; + } else { + goto switch_9_default; #line 1074 - if (0) { - switch_9_0: + if (0) { + switch_9_0: #line 1076 - return (0); - switch_9_default: ; + return (0); + switch_9_default:; #line 1078 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1086 "floppy_simpl3.cil.c" -int ObReferenceObjectByHandle(int Handle , int DesiredAccess , int ObjectType , int AccessMode , - int Object , int HandleInformation ) -{ +int ObReferenceObjectByHandle(int Handle, int DesiredAccess, int ObjectType, + int AccessMode, int Object, + int HandleInformation) { { #line 1091 - int tmp_ndt_10; - tmp_ndt_10 = __VERIFIER_nondet_int(); - if (tmp_ndt_10 == 0) { - goto switch_10_0; - } else { - goto switch_10_default; + int tmp_ndt_10; + tmp_ndt_10 = __VERIFIER_nondet_int(); + if (tmp_ndt_10 == 0) { + goto switch_10_0; + } else { + goto switch_10_default; #line 1096 - if (0) { - switch_10_0: + if (0) { + switch_10_0: #line 1098 - return (0); - switch_10_default: ; + return (0); + switch_10_default:; #line 1100 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1108 "floppy_simpl3.cil.c" -int PsCreateSystemThread(int ThreadHandle , int DesiredAccess , int ObjectAttributes , - int ProcessHandle , int ClientId , int StartRoutine , int StartContext ) -{ +int PsCreateSystemThread(int ThreadHandle, int DesiredAccess, + int ObjectAttributes, int ProcessHandle, int ClientId, + int StartRoutine, int StartContext) { { #line 1113 - int tmp_ndt_11; - tmp_ndt_11 = __VERIFIER_nondet_int(); - if (tmp_ndt_11 == 0) { - goto switch_11_0; - } else { - goto switch_11_default; + int tmp_ndt_11; + tmp_ndt_11 = __VERIFIER_nondet_int(); + if (tmp_ndt_11 == 0) { + goto switch_11_0; + } else { + goto switch_11_default; #line 1118 - if (0) { - switch_11_0: + if (0) { + switch_11_0: #line 1120 - return (0); - switch_11_default: ; + return (0); + switch_11_default:; #line 1122 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1130 "floppy_simpl3.cil.c" -int ZwClose(int Handle ) -{ +int ZwClose(int Handle) { { #line 1134 - int tmp_ndt_12; - tmp_ndt_12 = __VERIFIER_nondet_int(); - if (tmp_ndt_12 == 0) { - goto switch_12_0; - } else { - goto switch_12_default; + int tmp_ndt_12; + tmp_ndt_12 = __VERIFIER_nondet_int(); + if (tmp_ndt_12 == 0) { + goto switch_12_0; + } else { + goto switch_12_default; #line 1139 - if (0) { - switch_12_0: + if (0) { + switch_12_0: #line 1141 - return (0); - switch_12_default: ; + return (0); + switch_12_default:; #line 1143 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1151 "floppy_simpl3.cil.c" -int FloppyCreateClose(int DeviceObject , int Irp ) -{ int Irp__IoStatus__Status ; - int Irp__IoStatus__Information ; +int FloppyCreateClose(int DeviceObject, int Irp) { + int Irp__IoStatus__Status; + int Irp__IoStatus__Information; { - { + { #line 1157 - myStatus = 0; + myStatus = 0; #line 1158 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 1159 - Irp__IoStatus__Information = 1; + Irp__IoStatus__Information = 1; #line 1160 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 1162 - return (0); -} + return (0); + } } diff --git a/test/ntdrivers-simplified/floppy_simpl4_false.cil.c b/test/ntdrivers-simplified/floppy_simpl4_false.cil.c index 4926bd90b..29be2307c 100644 --- a/test/ntdrivers-simplified/floppy_simpl4_false.cil.c +++ b/test/ntdrivers-simplified/floppy_simpl4_false.cil.c @@ -6,547 +6,548 @@ extern char __VERIFIER_nondet_char(void); extern int __VERIFIER_nondet_int(void); extern long __VERIFIER_nondet_long(void); extern void *__VERIFIER_nondet_pointer(void); -void errorFn(void) ; -void IofCompleteRequest(int Irp , int PriorityBoost ); +void errorFn(void); +void IofCompleteRequest(int Irp, int PriorityBoost); extern int __VERIFIER_nondet_int(); -int FloppyThread ; -int KernelMode ; -int Suspended ; -int Executive ; -int DiskController ; -int FloppyDiskPeripheral ; -int FlConfigCallBack ; -int MaximumInterfaceType ; -int MOUNTDEV_MOUNTED_DEVICE_GUID ; -int myStatus ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; +int FloppyThread; +int KernelMode; +int Suspended; +int Executive; +int DiskController; +int FloppyDiskPeripheral; +int FlConfigCallBack; +int MaximumInterfaceType; +int MOUNTDEV_MOUNTED_DEVICE_GUID; +int myStatus; +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; -void _BLAST_init(void) -{ +void _BLAST_init(void) { { #line 75 - UNLOADED = 0; + UNLOADED = 0; #line 76 - NP = 1; + NP = 1; #line 77 - DC = 2; + DC = 2; #line 78 - SKIP1 = 3; + SKIP1 = 3; #line 79 - SKIP2 = 4; + SKIP2 = 4; #line 80 - MPR1 = 5; + MPR1 = 5; #line 81 - MPR3 = 6; + MPR3 = 6; #line 82 - IPC = 7; + IPC = 7; #line 83 - s = UNLOADED; + s = UNLOADED; #line 84 - pended = 0; + pended = 0; #line 85 - compRegistered = 0; + compRegistered = 0; #line 86 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 87 - setEventCalled = 0; + setEventCalled = 0; #line 88 - customIrp = 0; + customIrp = 0; #line 89 - return; -} + return; + } } #line 92 "floppy_simpl4.cil.c" -int PagingReferenceCount = 0; +int PagingReferenceCount = 0; #line 93 "floppy_simpl4.cil.c" -int PagingMutex = 0; +int PagingMutex = 0; #line 94 "floppy_simpl4.cil.c" -int FlAcpiConfigureFloppy(int DisketteExtension , int FdcInfo ) -{ +int FlAcpiConfigureFloppy(int DisketteExtension, int FdcInfo) { { #line 98 - return (0); -} + return (0); + } } #line 101 "floppy_simpl4.cil.c" -int FlQueueIrpToThread(int Irp , int DisketteExtension ) -{ int status ; - int threadHandle = __VERIFIER_nondet_int() ; - int DisketteExtension__PoweringDown = __VERIFIER_nondet_int() ; - int DisketteExtension__ThreadReferenceCount = __VERIFIER_nondet_int() ; - int DisketteExtension__FloppyThread = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int Irp__IoStatus__Information ; - int Irp__Tail__Overlay__CurrentStackLocation__Control ; - int ObjAttributes = __VERIFIER_nondet_int() ; - int __cil_tmp12 ; - int __cil_tmp13 ; +int FlQueueIrpToThread(int Irp, int DisketteExtension) { + int status; + int threadHandle = __VERIFIER_nondet_int(); + int DisketteExtension__PoweringDown = __VERIFIER_nondet_int(); + int DisketteExtension__ThreadReferenceCount = __VERIFIER_nondet_int(); + int DisketteExtension__FloppyThread = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int Irp__IoStatus__Information; + int Irp__Tail__Overlay__CurrentStackLocation__Control; + int ObjAttributes = __VERIFIER_nondet_int(); + int __cil_tmp12; + int __cil_tmp13; { #line 113 - if (DisketteExtension__PoweringDown == 1) { + if (DisketteExtension__PoweringDown == 1) { #line 114 - myStatus = -1073741101; + myStatus = -1073741101; #line 115 - Irp__IoStatus__Status = -1073741101; + Irp__IoStatus__Status = -1073741101; #line 116 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 117 - return (-1073741101); - } + return (-1073741101); + } #line 121 - DisketteExtension__ThreadReferenceCount ++; + DisketteExtension__ThreadReferenceCount++; #line 122 - if (DisketteExtension__ThreadReferenceCount == 0) { + if (DisketteExtension__ThreadReferenceCount == 0) { #line 123 - DisketteExtension__ThreadReferenceCount ++; + DisketteExtension__ThreadReferenceCount++; #line 124 - PagingReferenceCount ++; + PagingReferenceCount++; #line 125 - if (PagingReferenceCount == 1) { - - } - { + if (PagingReferenceCount == 1) { + } + { #line 131 - status = PsCreateSystemThread(threadHandle, 0, ObjAttributes, 0, 0, FloppyThread, - DisketteExtension); - } - { + status = PsCreateSystemThread(threadHandle, 0, ObjAttributes, 0, 0, + FloppyThread, DisketteExtension); + } + { #line 134 #line 134 - if (status < 0) { + if (status < 0) { #line 135 - DisketteExtension__ThreadReferenceCount = -1; + DisketteExtension__ThreadReferenceCount = -1; #line 136 - PagingReferenceCount --; + PagingReferenceCount--; #line 137 - if (PagingReferenceCount == 0) { - - } + if (PagingReferenceCount == 0) { + } #line 142 - return (status); - } - } - { + return (status); + } + } + { #line 147 - status = ObReferenceObjectByHandle(threadHandle, 1048576, 0, KernelMode, DisketteExtension__FloppyThread, - 0); + status = ObReferenceObjectByHandle(threadHandle, 1048576, 0, KernelMode, + DisketteExtension__FloppyThread, 0); #line 149 - ZwClose(threadHandle); - } - { + ZwClose(threadHandle); + } + { #line 151 #line 151 - if (status < 0) { + if (status < 0) { #line 152 - return (status); - } + return (status); + } + } } - } #line 159 - //Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; +// Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; #line 160 - if (pended == 0) { + if (pended == 0) { #line 161 - pended = 1; - } else { - { + pended = 1; + } else { + { #line 164 - errorFn(); + errorFn(); + } } - } #line 167 - return (259); -} + return (259); + } } #line 170 "floppy_simpl4.cil.c" -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 ; +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 199 - ntStatus = 0; + ntStatus = 0; #line 200 - PagingReferenceCount ++; + PagingReferenceCount++; #line 201 - if (PagingReferenceCount == 1) { - - } + if (PagingReferenceCount == 1) { + } #line 206 - disketteExtension = DeviceObject__DeviceExtension; + disketteExtension = DeviceObject__DeviceExtension; #line 207 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = Irp__Tail__Overlay__CurrentStackLocation; #line 208 - if (disketteExtension__IsRemoved) { - { + if (disketteExtension__IsRemoved) { + { #line 210 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 211 - Irp__IoStatus__Status = -1073741738; + Irp__IoStatus__Status = -1073741738; #line 212 - myStatus = -1073741738; + myStatus = -1073741738; #line 213 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 215 - return (-1073741738); - } + return (-1073741738); + } #line 219 - if (irpSp__MinorFunction == 0) { - goto switch_0_0; - } else { -#line 222 - if (irpSp__MinorFunction == 5) { - goto switch_0_5; + if (irpSp__MinorFunction == 0) { + goto switch_0_0; } else { -#line 225 - if (irpSp__MinorFunction == 1) { +#line 222 + if (irpSp__MinorFunction == 5) { goto switch_0_5; } else { -#line 228 - if (irpSp__MinorFunction == 6) { - goto switch_0_6; +#line 225 + if (irpSp__MinorFunction == 1) { + goto switch_0_5; } else { -#line 231 - if (irpSp__MinorFunction == 3) { +#line 228 + if (irpSp__MinorFunction == 6) { goto switch_0_6; } else { -#line 234 - if (irpSp__MinorFunction == 4) { - goto switch_0_4; +#line 231 + if (irpSp__MinorFunction == 3) { + goto switch_0_6; } else { -#line 237 - if (irpSp__MinorFunction == 2) { - goto switch_0_2; +#line 234 + if (irpSp__MinorFunction == 4) { + goto switch_0_4; } else { - goto switch_0_default; +#line 237 + if (irpSp__MinorFunction == 2) { + goto switch_0_2; + } else { + goto switch_0_default; #line 242 - if (0) { - switch_0_0: - { + if (0) { + switch_0_0 : { #line 245 - ntStatus = FloppyStartDevice(DeviceObject, Irp); + ntStatus = FloppyStartDevice(DeviceObject, Irp); } - goto switch_0_break; - switch_0_5: + goto switch_0_break; + switch_0_5: #line 250 - if (irpSp__MinorFunction == 5) { - - } + if (irpSp__MinorFunction == 5) { + } #line 255 - if (! disketteExtension__IsStarted) { + if (!disketteExtension__IsStarted) { #line 256 - if (s == NP) { + if (s == NP) { #line 257 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 260 - errorFn(); + errorFn(); + } } - } - { + { #line 264 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 265 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 266 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } #line 268 - return (ntStatus); - } - { + return (ntStatus); + } + { #line 273 - disketteExtension__HoldNewRequests = 1; + disketteExtension__HoldNewRequests = 1; #line 274 - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - { + ntStatus = FlQueueIrpToThread(Irp, disketteExtension); + } + { #line 276 - __cil_tmp29 = (long )ntStatus; + __cil_tmp29 = (long)ntStatus; #line 276 - if (__cil_tmp29 == 259L) { - { + if (__cil_tmp29 == 259L) { + { #line 278 - KeWaitForSingleObject(disketteExtension__FloppyThread, Executive, - KernelMode, 0, 0); - } + KeWaitForSingleObject(disketteExtension__FloppyThread, + Executive, KernelMode, 0, 0); + } #line 281 - if (disketteExtension__FloppyThread != 0) { - - } + if (disketteExtension__FloppyThread != 0) { + } #line 286 - disketteExtension__FloppyThread = 0; + disketteExtension__FloppyThread = 0; #line 287 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 288 - myStatus = 0; + myStatus = 0; #line 289 - if (s == NP) { + if (s == NP) { #line 290 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 293 - errorFn(); - } - } - { + errorFn(); + } + } + { #line 297 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 298 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 299 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - } else { - { + ntStatus = IofCallDriver( + disketteExtension__TargetObject, Irp); + } + } else { + { #line 303 - ntStatus = -1073741823; + ntStatus = -1073741823; #line 304 - Irp__IoStatus__Status = ntStatus; + Irp__IoStatus__Status = ntStatus; #line 305 - myStatus = ntStatus; + myStatus = ntStatus; #line 306 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 307 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); + } + } } - } - } - goto switch_0_break; - switch_0_6: + goto switch_0_break; + switch_0_6: #line 313 - if (irpSp__MinorFunction == 6) { - - } + if (irpSp__MinorFunction == 6) { + } #line 318 - if (! disketteExtension__IsStarted) { + if (!disketteExtension__IsStarted) { #line 319 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 320 - myStatus = 0; + myStatus = 0; #line 321 - if (s == NP) { + if (s == NP) { #line 322 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 325 - errorFn(); + errorFn(); + } } - } - { + { #line 329 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 330 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 331 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - } else { + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + } else { #line 334 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 335 - myStatus = 0; + myStatus = 0; #line 336 - irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; + irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; #line 337 - nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; + nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 338 - nextIrpSp__Control = 0; + nextIrpSp__Control = 0; #line 339 - if (s != NP) { - { -#line 341 - errorFn(); - } - } else { -#line 344 - if (compRegistered != 0) { + if (s != NP) { { -#line 346 - errorFn(); +#line 341 + errorFn(); } } else { +#line 344 + if (compRegistered != 0) { + { +#line 346 + errorFn(); + } + } else { #line 349 - compRegistered = 1; + compRegistered = 1; + } } - } - { + { #line 353 - irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1; + irpSp___1 = + Irp__Tail__Overlay__CurrentStackLocation - 1; #line 354 - irpSp__Context = doneEvent; + irpSp__Context = doneEvent; #line 355 - irpSp__Control = 224; + irpSp__Control = 224; #line 359 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - { + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + { #line 361 - __cil_tmp30 = (long )ntStatus; + __cil_tmp30 = (long)ntStatus; #line 361 - if (__cil_tmp30 == 259L) { - { + if (__cil_tmp30 == 259L) { + { #line 363 - KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0); + KeWaitForSingleObject(doneEvent, Executive, + KernelMode, 0, 0); #line 364 - ntStatus = myStatus; + ntStatus = myStatus; + } + } } - } - } - { + { #line 370 - disketteExtension__HoldNewRequests = 0; + disketteExtension__HoldNewRequests = 0; #line 371 - Irp__IoStatus__Status = ntStatus; + Irp__IoStatus__Status = ntStatus; #line 372 - myStatus = ntStatus; + myStatus = ntStatus; #line 373 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 374 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); + } } - } - goto switch_0_break; - switch_0_4: + goto switch_0_break; + switch_0_4: #line 379 - disketteExtension__IsStarted = 0; + disketteExtension__IsStarted = 0; #line 380 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 381 - myStatus = 0; + myStatus = 0; #line 382 - if (s == NP) { + if (s == NP) { #line 383 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 386 - errorFn(); + errorFn(); + } } - } - { + { #line 390 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 391 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 392 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - goto switch_0_break; - switch_0_2: + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + goto switch_0_break; + switch_0_2: #line 396 - disketteExtension__HoldNewRequests = 0; + disketteExtension__HoldNewRequests = 0; #line 397 - disketteExtension__IsStarted = 0; + disketteExtension__IsStarted = 0; #line 398 - disketteExtension__IsRemoved = 1; + disketteExtension__IsRemoved = 1; #line 399 - if (s == NP) { + if (s == NP) { #line 400 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 403 - errorFn(); + errorFn(); + } } - } - { + { #line 407 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 408 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 409 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 410 - myStatus = 0; + myStatus = 0; #line 411 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } #line 413 - if (disketteExtension__InterfaceString__Buffer != 0) { - { + if (disketteExtension__InterfaceString__Buffer != 0) { + { #line 415 - IoSetDeviceInterfaceState(disketteExtension__InterfaceString, - 0); + IoSetDeviceInterfaceState( + disketteExtension__InterfaceString, 0); + } } - } #line 421 - if (disketteExtension__ArcName__Length != 0) { - { + if (disketteExtension__ArcName__Length != 0) { + { #line 423 - IoDeleteSymbolicLink(disketteExtension__ArcName); + IoDeleteSymbolicLink(disketteExtension__ArcName); + } } - } #line 428 - IoGetConfigurationInformation__FloppyCount --; - goto switch_0_break; - switch_0_default: ; + IoGetConfigurationInformation__FloppyCount--; + goto switch_0_break; + switch_0_default:; #line 431 - if (s == NP) { + if (s == NP) { #line 432 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 435 - errorFn(); + errorFn(); + } } - } - { + { #line 439 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 440 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 441 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + } else { + switch_0_break:; } - } else { - switch_0_break: ; } } } @@ -554,547 +555,545 @@ int FloppyPnp(int DeviceObject , int Irp ) } } } - } #line 454 - PagingReferenceCount --; + PagingReferenceCount--; #line 455 - if (PagingReferenceCount == 0) { - - } + if (PagingReferenceCount == 0) { + } #line 460 - return (ntStatus); -} + return (ntStatus); + } } #line 463 "floppy_simpl4.cil.c" -int FloppyStartDevice(int DeviceObject , int Irp ) -{ int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int disketteExtension__TargetObject = __VERIFIER_nondet_int() ; - int disketteExtension__MaxTransferSize ; - int disketteExtension__DriveType = __VERIFIER_nondet_int() ; - int disketteExtension__PerpendicularMode ; - int disketteExtension__DeviceUnit ; - int disketteExtension__DriveOnValue ; - int disketteExtension__UnderlyingPDO = __VERIFIER_nondet_int() ; - int disketteExtension__InterfaceString = __VERIFIER_nondet_int() ; - int disketteExtension__IsStarted ; - int disketteExtension__HoldNewRequests ; - int ntStatus ; - int pnpStatus ; - int doneEvent = __VERIFIER_nondet_int() ; - int fdcInfo = __VERIFIER_nondet_int() ; - int fdcInfo__BufferCount ; - int fdcInfo__BufferSize ; - int fdcInfo__MaxTransferSize = __VERIFIER_nondet_int() ; - int fdcInfo__AcpiBios = __VERIFIER_nondet_int() ; - int fdcInfo__AcpiFdiSupported = __VERIFIER_nondet_int() ; - int fdcInfo__PeripheralNumber = __VERIFIER_nondet_int() ; - int fdcInfo__BusType ; - int fdcInfo__ControllerNumber = __VERIFIER_nondet_int() ; - int fdcInfo__UnitNumber = __VERIFIER_nondet_int() ; - int fdcInfo__BusNumber = __VERIFIER_nondet_int() ; - int Dc ; - int Fp ; - int disketteExtension ; - int irpSp ; - int irpSp___0 ; - int nextIrpSp ; - int nextIrpSp__Control ; - int irpSp___1 ; - int irpSp__Control ; - int irpSp__Context ; - int InterfaceType ; - int KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 = __VERIFIER_nondet_int() ; - long __cil_tmp42 ; - int __cil_tmp43 ; - int __cil_tmp44 ; - int __cil_tmp45 ; - int __cil_tmp46 = __VERIFIER_nondet_int() ; - int __cil_tmp47 ; - int __cil_tmp48 ; - int __cil_tmp49 ; +int FloppyStartDevice(int DeviceObject, int Irp) { + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int disketteExtension__TargetObject = __VERIFIER_nondet_int(); + int disketteExtension__MaxTransferSize; + int disketteExtension__DriveType = __VERIFIER_nondet_int(); + int disketteExtension__PerpendicularMode; + int disketteExtension__DeviceUnit; + int disketteExtension__DriveOnValue; + int disketteExtension__UnderlyingPDO = __VERIFIER_nondet_int(); + int disketteExtension__InterfaceString = __VERIFIER_nondet_int(); + int disketteExtension__IsStarted; + int disketteExtension__HoldNewRequests; + int ntStatus; + int pnpStatus; + int doneEvent = __VERIFIER_nondet_int(); + int fdcInfo = __VERIFIER_nondet_int(); + int fdcInfo__BufferCount; + int fdcInfo__BufferSize; + int fdcInfo__MaxTransferSize = __VERIFIER_nondet_int(); + int fdcInfo__AcpiBios = __VERIFIER_nondet_int(); + int fdcInfo__AcpiFdiSupported = __VERIFIER_nondet_int(); + int fdcInfo__PeripheralNumber = __VERIFIER_nondet_int(); + int fdcInfo__BusType; + int fdcInfo__ControllerNumber = __VERIFIER_nondet_int(); + int fdcInfo__UnitNumber = __VERIFIER_nondet_int(); + int fdcInfo__BusNumber = __VERIFIER_nondet_int(); + int Dc; + int Fp; + int disketteExtension; + int irpSp; + int irpSp___0; + int nextIrpSp; + int nextIrpSp__Control; + int irpSp___1; + int irpSp__Control; + int irpSp__Context; + int InterfaceType; + int KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 = + __VERIFIER_nondet_int(); + long __cil_tmp42; + int __cil_tmp43; + int __cil_tmp44; + int __cil_tmp45; + int __cil_tmp46 = __VERIFIER_nondet_int(); + int __cil_tmp47; + int __cil_tmp48; + int __cil_tmp49; { #line 505 - Dc = DiskController; + Dc = DiskController; #line 506 - Fp = FloppyDiskPeripheral; + Fp = FloppyDiskPeripheral; #line 507 - disketteExtension = DeviceObject__DeviceExtension; + disketteExtension = DeviceObject__DeviceExtension; #line 508 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = Irp__Tail__Overlay__CurrentStackLocation; #line 509 - irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; + irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; #line 510 - nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; + nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 511 - nextIrpSp__Control = 0; + nextIrpSp__Control = 0; #line 512 - if (s != NP) { - { -#line 514 - errorFn(); - } - } else { -#line 517 - if (compRegistered != 0) { + if (s != NP) { { -#line 519 - errorFn(); +#line 514 + errorFn(); } } else { +#line 517 + if (compRegistered != 0) { + { +#line 519 + errorFn(); + } + } else { #line 522 - compRegistered = 1; + compRegistered = 1; + } } - } - { + { #line 526 - irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1; + irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 527 - irpSp__Context = doneEvent; + irpSp__Context = doneEvent; #line 528 - irpSp__Control = 224; + irpSp__Control = 224; #line 532 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - { + ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); + } + { #line 534 - __cil_tmp42 = (long )ntStatus; + __cil_tmp42 = (long)ntStatus; #line 534 - if (__cil_tmp42 == 259L) { - { + if (__cil_tmp42 == 259L) { + { #line 536 - ntStatus = KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0); + ntStatus = + KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0); #line 537 - ntStatus = myStatus; + ntStatus = myStatus; + } + } } - } - } - { + { #line 543 - fdcInfo__BufferCount = 0; + fdcInfo__BufferCount = 0; #line 544 - fdcInfo__BufferSize = 0; + fdcInfo__BufferSize = 0; #line 545 - //__cil_tmp43 = 770 << 2; +//__cil_tmp43 = 770 << 2; #line 545 - //__cil_tmp44 = 7 << 16; +//__cil_tmp44 = 7 << 16; #line 545 - //__cil_tmp45 = __cil_tmp44 | __cil_tmp43; +//__cil_tmp45 = __cil_tmp44 | __cil_tmp43; #line 545 - //__cil_tmp46 = __cil_tmp45 | 3; +//__cil_tmp46 = __cil_tmp45 | 3; #line 545 - ntStatus = FlFdcDeviceIo(disketteExtension__TargetObject, __cil_tmp46, fdcInfo); - } + ntStatus = + FlFdcDeviceIo(disketteExtension__TargetObject, __cil_tmp46, fdcInfo); + } #line 548 - if (ntStatus >= 0) { + if (ntStatus >= 0) { #line 549 - disketteExtension__MaxTransferSize = fdcInfo__MaxTransferSize; + disketteExtension__MaxTransferSize = fdcInfo__MaxTransferSize; #line 550 - if (fdcInfo__AcpiBios) { + if (fdcInfo__AcpiBios) { #line 551 - if (fdcInfo__AcpiFdiSupported) { - { + if (fdcInfo__AcpiFdiSupported) { + { #line 553 - ntStatus = FlAcpiConfigureFloppy(disketteExtension, fdcInfo); - } + ntStatus = FlAcpiConfigureFloppy(disketteExtension, fdcInfo); + } #line 555 - if (disketteExtension__DriveType == 4) { + if (disketteExtension__DriveType == 4) { #line 556 - // __cil_tmp47 = 1 << fdcInfo__PeripheralNumber; +// __cil_tmp47 = 1 << fdcInfo__PeripheralNumber; #line 556 - //disketteExtension__PerpendicularMode |= __cil_tmp47; + // disketteExtension__PerpendicularMode |= __cil_tmp47; + } + } else { + goto _L; } } else { - goto _L; - } - } else { - _L: + _L: #line 565 - if (disketteExtension__DriveType == 4) { + if (disketteExtension__DriveType == 4) { #line 566 - // __cil_tmp48 = 1 << fdcInfo__PeripheralNumber; +// __cil_tmp48 = 1 << fdcInfo__PeripheralNumber; #line 566 - //disketteExtension__PerpendicularMode |= __cil_tmp48; - } + // disketteExtension__PerpendicularMode |= __cil_tmp48; + } #line 570 - InterfaceType = 0; - { + InterfaceType = 0; + { #line 572 - while (1) { - while_0_continue: /* CIL Label */ ; + while (1) { + while_0_continue: /* CIL Label */; #line 574 - if (InterfaceType >= MaximumInterfaceType) { - goto while_1_break; - } - { + if (InterfaceType >= MaximumInterfaceType) { + goto while_1_break; + } + { #line 580 - fdcInfo__BusType = InterfaceType; + fdcInfo__BusType = InterfaceType; #line 581 - ntStatus = IoQueryDeviceDescription(fdcInfo__BusType, fdcInfo__BusNumber, - Dc, fdcInfo__ControllerNumber, Fp, fdcInfo__PeripheralNumber, - FlConfigCallBack, disketteExtension); - } + ntStatus = IoQueryDeviceDescription( + fdcInfo__BusType, fdcInfo__BusNumber, Dc, + fdcInfo__ControllerNumber, Fp, fdcInfo__PeripheralNumber, + FlConfigCallBack, disketteExtension); + } #line 585 - if (ntStatus >= 0) { - goto while_1_break; - } + if (ntStatus >= 0) { + goto while_1_break; + } #line 590 - InterfaceType ++; - } - while_0_break: /* CIL Label */ ; + InterfaceType++; + } + while_0_break: /* CIL Label */; + } + while_1_break:; } - while_1_break: ; - } #line 595 - if (ntStatus >= 0) { + if (ntStatus >= 0) { #line 596 - if (KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 != 0) { + if (KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 != 0) { #line 597 - disketteExtension__DeviceUnit = fdcInfo__UnitNumber; + disketteExtension__DeviceUnit = fdcInfo__UnitNumber; #line 598 - disketteExtension__DriveOnValue = fdcInfo__UnitNumber; - } else { + disketteExtension__DriveOnValue = fdcInfo__UnitNumber; + } else { #line 600 - disketteExtension__DeviceUnit = fdcInfo__PeripheralNumber; + disketteExtension__DeviceUnit = fdcInfo__PeripheralNumber; #line 601 - //__cil_tmp49 = 16 << fdcInfo__PeripheralNumber; +//__cil_tmp49 = 16 << fdcInfo__PeripheralNumber; #line 601 - //disketteExtension__DriveOnValue = fdcInfo__PeripheralNumber | __cil_tmp49; - } - { + // disketteExtension__DriveOnValue = fdcInfo__PeripheralNumber | + // __cil_tmp49; + } + { #line 604 - pnpStatus = IoRegisterDeviceInterface(disketteExtension__UnderlyingPDO, MOUNTDEV_MOUNTED_DEVICE_GUID, - 0, disketteExtension__InterfaceString); - } + pnpStatus = IoRegisterDeviceInterface( + disketteExtension__UnderlyingPDO, MOUNTDEV_MOUNTED_DEVICE_GUID, 0, + disketteExtension__InterfaceString); + } #line 607 - if (pnpStatus >= 0) { - { + if (pnpStatus >= 0) { + { #line 609 - pnpStatus = IoSetDeviceInterfaceState(disketteExtension__InterfaceString, - 1); + pnpStatus = IoSetDeviceInterfaceState( + disketteExtension__InterfaceString, 1); + } } - } #line 615 - disketteExtension__IsStarted = 1; + disketteExtension__IsStarted = 1; #line 616 - disketteExtension__HoldNewRequests = 0; + disketteExtension__HoldNewRequests = 0; + } } - } - { + { #line 624 - Irp__IoStatus__Status = ntStatus; + Irp__IoStatus__Status = ntStatus; #line 625 - myStatus = ntStatus; + myStatus = ntStatus; #line 626 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 628 - return (ntStatus); -} + return (ntStatus); + } } #line 631 "floppy_simpl4.cil.c" -int FloppyPnpComplete(int DeviceObject , int Irp , int Context ) -{ +int FloppyPnpComplete(int DeviceObject, int Irp, int Context) { { - { + { #line 636 - KeSetEvent(Context, 1, 0); - } + KeSetEvent(Context, 1, 0); + } #line 638 - return (-1073741802); -} + return (-1073741802); + } } #line 641 "floppy_simpl4.cil.c" -int FlFdcDeviceIo(int DeviceObject , int Ioctl , int Data ) -{ int ntStatus ; - int irp ; - int irpStack ; - int doneEvent = __VERIFIER_nondet_int() ; - int ioStatus = __VERIFIER_nondet_int() ; - int irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int irpStack__Parameters__DeviceIoControl__Type3InputBuffer ; - long __cil_tmp11 ; +int FlFdcDeviceIo(int DeviceObject, int Ioctl, int Data) { + int ntStatus; + int irp; + int irpStack; + int doneEvent = __VERIFIER_nondet_int(); + int ioStatus = __VERIFIER_nondet_int(); + int irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int irpStack__Parameters__DeviceIoControl__Type3InputBuffer; + long __cil_tmp11; { - { + { #line 652 - irp = IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, 0, 0, 0, 0, 1, doneEvent, - ioStatus); - } + irp = IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, 0, 0, 0, 0, 1, + doneEvent, ioStatus); + } #line 655 - if (irp == 0) { + if (irp == 0) { #line 656 - return (-1073741670); - } - { + return (-1073741670); + } + { #line 661 - irpStack = irp__Tail__Overlay__CurrentStackLocation - 1; + irpStack = irp__Tail__Overlay__CurrentStackLocation - 1; #line 662 - irpStack__Parameters__DeviceIoControl__Type3InputBuffer = Data; + irpStack__Parameters__DeviceIoControl__Type3InputBuffer = Data; #line 663 - ntStatus = IofCallDriver(DeviceObject, irp); - } - { + ntStatus = IofCallDriver(DeviceObject, irp); + } + { #line 665 - __cil_tmp11 = (long )ntStatus; + __cil_tmp11 = (long)ntStatus; #line 665 - if (__cil_tmp11 == 259L) { - { + if (__cil_tmp11 == 259L) { + { #line 667 - KeWaitForSingleObject(doneEvent, Suspended, KernelMode, 0, 0); + KeWaitForSingleObject(doneEvent, Suspended, KernelMode, 0, 0); #line 668 - ntStatus = myStatus; + ntStatus = myStatus; + } + } } - } - } #line 673 - return (ntStatus); -} + return (ntStatus); + } } #line 676 "floppy_simpl4.cil.c" -void FloppyProcessQueuedRequests(int DisketteExtension ) -{ +void FloppyProcessQueuedRequests(int DisketteExtension) { { #line 680 - return; -} + return; + } } #line 683 "floppy_simpl4.cil.c" -void stub_driver_init(void) -{ +void stub_driver_init(void) { { #line 687 - s = NP; + s = NP; #line 688 - pended = 0; + pended = 0; #line 689 - compRegistered = 0; + compRegistered = 0; #line 690 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 691 - setEventCalled = 0; + setEventCalled = 0; #line 692 - customIrp = 0; + customIrp = 0; #line 693 - return; -} + return; + } } #line 696 "floppy_simpl4.cil.c" -int main(void) -{ int status ; - int irp = __VERIFIER_nondet_int() ; - int pirp ; - int pirp__IoStatus__Status ; - int irp_choice = __VERIFIER_nondet_int() ; - int devobj = __VERIFIER_nondet_int() ; - int __cil_tmp8 ; +int main(void) { + int status; + int irp = __VERIFIER_nondet_int(); + int pirp; + int pirp__IoStatus__Status; + int irp_choice = __VERIFIER_nondet_int(); + int devobj = __VERIFIER_nondet_int(); + int __cil_tmp8; - FloppyThread = 0; - KernelMode = 0; - Suspended = 0; - Executive = 0; - DiskController = 0; - FloppyDiskPeripheral = 0; - FlConfigCallBack = 0; - MaximumInterfaceType = 0; - MOUNTDEV_MOUNTED_DEVICE_GUID = 0; - myStatus = 0; - s = 0; - UNLOADED = 0; - NP = 0; - DC = 0; - SKIP1 = 0; - SKIP2 = 0 ; - MPR1 = 0; - MPR3 = 0; - IPC = 0; - pended = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; + FloppyThread = 0; + KernelMode = 0; + Suspended = 0; + Executive = 0; + DiskController = 0; + FloppyDiskPeripheral = 0; + FlConfigCallBack = 0; + MaximumInterfaceType = 0; + MOUNTDEV_MOUNTED_DEVICE_GUID = 0; + myStatus = 0; + s = 0; + UNLOADED = 0; + NP = 0; + DC = 0; + SKIP1 = 0; + SKIP2 = 0; + MPR1 = 0; + MPR3 = 0; + IPC = 0; + pended = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; { - { + { #line 707 - status = 0; + status = 0; #line 708 - pirp = irp; + pirp = irp; #line 709 - _BLAST_init(); - } + _BLAST_init(); + } #line 711 - if (status >= 0) { + if (status >= 0) { #line 712 - s = NP; + s = NP; #line 713 - customIrp = 0; + customIrp = 0; #line 714 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 715 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 716 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 717 - pended = compRegistered; + pended = compRegistered; #line 718 - pirp__IoStatus__Status = 0; + pirp__IoStatus__Status = 0; #line 719 - myStatus = 0; + myStatus = 0; #line 720 - if (irp_choice == 0) { + if (irp_choice == 0) { #line 721 - pirp__IoStatus__Status = -1073741637; + pirp__IoStatus__Status = -1073741637; #line 722 - myStatus = -1073741637; - } - { + myStatus = -1073741637; + } + { #line 727 - stub_driver_init(); - } - { + stub_driver_init(); + } + { #line 729 #line 729 - if (status < 0) { + if (status < 0) { #line 730 - return (-1); - } - } + return (-1); + } + } #line 734 - int tmp_ndt_1; - tmp_ndt_1 = __VERIFIER_nondet_int(); - if (tmp_ndt_1 == 0) { - goto switch_2_0; - } else { -#line 737 - int tmp_ndt_2; - tmp_ndt_2 = __VERIFIER_nondet_int(); - if (tmp_ndt_2 == 1) { - goto switch_2_1; + int tmp_ndt_1; + tmp_ndt_1 = __VERIFIER_nondet_int(); + if (tmp_ndt_1 == 0) { + goto switch_2_0; } else { -#line 740 - int tmp_ndt_3; - tmp_ndt_3 = __VERIFIER_nondet_int(); - if (tmp_ndt_3 == 2) { - goto switch_2_2; +#line 737 + int tmp_ndt_2; + tmp_ndt_2 = __VERIFIER_nondet_int(); + if (tmp_ndt_2 == 1) { + goto switch_2_1; } else { -#line 743 - int tmp_ndt_4; - tmp_ndt_4 = __VERIFIER_nondet_int(); - if (tmp_ndt_4 == 3) { - goto switch_2_3; +#line 740 + int tmp_ndt_3; + tmp_ndt_3 = __VERIFIER_nondet_int(); + if (tmp_ndt_3 == 2) { + goto switch_2_2; } else { - goto switch_2_default; +#line 743 + int tmp_ndt_4; + tmp_ndt_4 = __VERIFIER_nondet_int(); + if (tmp_ndt_4 == 3) { + goto switch_2_3; + } else { + goto switch_2_default; #line 748 - if (0) { - switch_2_0: - { + if (0) { + switch_2_0 : { #line 751 - status = FloppyCreateClose(devobj, pirp); + status = FloppyCreateClose(devobj, pirp); } - goto switch_2_break; - switch_2_1: - { + goto switch_2_break; + switch_2_1 : { #line 756 - status = FloppyCreateClose(devobj, pirp); + status = FloppyCreateClose(devobj, pirp); } - goto switch_2_break; - switch_2_2: - { + goto switch_2_break; + switch_2_2 : { #line 761 - status = FloppyDeviceControl(devobj, pirp); + status = FloppyDeviceControl(devobj, pirp); } - goto switch_2_break; - switch_2_3: - { + goto switch_2_break; + switch_2_3 : { #line 766 - status = FloppyPnp(devobj, pirp); + status = FloppyPnp(devobj, pirp); } - goto switch_2_break; - switch_2_default: ; + goto switch_2_break; + switch_2_default:; #line 770 - return (-1); - } else { - switch_2_break: ; + return (-1); + } else { + switch_2_break:; + } } } } } } - } #line 782 - if (pended == 1) { + if (pended == 1) { #line 783 - if (s == NP) { + if (s == NP) { #line 784 - s = NP; + s = NP; + } else { + goto _L___2; + } } else { - goto _L___2; - } - } else { - _L___2: + _L___2: #line 790 - if (pended == 1) { + if (pended == 1) { #line 791 - if (s == MPR3) { + if (s == MPR3) { #line 792 - s = MPR3; + s = MPR3; + } else { + goto _L___1; + } } else { - goto _L___1; - } - } else { - _L___1: + _L___1: #line 798 - if (s != UNLOADED) { + if (s != UNLOADED) { #line 801 - if (status != -1) { + if (status != -1) { #line 804 - if (s != SKIP2) { + if (s != SKIP2) { #line 805 - if (s != IPC) { + if (s != IPC) { #line 806 - if (s != DC) { - { + if (s != DC) { + { #line 808 - errorFn(); + errorFn(); + } + } else { + goto _L___0; } } else { goto _L___0; } } else { - goto _L___0; - } - } else { - _L___0: + _L___0: #line 818 - if (pended == 1) { + if (pended == 1) { #line 819 - if (status != 259) { + if (status != 259) { #line 820 - errorFn(); - } - } else { + errorFn(); + } + } else { #line 825 - if (s == DC) { + if (s == DC) { #line 826 - if (status == 259) { - { + if (status == 259) { + { #line 828 - errorFn(); + errorFn(); + } } - } - } else { + } else { #line 834 - if (status != lowerDriverReturn) { - { + if (status != lowerDriverReturn) { + { #line 836 - errorFn(); + errorFn(); + } } } } @@ -1103,1068 +1102,1110 @@ int main(void) } } } - } #line 848 - status = 0; + status = 0; #line 849 - return (status); -} + return (status); + } } #line 852 "floppy_simpl4.cil.c" -int IoBuildDeviceIoControlRequest(int IoControlCode , int DeviceObject , int InputBuffer , - int InputBufferLength , int OutputBuffer , int OutputBufferLength , - int InternalDeviceIoControl , int Event , int IoStatusBlock ) -{ - int malloc = __VERIFIER_nondet_int() ; +int IoBuildDeviceIoControlRequest(int IoControlCode, int DeviceObject, + int InputBuffer, int InputBufferLength, + int OutputBuffer, int OutputBufferLength, + int InternalDeviceIoControl, int Event, + int IoStatusBlock) { + int malloc = __VERIFIER_nondet_int(); { #line 859 - customIrp = 1; + customIrp = 1; #line 860 - int tmp_ndt_5; - tmp_ndt_5 = __VERIFIER_nondet_int(); - if (tmp_ndt_5 == 0) { - goto switch_3_0; - } else { - goto switch_3_default; + int tmp_ndt_5; + tmp_ndt_5 = __VERIFIER_nondet_int(); + if (tmp_ndt_5 == 0) { + goto switch_3_0; + } else { + goto switch_3_default; #line 865 - if (0) { - switch_3_0: + if (0) { + switch_3_0: #line 867 - return (malloc); - switch_3_default: ; + return (malloc); + switch_3_default:; #line 869 - return (0); - } else { - + return (0); + } else { + } } } } -} #line 877 "floppy_simpl4.cil.c" -int IoDeleteSymbolicLink(int SymbolicLinkName ) -{ +int IoDeleteSymbolicLink(int SymbolicLinkName) { { #line 881 - int tmp_ndt_6; - tmp_ndt_6 = __VERIFIER_nondet_int(); - if (tmp_ndt_6 == 0) { - goto switch_4_0; - } else { - goto switch_4_default; + int tmp_ndt_6; + tmp_ndt_6 = __VERIFIER_nondet_int(); + if (tmp_ndt_6 == 0) { + goto switch_4_0; + } else { + goto switch_4_default; #line 886 - if (0) { - switch_4_0: + if (0) { + switch_4_0: #line 888 - return (0); - switch_4_default: ; + return (0); + switch_4_default:; #line 890 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 898 "floppy_simpl4.cil.c" -int IoQueryDeviceDescription(int BusType , int BusNumber , int ControllerType , int ControllerNumber , - int PeripheralType , int PeripheralNumber , int CalloutRoutine , - int Context ) -{ +int IoQueryDeviceDescription(int BusType, int BusNumber, int ControllerType, + int ControllerNumber, int PeripheralType, + int PeripheralNumber, int CalloutRoutine, + int Context) { { #line 904 - int tmp_ndt_7; - tmp_ndt_7 = __VERIFIER_nondet_int(); - if (tmp_ndt_7 == 0) { - goto switch_5_0; - } else { - goto switch_5_default; + int tmp_ndt_7; + tmp_ndt_7 = __VERIFIER_nondet_int(); + if (tmp_ndt_7 == 0) { + goto switch_5_0; + } else { + goto switch_5_default; #line 909 - if (0) { - switch_5_0: + if (0) { + switch_5_0: #line 911 - return (0); - switch_5_default: ; + return (0); + switch_5_default:; #line 913 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 921 "floppy_simpl4.cil.c" -int IoRegisterDeviceInterface(int PhysicalDeviceObject , int InterfaceClassGuid , - int ReferenceString , int SymbolicLinkName ) -{ +int IoRegisterDeviceInterface(int PhysicalDeviceObject, int InterfaceClassGuid, + int ReferenceString, int SymbolicLinkName) { { #line 926 - int tmp_ndt_8; - tmp_ndt_8 = __VERIFIER_nondet_int(); - if (tmp_ndt_8 == 0) { - goto switch_6_0; - } else { - goto switch_6_default; + int tmp_ndt_8; + tmp_ndt_8 = __VERIFIER_nondet_int(); + if (tmp_ndt_8 == 0) { + goto switch_6_0; + } else { + goto switch_6_default; #line 931 - if (0) { - switch_6_0: + if (0) { + switch_6_0: #line 933 - return (0); - switch_6_default: ; + return (0); + switch_6_default:; #line 935 - return (-1073741808); - } else { - + return (-1073741808); + } else { + } } } } -} #line 943 "floppy_simpl4.cil.c" -int IoSetDeviceInterfaceState(int SymbolicLinkName , int Enable ) -{ +int IoSetDeviceInterfaceState(int SymbolicLinkName, int Enable) { { #line 947 - int tmp_ndt_9; - tmp_ndt_9 = __VERIFIER_nondet_int(); - if (tmp_ndt_9 == 0) { - goto switch_7_0; - } else { - goto switch_7_default; + int tmp_ndt_9; + tmp_ndt_9 = __VERIFIER_nondet_int(); + if (tmp_ndt_9 == 0) { + goto switch_7_0; + } else { + goto switch_7_default; #line 952 - if (0) { - switch_7_0: + if (0) { + switch_7_0: #line 954 - return (0); - switch_7_default: ; + return (0); + switch_7_default:; #line 956 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 964 "floppy_simpl4.cil.c" -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { #line 968 - if (s == NP) { + if (s == NP) { #line 969 - s = MPR1; - } else { - { + s = MPR1; + } else { + { #line 972 - errorFn(); + errorFn(); + } } - } #line 975 - return; -} + return; + } } #line 978 "floppy_simpl4.cil.c" -int IofCallDriver(int DeviceObject , int Irp ) -{ - int returnVal2 ; - int compRetStatus1 ; - int lcontext = __VERIFIER_nondet_int() ; - unsigned long __cil_tmp7 ; +int IofCallDriver(int DeviceObject, int Irp) { + int returnVal2; + int compRetStatus1; + int lcontext = __VERIFIER_nondet_int(); + unsigned long __cil_tmp7; { #line 985 - if (compRegistered) { - { + if (compRegistered) { + { #line 987 - compRetStatus1 = FloppyPnpComplete(DeviceObject, Irp, lcontext); - } - { + compRetStatus1 = FloppyPnpComplete(DeviceObject, Irp, lcontext); + } + { #line 989 - __cil_tmp7 = (unsigned long )compRetStatus1; + __cil_tmp7 = (unsigned long)compRetStatus1; #line 989 - if (__cil_tmp7 == -1073741802) { - { + if (__cil_tmp7 == -1073741802) { + { #line 991 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 999 - int tmp_ndt_10; - tmp_ndt_10 = __VERIFIER_nondet_int(); - if (tmp_ndt_10 == 0) { - goto switch_8_0; - } else { -#line 1002 - int tmp_ndt_11; - tmp_ndt_11 = __VERIFIER_nondet_int(); - if (tmp_ndt_11 == 1) { - goto switch_8_1; + int tmp_ndt_10; + tmp_ndt_10 = __VERIFIER_nondet_int(); + if (tmp_ndt_10 == 0) { + goto switch_8_0; } else { - goto switch_8_default; +#line 1002 + int tmp_ndt_11; + tmp_ndt_11 = __VERIFIER_nondet_int(); + if (tmp_ndt_11 == 1) { + goto switch_8_1; + } else { + goto switch_8_default; #line 1007 - if (0) { - switch_8_0: + if (0) { + switch_8_0: #line 1009 - returnVal2 = 0; - goto switch_8_break; - switch_8_1: + returnVal2 = 0; + goto switch_8_break; + switch_8_1: #line 1012 - returnVal2 = -1073741823; - goto switch_8_break; - switch_8_default: + returnVal2 = -1073741823; + goto switch_8_break; + switch_8_default: #line 1015 - returnVal2 = 259; - goto switch_8_break; - } else { - switch_8_break: ; + returnVal2 = 259; + goto switch_8_break; + } else { + switch_8_break:; + } } } - } #line 1023 - if (s == NP) { + if (s == NP) { #line 1024 - s = IPC; + s = IPC; #line 1025 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 1027 - if (s == MPR1) { + if (s == MPR1) { #line 1028 - if (returnVal2 == 259) { + if (returnVal2 == 259) { #line 1029 - s = MPR3; + s = MPR3; #line 1030 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 1032 - s = NP; + s = NP; #line 1033 - lowerDriverReturn = returnVal2; - } - } else { + lowerDriverReturn = returnVal2; + } + } else { #line 1036 - if (s == SKIP1) { + if (s == SKIP1) { #line 1037 - s = SKIP2; + s = SKIP2; #line 1038 - lowerDriverReturn = returnVal2; - } else { - { + lowerDriverReturn = returnVal2; + } else { + { #line 1041 - errorFn(); + errorFn(); + } } } } - } #line 1046 - return (returnVal2); -} + return (returnVal2); + } } #line 1049 "floppy_simpl4.cil.c" -void IofCompleteRequest(int Irp , int PriorityBoost ) -{ +void IofCompleteRequest(int Irp, int PriorityBoost) { { #line 1053 - if (s == NP) { + if (s == NP) { #line 1054 - s = DC; - } else { - { + s = DC; + } else { + { #line 1057 - errorFn(); + errorFn(); + } } - } #line 1060 - return; -} + return; + } } #line 1063 "floppy_simpl4.cil.c" -int KeSetEvent(int Event , int Increment , int Wait ) -{ int l = __VERIFIER_nondet_int() ; +int KeSetEvent(int Event, int Increment, int Wait) { + int l = __VERIFIER_nondet_int(); { #line 1067 - setEventCalled = 1; + setEventCalled = 1; #line 1068 - return (l); -} + return (l); + } } #line 1071 "floppy_simpl4.cil.c" -int KeWaitForSingleObject(int Object , int WaitReason , int WaitMode , int Alertable , - int Timeout ) -{ +int KeWaitForSingleObject(int Object, int WaitReason, int WaitMode, + int Alertable, int Timeout) { { #line 1076 - if (s == MPR3) { + if (s == MPR3) { #line 1077 - if (setEventCalled == 1) { + if (setEventCalled == 1) { #line 1078 - s = NP; + s = NP; #line 1079 - setEventCalled = 0; + setEventCalled = 0; + } else { + goto _L; + } } else { - goto _L; - } - } else { - _L: + _L: #line 1085 - if (customIrp == 1) { + if (customIrp == 1) { #line 1086 - s = NP; + s = NP; #line 1087 - customIrp = 0; - } else { + customIrp = 0; + } else { #line 1089 - if (s == MPR3) { - { + if (s == MPR3) { + { #line 1091 - errorFn(); + errorFn(); + } } } } - } #line 1098 - int tmp_ndt_12; - tmp_ndt_12 = __VERIFIER_nondet_int(); - if (tmp_ndt_12 == 0) { - goto switch_9_0; - } else { - goto switch_9_default; + int tmp_ndt_12; + tmp_ndt_12 = __VERIFIER_nondet_int(); + if (tmp_ndt_12 == 0) { + goto switch_9_0; + } else { + goto switch_9_default; #line 1103 - if (0) { - switch_9_0: + if (0) { + switch_9_0: #line 1105 - return (0); - switch_9_default: ; + return (0); + switch_9_default:; #line 1107 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1115 "floppy_simpl4.cil.c" -int ObReferenceObjectByHandle(int Handle , int DesiredAccess , int ObjectType , int AccessMode , - int Object , int HandleInformation ) -{ +int ObReferenceObjectByHandle(int Handle, int DesiredAccess, int ObjectType, + int AccessMode, int Object, + int HandleInformation) { { #line 1120 - int tmp_ndt_13; - tmp_ndt_13 = __VERIFIER_nondet_int(); - if (tmp_ndt_13 == 0) { - goto switch_10_0; - } else { - goto switch_10_default; + int tmp_ndt_13; + tmp_ndt_13 = __VERIFIER_nondet_int(); + if (tmp_ndt_13 == 0) { + goto switch_10_0; + } else { + goto switch_10_default; #line 1125 - if (0) { - switch_10_0: + if (0) { + switch_10_0: #line 1127 - return (0); - switch_10_default: ; + return (0); + switch_10_default:; #line 1129 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1137 "floppy_simpl4.cil.c" -int PsCreateSystemThread(int ThreadHandle , int DesiredAccess , int ObjectAttributes , - int ProcessHandle , int ClientId , int StartRoutine , int StartContext ) -{ +int PsCreateSystemThread(int ThreadHandle, int DesiredAccess, + int ObjectAttributes, int ProcessHandle, int ClientId, + int StartRoutine, int StartContext) { { #line 1142 - int tmp_ndt_14; - tmp_ndt_14 = __VERIFIER_nondet_int(); - if (tmp_ndt_14 == 0) { - goto switch_11_0; - } else { - goto switch_11_default; + int tmp_ndt_14; + tmp_ndt_14 = __VERIFIER_nondet_int(); + if (tmp_ndt_14 == 0) { + goto switch_11_0; + } else { + goto switch_11_default; #line 1147 - if (0) { - switch_11_0: + if (0) { + switch_11_0: #line 1149 - return (0); - switch_11_default: ; + return (0); + switch_11_default:; #line 1151 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1159 "floppy_simpl4.cil.c" -int ZwClose(int Handle ) -{ +int ZwClose(int Handle) { { #line 1163 - int tmp_ndt_15; - tmp_ndt_15 = __VERIFIER_nondet_int(); - if (tmp_ndt_15 == 0) { - goto switch_12_0; - } else { - goto switch_12_default; + int tmp_ndt_15; + tmp_ndt_15 = __VERIFIER_nondet_int(); + if (tmp_ndt_15 == 0) { + goto switch_12_0; + } else { + goto switch_12_default; #line 1168 - if (0) { - switch_12_0: + if (0) { + switch_12_0: #line 1170 - return (0); - switch_12_default: ; + return (0); + switch_12_default:; #line 1172 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1180 "floppy_simpl4.cil.c" -int FloppyCreateClose(int DeviceObject , int Irp ) -{ int Irp__IoStatus__Status ; - int Irp__IoStatus__Information ; +int FloppyCreateClose(int DeviceObject, int Irp) { + int Irp__IoStatus__Status; + int Irp__IoStatus__Information; { - { + { #line 1186 - myStatus = 0; + myStatus = 0; #line 1187 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 1188 - Irp__IoStatus__Information = 1; + Irp__IoStatus__Information = 1; #line 1189 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 1191 - return (0); -} + return (0); + } } #line 1194 -int FloppyQueueRequest(int DisketteExtension , int Irp ) ; +int FloppyQueueRequest(int DisketteExtension, int Irp); #line 1195 "floppy_simpl4.cil.c" -int FloppyDeviceControl(int DeviceObject , int Irp ) -{ int disketteExtension__HoldNewRequests = __VERIFIER_nondet_int() ; - int disketteExtension__IsRemoved = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Information ; - int disketteExtension__IsStarted = __VERIFIER_nondet_int() ; - int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int disketteExtension__TargetObject = __VERIFIER_nondet_int() ; - int irpSp__Parameters__DeviceIoControl__OutputBufferLength = __VERIFIER_nondet_int() ; - int sizeof__MOUNTDEV_NAME = __VERIFIER_nondet_int() ; - int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int() ; - int mountName__NameLength ; - int disketteExtension__DeviceName__Length = __VERIFIER_nondet_int() ; - int sizeof__USHORT = __VERIFIER_nondet_int() ; - int disketteExtension__InterfaceString__Buffer = __VERIFIER_nondet_int() ; - int uniqueId__UniqueIdLength ; - int disketteExtension__InterfaceString__Length = __VERIFIER_nondet_int() ; - int sizeof__MOUNTDEV_UNIQUE_ID = __VERIFIER_nondet_int() ; - int irpSp__Parameters__DeviceIoControl__InputBufferLength = __VERIFIER_nondet_int() ; - int sizeof__FORMAT_PARAMETERS = __VERIFIER_nondet_int() ; - int irpSp__Parameters__DeviceIoControl__IoControlCode___1 = __VERIFIER_nondet_int() ; - int sizeof__FORMAT_EX_PARAMETERS = __VERIFIER_nondet_int() ; - int formatExParameters__FormatGapLength = __VERIFIER_nondet_int() ; - int formatExParameters__SectorsPerTrack = __VERIFIER_nondet_int() ; - int sizeof__DISK_GEOMETRY = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status___0 ; - int disketteExtension = __VERIFIER_nondet_int() ; - int ntStatus ; - int outputBufferLength ; - int lowestDriveMediaType = __VERIFIER_nondet_int() ; - int highestDriveMediaType = __VERIFIER_nondet_int() ; - int formatExParametersSize = __VERIFIER_nondet_int() ; - int formatExParameters ; - int tmp ; - int mountName ; - int uniqueId ; - int tmp___0 ; - int __cil_tmp39 ; - int __cil_tmp40 ; - int __cil_tmp41 = __VERIFIER_nondet_int() ; - int __cil_tmp42 ; - int __cil_tmp43 ; - int __cil_tmp44 = __VERIFIER_nondet_int() ; - int __cil_tmp45 = __VERIFIER_nondet_int() ; - int __cil_tmp46 ; - int __cil_tmp47 ; - int __cil_tmp48 ; - int __cil_tmp49 ; - int __cil_tmp50 = __VERIFIER_nondet_int() ; - int __cil_tmp51 ; - int __cil_tmp52 ; - int __cil_tmp53 ; - int __cil_tmp54 ; - int __cil_tmp55 = __VERIFIER_nondet_int() ; - int __cil_tmp56 ; - int __cil_tmp57 ; - int __cil_tmp58 ; - int __cil_tmp59 ; - int __cil_tmp60 = __VERIFIER_nondet_int() ; - int __cil_tmp61 ; - int __cil_tmp62 ; - int __cil_tmp63 ; - int __cil_tmp64 ; - int __cil_tmp65 = __VERIFIER_nondet_int() ; - int __cil_tmp66 = __VERIFIER_nondet_int() ; - int __cil_tmp67 ; - int __cil_tmp68 ; - int __cil_tmp69 = __VERIFIER_nondet_int() ; - int __cil_tmp70 ; - int __cil_tmp71 ; - int __cil_tmp72 = __VERIFIER_nondet_int() ; - int __cil_tmp73 ; - int __cil_tmp74 ; - int __cil_tmp75 = __VERIFIER_nondet_int() ; - int __cil_tmp76 ; - int __cil_tmp77 ; - int __cil_tmp78 = __VERIFIER_nondet_int() ; - int __cil_tmp79 ; - int __cil_tmp80 ; - int __cil_tmp81 = __VERIFIER_nondet_int() ; - int __cil_tmp82 ; - int __cil_tmp83 ; - int __cil_tmp84 ; - int __cil_tmp85 ; - int __cil_tmp86 ; - int __cil_tmp87 ; - int __cil_tmp88 = __VERIFIER_nondet_int() ; - int __cil_tmp89 ; - int __cil_tmp90 ; - long __cil_tmp91 ; +int FloppyDeviceControl(int DeviceObject, int Irp) { + int disketteExtension__HoldNewRequests = __VERIFIER_nondet_int(); + int disketteExtension__IsRemoved = __VERIFIER_nondet_int(); + int Irp__IoStatus__Information; + int disketteExtension__IsStarted = __VERIFIER_nondet_int(); + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int disketteExtension__TargetObject = __VERIFIER_nondet_int(); + int irpSp__Parameters__DeviceIoControl__OutputBufferLength = + __VERIFIER_nondet_int(); + int sizeof__MOUNTDEV_NAME = __VERIFIER_nondet_int(); + int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int(); + int mountName__NameLength; + int disketteExtension__DeviceName__Length = __VERIFIER_nondet_int(); + int sizeof__USHORT = __VERIFIER_nondet_int(); + int disketteExtension__InterfaceString__Buffer = __VERIFIER_nondet_int(); + int uniqueId__UniqueIdLength; + int disketteExtension__InterfaceString__Length = __VERIFIER_nondet_int(); + int sizeof__MOUNTDEV_UNIQUE_ID = __VERIFIER_nondet_int(); + int irpSp__Parameters__DeviceIoControl__InputBufferLength = + __VERIFIER_nondet_int(); + int sizeof__FORMAT_PARAMETERS = __VERIFIER_nondet_int(); + int irpSp__Parameters__DeviceIoControl__IoControlCode___1 = + __VERIFIER_nondet_int(); + int sizeof__FORMAT_EX_PARAMETERS = __VERIFIER_nondet_int(); + int formatExParameters__FormatGapLength = __VERIFIER_nondet_int(); + int formatExParameters__SectorsPerTrack = __VERIFIER_nondet_int(); + int sizeof__DISK_GEOMETRY = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status___0; + int disketteExtension = __VERIFIER_nondet_int(); + int ntStatus; + int outputBufferLength; + int lowestDriveMediaType = __VERIFIER_nondet_int(); + int highestDriveMediaType = __VERIFIER_nondet_int(); + int formatExParametersSize = __VERIFIER_nondet_int(); + int formatExParameters; + int tmp; + int mountName; + int uniqueId; + int tmp___0; + int __cil_tmp39; + int __cil_tmp40; + int __cil_tmp41 = __VERIFIER_nondet_int(); + int __cil_tmp42; + int __cil_tmp43; + int __cil_tmp44 = __VERIFIER_nondet_int(); + int __cil_tmp45 = __VERIFIER_nondet_int(); + int __cil_tmp46; + int __cil_tmp47; + int __cil_tmp48; + int __cil_tmp49; + int __cil_tmp50 = __VERIFIER_nondet_int(); + int __cil_tmp51; + int __cil_tmp52; + int __cil_tmp53; + int __cil_tmp54; + int __cil_tmp55 = __VERIFIER_nondet_int(); + int __cil_tmp56; + int __cil_tmp57; + int __cil_tmp58; + int __cil_tmp59; + int __cil_tmp60 = __VERIFIER_nondet_int(); + int __cil_tmp61; + int __cil_tmp62; + int __cil_tmp63; + int __cil_tmp64; + int __cil_tmp65 = __VERIFIER_nondet_int(); + int __cil_tmp66 = __VERIFIER_nondet_int(); + int __cil_tmp67; + int __cil_tmp68; + int __cil_tmp69 = __VERIFIER_nondet_int(); + int __cil_tmp70; + int __cil_tmp71; + int __cil_tmp72 = __VERIFIER_nondet_int(); + int __cil_tmp73; + int __cil_tmp74; + int __cil_tmp75 = __VERIFIER_nondet_int(); + int __cil_tmp76; + int __cil_tmp77; + int __cil_tmp78 = __VERIFIER_nondet_int(); + int __cil_tmp79; + int __cil_tmp80; + int __cil_tmp81 = __VERIFIER_nondet_int(); + int __cil_tmp82; + int __cil_tmp83; + int __cil_tmp84; + int __cil_tmp85; + int __cil_tmp86; + int __cil_tmp87; + int __cil_tmp88 = __VERIFIER_nondet_int(); + int __cil_tmp89; + int __cil_tmp90; + long __cil_tmp91; { #line 1234 - if (disketteExtension__HoldNewRequests) { - { + if (disketteExtension__HoldNewRequests) { + { #line 1235 - //__cil_tmp39 = 3 << 14; +//__cil_tmp39 = 3 << 14; #line 1235 - //__cil_tmp40 = 50 << 16; +//__cil_tmp40 = 50 << 16; #line 1235 - //__cil_tmp41 = __cil_tmp40 | __cil_tmp39; +//__cil_tmp41 = __cil_tmp40 | __cil_tmp39; #line 1235 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 != __cil_tmp41) { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 != + __cil_tmp41) { + { #line 1237 - ntStatus = FloppyQueueRequest(disketteExtension, Irp); - } + ntStatus = FloppyQueueRequest(disketteExtension, Irp); + } #line 1239 - return (ntStatus); - } + return (ntStatus); + } + } } - } #line 1246 - if (disketteExtension__IsRemoved) { - { + if (disketteExtension__IsRemoved) { + { #line 1248 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 1249 - Irp__IoStatus__Status___0 = -1073741738; + Irp__IoStatus__Status___0 = -1073741738; #line 1250 - myStatus = -1073741738; + myStatus = -1073741738; #line 1251 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 1253 - return (-1073741738); - } + return (-1073741738); + } #line 1257 - if (! disketteExtension__IsStarted) { + if (!disketteExtension__IsStarted) { #line 1258 - if (s == NP) { + if (s == NP) { #line 1259 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 1262 - errorFn(); + errorFn(); + } } - } - { + { #line 1266 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 1267 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 1268 - tmp = IofCallDriver(disketteExtension__TargetObject, Irp); - } + tmp = IofCallDriver(disketteExtension__TargetObject, Irp); + } #line 1270 - return (tmp); - } - { + return (tmp); + } + { #line 1274 - //__cil_tmp42 = 2 << 2; +//__cil_tmp42 = 2 << 2; #line 1274 - //__cil_tmp43 = 77 << 16; +//__cil_tmp43 = 77 << 16; #line 1274 - //__cil_tmp44 = __cil_tmp43 | __cil_tmp42; +//__cil_tmp44 = __cil_tmp43 | __cil_tmp42; #line 1274 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp44) { - goto switch_13_exp_0; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp44) { + goto switch_13_exp_0; + } else { + { #line 1277 - //__cil_tmp45 = 77 << 16; +//__cil_tmp45 = 77 << 16; #line 1277 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp45) { - goto switch_13_exp_1; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp45) { + goto switch_13_exp_1; + } else { + { #line 1280 - //__cil_tmp46 = 6 << 2; +//__cil_tmp46 = 6 << 2; #line 1280 - //__cil_tmp47 = 3 << 14; +//__cil_tmp47 = 3 << 14; #line 1280 - //__cil_tmp48 = 7 << 16; +//__cil_tmp48 = 7 << 16; #line 1280 - //__cil_tmp49 = __cil_tmp48 | __cil_tmp47; +//__cil_tmp49 = __cil_tmp48 | __cil_tmp47; #line 1280 - //__cil_tmp50 = __cil_tmp49 | __cil_tmp46; +//__cil_tmp50 = __cil_tmp49 | __cil_tmp46; #line 1280 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp50) { - goto switch_13_exp_2; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp50) { + goto switch_13_exp_2; + } else { + { #line 1283 - // __cil_tmp51 = 11 << 2; +// __cil_tmp51 = 11 << 2; #line 1283 - //__cil_tmp52 = 3 << 14; +//__cil_tmp52 = 3 << 14; #line 1283 - //__cil_tmp53 = 7 << 16; +//__cil_tmp53 = 7 << 16; #line 1283 - // __cil_tmp54 = __cil_tmp53 | __cil_tmp52; +// __cil_tmp54 = __cil_tmp53 | __cil_tmp52; #line 1283 - //__cil_tmp55 = __cil_tmp54 | __cil_tmp51; +//__cil_tmp55 = __cil_tmp54 | __cil_tmp51; #line 1283 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp55) { - goto switch_13_exp_3; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp55) { + goto switch_13_exp_3; + } else { + { #line 1286 - // __cil_tmp56 = 512 << 2; +// __cil_tmp56 = 512 << 2; #line 1286 - // __cil_tmp57 = 1 << 14; +// __cil_tmp57 = 1 << 14; #line 1286 - // __cil_tmp58 = 7 << 16; +// __cil_tmp58 = 7 << 16; #line 1286 - //__cil_tmp59 = __cil_tmp58 | __cil_tmp57; +//__cil_tmp59 = __cil_tmp58 | __cil_tmp57; #line 1286 - // __cil_tmp60 = __cil_tmp59 | __cil_tmp56; +// __cil_tmp60 = __cil_tmp59 | __cil_tmp56; #line 1286 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp60) { - goto switch_13_exp_4; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp60) { + goto switch_13_exp_4; + } else { + { #line 1289 - //__cil_tmp61 = 512 << 2; +//__cil_tmp61 = 512 << 2; #line 1289 - //__cil_tmp62 = 1 << 14; +//__cil_tmp62 = 1 << 14; #line 1289 - // __cil_tmp63 = 45 << 16; +// __cil_tmp63 = 45 << 16; #line 1289 - //__cil_tmp64 = __cil_tmp63 | __cil_tmp62; +//__cil_tmp64 = __cil_tmp63 | __cil_tmp62; #line 1289 - //__cil_tmp65 = __cil_tmp64 | __cil_tmp61; +//__cil_tmp65 = __cil_tmp64 | __cil_tmp61; #line 1289 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp65) { - goto switch_13_exp_5; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp65) { + goto switch_13_exp_5; + } else { + { #line 1292 - //__cil_tmp66 = 7 << 16; +//__cil_tmp66 = 7 << 16; #line 1292 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp66) { - goto switch_13_exp_6; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp66) { + goto switch_13_exp_6; + } else { + { #line 1295 - //__cil_tmp67 = 9 << 2; +//__cil_tmp67 = 9 << 2; #line 1295 - //__cil_tmp68 = 7 << 16; +//__cil_tmp68 = 7 << 16; #line 1295 - //__cil_tmp69 = __cil_tmp68 | __cil_tmp67; +//__cil_tmp69 = __cil_tmp68 | __cil_tmp67; #line 1295 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp69) { - goto switch_13_exp_7; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp69) { + goto switch_13_exp_7; + } else { + { #line 1298 - //__cil_tmp70 = 768 << 2; +//__cil_tmp70 = 768 << 2; #line 1298 - //__cil_tmp71 = 7 << 16; +//__cil_tmp71 = 7 << 16; #line 1298 - //__cil_tmp72 = __cil_tmp71 | __cil_tmp70; +//__cil_tmp72 = __cil_tmp71 | __cil_tmp70; #line 1298 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp72) { - goto switch_13_exp_8; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp72) { + goto switch_13_exp_8; + } else { + { #line 1301 - //__cil_tmp73 = 768 << 2; +//__cil_tmp73 = 768 << 2; #line 1301 - // __cil_tmp74 = 45 << 16; +// __cil_tmp74 = 45 << 16; #line 1301 - //__cil_tmp75 = __cil_tmp74 | __cil_tmp73; +//__cil_tmp75 = __cil_tmp74 | __cil_tmp73; #line 1301 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp75) { - goto switch_13_exp_9; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp75) { + goto switch_13_exp_9; + } else { + { #line 1304 - //__cil_tmp76 = 3 << 2; +//__cil_tmp76 = 3 << 2; #line 1304 - //__cil_tmp77 = 77 << 16; +//__cil_tmp77 = 77 << 16; #line 1304 - //__cil_tmp78 = __cil_tmp77 | __cil_tmp76; +//__cil_tmp78 = __cil_tmp77 | __cil_tmp76; #line 1304 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp78) { - goto switch_13_exp_10; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp78) { + goto switch_13_exp_10; + } else { + { #line 1307 - //__cil_tmp79 = 248 << 2; +//__cil_tmp79 = 248 << 2; #line 1307 - //__cil_tmp80 = 7 << 16; +//__cil_tmp80 = 7 << 16; #line 1307 - //__cil_tmp81 = __cil_tmp80 | __cil_tmp79; +//__cil_tmp81 = __cil_tmp80 | __cil_tmp79; #line 1307 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp81) { - goto switch_13_exp_11; - } else { - goto switch_13_default; + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp81) { + goto switch_13_exp_11; + } else { + goto switch_13_default; #line 1312 - if (0) { - switch_13_exp_0: ; + if (0) { + switch_13_exp_0:; #line 1314 - if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < sizeof__MOUNTDEV_NAME) { + if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < + sizeof__MOUNTDEV_NAME) { #line 1315 - ntStatus = -1073741811; - goto switch_13_break; - } + ntStatus = -1073741811; + goto switch_13_break; + } #line 1320 - mountName = Irp__AssociatedIrp__SystemBuffer; + mountName = + Irp__AssociatedIrp__SystemBuffer; #line 1321 - mountName__NameLength = disketteExtension__DeviceName__Length; - { + mountName__NameLength = + disketteExtension__DeviceName__Length; + { #line 1322 - __cil_tmp82 = sizeof__USHORT + mountName__NameLength; + __cil_tmp82 = + sizeof__USHORT + + mountName__NameLength; #line 1322 - if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < __cil_tmp82) { + if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < + __cil_tmp82) { #line 1323 - ntStatus = -2147483643; + ntStatus = + -2147483643; #line 1324 - Irp__IoStatus__Information = sizeof__MOUNTDEV_NAME; - goto switch_13_break; - } - } + Irp__IoStatus__Information = + sizeof__MOUNTDEV_NAME; + goto switch_13_break; + } + } #line 1329 - ntStatus = 0; + ntStatus = 0; #line 1330 - Irp__IoStatus__Information = sizeof__USHORT + mountName__NameLength; - goto switch_13_break; - switch_13_exp_1: ; + Irp__IoStatus__Information = + sizeof__USHORT + + mountName__NameLength; + goto switch_13_break; + switch_13_exp_1:; #line 1333 - if (! disketteExtension__InterfaceString__Buffer) { + if (!disketteExtension__InterfaceString__Buffer) { #line 1334 - ntStatus = -1073741811; - goto switch_13_break; - } else { + ntStatus = -1073741811; + goto switch_13_break; + } else { #line 1337 - if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < sizeof__MOUNTDEV_UNIQUE_ID) { + if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < + sizeof__MOUNTDEV_UNIQUE_ID) { #line 1338 - ntStatus = -1073741811; - goto switch_13_break; - } - } + ntStatus = + -1073741811; + goto switch_13_break; + } + } #line 1344 - uniqueId = Irp__AssociatedIrp__SystemBuffer; + uniqueId = + Irp__AssociatedIrp__SystemBuffer; #line 1345 - uniqueId__UniqueIdLength = disketteExtension__InterfaceString__Length; - { + uniqueId__UniqueIdLength = + disketteExtension__InterfaceString__Length; + { #line 1346 - __cil_tmp83 = sizeof__USHORT + uniqueId__UniqueIdLength; + __cil_tmp83 = + sizeof__USHORT + + uniqueId__UniqueIdLength; #line 1346 - if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < __cil_tmp83) { + if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < + __cil_tmp83) { #line 1347 - ntStatus = -2147483643; + ntStatus = + -2147483643; #line 1348 - Irp__IoStatus__Information = sizeof__MOUNTDEV_UNIQUE_ID; - goto switch_13_break; - } - } + Irp__IoStatus__Information = + sizeof__MOUNTDEV_UNIQUE_ID; + goto switch_13_break; + } + } #line 1353 - ntStatus = 0; + ntStatus = 0; #line 1354 - Irp__IoStatus__Information = sizeof__USHORT + uniqueId__UniqueIdLength; - goto switch_13_break; - switch_13_exp_2: ; - switch_13_exp_3: ; + Irp__IoStatus__Information = + sizeof__USHORT + + uniqueId__UniqueIdLength; + goto switch_13_break; + switch_13_exp_2:; + switch_13_exp_3:; #line 1358 - if (irpSp__Parameters__DeviceIoControl__InputBufferLength < sizeof__FORMAT_PARAMETERS) { + if (irpSp__Parameters__DeviceIoControl__InputBufferLength < + sizeof__FORMAT_PARAMETERS) { #line 1359 - ntStatus = -1073741811; - goto switch_13_break; - } - { + ntStatus = -1073741811; + goto switch_13_break; + } + { #line 1365 - tmp___0 = FlCheckFormatParameters(disketteExtension, Irp__AssociatedIrp__SystemBuffer); - } + tmp___0 = FlCheckFormatParameters( + disketteExtension, + Irp__AssociatedIrp__SystemBuffer); + } #line 1367 - if (! tmp___0) { + if (!tmp___0) { #line 1370 - ntStatus = -1073741811; - goto switch_13_break; - } - { + ntStatus = -1073741811; + goto switch_13_break; + } + { #line 1373 - //__cil_tmp84 = 11 << 2; +//__cil_tmp84 = 11 << 2; #line 1373 - //__cil_tmp85 = 3 << 14; +//__cil_tmp85 = 3 << 14; #line 1373 - //__cil_tmp86 = 7 << 16; +//__cil_tmp86 = 7 << 16; #line 1373 - //__cil_tmp87 = __cil_tmp86 | __cil_tmp85; +//__cil_tmp87 = __cil_tmp86 | __cil_tmp85; #line 1373 - //__cil_tmp88 = __cil_tmp87 | __cil_tmp84; +//__cil_tmp88 = __cil_tmp87 | __cil_tmp84; #line 1373 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp88) { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp88) { #line 1374 - if (irpSp__Parameters__DeviceIoControl__InputBufferLength < sizeof__FORMAT_EX_PARAMETERS) { + if (irpSp__Parameters__DeviceIoControl__InputBufferLength < + sizeof__FORMAT_EX_PARAMETERS) { #line 1375 - ntStatus = -1073741811; - goto switch_13_break; - } + ntStatus = + -1073741811; + goto switch_13_break; + } #line 1380 - formatExParameters = Irp__AssociatedIrp__SystemBuffer; + formatExParameters = + Irp__AssociatedIrp__SystemBuffer; #line 1381 - if (irpSp__Parameters__DeviceIoControl__InputBufferLength < formatExParametersSize) { + if (irpSp__Parameters__DeviceIoControl__InputBufferLength < + formatExParametersSize) { #line 1382 - ntStatus = -1073741811; - goto switch_13_break; - } else { + ntStatus = + -1073741811; + goto switch_13_break; + } else { #line 1385 - if (formatExParameters__FormatGapLength >= 256) { + if (formatExParameters__FormatGapLength >= + 256) { #line 1386 - ntStatus = -1073741811; - goto switch_13_break; - } else { + ntStatus = + -1073741811; + goto switch_13_break; + } else { #line 1389 - if (formatExParameters__SectorsPerTrack >= 256) { + if (formatExParameters__SectorsPerTrack >= + 256) { #line 1390 - ntStatus = -1073741811; - goto switch_13_break; - } - } - } - } - } - switch_13_exp_4: ; - switch_13_exp_5: ; - switch_13_exp_6: ; - switch_13_exp_7: - { + ntStatus = + -1073741811; + goto switch_13_break; + } + } + } + } + } + switch_13_exp_4:; + switch_13_exp_5:; + switch_13_exp_6:; + switch_13_exp_7 : { #line 1405 - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - goto switch_13_break; - switch_13_exp_8: ; - switch_13_exp_9: + ntStatus = + FlQueueIrpToThread( + Irp, + disketteExtension); + } + goto switch_13_break; + switch_13_exp_8:; + switch_13_exp_9: #line 1410 - outputBufferLength = irpSp__Parameters__DeviceIoControl__OutputBufferLength; + outputBufferLength = + irpSp__Parameters__DeviceIoControl__OutputBufferLength; #line 1411 - if (outputBufferLength < sizeof__DISK_GEOMETRY) { + if (outputBufferLength < + sizeof__DISK_GEOMETRY) { #line 1412 - ntStatus = -1073741789; - goto switch_13_break; - } + ntStatus = -1073741789; + goto switch_13_break; + } #line 1417 - ntStatus = 0; - { + ntStatus = 0; + { #line 1418 - __cil_tmp89 = highestDriveMediaType - lowestDriveMediaType; + __cil_tmp89 = + highestDriveMediaType - + lowestDriveMediaType; #line 1418 - __cil_tmp90 = __cil_tmp89 + 1; + __cil_tmp90 = + __cil_tmp89 + 1; #line 1418 - if (outputBufferLength < __cil_tmp90) { + if (outputBufferLength < + __cil_tmp90) { #line 1419 - ntStatus = -2147483643; - } - } - goto switch_13_break; - switch_13_exp_10: ; - switch_13_exp_11: ; - switch_13_default: ; + ntStatus = + -2147483643; + } + } + goto switch_13_break; + switch_13_exp_10:; + switch_13_exp_11:; + switch_13_default:; #line 1427 - if (s == NP) { + if (s == NP) { #line 1428 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 1431 - errorFn(); - } - } - { + errorFn(); + } + } + { #line 1435 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 1436 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 1437 - ntStatus = IofCallDriver(disketteExtension__TargetObject, - Irp); - } + ntStatus = IofCallDriver( + disketteExtension__TargetObject, + Irp); + } #line 1440 - return (ntStatus); - } else { - switch_13_break: ; + return (ntStatus); + } else { + switch_13_break:; + } + } + } + } + } + } + } + } + } + } + } + } + } } } - } } - } - } } } - } - } } } - } - } } } - } - } } } - } - } } - } - } - { + { #line 1457 - __cil_tmp91 = (long )ntStatus; + __cil_tmp91 = (long)ntStatus; #line 1457 - if (__cil_tmp91 != 259L) { - { + if (__cil_tmp91 != 259L) { + { #line 1459 - Irp__IoStatus__Status___0 = ntStatus; + Irp__IoStatus__Status___0 = ntStatus; #line 1460 - myStatus = ntStatus; + myStatus = ntStatus; #line 1461 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); + } + } } - } - } #line 1466 - return (ntStatus); -} + return (ntStatus); + } } #line 1469 "floppy_simpl4.cil.c" -int FlCheckFormatParameters(int DisketteExtension , int FormatParameters ) -{ int DriveMediaConstants__driveMediaType__MediaType = __VERIFIER_nondet_int() ; - int FormatParameters__MediaType = __VERIFIER_nondet_int() ; - int FAKE_CONDITION = __VERIFIER_nondet_int() ; +int FlCheckFormatParameters(int DisketteExtension, int FormatParameters) { + int DriveMediaConstants__driveMediaType__MediaType = __VERIFIER_nondet_int(); + int FormatParameters__MediaType = __VERIFIER_nondet_int(); + int FAKE_CONDITION = __VERIFIER_nondet_int(); { #line 1475 - if (DriveMediaConstants__driveMediaType__MediaType != FormatParameters__MediaType) { + if (DriveMediaConstants__driveMediaType__MediaType != + FormatParameters__MediaType) { #line 1476 - return (0); - } else { -#line 1478 - if (FAKE_CONDITION) { -#line 1479 return (0); } else { +#line 1478 + if (FAKE_CONDITION) { +#line 1479 + return (0); + } else { #line 1481 - return (1); + return (1); + } } } } -} #line 1486 "floppy_simpl4.cil.c" -int FloppyQueueRequest(int DisketteExtension , int Irp ) -{ int Irp__IoStatus__Status ; - int Irp__IoStatus__Information ; - int Irp__Tail__Overlay__CurrentStackLocation__Control ; - int ntStatus ; - int FAKE_CONDITION = __VERIFIER_nondet_int() ; +int FloppyQueueRequest(int DisketteExtension, int Irp) { + int Irp__IoStatus__Status; + int Irp__IoStatus__Information; + int Irp__Tail__Overlay__CurrentStackLocation__Control; + int ntStatus; + int FAKE_CONDITION = __VERIFIER_nondet_int(); { #line 1494 - PagingReferenceCount ++; + PagingReferenceCount++; #line 1495 - if (PagingReferenceCount == 1) { - - } + if (PagingReferenceCount == 1) { + } #line 1500 - if (FAKE_CONDITION) { - { + if (FAKE_CONDITION) { + { #line 1502 - Irp__IoStatus__Status = -1073741536; + Irp__IoStatus__Status = -1073741536; #line 1503 - myStatus = -1073741536; + myStatus = -1073741536; #line 1504 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 1505 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); #line 1506 - PagingReferenceCount --; - } + PagingReferenceCount--; + } #line 1508 - if (PagingReferenceCount == 0) { - - } + if (PagingReferenceCount == 0) { + } #line 1513 - ntStatus = -1073741536; - } else { + ntStatus = -1073741536; + } else { #line 1515 - Irp__IoStatus__Status = 259; + Irp__IoStatus__Status = 259; #line 1516 - myStatus = 259; + myStatus = 259; #line 1517 - //Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; +// Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; #line 1518 - if (pended == 0) { + if (pended == 0) { #line 1519 - pended = 1; - } else { - { + pended = 1; + } else { + { #line 1522 - errorFn(); + errorFn(); + } } - } #line 1525 - ntStatus = 259; - } + ntStatus = 259; + } #line 1527 - return (ntStatus); -} + return (ntStatus); + } } -void errorFn(void) -{ +void errorFn(void) { { - goto ERROR; - ERROR: assert(0); + goto ERROR; + ERROR: + assert(0); #line 53 - return; -} + return; + } } diff --git a/test/ntdrivers-simplified/floppy_simpl4_true.cil.c b/test/ntdrivers-simplified/floppy_simpl4_true.cil.c index 463ccf99a..2f806998a 100644 --- a/test/ntdrivers-simplified/floppy_simpl4_true.cil.c +++ b/test/ntdrivers-simplified/floppy_simpl4_true.cil.c @@ -6,547 +6,548 @@ extern char __VERIFIER_nondet_char(void); extern int __VERIFIER_nondet_int(void); extern long __VERIFIER_nondet_long(void); extern void *__VERIFIER_nondet_pointer(void); -void errorFn(void) ; -void IofCompleteRequest(int Irp , int PriorityBoost ); +void errorFn(void); +void IofCompleteRequest(int Irp, int PriorityBoost); extern int __VERIFIER_nondet_int(); -int FloppyThread ; -int KernelMode ; -int Suspended ; -int Executive ; -int DiskController ; -int FloppyDiskPeripheral ; -int FlConfigCallBack ; -int MaximumInterfaceType ; -int MOUNTDEV_MOUNTED_DEVICE_GUID ; -int myStatus ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; +int FloppyThread; +int KernelMode; +int Suspended; +int Executive; +int DiskController; +int FloppyDiskPeripheral; +int FlConfigCallBack; +int MaximumInterfaceType; +int MOUNTDEV_MOUNTED_DEVICE_GUID; +int myStatus; +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; -void _BLAST_init(void) -{ +void _BLAST_init(void) { { #line 75 - UNLOADED = 0; + UNLOADED = 0; #line 76 - NP = 1; + NP = 1; #line 77 - DC = 2; + DC = 2; #line 78 - SKIP1 = 3; + SKIP1 = 3; #line 79 - SKIP2 = 4; + SKIP2 = 4; #line 80 - MPR1 = 5; + MPR1 = 5; #line 81 - MPR3 = 6; + MPR3 = 6; #line 82 - IPC = 7; + IPC = 7; #line 83 - s = UNLOADED; + s = UNLOADED; #line 84 - pended = 0; + pended = 0; #line 85 - compRegistered = 0; + compRegistered = 0; #line 86 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 87 - setEventCalled = 0; + setEventCalled = 0; #line 88 - customIrp = 0; + customIrp = 0; #line 89 - return; -} + return; + } } #line 92 "floppy_simpl4.cil.c" -int PagingReferenceCount = 0; +int PagingReferenceCount = 0; #line 93 "floppy_simpl4.cil.c" -int PagingMutex = 0; +int PagingMutex = 0; #line 94 "floppy_simpl4.cil.c" -int FlAcpiConfigureFloppy(int DisketteExtension , int FdcInfo ) -{ +int FlAcpiConfigureFloppy(int DisketteExtension, int FdcInfo) { { #line 98 - return (0); -} + return (0); + } } #line 101 "floppy_simpl4.cil.c" -int FlQueueIrpToThread(int Irp , int DisketteExtension ) -{ int status ; - int threadHandle = __VERIFIER_nondet_int() ; - int DisketteExtension__PoweringDown = __VERIFIER_nondet_int() ; - int DisketteExtension__ThreadReferenceCount = __VERIFIER_nondet_int() ; - int DisketteExtension__FloppyThread = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int Irp__IoStatus__Information ; - int Irp__Tail__Overlay__CurrentStackLocation__Control ; - int ObjAttributes = __VERIFIER_nondet_int() ; - int __cil_tmp12 ; - int __cil_tmp13 ; +int FlQueueIrpToThread(int Irp, int DisketteExtension) { + int status; + int threadHandle = __VERIFIER_nondet_int(); + int DisketteExtension__PoweringDown = __VERIFIER_nondet_int(); + int DisketteExtension__ThreadReferenceCount = __VERIFIER_nondet_int(); + int DisketteExtension__FloppyThread = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int Irp__IoStatus__Information; + int Irp__Tail__Overlay__CurrentStackLocation__Control; + int ObjAttributes = __VERIFIER_nondet_int(); + int __cil_tmp12; + int __cil_tmp13; { #line 113 - if (DisketteExtension__PoweringDown == 1) { + if (DisketteExtension__PoweringDown == 1) { #line 114 - myStatus = -1073741101; + myStatus = -1073741101; #line 115 - Irp__IoStatus__Status = -1073741101; + Irp__IoStatus__Status = -1073741101; #line 116 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 117 - return (-1073741101); - } + return (-1073741101); + } #line 121 - DisketteExtension__ThreadReferenceCount ++; + DisketteExtension__ThreadReferenceCount++; #line 122 - if (DisketteExtension__ThreadReferenceCount == 0) { + if (DisketteExtension__ThreadReferenceCount == 0) { #line 123 - DisketteExtension__ThreadReferenceCount ++; + DisketteExtension__ThreadReferenceCount++; #line 124 - PagingReferenceCount ++; + PagingReferenceCount++; #line 125 - if (PagingReferenceCount == 1) { - - } - { + if (PagingReferenceCount == 1) { + } + { #line 131 - status = PsCreateSystemThread(threadHandle, 0, ObjAttributes, 0, 0, FloppyThread, - DisketteExtension); - } - { + status = PsCreateSystemThread(threadHandle, 0, ObjAttributes, 0, 0, + FloppyThread, DisketteExtension); + } + { #line 134 #line 134 - if (status < 0) { + if (status < 0) { #line 135 - DisketteExtension__ThreadReferenceCount = -1; + DisketteExtension__ThreadReferenceCount = -1; #line 136 - PagingReferenceCount --; + PagingReferenceCount--; #line 137 - if (PagingReferenceCount == 0) { - - } + if (PagingReferenceCount == 0) { + } #line 142 - return (status); - } - } - { + return (status); + } + } + { #line 147 - status = ObReferenceObjectByHandle(threadHandle, 1048576, 0, KernelMode, DisketteExtension__FloppyThread, - 0); + status = ObReferenceObjectByHandle(threadHandle, 1048576, 0, KernelMode, + DisketteExtension__FloppyThread, 0); #line 149 - ZwClose(threadHandle); - } - { + ZwClose(threadHandle); + } + { #line 151 #line 151 - if (status < 0) { + if (status < 0) { #line 152 - return (status); - } + return (status); + } + } } - } #line 159 - //Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; +// Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; #line 160 - if (pended == 0) { + if (pended == 0) { #line 161 - pended = 1; - } else { - { + pended = 1; + } else { + { #line 164 - errorFn(); + errorFn(); + } } - } #line 167 - return (259); -} + return (259); + } } #line 170 "floppy_simpl4.cil.c" -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 ; +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 199 - ntStatus = 0; + ntStatus = 0; #line 200 - PagingReferenceCount ++; + PagingReferenceCount++; #line 201 - if (PagingReferenceCount == 1) { - - } + if (PagingReferenceCount == 1) { + } #line 206 - disketteExtension = DeviceObject__DeviceExtension; + disketteExtension = DeviceObject__DeviceExtension; #line 207 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = Irp__Tail__Overlay__CurrentStackLocation; #line 208 - if (disketteExtension__IsRemoved) { - { + if (disketteExtension__IsRemoved) { + { #line 210 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 211 - Irp__IoStatus__Status = -1073741738; + Irp__IoStatus__Status = -1073741738; #line 212 - myStatus = -1073741738; + myStatus = -1073741738; #line 213 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 215 - return (-1073741738); - } + return (-1073741738); + } #line 219 - if (irpSp__MinorFunction == 0) { - goto switch_0_0; - } else { -#line 222 - if (irpSp__MinorFunction == 5) { - goto switch_0_5; + if (irpSp__MinorFunction == 0) { + goto switch_0_0; } else { -#line 225 - if (irpSp__MinorFunction == 1) { +#line 222 + if (irpSp__MinorFunction == 5) { goto switch_0_5; } else { -#line 228 - if (irpSp__MinorFunction == 6) { - goto switch_0_6; +#line 225 + if (irpSp__MinorFunction == 1) { + goto switch_0_5; } else { -#line 231 - if (irpSp__MinorFunction == 3) { +#line 228 + if (irpSp__MinorFunction == 6) { goto switch_0_6; } else { -#line 234 - if (irpSp__MinorFunction == 4) { - goto switch_0_4; +#line 231 + if (irpSp__MinorFunction == 3) { + goto switch_0_6; } else { -#line 237 - if (irpSp__MinorFunction == 2) { - goto switch_0_2; +#line 234 + if (irpSp__MinorFunction == 4) { + goto switch_0_4; } else { - goto switch_0_default; +#line 237 + if (irpSp__MinorFunction == 2) { + goto switch_0_2; + } else { + goto switch_0_default; #line 242 - if (0) { - switch_0_0: - { + if (0) { + switch_0_0 : { #line 245 - ntStatus = FloppyStartDevice(DeviceObject, Irp); + ntStatus = FloppyStartDevice(DeviceObject, Irp); } - goto switch_0_break; - switch_0_5: + goto switch_0_break; + switch_0_5: #line 250 - if (irpSp__MinorFunction == 5) { - - } + if (irpSp__MinorFunction == 5) { + } #line 255 - if (! disketteExtension__IsStarted) { + if (!disketteExtension__IsStarted) { #line 256 - if (s == NP) { + if (s == NP) { #line 257 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 260 - errorFn(); + errorFn(); + } } - } - { + { #line 264 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 265 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 266 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } #line 268 - return (ntStatus); - } - { + return (ntStatus); + } + { #line 273 - disketteExtension__HoldNewRequests = 1; + disketteExtension__HoldNewRequests = 1; #line 274 - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - { + ntStatus = FlQueueIrpToThread(Irp, disketteExtension); + } + { #line 276 - __cil_tmp29 = (long )ntStatus; + __cil_tmp29 = (long)ntStatus; #line 276 - if (__cil_tmp29 == 259L) { - { + if (__cil_tmp29 == 259L) { + { #line 278 - KeWaitForSingleObject(disketteExtension__FloppyThread, Executive, - KernelMode, 0, 0); - } + KeWaitForSingleObject(disketteExtension__FloppyThread, + Executive, KernelMode, 0, 0); + } #line 281 - if (disketteExtension__FloppyThread != 0) { - - } + if (disketteExtension__FloppyThread != 0) { + } #line 286 - disketteExtension__FloppyThread = 0; + disketteExtension__FloppyThread = 0; #line 287 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 288 - myStatus = 0; + myStatus = 0; #line 289 - if (s == NP) { + if (s == NP) { #line 290 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 293 - errorFn(); - } - } - { + errorFn(); + } + } + { #line 297 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 298 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 299 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - } else { - { + ntStatus = IofCallDriver( + disketteExtension__TargetObject, Irp); + } + } else { + { #line 303 - ntStatus = -1073741823; + ntStatus = -1073741823; #line 304 - Irp__IoStatus__Status = ntStatus; + Irp__IoStatus__Status = ntStatus; #line 305 - myStatus = ntStatus; + myStatus = ntStatus; #line 306 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 307 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); + } + } } - } - } - goto switch_0_break; - switch_0_6: + goto switch_0_break; + switch_0_6: #line 313 - if (irpSp__MinorFunction == 6) { - - } + if (irpSp__MinorFunction == 6) { + } #line 318 - if (! disketteExtension__IsStarted) { + if (!disketteExtension__IsStarted) { #line 319 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 320 - myStatus = 0; + myStatus = 0; #line 321 - if (s == NP) { + if (s == NP) { #line 322 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 325 - errorFn(); + errorFn(); + } } - } - { + { #line 329 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 330 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 331 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - } else { + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + } else { #line 334 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 335 - myStatus = 0; + myStatus = 0; #line 336 - irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; + irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; #line 337 - nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; + nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 338 - nextIrpSp__Control = 0; + nextIrpSp__Control = 0; #line 339 - if (s != NP) { - { -#line 341 - errorFn(); - } - } else { -#line 344 - if (compRegistered != 0) { + if (s != NP) { { -#line 346 - errorFn(); +#line 341 + errorFn(); } } else { +#line 344 + if (compRegistered != 0) { + { +#line 346 + errorFn(); + } + } else { #line 349 - compRegistered = 1; + compRegistered = 1; + } } - } - { + { #line 353 - irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1; + irpSp___1 = + Irp__Tail__Overlay__CurrentStackLocation - 1; #line 354 - irpSp__Context = doneEvent; + irpSp__Context = doneEvent; #line 355 - irpSp__Control = 224; + irpSp__Control = 224; #line 359 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - { + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + { #line 361 - __cil_tmp30 = (long )ntStatus; + __cil_tmp30 = (long)ntStatus; #line 361 - if (__cil_tmp30 == 259L) { - { + if (__cil_tmp30 == 259L) { + { #line 363 - KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0); + KeWaitForSingleObject(doneEvent, Executive, + KernelMode, 0, 0); #line 364 - ntStatus = myStatus; + ntStatus = myStatus; + } + } } - } - } - { + { #line 370 - disketteExtension__HoldNewRequests = 0; + disketteExtension__HoldNewRequests = 0; #line 371 - Irp__IoStatus__Status = ntStatus; + Irp__IoStatus__Status = ntStatus; #line 372 - myStatus = ntStatus; + myStatus = ntStatus; #line 373 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 374 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); + } } - } - goto switch_0_break; - switch_0_4: + goto switch_0_break; + switch_0_4: #line 379 - disketteExtension__IsStarted = 0; + disketteExtension__IsStarted = 0; #line 380 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 381 - myStatus = 0; + myStatus = 0; #line 382 - if (s == NP) { + if (s == NP) { #line 383 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 386 - errorFn(); + errorFn(); + } } - } - { + { #line 390 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 391 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 392 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - goto switch_0_break; - switch_0_2: + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + goto switch_0_break; + switch_0_2: #line 396 - disketteExtension__HoldNewRequests = 0; + disketteExtension__HoldNewRequests = 0; #line 397 - disketteExtension__IsStarted = 0; + disketteExtension__IsStarted = 0; #line 398 - disketteExtension__IsRemoved = 1; + disketteExtension__IsRemoved = 1; #line 399 - if (s == NP) { + if (s == NP) { #line 400 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 403 - errorFn(); + errorFn(); + } } - } - { + { #line 407 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 408 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 409 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 410 - myStatus = 0; + myStatus = 0; #line 411 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } #line 413 - if (disketteExtension__InterfaceString__Buffer != 0) { - { + if (disketteExtension__InterfaceString__Buffer != 0) { + { #line 415 - IoSetDeviceInterfaceState(disketteExtension__InterfaceString, - 0); + IoSetDeviceInterfaceState( + disketteExtension__InterfaceString, 0); + } } - } #line 421 - if (disketteExtension__ArcName__Length != 0) { - { + if (disketteExtension__ArcName__Length != 0) { + { #line 423 - IoDeleteSymbolicLink(disketteExtension__ArcName); + IoDeleteSymbolicLink(disketteExtension__ArcName); + } } - } #line 428 - IoGetConfigurationInformation__FloppyCount --; - goto switch_0_break; - switch_0_default: ; + IoGetConfigurationInformation__FloppyCount--; + goto switch_0_break; + switch_0_default:; #line 431 - if (s == NP) { + if (s == NP) { #line 432 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 435 - errorFn(); + errorFn(); + } } - } - { + { #line 439 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 440 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 441 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); + ntStatus = + IofCallDriver(disketteExtension__TargetObject, Irp); + } + } else { + switch_0_break:; } - } else { - switch_0_break: ; } } } @@ -554,547 +555,545 @@ int FloppyPnp(int DeviceObject , int Irp ) } } } - } #line 454 - PagingReferenceCount --; + PagingReferenceCount--; #line 455 - if (PagingReferenceCount == 0) { - - } + if (PagingReferenceCount == 0) { + } #line 460 - return (ntStatus); -} + return (ntStatus); + } } #line 463 "floppy_simpl4.cil.c" -int FloppyStartDevice(int DeviceObject , int Irp ) -{ int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int disketteExtension__TargetObject = __VERIFIER_nondet_int() ; - int disketteExtension__MaxTransferSize ; - int disketteExtension__DriveType = __VERIFIER_nondet_int() ; - int disketteExtension__PerpendicularMode ; - int disketteExtension__DeviceUnit ; - int disketteExtension__DriveOnValue ; - int disketteExtension__UnderlyingPDO = __VERIFIER_nondet_int() ; - int disketteExtension__InterfaceString = __VERIFIER_nondet_int() ; - int disketteExtension__IsStarted ; - int disketteExtension__HoldNewRequests ; - int ntStatus ; - int pnpStatus ; - int doneEvent = __VERIFIER_nondet_int() ; - int fdcInfo = __VERIFIER_nondet_int() ; - int fdcInfo__BufferCount ; - int fdcInfo__BufferSize ; - int fdcInfo__MaxTransferSize = __VERIFIER_nondet_int() ; - int fdcInfo__AcpiBios = __VERIFIER_nondet_int() ; - int fdcInfo__AcpiFdiSupported = __VERIFIER_nondet_int() ; - int fdcInfo__PeripheralNumber = __VERIFIER_nondet_int() ; - int fdcInfo__BusType ; - int fdcInfo__ControllerNumber = __VERIFIER_nondet_int() ; - int fdcInfo__UnitNumber = __VERIFIER_nondet_int() ; - int fdcInfo__BusNumber = __VERIFIER_nondet_int() ; - int Dc ; - int Fp ; - int disketteExtension ; - int irpSp ; - int irpSp___0 ; - int nextIrpSp ; - int nextIrpSp__Control ; - int irpSp___1 ; - int irpSp__Control ; - int irpSp__Context ; - int InterfaceType ; - int KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 = __VERIFIER_nondet_int() ; - long __cil_tmp42 ; - int __cil_tmp43 ; - int __cil_tmp44 ; - int __cil_tmp45 ; - int __cil_tmp46 = __VERIFIER_nondet_int() ; - int __cil_tmp47 ; - int __cil_tmp48 ; - int __cil_tmp49 ; +int FloppyStartDevice(int DeviceObject, int Irp) { + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int disketteExtension__TargetObject = __VERIFIER_nondet_int(); + int disketteExtension__MaxTransferSize; + int disketteExtension__DriveType = __VERIFIER_nondet_int(); + int disketteExtension__PerpendicularMode; + int disketteExtension__DeviceUnit; + int disketteExtension__DriveOnValue; + int disketteExtension__UnderlyingPDO = __VERIFIER_nondet_int(); + int disketteExtension__InterfaceString = __VERIFIER_nondet_int(); + int disketteExtension__IsStarted; + int disketteExtension__HoldNewRequests; + int ntStatus; + int pnpStatus; + int doneEvent = __VERIFIER_nondet_int(); + int fdcInfo = __VERIFIER_nondet_int(); + int fdcInfo__BufferCount; + int fdcInfo__BufferSize; + int fdcInfo__MaxTransferSize = __VERIFIER_nondet_int(); + int fdcInfo__AcpiBios = __VERIFIER_nondet_int(); + int fdcInfo__AcpiFdiSupported = __VERIFIER_nondet_int(); + int fdcInfo__PeripheralNumber = __VERIFIER_nondet_int(); + int fdcInfo__BusType; + int fdcInfo__ControllerNumber = __VERIFIER_nondet_int(); + int fdcInfo__UnitNumber = __VERIFIER_nondet_int(); + int fdcInfo__BusNumber = __VERIFIER_nondet_int(); + int Dc; + int Fp; + int disketteExtension; + int irpSp; + int irpSp___0; + int nextIrpSp; + int nextIrpSp__Control; + int irpSp___1; + int irpSp__Control; + int irpSp__Context; + int InterfaceType; + int KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 = + __VERIFIER_nondet_int(); + long __cil_tmp42; + int __cil_tmp43; + int __cil_tmp44; + int __cil_tmp45; + int __cil_tmp46 = __VERIFIER_nondet_int(); + int __cil_tmp47; + int __cil_tmp48; + int __cil_tmp49; { #line 505 - Dc = DiskController; + Dc = DiskController; #line 506 - Fp = FloppyDiskPeripheral; + Fp = FloppyDiskPeripheral; #line 507 - disketteExtension = DeviceObject__DeviceExtension; + disketteExtension = DeviceObject__DeviceExtension; #line 508 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = Irp__Tail__Overlay__CurrentStackLocation; #line 509 - irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; + irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation; #line 510 - nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; + nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 511 - nextIrpSp__Control = 0; + nextIrpSp__Control = 0; #line 512 - if (s != NP) { - { -#line 514 - errorFn(); - } - } else { -#line 517 - if (compRegistered != 0) { + if (s != NP) { { -#line 519 - errorFn(); +#line 514 + errorFn(); } } else { +#line 517 + if (compRegistered != 0) { + { +#line 519 + errorFn(); + } + } else { #line 522 - compRegistered = 1; + compRegistered = 1; + } } - } - { + { #line 526 - irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1; + irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1; #line 527 - irpSp__Context = doneEvent; + irpSp__Context = doneEvent; #line 528 - irpSp__Control = 224; + irpSp__Control = 224; #line 532 - ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); - } - { + ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp); + } + { #line 534 - __cil_tmp42 = (long )ntStatus; + __cil_tmp42 = (long)ntStatus; #line 534 - if (__cil_tmp42 == 259L) { - { + if (__cil_tmp42 == 259L) { + { #line 536 - ntStatus = KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0); + ntStatus = + KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0); #line 537 - ntStatus = myStatus; + ntStatus = myStatus; + } + } } - } - } - { + { #line 543 - fdcInfo__BufferCount = 0; + fdcInfo__BufferCount = 0; #line 544 - fdcInfo__BufferSize = 0; + fdcInfo__BufferSize = 0; #line 545 - //__cil_tmp43 = 770 << 2; +//__cil_tmp43 = 770 << 2; #line 545 - //__cil_tmp44 = 7 << 16; +//__cil_tmp44 = 7 << 16; #line 545 - //__cil_tmp45 = __cil_tmp44 | __cil_tmp43; +//__cil_tmp45 = __cil_tmp44 | __cil_tmp43; #line 545 - //__cil_tmp46 = __cil_tmp45 | 3; +//__cil_tmp46 = __cil_tmp45 | 3; #line 545 - ntStatus = FlFdcDeviceIo(disketteExtension__TargetObject, __cil_tmp46, fdcInfo); - } + ntStatus = + FlFdcDeviceIo(disketteExtension__TargetObject, __cil_tmp46, fdcInfo); + } #line 548 - if (ntStatus >= 0) { + if (ntStatus >= 0) { #line 549 - disketteExtension__MaxTransferSize = fdcInfo__MaxTransferSize; + disketteExtension__MaxTransferSize = fdcInfo__MaxTransferSize; #line 550 - if (fdcInfo__AcpiBios) { + if (fdcInfo__AcpiBios) { #line 551 - if (fdcInfo__AcpiFdiSupported) { - { + if (fdcInfo__AcpiFdiSupported) { + { #line 553 - ntStatus = FlAcpiConfigureFloppy(disketteExtension, fdcInfo); - } + ntStatus = FlAcpiConfigureFloppy(disketteExtension, fdcInfo); + } #line 555 - if (disketteExtension__DriveType == 4) { + if (disketteExtension__DriveType == 4) { #line 556 - // __cil_tmp47 = 1 << fdcInfo__PeripheralNumber; +// __cil_tmp47 = 1 << fdcInfo__PeripheralNumber; #line 556 - //disketteExtension__PerpendicularMode |= __cil_tmp47; + // disketteExtension__PerpendicularMode |= __cil_tmp47; + } + } else { + goto _L; } } else { - goto _L; - } - } else { - _L: + _L: #line 565 - if (disketteExtension__DriveType == 4) { + if (disketteExtension__DriveType == 4) { #line 566 - // __cil_tmp48 = 1 << fdcInfo__PeripheralNumber; +// __cil_tmp48 = 1 << fdcInfo__PeripheralNumber; #line 566 - //disketteExtension__PerpendicularMode |= __cil_tmp48; - } + // disketteExtension__PerpendicularMode |= __cil_tmp48; + } #line 570 - InterfaceType = 0; - { + InterfaceType = 0; + { #line 572 - while (1) { - while_0_continue: /* CIL Label */ ; + while (1) { + while_0_continue: /* CIL Label */; #line 574 - if (InterfaceType >= MaximumInterfaceType) { - goto while_1_break; - } - { + if (InterfaceType >= MaximumInterfaceType) { + goto while_1_break; + } + { #line 580 - fdcInfo__BusType = InterfaceType; + fdcInfo__BusType = InterfaceType; #line 581 - ntStatus = IoQueryDeviceDescription(fdcInfo__BusType, fdcInfo__BusNumber, - Dc, fdcInfo__ControllerNumber, Fp, fdcInfo__PeripheralNumber, - FlConfigCallBack, disketteExtension); - } + ntStatus = IoQueryDeviceDescription( + fdcInfo__BusType, fdcInfo__BusNumber, Dc, + fdcInfo__ControllerNumber, Fp, fdcInfo__PeripheralNumber, + FlConfigCallBack, disketteExtension); + } #line 585 - if (ntStatus >= 0) { - goto while_1_break; - } + if (ntStatus >= 0) { + goto while_1_break; + } #line 590 - InterfaceType ++; - } - while_0_break: /* CIL Label */ ; + InterfaceType++; + } + while_0_break: /* CIL Label */; + } + while_1_break:; } - while_1_break: ; - } #line 595 - if (ntStatus >= 0) { + if (ntStatus >= 0) { #line 596 - if (KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 != 0) { + if (KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 != 0) { #line 597 - disketteExtension__DeviceUnit = fdcInfo__UnitNumber; + disketteExtension__DeviceUnit = fdcInfo__UnitNumber; #line 598 - disketteExtension__DriveOnValue = fdcInfo__UnitNumber; - } else { + disketteExtension__DriveOnValue = fdcInfo__UnitNumber; + } else { #line 600 - disketteExtension__DeviceUnit = fdcInfo__PeripheralNumber; + disketteExtension__DeviceUnit = fdcInfo__PeripheralNumber; #line 601 - //__cil_tmp49 = 16 << fdcInfo__PeripheralNumber; +//__cil_tmp49 = 16 << fdcInfo__PeripheralNumber; #line 601 - //disketteExtension__DriveOnValue = fdcInfo__PeripheralNumber | __cil_tmp49; - } - { + // disketteExtension__DriveOnValue = fdcInfo__PeripheralNumber | + // __cil_tmp49; + } + { #line 604 - pnpStatus = IoRegisterDeviceInterface(disketteExtension__UnderlyingPDO, MOUNTDEV_MOUNTED_DEVICE_GUID, - 0, disketteExtension__InterfaceString); - } + pnpStatus = IoRegisterDeviceInterface( + disketteExtension__UnderlyingPDO, MOUNTDEV_MOUNTED_DEVICE_GUID, 0, + disketteExtension__InterfaceString); + } #line 607 - if (pnpStatus >= 0) { - { + if (pnpStatus >= 0) { + { #line 609 - pnpStatus = IoSetDeviceInterfaceState(disketteExtension__InterfaceString, - 1); + pnpStatus = IoSetDeviceInterfaceState( + disketteExtension__InterfaceString, 1); + } } - } #line 615 - disketteExtension__IsStarted = 1; + disketteExtension__IsStarted = 1; #line 616 - disketteExtension__HoldNewRequests = 0; + disketteExtension__HoldNewRequests = 0; + } } - } - { + { #line 624 - Irp__IoStatus__Status = ntStatus; + Irp__IoStatus__Status = ntStatus; #line 625 - myStatus = ntStatus; + myStatus = ntStatus; #line 626 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 628 - return (ntStatus); -} + return (ntStatus); + } } #line 631 "floppy_simpl4.cil.c" -int FloppyPnpComplete(int DeviceObject , int Irp , int Context ) -{ +int FloppyPnpComplete(int DeviceObject, int Irp, int Context) { { - { + { #line 636 - KeSetEvent(Context, 1, 0); - } + KeSetEvent(Context, 1, 0); + } #line 638 - return (-1073741802); -} + return (-1073741802); + } } #line 641 "floppy_simpl4.cil.c" -int FlFdcDeviceIo(int DeviceObject , int Ioctl , int Data ) -{ int ntStatus ; - int irp ; - int irpStack ; - int doneEvent = __VERIFIER_nondet_int() ; - int ioStatus = __VERIFIER_nondet_int() ; - int irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int irpStack__Parameters__DeviceIoControl__Type3InputBuffer ; - long __cil_tmp11 ; +int FlFdcDeviceIo(int DeviceObject, int Ioctl, int Data) { + int ntStatus; + int irp; + int irpStack; + int doneEvent = __VERIFIER_nondet_int(); + int ioStatus = __VERIFIER_nondet_int(); + int irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int irpStack__Parameters__DeviceIoControl__Type3InputBuffer; + long __cil_tmp11; { - { + { #line 652 - irp = IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, 0, 0, 0, 0, 1, doneEvent, - ioStatus); - } + irp = IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, 0, 0, 0, 0, 1, + doneEvent, ioStatus); + } #line 655 - if (irp == 0) { + if (irp == 0) { #line 656 - return (-1073741670); - } - { + return (-1073741670); + } + { #line 661 - irpStack = irp__Tail__Overlay__CurrentStackLocation - 1; + irpStack = irp__Tail__Overlay__CurrentStackLocation - 1; #line 662 - irpStack__Parameters__DeviceIoControl__Type3InputBuffer = Data; + irpStack__Parameters__DeviceIoControl__Type3InputBuffer = Data; #line 663 - ntStatus = IofCallDriver(DeviceObject, irp); - } - { + ntStatus = IofCallDriver(DeviceObject, irp); + } + { #line 665 - __cil_tmp11 = (long )ntStatus; + __cil_tmp11 = (long)ntStatus; #line 665 - if (__cil_tmp11 == 259L) { - { + if (__cil_tmp11 == 259L) { + { #line 667 - KeWaitForSingleObject(doneEvent, Suspended, KernelMode, 0, 0); + KeWaitForSingleObject(doneEvent, Suspended, KernelMode, 0, 0); #line 668 - ntStatus = myStatus; + ntStatus = myStatus; + } + } } - } - } #line 673 - return (ntStatus); -} + return (ntStatus); + } } #line 676 "floppy_simpl4.cil.c" -void FloppyProcessQueuedRequests(int DisketteExtension ) -{ +void FloppyProcessQueuedRequests(int DisketteExtension) { { #line 680 - return; -} + return; + } } #line 683 "floppy_simpl4.cil.c" -void stub_driver_init(void) -{ +void stub_driver_init(void) { { #line 687 - s = NP; + s = NP; #line 688 - pended = 0; + pended = 0; #line 689 - compRegistered = 0; + compRegistered = 0; #line 690 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 691 - setEventCalled = 0; + setEventCalled = 0; #line 692 - customIrp = 0; + customIrp = 0; #line 693 - return; -} + return; + } } #line 696 "floppy_simpl4.cil.c" -int main(void) -{ int status ; - int irp = __VERIFIER_nondet_int() ; - int pirp ; - int pirp__IoStatus__Status ; - int irp_choice = __VERIFIER_nondet_int() ; - int devobj = __VERIFIER_nondet_int() ; - int __cil_tmp8 ; +int main(void) { + int status; + int irp = __VERIFIER_nondet_int(); + int pirp; + int pirp__IoStatus__Status; + int irp_choice = __VERIFIER_nondet_int(); + int devobj = __VERIFIER_nondet_int(); + int __cil_tmp8; - FloppyThread = 0; - KernelMode = 0; - Suspended = 0; - Executive = 0; - DiskController = 0; - FloppyDiskPeripheral = 0; - FlConfigCallBack = 0; - MaximumInterfaceType = 0; - MOUNTDEV_MOUNTED_DEVICE_GUID = 0; - myStatus = 0; - s = 0; - UNLOADED = 0; - NP = 0; - DC = 0; - SKIP1 = 0; - SKIP2 = 0 ; - MPR1 = 0; - MPR3 = 0; - IPC = 0; - pended = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; + FloppyThread = 0; + KernelMode = 0; + Suspended = 0; + Executive = 0; + DiskController = 0; + FloppyDiskPeripheral = 0; + FlConfigCallBack = 0; + MaximumInterfaceType = 0; + MOUNTDEV_MOUNTED_DEVICE_GUID = 0; + myStatus = 0; + s = 0; + UNLOADED = 0; + NP = 0; + DC = 0; + SKIP1 = 0; + SKIP2 = 0; + MPR1 = 0; + MPR3 = 0; + IPC = 0; + pended = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; { - { + { #line 707 - status = 0; + status = 0; #line 708 - pirp = irp; + pirp = irp; #line 709 - _BLAST_init(); - } + _BLAST_init(); + } #line 711 - if (status >= 0) { + if (status >= 0) { #line 712 - s = NP; + s = NP; #line 713 - customIrp = 0; + customIrp = 0; #line 714 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 715 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 716 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 717 - pended = compRegistered; + pended = compRegistered; #line 718 - pirp__IoStatus__Status = 0; + pirp__IoStatus__Status = 0; #line 719 - myStatus = 0; + myStatus = 0; #line 720 - if (irp_choice == 0) { + if (irp_choice == 0) { #line 721 - pirp__IoStatus__Status = -1073741637; + pirp__IoStatus__Status = -1073741637; #line 722 - myStatus = -1073741637; - } - { + myStatus = -1073741637; + } + { #line 727 - stub_driver_init(); - } - { + stub_driver_init(); + } + { #line 729 #line 729 - if (status < 0) { + if (status < 0) { #line 730 - return (-1); - } - } + return (-1); + } + } #line 734 - int tmp_ndt_1; - tmp_ndt_1 = __VERIFIER_nondet_int(); - if (tmp_ndt_1 == 0) { - goto switch_2_0; - } else { -#line 737 - int tmp_ndt_2; - tmp_ndt_2 = __VERIFIER_nondet_int(); - if (tmp_ndt_2 == 1) { - goto switch_2_1; + int tmp_ndt_1; + tmp_ndt_1 = __VERIFIER_nondet_int(); + if (tmp_ndt_1 == 0) { + goto switch_2_0; } else { -#line 740 - int tmp_ndt_3; - tmp_ndt_3 = __VERIFIER_nondet_int(); - if (tmp_ndt_3 == 2) { - goto switch_2_2; +#line 737 + int tmp_ndt_2; + tmp_ndt_2 = __VERIFIER_nondet_int(); + if (tmp_ndt_2 == 1) { + goto switch_2_1; } else { -#line 743 - int tmp_ndt_4; - tmp_ndt_4 = __VERIFIER_nondet_int(); - if (tmp_ndt_4 == 3) { - goto switch_2_3; +#line 740 + int tmp_ndt_3; + tmp_ndt_3 = __VERIFIER_nondet_int(); + if (tmp_ndt_3 == 2) { + goto switch_2_2; } else { - goto switch_2_default; +#line 743 + int tmp_ndt_4; + tmp_ndt_4 = __VERIFIER_nondet_int(); + if (tmp_ndt_4 == 3) { + goto switch_2_3; + } else { + goto switch_2_default; #line 748 - if (0) { - switch_2_0: - { + if (0) { + switch_2_0 : { #line 751 - status = FloppyCreateClose(devobj, pirp); + status = FloppyCreateClose(devobj, pirp); } - goto switch_2_break; - switch_2_1: - { + goto switch_2_break; + switch_2_1 : { #line 756 - status = FloppyCreateClose(devobj, pirp); + status = FloppyCreateClose(devobj, pirp); } - goto switch_2_break; - switch_2_2: - { + goto switch_2_break; + switch_2_2 : { #line 761 - status = FloppyDeviceControl(devobj, pirp); + status = FloppyDeviceControl(devobj, pirp); } - goto switch_2_break; - switch_2_3: - { + goto switch_2_break; + switch_2_3 : { #line 766 - status = FloppyPnp(devobj, pirp); + status = FloppyPnp(devobj, pirp); } - goto switch_2_break; - switch_2_default: ; + goto switch_2_break; + switch_2_default:; #line 770 - return (-1); - } else { - switch_2_break: ; + return (-1); + } else { + switch_2_break:; + } } } } } } - } #line 782 - if (pended == 1) { + if (pended == 1) { #line 783 - if (s == NP) { + if (s == NP) { #line 784 - s = NP; + s = NP; + } else { + goto _L___2; + } } else { - goto _L___2; - } - } else { - _L___2: + _L___2: #line 790 - if (pended == 1) { + if (pended == 1) { #line 791 - if (s == MPR3) { + if (s == MPR3) { #line 792 - s = MPR3; + s = MPR3; + } else { + goto _L___1; + } } else { - goto _L___1; - } - } else { - _L___1: + _L___1: #line 798 - if (s != UNLOADED) { + if (s != UNLOADED) { #line 801 - if (status != -1) { + if (status != -1) { #line 804 - if (s != SKIP2) { + if (s != SKIP2) { #line 805 - if (s != IPC) { + if (s != IPC) { #line 806 - if (s != DC) { - { + if (s != DC) { + { #line 808 - errorFn(); + errorFn(); + } + } else { + goto _L___0; } } else { goto _L___0; } } else { - goto _L___0; - } - } else { - _L___0: + _L___0: #line 818 - if (pended == 1) { + if (pended == 1) { #line 819 - if (status != 259) { + if (status != 259) { #line 820 - status = 0; - } - } else { + status = 0; + } + } else { #line 825 - if (s == DC) { + if (s == DC) { #line 826 - if (status == 259) { - { + if (status == 259) { + { #line 828 - errorFn(); + errorFn(); + } } - } - } else { + } else { #line 834 - if (status != lowerDriverReturn) { - { + if (status != lowerDriverReturn) { + { #line 836 - errorFn(); + errorFn(); + } } } } @@ -1103,1068 +1102,1110 @@ int main(void) } } } - } #line 848 - status = 0; + status = 0; #line 849 - return (status); -} + return (status); + } } #line 852 "floppy_simpl4.cil.c" -int IoBuildDeviceIoControlRequest(int IoControlCode , int DeviceObject , int InputBuffer , - int InputBufferLength , int OutputBuffer , int OutputBufferLength , - int InternalDeviceIoControl , int Event , int IoStatusBlock ) -{ - int malloc = __VERIFIER_nondet_int() ; +int IoBuildDeviceIoControlRequest(int IoControlCode, int DeviceObject, + int InputBuffer, int InputBufferLength, + int OutputBuffer, int OutputBufferLength, + int InternalDeviceIoControl, int Event, + int IoStatusBlock) { + int malloc = __VERIFIER_nondet_int(); { #line 859 - customIrp = 1; + customIrp = 1; #line 860 - int tmp_ndt_5; - tmp_ndt_5 = __VERIFIER_nondet_int(); - if (tmp_ndt_5 == 0) { - goto switch_3_0; - } else { - goto switch_3_default; + int tmp_ndt_5; + tmp_ndt_5 = __VERIFIER_nondet_int(); + if (tmp_ndt_5 == 0) { + goto switch_3_0; + } else { + goto switch_3_default; #line 865 - if (0) { - switch_3_0: + if (0) { + switch_3_0: #line 867 - return (malloc); - switch_3_default: ; + return (malloc); + switch_3_default:; #line 869 - return (0); - } else { - + return (0); + } else { + } } } } -} #line 877 "floppy_simpl4.cil.c" -int IoDeleteSymbolicLink(int SymbolicLinkName ) -{ +int IoDeleteSymbolicLink(int SymbolicLinkName) { { #line 881 - int tmp_ndt_6; - tmp_ndt_6 = __VERIFIER_nondet_int(); - if (tmp_ndt_6 == 0) { - goto switch_4_0; - } else { - goto switch_4_default; + int tmp_ndt_6; + tmp_ndt_6 = __VERIFIER_nondet_int(); + if (tmp_ndt_6 == 0) { + goto switch_4_0; + } else { + goto switch_4_default; #line 886 - if (0) { - switch_4_0: + if (0) { + switch_4_0: #line 888 - return (0); - switch_4_default: ; + return (0); + switch_4_default:; #line 890 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 898 "floppy_simpl4.cil.c" -int IoQueryDeviceDescription(int BusType , int BusNumber , int ControllerType , int ControllerNumber , - int PeripheralType , int PeripheralNumber , int CalloutRoutine , - int Context ) -{ +int IoQueryDeviceDescription(int BusType, int BusNumber, int ControllerType, + int ControllerNumber, int PeripheralType, + int PeripheralNumber, int CalloutRoutine, + int Context) { { #line 904 - int tmp_ndt_7; - tmp_ndt_7 = __VERIFIER_nondet_int(); - if (tmp_ndt_7 == 0) { - goto switch_5_0; - } else { - goto switch_5_default; + int tmp_ndt_7; + tmp_ndt_7 = __VERIFIER_nondet_int(); + if (tmp_ndt_7 == 0) { + goto switch_5_0; + } else { + goto switch_5_default; #line 909 - if (0) { - switch_5_0: + if (0) { + switch_5_0: #line 911 - return (0); - switch_5_default: ; + return (0); + switch_5_default:; #line 913 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 921 "floppy_simpl4.cil.c" -int IoRegisterDeviceInterface(int PhysicalDeviceObject , int InterfaceClassGuid , - int ReferenceString , int SymbolicLinkName ) -{ +int IoRegisterDeviceInterface(int PhysicalDeviceObject, int InterfaceClassGuid, + int ReferenceString, int SymbolicLinkName) { { #line 926 - int tmp_ndt_8; - tmp_ndt_8 = __VERIFIER_nondet_int(); - if (tmp_ndt_8 == 0) { - goto switch_6_0; - } else { - goto switch_6_default; + int tmp_ndt_8; + tmp_ndt_8 = __VERIFIER_nondet_int(); + if (tmp_ndt_8 == 0) { + goto switch_6_0; + } else { + goto switch_6_default; #line 931 - if (0) { - switch_6_0: + if (0) { + switch_6_0: #line 933 - return (0); - switch_6_default: ; + return (0); + switch_6_default:; #line 935 - return (-1073741808); - } else { - + return (-1073741808); + } else { + } } } } -} #line 943 "floppy_simpl4.cil.c" -int IoSetDeviceInterfaceState(int SymbolicLinkName , int Enable ) -{ +int IoSetDeviceInterfaceState(int SymbolicLinkName, int Enable) { { #line 947 - int tmp_ndt_9; - tmp_ndt_9 = __VERIFIER_nondet_int(); - if (tmp_ndt_9 == 0) { - goto switch_7_0; - } else { - goto switch_7_default; + int tmp_ndt_9; + tmp_ndt_9 = __VERIFIER_nondet_int(); + if (tmp_ndt_9 == 0) { + goto switch_7_0; + } else { + goto switch_7_default; #line 952 - if (0) { - switch_7_0: + if (0) { + switch_7_0: #line 954 - return (0); - switch_7_default: ; + return (0); + switch_7_default:; #line 956 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 964 "floppy_simpl4.cil.c" -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { #line 968 - if (s == NP) { + if (s == NP) { #line 969 - s = MPR1; - } else { - { + s = MPR1; + } else { + { #line 972 - errorFn(); + errorFn(); + } } - } #line 975 - return; -} + return; + } } #line 978 "floppy_simpl4.cil.c" -int IofCallDriver(int DeviceObject , int Irp ) -{ - int returnVal2 ; - int compRetStatus1 ; - int lcontext = __VERIFIER_nondet_int() ; - unsigned long __cil_tmp7 ; +int IofCallDriver(int DeviceObject, int Irp) { + int returnVal2; + int compRetStatus1; + int lcontext = __VERIFIER_nondet_int(); + unsigned long __cil_tmp7; { #line 985 - if (compRegistered) { - { + if (compRegistered) { + { #line 987 - compRetStatus1 = FloppyPnpComplete(DeviceObject, Irp, lcontext); - } - { + compRetStatus1 = FloppyPnpComplete(DeviceObject, Irp, lcontext); + } + { #line 989 - __cil_tmp7 = (unsigned long )compRetStatus1; + __cil_tmp7 = (unsigned long)compRetStatus1; #line 989 - if (__cil_tmp7 == -1073741802) { - { + if (__cil_tmp7 == -1073741802) { + { #line 991 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 999 - int tmp_ndt_10; - tmp_ndt_10 = __VERIFIER_nondet_int(); - if (tmp_ndt_10 == 0) { - goto switch_8_0; - } else { -#line 1002 - int tmp_ndt_11; - tmp_ndt_11 = __VERIFIER_nondet_int(); - if (tmp_ndt_11 == 1) { - goto switch_8_1; + int tmp_ndt_10; + tmp_ndt_10 = __VERIFIER_nondet_int(); + if (tmp_ndt_10 == 0) { + goto switch_8_0; } else { - goto switch_8_default; +#line 1002 + int tmp_ndt_11; + tmp_ndt_11 = __VERIFIER_nondet_int(); + if (tmp_ndt_11 == 1) { + goto switch_8_1; + } else { + goto switch_8_default; #line 1007 - if (0) { - switch_8_0: + if (0) { + switch_8_0: #line 1009 - returnVal2 = 0; - goto switch_8_break; - switch_8_1: + returnVal2 = 0; + goto switch_8_break; + switch_8_1: #line 1012 - returnVal2 = -1073741823; - goto switch_8_break; - switch_8_default: + returnVal2 = -1073741823; + goto switch_8_break; + switch_8_default: #line 1015 - returnVal2 = 259; - goto switch_8_break; - } else { - switch_8_break: ; + returnVal2 = 259; + goto switch_8_break; + } else { + switch_8_break:; + } } } - } #line 1023 - if (s == NP) { + if (s == NP) { #line 1024 - s = IPC; + s = IPC; #line 1025 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 1027 - if (s == MPR1) { + if (s == MPR1) { #line 1028 - if (returnVal2 == 259) { + if (returnVal2 == 259) { #line 1029 - s = MPR3; + s = MPR3; #line 1030 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 1032 - s = NP; + s = NP; #line 1033 - lowerDriverReturn = returnVal2; - } - } else { + lowerDriverReturn = returnVal2; + } + } else { #line 1036 - if (s == SKIP1) { + if (s == SKIP1) { #line 1037 - s = SKIP2; + s = SKIP2; #line 1038 - lowerDriverReturn = returnVal2; - } else { - { + lowerDriverReturn = returnVal2; + } else { + { #line 1041 - errorFn(); + errorFn(); + } } } } - } #line 1046 - return (returnVal2); -} + return (returnVal2); + } } #line 1049 "floppy_simpl4.cil.c" -void IofCompleteRequest(int Irp , int PriorityBoost ) -{ +void IofCompleteRequest(int Irp, int PriorityBoost) { { #line 1053 - if (s == NP) { + if (s == NP) { #line 1054 - s = DC; - } else { - { + s = DC; + } else { + { #line 1057 - errorFn(); + errorFn(); + } } - } #line 1060 - return; -} + return; + } } #line 1063 "floppy_simpl4.cil.c" -int KeSetEvent(int Event , int Increment , int Wait ) -{ int l = __VERIFIER_nondet_int() ; +int KeSetEvent(int Event, int Increment, int Wait) { + int l = __VERIFIER_nondet_int(); { #line 1067 - setEventCalled = 1; + setEventCalled = 1; #line 1068 - return (l); -} + return (l); + } } #line 1071 "floppy_simpl4.cil.c" -int KeWaitForSingleObject(int Object , int WaitReason , int WaitMode , int Alertable , - int Timeout ) -{ +int KeWaitForSingleObject(int Object, int WaitReason, int WaitMode, + int Alertable, int Timeout) { { #line 1076 - if (s == MPR3) { + if (s == MPR3) { #line 1077 - if (setEventCalled == 1) { + if (setEventCalled == 1) { #line 1078 - s = NP; + s = NP; #line 1079 - setEventCalled = 0; + setEventCalled = 0; + } else { + goto _L; + } } else { - goto _L; - } - } else { - _L: + _L: #line 1085 - if (customIrp == 1) { + if (customIrp == 1) { #line 1086 - s = NP; + s = NP; #line 1087 - customIrp = 0; - } else { + customIrp = 0; + } else { #line 1089 - if (s == MPR3) { - { + if (s == MPR3) { + { #line 1091 - errorFn(); + errorFn(); + } } } } - } #line 1098 - int tmp_ndt_12; - tmp_ndt_12 = __VERIFIER_nondet_int(); - if (tmp_ndt_12 == 0) { - goto switch_9_0; - } else { - goto switch_9_default; + int tmp_ndt_12; + tmp_ndt_12 = __VERIFIER_nondet_int(); + if (tmp_ndt_12 == 0) { + goto switch_9_0; + } else { + goto switch_9_default; #line 1103 - if (0) { - switch_9_0: + if (0) { + switch_9_0: #line 1105 - return (0); - switch_9_default: ; + return (0); + switch_9_default:; #line 1107 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1115 "floppy_simpl4.cil.c" -int ObReferenceObjectByHandle(int Handle , int DesiredAccess , int ObjectType , int AccessMode , - int Object , int HandleInformation ) -{ +int ObReferenceObjectByHandle(int Handle, int DesiredAccess, int ObjectType, + int AccessMode, int Object, + int HandleInformation) { { #line 1120 - int tmp_ndt_13; - tmp_ndt_13 = __VERIFIER_nondet_int(); - if (tmp_ndt_13 == 0) { - goto switch_10_0; - } else { - goto switch_10_default; + int tmp_ndt_13; + tmp_ndt_13 = __VERIFIER_nondet_int(); + if (tmp_ndt_13 == 0) { + goto switch_10_0; + } else { + goto switch_10_default; #line 1125 - if (0) { - switch_10_0: + if (0) { + switch_10_0: #line 1127 - return (0); - switch_10_default: ; + return (0); + switch_10_default:; #line 1129 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1137 "floppy_simpl4.cil.c" -int PsCreateSystemThread(int ThreadHandle , int DesiredAccess , int ObjectAttributes , - int ProcessHandle , int ClientId , int StartRoutine , int StartContext ) -{ +int PsCreateSystemThread(int ThreadHandle, int DesiredAccess, + int ObjectAttributes, int ProcessHandle, int ClientId, + int StartRoutine, int StartContext) { { #line 1142 - int tmp_ndt_14; - tmp_ndt_14 = __VERIFIER_nondet_int(); - if (tmp_ndt_14 == 0) { - goto switch_11_0; - } else { - goto switch_11_default; + int tmp_ndt_14; + tmp_ndt_14 = __VERIFIER_nondet_int(); + if (tmp_ndt_14 == 0) { + goto switch_11_0; + } else { + goto switch_11_default; #line 1147 - if (0) { - switch_11_0: + if (0) { + switch_11_0: #line 1149 - return (0); - switch_11_default: ; + return (0); + switch_11_default:; #line 1151 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1159 "floppy_simpl4.cil.c" -int ZwClose(int Handle ) -{ +int ZwClose(int Handle) { { #line 1163 - int tmp_ndt_15; - tmp_ndt_15 = __VERIFIER_nondet_int(); - if (tmp_ndt_15 == 0) { - goto switch_12_0; - } else { - goto switch_12_default; + int tmp_ndt_15; + tmp_ndt_15 = __VERIFIER_nondet_int(); + if (tmp_ndt_15 == 0) { + goto switch_12_0; + } else { + goto switch_12_default; #line 1168 - if (0) { - switch_12_0: + if (0) { + switch_12_0: #line 1170 - return (0); - switch_12_default: ; + return (0); + switch_12_default:; #line 1172 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 1180 "floppy_simpl4.cil.c" -int FloppyCreateClose(int DeviceObject , int Irp ) -{ int Irp__IoStatus__Status ; - int Irp__IoStatus__Information ; +int FloppyCreateClose(int DeviceObject, int Irp) { + int Irp__IoStatus__Status; + int Irp__IoStatus__Information; { - { + { #line 1186 - myStatus = 0; + myStatus = 0; #line 1187 - Irp__IoStatus__Status = 0; + Irp__IoStatus__Status = 0; #line 1188 - Irp__IoStatus__Information = 1; + Irp__IoStatus__Information = 1; #line 1189 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 1191 - return (0); -} + return (0); + } } #line 1194 -int FloppyQueueRequest(int DisketteExtension , int Irp ) ; +int FloppyQueueRequest(int DisketteExtension, int Irp); #line 1195 "floppy_simpl4.cil.c" -int FloppyDeviceControl(int DeviceObject , int Irp ) -{ int disketteExtension__HoldNewRequests = __VERIFIER_nondet_int() ; - int disketteExtension__IsRemoved = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Information ; - int disketteExtension__IsStarted = __VERIFIER_nondet_int() ; - int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int disketteExtension__TargetObject = __VERIFIER_nondet_int() ; - int irpSp__Parameters__DeviceIoControl__OutputBufferLength = __VERIFIER_nondet_int() ; - int sizeof__MOUNTDEV_NAME = __VERIFIER_nondet_int() ; - int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int() ; - int mountName__NameLength ; - int disketteExtension__DeviceName__Length = __VERIFIER_nondet_int() ; - int sizeof__USHORT = __VERIFIER_nondet_int() ; - int disketteExtension__InterfaceString__Buffer = __VERIFIER_nondet_int() ; - int uniqueId__UniqueIdLength ; - int disketteExtension__InterfaceString__Length = __VERIFIER_nondet_int() ; - int sizeof__MOUNTDEV_UNIQUE_ID = __VERIFIER_nondet_int() ; - int irpSp__Parameters__DeviceIoControl__InputBufferLength = __VERIFIER_nondet_int() ; - int sizeof__FORMAT_PARAMETERS = __VERIFIER_nondet_int() ; - int irpSp__Parameters__DeviceIoControl__IoControlCode___1 = __VERIFIER_nondet_int() ; - int sizeof__FORMAT_EX_PARAMETERS = __VERIFIER_nondet_int() ; - int formatExParameters__FormatGapLength = __VERIFIER_nondet_int() ; - int formatExParameters__SectorsPerTrack = __VERIFIER_nondet_int() ; - int sizeof__DISK_GEOMETRY = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status___0 ; - int disketteExtension = __VERIFIER_nondet_int() ; - int ntStatus ; - int outputBufferLength ; - int lowestDriveMediaType = __VERIFIER_nondet_int() ; - int highestDriveMediaType = __VERIFIER_nondet_int() ; - int formatExParametersSize = __VERIFIER_nondet_int() ; - int formatExParameters ; - int tmp ; - int mountName ; - int uniqueId ; - int tmp___0 ; - int __cil_tmp39 ; - int __cil_tmp40 ; - int __cil_tmp41 = __VERIFIER_nondet_int() ; - int __cil_tmp42 ; - int __cil_tmp43 ; - int __cil_tmp44 = __VERIFIER_nondet_int() ; - int __cil_tmp45 = __VERIFIER_nondet_int() ; - int __cil_tmp46 ; - int __cil_tmp47 ; - int __cil_tmp48 ; - int __cil_tmp49 ; - int __cil_tmp50 = __VERIFIER_nondet_int() ; - int __cil_tmp51 ; - int __cil_tmp52 ; - int __cil_tmp53 ; - int __cil_tmp54 ; - int __cil_tmp55 = __VERIFIER_nondet_int() ; - int __cil_tmp56 ; - int __cil_tmp57 ; - int __cil_tmp58 ; - int __cil_tmp59 ; - int __cil_tmp60 = __VERIFIER_nondet_int() ; - int __cil_tmp61 ; - int __cil_tmp62 ; - int __cil_tmp63 ; - int __cil_tmp64 ; - int __cil_tmp65 = __VERIFIER_nondet_int() ; - int __cil_tmp66 = __VERIFIER_nondet_int() ; - int __cil_tmp67 ; - int __cil_tmp68 ; - int __cil_tmp69 = __VERIFIER_nondet_int() ; - int __cil_tmp70 ; - int __cil_tmp71 ; - int __cil_tmp72 = __VERIFIER_nondet_int() ; - int __cil_tmp73 ; - int __cil_tmp74 ; - int __cil_tmp75 = __VERIFIER_nondet_int() ; - int __cil_tmp76 ; - int __cil_tmp77 ; - int __cil_tmp78 = __VERIFIER_nondet_int() ; - int __cil_tmp79 ; - int __cil_tmp80 ; - int __cil_tmp81 = __VERIFIER_nondet_int() ; - int __cil_tmp82 ; - int __cil_tmp83 ; - int __cil_tmp84 ; - int __cil_tmp85 ; - int __cil_tmp86 ; - int __cil_tmp87 ; - int __cil_tmp88 = __VERIFIER_nondet_int() ; - int __cil_tmp89 ; - int __cil_tmp90 ; - long __cil_tmp91 ; +int FloppyDeviceControl(int DeviceObject, int Irp) { + int disketteExtension__HoldNewRequests = __VERIFIER_nondet_int(); + int disketteExtension__IsRemoved = __VERIFIER_nondet_int(); + int Irp__IoStatus__Information; + int disketteExtension__IsStarted = __VERIFIER_nondet_int(); + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int disketteExtension__TargetObject = __VERIFIER_nondet_int(); + int irpSp__Parameters__DeviceIoControl__OutputBufferLength = + __VERIFIER_nondet_int(); + int sizeof__MOUNTDEV_NAME = __VERIFIER_nondet_int(); + int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int(); + int mountName__NameLength; + int disketteExtension__DeviceName__Length = __VERIFIER_nondet_int(); + int sizeof__USHORT = __VERIFIER_nondet_int(); + int disketteExtension__InterfaceString__Buffer = __VERIFIER_nondet_int(); + int uniqueId__UniqueIdLength; + int disketteExtension__InterfaceString__Length = __VERIFIER_nondet_int(); + int sizeof__MOUNTDEV_UNIQUE_ID = __VERIFIER_nondet_int(); + int irpSp__Parameters__DeviceIoControl__InputBufferLength = + __VERIFIER_nondet_int(); + int sizeof__FORMAT_PARAMETERS = __VERIFIER_nondet_int(); + int irpSp__Parameters__DeviceIoControl__IoControlCode___1 = + __VERIFIER_nondet_int(); + int sizeof__FORMAT_EX_PARAMETERS = __VERIFIER_nondet_int(); + int formatExParameters__FormatGapLength = __VERIFIER_nondet_int(); + int formatExParameters__SectorsPerTrack = __VERIFIER_nondet_int(); + int sizeof__DISK_GEOMETRY = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status___0; + int disketteExtension = __VERIFIER_nondet_int(); + int ntStatus; + int outputBufferLength; + int lowestDriveMediaType = __VERIFIER_nondet_int(); + int highestDriveMediaType = __VERIFIER_nondet_int(); + int formatExParametersSize = __VERIFIER_nondet_int(); + int formatExParameters; + int tmp; + int mountName; + int uniqueId; + int tmp___0; + int __cil_tmp39; + int __cil_tmp40; + int __cil_tmp41 = __VERIFIER_nondet_int(); + int __cil_tmp42; + int __cil_tmp43; + int __cil_tmp44 = __VERIFIER_nondet_int(); + int __cil_tmp45 = __VERIFIER_nondet_int(); + int __cil_tmp46; + int __cil_tmp47; + int __cil_tmp48; + int __cil_tmp49; + int __cil_tmp50 = __VERIFIER_nondet_int(); + int __cil_tmp51; + int __cil_tmp52; + int __cil_tmp53; + int __cil_tmp54; + int __cil_tmp55 = __VERIFIER_nondet_int(); + int __cil_tmp56; + int __cil_tmp57; + int __cil_tmp58; + int __cil_tmp59; + int __cil_tmp60 = __VERIFIER_nondet_int(); + int __cil_tmp61; + int __cil_tmp62; + int __cil_tmp63; + int __cil_tmp64; + int __cil_tmp65 = __VERIFIER_nondet_int(); + int __cil_tmp66 = __VERIFIER_nondet_int(); + int __cil_tmp67; + int __cil_tmp68; + int __cil_tmp69 = __VERIFIER_nondet_int(); + int __cil_tmp70; + int __cil_tmp71; + int __cil_tmp72 = __VERIFIER_nondet_int(); + int __cil_tmp73; + int __cil_tmp74; + int __cil_tmp75 = __VERIFIER_nondet_int(); + int __cil_tmp76; + int __cil_tmp77; + int __cil_tmp78 = __VERIFIER_nondet_int(); + int __cil_tmp79; + int __cil_tmp80; + int __cil_tmp81 = __VERIFIER_nondet_int(); + int __cil_tmp82; + int __cil_tmp83; + int __cil_tmp84; + int __cil_tmp85; + int __cil_tmp86; + int __cil_tmp87; + int __cil_tmp88 = __VERIFIER_nondet_int(); + int __cil_tmp89; + int __cil_tmp90; + long __cil_tmp91; { #line 1234 - if (disketteExtension__HoldNewRequests) { - { + if (disketteExtension__HoldNewRequests) { + { #line 1235 - //__cil_tmp39 = 3 << 14; +//__cil_tmp39 = 3 << 14; #line 1235 - //__cil_tmp40 = 50 << 16; +//__cil_tmp40 = 50 << 16; #line 1235 - //__cil_tmp41 = __cil_tmp40 | __cil_tmp39; +//__cil_tmp41 = __cil_tmp40 | __cil_tmp39; #line 1235 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 != __cil_tmp41) { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 != + __cil_tmp41) { + { #line 1237 - ntStatus = FloppyQueueRequest(disketteExtension, Irp); - } + ntStatus = FloppyQueueRequest(disketteExtension, Irp); + } #line 1239 - return (ntStatus); - } + return (ntStatus); + } + } } - } #line 1246 - if (disketteExtension__IsRemoved) { - { + if (disketteExtension__IsRemoved) { + { #line 1248 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 1249 - Irp__IoStatus__Status___0 = -1073741738; + Irp__IoStatus__Status___0 = -1073741738; #line 1250 - myStatus = -1073741738; + myStatus = -1073741738; #line 1251 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 1253 - return (-1073741738); - } + return (-1073741738); + } #line 1257 - if (! disketteExtension__IsStarted) { + if (!disketteExtension__IsStarted) { #line 1258 - if (s == NP) { + if (s == NP) { #line 1259 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 1262 - errorFn(); + errorFn(); + } } - } - { + { #line 1266 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 1267 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 1268 - tmp = IofCallDriver(disketteExtension__TargetObject, Irp); - } + tmp = IofCallDriver(disketteExtension__TargetObject, Irp); + } #line 1270 - return (tmp); - } - { + return (tmp); + } + { #line 1274 - //__cil_tmp42 = 2 << 2; +//__cil_tmp42 = 2 << 2; #line 1274 - //__cil_tmp43 = 77 << 16; +//__cil_tmp43 = 77 << 16; #line 1274 - //__cil_tmp44 = __cil_tmp43 | __cil_tmp42; +//__cil_tmp44 = __cil_tmp43 | __cil_tmp42; #line 1274 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp44) { - goto switch_13_exp_0; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp44) { + goto switch_13_exp_0; + } else { + { #line 1277 - //__cil_tmp45 = 77 << 16; +//__cil_tmp45 = 77 << 16; #line 1277 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp45) { - goto switch_13_exp_1; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp45) { + goto switch_13_exp_1; + } else { + { #line 1280 - //__cil_tmp46 = 6 << 2; +//__cil_tmp46 = 6 << 2; #line 1280 - //__cil_tmp47 = 3 << 14; +//__cil_tmp47 = 3 << 14; #line 1280 - //__cil_tmp48 = 7 << 16; +//__cil_tmp48 = 7 << 16; #line 1280 - //__cil_tmp49 = __cil_tmp48 | __cil_tmp47; +//__cil_tmp49 = __cil_tmp48 | __cil_tmp47; #line 1280 - //__cil_tmp50 = __cil_tmp49 | __cil_tmp46; +//__cil_tmp50 = __cil_tmp49 | __cil_tmp46; #line 1280 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp50) { - goto switch_13_exp_2; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp50) { + goto switch_13_exp_2; + } else { + { #line 1283 - // __cil_tmp51 = 11 << 2; +// __cil_tmp51 = 11 << 2; #line 1283 - //__cil_tmp52 = 3 << 14; +//__cil_tmp52 = 3 << 14; #line 1283 - //__cil_tmp53 = 7 << 16; +//__cil_tmp53 = 7 << 16; #line 1283 - // __cil_tmp54 = __cil_tmp53 | __cil_tmp52; +// __cil_tmp54 = __cil_tmp53 | __cil_tmp52; #line 1283 - //__cil_tmp55 = __cil_tmp54 | __cil_tmp51; +//__cil_tmp55 = __cil_tmp54 | __cil_tmp51; #line 1283 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp55) { - goto switch_13_exp_3; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp55) { + goto switch_13_exp_3; + } else { + { #line 1286 - // __cil_tmp56 = 512 << 2; +// __cil_tmp56 = 512 << 2; #line 1286 - // __cil_tmp57 = 1 << 14; +// __cil_tmp57 = 1 << 14; #line 1286 - // __cil_tmp58 = 7 << 16; +// __cil_tmp58 = 7 << 16; #line 1286 - //__cil_tmp59 = __cil_tmp58 | __cil_tmp57; +//__cil_tmp59 = __cil_tmp58 | __cil_tmp57; #line 1286 - // __cil_tmp60 = __cil_tmp59 | __cil_tmp56; +// __cil_tmp60 = __cil_tmp59 | __cil_tmp56; #line 1286 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp60) { - goto switch_13_exp_4; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp60) { + goto switch_13_exp_4; + } else { + { #line 1289 - //__cil_tmp61 = 512 << 2; +//__cil_tmp61 = 512 << 2; #line 1289 - //__cil_tmp62 = 1 << 14; +//__cil_tmp62 = 1 << 14; #line 1289 - // __cil_tmp63 = 45 << 16; +// __cil_tmp63 = 45 << 16; #line 1289 - //__cil_tmp64 = __cil_tmp63 | __cil_tmp62; +//__cil_tmp64 = __cil_tmp63 | __cil_tmp62; #line 1289 - //__cil_tmp65 = __cil_tmp64 | __cil_tmp61; +//__cil_tmp65 = __cil_tmp64 | __cil_tmp61; #line 1289 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp65) { - goto switch_13_exp_5; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp65) { + goto switch_13_exp_5; + } else { + { #line 1292 - //__cil_tmp66 = 7 << 16; +//__cil_tmp66 = 7 << 16; #line 1292 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp66) { - goto switch_13_exp_6; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp66) { + goto switch_13_exp_6; + } else { + { #line 1295 - //__cil_tmp67 = 9 << 2; +//__cil_tmp67 = 9 << 2; #line 1295 - //__cil_tmp68 = 7 << 16; +//__cil_tmp68 = 7 << 16; #line 1295 - //__cil_tmp69 = __cil_tmp68 | __cil_tmp67; +//__cil_tmp69 = __cil_tmp68 | __cil_tmp67; #line 1295 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp69) { - goto switch_13_exp_7; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp69) { + goto switch_13_exp_7; + } else { + { #line 1298 - //__cil_tmp70 = 768 << 2; +//__cil_tmp70 = 768 << 2; #line 1298 - //__cil_tmp71 = 7 << 16; +//__cil_tmp71 = 7 << 16; #line 1298 - //__cil_tmp72 = __cil_tmp71 | __cil_tmp70; +//__cil_tmp72 = __cil_tmp71 | __cil_tmp70; #line 1298 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp72) { - goto switch_13_exp_8; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp72) { + goto switch_13_exp_8; + } else { + { #line 1301 - //__cil_tmp73 = 768 << 2; +//__cil_tmp73 = 768 << 2; #line 1301 - // __cil_tmp74 = 45 << 16; +// __cil_tmp74 = 45 << 16; #line 1301 - //__cil_tmp75 = __cil_tmp74 | __cil_tmp73; +//__cil_tmp75 = __cil_tmp74 | __cil_tmp73; #line 1301 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp75) { - goto switch_13_exp_9; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp75) { + goto switch_13_exp_9; + } else { + { #line 1304 - //__cil_tmp76 = 3 << 2; +//__cil_tmp76 = 3 << 2; #line 1304 - //__cil_tmp77 = 77 << 16; +//__cil_tmp77 = 77 << 16; #line 1304 - //__cil_tmp78 = __cil_tmp77 | __cil_tmp76; +//__cil_tmp78 = __cil_tmp77 | __cil_tmp76; #line 1304 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp78) { - goto switch_13_exp_10; - } else { - { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp78) { + goto switch_13_exp_10; + } else { + { #line 1307 - //__cil_tmp79 = 248 << 2; +//__cil_tmp79 = 248 << 2; #line 1307 - //__cil_tmp80 = 7 << 16; +//__cil_tmp80 = 7 << 16; #line 1307 - //__cil_tmp81 = __cil_tmp80 | __cil_tmp79; +//__cil_tmp81 = __cil_tmp80 | __cil_tmp79; #line 1307 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp81) { - goto switch_13_exp_11; - } else { - goto switch_13_default; + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp81) { + goto switch_13_exp_11; + } else { + goto switch_13_default; #line 1312 - if (0) { - switch_13_exp_0: ; + if (0) { + switch_13_exp_0:; #line 1314 - if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < sizeof__MOUNTDEV_NAME) { + if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < + sizeof__MOUNTDEV_NAME) { #line 1315 - ntStatus = -1073741811; - goto switch_13_break; - } + ntStatus = -1073741811; + goto switch_13_break; + } #line 1320 - mountName = Irp__AssociatedIrp__SystemBuffer; + mountName = + Irp__AssociatedIrp__SystemBuffer; #line 1321 - mountName__NameLength = disketteExtension__DeviceName__Length; - { + mountName__NameLength = + disketteExtension__DeviceName__Length; + { #line 1322 - __cil_tmp82 = sizeof__USHORT + mountName__NameLength; + __cil_tmp82 = + sizeof__USHORT + + mountName__NameLength; #line 1322 - if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < __cil_tmp82) { + if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < + __cil_tmp82) { #line 1323 - ntStatus = -2147483643; + ntStatus = + -2147483643; #line 1324 - Irp__IoStatus__Information = sizeof__MOUNTDEV_NAME; - goto switch_13_break; - } - } + Irp__IoStatus__Information = + sizeof__MOUNTDEV_NAME; + goto switch_13_break; + } + } #line 1329 - ntStatus = 0; + ntStatus = 0; #line 1330 - Irp__IoStatus__Information = sizeof__USHORT + mountName__NameLength; - goto switch_13_break; - switch_13_exp_1: ; + Irp__IoStatus__Information = + sizeof__USHORT + + mountName__NameLength; + goto switch_13_break; + switch_13_exp_1:; #line 1333 - if (! disketteExtension__InterfaceString__Buffer) { + if (!disketteExtension__InterfaceString__Buffer) { #line 1334 - ntStatus = -1073741811; - goto switch_13_break; - } else { + ntStatus = -1073741811; + goto switch_13_break; + } else { #line 1337 - if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < sizeof__MOUNTDEV_UNIQUE_ID) { + if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < + sizeof__MOUNTDEV_UNIQUE_ID) { #line 1338 - ntStatus = -1073741811; - goto switch_13_break; - } - } + ntStatus = + -1073741811; + goto switch_13_break; + } + } #line 1344 - uniqueId = Irp__AssociatedIrp__SystemBuffer; + uniqueId = + Irp__AssociatedIrp__SystemBuffer; #line 1345 - uniqueId__UniqueIdLength = disketteExtension__InterfaceString__Length; - { + uniqueId__UniqueIdLength = + disketteExtension__InterfaceString__Length; + { #line 1346 - __cil_tmp83 = sizeof__USHORT + uniqueId__UniqueIdLength; + __cil_tmp83 = + sizeof__USHORT + + uniqueId__UniqueIdLength; #line 1346 - if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < __cil_tmp83) { + if (irpSp__Parameters__DeviceIoControl__OutputBufferLength < + __cil_tmp83) { #line 1347 - ntStatus = -2147483643; + ntStatus = + -2147483643; #line 1348 - Irp__IoStatus__Information = sizeof__MOUNTDEV_UNIQUE_ID; - goto switch_13_break; - } - } + Irp__IoStatus__Information = + sizeof__MOUNTDEV_UNIQUE_ID; + goto switch_13_break; + } + } #line 1353 - ntStatus = 0; + ntStatus = 0; #line 1354 - Irp__IoStatus__Information = sizeof__USHORT + uniqueId__UniqueIdLength; - goto switch_13_break; - switch_13_exp_2: ; - switch_13_exp_3: ; + Irp__IoStatus__Information = + sizeof__USHORT + + uniqueId__UniqueIdLength; + goto switch_13_break; + switch_13_exp_2:; + switch_13_exp_3:; #line 1358 - if (irpSp__Parameters__DeviceIoControl__InputBufferLength < sizeof__FORMAT_PARAMETERS) { + if (irpSp__Parameters__DeviceIoControl__InputBufferLength < + sizeof__FORMAT_PARAMETERS) { #line 1359 - ntStatus = -1073741811; - goto switch_13_break; - } - { + ntStatus = -1073741811; + goto switch_13_break; + } + { #line 1365 - tmp___0 = FlCheckFormatParameters(disketteExtension, Irp__AssociatedIrp__SystemBuffer); - } + tmp___0 = FlCheckFormatParameters( + disketteExtension, + Irp__AssociatedIrp__SystemBuffer); + } #line 1367 - if (! tmp___0) { + if (!tmp___0) { #line 1370 - ntStatus = -1073741811; - goto switch_13_break; - } - { + ntStatus = -1073741811; + goto switch_13_break; + } + { #line 1373 - //__cil_tmp84 = 11 << 2; +//__cil_tmp84 = 11 << 2; #line 1373 - //__cil_tmp85 = 3 << 14; +//__cil_tmp85 = 3 << 14; #line 1373 - //__cil_tmp86 = 7 << 16; +//__cil_tmp86 = 7 << 16; #line 1373 - //__cil_tmp87 = __cil_tmp86 | __cil_tmp85; +//__cil_tmp87 = __cil_tmp86 | __cil_tmp85; #line 1373 - //__cil_tmp88 = __cil_tmp87 | __cil_tmp84; +//__cil_tmp88 = __cil_tmp87 | __cil_tmp84; #line 1373 - if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == __cil_tmp88) { + if (irpSp__Parameters__DeviceIoControl__IoControlCode___1 == + __cil_tmp88) { #line 1374 - if (irpSp__Parameters__DeviceIoControl__InputBufferLength < sizeof__FORMAT_EX_PARAMETERS) { + if (irpSp__Parameters__DeviceIoControl__InputBufferLength < + sizeof__FORMAT_EX_PARAMETERS) { #line 1375 - ntStatus = -1073741811; - goto switch_13_break; - } + ntStatus = + -1073741811; + goto switch_13_break; + } #line 1380 - formatExParameters = Irp__AssociatedIrp__SystemBuffer; + formatExParameters = + Irp__AssociatedIrp__SystemBuffer; #line 1381 - if (irpSp__Parameters__DeviceIoControl__InputBufferLength < formatExParametersSize) { + if (irpSp__Parameters__DeviceIoControl__InputBufferLength < + formatExParametersSize) { #line 1382 - ntStatus = -1073741811; - goto switch_13_break; - } else { + ntStatus = + -1073741811; + goto switch_13_break; + } else { #line 1385 - if (formatExParameters__FormatGapLength >= 256) { + if (formatExParameters__FormatGapLength >= + 256) { #line 1386 - ntStatus = -1073741811; - goto switch_13_break; - } else { + ntStatus = + -1073741811; + goto switch_13_break; + } else { #line 1389 - if (formatExParameters__SectorsPerTrack >= 256) { + if (formatExParameters__SectorsPerTrack >= + 256) { #line 1390 - ntStatus = -1073741811; - goto switch_13_break; - } - } - } - } - } - switch_13_exp_4: ; - switch_13_exp_5: ; - switch_13_exp_6: ; - switch_13_exp_7: - { + ntStatus = + -1073741811; + goto switch_13_break; + } + } + } + } + } + switch_13_exp_4:; + switch_13_exp_5:; + switch_13_exp_6:; + switch_13_exp_7 : { #line 1405 - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - goto switch_13_break; - switch_13_exp_8: ; - switch_13_exp_9: + ntStatus = + FlQueueIrpToThread( + Irp, + disketteExtension); + } + goto switch_13_break; + switch_13_exp_8:; + switch_13_exp_9: #line 1410 - outputBufferLength = irpSp__Parameters__DeviceIoControl__OutputBufferLength; + outputBufferLength = + irpSp__Parameters__DeviceIoControl__OutputBufferLength; #line 1411 - if (outputBufferLength < sizeof__DISK_GEOMETRY) { + if (outputBufferLength < + sizeof__DISK_GEOMETRY) { #line 1412 - ntStatus = -1073741789; - goto switch_13_break; - } + ntStatus = -1073741789; + goto switch_13_break; + } #line 1417 - ntStatus = 0; - { + ntStatus = 0; + { #line 1418 - __cil_tmp89 = highestDriveMediaType - lowestDriveMediaType; + __cil_tmp89 = + highestDriveMediaType - + lowestDriveMediaType; #line 1418 - __cil_tmp90 = __cil_tmp89 + 1; + __cil_tmp90 = + __cil_tmp89 + 1; #line 1418 - if (outputBufferLength < __cil_tmp90) { + if (outputBufferLength < + __cil_tmp90) { #line 1419 - ntStatus = -2147483643; - } - } - goto switch_13_break; - switch_13_exp_10: ; - switch_13_exp_11: ; - switch_13_default: ; + ntStatus = + -2147483643; + } + } + goto switch_13_break; + switch_13_exp_10:; + switch_13_exp_11:; + switch_13_default:; #line 1427 - if (s == NP) { + if (s == NP) { #line 1428 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 1431 - errorFn(); - } - } - { + errorFn(); + } + } + { #line 1435 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 1436 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 1437 - ntStatus = IofCallDriver(disketteExtension__TargetObject, - Irp); - } + ntStatus = IofCallDriver( + disketteExtension__TargetObject, + Irp); + } #line 1440 - return (ntStatus); - } else { - switch_13_break: ; + return (ntStatus); + } else { + switch_13_break:; + } + } + } + } + } + } + } + } + } + } + } + } + } } } - } } - } - } } } - } - } } } - } - } } } - } - } } } - } - } } - } - } - { + { #line 1457 - __cil_tmp91 = (long )ntStatus; + __cil_tmp91 = (long)ntStatus; #line 1457 - if (__cil_tmp91 != 259L) { - { + if (__cil_tmp91 != 259L) { + { #line 1459 - Irp__IoStatus__Status___0 = ntStatus; + Irp__IoStatus__Status___0 = ntStatus; #line 1460 - myStatus = ntStatus; + myStatus = ntStatus; #line 1461 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); + } + } } - } - } #line 1466 - return (ntStatus); -} + return (ntStatus); + } } #line 1469 "floppy_simpl4.cil.c" -int FlCheckFormatParameters(int DisketteExtension , int FormatParameters ) -{ int DriveMediaConstants__driveMediaType__MediaType = __VERIFIER_nondet_int() ; - int FormatParameters__MediaType = __VERIFIER_nondet_int() ; - int FAKE_CONDITION = __VERIFIER_nondet_int() ; +int FlCheckFormatParameters(int DisketteExtension, int FormatParameters) { + int DriveMediaConstants__driveMediaType__MediaType = __VERIFIER_nondet_int(); + int FormatParameters__MediaType = __VERIFIER_nondet_int(); + int FAKE_CONDITION = __VERIFIER_nondet_int(); { #line 1475 - if (DriveMediaConstants__driveMediaType__MediaType != FormatParameters__MediaType) { + if (DriveMediaConstants__driveMediaType__MediaType != + FormatParameters__MediaType) { #line 1476 - return (0); - } else { -#line 1478 - if (FAKE_CONDITION) { -#line 1479 return (0); } else { +#line 1478 + if (FAKE_CONDITION) { +#line 1479 + return (0); + } else { #line 1481 - return (1); + return (1); + } } } } -} #line 1486 "floppy_simpl4.cil.c" -int FloppyQueueRequest(int DisketteExtension , int Irp ) -{ int Irp__IoStatus__Status ; - int Irp__IoStatus__Information ; - int Irp__Tail__Overlay__CurrentStackLocation__Control ; - int ntStatus ; - int FAKE_CONDITION = __VERIFIER_nondet_int() ; +int FloppyQueueRequest(int DisketteExtension, int Irp) { + int Irp__IoStatus__Status; + int Irp__IoStatus__Information; + int Irp__Tail__Overlay__CurrentStackLocation__Control; + int ntStatus; + int FAKE_CONDITION = __VERIFIER_nondet_int(); { #line 1494 - PagingReferenceCount ++; + PagingReferenceCount++; #line 1495 - if (PagingReferenceCount == 1) { - - } + if (PagingReferenceCount == 1) { + } #line 1500 - if (FAKE_CONDITION) { - { + if (FAKE_CONDITION) { + { #line 1502 - Irp__IoStatus__Status = -1073741536; + Irp__IoStatus__Status = -1073741536; #line 1503 - myStatus = -1073741536; + myStatus = -1073741536; #line 1504 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = 0; #line 1505 - IofCompleteRequest(Irp, 0); + IofCompleteRequest(Irp, 0); #line 1506 - PagingReferenceCount --; - } + PagingReferenceCount--; + } #line 1508 - if (PagingReferenceCount == 0) { - - } + if (PagingReferenceCount == 0) { + } #line 1513 - ntStatus = -1073741536; - } else { + ntStatus = -1073741536; + } else { #line 1515 - Irp__IoStatus__Status = 259; + Irp__IoStatus__Status = 259; #line 1516 - myStatus = 259; + myStatus = 259; #line 1517 - //Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; +// Irp__Tail__Overlay__CurrentStackLocation__Control |= 1; #line 1518 - if (pended == 0) { + if (pended == 0) { #line 1519 - pended = 1; - } else { - { + pended = 1; + } else { + { #line 1522 - errorFn(); + errorFn(); + } } - } #line 1525 - ntStatus = 259; - } + ntStatus = 259; + } #line 1527 - return (ntStatus); -} + return (ntStatus); + } } -void errorFn(void) -{ +void errorFn(void) { { - goto ERROR; - ERROR: assert(0); + goto ERROR; + ERROR: + assert(0); #line 53 - return; -} + return; + } } diff --git a/test/ntdrivers-simplified/kbfiltr_simpl1_true.cil.c b/test/ntdrivers-simplified/kbfiltr_simpl1_true.cil.c index dcd718359..60a00e9b2 100644 --- a/test/ntdrivers-simplified/kbfiltr_simpl1_true.cil.c +++ b/test/ntdrivers-simplified/kbfiltr_simpl1_true.cil.c @@ -10,346 +10,353 @@ extern int __VERIFIER_nondet_int(); /* Generated by CIL v. 1.3.6 */ /* print_CIL_Input is true */ -int KernelMode ; -int Executive ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -int compFptr ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -int myStatus ; +int KernelMode; +int Executive; +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +int compFptr; +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +int myStatus; -void stub_driver_init(void) -{ +void stub_driver_init(void) { { #line 46 - s = NP; + s = NP; #line 47 - pended = 0; + pended = 0; #line 48 - compFptr = 0; + compFptr = 0; #line 49 - compRegistered = 0; + compRegistered = 0; #line 50 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 51 - setEventCalled = 0; + setEventCalled = 0; #line 52 - customIrp = 0; + customIrp = 0; #line 53 - return; -} + return; + } } #line 56 "kbfiltr_simpl1.cil.c" -void _BLAST_init(void) -{ +void _BLAST_init(void) { { #line 60 - UNLOADED = 0; + UNLOADED = 0; #line 61 - NP = 1; + NP = 1; #line 62 - DC = 2; + DC = 2; #line 63 - SKIP1 = 3; + SKIP1 = 3; #line 64 - SKIP2 = 4; + SKIP2 = 4; #line 65 - MPR1 = 5; + MPR1 = 5; #line 66 - MPR3 = 6; + MPR3 = 6; #line 67 - IPC = 7; + IPC = 7; #line 68 - s = UNLOADED; + s = UNLOADED; #line 69 - pended = 0; + pended = 0; #line 70 - compFptr = 0; + compFptr = 0; #line 71 - compRegistered = 0; + compRegistered = 0; #line 72 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 73 - setEventCalled = 0; + setEventCalled = 0; #line 74 - customIrp = 0; + customIrp = 0; #line 75 - return; -} + return; + } } #line 78 "kbfiltr_simpl1.cil.c" void IofCompleteRequest(int, int); void errorFn(void); -int KbFilter_PnP(int DeviceObject , int Irp ) -{ int devExt ; - int irpStack ; - int status ; - int event = __VERIFIER_nondet_int() ; - int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int irpStack__MinorFunction = __VERIFIER_nondet_int() ; - int devExt__TopOfStack = __VERIFIER_nondet_int() ; - int devExt__Started ; - int devExt__Removed ; - int devExt__SurpriseRemoved ; - int Irp__IoStatus__Status ; - int Irp__IoStatus__Information ; - int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int irpSp ; - int nextIrpSp ; - int nextIrpSp__Control ; - int irpSp___0 ; - int irpSp__Context ; - int irpSp__Control ; - long __cil_tmp23 ; +int KbFilter_PnP(int DeviceObject, int Irp) { + int devExt; + int irpStack; + int status; + int event = __VERIFIER_nondet_int(); + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int irpStack__MinorFunction = __VERIFIER_nondet_int(); + int devExt__TopOfStack = __VERIFIER_nondet_int(); + int devExt__Started; + int devExt__Removed; + int devExt__SurpriseRemoved; + int Irp__IoStatus__Status; + int Irp__IoStatus__Information; + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int irpSp; + int nextIrpSp; + int nextIrpSp__Control; + int irpSp___0; + int irpSp__Context; + int irpSp__Control; + long __cil_tmp23; { #line 101 - status = 0; + status = 0; #line 102 - devExt = DeviceObject__DeviceExtension; + devExt = DeviceObject__DeviceExtension; #line 103 - irpStack = Irp__Tail__Overlay__CurrentStackLocation; + irpStack = Irp__Tail__Overlay__CurrentStackLocation; #line 104 - if (irpStack__MinorFunction == 0) { - goto switch_0_0; - } else { -#line 107 - if (irpStack__MinorFunction == 23) { - goto switch_0_23; + if (irpStack__MinorFunction == 0) { + goto switch_0_0; } else { -#line 110 - if (irpStack__MinorFunction == 2) { - goto switch_0_2; +#line 107 + if (irpStack__MinorFunction == 23) { + goto switch_0_23; } else { -#line 113 - if (irpStack__MinorFunction == 1) { - goto switch_0_1; +#line 110 + if (irpStack__MinorFunction == 2) { + goto switch_0_2; } else { -#line 116 - if (irpStack__MinorFunction == 5) { +#line 113 + if (irpStack__MinorFunction == 1) { goto switch_0_1; } else { -#line 119 - if (irpStack__MinorFunction == 3) { +#line 116 + if (irpStack__MinorFunction == 5) { goto switch_0_1; } else { -#line 122 - if (irpStack__MinorFunction == 6) { +#line 119 + if (irpStack__MinorFunction == 3) { goto switch_0_1; } else { -#line 125 - if (irpStack__MinorFunction == 13) { +#line 122 + if (irpStack__MinorFunction == 6) { goto switch_0_1; } else { -#line 128 - if (irpStack__MinorFunction == 4) { +#line 125 + if (irpStack__MinorFunction == 13) { goto switch_0_1; } else { -#line 131 - if (irpStack__MinorFunction == 7) { +#line 128 + if (irpStack__MinorFunction == 4) { goto switch_0_1; } else { -#line 134 - if (irpStack__MinorFunction == 8) { +#line 131 + if (irpStack__MinorFunction == 7) { goto switch_0_1; } else { -#line 137 - if (irpStack__MinorFunction == 9) { +#line 134 + if (irpStack__MinorFunction == 8) { goto switch_0_1; } else { -#line 140 - if (irpStack__MinorFunction == 12) { +#line 137 + if (irpStack__MinorFunction == 9) { goto switch_0_1; } else { -#line 143 - if (irpStack__MinorFunction == 10) { +#line 140 + if (irpStack__MinorFunction == 12) { goto switch_0_1; } else { -#line 146 - if (irpStack__MinorFunction == 11) { +#line 143 + if (irpStack__MinorFunction == 10) { goto switch_0_1; } else { -#line 149 - if (irpStack__MinorFunction == 15) { +#line 146 + if (irpStack__MinorFunction == 11) { goto switch_0_1; } else { -#line 152 - if (irpStack__MinorFunction == 16) { +#line 149 + if (irpStack__MinorFunction == 15) { goto switch_0_1; } else { -#line 155 - if (irpStack__MinorFunction == 17) { +#line 152 + if (irpStack__MinorFunction == 16) { goto switch_0_1; } else { -#line 158 - if (irpStack__MinorFunction == 18) { +#line 155 + if (irpStack__MinorFunction == 17) { goto switch_0_1; } else { -#line 161 - if (irpStack__MinorFunction == 19) { +#line 158 + if (irpStack__MinorFunction == 18) { goto switch_0_1; } else { -#line 164 - if (irpStack__MinorFunction == 20) { +#line 161 + if (irpStack__MinorFunction == 19) { goto switch_0_1; } else { - goto switch_0_1; +#line 164 + if (irpStack__MinorFunction == 20) { + goto switch_0_1; + } else { + goto switch_0_1; #line 169 - if (0) { - switch_0_0: + if (0) { + switch_0_0: #line 171 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = + Irp__Tail__Overlay__CurrentStackLocation; #line 172 - nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; + nextIrpSp = + Irp__Tail__Overlay__CurrentStackLocation - + 1; #line 173 - nextIrpSp__Control = 0; + nextIrpSp__Control = 0; #line 174 - if (s != NP) { - { -#line 176 - errorFn(); - } - } else { -#line 179 - if (compRegistered != 0) { + if (s != NP) { { -#line 181 - errorFn(); +#line 176 + errorFn(); } } else { +#line 179 + if (compRegistered != 0) { + { +#line 181 + errorFn(); + } + } else { #line 184 - compRegistered = 1; + compRegistered = 1; + } } - } - { + { #line 188 - irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation - 1; + irpSp___0 = + Irp__Tail__Overlay__CurrentStackLocation - + 1; #line 189 - irpSp__Control = 224; + irpSp__Control = 224; #line 192 - status = IofCallDriver(devExt__TopOfStack, - Irp); - } - { + status = IofCallDriver( + devExt__TopOfStack, Irp); + } + { #line 197 - __cil_tmp23 = (long )status; + __cil_tmp23 = (long)status; #line 197 - if (__cil_tmp23 == 259 ) { - { + if (__cil_tmp23 == 259) { + { #line 199 - KeWaitForSingleObject(event, Executive, - KernelMode, - 0, 0); + KeWaitForSingleObject( + event, Executive, + KernelMode, 0, 0); + } + } } - } - } #line 206 - if (status >= 0) { + if (status >= 0) { #line 207 - if (myStatus >= 0) { + if (myStatus >= 0) { #line 208 - devExt__Started = 1; + devExt__Started = 1; #line 209 - devExt__Removed = 0; + devExt__Removed = 0; #line 210 - devExt__SurpriseRemoved = 0; + devExt__SurpriseRemoved = 0; + } } - } - { + { #line 218 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = + status; #line 219 - myStatus = status; + myStatus = status; #line 220 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 221 - IofCompleteRequest(Irp, 0); - } - goto switch_0_break; - switch_0_23: + IofCompleteRequest(Irp, 0); + } + goto switch_0_break; + switch_0_23: #line 225 - devExt__SurpriseRemoved = 1; + devExt__SurpriseRemoved = 1; #line 226 - if (s == NP) { + if (s == NP) { #line 227 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 230 - errorFn(); + errorFn(); + } } - } - { + { #line 234 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 235 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 236 - status = IofCallDriver(devExt__TopOfStack, - Irp); - } - goto switch_0_break; - switch_0_2: + status = IofCallDriver( + devExt__TopOfStack, Irp); + } + goto switch_0_break; + switch_0_2: #line 241 - devExt__Removed = 1; + devExt__Removed = 1; #line 242 - if (s == NP) { + if (s == NP) { #line 243 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 246 - errorFn(); + errorFn(); + } } - } - { + { #line 250 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 251 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 252 - IofCallDriver(devExt__TopOfStack, Irp); + IofCallDriver( + devExt__TopOfStack, Irp); #line 253 - status = 0; - } - goto switch_0_break; - switch_0_1: ; + status = 0; + } + goto switch_0_break; + switch_0_1:; #line 275 - if (s == NP) { + if (s == NP) { #line 276 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 279 - errorFn(); + errorFn(); + } } - } - { + { #line 283 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 284 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 285 - status = IofCallDriver(devExt__TopOfStack, - Irp); + status = IofCallDriver( + devExt__TopOfStack, Irp); + } + goto switch_0_break; + } else { + switch_0_break:; } - goto switch_0_break; - } else { - switch_0_break: ; } } } @@ -371,175 +378,171 @@ int KbFilter_PnP(int DeviceObject , int Irp ) } } } - } #line 314 - return (status); -} + return (status); + } } #line 317 "kbfiltr_simpl1.cil.c" -int main(void) -{ int status ; - int irp = __VERIFIER_nondet_int() ; - int pirp ; - int pirp__IoStatus__Status ; - int irp_choice = __VERIFIER_nondet_int() ; - int devobj = __VERIFIER_nondet_int() ; - int __cil_tmp8 ; +int main(void) { + int status; + int irp = __VERIFIER_nondet_int(); + int pirp; + int pirp__IoStatus__Status; + int irp_choice = __VERIFIER_nondet_int(); + int devobj = __VERIFIER_nondet_int(); + int __cil_tmp8; { - { -; -KernelMode = 0 ; - Executive = 0; -s = 0; -UNLOADED = 0; -NP = 0; - DC = 0; - SKIP1 = 0; - SKIP2 = 0; - MPR1 = 0; - MPR3 = 0; - IPC = 0; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - myStatus = 0; + { + ; + KernelMode = 0; + Executive = 0; + s = 0; + UNLOADED = 0; + NP = 0; + DC = 0; + SKIP1 = 0; + SKIP2 = 0; + MPR1 = 0; + MPR3 = 0; + IPC = 0; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + myStatus = 0; #line 328 - status = 0; + status = 0; #line 329 - pirp = irp; + pirp = irp; #line 330 - _BLAST_init(); - } + _BLAST_init(); + } #line 332 - if (status >= 0) { + if (status >= 0) { #line 333 - s = NP; + s = NP; #line 334 - customIrp = 0; + customIrp = 0; #line 335 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 336 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 337 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 338 - pended = compRegistered; + pended = compRegistered; #line 339 - pirp__IoStatus__Status = 0; + pirp__IoStatus__Status = 0; #line 340 - myStatus = 0; + myStatus = 0; #line 341 - if (irp_choice == 0) { + if (irp_choice == 0) { #line 342 - pirp__IoStatus__Status = -1073741637; + pirp__IoStatus__Status = -1073741637; #line 343 - myStatus = -1073741637; - } - { + myStatus = -1073741637; + } + { #line 348 - stub_driver_init(); - } - { + stub_driver_init(); + } + { #line 350 - if(status >= 0){ - __cil_tmp8 = 1; - } - else{ - __cil_tmp8 = 0; - } + if (status >= 0) { + __cil_tmp8 = 1; + } else { + __cil_tmp8 = 0; + } #line 350 - if (! __cil_tmp8) { + if (!__cil_tmp8) { #line 351 - return (-1); - } - } + return (-1); + } + } #line 355 - int tmp_ndt_1; - tmp_ndt_1 = __VERIFIER_nondet_int(); - if (tmp_ndt_1 == 3) { - goto switch_1_3; - } else { - goto switch_1_default; + int tmp_ndt_1; + tmp_ndt_1 = __VERIFIER_nondet_int(); + if (tmp_ndt_1 == 3) { + goto switch_1_3; + } else { + goto switch_1_default; #line 360 - if (0) { - switch_1_3: - { + if (0) { + switch_1_3 : { #line 363 - status = KbFilter_PnP(devobj, pirp); + status = KbFilter_PnP(devobj, pirp); } - goto switch_1_break; - switch_1_default: ; + goto switch_1_break; + switch_1_default:; #line 367 - return (-1); - } else { - switch_1_break: ; + return (-1); + } else { + switch_1_break:; + } } } - } #line 376 - if (pended == 1) { + if (pended == 1) { #line 377 - if (s == NP) { + if (s == NP) { #line 378 - s = NP; + s = NP; + } else { + goto _L___2; + } } else { - goto _L___2; - } - } else { - _L___2: + _L___2: #line 384 - if (pended == 1) { + if (pended == 1) { #line 385 - if (s == MPR3) { + if (s == MPR3) { #line 386 - s = MPR3; + s = MPR3; + } else { + goto _L___1; + } } else { - goto _L___1; - } - } else { - _L___1: + _L___1: #line 392 - if (s != UNLOADED) { + if (s != UNLOADED) { #line 395 - if (status != -1) { + if (status != -1) { #line 398 - if (s != SKIP2) { + if (s != SKIP2) { #line 399 - if (s != IPC) { + if (s != IPC) { #line 400 - if (s == DC) { + if (s == DC) { + goto _L___0; + } + } else { goto _L___0; } } else { - goto _L___0; - } - } else { - _L___0: + _L___0: #line 410 - if (pended == 1) { + if (pended == 1) { #line 411 - if (status != 259) { - { + if (status != 259) { + { #line 413 - errorFn(); + errorFn(); + } } - } - } else { + } else { #line 419 - if (s == DC) { + if (s == DC) { #line 420 - if (status == 259) { - - } - } else { + if (status == 259) { + } + } else { #line 426 - if (status != lowerDriverReturn) { - + if (status != lowerDriverReturn) { + } } } } @@ -547,225 +550,219 @@ NP = 0; } } } - } - return (status); -} + return (status); + } } #line 441 "kbfiltr_simpl1.cil.c" -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { #line 445 - if (s == NP) { + if (s == NP) { #line 446 - s = MPR1; - } else { - { + s = MPR1; + } else { + { #line 449 - errorFn(); + errorFn(); + } } - } #line 452 - return; -} + return; + } } #line 455 "kbfiltr_simpl1.cil.c" -int IofCallDriver(int DeviceObject , int Irp ) -{ - int returnVal2 ; - int compRetStatus ; - int lcontext = __VERIFIER_nondet_int() ; - long long __cil_tmp7 ; -; +int IofCallDriver(int DeviceObject, int Irp) { + int returnVal2; + int compRetStatus; + int lcontext = __VERIFIER_nondet_int(); + long long __cil_tmp7; + ; { #line 462 - if (compRegistered) { - compRetStatus = KbFilter_Complete(DeviceObject, Irp, lcontext); - stubMoreProcessingRequired(); - } + if (compRegistered) { + compRetStatus = KbFilter_Complete(DeviceObject, Irp, lcontext); + stubMoreProcessingRequired(); + } #line 476 - int tmp_ndt_2; - tmp_ndt_2 = __VERIFIER_nondet_int(); - if (tmp_ndt_2 == 0) { - goto switch_2_0; - } else { -#line 479 - int tmp_ndt_3; - tmp_ndt_3 = __VERIFIER_nondet_int(); - if (tmp_ndt_3 == 1) { - goto switch_2_1; + int tmp_ndt_2; + tmp_ndt_2 = __VERIFIER_nondet_int(); + if (tmp_ndt_2 == 0) { + goto switch_2_0; } else { - goto switch_2_default; +#line 479 + int tmp_ndt_3; + tmp_ndt_3 = __VERIFIER_nondet_int(); + if (tmp_ndt_3 == 1) { + goto switch_2_1; + } else { + goto switch_2_default; #line 484 - if (0) { - switch_2_0: + if (0) { + switch_2_0: #line 486 - returnVal2 = 0; - goto switch_2_break; - switch_2_1: + returnVal2 = 0; + goto switch_2_break; + switch_2_1: #line 489 - returnVal2 = -1073741823; - goto switch_2_break; - switch_2_default: + returnVal2 = -1073741823; + goto switch_2_break; + switch_2_default: #line 492 - returnVal2 = 259; - goto switch_2_break; - } else { - switch_2_break: ; + returnVal2 = 259; + goto switch_2_break; + } else { + switch_2_break:; + } } } - } #line 500 - if (s == NP) { + if (s == NP) { #line 501 - s = IPC; + s = IPC; #line 502 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 504 - if (s == MPR1) { + if (s == MPR1) { #line 505 - if (returnVal2 == 259) { + if (returnVal2 == 259) { #line 506 - s = MPR3; + s = MPR3; #line 507 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 509 - s = NP; + s = NP; #line 510 - lowerDriverReturn = returnVal2; - } - } else { + lowerDriverReturn = returnVal2; + } + } else { #line 513 - if (s == SKIP1) { + if (s == SKIP1) { #line 514 - s = SKIP2; + s = SKIP2; #line 515 - lowerDriverReturn = returnVal2; - } else { - { + lowerDriverReturn = returnVal2; + } else { + { #line 518 - errorFn(); + errorFn(); + } } } } - } #line 523 - return (returnVal2); -} + return (returnVal2); + } } #line 526 "kbfiltr_simpl1.cil.c" -void IofCompleteRequest(int Irp , int PriorityBoost ) -{ +void IofCompleteRequest(int Irp, int PriorityBoost) { { #line 530 - if (s == NP) { + if (s == NP) { #line 531 - s = DC; - } else { - { + s = DC; + } else { + { #line 534 - errorFn(); + errorFn(); + } } - } #line 537 - return; -} + return; + } } #line 540 "kbfiltr_simpl1.cil.c" -int KeSetEvent(int Event , int Increment , int Wait ) -{ int l = __VERIFIER_nondet_int() ; +int KeSetEvent(int Event, int Increment, int Wait) { + int l = __VERIFIER_nondet_int(); { #line 544 - setEventCalled = 1; + setEventCalled = 1; #line 545 - return (l); -} + return (l); + } } #line 548 "kbfiltr_simpl1.cil.c" -int KeWaitForSingleObject(int Object , int WaitReason , int WaitMode , int Alertable , - int Timeout ) -{ -; +int KeWaitForSingleObject(int Object, int WaitReason, int WaitMode, + int Alertable, int Timeout) { + ; { #line 553 - if (s == MPR3) { + if (s == MPR3) { #line 554 - if (setEventCalled == 1) { + if (setEventCalled == 1) { #line 555 - s = NP; + s = NP; #line 556 - setEventCalled = 0; + setEventCalled = 0; + } else { + goto _L; + } } else { - goto _L; - } - } else { - _L: + _L: #line 562 - if (customIrp == 1) { + if (customIrp == 1) { #line 563 - s = NP; + s = NP; #line 564 - customIrp = 0; - } else { + customIrp = 0; + } else { #line 566 - if (s == MPR3) { - { + if (s == MPR3) { + { #line 568 - errorFn(); + errorFn(); + } } } } - } #line 575 - int tmp_ndt_4; - tmp_ndt_4 = __VERIFIER_nondet_int(); - if (tmp_ndt_4 == 0) { - goto switch_3_0; - } else { - goto switch_3_default; + int tmp_ndt_4; + tmp_ndt_4 = __VERIFIER_nondet_int(); + if (tmp_ndt_4 == 0) { + goto switch_3_0; + } else { + goto switch_3_default; #line 580 - if (0) { - switch_3_0: + if (0) { + switch_3_0: #line 582 - return (0); - switch_3_default: ; + return (0); + switch_3_default:; #line 584 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 592 "kbfiltr_simpl1.cil.c" -int KbFilter_Complete(int DeviceObject , int Irp , int Context ) -{ int event ; +int KbFilter_Complete(int DeviceObject, int Irp, int Context) { + int event; { - { + { #line 597 - event = Context; + event = Context; #line 598 - KeSetEvent(event, 0, 0); - } + KeSetEvent(event, 0, 0); + } #line 600 - return (-1073741802); -} + return (-1073741802); + } } -void errorFn(void) -{ +void errorFn(void) { { - goto ERROR; - ERROR: assert(0); + goto ERROR; + ERROR: + assert(0); #line 23 - return; -} + return; + } } diff --git a/test/ntdrivers-simplified/kbfiltr_simpl2_false.cil.c b/test/ntdrivers-simplified/kbfiltr_simpl2_false.cil.c index 33b83447b..f30024171 100644 --- a/test/ntdrivers-simplified/kbfiltr_simpl2_false.cil.c +++ b/test/ntdrivers-simplified/kbfiltr_simpl2_false.cil.c @@ -6,350 +6,357 @@ extern char __VERIFIER_nondet_char(void); extern int __VERIFIER_nondet_int(void); extern long __VERIFIER_nondet_long(void); extern void *__VERIFIER_nondet_pointer(void); -void errorFn(void) ; -void IofCompleteRequest(int Irp , int PriorityBoost ); +void errorFn(void); +void IofCompleteRequest(int Irp, int PriorityBoost); extern int __VERIFIER_nondet_int(); -int KernelMode ; -int Executive ; -int DevicePowerState ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -int compFptr ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -int myStatus ; +int KernelMode; +int Executive; +int DevicePowerState; +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +int compFptr; +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +int myStatus; -void stub_driver_init(void) -{ +void stub_driver_init(void) { { #line 52 - s = NP; + s = NP; #line 53 - pended = 0; + pended = 0; #line 54 - compFptr = 0; + compFptr = 0; #line 55 - compRegistered = 0; + compRegistered = 0; #line 56 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 57 - setEventCalled = 0; + setEventCalled = 0; #line 58 - customIrp = 0; + customIrp = 0; #line 59 - return; -} + return; + } } #line 62 "kbfiltr_simpl2.cil.c" -void _BLAST_init(void) -{ +void _BLAST_init(void) { { #line 66 - UNLOADED = 0; + UNLOADED = 0; #line 67 - NP = 1; + NP = 1; #line 68 - DC = 2; + DC = 2; #line 69 - SKIP1 = 3; + SKIP1 = 3; #line 70 - SKIP2 = 4; + SKIP2 = 4; #line 71 - MPR1 = 5; + MPR1 = 5; #line 72 - MPR3 = 6; + MPR3 = 6; #line 73 - IPC = 7; + IPC = 7; #line 74 - s = UNLOADED; + s = UNLOADED; #line 75 - pended = 0; + pended = 0; #line 76 - compFptr = 0; + compFptr = 0; #line 77 - compRegistered = 0; + compRegistered = 0; #line 78 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 79 - setEventCalled = 0; + setEventCalled = 0; #line 80 - customIrp = 0; + customIrp = 0; #line 81 - return; -} + return; + } } #line 84 "kbfiltr_simpl2.cil.c" -int KbFilter_PnP(int DeviceObject , int Irp ) -{ int devExt ; - int irpStack ; - int status ; - int event = __VERIFIER_nondet_int() ; - int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int irpStack__MinorFunction = __VERIFIER_nondet_int() ; - int devExt__TopOfStack = __VERIFIER_nondet_int() ; - int devExt__Started ; - int devExt__Removed ; - int devExt__SurpriseRemoved ; - int Irp__IoStatus__Status ; - int Irp__IoStatus__Information ; - int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int irpSp ; - int nextIrpSp ; - int nextIrpSp__Control ; - int irpSp___0 ; - int irpSp__Context ; - int irpSp__Control ; - long __cil_tmp23 ; +int KbFilter_PnP(int DeviceObject, int Irp) { + int devExt; + int irpStack; + int status; + int event = __VERIFIER_nondet_int(); + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int irpStack__MinorFunction = __VERIFIER_nondet_int(); + int devExt__TopOfStack = __VERIFIER_nondet_int(); + int devExt__Started; + int devExt__Removed; + int devExt__SurpriseRemoved; + int Irp__IoStatus__Status; + int Irp__IoStatus__Information; + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int irpSp; + int nextIrpSp; + int nextIrpSp__Control; + int irpSp___0; + int irpSp__Context; + int irpSp__Control; + long __cil_tmp23; { #line 107 - status = 0; + status = 0; #line 108 - devExt = DeviceObject__DeviceExtension; + devExt = DeviceObject__DeviceExtension; #line 109 - irpStack = Irp__Tail__Overlay__CurrentStackLocation; + irpStack = Irp__Tail__Overlay__CurrentStackLocation; #line 110 - if (irpStack__MinorFunction == 0) { - goto switch_0_0; - } else { -#line 113 - if (irpStack__MinorFunction == 23) { - goto switch_0_23; + if (irpStack__MinorFunction == 0) { + goto switch_0_0; } else { -#line 116 - if (irpStack__MinorFunction == 2) { - goto switch_0_2; +#line 113 + if (irpStack__MinorFunction == 23) { + goto switch_0_23; } else { -#line 119 - if (irpStack__MinorFunction == 1) { - goto switch_0_1; +#line 116 + if (irpStack__MinorFunction == 2) { + goto switch_0_2; } else { -#line 122 - if (irpStack__MinorFunction == 5) { +#line 119 + if (irpStack__MinorFunction == 1) { goto switch_0_1; } else { -#line 125 - if (irpStack__MinorFunction == 3) { +#line 122 + if (irpStack__MinorFunction == 5) { goto switch_0_1; } else { -#line 128 - if (irpStack__MinorFunction == 6) { +#line 125 + if (irpStack__MinorFunction == 3) { goto switch_0_1; } else { -#line 131 - if (irpStack__MinorFunction == 13) { +#line 128 + if (irpStack__MinorFunction == 6) { goto switch_0_1; } else { -#line 134 - if (irpStack__MinorFunction == 4) { +#line 131 + if (irpStack__MinorFunction == 13) { goto switch_0_1; } else { -#line 137 - if (irpStack__MinorFunction == 7) { +#line 134 + if (irpStack__MinorFunction == 4) { goto switch_0_1; } else { -#line 140 - if (irpStack__MinorFunction == 8) { +#line 137 + if (irpStack__MinorFunction == 7) { goto switch_0_1; } else { -#line 143 - if (irpStack__MinorFunction == 9) { +#line 140 + if (irpStack__MinorFunction == 8) { goto switch_0_1; } else { -#line 146 - if (irpStack__MinorFunction == 12) { +#line 143 + if (irpStack__MinorFunction == 9) { goto switch_0_1; } else { -#line 149 - if (irpStack__MinorFunction == 10) { +#line 146 + if (irpStack__MinorFunction == 12) { goto switch_0_1; } else { -#line 152 - if (irpStack__MinorFunction == 11) { +#line 149 + if (irpStack__MinorFunction == 10) { goto switch_0_1; } else { -#line 155 - if (irpStack__MinorFunction == 15) { +#line 152 + if (irpStack__MinorFunction == 11) { goto switch_0_1; } else { -#line 158 - if (irpStack__MinorFunction == 16) { +#line 155 + if (irpStack__MinorFunction == 15) { goto switch_0_1; } else { -#line 161 - if (irpStack__MinorFunction == 17) { +#line 158 + if (irpStack__MinorFunction == 16) { goto switch_0_1; } else { -#line 164 - if (irpStack__MinorFunction == 18) { +#line 161 + if (irpStack__MinorFunction == 17) { goto switch_0_1; } else { -#line 167 - if (irpStack__MinorFunction == 19) { +#line 164 + if (irpStack__MinorFunction == 18) { goto switch_0_1; } else { -#line 170 - if (irpStack__MinorFunction == 20) { +#line 167 + if (irpStack__MinorFunction == 19) { goto switch_0_1; } else { - goto switch_0_1; +#line 170 + if (irpStack__MinorFunction == 20) { + goto switch_0_1; + } else { + goto switch_0_1; #line 175 - if (0) { - switch_0_0: + if (0) { + switch_0_0: #line 177 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = + Irp__Tail__Overlay__CurrentStackLocation; #line 178 - nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; + nextIrpSp = + Irp__Tail__Overlay__CurrentStackLocation - + 1; #line 179 - nextIrpSp__Control = 0; + nextIrpSp__Control = 0; #line 180 - if (s != NP) { - { -#line 182 - errorFn(); - } - } else { -#line 185 - if (compRegistered != 0) { + if (s != NP) { { -#line 187 - errorFn(); +#line 182 + errorFn(); } } else { +#line 185 + if (compRegistered != 0) { + { +#line 187 + errorFn(); + } + } else { #line 190 - compRegistered = 1; + compRegistered = 1; + } } - } - { + { #line 194 - irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation - 1; + irpSp___0 = + Irp__Tail__Overlay__CurrentStackLocation - + 1; #line 195 - irpSp__Context = event; + irpSp__Context = event; #line 196 - irpSp__Control = 224; + irpSp__Control = 224; #line 200 - status = IofCallDriver(devExt__TopOfStack, - Irp); - } - { + status = IofCallDriver( + devExt__TopOfStack, Irp); + } + { #line 203 - __cil_tmp23 = (long )status; + __cil_tmp23 = (long)status; #line 203 - if (__cil_tmp23 == 259) { - { + if (__cil_tmp23 == 259) { + { #line 205 - KeWaitForSingleObject(event, Executive, - KernelMode, - 0, 0); + KeWaitForSingleObject( + event, Executive, + KernelMode, 0, 0); + } + } } - } - } #line 212 - if (status >= 0) { + if (status >= 0) { #line 213 - if (myStatus >= 0) { + if (myStatus >= 0) { #line 214 - devExt__Started = 1; + devExt__Started = 1; #line 215 - devExt__Removed = 0; + devExt__Removed = 0; #line 216 - devExt__SurpriseRemoved = 0; + devExt__SurpriseRemoved = 0; + } } - } - { + { #line 224 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = + status; #line 225 - myStatus = status; + myStatus = status; #line 226 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 227 - IofCompleteRequest(Irp, 0); - } - goto switch_0_break; - switch_0_23: + IofCompleteRequest(Irp, 0); + } + goto switch_0_break; + switch_0_23: #line 231 - devExt__SurpriseRemoved = 1; + devExt__SurpriseRemoved = 1; #line 232 - if (s == NP) { + if (s == NP) { #line 233 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 236 - errorFn(); + errorFn(); + } } - } - { + { #line 240 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 241 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 242 - status = IofCallDriver(devExt__TopOfStack, - Irp); - } - goto switch_0_break; - switch_0_2: + status = IofCallDriver( + devExt__TopOfStack, Irp); + } + goto switch_0_break; + switch_0_2: #line 247 - devExt__Removed = 1; + devExt__Removed = 1; #line 248 - if (s == NP) { + if (s == NP) { #line 249 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 252 - errorFn(); + errorFn(); + } } - } - { + { #line 256 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 257 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 258 - IofCallDriver(devExt__TopOfStack, Irp); + IofCallDriver( + devExt__TopOfStack, Irp); #line 259 - status = 0; - } - goto switch_0_break; - switch_0_1: ; + status = 0; + } + goto switch_0_break; + switch_0_1:; #line 281 - if (s == NP) { + if (s == NP) { #line 282 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 285 - errorFn(); + errorFn(); + } } - } - { + { #line 289 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 290 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 291 - status = IofCallDriver(devExt__TopOfStack, - Irp); + status = IofCallDriver( + devExt__TopOfStack, Irp); + } + goto switch_0_break; + } else { + switch_0_break:; } - goto switch_0_break; - } else { - switch_0_break: ; } } } @@ -371,223 +378,216 @@ int KbFilter_PnP(int DeviceObject , int Irp ) } } } - } #line 320 - return (status); -} + return (status); + } } #line 323 "kbfiltr_simpl2.cil.c" -int main(void) -{ int status ; - int irp = __VERIFIER_nondet_int() ; - int pirp ; - int pirp__IoStatus__Status ; - int irp_choice = __VERIFIER_nondet_int() ; - int devobj = __VERIFIER_nondet_int() ; - int __cil_tmp8 ; +int main(void) { + int status; + int irp = __VERIFIER_nondet_int(); + int pirp; + int pirp__IoStatus__Status; + int irp_choice = __VERIFIER_nondet_int(); + int devobj = __VERIFIER_nondet_int(); + int __cil_tmp8; - KernelMode = 0; - Executive = 0; - DevicePowerState = 1; - s = 0; - UNLOADED = 0; - NP = 0; - DC = 0; - SKIP1 = 0; - SKIP2 = 0 ; - MPR1 = 0; - MPR3 = 0; - IPC = 0; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - myStatus = 0; + KernelMode = 0; + Executive = 0; + DevicePowerState = 1; + s = 0; + UNLOADED = 0; + NP = 0; + DC = 0; + SKIP1 = 0; + SKIP2 = 0; + MPR1 = 0; + MPR3 = 0; + IPC = 0; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + myStatus = 0; { - { + { #line 334 - status = 0; + status = 0; #line 335 - pirp = irp; + pirp = irp; #line 336 - _BLAST_init(); - } + _BLAST_init(); + } #line 338 - if (status >= 0) { + if (status >= 0) { #line 339 - s = NP; + s = NP; #line 340 - customIrp = 0; + customIrp = 0; #line 341 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 342 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 343 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 344 - pended = compRegistered; + pended = compRegistered; #line 345 - pirp__IoStatus__Status = 0; + pirp__IoStatus__Status = 0; #line 346 - myStatus = 0; + myStatus = 0; #line 347 - if (irp_choice == 0) { + if (irp_choice == 0) { #line 348 - pirp__IoStatus__Status = -1073741637; + pirp__IoStatus__Status = -1073741637; #line 349 - myStatus = -1073741637; - } - { + myStatus = -1073741637; + } + { #line 354 - stub_driver_init(); - } - { + stub_driver_init(); + } + { #line 356 #line 356 - if (status < 0) { + if (status < 0) { #line 357 - return (-1); - } - } + return (-1); + } + } #line 361 - int tmp_ndt_1; - tmp_ndt_1 = __VERIFIER_nondet_int(); - if (tmp_ndt_1 == 0) { - goto switch_1_0; - } else { -#line 364 - int tmp_ndt_2; - tmp_ndt_2 = __VERIFIER_nondet_int(); - if (tmp_ndt_2 == 1) { - goto switch_1_1; + int tmp_ndt_1; + tmp_ndt_1 = __VERIFIER_nondet_int(); + if (tmp_ndt_1 == 0) { + goto switch_1_0; } else { -#line 367 - int tmp_ndt_3; - tmp_ndt_3 = __VERIFIER_nondet_int(); - if (tmp_ndt_3 == 3) { - goto switch_1_3; +#line 364 + int tmp_ndt_2; + tmp_ndt_2 = __VERIFIER_nondet_int(); + if (tmp_ndt_2 == 1) { + goto switch_1_1; } else { -#line 370 - int tmp_ndt_4; - tmp_ndt_4 = __VERIFIER_nondet_int(); - if (tmp_ndt_4 == 4) { - goto switch_1_4; +#line 367 + int tmp_ndt_3; + tmp_ndt_3 = __VERIFIER_nondet_int(); + if (tmp_ndt_3 == 3) { + goto switch_1_3; } else { -#line 373 - int tmp_ndt_5; - tmp_ndt_5 = __VERIFIER_nondet_int(); - if (tmp_ndt_5 == 8) { - goto switch_1_8; +#line 370 + int tmp_ndt_4; + tmp_ndt_4 = __VERIFIER_nondet_int(); + if (tmp_ndt_4 == 4) { + goto switch_1_4; } else { - goto switch_1_default; +#line 373 + int tmp_ndt_5; + tmp_ndt_5 = __VERIFIER_nondet_int(); + if (tmp_ndt_5 == 8) { + goto switch_1_8; + } else { + goto switch_1_default; #line 378 - if (0) { - switch_1_0: - { + if (0) { + switch_1_0 : { #line 381 - status = KbFilter_CreateClose(devobj, pirp); + status = KbFilter_CreateClose(devobj, pirp); } - goto switch_1_break; - switch_1_1: - { + goto switch_1_break; + switch_1_1 : { #line 386 - status = KbFilter_CreateClose(devobj, pirp); + status = KbFilter_CreateClose(devobj, pirp); } - goto switch_1_break; - switch_1_3: - { + goto switch_1_break; + switch_1_3 : { #line 391 - status = KbFilter_PnP(devobj, pirp); + status = KbFilter_PnP(devobj, pirp); } - goto switch_1_break; - switch_1_4: - { + goto switch_1_break; + switch_1_4 : { #line 396 - status = KbFilter_Power(devobj, pirp); + status = KbFilter_Power(devobj, pirp); } - goto switch_1_break; - switch_1_8: - { + goto switch_1_break; + switch_1_8 : { #line 401 - status = KbFilter_InternIoCtl(devobj, pirp); + status = KbFilter_InternIoCtl(devobj, pirp); } - goto switch_1_break; - switch_1_default: ; + goto switch_1_break; + switch_1_default:; #line 405 - return (-1); - } else { - switch_1_break: ; + return (-1); + } else { + switch_1_break:; + } } } } } } } - } #line 418 - if (pended == 1) { + if (pended == 1) { #line 419 - if (s == NP) { + if (s == NP) { #line 420 - s = NP; + s = NP; + } else { + goto _L___2; + } } else { - goto _L___2; - } - } else { - _L___2: + _L___2: #line 426 - if (pended == 1) { + if (pended == 1) { #line 427 - if (s == MPR3) { + if (s == MPR3) { #line 428 - s = MPR3; + s = MPR3; + } else { + goto _L___1; + } } else { - goto _L___1; - } - } else { - _L___1: + _L___1: #line 434 - if (s != UNLOADED) { + if (s != UNLOADED) { #line 437 - if (status != -1) { + if (status != -1) { #line 440 - if (s != SKIP2) { + if (s != SKIP2) { #line 441 - if (s != IPC) { + if (s != IPC) { #line 442 - if (s == DC) { + if (s == DC) { + goto _L___0; + } + } else { goto _L___0; } } else { - goto _L___0; - } - } else { - _L___0: + _L___0: #line 452 - if (pended == 1) { + if (pended == 1) { #line 453 - if (status != 259) { - { + if (status != 259) { + { #line 455 - errorFn(); + errorFn(); + } } - } - } else { + } else { #line 461 - if (s == DC) { + if (s == DC) { #line 462 - if (status == 259) { - - } - } else { + if (status == 259) { + } + } else { #line 468 - if (status != lowerDriverReturn) { - errorFn(); - } - else{ + if (status != lowerDriverReturn) { + errorFn(); + } else { + } } } } @@ -595,740 +595,747 @@ int main(void) } } } - } #line 480 - return (status); -} + return (status); + } } #line 483 "kbfiltr_simpl2.cil.c" -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { #line 487 - if (s == NP) { + if (s == NP) { #line 488 - s = MPR1; - } else { - { + s = MPR1; + } else { + { #line 491 - errorFn(); + errorFn(); + } } - } #line 494 - return; -} + return; + } } #line 497 "kbfiltr_simpl2.cil.c" -int IofCallDriver(int DeviceObject , int Irp ) -{ - int returnVal2 ; - int compRetStatus ; - int lcontext = __VERIFIER_nondet_int() ; - long long __cil_tmp7 ; +int IofCallDriver(int DeviceObject, int Irp) { + int returnVal2; + int compRetStatus; + int lcontext = __VERIFIER_nondet_int(); + long long __cil_tmp7; { #line 504 - if (compRegistered) { - { + if (compRegistered) { + { #line 506 - compRetStatus = KbFilter_Complete(DeviceObject, Irp, lcontext); - } - { + compRetStatus = KbFilter_Complete(DeviceObject, Irp, lcontext); + } + { #line 508 - __cil_tmp7 = (long long )compRetStatus; + __cil_tmp7 = (long long)compRetStatus; #line 508 - if (__cil_tmp7 == -1073741802) { - { + if (__cil_tmp7 == -1073741802) { + { #line 510 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 518 - int tmp_ndt_6; - tmp_ndt_6 = __VERIFIER_nondet_int(); - if (tmp_ndt_6 == 0) { - goto switch_2_0; - } else { -#line 521 - int tmp_ndt_7; - tmp_ndt_7 = __VERIFIER_nondet_int(); - if (tmp_ndt_7 == 1) { - goto switch_2_1; + int tmp_ndt_6; + tmp_ndt_6 = __VERIFIER_nondet_int(); + if (tmp_ndt_6 == 0) { + goto switch_2_0; } else { - goto switch_2_default; +#line 521 + int tmp_ndt_7; + tmp_ndt_7 = __VERIFIER_nondet_int(); + if (tmp_ndt_7 == 1) { + goto switch_2_1; + } else { + goto switch_2_default; #line 526 - if (0) { - switch_2_0: + if (0) { + switch_2_0: #line 528 - returnVal2 = 0; - goto switch_2_break; - switch_2_1: + returnVal2 = 0; + goto switch_2_break; + switch_2_1: #line 531 - returnVal2 = -1073741823; - goto switch_2_break; - switch_2_default: + returnVal2 = -1073741823; + goto switch_2_break; + switch_2_default: #line 534 - returnVal2 = 259; - goto switch_2_break; - } else { - switch_2_break: ; + returnVal2 = 259; + goto switch_2_break; + } else { + switch_2_break:; + } } } - } #line 542 - if (s == NP) { + if (s == NP) { #line 543 - s = IPC; + s = IPC; #line 544 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 546 - if (s == MPR1) { + if (s == MPR1) { #line 547 - if (returnVal2 == 259) { + if (returnVal2 == 259) { #line 548 - s = MPR3; + s = MPR3; #line 549 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 551 - s = NP; + s = NP; #line 552 - lowerDriverReturn = returnVal2; - } - } else { + lowerDriverReturn = returnVal2; + } + } else { #line 555 - if (s == SKIP1) { + if (s == SKIP1) { #line 556 - s = SKIP2; + s = SKIP2; #line 557 - lowerDriverReturn = returnVal2; - } else { - { + lowerDriverReturn = returnVal2; + } else { + { #line 560 - errorFn(); + errorFn(); + } } } } - } #line 565 - return (returnVal2); -} + return (returnVal2); + } } #line 568 "kbfiltr_simpl2.cil.c" -void IofCompleteRequest(int Irp , int PriorityBoost ) -{ +void IofCompleteRequest(int Irp, int PriorityBoost) { { #line 572 - if (s == NP) { + if (s == NP) { #line 573 - s = DC; - } else { - { + s = DC; + } else { + { #line 576 - errorFn(); + errorFn(); + } } - } #line 579 - return; -} + return; + } } #line 582 "kbfiltr_simpl2.cil.c" -int KeSetEvent(int Event , int Increment , int Wait ) -{ int l = __VERIFIER_nondet_int() ; +int KeSetEvent(int Event, int Increment, int Wait) { + int l = __VERIFIER_nondet_int(); { #line 586 - setEventCalled = 1; + setEventCalled = 1; #line 587 - return (l); -} + return (l); + } } #line 590 "kbfiltr_simpl2.cil.c" -int KeWaitForSingleObject(int Object , int WaitReason , int WaitMode , int Alertable , - int Timeout ) -{ +int KeWaitForSingleObject(int Object, int WaitReason, int WaitMode, + int Alertable, int Timeout) { { #line 595 - if (s == MPR3) { + if (s == MPR3) { #line 596 - if (setEventCalled == 1) { + if (setEventCalled == 1) { #line 597 - s = NP; + s = NP; #line 598 - setEventCalled = 0; + setEventCalled = 0; + } else { + goto _L; + } } else { - goto _L; - } - } else { - _L: + _L: #line 604 - if (customIrp == 1) { + if (customIrp == 1) { #line 605 - s = NP; + s = NP; #line 606 - customIrp = 0; - } else { + customIrp = 0; + } else { #line 608 - if (s == MPR3) { - { + if (s == MPR3) { + { #line 610 - errorFn(); + errorFn(); + } } } } - } #line 617 - int tmp_ndt_8; - tmp_ndt_8 = __VERIFIER_nondet_int(); - if (tmp_ndt_8 == 0) { - goto switch_3_0; - } else { - goto switch_3_default; + int tmp_ndt_8; + tmp_ndt_8 = __VERIFIER_nondet_int(); + if (tmp_ndt_8 == 0) { + goto switch_3_0; + } else { + goto switch_3_default; #line 622 - if (0) { - switch_3_0: + if (0) { + switch_3_0: #line 624 - return (0); - switch_3_default: ; + return (0); + switch_3_default:; #line 626 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 634 "kbfiltr_simpl2.cil.c" -int KbFilter_Complete(int DeviceObject , int Irp , int Context ) -{ int event ; +int KbFilter_Complete(int DeviceObject, int Irp, int Context) { + int event; { - { + { #line 639 - event = Context; + event = Context; #line 640 - KeSetEvent(event, 0, 0); - } + KeSetEvent(event, 0, 0); + } #line 642 - return (-1073741802); -} + return (-1073741802); + } } #line 645 "kbfiltr_simpl2.cil.c" -int KbFilter_CreateClose(int DeviceObject , int Irp ) -{ int irpStack__MajorFunction = __VERIFIER_nondet_int() ; - int devExt__UpperConnectData__ClassService = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int status ; - int tmp ; +int KbFilter_CreateClose(int DeviceObject, int Irp) { + int irpStack__MajorFunction = __VERIFIER_nondet_int(); + int devExt__UpperConnectData__ClassService = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int status; + int tmp; { #line 653 - status = myStatus; + status = myStatus; #line 654 - if (irpStack__MajorFunction == 0) { - goto switch_4_0; - } else { -#line 657 - if (irpStack__MajorFunction == 2) { - goto switch_4_2; + if (irpStack__MajorFunction == 0) { + goto switch_4_0; } else { +#line 657 + if (irpStack__MajorFunction == 2) { + goto switch_4_2; + } else { #line 660 - if (0) { - switch_4_0: ; + if (0) { + switch_4_0:; #line 662 - if (devExt__UpperConnectData__ClassService == 0) { + if (devExt__UpperConnectData__ClassService == 0) { #line 663 - status = -1073741436; + status = -1073741436; + } + goto switch_4_break; + switch_4_2:; + goto switch_4_break; + } else { + switch_4_break:; } - goto switch_4_break; - switch_4_2: ; - goto switch_4_break; - } else { - switch_4_break: ; } } - } - { + { #line 676 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = status; #line 677 - myStatus = status; + myStatus = status; #line 678 - tmp = KbFilter_DispatchPassThrough(DeviceObject, Irp); - } + tmp = KbFilter_DispatchPassThrough(DeviceObject, Irp); + } #line 680 - return (tmp); -} + return (tmp); + } } #line 683 "kbfiltr_simpl2.cil.c" -int KbFilter_DispatchPassThrough(int DeviceObject , int Irp ) -{ int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int DeviceObject__DeviceExtension__TopOfStack = __VERIFIER_nondet_int() ; - int irpStack ; - int tmp ; +int KbFilter_DispatchPassThrough(int DeviceObject, int Irp) { + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int DeviceObject__DeviceExtension__TopOfStack = __VERIFIER_nondet_int(); + int irpStack; + int tmp; { #line 691 - irpStack = Irp__Tail__Overlay__CurrentStackLocation; + irpStack = Irp__Tail__Overlay__CurrentStackLocation; #line 692 - if (s == NP) { + if (s == NP) { #line 693 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 696 - errorFn(); + errorFn(); + } } - } - { + { #line 700 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 701 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 702 - tmp = IofCallDriver(DeviceObject__DeviceExtension__TopOfStack, Irp); - } + tmp = IofCallDriver(DeviceObject__DeviceExtension__TopOfStack, Irp); + } #line 704 - return (tmp); -} + return (tmp); + } } #line 707 "kbfiltr_simpl2.cil.c" -int KbFilter_Power(int DeviceObject , int Irp ) -{ int irpStack__MinorFunction = __VERIFIER_nondet_int() ; - int devExt__DeviceState ; - int powerState__DeviceState = __VERIFIER_nondet_int() ; - int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int devExt__TopOfStack = __VERIFIER_nondet_int() ; - int powerType = __VERIFIER_nondet_int() ; - int tmp ; +int KbFilter_Power(int DeviceObject, int Irp) { + int irpStack__MinorFunction = __VERIFIER_nondet_int(); + int devExt__DeviceState; + int powerState__DeviceState = __VERIFIER_nondet_int(); + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int devExt__TopOfStack = __VERIFIER_nondet_int(); + int powerType = __VERIFIER_nondet_int(); + int tmp; { #line 718 - if (irpStack__MinorFunction == 2) { - goto switch_5_2; - } else { -#line 721 - if (irpStack__MinorFunction == 1) { - goto switch_5_1; + if (irpStack__MinorFunction == 2) { + goto switch_5_2; } else { -#line 724 - if (irpStack__MinorFunction == 0) { - goto switch_5_0; +#line 721 + if (irpStack__MinorFunction == 1) { + goto switch_5_1; } else { -#line 727 - if (irpStack__MinorFunction == 3) { - goto switch_5_3; +#line 724 + if (irpStack__MinorFunction == 0) { + goto switch_5_0; } else { - goto switch_5_default; +#line 727 + if (irpStack__MinorFunction == 3) { + goto switch_5_3; + } else { + goto switch_5_default; #line 732 - if (0) { - switch_5_2: ; + if (0) { + switch_5_2:; #line 734 - if (powerType == DevicePowerState) { + if (powerType == DevicePowerState) { #line 735 - devExt__DeviceState = powerState__DeviceState; + devExt__DeviceState = powerState__DeviceState; + } + switch_5_1:; + switch_5_0:; + switch_5_3:; + switch_5_default:; + goto switch_5_break; + } else { + switch_5_break:; } - switch_5_1: ; - switch_5_0: ; - switch_5_3: ; - switch_5_default: ; - goto switch_5_break; - } else { - switch_5_break: ; } } } } - } #line 752 - if (s == NP) { + if (s == NP) { #line 753 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 756 - errorFn(); + errorFn(); + } } - } - { + { #line 760 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 761 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 762 - tmp = PoCallDriver(devExt__TopOfStack, Irp); - } + tmp = PoCallDriver(devExt__TopOfStack, Irp); + } #line 764 - return (tmp); -} + return (tmp); + } } #line 767 "kbfiltr_simpl2.cil.c" -int PoCallDriver(int DeviceObject , int Irp ) -{ - int compRetStatus ; - int returnVal ; - int lcontext = __VERIFIER_nondet_int() ; - unsigned long __cil_tmp7 ; - long __cil_tmp8 ; +int PoCallDriver(int DeviceObject, int Irp) { + int compRetStatus; + int returnVal; + int lcontext = __VERIFIER_nondet_int(); + unsigned long __cil_tmp7; + long __cil_tmp8; { #line 774 - if (compRegistered) { - { + if (compRegistered) { + { #line 776 - compRetStatus = KbFilter_Complete(DeviceObject, Irp, lcontext); - } - { + compRetStatus = KbFilter_Complete(DeviceObject, Irp, lcontext); + } + { #line 778 - __cil_tmp7 = (unsigned long )compRetStatus; + __cil_tmp7 = (unsigned long)compRetStatus; #line 778 - if (__cil_tmp7 == -1073741802) { - { + if (__cil_tmp7 == -1073741802) { + { #line 780 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 788 - int tmp_ndt_9; - tmp_ndt_9 = __VERIFIER_nondet_int(); - if (tmp_ndt_9 == 0) { - goto switch_6_0; - } else { -#line 791 - int tmp_ndt_10; - tmp_ndt_10 = __VERIFIER_nondet_int(); - if (tmp_ndt_10 == 1) { - goto switch_6_1; + int tmp_ndt_9; + tmp_ndt_9 = __VERIFIER_nondet_int(); + if (tmp_ndt_9 == 0) { + goto switch_6_0; } else { - goto switch_6_default; +#line 791 + int tmp_ndt_10; + tmp_ndt_10 = __VERIFIER_nondet_int(); + if (tmp_ndt_10 == 1) { + goto switch_6_1; + } else { + goto switch_6_default; #line 796 - if (0) { - switch_6_0: + if (0) { + switch_6_0: #line 798 - returnVal = 0; - goto switch_6_break; - switch_6_1: + returnVal = 0; + goto switch_6_break; + switch_6_1: #line 801 - returnVal = -1073741823; - goto switch_6_break; - switch_6_default: + returnVal = -1073741823; + goto switch_6_break; + switch_6_default: #line 804 - returnVal = 259; - goto switch_6_break; - } else { - switch_6_break: ; + returnVal = 259; + goto switch_6_break; + } else { + switch_6_break:; + } } } - } #line 812 - if (s == NP) { + if (s == NP) { #line 813 - s = IPC; + s = IPC; #line 814 - lowerDriverReturn = returnVal; - } else { + lowerDriverReturn = returnVal; + } else { #line 816 - if (s == MPR1) { - { + if (s == MPR1) { + { #line 817 - __cil_tmp8 = (long )returnVal; + __cil_tmp8 = (long)returnVal; #line 817 - if (__cil_tmp8 == 259L) { + if (__cil_tmp8 == 259L) { #line 818 - s = MPR3; + s = MPR3; #line 819 - lowerDriverReturn = returnVal; - } else { + lowerDriverReturn = returnVal; + } else { #line 821 - s = NP; + s = NP; #line 822 - lowerDriverReturn = returnVal; - } - } - } else { + lowerDriverReturn = returnVal; + } + } + } else { #line 825 - if (s == SKIP1) { + if (s == SKIP1) { #line 826 - s = SKIP2; + s = SKIP2; #line 827 - lowerDriverReturn = returnVal; - } else { - { + lowerDriverReturn = returnVal; + } else { + { #line 830 - errorFn(); + errorFn(); + } } } } - } #line 835 - return (returnVal); -} + return (returnVal); + } } #line 838 "kbfiltr_simpl2.cil.c" -int KbFilter_InternIoCtl(int DeviceObject , int Irp ) -{ int Irp__IoStatus__Information ; - int irpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; - int devExt__UpperConnectData__ClassService = __VERIFIER_nondet_int() ; - int irpStack__Parameters__DeviceIoControl__InputBufferLength = __VERIFIER_nondet_int() ; - int sizeof__CONNECT_DATA = __VERIFIER_nondet_int() ; - int irpStack__Parameters__DeviceIoControl__Type3InputBuffer = __VERIFIER_nondet_int() ; - int sizeof__INTERNAL_I8042_HOOK_KEYBOARD = __VERIFIER_nondet_int() ; - int hookKeyboard__InitializationRoutine = __VERIFIER_nondet_int() ; - int hookKeyboard__IsrRoutine = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int hookKeyboard ; - int connectData ; - int status ; - int tmp ; - int __cil_tmp17 ; - int __cil_tmp18 ; - int __cil_tmp19 ; - int __cil_tmp20 = __VERIFIER_nondet_int() ; - int __cil_tmp21 ; - int __cil_tmp22 ; - int __cil_tmp23 ; - int __cil_tmp24 = __VERIFIER_nondet_int() ; - int __cil_tmp25 ; - int __cil_tmp26 ; - int __cil_tmp27 ; - int __cil_tmp28 = __VERIFIER_nondet_int() ; - int __cil_tmp29 = __VERIFIER_nondet_int() ; - int __cil_tmp30 ; - int __cil_tmp31 ; - int __cil_tmp32 = __VERIFIER_nondet_int() ; - int __cil_tmp33 ; - int __cil_tmp34 ; - int __cil_tmp35 = __VERIFIER_nondet_int() ; - int __cil_tmp36 ; - int __cil_tmp37 ; - int __cil_tmp38 = __VERIFIER_nondet_int() ; - int __cil_tmp39 ; - int __cil_tmp40 ; - int __cil_tmp41 = __VERIFIER_nondet_int() ; - int __cil_tmp42 ; - int __cil_tmp43 ; - int __cil_tmp44 = __VERIFIER_nondet_int() ; - int __cil_tmp45 ; +int KbFilter_InternIoCtl(int DeviceObject, int Irp) { + int Irp__IoStatus__Information; + int irpStack__Parameters__DeviceIoControl__IoControlCode = + __VERIFIER_nondet_int(); + int devExt__UpperConnectData__ClassService = __VERIFIER_nondet_int(); + int irpStack__Parameters__DeviceIoControl__InputBufferLength = + __VERIFIER_nondet_int(); + int sizeof__CONNECT_DATA = __VERIFIER_nondet_int(); + int irpStack__Parameters__DeviceIoControl__Type3InputBuffer = + __VERIFIER_nondet_int(); + int sizeof__INTERNAL_I8042_HOOK_KEYBOARD = __VERIFIER_nondet_int(); + int hookKeyboard__InitializationRoutine = __VERIFIER_nondet_int(); + int hookKeyboard__IsrRoutine = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int hookKeyboard; + int connectData; + int status; + int tmp; + int __cil_tmp17; + int __cil_tmp18; + int __cil_tmp19; + int __cil_tmp20 = __VERIFIER_nondet_int(); + int __cil_tmp21; + int __cil_tmp22; + int __cil_tmp23; + int __cil_tmp24 = __VERIFIER_nondet_int(); + int __cil_tmp25; + int __cil_tmp26; + int __cil_tmp27; + int __cil_tmp28 = __VERIFIER_nondet_int(); + int __cil_tmp29 = __VERIFIER_nondet_int(); + int __cil_tmp30; + int __cil_tmp31; + int __cil_tmp32 = __VERIFIER_nondet_int(); + int __cil_tmp33; + int __cil_tmp34; + int __cil_tmp35 = __VERIFIER_nondet_int(); + int __cil_tmp36; + int __cil_tmp37; + int __cil_tmp38 = __VERIFIER_nondet_int(); + int __cil_tmp39; + int __cil_tmp40; + int __cil_tmp41 = __VERIFIER_nondet_int(); + int __cil_tmp42; + int __cil_tmp43; + int __cil_tmp44 = __VERIFIER_nondet_int(); + int __cil_tmp45; { #line 855 - status = 0; + status = 0; #line 856 - Irp__IoStatus__Information = 0; - { + Irp__IoStatus__Information = 0; + { #line 857 - //__cil_tmp17 = 128 << 2; +//__cil_tmp17 = 128 << 2; #line 857 - //__cil_tmp18 = 11 << 16; +//__cil_tmp18 = 11 << 16; #line 857 - //__cil_tmp19 = __cil_tmp18 | __cil_tmp17; +//__cil_tmp19 = __cil_tmp18 | __cil_tmp17; #line 857 - //__cil_tmp20 = __cil_tmp19 | 3; +//__cil_tmp20 = __cil_tmp19 | 3; #line 857 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp20) { - goto switch_7_exp_0; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp20) { + goto switch_7_exp_0; + } else { + { #line 860 - //__cil_tmp21 = 256 << 2; +//__cil_tmp21 = 256 << 2; #line 860 - //__cil_tmp22 = 11 << 16; +//__cil_tmp22 = 11 << 16; #line 860 - //__cil_tmp23 = __cil_tmp22 | __cil_tmp21; +//__cil_tmp23 = __cil_tmp22 | __cil_tmp21; #line 860 - //__cil_tmp24 = __cil_tmp23 | 3; +//__cil_tmp24 = __cil_tmp23 | 3; #line 860 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp24) { - goto switch_7_exp_1; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp24) { + goto switch_7_exp_1; + } else { + { #line 863 - //__cil_tmp25 = 4080 << 2; +//__cil_tmp25 = 4080 << 2; #line 863 - //__cil_tmp26 = 11 << 16; +//__cil_tmp26 = 11 << 16; #line 863 - //__cil_tmp27 = __cil_tmp26 | __cil_tmp25; +//__cil_tmp27 = __cil_tmp26 | __cil_tmp25; #line 863 - //__cil_tmp28 = __cil_tmp27 | 3; +//__cil_tmp28 = __cil_tmp27 | 3; #line 863 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp28) { - goto switch_7_exp_2; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp28) { + goto switch_7_exp_2; + } else { + { #line 866 - //__cil_tmp29 = 11 << 16; +//__cil_tmp29 = 11 << 16; #line 866 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp29) { - goto switch_7_exp_3; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp29) { + goto switch_7_exp_3; + } else { + { #line 869 - //__cil_tmp30 = 32 << 2; +//__cil_tmp30 = 32 << 2; #line 869 - //__cil_tmp31 = 11 << 16; +//__cil_tmp31 = 11 << 16; #line 869 - //__cil_tmp32 = __cil_tmp31 | __cil_tmp30; +//__cil_tmp32 = __cil_tmp31 | __cil_tmp30; #line 869 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp32) { - goto switch_7_exp_4; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp32) { + goto switch_7_exp_4; + } else { + { #line 872 - //__cil_tmp33 = 16 << 2; +//__cil_tmp33 = 16 << 2; #line 872 - //__cil_tmp34 = 11 << 16; +//__cil_tmp34 = 11 << 16; #line 872 - //__cil_tmp35 = __cil_tmp34 | __cil_tmp33; +//__cil_tmp35 = __cil_tmp34 | __cil_tmp33; #line 872 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp35) { - goto switch_7_exp_5; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp35) { + goto switch_7_exp_5; + } else { + { #line 875 - //__cil_tmp36 = 2 << 2; +//__cil_tmp36 = 2 << 2; #line 875 - // __cil_tmp37 = 11 << 16; +// __cil_tmp37 = 11 << 16; #line 875 - //__cil_tmp38 = __cil_tmp37 | __cil_tmp36; +//__cil_tmp38 = __cil_tmp37 | __cil_tmp36; #line 875 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp38) { - goto switch_7_exp_6; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp38) { + goto switch_7_exp_6; + } else { + { #line 878 - // __cil_tmp39 = 8 << 2; +// __cil_tmp39 = 8 << 2; #line 878 - // __cil_tmp40 = 11 << 16; +// __cil_tmp40 = 11 << 16; #line 878 - // __cil_tmp41 = __cil_tmp40 | __cil_tmp39; +// __cil_tmp41 = __cil_tmp40 | __cil_tmp39; #line 878 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp41) { - goto switch_7_exp_7; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp41) { + goto switch_7_exp_7; + } else { + { #line 881 - // __cil_tmp42 = 1 << 2; +// __cil_tmp42 = 1 << 2; #line 881 - // __cil_tmp43 = 11 << 16; +// __cil_tmp43 = 11 << 16; #line 881 - // __cil_tmp44 = __cil_tmp43 | __cil_tmp42; +// __cil_tmp44 = __cil_tmp43 | __cil_tmp42; #line 881 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp44) { - goto switch_7_exp_8; - } else { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp44) { + goto switch_7_exp_8; + } else { #line 884 - if (0) { - switch_7_exp_0: ; + if (0) { + switch_7_exp_0:; #line 886 - if (devExt__UpperConnectData__ClassService != 0) { + if (devExt__UpperConnectData__ClassService != + 0) { #line 887 - status = -1073741757; - goto switch_7_break; - } else { + status = -1073741757; + goto switch_7_break; + } else { #line 890 - if (irpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CONNECT_DATA) { + if (irpStack__Parameters__DeviceIoControl__InputBufferLength < + sizeof__CONNECT_DATA) { #line 891 - status = -1073741811; - goto switch_7_break; - } - } + status = -1073741811; + goto switch_7_break; + } + } #line 897 - connectData = irpStack__Parameters__DeviceIoControl__Type3InputBuffer; - goto switch_7_break; - switch_7_exp_1: + connectData = + irpStack__Parameters__DeviceIoControl__Type3InputBuffer; + goto switch_7_break; + switch_7_exp_1: #line 900 - status = -1073741822; - goto switch_7_break; - switch_7_exp_2: ; + status = -1073741822; + goto switch_7_break; + switch_7_exp_2:; #line 903 - if (irpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__INTERNAL_I8042_HOOK_KEYBOARD) { + if (irpStack__Parameters__DeviceIoControl__InputBufferLength < + sizeof__INTERNAL_I8042_HOOK_KEYBOARD) { #line 904 - status = -1073741811; - goto switch_7_break; - } + status = -1073741811; + goto switch_7_break; + } #line 909 - hookKeyboard = irpStack__Parameters__DeviceIoControl__Type3InputBuffer; + hookKeyboard = + irpStack__Parameters__DeviceIoControl__Type3InputBuffer; #line 910 - if (hookKeyboard__InitializationRoutine) { - - } + if (hookKeyboard__InitializationRoutine) { + } #line 915 - if (hookKeyboard__IsrRoutine) { - - } + if (hookKeyboard__IsrRoutine) { + } #line 920 - status = 0; - goto switch_7_break; - switch_7_exp_3: ; - switch_7_exp_4: ; - switch_7_exp_5: ; - switch_7_exp_6: ; - switch_7_exp_7: ; - switch_7_exp_8: ; - goto switch_7_break; - } else { - switch_7_break: ; + status = 0; + goto switch_7_break; + switch_7_exp_3:; + switch_7_exp_4:; + switch_7_exp_5:; + switch_7_exp_6:; + switch_7_exp_7:; + switch_7_exp_8:; + goto switch_7_break; + } else { + switch_7_break:; + } + } + } + } + } + } + } + } + } + } } } - } } - } - } } } - } - } } } - } - } } } - } - } - } - { + { #line 941 #line 941 - if (status < 0) { - { + if (status < 0) { + { #line 943 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = status; #line 944 - myStatus = status; + myStatus = status; #line 945 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 947 - return (status); - } - } - { + return (status); + } + } + { #line 952 - tmp = KbFilter_DispatchPassThrough(DeviceObject, Irp); - } + tmp = KbFilter_DispatchPassThrough(DeviceObject, Irp); + } #line 954 - return (tmp); -} + return (tmp); + } } -void errorFn(void) -{ +void errorFn(void) { { - goto ERROR; - ERROR: assert(0); + goto ERROR; + ERROR: + assert(0); #line 29 - return; -} + return; + } } diff --git a/test/ntdrivers-simplified/kbfiltr_simpl2_true.cil.c b/test/ntdrivers-simplified/kbfiltr_simpl2_true.cil.c index 4a4c0d85f..0ad7b4a1f 100644 --- a/test/ntdrivers-simplified/kbfiltr_simpl2_true.cil.c +++ b/test/ntdrivers-simplified/kbfiltr_simpl2_true.cil.c @@ -7,349 +7,356 @@ extern int __VERIFIER_nondet_int(void); extern long __VERIFIER_nondet_long(void); extern void *__VERIFIER_nondet_pointer(void); extern int __VERIFIER_nondet_int(); -int KernelMode ; -int Executive ; -int DevicePowerState ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -int compFptr ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -int myStatus ; +int KernelMode; +int Executive; +int DevicePowerState; +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +int compFptr; +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +int myStatus; -void stub_driver_init(void) -{ +void stub_driver_init(void) { { #line 52 - s = NP; + s = NP; #line 53 - pended = 0; + pended = 0; #line 54 - compFptr = 0; + compFptr = 0; #line 55 - compRegistered = 0; + compRegistered = 0; #line 56 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 57 - setEventCalled = 0; + setEventCalled = 0; #line 58 - customIrp = 0; + customIrp = 0; #line 59 - return; -} + return; + } } #line 62 "kbfiltr_simpl2.cil.c" -void _BLAST_init(void) -{ +void _BLAST_init(void) { { #line 66 - UNLOADED = 0; + UNLOADED = 0; #line 67 - NP = 1; + NP = 1; #line 68 - DC = 2; + DC = 2; #line 69 - SKIP1 = 3; + SKIP1 = 3; #line 70 - SKIP2 = 4; + SKIP2 = 4; #line 71 - MPR1 = 5; + MPR1 = 5; #line 72 - MPR3 = 6; + MPR3 = 6; #line 73 - IPC = 7; + IPC = 7; #line 74 - s = UNLOADED; + s = UNLOADED; #line 75 - pended = 0; + pended = 0; #line 76 - compFptr = 0; + compFptr = 0; #line 77 - compRegistered = 0; + compRegistered = 0; #line 78 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 79 - setEventCalled = 0; + setEventCalled = 0; #line 80 - customIrp = 0; + customIrp = 0; #line 81 - return; -} + return; + } } #line 84 "kbfiltr_simpl2.cil.c" void IofCompleteRequest(int, int); void errorFn(void); -int KbFilter_PnP(int DeviceObject , int Irp ) -{ int devExt ; - int irpStack ; - int status ; - int event = __VERIFIER_nondet_int() ; - int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int irpStack__MinorFunction = __VERIFIER_nondet_int() ; - int devExt__TopOfStack = __VERIFIER_nondet_int() ; - int devExt__Started ; - int devExt__Removed ; - int devExt__SurpriseRemoved ; - int Irp__IoStatus__Status ; - int Irp__IoStatus__Information ; - int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int irpSp ; - int nextIrpSp ; - int nextIrpSp__Control ; - int irpSp___0 ; - int irpSp__Context ; - int irpSp__Control ; - long __cil_tmp23 ; +int KbFilter_PnP(int DeviceObject, int Irp) { + int devExt; + int irpStack; + int status; + int event = __VERIFIER_nondet_int(); + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int irpStack__MinorFunction = __VERIFIER_nondet_int(); + int devExt__TopOfStack = __VERIFIER_nondet_int(); + int devExt__Started; + int devExt__Removed; + int devExt__SurpriseRemoved; + int Irp__IoStatus__Status; + int Irp__IoStatus__Information; + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int irpSp; + int nextIrpSp; + int nextIrpSp__Control; + int irpSp___0; + int irpSp__Context; + int irpSp__Control; + long __cil_tmp23; { #line 107 - status = 0; + status = 0; #line 108 - devExt = DeviceObject__DeviceExtension; + devExt = DeviceObject__DeviceExtension; #line 109 - irpStack = Irp__Tail__Overlay__CurrentStackLocation; + irpStack = Irp__Tail__Overlay__CurrentStackLocation; #line 110 - if (irpStack__MinorFunction == 0) { - goto switch_0_0; - } else { -#line 113 - if (irpStack__MinorFunction == 23) { - goto switch_0_23; + if (irpStack__MinorFunction == 0) { + goto switch_0_0; } else { -#line 116 - if (irpStack__MinorFunction == 2) { - goto switch_0_2; +#line 113 + if (irpStack__MinorFunction == 23) { + goto switch_0_23; } else { -#line 119 - if (irpStack__MinorFunction == 1) { - goto switch_0_1; +#line 116 + if (irpStack__MinorFunction == 2) { + goto switch_0_2; } else { -#line 122 - if (irpStack__MinorFunction == 5) { +#line 119 + if (irpStack__MinorFunction == 1) { goto switch_0_1; } else { -#line 125 - if (irpStack__MinorFunction == 3) { +#line 122 + if (irpStack__MinorFunction == 5) { goto switch_0_1; } else { -#line 128 - if (irpStack__MinorFunction == 6) { +#line 125 + if (irpStack__MinorFunction == 3) { goto switch_0_1; } else { -#line 131 - if (irpStack__MinorFunction == 13) { +#line 128 + if (irpStack__MinorFunction == 6) { goto switch_0_1; } else { -#line 134 - if (irpStack__MinorFunction == 4) { +#line 131 + if (irpStack__MinorFunction == 13) { goto switch_0_1; } else { -#line 137 - if (irpStack__MinorFunction == 7) { +#line 134 + if (irpStack__MinorFunction == 4) { goto switch_0_1; } else { -#line 140 - if (irpStack__MinorFunction == 8) { +#line 137 + if (irpStack__MinorFunction == 7) { goto switch_0_1; } else { -#line 143 - if (irpStack__MinorFunction == 9) { +#line 140 + if (irpStack__MinorFunction == 8) { goto switch_0_1; } else { -#line 146 - if (irpStack__MinorFunction == 12) { +#line 143 + if (irpStack__MinorFunction == 9) { goto switch_0_1; } else { -#line 149 - if (irpStack__MinorFunction == 10) { +#line 146 + if (irpStack__MinorFunction == 12) { goto switch_0_1; } else { -#line 152 - if (irpStack__MinorFunction == 11) { +#line 149 + if (irpStack__MinorFunction == 10) { goto switch_0_1; } else { -#line 155 - if (irpStack__MinorFunction == 15) { +#line 152 + if (irpStack__MinorFunction == 11) { goto switch_0_1; } else { -#line 158 - if (irpStack__MinorFunction == 16) { +#line 155 + if (irpStack__MinorFunction == 15) { goto switch_0_1; } else { -#line 161 - if (irpStack__MinorFunction == 17) { +#line 158 + if (irpStack__MinorFunction == 16) { goto switch_0_1; } else { -#line 164 - if (irpStack__MinorFunction == 18) { +#line 161 + if (irpStack__MinorFunction == 17) { goto switch_0_1; } else { -#line 167 - if (irpStack__MinorFunction == 19) { +#line 164 + if (irpStack__MinorFunction == 18) { goto switch_0_1; } else { -#line 170 - if (irpStack__MinorFunction == 20) { +#line 167 + if (irpStack__MinorFunction == 19) { goto switch_0_1; } else { - goto switch_0_1; +#line 170 + if (irpStack__MinorFunction == 20) { + goto switch_0_1; + } else { + goto switch_0_1; #line 175 - if (0) { - switch_0_0: + if (0) { + switch_0_0: #line 177 - irpSp = Irp__Tail__Overlay__CurrentStackLocation; + irpSp = + Irp__Tail__Overlay__CurrentStackLocation; #line 178 - nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1; + nextIrpSp = + Irp__Tail__Overlay__CurrentStackLocation - + 1; #line 179 - nextIrpSp__Control = 0; + nextIrpSp__Control = 0; #line 180 - if (s != NP) { - { -#line 182 - errorFn(); - } - } else { -#line 185 - if (compRegistered != 0) { + if (s != NP) { { -#line 187 - errorFn(); +#line 182 + errorFn(); } } else { +#line 185 + if (compRegistered != 0) { + { +#line 187 + errorFn(); + } + } else { #line 190 - compRegistered = 1; + compRegistered = 1; + } } - } - { + { #line 194 - irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation - 1; + irpSp___0 = + Irp__Tail__Overlay__CurrentStackLocation - + 1; #line 195 - irpSp__Context = event; + irpSp__Context = event; #line 196 - irpSp__Control = 224; + irpSp__Control = 224; #line 200 - status = IofCallDriver(devExt__TopOfStack, - Irp); - } - { + status = IofCallDriver( + devExt__TopOfStack, Irp); + } + { #line 203 - __cil_tmp23 = (long )status; + __cil_tmp23 = (long)status; #line 203 - if (__cil_tmp23 == 259) { - { + if (__cil_tmp23 == 259) { + { #line 205 - KeWaitForSingleObject(event, Executive, - KernelMode, - 0, 0); + KeWaitForSingleObject( + event, Executive, + KernelMode, 0, 0); + } + } } - } - } #line 212 - if (status >= 0) { + if (status >= 0) { #line 213 - if (myStatus >= 0) { + if (myStatus >= 0) { #line 214 - devExt__Started = 1; + devExt__Started = 1; #line 215 - devExt__Removed = 0; + devExt__Removed = 0; #line 216 - devExt__SurpriseRemoved = 0; + devExt__SurpriseRemoved = 0; + } } - } - { + { #line 224 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = + status; #line 225 - myStatus = status; + myStatus = status; #line 226 - Irp__IoStatus__Information = 0; + Irp__IoStatus__Information = + 0; #line 227 - IofCompleteRequest(Irp, 0); - } - goto switch_0_break; - switch_0_23: + IofCompleteRequest(Irp, 0); + } + goto switch_0_break; + switch_0_23: #line 231 - devExt__SurpriseRemoved = 1; + devExt__SurpriseRemoved = 1; #line 232 - if (s == NP) { + if (s == NP) { #line 233 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 236 - errorFn(); + errorFn(); + } } - } - { + { #line 240 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 241 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 242 - status = IofCallDriver(devExt__TopOfStack, - Irp); - } - goto switch_0_break; - switch_0_2: + status = IofCallDriver( + devExt__TopOfStack, Irp); + } + goto switch_0_break; + switch_0_2: #line 247 - devExt__Removed = 1; + devExt__Removed = 1; #line 248 - if (s == NP) { + if (s == NP) { #line 249 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 252 - errorFn(); + errorFn(); + } } - } - { + { #line 256 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 257 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 258 - IofCallDriver(devExt__TopOfStack, Irp); + IofCallDriver( + devExt__TopOfStack, Irp); #line 259 - status = 0; - } - goto switch_0_break; - switch_0_1: ; + status = 0; + } + goto switch_0_break; + switch_0_1:; #line 281 - if (s == NP) { + if (s == NP) { #line 282 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 285 - errorFn(); + errorFn(); + } } - } - { + { #line 289 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 290 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 291 - status = IofCallDriver(devExt__TopOfStack, - Irp); + status = IofCallDriver( + devExt__TopOfStack, Irp); + } + goto switch_0_break; + } else { + switch_0_break:; } - goto switch_0_break; - } else { - switch_0_break: ; } } } @@ -371,221 +378,214 @@ int KbFilter_PnP(int DeviceObject , int Irp ) } } } - } #line 320 - return (status); -} + return (status); + } } #line 323 "kbfiltr_simpl2.cil.c" -int main(void) -{ int status ; - int irp = __VERIFIER_nondet_int() ; - int pirp ; - int pirp__IoStatus__Status ; - int irp_choice = __VERIFIER_nondet_int() ; - int devobj = __VERIFIER_nondet_int() ; - int __cil_tmp8 ; +int main(void) { + int status; + int irp = __VERIFIER_nondet_int(); + int pirp; + int pirp__IoStatus__Status; + int irp_choice = __VERIFIER_nondet_int(); + int devobj = __VERIFIER_nondet_int(); + int __cil_tmp8; - KernelMode = 0; - Executive = 0; - DevicePowerState = 1; - s = 0; - UNLOADED = 0; - NP = 0; - DC = 0; - SKIP1 = 0; - SKIP2 = 0 ; - MPR1 = 0; - MPR3 = 0; - IPC = 0; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - myStatus = 0; + KernelMode = 0; + Executive = 0; + DevicePowerState = 1; + s = 0; + UNLOADED = 0; + NP = 0; + DC = 0; + SKIP1 = 0; + SKIP2 = 0; + MPR1 = 0; + MPR3 = 0; + IPC = 0; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + myStatus = 0; { - { + { #line 334 - status = 0; + status = 0; #line 335 - pirp = irp; + pirp = irp; #line 336 - _BLAST_init(); - } + _BLAST_init(); + } #line 338 - if (status >= 0) { + if (status >= 0) { #line 339 - s = NP; + s = NP; #line 340 - customIrp = 0; + customIrp = 0; #line 341 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 342 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 343 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 344 - pended = compRegistered; + pended = compRegistered; #line 345 - pirp__IoStatus__Status = 0; + pirp__IoStatus__Status = 0; #line 346 - myStatus = 0; + myStatus = 0; #line 347 - if (irp_choice == 0) { + if (irp_choice == 0) { #line 348 - pirp__IoStatus__Status = -1073741637; + pirp__IoStatus__Status = -1073741637; #line 349 - myStatus = -1073741637; - } - { + myStatus = -1073741637; + } + { #line 354 - stub_driver_init(); - } - { + stub_driver_init(); + } + { #line 356 #line 356 - if (status < 0) { + if (status < 0) { #line 357 - return (-1); - } - } + return (-1); + } + } #line 361 - int tmp_ndt_1; - tmp_ndt_1 = __VERIFIER_nondet_int(); - if (tmp_ndt_1 == 0) { - goto switch_1_0; - } else { -#line 364 - int tmp_ndt_2; - tmp_ndt_2 = __VERIFIER_nondet_int(); - if (tmp_ndt_2 == 1) { - goto switch_1_1; + int tmp_ndt_1; + tmp_ndt_1 = __VERIFIER_nondet_int(); + if (tmp_ndt_1 == 0) { + goto switch_1_0; } else { -#line 367 - int tmp_ndt_3; - tmp_ndt_3 = __VERIFIER_nondet_int(); - if (tmp_ndt_3 == 3) { - goto switch_1_3; +#line 364 + int tmp_ndt_2; + tmp_ndt_2 = __VERIFIER_nondet_int(); + if (tmp_ndt_2 == 1) { + goto switch_1_1; } else { -#line 370 - int tmp_ndt_4; - tmp_ndt_4 = __VERIFIER_nondet_int(); - if (tmp_ndt_4 == 4) { - goto switch_1_4; +#line 367 + int tmp_ndt_3; + tmp_ndt_3 = __VERIFIER_nondet_int(); + if (tmp_ndt_3 == 3) { + goto switch_1_3; } else { -#line 373 - int tmp_ndt_5; - tmp_ndt_5 = __VERIFIER_nondet_int(); - if (tmp_ndt_5 == 8) { - goto switch_1_8; +#line 370 + int tmp_ndt_4; + tmp_ndt_4 = __VERIFIER_nondet_int(); + if (tmp_ndt_4 == 4) { + goto switch_1_4; } else { - goto switch_1_default; +#line 373 + int tmp_ndt_5; + tmp_ndt_5 = __VERIFIER_nondet_int(); + if (tmp_ndt_5 == 8) { + goto switch_1_8; + } else { + goto switch_1_default; #line 378 - if (0) { - switch_1_0: - { + if (0) { + switch_1_0 : { #line 381 - status = KbFilter_CreateClose(devobj, pirp); + status = KbFilter_CreateClose(devobj, pirp); } - goto switch_1_break; - switch_1_1: - { + goto switch_1_break; + switch_1_1 : { #line 386 - status = KbFilter_CreateClose(devobj, pirp); + status = KbFilter_CreateClose(devobj, pirp); } - goto switch_1_break; - switch_1_3: - { + goto switch_1_break; + switch_1_3 : { #line 391 - status = KbFilter_PnP(devobj, pirp); + status = KbFilter_PnP(devobj, pirp); } - goto switch_1_break; - switch_1_4: - { + goto switch_1_break; + switch_1_4 : { #line 396 - status = KbFilter_Power(devobj, pirp); + status = KbFilter_Power(devobj, pirp); } - goto switch_1_break; - switch_1_8: - { + goto switch_1_break; + switch_1_8 : { #line 401 - status = KbFilter_InternIoCtl(devobj, pirp); + status = KbFilter_InternIoCtl(devobj, pirp); } - goto switch_1_break; - switch_1_default: ; + goto switch_1_break; + switch_1_default:; #line 405 - return (-1); - } else { - switch_1_break: ; + return (-1); + } else { + switch_1_break:; + } } } } } } } - } #line 418 - if (pended == 1) { + if (pended == 1) { #line 419 - if (s == NP) { + if (s == NP) { #line 420 - s = NP; + s = NP; + } else { + goto _L___2; + } } else { - goto _L___2; - } - } else { - _L___2: + _L___2: #line 426 - if (pended == 1) { + if (pended == 1) { #line 427 - if (s == MPR3) { + if (s == MPR3) { #line 428 - s = MPR3; + s = MPR3; + } else { + goto _L___1; + } } else { - goto _L___1; - } - } else { - _L___1: + _L___1: #line 434 - if (s != UNLOADED) { + if (s != UNLOADED) { #line 437 - if (status != -1) { + if (status != -1) { #line 440 - if (s != SKIP2) { + if (s != SKIP2) { #line 441 - if (s != IPC) { + if (s != IPC) { #line 442 - if (s == DC) { + if (s == DC) { + goto _L___0; + } + } else { goto _L___0; } } else { - goto _L___0; - } - } else { - _L___0: + _L___0: #line 452 - if (pended == 1) { + if (pended == 1) { #line 453 - if (status != 259) { - { + if (status != 259) { + { #line 455 - errorFn(); + errorFn(); + } } - } - } else { + } else { #line 461 - if (s == DC) { + if (s == DC) { #line 462 - if (status == 259) { - - } - } else { + if (status == 259) { + } + } else { #line 468 - if (status != lowerDriverReturn) { - + if (status != lowerDriverReturn) { + } } } } @@ -593,740 +593,747 @@ int main(void) } } } - } #line 480 - return (status); -} + return (status); + } } #line 483 "kbfiltr_simpl2.cil.c" -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { #line 487 - if (s == NP) { + if (s == NP) { #line 488 - s = MPR1; - } else { - { + s = MPR1; + } else { + { #line 491 - errorFn(); + errorFn(); + } } - } #line 494 - return; -} + return; + } } #line 497 "kbfiltr_simpl2.cil.c" -int IofCallDriver(int DeviceObject , int Irp ) -{ - int returnVal2 ; - int compRetStatus ; - int lcontext = __VERIFIER_nondet_int() ; - long long __cil_tmp7 ; +int IofCallDriver(int DeviceObject, int Irp) { + int returnVal2; + int compRetStatus; + int lcontext = __VERIFIER_nondet_int(); + long long __cil_tmp7; { #line 504 - if (compRegistered) { - { + if (compRegistered) { + { #line 506 - compRetStatus = KbFilter_Complete(DeviceObject, Irp, lcontext); - } - { + compRetStatus = KbFilter_Complete(DeviceObject, Irp, lcontext); + } + { #line 508 - __cil_tmp7 = (long long )compRetStatus; + __cil_tmp7 = (long long)compRetStatus; #line 508 - if (__cil_tmp7 == -1073741802) { - { + if (__cil_tmp7 == -1073741802) { + { #line 510 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 518 - int tmp_ndt_6; - tmp_ndt_6 = __VERIFIER_nondet_int(); - if (tmp_ndt_6 == 0) { - goto switch_2_0; - } else { -#line 521 - int tmp_ndt_7; - tmp_ndt_7 = __VERIFIER_nondet_int(); - if (tmp_ndt_7 == 1) { - goto switch_2_1; + int tmp_ndt_6; + tmp_ndt_6 = __VERIFIER_nondet_int(); + if (tmp_ndt_6 == 0) { + goto switch_2_0; } else { - goto switch_2_default; +#line 521 + int tmp_ndt_7; + tmp_ndt_7 = __VERIFIER_nondet_int(); + if (tmp_ndt_7 == 1) { + goto switch_2_1; + } else { + goto switch_2_default; #line 526 - if (0) { - switch_2_0: + if (0) { + switch_2_0: #line 528 - returnVal2 = 0; - goto switch_2_break; - switch_2_1: + returnVal2 = 0; + goto switch_2_break; + switch_2_1: #line 531 - returnVal2 = -1073741823; - goto switch_2_break; - switch_2_default: + returnVal2 = -1073741823; + goto switch_2_break; + switch_2_default: #line 534 - returnVal2 = 259; - goto switch_2_break; - } else { - switch_2_break: ; + returnVal2 = 259; + goto switch_2_break; + } else { + switch_2_break:; + } } } - } #line 542 - if (s == NP) { + if (s == NP) { #line 543 - s = IPC; + s = IPC; #line 544 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 546 - if (s == MPR1) { + if (s == MPR1) { #line 547 - if (returnVal2 == 259) { + if (returnVal2 == 259) { #line 548 - s = MPR3; + s = MPR3; #line 549 - lowerDriverReturn = returnVal2; - } else { + lowerDriverReturn = returnVal2; + } else { #line 551 - s = NP; + s = NP; #line 552 - lowerDriverReturn = returnVal2; - } - } else { + lowerDriverReturn = returnVal2; + } + } else { #line 555 - if (s == SKIP1) { + if (s == SKIP1) { #line 556 - s = SKIP2; + s = SKIP2; #line 557 - lowerDriverReturn = returnVal2; - } else { - { + lowerDriverReturn = returnVal2; + } else { + { #line 560 - errorFn(); + errorFn(); + } } } } - } #line 565 - return (returnVal2); -} + return (returnVal2); + } } #line 568 "kbfiltr_simpl2.cil.c" -void IofCompleteRequest(int Irp , int PriorityBoost ) -{ +void IofCompleteRequest(int Irp, int PriorityBoost) { { #line 572 - if (s == NP) { + if (s == NP) { #line 573 - s = DC; - } else { - { + s = DC; + } else { + { #line 576 - errorFn(); + errorFn(); + } } - } #line 579 - return; -} + return; + } } #line 582 "kbfiltr_simpl2.cil.c" -int KeSetEvent(int Event , int Increment , int Wait ) -{ int l = __VERIFIER_nondet_int() ; +int KeSetEvent(int Event, int Increment, int Wait) { + int l = __VERIFIER_nondet_int(); { #line 586 - setEventCalled = 1; + setEventCalled = 1; #line 587 - return (l); -} + return (l); + } } #line 590 "kbfiltr_simpl2.cil.c" -int KeWaitForSingleObject(int Object , int WaitReason , int WaitMode , int Alertable , - int Timeout ) -{ +int KeWaitForSingleObject(int Object, int WaitReason, int WaitMode, + int Alertable, int Timeout) { { #line 595 - if (s == MPR3) { + if (s == MPR3) { #line 596 - if (setEventCalled == 1) { + if (setEventCalled == 1) { #line 597 - s = NP; + s = NP; #line 598 - setEventCalled = 0; + setEventCalled = 0; + } else { + goto _L; + } } else { - goto _L; - } - } else { - _L: + _L: #line 604 - if (customIrp == 1) { + if (customIrp == 1) { #line 605 - s = NP; + s = NP; #line 606 - customIrp = 0; - } else { + customIrp = 0; + } else { #line 608 - if (s == MPR3) { - { + if (s == MPR3) { + { #line 610 - errorFn(); + errorFn(); + } } } } - } #line 617 - int tmp_ndt_8; - tmp_ndt_8 = __VERIFIER_nondet_int(); - if (tmp_ndt_8 == 0) { - goto switch_3_0; - } else { - goto switch_3_default; + int tmp_ndt_8; + tmp_ndt_8 = __VERIFIER_nondet_int(); + if (tmp_ndt_8 == 0) { + goto switch_3_0; + } else { + goto switch_3_default; #line 622 - if (0) { - switch_3_0: + if (0) { + switch_3_0: #line 624 - return (0); - switch_3_default: ; + return (0); + switch_3_default:; #line 626 - return (-1073741823); - } else { - + return (-1073741823); + } else { + } } } } -} #line 634 "kbfiltr_simpl2.cil.c" -int KbFilter_Complete(int DeviceObject , int Irp , int Context ) -{ int event ; +int KbFilter_Complete(int DeviceObject, int Irp, int Context) { + int event; { - { + { #line 639 - event = Context; + event = Context; #line 640 - KeSetEvent(event, 0, 0); - } + KeSetEvent(event, 0, 0); + } #line 642 - return (-1073741802); -} + return (-1073741802); + } } #line 645 "kbfiltr_simpl2.cil.c" -int KbFilter_CreateClose(int DeviceObject , int Irp ) -{ int irpStack__MajorFunction = __VERIFIER_nondet_int() ; - int devExt__UpperConnectData__ClassService = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int status ; - int tmp ; +int KbFilter_CreateClose(int DeviceObject, int Irp) { + int irpStack__MajorFunction = __VERIFIER_nondet_int(); + int devExt__UpperConnectData__ClassService = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int status; + int tmp; { #line 653 - status = myStatus; + status = myStatus; #line 654 - if (irpStack__MajorFunction == 0) { - goto switch_4_0; - } else { -#line 657 - if (irpStack__MajorFunction == 2) { - goto switch_4_2; + if (irpStack__MajorFunction == 0) { + goto switch_4_0; } else { +#line 657 + if (irpStack__MajorFunction == 2) { + goto switch_4_2; + } else { #line 660 - if (0) { - switch_4_0: ; + if (0) { + switch_4_0:; #line 662 - if (devExt__UpperConnectData__ClassService == 0) { + if (devExt__UpperConnectData__ClassService == 0) { #line 663 - status = -1073741436; + status = -1073741436; + } + goto switch_4_break; + switch_4_2:; + goto switch_4_break; + } else { + switch_4_break:; } - goto switch_4_break; - switch_4_2: ; - goto switch_4_break; - } else { - switch_4_break: ; } } - } - { + { #line 676 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = status; #line 677 - myStatus = status; + myStatus = status; #line 678 - tmp = KbFilter_DispatchPassThrough(DeviceObject, Irp); - } + tmp = KbFilter_DispatchPassThrough(DeviceObject, Irp); + } #line 680 - return (tmp); -} + return (tmp); + } } #line 683 "kbfiltr_simpl2.cil.c" -int KbFilter_DispatchPassThrough(int DeviceObject , int Irp ) -{ int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int DeviceObject__DeviceExtension__TopOfStack = __VERIFIER_nondet_int() ; - int irpStack ; - int tmp ; +int KbFilter_DispatchPassThrough(int DeviceObject, int Irp) { + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int DeviceObject__DeviceExtension__TopOfStack = __VERIFIER_nondet_int(); + int irpStack; + int tmp; { #line 691 - irpStack = Irp__Tail__Overlay__CurrentStackLocation; + irpStack = Irp__Tail__Overlay__CurrentStackLocation; #line 692 - if (s == NP) { + if (s == NP) { #line 693 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 696 - errorFn(); + errorFn(); + } } - } - { + { #line 700 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 701 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 702 - tmp = IofCallDriver(DeviceObject__DeviceExtension__TopOfStack, Irp); - } + tmp = IofCallDriver(DeviceObject__DeviceExtension__TopOfStack, Irp); + } #line 704 - return (tmp); -} + return (tmp); + } } #line 707 "kbfiltr_simpl2.cil.c" -int KbFilter_Power(int DeviceObject , int Irp ) -{ int irpStack__MinorFunction = __VERIFIER_nondet_int() ; - int devExt__DeviceState ; - int powerState__DeviceState = __VERIFIER_nondet_int() ; - int Irp__CurrentLocation = __VERIFIER_nondet_int() ; - int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; - int devExt__TopOfStack = __VERIFIER_nondet_int() ; - int powerType = __VERIFIER_nondet_int() ; - int tmp ; +int KbFilter_Power(int DeviceObject, int Irp) { + int irpStack__MinorFunction = __VERIFIER_nondet_int(); + int devExt__DeviceState; + int powerState__DeviceState = __VERIFIER_nondet_int(); + int Irp__CurrentLocation = __VERIFIER_nondet_int(); + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int(); + int devExt__TopOfStack = __VERIFIER_nondet_int(); + int powerType = __VERIFIER_nondet_int(); + int tmp; { #line 718 - if (irpStack__MinorFunction == 2) { - goto switch_5_2; - } else { -#line 721 - if (irpStack__MinorFunction == 1) { - goto switch_5_1; + if (irpStack__MinorFunction == 2) { + goto switch_5_2; } else { -#line 724 - if (irpStack__MinorFunction == 0) { - goto switch_5_0; +#line 721 + if (irpStack__MinorFunction == 1) { + goto switch_5_1; } else { -#line 727 - if (irpStack__MinorFunction == 3) { - goto switch_5_3; +#line 724 + if (irpStack__MinorFunction == 0) { + goto switch_5_0; } else { - goto switch_5_default; +#line 727 + if (irpStack__MinorFunction == 3) { + goto switch_5_3; + } else { + goto switch_5_default; #line 732 - if (0) { - switch_5_2: ; + if (0) { + switch_5_2:; #line 734 - if (powerType == DevicePowerState) { + if (powerType == DevicePowerState) { #line 735 - devExt__DeviceState = powerState__DeviceState; + devExt__DeviceState = powerState__DeviceState; + } + switch_5_1:; + switch_5_0:; + switch_5_3:; + switch_5_default:; + goto switch_5_break; + } else { + switch_5_break:; } - switch_5_1: ; - switch_5_0: ; - switch_5_3: ; - switch_5_default: ; - goto switch_5_break; - } else { - switch_5_break: ; } } } } - } #line 752 - if (s == NP) { + if (s == NP) { #line 753 - s = SKIP1; - } else { - { + s = SKIP1; + } else { + { #line 756 - errorFn(); + errorFn(); + } } - } - { + { #line 760 - Irp__CurrentLocation ++; + Irp__CurrentLocation++; #line 761 - Irp__Tail__Overlay__CurrentStackLocation ++; + Irp__Tail__Overlay__CurrentStackLocation++; #line 762 - tmp = PoCallDriver(devExt__TopOfStack, Irp); - } + tmp = PoCallDriver(devExt__TopOfStack, Irp); + } #line 764 - return (tmp); -} + return (tmp); + } } #line 767 "kbfiltr_simpl2.cil.c" -int PoCallDriver(int DeviceObject , int Irp ) -{ - int compRetStatus ; - int returnVal ; - int lcontext = __VERIFIER_nondet_int() ; - unsigned long __cil_tmp7 ; - long __cil_tmp8 ; +int PoCallDriver(int DeviceObject, int Irp) { + int compRetStatus; + int returnVal; + int lcontext = __VERIFIER_nondet_int(); + unsigned long __cil_tmp7; + long __cil_tmp8; { #line 774 - if (compRegistered) { - { + if (compRegistered) { + { #line 776 - compRetStatus = KbFilter_Complete(DeviceObject, Irp, lcontext); - } - { + compRetStatus = KbFilter_Complete(DeviceObject, Irp, lcontext); + } + { #line 778 - __cil_tmp7 = (unsigned long )compRetStatus; + __cil_tmp7 = (unsigned long)compRetStatus; #line 778 - if (__cil_tmp7 == -1073741802) { - { + if (__cil_tmp7 == -1073741802) { + { #line 780 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } } } - } - } #line 788 - int tmp_ndt_9; - tmp_ndt_9 = __VERIFIER_nondet_int(); - if (tmp_ndt_9 == 0) { - goto switch_6_0; - } else { -#line 791 - int tmp_ndt_10; - tmp_ndt_10 = __VERIFIER_nondet_int(); - if (tmp_ndt_10 == 1) { - goto switch_6_1; + int tmp_ndt_9; + tmp_ndt_9 = __VERIFIER_nondet_int(); + if (tmp_ndt_9 == 0) { + goto switch_6_0; } else { - goto switch_6_default; +#line 791 + int tmp_ndt_10; + tmp_ndt_10 = __VERIFIER_nondet_int(); + if (tmp_ndt_10 == 1) { + goto switch_6_1; + } else { + goto switch_6_default; #line 796 - if (0) { - switch_6_0: + if (0) { + switch_6_0: #line 798 - returnVal = 0; - goto switch_6_break; - switch_6_1: + returnVal = 0; + goto switch_6_break; + switch_6_1: #line 801 - returnVal = -1073741823; - goto switch_6_break; - switch_6_default: + returnVal = -1073741823; + goto switch_6_break; + switch_6_default: #line 804 - returnVal = 259; - goto switch_6_break; - } else { - switch_6_break: ; + returnVal = 259; + goto switch_6_break; + } else { + switch_6_break:; + } } } - } #line 812 - if (s == NP) { + if (s == NP) { #line 813 - s = IPC; + s = IPC; #line 814 - lowerDriverReturn = returnVal; - } else { + lowerDriverReturn = returnVal; + } else { #line 816 - if (s == MPR1) { - { + if (s == MPR1) { + { #line 817 - __cil_tmp8 = (long )returnVal; + __cil_tmp8 = (long)returnVal; #line 817 - if (__cil_tmp8 == 259L) { + if (__cil_tmp8 == 259L) { #line 818 - s = MPR3; + s = MPR3; #line 819 - lowerDriverReturn = returnVal; - } else { + lowerDriverReturn = returnVal; + } else { #line 821 - s = NP; + s = NP; #line 822 - lowerDriverReturn = returnVal; - } - } - } else { + lowerDriverReturn = returnVal; + } + } + } else { #line 825 - if (s == SKIP1) { + if (s == SKIP1) { #line 826 - s = SKIP2; + s = SKIP2; #line 827 - lowerDriverReturn = returnVal; - } else { - { + lowerDriverReturn = returnVal; + } else { + { #line 830 - errorFn(); + errorFn(); + } } } } - } #line 835 - return (returnVal); -} + return (returnVal); + } } #line 838 "kbfiltr_simpl2.cil.c" -int KbFilter_InternIoCtl(int DeviceObject , int Irp ) -{ int Irp__IoStatus__Information ; - int irpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; - int devExt__UpperConnectData__ClassService = __VERIFIER_nondet_int() ; - int irpStack__Parameters__DeviceIoControl__InputBufferLength = __VERIFIER_nondet_int() ; - int sizeof__CONNECT_DATA = __VERIFIER_nondet_int() ; - int irpStack__Parameters__DeviceIoControl__Type3InputBuffer = __VERIFIER_nondet_int() ; - int sizeof__INTERNAL_I8042_HOOK_KEYBOARD = __VERIFIER_nondet_int() ; - int hookKeyboard__InitializationRoutine = __VERIFIER_nondet_int() ; - int hookKeyboard__IsrRoutine = __VERIFIER_nondet_int() ; - int Irp__IoStatus__Status ; - int hookKeyboard ; - int connectData ; - int status ; - int tmp ; - int __cil_tmp17 ; - int __cil_tmp18 ; - int __cil_tmp19 ; - int __cil_tmp20 = __VERIFIER_nondet_int() ; - int __cil_tmp21 ; - int __cil_tmp22 ; - int __cil_tmp23 ; - int __cil_tmp24 = __VERIFIER_nondet_int() ; - int __cil_tmp25 ; - int __cil_tmp26 ; - int __cil_tmp27 ; - int __cil_tmp28 = __VERIFIER_nondet_int() ; - int __cil_tmp29 = __VERIFIER_nondet_int() ; - int __cil_tmp30 ; - int __cil_tmp31 ; - int __cil_tmp32 = __VERIFIER_nondet_int() ; - int __cil_tmp33 ; - int __cil_tmp34 ; - int __cil_tmp35 = __VERIFIER_nondet_int() ; - int __cil_tmp36 ; - int __cil_tmp37 ; - int __cil_tmp38 = __VERIFIER_nondet_int() ; - int __cil_tmp39 ; - int __cil_tmp40 ; - int __cil_tmp41 = __VERIFIER_nondet_int() ; - int __cil_tmp42 ; - int __cil_tmp43 ; - int __cil_tmp44 = __VERIFIER_nondet_int() ; - int __cil_tmp45 ; +int KbFilter_InternIoCtl(int DeviceObject, int Irp) { + int Irp__IoStatus__Information; + int irpStack__Parameters__DeviceIoControl__IoControlCode = + __VERIFIER_nondet_int(); + int devExt__UpperConnectData__ClassService = __VERIFIER_nondet_int(); + int irpStack__Parameters__DeviceIoControl__InputBufferLength = + __VERIFIER_nondet_int(); + int sizeof__CONNECT_DATA = __VERIFIER_nondet_int(); + int irpStack__Parameters__DeviceIoControl__Type3InputBuffer = + __VERIFIER_nondet_int(); + int sizeof__INTERNAL_I8042_HOOK_KEYBOARD = __VERIFIER_nondet_int(); + int hookKeyboard__InitializationRoutine = __VERIFIER_nondet_int(); + int hookKeyboard__IsrRoutine = __VERIFIER_nondet_int(); + int Irp__IoStatus__Status; + int hookKeyboard; + int connectData; + int status; + int tmp; + int __cil_tmp17; + int __cil_tmp18; + int __cil_tmp19; + int __cil_tmp20 = __VERIFIER_nondet_int(); + int __cil_tmp21; + int __cil_tmp22; + int __cil_tmp23; + int __cil_tmp24 = __VERIFIER_nondet_int(); + int __cil_tmp25; + int __cil_tmp26; + int __cil_tmp27; + int __cil_tmp28 = __VERIFIER_nondet_int(); + int __cil_tmp29 = __VERIFIER_nondet_int(); + int __cil_tmp30; + int __cil_tmp31; + int __cil_tmp32 = __VERIFIER_nondet_int(); + int __cil_tmp33; + int __cil_tmp34; + int __cil_tmp35 = __VERIFIER_nondet_int(); + int __cil_tmp36; + int __cil_tmp37; + int __cil_tmp38 = __VERIFIER_nondet_int(); + int __cil_tmp39; + int __cil_tmp40; + int __cil_tmp41 = __VERIFIER_nondet_int(); + int __cil_tmp42; + int __cil_tmp43; + int __cil_tmp44 = __VERIFIER_nondet_int(); + int __cil_tmp45; { #line 855 - status = 0; + status = 0; #line 856 - Irp__IoStatus__Information = 0; - { + Irp__IoStatus__Information = 0; + { #line 857 - //__cil_tmp17 = 128 << 2; +//__cil_tmp17 = 128 << 2; #line 857 - //__cil_tmp18 = 11 << 16; +//__cil_tmp18 = 11 << 16; #line 857 - //__cil_tmp19 = __cil_tmp18 | __cil_tmp17; +//__cil_tmp19 = __cil_tmp18 | __cil_tmp17; #line 857 - //__cil_tmp20 = __cil_tmp19 | 3; +//__cil_tmp20 = __cil_tmp19 | 3; #line 857 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp20) { - goto switch_7_exp_0; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp20) { + goto switch_7_exp_0; + } else { + { #line 860 - //__cil_tmp21 = 256 << 2; +//__cil_tmp21 = 256 << 2; #line 860 - //__cil_tmp22 = 11 << 16; +//__cil_tmp22 = 11 << 16; #line 860 - //__cil_tmp23 = __cil_tmp22 | __cil_tmp21; +//__cil_tmp23 = __cil_tmp22 | __cil_tmp21; #line 860 - //__cil_tmp24 = __cil_tmp23 | 3; +//__cil_tmp24 = __cil_tmp23 | 3; #line 860 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp24) { - goto switch_7_exp_1; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp24) { + goto switch_7_exp_1; + } else { + { #line 863 - //__cil_tmp25 = 4080 << 2; +//__cil_tmp25 = 4080 << 2; #line 863 - //__cil_tmp26 = 11 << 16; +//__cil_tmp26 = 11 << 16; #line 863 - //__cil_tmp27 = __cil_tmp26 | __cil_tmp25; +//__cil_tmp27 = __cil_tmp26 | __cil_tmp25; #line 863 - //__cil_tmp28 = __cil_tmp27 | 3; +//__cil_tmp28 = __cil_tmp27 | 3; #line 863 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp28) { - goto switch_7_exp_2; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp28) { + goto switch_7_exp_2; + } else { + { #line 866 - //__cil_tmp29 = 11 << 16; +//__cil_tmp29 = 11 << 16; #line 866 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp29) { - goto switch_7_exp_3; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp29) { + goto switch_7_exp_3; + } else { + { #line 869 - //__cil_tmp30 = 32 << 2; +//__cil_tmp30 = 32 << 2; #line 869 - //__cil_tmp31 = 11 << 16; +//__cil_tmp31 = 11 << 16; #line 869 - //__cil_tmp32 = __cil_tmp31 | __cil_tmp30; +//__cil_tmp32 = __cil_tmp31 | __cil_tmp30; #line 869 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp32) { - goto switch_7_exp_4; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp32) { + goto switch_7_exp_4; + } else { + { #line 872 - //__cil_tmp33 = 16 << 2; +//__cil_tmp33 = 16 << 2; #line 872 - //__cil_tmp34 = 11 << 16; +//__cil_tmp34 = 11 << 16; #line 872 - //__cil_tmp35 = __cil_tmp34 | __cil_tmp33; +//__cil_tmp35 = __cil_tmp34 | __cil_tmp33; #line 872 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp35) { - goto switch_7_exp_5; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp35) { + goto switch_7_exp_5; + } else { + { #line 875 - //__cil_tmp36 = 2 << 2; +//__cil_tmp36 = 2 << 2; #line 875 - // __cil_tmp37 = 11 << 16; +// __cil_tmp37 = 11 << 16; #line 875 - //__cil_tmp38 = __cil_tmp37 | __cil_tmp36; +//__cil_tmp38 = __cil_tmp37 | __cil_tmp36; #line 875 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp38) { - goto switch_7_exp_6; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp38) { + goto switch_7_exp_6; + } else { + { #line 878 - // __cil_tmp39 = 8 << 2; +// __cil_tmp39 = 8 << 2; #line 878 - // __cil_tmp40 = 11 << 16; +// __cil_tmp40 = 11 << 16; #line 878 - // __cil_tmp41 = __cil_tmp40 | __cil_tmp39; +// __cil_tmp41 = __cil_tmp40 | __cil_tmp39; #line 878 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp41) { - goto switch_7_exp_7; - } else { - { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp41) { + goto switch_7_exp_7; + } else { + { #line 881 - // __cil_tmp42 = 1 << 2; +// __cil_tmp42 = 1 << 2; #line 881 - // __cil_tmp43 = 11 << 16; +// __cil_tmp43 = 11 << 16; #line 881 - // __cil_tmp44 = __cil_tmp43 | __cil_tmp42; +// __cil_tmp44 = __cil_tmp43 | __cil_tmp42; #line 881 - if (irpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp44) { - goto switch_7_exp_8; - } else { + if (irpStack__Parameters__DeviceIoControl__IoControlCode == + __cil_tmp44) { + goto switch_7_exp_8; + } else { #line 884 - if (0) { - switch_7_exp_0: ; + if (0) { + switch_7_exp_0:; #line 886 - if (devExt__UpperConnectData__ClassService != 0) { + if (devExt__UpperConnectData__ClassService != + 0) { #line 887 - status = -1073741757; - goto switch_7_break; - } else { + status = -1073741757; + goto switch_7_break; + } else { #line 890 - if (irpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CONNECT_DATA) { + if (irpStack__Parameters__DeviceIoControl__InputBufferLength < + sizeof__CONNECT_DATA) { #line 891 - status = -1073741811; - goto switch_7_break; - } - } + status = -1073741811; + goto switch_7_break; + } + } #line 897 - connectData = irpStack__Parameters__DeviceIoControl__Type3InputBuffer; - goto switch_7_break; - switch_7_exp_1: + connectData = + irpStack__Parameters__DeviceIoControl__Type3InputBuffer; + goto switch_7_break; + switch_7_exp_1: #line 900 - status = -1073741822; - goto switch_7_break; - switch_7_exp_2: ; + status = -1073741822; + goto switch_7_break; + switch_7_exp_2:; #line 903 - if (irpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__INTERNAL_I8042_HOOK_KEYBOARD) { + if (irpStack__Parameters__DeviceIoControl__InputBufferLength < + sizeof__INTERNAL_I8042_HOOK_KEYBOARD) { #line 904 - status = -1073741811; - goto switch_7_break; - } + status = -1073741811; + goto switch_7_break; + } #line 909 - hookKeyboard = irpStack__Parameters__DeviceIoControl__Type3InputBuffer; + hookKeyboard = + irpStack__Parameters__DeviceIoControl__Type3InputBuffer; #line 910 - if (hookKeyboard__InitializationRoutine) { - - } + if (hookKeyboard__InitializationRoutine) { + } #line 915 - if (hookKeyboard__IsrRoutine) { - - } + if (hookKeyboard__IsrRoutine) { + } #line 920 - status = 0; - goto switch_7_break; - switch_7_exp_3: ; - switch_7_exp_4: ; - switch_7_exp_5: ; - switch_7_exp_6: ; - switch_7_exp_7: ; - switch_7_exp_8: ; - goto switch_7_break; - } else { - switch_7_break: ; + status = 0; + goto switch_7_break; + switch_7_exp_3:; + switch_7_exp_4:; + switch_7_exp_5:; + switch_7_exp_6:; + switch_7_exp_7:; + switch_7_exp_8:; + goto switch_7_break; + } else { + switch_7_break:; + } + } + } + } + } + } + } + } + } + } } } - } } - } - } } } - } - } } } - } - } } } - } - } - } - { + { #line 941 #line 941 - if (status < 0) { - { + if (status < 0) { + { #line 943 - Irp__IoStatus__Status = status; + Irp__IoStatus__Status = status; #line 944 - myStatus = status; + myStatus = status; #line 945 - IofCompleteRequest(Irp, 0); - } + IofCompleteRequest(Irp, 0); + } #line 947 - return (status); - } - } - { + return (status); + } + } + { #line 952 - tmp = KbFilter_DispatchPassThrough(DeviceObject, Irp); - } + tmp = KbFilter_DispatchPassThrough(DeviceObject, Irp); + } #line 954 - return (tmp); -} + return (tmp); + } } -void errorFn(void) -{ +void errorFn(void) { { - goto ERROR; - ERROR: assert(0); + goto ERROR; + ERROR: + assert(0); #line 29 - return; -} + return; + } } diff --git a/test/ntdrivers/cdaudio_true.i.cil.c b/test/ntdrivers/cdaudio_true.i.cil.c index cb9ff0e19..1607b4787 100644 --- a/test/ntdrivers/cdaudio_true.i.cil.c +++ b/test/ntdrivers/cdaudio_true.i.cil.c @@ -9,7 +9,7 @@ extern void *__VERIFIER_nondet_pointer(void); /* Generated by CIL v. 1.3.6 */ /* print_CIL_Input is true */ -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) typedef unsigned short wchar_t; typedef unsigned long ULONG_PTR; @@ -21,7 +21,7 @@ typedef short SHORT; typedef long LONG; typedef wchar_t WCHAR; typedef WCHAR *PWSTR; -typedef WCHAR const *PCWSTR; +typedef WCHAR const *PCWSTR; typedef CHAR *PCHAR; typedef LONG *PLONG; typedef unsigned char UCHAR; @@ -38,83 +38,80 @@ typedef LONG NTSTATUS; typedef long long LONGLONG; typedef unsigned long long ULONGLONG; struct __anonstruct____missing_field_name_1 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; struct __anonstruct_u_2 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; union _LARGE_INTEGER { - struct __anonstruct____missing_field_name_1 __annonCompField1 ; - struct __anonstruct_u_2 u ; - LONGLONG QuadPart ; + struct __anonstruct____missing_field_name_1 __annonCompField1; + struct __anonstruct_u_2 u; + LONGLONG QuadPart; }; typedef union _LARGE_INTEGER LARGE_INTEGER; typedef LARGE_INTEGER *PLARGE_INTEGER; struct __anonstruct____missing_field_name_3 { - ULONG LowPart ; - ULONG HighPart ; + ULONG LowPart; + ULONG HighPart; }; struct __anonstruct_u_4 { - ULONG LowPart ; - ULONG HighPart ; + ULONG LowPart; + ULONG HighPart; }; union _ULARGE_INTEGER { - struct __anonstruct____missing_field_name_3 __annonCompField2 ; - struct __anonstruct_u_4 u ; - ULONGLONG QuadPart ; + struct __anonstruct____missing_field_name_3 __annonCompField2; + struct __anonstruct_u_4 u; + ULONGLONG QuadPart; }; typedef union _ULARGE_INTEGER ULARGE_INTEGER; struct _LUID { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; typedef struct _LUID LUID; typedef LARGE_INTEGER PHYSICAL_ADDRESS; -enum _EVENT_TYPE { - NotificationEvent = 0, - SynchronizationEvent = 1 -} ; +enum _EVENT_TYPE { NotificationEvent = 0, SynchronizationEvent = 1 }; typedef enum _EVENT_TYPE EVENT_TYPE; -typedef char const *PCSZ; +typedef char const *PCSZ; struct _STRING { - USHORT Length ; - USHORT MaximumLength ; - PCHAR Buffer ; + USHORT Length; + USHORT MaximumLength; + PCHAR Buffer; }; typedef struct _STRING STRING; typedef STRING *PSTRING; typedef PSTRING PANSI_STRING; struct _UNICODE_STRING { - USHORT Length ; - USHORT MaximumLength ; - PWSTR Buffer ; + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; }; typedef struct _UNICODE_STRING UNICODE_STRING; typedef UNICODE_STRING *PUNICODE_STRING; typedef UCHAR BOOLEAN; struct _LIST_ENTRY { - struct _LIST_ENTRY *Flink ; - struct _LIST_ENTRY *Blink ; + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; }; typedef struct _LIST_ENTRY LIST_ENTRY; typedef struct _LIST_ENTRY *PLIST_ENTRY; struct _OBJECT_ATTRIBUTES { - ULONG Length ; - HANDLE RootDirectory ; - PUNICODE_STRING ObjectName ; - ULONG Attributes ; - PVOID SecurityDescriptor ; - PVOID SecurityQualityOfService ; + ULONG Length; + HANDLE RootDirectory; + PUNICODE_STRING ObjectName; + ULONG Attributes; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; }; typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES; typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; struct _GUID { - unsigned long Data1 ; - unsigned short Data2 ; - unsigned short Data3 ; - unsigned char Data4[8] ; + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; }; typedef struct _GUID GUID; typedef unsigned int size_t; @@ -132,83 +129,86 @@ typedef struct _OBJECT_TYPE *POBJECT_TYPE; typedef CCHAR KPROCESSOR_MODE; struct _KAPC; struct _KAPC; -typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ); +typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); struct _KAPC { - CSHORT Type ; - CSHORT Size ; - ULONG Spare0 ; - struct _KTHREAD *Thread ; - LIST_ENTRY ApcListEntry ; - void (*KernelRoutine)(struct _KAPC *Apc , PKNORMAL_ROUTINE *NormalRoutine , PVOID *NormalContext , - PVOID *SystemArgument1 , PVOID *SystemArgument2 ) ; - void (*RundownRoutine)(struct _KAPC *Apc ) ; - void (*NormalRoutine)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ) ; - PVOID NormalContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - CCHAR ApcStateIndex ; - KPROCESSOR_MODE ApcMode ; - BOOLEAN Inserted ; + CSHORT Type; + CSHORT Size; + ULONG Spare0; + struct _KTHREAD *Thread; + LIST_ENTRY ApcListEntry; + void (*KernelRoutine)(struct _KAPC *Apc, PKNORMAL_ROUTINE *NormalRoutine, + PVOID *NormalContext, PVOID *SystemArgument1, + PVOID *SystemArgument2); + void (*RundownRoutine)(struct _KAPC *Apc); + void (*NormalRoutine)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); + PVOID NormalContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + CCHAR ApcStateIndex; + KPROCESSOR_MODE ApcMode; + BOOLEAN Inserted; }; typedef struct _KAPC KAPC; struct _KDPC; struct _KDPC; struct _KDPC { - CSHORT Type ; - UCHAR Number ; - UCHAR Importance ; - LIST_ENTRY DpcListEntry ; - void (*DeferredRoutine)(struct _KDPC *Dpc , PVOID DeferredContext , PVOID SystemArgument1 , - PVOID SystemArgument2 ) ; - PVOID DeferredContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - PULONG_PTR Lock ; + CSHORT Type; + UCHAR Number; + UCHAR Importance; + LIST_ENTRY DpcListEntry; + void (*DeferredRoutine)(struct _KDPC *Dpc, PVOID DeferredContext, + PVOID SystemArgument1, PVOID SystemArgument2); + PVOID DeferredContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + PULONG_PTR Lock; }; typedef struct _KDPC KDPC; typedef struct _KDPC *PKDPC; typedef struct _KDPC *PRKDPC; struct _MDL { - struct _MDL *Next ; - CSHORT Size ; - CSHORT MdlFlags ; - struct _EPROCESS *Process ; - PVOID MappedSystemVa ; - PVOID StartVa ; - ULONG ByteCount ; - ULONG ByteOffset ; + struct _MDL *Next; + CSHORT Size; + CSHORT MdlFlags; + struct _EPROCESS *Process; + PVOID MappedSystemVa; + PVOID StartVa; + ULONG ByteCount; + ULONG ByteOffset; }; typedef struct _MDL MDL; typedef struct _MDL *PMDL; typedef PVOID PACCESS_TOKEN; typedef PVOID PSECURITY_DESCRIPTOR; typedef ULONG ACCESS_MASK; -#pragma pack(push,4) +#pragma pack(push, 4) struct _LUID_AND_ATTRIBUTES { - LUID Luid ; - ULONG Attributes ; + LUID Luid; + ULONG Attributes; }; typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES; #pragma pack(pop) struct _PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[1] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[1]; }; typedef struct _PRIVILEGE_SET PRIVILEGE_SET; enum _SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous = 0, - SecurityIdentification = 1, - SecurityImpersonation = 2, - SecurityDelegation = 3 -} ; + SecurityAnonymous = 0, + SecurityIdentification = 1, + SecurityImpersonation = 2, + SecurityDelegation = 3 +}; typedef enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL; typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE; struct _SECURITY_QUALITY_OF_SERVICE { - ULONG Length ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode ; - BOOLEAN EffectiveOnly ; + ULONG Length; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; + BOOLEAN EffectiveOnly; }; typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE; typedef ULONG SECURITY_INFORMATION; @@ -216,573 +216,570 @@ typedef LONG KPRIORITY; typedef ULONG_PTR KSPIN_LOCK; typedef KSPIN_LOCK *PKSPIN_LOCK; struct _RTL_QUERY_REGISTRY_TABLE { - NTSTATUS (*QueryRoutine)(PWSTR ValueName , ULONG ValueType , - PVOID ValueData , ULONG ValueLength , - PVOID Context , PVOID EntryContext ) ; - ULONG Flags ; - PWSTR Name ; - PVOID EntryContext ; - ULONG DefaultType ; - PVOID DefaultData ; - ULONG DefaultLength ; + NTSTATUS(*QueryRoutine) + (PWSTR ValueName, ULONG ValueType, PVOID ValueData, ULONG ValueLength, + PVOID Context, PVOID EntryContext); + ULONG Flags; + PWSTR Name; + PVOID EntryContext; + ULONG DefaultType; + PVOID DefaultData; + ULONG DefaultLength; }; typedef struct _RTL_QUERY_REGISTRY_TABLE RTL_QUERY_REGISTRY_TABLE; typedef struct _RTL_QUERY_REGISTRY_TABLE *PRTL_QUERY_REGISTRY_TABLE; union __anonunion____missing_field_name_6 { - NTSTATUS Status ; - PVOID Pointer ; + NTSTATUS Status; + PVOID Pointer; }; struct _IO_STATUS_BLOCK { - union __anonunion____missing_field_name_6 __annonCompField4 ; - ULONG_PTR Information ; + union __anonunion____missing_field_name_6 __annonCompField4; + ULONG_PTR Information; }; typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK; typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK; enum _FILE_INFORMATION_CLASS { - FileDirectoryInformation = 1, - FileFullDirectoryInformation = 2, - FileBothDirectoryInformation = 3, - FileBasicInformation = 4, - FileStandardInformation = 5, - FileInternalInformation = 6, - FileEaInformation = 7, - FileAccessInformation = 8, - FileNameInformation = 9, - FileRenameInformation = 10, - FileLinkInformation = 11, - FileNamesInformation = 12, - FileDispositionInformation = 13, - FilePositionInformation = 14, - FileFullEaInformation = 15, - FileModeInformation = 16, - FileAlignmentInformation = 17, - FileAllInformation = 18, - FileAllocationInformation = 19, - FileEndOfFileInformation = 20, - FileAlternateNameInformation = 21, - FileStreamInformation = 22, - FilePipeInformation = 23, - FilePipeLocalInformation = 24, - FilePipeRemoteInformation = 25, - FileMailslotQueryInformation = 26, - FileMailslotSetInformation = 27, - FileCompressionInformation = 28, - FileObjectIdInformation = 29, - FileCompletionInformation = 30, - FileMoveClusterInformation = 31, - FileQuotaInformation = 32, - FileReparsePointInformation = 33, - FileNetworkOpenInformation = 34, - FileAttributeTagInformation = 35, - FileTrackingInformation = 36, - FileMaximumInformation = 37 -} ; + FileDirectoryInformation = 1, + FileFullDirectoryInformation = 2, + FileBothDirectoryInformation = 3, + FileBasicInformation = 4, + FileStandardInformation = 5, + FileInternalInformation = 6, + FileEaInformation = 7, + FileAccessInformation = 8, + FileNameInformation = 9, + FileRenameInformation = 10, + FileLinkInformation = 11, + FileNamesInformation = 12, + FileDispositionInformation = 13, + FilePositionInformation = 14, + FileFullEaInformation = 15, + FileModeInformation = 16, + FileAlignmentInformation = 17, + FileAllInformation = 18, + FileAllocationInformation = 19, + FileEndOfFileInformation = 20, + FileAlternateNameInformation = 21, + FileStreamInformation = 22, + FilePipeInformation = 23, + FilePipeLocalInformation = 24, + FilePipeRemoteInformation = 25, + FileMailslotQueryInformation = 26, + FileMailslotSetInformation = 27, + FileCompressionInformation = 28, + FileObjectIdInformation = 29, + FileCompletionInformation = 30, + FileMoveClusterInformation = 31, + FileQuotaInformation = 32, + FileReparsePointInformation = 33, + FileNetworkOpenInformation = 34, + FileAttributeTagInformation = 35, + FileTrackingInformation = 36, + FileMaximumInformation = 37 +}; typedef enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS; struct _FILE_BASIC_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + ULONG FileAttributes; }; typedef struct _FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION; struct _FILE_STANDARD_INFORMATION { - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG NumberOfLinks ; - BOOLEAN DeletePending ; - BOOLEAN Directory ; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG NumberOfLinks; + BOOLEAN DeletePending; + BOOLEAN Directory; }; typedef struct _FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION; struct _FILE_NETWORK_OPEN_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG FileAttributes; }; typedef struct _FILE_NETWORK_OPEN_INFORMATION *PFILE_NETWORK_OPEN_INFORMATION; enum _FSINFOCLASS { - FileFsVolumeInformation = 1, - FileFsLabelInformation = 2, - FileFsSizeInformation = 3, - FileFsDeviceInformation = 4, - FileFsAttributeInformation = 5, - FileFsControlInformation = 6, - FileFsFullSizeInformation = 7, - FileFsObjectIdInformation = 8, - FileFsMaximumInformation = 9 -} ; + FileFsVolumeInformation = 1, + FileFsLabelInformation = 2, + FileFsSizeInformation = 3, + FileFsDeviceInformation = 4, + FileFsAttributeInformation = 5, + FileFsControlInformation = 6, + FileFsFullSizeInformation = 7, + FileFsObjectIdInformation = 8, + FileFsMaximumInformation = 9 +}; typedef enum _FSINFOCLASS FS_INFORMATION_CLASS; enum _INTERFACE_TYPE { - InterfaceTypeUndefined = -1, - Internal = 0, - Isa = 1, - Eisa = 2, - MicroChannel = 3, - TurboChannel = 4, - PCIBus = 5, - VMEBus = 6, - NuBus = 7, - PCMCIABus = 8, - CBus = 9, - MPIBus = 10, - MPSABus = 11, - ProcessorInternal = 12, - InternalPowerBus = 13, - PNPISABus = 14, - PNPBus = 15, - MaximumInterfaceType = 16 -} ; + InterfaceTypeUndefined = -1, + Internal = 0, + Isa = 1, + Eisa = 2, + MicroChannel = 3, + TurboChannel = 4, + PCIBus = 5, + VMEBus = 6, + NuBus = 7, + PCMCIABus = 8, + CBus = 9, + MPIBus = 10, + MPSABus = 11, + ProcessorInternal = 12, + InternalPowerBus = 13, + PNPISABus = 14, + PNPBus = 15, + MaximumInterfaceType = 16 +}; typedef enum _INTERFACE_TYPE INTERFACE_TYPE; typedef enum _INTERFACE_TYPE *PINTERFACE_TYPE; struct _KEY_VALUE_FULL_INFORMATION { - ULONG TitleIndex ; - ULONG Type ; - ULONG DataOffset ; - ULONG DataLength ; - ULONG NameLength ; - WCHAR Name[1] ; + ULONG TitleIndex; + ULONG Type; + ULONG DataOffset; + ULONG DataLength; + ULONG NameLength; + WCHAR Name[1]; }; typedef struct _KEY_VALUE_FULL_INFORMATION *PKEY_VALUE_FULL_INFORMATION; struct _CLIENT_ID { - HANDLE UniqueProcess ; - HANDLE UniqueThread ; + HANDLE UniqueProcess; + HANDLE UniqueThread; }; typedef struct _CLIENT_ID CLIENT_ID; typedef CLIENT_ID *PCLIENT_ID; enum _SYSTEM_POWER_STATE { - PowerSystemUnspecified = 0, - PowerSystemWorking = 1, - PowerSystemSleeping1 = 2, - PowerSystemSleeping2 = 3, - PowerSystemSleeping3 = 4, - PowerSystemHibernate = 5, - PowerSystemShutdown = 6, - PowerSystemMaximum = 7 -} ; + PowerSystemUnspecified = 0, + PowerSystemWorking = 1, + PowerSystemSleeping1 = 2, + PowerSystemSleeping2 = 3, + PowerSystemSleeping3 = 4, + PowerSystemHibernate = 5, + PowerSystemShutdown = 6, + PowerSystemMaximum = 7 +}; typedef enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE; enum __anonenum_POWER_ACTION_11 { - PowerActionNone = 0, - PowerActionReserved = 1, - PowerActionSleep = 2, - PowerActionHibernate = 3, - PowerActionShutdown = 4, - PowerActionShutdownReset = 5, - PowerActionShutdownOff = 6, - PowerActionWarmEject = 7 -} ; + PowerActionNone = 0, + PowerActionReserved = 1, + PowerActionSleep = 2, + PowerActionHibernate = 3, + PowerActionShutdown = 4, + PowerActionShutdownReset = 5, + PowerActionShutdownOff = 6, + PowerActionWarmEject = 7 +}; typedef enum __anonenum_POWER_ACTION_11 POWER_ACTION; enum _DEVICE_POWER_STATE { - PowerDeviceUnspecified = 0, - PowerDeviceD0 = 1, - PowerDeviceD1 = 2, - PowerDeviceD2 = 3, - PowerDeviceD3 = 4, - PowerDeviceMaximum = 5 -} ; + PowerDeviceUnspecified = 0, + PowerDeviceD0 = 1, + PowerDeviceD1 = 2, + PowerDeviceD2 = 3, + PowerDeviceD3 = 4, + PowerDeviceMaximum = 5 +}; typedef enum _DEVICE_POWER_STATE DEVICE_POWER_STATE; union _POWER_STATE { - SYSTEM_POWER_STATE SystemState ; - DEVICE_POWER_STATE DeviceState ; + SYSTEM_POWER_STATE SystemState; + DEVICE_POWER_STATE DeviceState; }; typedef union _POWER_STATE POWER_STATE; -enum _POWER_STATE_TYPE { - SystemPowerState = 0, - DevicePowerState = 1 -} ; +enum _POWER_STATE_TYPE { SystemPowerState = 0, DevicePowerState = 1 }; typedef enum _POWER_STATE_TYPE POWER_STATE_TYPE; typedef PVOID PASSIGNED_RESOURCE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Generic_16 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Port_17 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Interrupt_18 { - ULONG Level ; - ULONG Vector ; - ULONG Affinity ; + ULONG Level; + ULONG Vector; + ULONG Affinity; }; struct __anonstruct_Memory_19 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Dma_20 { - ULONG Channel ; - ULONG Port ; - ULONG Reserved1 ; + ULONG Channel; + ULONG Port; + ULONG Reserved1; }; struct __anonstruct_DevicePrivate_21 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_22 { - ULONG Start ; - ULONG Length ; - ULONG Reserved ; + ULONG Start; + ULONG Length; + ULONG Reserved; }; struct __anonstruct_DeviceSpecificData_23 { - ULONG DataSize ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG DataSize; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_15 { - struct __anonstruct_Generic_16 Generic ; - struct __anonstruct_Port_17 Port ; - struct __anonstruct_Interrupt_18 Interrupt ; - struct __anonstruct_Memory_19 Memory ; - struct __anonstruct_Dma_20 Dma ; - struct __anonstruct_DevicePrivate_21 DevicePrivate ; - struct __anonstruct_BusNumber_22 BusNumber ; - struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData ; + struct __anonstruct_Generic_16 Generic; + struct __anonstruct_Port_17 Port; + struct __anonstruct_Interrupt_18 Interrupt; + struct __anonstruct_Memory_19 Memory; + struct __anonstruct_Dma_20 Dma; + struct __anonstruct_DevicePrivate_21 DevicePrivate; + struct __anonstruct_BusNumber_22 BusNumber; + struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData; }; struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { - UCHAR Type ; - UCHAR ShareDisposition ; - USHORT Flags ; - union __anonunion_u_15 u ; + UCHAR Type; + UCHAR ShareDisposition; + USHORT Flags; + union __anonunion_u_15 u; }; typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR; #pragma pack(pop) struct _CM_PARTIAL_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; }; typedef struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST; struct _CM_FULL_RESOURCE_DESCRIPTOR { - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - CM_PARTIAL_RESOURCE_LIST PartialResourceList ; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; }; typedef struct _CM_FULL_RESOURCE_DESCRIPTOR CM_FULL_RESOURCE_DESCRIPTOR; struct _CM_RESOURCE_LIST { - ULONG Count ; - CM_FULL_RESOURCE_DESCRIPTOR List[1] ; + ULONG Count; + CM_FULL_RESOURCE_DESCRIPTOR List[1]; }; typedef struct _CM_RESOURCE_LIST *PCM_RESOURCE_LIST; -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct __anonstruct_Port_25 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Memory_26 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Interrupt_27 { - ULONG MinimumVector ; - ULONG MaximumVector ; + ULONG MinimumVector; + ULONG MaximumVector; }; struct __anonstruct_Dma_28 { - ULONG MinimumChannel ; - ULONG MaximumChannel ; + ULONG MinimumChannel; + ULONG MaximumChannel; }; struct __anonstruct_Generic_29 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_DevicePrivate_30 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_31 { - ULONG Length ; - ULONG MinBusNumber ; - ULONG MaxBusNumber ; - ULONG Reserved ; + ULONG Length; + ULONG MinBusNumber; + ULONG MaxBusNumber; + ULONG Reserved; }; struct __anonstruct_AssignedResource_32 { - PASSIGNED_RESOURCE AssignedResource ; + PASSIGNED_RESOURCE AssignedResource; }; struct __anonstruct_SubAllocateFrom_33 { - UCHAR Type ; - UCHAR Reserved[3] ; - PASSIGNED_RESOURCE AssignedResource ; - PHYSICAL_ADDRESS Transformation ; + UCHAR Type; + UCHAR Reserved[3]; + PASSIGNED_RESOURCE AssignedResource; + PHYSICAL_ADDRESS Transformation; }; struct __anonstruct_ConfigData_34 { - ULONG Priority ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG Priority; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_24 { - struct __anonstruct_Port_25 Port ; - struct __anonstruct_Memory_26 Memory ; - struct __anonstruct_Interrupt_27 Interrupt ; - struct __anonstruct_Dma_28 Dma ; - struct __anonstruct_Generic_29 Generic ; - struct __anonstruct_DevicePrivate_30 DevicePrivate ; - struct __anonstruct_BusNumber_31 BusNumber ; - struct __anonstruct_AssignedResource_32 AssignedResource ; - struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom ; - struct __anonstruct_ConfigData_34 ConfigData ; + struct __anonstruct_Port_25 Port; + struct __anonstruct_Memory_26 Memory; + struct __anonstruct_Interrupt_27 Interrupt; + struct __anonstruct_Dma_28 Dma; + struct __anonstruct_Generic_29 Generic; + struct __anonstruct_DevicePrivate_30 DevicePrivate; + struct __anonstruct_BusNumber_31 BusNumber; + struct __anonstruct_AssignedResource_32 AssignedResource; + struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom; + struct __anonstruct_ConfigData_34 ConfigData; }; struct _IO_RESOURCE_DESCRIPTOR { - UCHAR Option ; - UCHAR Type ; - UCHAR ShareDisposition ; - UCHAR Spare1 ; - USHORT Flags ; - USHORT Spare2 ; - union __anonunion_u_24 u ; + UCHAR Option; + UCHAR Type; + UCHAR ShareDisposition; + UCHAR Spare1; + USHORT Flags; + USHORT Spare2; + union __anonunion_u_24 u; }; typedef struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR; struct _IO_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - IO_RESOURCE_DESCRIPTOR Descriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + IO_RESOURCE_DESCRIPTOR Descriptors[1]; }; typedef struct _IO_RESOURCE_LIST IO_RESOURCE_LIST; struct _IO_RESOURCE_REQUIREMENTS_LIST { - ULONG ListSize ; - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - ULONG SlotNumber ; - ULONG Reserved[3] ; - ULONG AlternativeLists ; - IO_RESOURCE_LIST List[1] ; + ULONG ListSize; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + ULONG SlotNumber; + ULONG Reserved[3]; + ULONG AlternativeLists; + IO_RESOURCE_LIST List[1]; }; typedef struct _IO_RESOURCE_REQUIREMENTS_LIST *PIO_RESOURCE_REQUIREMENTS_LIST; enum _CONFIGURATION_TYPE { - ArcSystem = 0, - CentralProcessor = 1, - FloatingPointProcessor = 2, - PrimaryIcache = 3, - PrimaryDcache = 4, - SecondaryIcache = 5, - SecondaryDcache = 6, - SecondaryCache = 7, - EisaAdapter = 8, - TcAdapter = 9, - ScsiAdapter = 10, - DtiAdapter = 11, - MultiFunctionAdapter = 12, - DiskController = 13, - TapeController = 14, - CdromController = 15, - WormController = 16, - SerialController = 17, - NetworkController = 18, - DisplayController = 19, - ParallelController = 20, - PointerController = 21, - KeyboardController = 22, - AudioController = 23, - OtherController = 24, - DiskPeripheral = 25, - FloppyDiskPeripheral = 26, - TapePeripheral = 27, - ModemPeripheral = 28, - MonitorPeripheral = 29, - PrinterPeripheral = 30, - PointerPeripheral = 31, - KeyboardPeripheral = 32, - TerminalPeripheral = 33, - OtherPeripheral = 34, - LinePeripheral = 35, - NetworkPeripheral = 36, - SystemMemory = 37, - DockingInformation = 38, - RealModeIrqRoutingTable = 39, - MaximumType = 40 -} ; + ArcSystem = 0, + CentralProcessor = 1, + FloatingPointProcessor = 2, + PrimaryIcache = 3, + PrimaryDcache = 4, + SecondaryIcache = 5, + SecondaryDcache = 6, + SecondaryCache = 7, + EisaAdapter = 8, + TcAdapter = 9, + ScsiAdapter = 10, + DtiAdapter = 11, + MultiFunctionAdapter = 12, + DiskController = 13, + TapeController = 14, + CdromController = 15, + WormController = 16, + SerialController = 17, + NetworkController = 18, + DisplayController = 19, + ParallelController = 20, + PointerController = 21, + KeyboardController = 22, + AudioController = 23, + OtherController = 24, + DiskPeripheral = 25, + FloppyDiskPeripheral = 26, + TapePeripheral = 27, + ModemPeripheral = 28, + MonitorPeripheral = 29, + PrinterPeripheral = 30, + PointerPeripheral = 31, + KeyboardPeripheral = 32, + TerminalPeripheral = 33, + OtherPeripheral = 34, + LinePeripheral = 35, + NetworkPeripheral = 36, + SystemMemory = 37, + DockingInformation = 38, + RealModeIrqRoutingTable = 39, + MaximumType = 40 +}; typedef enum _CONFIGURATION_TYPE CONFIGURATION_TYPE; typedef enum _CONFIGURATION_TYPE *PCONFIGURATION_TYPE; enum _KWAIT_REASON { - Executive = 0, - FreePage = 1, - PageIn = 2, - PoolAllocation = 3, - DelayExecution = 4, - Suspended = 5, - UserRequest = 6, - WrExecutive = 7, - WrFreePage = 8, - WrPageIn = 9, - WrPoolAllocation = 10, - WrDelayExecution = 11, - WrSuspended = 12, - WrUserRequest = 13, - WrEventPair = 14, - WrQueue = 15, - WrLpcReceive = 16, - WrLpcReply = 17, - WrVirtualMemory = 18, - WrPageOut = 19, - WrRendezvous = 20, - Spare2 = 21, - Spare3 = 22, - Spare4 = 23, - Spare5 = 24, - Spare6 = 25, - WrKernel = 26, - MaximumWaitReason = 27 -} ; + Executive = 0, + FreePage = 1, + PageIn = 2, + PoolAllocation = 3, + DelayExecution = 4, + Suspended = 5, + UserRequest = 6, + WrExecutive = 7, + WrFreePage = 8, + WrPageIn = 9, + WrPoolAllocation = 10, + WrDelayExecution = 11, + WrSuspended = 12, + WrUserRequest = 13, + WrEventPair = 14, + WrQueue = 15, + WrLpcReceive = 16, + WrLpcReply = 17, + WrVirtualMemory = 18, + WrPageOut = 19, + WrRendezvous = 20, + Spare2 = 21, + Spare3 = 22, + Spare4 = 23, + Spare5 = 24, + Spare6 = 25, + WrKernel = 26, + MaximumWaitReason = 27 +}; typedef enum _KWAIT_REASON KWAIT_REASON; struct _DISPATCHER_HEADER { - UCHAR Type ; - UCHAR Absolute ; - UCHAR Size ; - UCHAR Inserted ; - LONG SignalState ; - LIST_ENTRY WaitListHead ; + UCHAR Type; + UCHAR Absolute; + UCHAR Size; + UCHAR Inserted; + LONG SignalState; + LIST_ENTRY WaitListHead; }; typedef struct _DISPATCHER_HEADER DISPATCHER_HEADER; struct _KDEVICE_QUEUE { - CSHORT Type ; - CSHORT Size ; - LIST_ENTRY DeviceListHead ; - KSPIN_LOCK Lock ; - BOOLEAN Busy ; + CSHORT Type; + CSHORT Size; + LIST_ENTRY DeviceListHead; + KSPIN_LOCK Lock; + BOOLEAN Busy; }; typedef struct _KDEVICE_QUEUE KDEVICE_QUEUE; struct _KDEVICE_QUEUE_ENTRY { - LIST_ENTRY DeviceListEntry ; - ULONG SortKey ; - BOOLEAN Inserted ; + LIST_ENTRY DeviceListEntry; + ULONG SortKey; + BOOLEAN Inserted; }; typedef struct _KDEVICE_QUEUE_ENTRY KDEVICE_QUEUE_ENTRY; struct _KEVENT { - DISPATCHER_HEADER Header ; + DISPATCHER_HEADER Header; }; typedef struct _KEVENT KEVENT; typedef struct _KEVENT *PKEVENT; typedef struct _KEVENT *PRKEVENT; struct _KSEMAPHORE { - DISPATCHER_HEADER Header ; - LONG Limit ; + DISPATCHER_HEADER Header; + LONG Limit; }; typedef struct _KSEMAPHORE *PKSEMAPHORE; typedef struct _KSEMAPHORE *PRKSEMAPHORE; struct _KTIMER { - DISPATCHER_HEADER Header ; - ULARGE_INTEGER DueTime ; - LIST_ENTRY TimerListEntry ; - struct _KDPC *Dpc ; - LONG Period ; + DISPATCHER_HEADER Header; + ULARGE_INTEGER DueTime; + LIST_ENTRY TimerListEntry; + struct _KDPC *Dpc; + LONG Period; }; typedef struct _KTIMER *PKTIMER; enum _MEMORY_CACHING_TYPE { - MmNonCached = 0, - MmCached = 1, - MmWriteCombined = 2, - MmHardwareCoherentCached = 3, - MmNonCachedUnordered = 4, - MmUSWCCached = 5, - MmMaximumCacheType = 6 -} ; + MmNonCached = 0, + MmCached = 1, + MmWriteCombined = 2, + MmHardwareCoherentCached = 3, + MmNonCachedUnordered = 4, + MmUSWCCached = 5, + MmMaximumCacheType = 6 +}; typedef enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE; enum _POOL_TYPE { - NonPagedPool = 0, - PagedPool = 1, - NonPagedPoolMustSucceed = 2, - DontUseThisType = 3, - NonPagedPoolCacheAligned = 4, - PagedPoolCacheAligned = 5, - NonPagedPoolCacheAlignedMustS = 6, - MaxPoolType = 7, - NonPagedPoolSession = 32, - PagedPoolSession = 33, - NonPagedPoolMustSucceedSession = 34, - DontUseThisTypeSession = 35, - NonPagedPoolCacheAlignedSession = 36, - PagedPoolCacheAlignedSession = 37, - NonPagedPoolCacheAlignedMustSSession = 38 -} ; + NonPagedPool = 0, + PagedPool = 1, + NonPagedPoolMustSucceed = 2, + DontUseThisType = 3, + NonPagedPoolCacheAligned = 4, + PagedPoolCacheAligned = 5, + NonPagedPoolCacheAlignedMustS = 6, + MaxPoolType = 7, + NonPagedPoolSession = 32, + PagedPoolSession = 33, + NonPagedPoolMustSucceedSession = 34, + DontUseThisTypeSession = 35, + NonPagedPoolCacheAlignedSession = 36, + PagedPoolCacheAlignedSession = 37, + NonPagedPoolCacheAlignedMustSSession = 38 +}; typedef enum _POOL_TYPE POOL_TYPE; struct _FAST_MUTEX { - LONG Count ; - PKTHREAD Owner ; - ULONG Contention ; - KEVENT Event ; - ULONG OldIrql ; + LONG Count; + PKTHREAD Owner; + ULONG Contention; + KEVENT Event; + ULONG OldIrql; }; typedef struct _FAST_MUTEX *PFAST_MUTEX; typedef ULONG_PTR ERESOURCE_THREAD; union __anonunion____missing_field_name_38 { - LONG OwnerCount ; - ULONG TableSize ; + LONG OwnerCount; + ULONG TableSize; }; struct _OWNER_ENTRY { - ERESOURCE_THREAD OwnerThread ; - union __anonunion____missing_field_name_38 __annonCompField10 ; + ERESOURCE_THREAD OwnerThread; + union __anonunion____missing_field_name_38 __annonCompField10; }; typedef struct _OWNER_ENTRY OWNER_ENTRY; typedef struct _OWNER_ENTRY *POWNER_ENTRY; union __anonunion____missing_field_name_39 { - PVOID Address ; - ULONG_PTR CreatorBackTraceIndex ; + PVOID Address; + ULONG_PTR CreatorBackTraceIndex; }; struct _ERESOURCE { - LIST_ENTRY SystemResourcesList ; - POWNER_ENTRY OwnerTable ; - SHORT ActiveCount ; - USHORT Flag ; - PKSEMAPHORE SharedWaiters ; - PKEVENT ExclusiveWaiters ; - OWNER_ENTRY OwnerThreads[2] ; - ULONG ContentionCount ; - USHORT NumberOfSharedWaiters ; - USHORT NumberOfExclusiveWaiters ; - union __anonunion____missing_field_name_39 __annonCompField11 ; - KSPIN_LOCK SpinLock ; + LIST_ENTRY SystemResourcesList; + POWNER_ENTRY OwnerTable; + SHORT ActiveCount; + USHORT Flag; + PKSEMAPHORE SharedWaiters; + PKEVENT ExclusiveWaiters; + OWNER_ENTRY OwnerThreads[2]; + ULONG ContentionCount; + USHORT NumberOfSharedWaiters; + USHORT NumberOfExclusiveWaiters; + union __anonunion____missing_field_name_39 __annonCompField11; + KSPIN_LOCK SpinLock; }; enum _MM_PAGE_PRIORITY { - LowPagePriority = 0, - NormalPagePriority = 16, - HighPagePriority = 32 -} ; + LowPagePriority = 0, + NormalPagePriority = 16, + HighPagePriority = 32 +}; typedef enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY; struct _DRIVER_OBJECT; struct _DRIVER_OBJECT; struct _SECURITY_SUBJECT_CONTEXT { - PACCESS_TOKEN ClientToken ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - PACCESS_TOKEN PrimaryToken ; - PVOID ProcessAuditId ; + PACCESS_TOKEN ClientToken; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + PACCESS_TOKEN PrimaryToken; + PVOID ProcessAuditId; }; typedef struct _SECURITY_SUBJECT_CONTEXT SECURITY_SUBJECT_CONTEXT; struct _INITIAL_PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[3] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[3]; }; typedef struct _INITIAL_PRIVILEGE_SET INITIAL_PRIVILEGE_SET; union __anonunion_Privileges_40 { - INITIAL_PRIVILEGE_SET InitialPrivilegeSet ; - PRIVILEGE_SET PrivilegeSet ; + INITIAL_PRIVILEGE_SET InitialPrivilegeSet; + PRIVILEGE_SET PrivilegeSet; }; struct _ACCESS_STATE { - LUID OperationID ; - BOOLEAN SecurityEvaluated ; - BOOLEAN GenerateAudit ; - BOOLEAN GenerateOnClose ; - BOOLEAN PrivilegesAllocated ; - ULONG Flags ; - ACCESS_MASK RemainingDesiredAccess ; - ACCESS_MASK PreviouslyGrantedAccess ; - ACCESS_MASK OriginalDesiredAccess ; - SECURITY_SUBJECT_CONTEXT SubjectSecurityContext ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - PVOID AuxData ; - union __anonunion_Privileges_40 Privileges ; - BOOLEAN AuditPrivileges ; - UNICODE_STRING ObjectName ; - UNICODE_STRING ObjectTypeName ; + LUID OperationID; + BOOLEAN SecurityEvaluated; + BOOLEAN GenerateAudit; + BOOLEAN GenerateOnClose; + BOOLEAN PrivilegesAllocated; + ULONG Flags; + ACCESS_MASK RemainingDesiredAccess; + ACCESS_MASK PreviouslyGrantedAccess; + ACCESS_MASK OriginalDesiredAccess; + SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PVOID AuxData; + union __anonunion_Privileges_40 Privileges; + BOOLEAN AuditPrivileges; + UNICODE_STRING ObjectName; + UNICODE_STRING ObjectTypeName; }; typedef struct _ACCESS_STATE *PACCESS_STATE; struct _DEVICE_OBJECT; @@ -794,1843 +791,1874 @@ struct _IRP; struct _IRP; struct _SCSI_REQUEST_BLOCK; struct _SCSI_REQUEST_BLOCK; -typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ); +typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp); struct _COMPRESSED_DATA_INFO; struct _FAST_IO_DISPATCH { - ULONG SizeOfFastIoDispatch ; - BOOLEAN (*FastIoCheckIfPossible)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , - BOOLEAN CheckForReadOperation , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryBasicInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_BASIC_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryStandardInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_STANDARD_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoLock)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - BOOLEAN FailImmediately , BOOLEAN ExclusiveLock , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockSingle)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAll)(struct _FILE_OBJECT *FileObject , PEPROCESS ProcessId , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAllByKey)(struct _FILE_OBJECT *FileObject , PVOID ProcessId , - ULONG Key , PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoDeviceControl)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , ULONG IoControlCode , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice , struct _DEVICE_OBJECT *TargetDevice ) ; - BOOLEAN (*FastIoQueryNetworkOpenInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - struct _FILE_NETWORK_OPEN_INFORMATION *Buffer , - struct _IO_STATUS_BLOCK *IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForModWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER EndingOffset , - struct _ERESOURCE **ResourceToRelease , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadComplete)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*PrepareMdlWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteComplete)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoReadCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , PMDL *MdlChain , - PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWriteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , - PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadCompleteCompressed)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteCompleteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryOpen)(struct _IRP *Irp , PFILE_NETWORK_OPEN_INFORMATION NetworkInformation , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForModWrite)(struct _FILE_OBJECT *FileObject , struct _ERESOURCE *ResourceToRelease , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; + ULONG SizeOfFastIoDispatch; + BOOLEAN(*FastIoCheckIfPossible) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, BOOLEAN CheckForReadOperation, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryBasicInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_BASIC_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryStandardInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_STANDARD_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoLock) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + BOOLEAN FailImmediately, BOOLEAN ExclusiveLock, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockSingle) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAll) + (struct _FILE_OBJECT *FileObject, PEPROCESS ProcessId, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAllByKey) + (struct _FILE_OBJECT *FileObject, PVOID ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoDeviceControl) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, PVOID InputBuffer, + ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength, + ULONG IoControlCode, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice, + struct _DEVICE_OBJECT *TargetDevice); + BOOLEAN(*FastIoQueryNetworkOpenInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + struct _FILE_NETWORK_OPEN_INFORMATION *Buffer, + struct _IO_STATUS_BLOCK *IoStatus, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForModWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER EndingOffset, + struct _ERESOURCE **ResourceToRelease, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadComplete) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*PrepareMdlWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteComplete) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoReadCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWriteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryOpen) + (struct _IRP *Irp, PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForModWrite) + (struct _FILE_OBJECT *FileObject, struct _ERESOURCE *ResourceToRelease, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); }; typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH; enum _IO_ALLOCATION_ACTION { - KeepObject = 1, - DeallocateObject = 2, - DeallocateObjectKeepRegisters = 3 -} ; + KeepObject = 1, + DeallocateObject = 2, + DeallocateObjectKeepRegisters = 3 +}; typedef enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION; struct _IO_SECURITY_CONTEXT { - PSECURITY_QUALITY_OF_SERVICE SecurityQos ; - PACCESS_STATE AccessState ; - ACCESS_MASK DesiredAccess ; - ULONG FullCreateOptions ; + PSECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_STATE AccessState; + ACCESS_MASK DesiredAccess; + ULONG FullCreateOptions; }; typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT; struct _VPB { - CSHORT Type ; - CSHORT Size ; - USHORT Flags ; - USHORT VolumeLabelLength ; - struct _DEVICE_OBJECT *DeviceObject ; - struct _DEVICE_OBJECT *RealDevice ; - ULONG SerialNumber ; - ULONG ReferenceCount ; - WCHAR VolumeLabel[(32U * sizeof(WCHAR )) / sizeof(WCHAR )] ; + CSHORT Type; + CSHORT Size; + USHORT Flags; + USHORT VolumeLabelLength; + struct _DEVICE_OBJECT *DeviceObject; + struct _DEVICE_OBJECT *RealDevice; + ULONG SerialNumber; + ULONG ReferenceCount; + WCHAR VolumeLabel[(32U * sizeof(WCHAR)) / sizeof(WCHAR)]; }; typedef struct _VPB *PVPB; struct _WAIT_CONTEXT_BLOCK { - KDEVICE_QUEUE_ENTRY WaitQueueEntry ; - IO_ALLOCATION_ACTION (*DeviceRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp , - PVOID MapRegisterBase , PVOID Context ) ; - PVOID DeviceContext ; - ULONG NumberOfMapRegisters ; - PVOID DeviceObject ; - PVOID CurrentIrp ; - PKDPC BufferChainingDpc ; + KDEVICE_QUEUE_ENTRY WaitQueueEntry; + IO_ALLOCATION_ACTION(*DeviceRoutine) + (struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp, PVOID MapRegisterBase, + PVOID Context); + PVOID DeviceContext; + ULONG NumberOfMapRegisters; + PVOID DeviceObject; + PVOID CurrentIrp; + PKDPC BufferChainingDpc; }; typedef struct _WAIT_CONTEXT_BLOCK WAIT_CONTEXT_BLOCK; union __anonunion_Queue_43 { - LIST_ENTRY ListEntry ; - WAIT_CONTEXT_BLOCK Wcb ; + LIST_ENTRY ListEntry; + WAIT_CONTEXT_BLOCK Wcb; }; struct _DEVOBJ_EXTENSION; struct _DEVICE_OBJECT { - CSHORT Type ; - USHORT Size ; - LONG ReferenceCount ; - struct _DRIVER_OBJECT *DriverObject ; - struct _DEVICE_OBJECT *NextDevice ; - struct _DEVICE_OBJECT *AttachedDevice ; - struct _IRP *CurrentIrp ; - PIO_TIMER Timer ; - ULONG Flags ; - ULONG Characteristics ; - PVPB Vpb ; - PVOID DeviceExtension ; - ULONG DeviceType ; - CCHAR StackSize ; - union __anonunion_Queue_43 Queue ; - ULONG AlignmentRequirement ; - KDEVICE_QUEUE DeviceQueue ; - KDPC Dpc ; - ULONG ActiveThreadCount ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - KEVENT DeviceLock ; - USHORT SectorSize ; - USHORT Spare1 ; - struct _DEVOBJ_EXTENSION *DeviceObjectExtension ; - PVOID Reserved ; + CSHORT Type; + USHORT Size; + LONG ReferenceCount; + struct _DRIVER_OBJECT *DriverObject; + struct _DEVICE_OBJECT *NextDevice; + struct _DEVICE_OBJECT *AttachedDevice; + struct _IRP *CurrentIrp; + PIO_TIMER Timer; + ULONG Flags; + ULONG Characteristics; + PVPB Vpb; + PVOID DeviceExtension; + ULONG DeviceType; + CCHAR StackSize; + union __anonunion_Queue_43 Queue; + ULONG AlignmentRequirement; + KDEVICE_QUEUE DeviceQueue; + KDPC Dpc; + ULONG ActiveThreadCount; + PSECURITY_DESCRIPTOR SecurityDescriptor; + KEVENT DeviceLock; + USHORT SectorSize; + USHORT Spare1; + struct _DEVOBJ_EXTENSION *DeviceObjectExtension; + PVOID Reserved; }; typedef struct _DEVICE_OBJECT DEVICE_OBJECT; typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; struct _DEVOBJ_EXTENSION { - CSHORT Type ; - USHORT Size ; - PDEVICE_OBJECT DeviceObject ; + CSHORT Type; + USHORT Size; + PDEVICE_OBJECT DeviceObject; }; struct _DRIVER_EXTENSION { - struct _DRIVER_OBJECT *DriverObject ; - NTSTATUS (*AddDevice)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ; - ULONG Count ; - UNICODE_STRING ServiceKeyName ; + struct _DRIVER_OBJECT *DriverObject; + NTSTATUS(*AddDevice) + (struct _DRIVER_OBJECT *DriverObject, + struct _DEVICE_OBJECT *PhysicalDeviceObject); + ULONG Count; + UNICODE_STRING ServiceKeyName; }; typedef struct _DRIVER_EXTENSION *PDRIVER_EXTENSION; struct _DRIVER_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - ULONG Flags ; - PVOID DriverStart ; - ULONG DriverSize ; - PVOID DriverSection ; - PDRIVER_EXTENSION DriverExtension ; - UNICODE_STRING DriverName ; - PUNICODE_STRING HardwareDatabase ; - PFAST_IO_DISPATCH FastIoDispatch ; - NTSTATUS (*DriverInit)(struct _DRIVER_OBJECT *DriverObject , PUNICODE_STRING RegistryPath ) ; - void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject ) ; - PDRIVER_DISPATCH MajorFunction[28] ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + PVOID DriverStart; + ULONG DriverSize; + PVOID DriverSection; + PDRIVER_EXTENSION DriverExtension; + UNICODE_STRING DriverName; + PUNICODE_STRING HardwareDatabase; + PFAST_IO_DISPATCH FastIoDispatch; + NTSTATUS(*DriverInit) + (struct _DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath); + void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject); + PDRIVER_DISPATCH MajorFunction[28]; }; typedef struct _DRIVER_OBJECT DRIVER_OBJECT; typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; struct _SECTION_OBJECT_POINTERS { - PVOID DataSectionObject ; - PVOID SharedCacheMap ; - PVOID ImageSectionObject ; + PVOID DataSectionObject; + PVOID SharedCacheMap; + PVOID ImageSectionObject; }; typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS; typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS; struct _IO_COMPLETION_CONTEXT { - PVOID Port ; - PVOID Key ; + PVOID Port; + PVOID Key; }; typedef struct _IO_COMPLETION_CONTEXT *PIO_COMPLETION_CONTEXT; struct _FILE_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - PVPB Vpb ; - PVOID FsContext ; - PVOID FsContext2 ; - PSECTION_OBJECT_POINTERS SectionObjectPointer ; - PVOID PrivateCacheMap ; - NTSTATUS FinalStatus ; - struct _FILE_OBJECT *RelatedFileObject ; - BOOLEAN LockOperation ; - BOOLEAN DeletePending ; - BOOLEAN ReadAccess ; - BOOLEAN WriteAccess ; - BOOLEAN DeleteAccess ; - BOOLEAN SharedRead ; - BOOLEAN SharedWrite ; - BOOLEAN SharedDelete ; - ULONG Flags ; - UNICODE_STRING FileName ; - LARGE_INTEGER CurrentByteOffset ; - ULONG Waiters ; - ULONG Busy ; - PVOID LastLock ; - KEVENT Lock ; - KEVENT Event ; - PIO_COMPLETION_CONTEXT CompletionContext ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + PVPB Vpb; + PVOID FsContext; + PVOID FsContext2; + PSECTION_OBJECT_POINTERS SectionObjectPointer; + PVOID PrivateCacheMap; + NTSTATUS FinalStatus; + struct _FILE_OBJECT *RelatedFileObject; + BOOLEAN LockOperation; + BOOLEAN DeletePending; + BOOLEAN ReadAccess; + BOOLEAN WriteAccess; + BOOLEAN DeleteAccess; + BOOLEAN SharedRead; + BOOLEAN SharedWrite; + BOOLEAN SharedDelete; + ULONG Flags; + UNICODE_STRING FileName; + LARGE_INTEGER CurrentByteOffset; + ULONG Waiters; + ULONG Busy; + PVOID LastLock; + KEVENT Lock; + KEVENT Event; + PIO_COMPLETION_CONTEXT CompletionContext; }; typedef struct _FILE_OBJECT *PFILE_OBJECT; union __anonunion_AssociatedIrp_44 { - struct _IRP *MasterIrp ; - LONG IrpCount ; - PVOID SystemBuffer ; + struct _IRP *MasterIrp; + LONG IrpCount; + PVOID SystemBuffer; }; struct __anonstruct_AsynchronousParameters_46 { - void (*UserApcRoutine)(PVOID ApcContext , PIO_STATUS_BLOCK IoStatusBlock , - ULONG Reserved ) ; - PVOID UserApcContext ; + void (*UserApcRoutine)(PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, + ULONG Reserved); + PVOID UserApcContext; }; union __anonunion_Overlay_45 { - struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters ; - LARGE_INTEGER AllocationSize ; + struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters; + LARGE_INTEGER AllocationSize; }; struct __anonstruct____missing_field_name_50 { - PVOID DriverContext[4] ; + PVOID DriverContext[4]; }; union __anonunion____missing_field_name_49 { - KDEVICE_QUEUE_ENTRY DeviceQueueEntry ; - struct __anonstruct____missing_field_name_50 __annonCompField14 ; + KDEVICE_QUEUE_ENTRY DeviceQueueEntry; + struct __anonstruct____missing_field_name_50 __annonCompField14; }; struct _IO_STACK_LOCATION; union __anonunion____missing_field_name_52 { - struct _IO_STACK_LOCATION *CurrentStackLocation ; - ULONG PacketType ; + struct _IO_STACK_LOCATION *CurrentStackLocation; + ULONG PacketType; }; struct __anonstruct____missing_field_name_51 { - LIST_ENTRY ListEntry ; - union __anonunion____missing_field_name_52 __annonCompField16 ; + LIST_ENTRY ListEntry; + union __anonunion____missing_field_name_52 __annonCompField16; }; struct __anonstruct_Overlay_48 { - union __anonunion____missing_field_name_49 __annonCompField15 ; - PETHREAD Thread ; - PCHAR AuxiliaryBuffer ; - struct __anonstruct____missing_field_name_51 __annonCompField17 ; - PFILE_OBJECT OriginalFileObject ; + union __anonunion____missing_field_name_49 __annonCompField15; + PETHREAD Thread; + PCHAR AuxiliaryBuffer; + struct __anonstruct____missing_field_name_51 __annonCompField17; + PFILE_OBJECT OriginalFileObject; }; union __anonunion_Tail_47 { - struct __anonstruct_Overlay_48 Overlay ; - KAPC Apc ; - PVOID CompletionKey ; + struct __anonstruct_Overlay_48 Overlay; + KAPC Apc; + PVOID CompletionKey; }; struct _IRP { - CSHORT Type ; - USHORT Size ; - PMDL MdlAddress ; - ULONG Flags ; - union __anonunion_AssociatedIrp_44 AssociatedIrp ; - LIST_ENTRY ThreadListEntry ; - IO_STATUS_BLOCK IoStatus ; - KPROCESSOR_MODE RequestorMode ; - BOOLEAN PendingReturned ; - CHAR StackCount ; - CHAR CurrentLocation ; - BOOLEAN Cancel ; - KIRQL CancelIrql ; - CCHAR ApcEnvironment ; - UCHAR AllocationFlags ; - PIO_STATUS_BLOCK UserIosb ; - PKEVENT UserEvent ; - union __anonunion_Overlay_45 Overlay ; - void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - PVOID UserBuffer ; - union __anonunion_Tail_47 Tail ; + CSHORT Type; + USHORT Size; + PMDL MdlAddress; + ULONG Flags; + union __anonunion_AssociatedIrp_44 AssociatedIrp; + LIST_ENTRY ThreadListEntry; + IO_STATUS_BLOCK IoStatus; + KPROCESSOR_MODE RequestorMode; + BOOLEAN PendingReturned; + CHAR StackCount; + CHAR CurrentLocation; + BOOLEAN Cancel; + KIRQL CancelIrql; + CCHAR ApcEnvironment; + UCHAR AllocationFlags; + PIO_STATUS_BLOCK UserIosb; + PKEVENT UserEvent; + union __anonunion_Overlay_45 Overlay; + void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + PVOID UserBuffer; + union __anonunion_Tail_47 Tail; }; typedef struct _IRP IRP; typedef struct _IRP *PIRP; enum _DEVICE_RELATION_TYPE { - BusRelations = 0, - EjectionRelations = 1, - PowerRelations = 2, - RemovalRelations = 3, - TargetDeviceRelation = 4 -} ; + BusRelations = 0, + EjectionRelations = 1, + PowerRelations = 2, + RemovalRelations = 3, + TargetDeviceRelation = 4 +}; typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE; enum _DEVICE_USAGE_NOTIFICATION_TYPE { - DeviceUsageTypeUndefined = 0, - DeviceUsageTypePaging = 1, - DeviceUsageTypeHibernation = 2, - DeviceUsageTypeDumpFile = 3 -} ; + DeviceUsageTypeUndefined = 0, + DeviceUsageTypePaging = 1, + DeviceUsageTypeHibernation = 2, + DeviceUsageTypeDumpFile = 3 +}; typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE; struct _INTERFACE { - USHORT Size ; - USHORT Version ; - PVOID Context ; - void (*InterfaceReference)(PVOID Context ) ; - void (*InterfaceDereference)(PVOID Context ) ; + USHORT Size; + USHORT Version; + PVOID Context; + void (*InterfaceReference)(PVOID Context); + void (*InterfaceDereference)(PVOID Context); }; typedef struct _INTERFACE *PINTERFACE; struct _DEVICE_CAPABILITIES { - USHORT Size ; - USHORT Version ; - ULONG DeviceD1 : 1 ; - ULONG DeviceD2 : 1 ; - ULONG LockSupported : 1 ; - ULONG EjectSupported : 1 ; - ULONG Removable : 1 ; - ULONG DockDevice : 1 ; - ULONG UniqueID : 1 ; - ULONG SilentInstall : 1 ; - ULONG RawDeviceOK : 1 ; - ULONG SurpriseRemovalOK : 1 ; - ULONG WakeFromD0 : 1 ; - ULONG WakeFromD1 : 1 ; - ULONG WakeFromD2 : 1 ; - ULONG WakeFromD3 : 1 ; - ULONG HardwareDisabled : 1 ; - ULONG NonDynamic : 1 ; - ULONG WarmEjectSupported : 1 ; - ULONG Reserved : 15 ; - ULONG Address ; - ULONG UINumber ; - DEVICE_POWER_STATE DeviceState[7] ; - SYSTEM_POWER_STATE SystemWake ; - DEVICE_POWER_STATE DeviceWake ; - ULONG D1Latency ; - ULONG D2Latency ; - ULONG D3Latency ; + USHORT Size; + USHORT Version; + ULONG DeviceD1 : 1; + ULONG DeviceD2 : 1; + ULONG LockSupported : 1; + ULONG EjectSupported : 1; + ULONG Removable : 1; + ULONG DockDevice : 1; + ULONG UniqueID : 1; + ULONG SilentInstall : 1; + ULONG RawDeviceOK : 1; + ULONG SurpriseRemovalOK : 1; + ULONG WakeFromD0 : 1; + ULONG WakeFromD1 : 1; + ULONG WakeFromD2 : 1; + ULONG WakeFromD3 : 1; + ULONG HardwareDisabled : 1; + ULONG NonDynamic : 1; + ULONG WarmEjectSupported : 1; + ULONG Reserved : 15; + ULONG Address; + ULONG UINumber; + DEVICE_POWER_STATE DeviceState[7]; + SYSTEM_POWER_STATE SystemWake; + DEVICE_POWER_STATE DeviceWake; + ULONG D1Latency; + ULONG D2Latency; + ULONG D3Latency; }; typedef struct _DEVICE_CAPABILITIES *PDEVICE_CAPABILITIES; struct _POWER_SEQUENCE { - ULONG SequenceD1 ; - ULONG SequenceD2 ; - ULONG SequenceD3 ; + ULONG SequenceD1; + ULONG SequenceD2; + ULONG SequenceD3; }; typedef struct _POWER_SEQUENCE *PPOWER_SEQUENCE; enum __anonenum_BUS_QUERY_ID_TYPE_53 { - BusQueryDeviceID = 0, - BusQueryHardwareIDs = 1, - BusQueryCompatibleIDs = 2, - BusQueryInstanceID = 3, - BusQueryDeviceSerialNumber = 4 -} ; + BusQueryDeviceID = 0, + BusQueryHardwareIDs = 1, + BusQueryCompatibleIDs = 2, + BusQueryInstanceID = 3, + BusQueryDeviceSerialNumber = 4 +}; typedef enum __anonenum_BUS_QUERY_ID_TYPE_53 BUS_QUERY_ID_TYPE; enum __anonenum_DEVICE_TEXT_TYPE_54 { - DeviceTextDescription = 0, - DeviceTextLocationInformation = 1 -} ; + DeviceTextDescription = 0, + DeviceTextLocationInformation = 1 +}; typedef enum __anonenum_DEVICE_TEXT_TYPE_54 DEVICE_TEXT_TYPE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Create_56 { - PIO_SECURITY_CONTEXT SecurityContext ; - ULONG Options ; - USHORT FileAttributes ; - USHORT ShareAccess ; - ULONG EaLength ; + PIO_SECURITY_CONTEXT SecurityContext; + ULONG Options; + USHORT FileAttributes; + USHORT ShareAccess; + ULONG EaLength; }; struct __anonstruct_Read_57 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_Write_58 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_QueryFile_59 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; }; struct __anonstruct____missing_field_name_62 { - BOOLEAN ReplaceIfExists ; - BOOLEAN AdvanceOnly ; + BOOLEAN ReplaceIfExists; + BOOLEAN AdvanceOnly; }; union __anonunion____missing_field_name_61 { - struct __anonstruct____missing_field_name_62 __annonCompField18 ; - ULONG ClusterCount ; - HANDLE DeleteHandle ; + struct __anonstruct____missing_field_name_62 __annonCompField18; + ULONG ClusterCount; + HANDLE DeleteHandle; }; struct __anonstruct_SetFile_60 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; - PFILE_OBJECT FileObject ; - union __anonunion____missing_field_name_61 __annonCompField19 ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; + PFILE_OBJECT FileObject; + union __anonunion____missing_field_name_61 __annonCompField19; }; struct __anonstruct_QueryVolume_63 { - ULONG Length ; - FS_INFORMATION_CLASS FsInformationClass ; + ULONG Length; + FS_INFORMATION_CLASS FsInformationClass; }; struct __anonstruct_DeviceIoControl_64 { - ULONG OutputBufferLength ; - ULONG InputBufferLength ; - ULONG IoControlCode ; - PVOID Type3InputBuffer ; + ULONG OutputBufferLength; + ULONG InputBufferLength; + ULONG IoControlCode; + PVOID Type3InputBuffer; }; struct __anonstruct_QuerySecurity_65 { - SECURITY_INFORMATION SecurityInformation ; - ULONG Length ; + SECURITY_INFORMATION SecurityInformation; + ULONG Length; }; struct __anonstruct_SetSecurity_66 { - SECURITY_INFORMATION SecurityInformation ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; + SECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; }; struct __anonstruct_MountVolume_67 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_VerifyVolume_68 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_Scsi_69 { - struct _SCSI_REQUEST_BLOCK *Srb ; + struct _SCSI_REQUEST_BLOCK *Srb; }; struct __anonstruct_QueryDeviceRelations_70 { - DEVICE_RELATION_TYPE Type ; + DEVICE_RELATION_TYPE Type; }; struct __anonstruct_QueryInterface_71 { - GUID const *InterfaceType ; - USHORT Size ; - USHORT Version ; - PINTERFACE Interface ; - PVOID InterfaceSpecificData ; + GUID const *InterfaceType; + USHORT Size; + USHORT Version; + PINTERFACE Interface; + PVOID InterfaceSpecificData; }; struct __anonstruct_DeviceCapabilities_72 { - PDEVICE_CAPABILITIES Capabilities ; + PDEVICE_CAPABILITIES Capabilities; }; struct __anonstruct_FilterResourceRequirements_73 { - PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList ; + PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; }; struct __anonstruct_ReadWriteConfig_74 { - ULONG WhichSpace ; - PVOID Buffer ; - ULONG Offset ; - ULONG Length ; + ULONG WhichSpace; + PVOID Buffer; + ULONG Offset; + ULONG Length; }; struct __anonstruct_SetLock_75 { - BOOLEAN Lock ; + BOOLEAN Lock; }; struct __anonstruct_QueryId_76 { - BUS_QUERY_ID_TYPE IdType ; + BUS_QUERY_ID_TYPE IdType; }; struct __anonstruct_QueryDeviceText_77 { - DEVICE_TEXT_TYPE DeviceTextType ; - LCID LocaleId ; + DEVICE_TEXT_TYPE DeviceTextType; + LCID LocaleId; }; struct __anonstruct_UsageNotification_78 { - BOOLEAN InPath ; - BOOLEAN Reserved[3] ; - DEVICE_USAGE_NOTIFICATION_TYPE Type ; + BOOLEAN InPath; + BOOLEAN Reserved[3]; + DEVICE_USAGE_NOTIFICATION_TYPE Type; }; struct __anonstruct_WaitWake_79 { - SYSTEM_POWER_STATE PowerState ; + SYSTEM_POWER_STATE PowerState; }; struct __anonstruct_PowerSequence_80 { - PPOWER_SEQUENCE PowerSequence ; + PPOWER_SEQUENCE PowerSequence; }; struct __anonstruct_Power_81 { - ULONG SystemContext ; - POWER_STATE_TYPE Type ; - POWER_STATE State ; - POWER_ACTION ShutdownType ; + ULONG SystemContext; + POWER_STATE_TYPE Type; + POWER_STATE State; + POWER_ACTION ShutdownType; }; struct __anonstruct_StartDevice_82 { - PCM_RESOURCE_LIST AllocatedResources ; - PCM_RESOURCE_LIST AllocatedResourcesTranslated ; + PCM_RESOURCE_LIST AllocatedResources; + PCM_RESOURCE_LIST AllocatedResourcesTranslated; }; struct __anonstruct_WMI_83 { - ULONG_PTR ProviderId ; - PVOID DataPath ; - ULONG BufferSize ; - PVOID Buffer ; + ULONG_PTR ProviderId; + PVOID DataPath; + ULONG BufferSize; + PVOID Buffer; }; struct __anonstruct_Others_84 { - PVOID Argument1 ; - PVOID Argument2 ; - PVOID Argument3 ; - PVOID Argument4 ; + PVOID Argument1; + PVOID Argument2; + PVOID Argument3; + PVOID Argument4; }; union __anonunion_Parameters_55 { - struct __anonstruct_Create_56 Create ; - struct __anonstruct_Read_57 Read ; - struct __anonstruct_Write_58 Write ; - struct __anonstruct_QueryFile_59 QueryFile ; - struct __anonstruct_SetFile_60 SetFile ; - struct __anonstruct_QueryVolume_63 QueryVolume ; - struct __anonstruct_DeviceIoControl_64 DeviceIoControl ; - struct __anonstruct_QuerySecurity_65 QuerySecurity ; - struct __anonstruct_SetSecurity_66 SetSecurity ; - struct __anonstruct_MountVolume_67 MountVolume ; - struct __anonstruct_VerifyVolume_68 VerifyVolume ; - struct __anonstruct_Scsi_69 Scsi ; - struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations ; - struct __anonstruct_QueryInterface_71 QueryInterface ; - struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities ; - struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements ; - struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig ; - struct __anonstruct_SetLock_75 SetLock ; - struct __anonstruct_QueryId_76 QueryId ; - struct __anonstruct_QueryDeviceText_77 QueryDeviceText ; - struct __anonstruct_UsageNotification_78 UsageNotification ; - struct __anonstruct_WaitWake_79 WaitWake ; - struct __anonstruct_PowerSequence_80 PowerSequence ; - struct __anonstruct_Power_81 Power ; - struct __anonstruct_StartDevice_82 StartDevice ; - struct __anonstruct_WMI_83 WMI ; - struct __anonstruct_Others_84 Others ; + struct __anonstruct_Create_56 Create; + struct __anonstruct_Read_57 Read; + struct __anonstruct_Write_58 Write; + struct __anonstruct_QueryFile_59 QueryFile; + struct __anonstruct_SetFile_60 SetFile; + struct __anonstruct_QueryVolume_63 QueryVolume; + struct __anonstruct_DeviceIoControl_64 DeviceIoControl; + struct __anonstruct_QuerySecurity_65 QuerySecurity; + struct __anonstruct_SetSecurity_66 SetSecurity; + struct __anonstruct_MountVolume_67 MountVolume; + struct __anonstruct_VerifyVolume_68 VerifyVolume; + struct __anonstruct_Scsi_69 Scsi; + struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations; + struct __anonstruct_QueryInterface_71 QueryInterface; + struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities; + struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements; + struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig; + struct __anonstruct_SetLock_75 SetLock; + struct __anonstruct_QueryId_76 QueryId; + struct __anonstruct_QueryDeviceText_77 QueryDeviceText; + struct __anonstruct_UsageNotification_78 UsageNotification; + struct __anonstruct_WaitWake_79 WaitWake; + struct __anonstruct_PowerSequence_80 PowerSequence; + struct __anonstruct_Power_81 Power; + struct __anonstruct_StartDevice_82 StartDevice; + struct __anonstruct_WMI_83 WMI; + struct __anonstruct_Others_84 Others; }; struct _IO_STACK_LOCATION { - UCHAR MajorFunction ; - UCHAR MinorFunction ; - UCHAR Flags ; - UCHAR Control ; - union __anonunion_Parameters_55 Parameters ; - PDEVICE_OBJECT DeviceObject ; - PFILE_OBJECT FileObject ; - NTSTATUS (*CompletionRoutine)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - PVOID Context ; + UCHAR MajorFunction; + UCHAR MinorFunction; + UCHAR Flags; + UCHAR Control; + union __anonunion_Parameters_55 Parameters; + PDEVICE_OBJECT DeviceObject; + PFILE_OBJECT FileObject; + NTSTATUS(*CompletionRoutine) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + PVOID Context; }; typedef struct _IO_STACK_LOCATION IO_STACK_LOCATION; typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION; #pragma pack(pop) struct _CONFIGURATION_INFORMATION { - ULONG DiskCount ; - ULONG FloppyCount ; - ULONG CdRomCount ; - ULONG TapeCount ; - ULONG ScsiPortCount ; - ULONG SerialCount ; - ULONG ParallelCount ; - BOOLEAN AtDiskPrimaryAddressClaimed ; - BOOLEAN AtDiskSecondaryAddressClaimed ; - ULONG Version ; - ULONG MediumChangerCount ; + ULONG DiskCount; + ULONG FloppyCount; + ULONG CdRomCount; + ULONG TapeCount; + ULONG ScsiPortCount; + ULONG SerialCount; + ULONG ParallelCount; + BOOLEAN AtDiskPrimaryAddressClaimed; + BOOLEAN AtDiskSecondaryAddressClaimed; + ULONG Version; + ULONG MediumChangerCount; }; typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION; typedef struct _CONFIGURATION_INFORMATION *PCONFIGURATION_INFORMATION; struct _OBJECT_HANDLE_INFORMATION { - ULONG HandleAttributes ; - ACCESS_MASK GrantedAccess ; + ULONG HandleAttributes; + ACCESS_MASK GrantedAccess; }; typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION; struct _SCSI_PASS_THROUGH { - USHORT Length ; - UCHAR ScsiStatus ; - UCHAR PathId ; - UCHAR TargetId ; - UCHAR Lun ; - UCHAR CdbLength ; - UCHAR SenseInfoLength ; - UCHAR DataIn ; - ULONG DataTransferLength ; - ULONG TimeOutValue ; - ULONG_PTR DataBufferOffset ; - ULONG SenseInfoOffset ; - UCHAR Cdb[16] ; + USHORT Length; + UCHAR ScsiStatus; + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; + UCHAR CdbLength; + UCHAR SenseInfoLength; + UCHAR DataIn; + ULONG DataTransferLength; + ULONG TimeOutValue; + ULONG_PTR DataBufferOffset; + ULONG SenseInfoOffset; + UCHAR Cdb[16]; }; typedef struct _SCSI_PASS_THROUGH SCSI_PASS_THROUGH; typedef struct _SCSI_PASS_THROUGH *PSCSI_PASS_THROUGH; struct _TRACK_DATA { - UCHAR Reserved ; - UCHAR Control : 4 ; - UCHAR Adr : 4 ; - UCHAR TrackNumber ; - UCHAR Reserved1 ; - UCHAR Address[4] ; + UCHAR Reserved; + UCHAR Control : 4; + UCHAR Adr : 4; + UCHAR TrackNumber; + UCHAR Reserved1; + UCHAR Address[4]; }; typedef struct _TRACK_DATA TRACK_DATA; struct _CDROM_TOC { - UCHAR Length[2] ; - UCHAR FirstTrack ; - UCHAR LastTrack ; - TRACK_DATA TrackData[100] ; + UCHAR Length[2]; + UCHAR FirstTrack; + UCHAR LastTrack; + TRACK_DATA TrackData[100]; }; typedef struct _CDROM_TOC CDROM_TOC; typedef struct _CDROM_TOC *PCDROM_TOC; struct _CDROM_PLAY_AUDIO_MSF { - UCHAR StartingM ; - UCHAR StartingS ; - UCHAR StartingF ; - UCHAR EndingM ; - UCHAR EndingS ; - UCHAR EndingF ; + UCHAR StartingM; + UCHAR StartingS; + UCHAR StartingF; + UCHAR EndingM; + UCHAR EndingS; + UCHAR EndingF; }; typedef struct _CDROM_PLAY_AUDIO_MSF CDROM_PLAY_AUDIO_MSF; typedef struct _CDROM_PLAY_AUDIO_MSF *PCDROM_PLAY_AUDIO_MSF; struct _CDROM_SEEK_AUDIO_MSF { - UCHAR M ; - UCHAR S ; - UCHAR F ; + UCHAR M; + UCHAR S; + UCHAR F; }; typedef struct _CDROM_SEEK_AUDIO_MSF CDROM_SEEK_AUDIO_MSF; typedef struct _CDROM_SEEK_AUDIO_MSF *PCDROM_SEEK_AUDIO_MSF; struct _CDROM_SUB_Q_DATA_FORMAT { - UCHAR Format ; - UCHAR Track ; + UCHAR Format; + UCHAR Track; }; struct _SUB_Q_HEADER { - UCHAR Reserved ; - UCHAR AudioStatus ; - UCHAR DataLength[2] ; + UCHAR Reserved; + UCHAR AudioStatus; + UCHAR DataLength[2]; }; typedef struct _SUB_Q_HEADER SUB_Q_HEADER; struct _SUB_Q_CURRENT_POSITION { - SUB_Q_HEADER Header ; - UCHAR FormatCode ; - UCHAR Control : 4 ; - UCHAR ADR : 4 ; - UCHAR TrackNumber ; - UCHAR IndexNumber ; - UCHAR AbsoluteAddress[4] ; - UCHAR TrackRelativeAddress[4] ; + SUB_Q_HEADER Header; + UCHAR FormatCode; + UCHAR Control : 4; + UCHAR ADR : 4; + UCHAR TrackNumber; + UCHAR IndexNumber; + UCHAR AbsoluteAddress[4]; + UCHAR TrackRelativeAddress[4]; }; typedef struct _SUB_Q_CURRENT_POSITION SUB_Q_CURRENT_POSITION; typedef struct _SUB_Q_CURRENT_POSITION *PSUB_Q_CURRENT_POSITION; struct _SUB_Q_MEDIA_CATALOG_NUMBER { - SUB_Q_HEADER Header ; - UCHAR FormatCode ; - UCHAR Reserved[3] ; - UCHAR Reserved1 : 7 ; - UCHAR Mcval : 1 ; - UCHAR MediaCatalog[15] ; + SUB_Q_HEADER Header; + UCHAR FormatCode; + UCHAR Reserved[3]; + UCHAR Reserved1 : 7; + UCHAR Mcval : 1; + UCHAR MediaCatalog[15]; }; typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER SUB_Q_MEDIA_CATALOG_NUMBER; struct _SUB_Q_TRACK_ISRC { - SUB_Q_HEADER Header ; - UCHAR FormatCode ; - UCHAR Reserved0 ; - UCHAR Track ; - UCHAR Reserved1 ; - UCHAR Reserved2 : 7 ; - UCHAR Tcval : 1 ; - UCHAR TrackIsrc[15] ; + SUB_Q_HEADER Header; + UCHAR FormatCode; + UCHAR Reserved0; + UCHAR Track; + UCHAR Reserved1; + UCHAR Reserved2 : 7; + UCHAR Tcval : 1; + UCHAR TrackIsrc[15]; }; typedef struct _SUB_Q_TRACK_ISRC SUB_Q_TRACK_ISRC; union _SUB_Q_CHANNEL_DATA { - SUB_Q_CURRENT_POSITION CurrentPosition ; - SUB_Q_MEDIA_CATALOG_NUMBER MediaCatalog ; - SUB_Q_TRACK_ISRC TrackIsrc ; + SUB_Q_CURRENT_POSITION CurrentPosition; + SUB_Q_MEDIA_CATALOG_NUMBER MediaCatalog; + SUB_Q_TRACK_ISRC TrackIsrc; }; typedef union _SUB_Q_CHANNEL_DATA SUB_Q_CHANNEL_DATA; -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) union __anonunion____missing_field_name_116 { - ULONG InternalStatus ; - ULONG QueueSortKey ; + ULONG InternalStatus; + ULONG QueueSortKey; }; struct _SCSI_REQUEST_BLOCK { - USHORT Length ; - UCHAR Function ; - UCHAR SrbStatus ; - UCHAR ScsiStatus ; - UCHAR PathId ; - UCHAR TargetId ; - UCHAR Lun ; - UCHAR QueueTag ; - UCHAR QueueAction ; - UCHAR CdbLength ; - UCHAR SenseInfoBufferLength ; - ULONG SrbFlags ; - ULONG DataTransferLength ; - ULONG TimeOutValue ; - PVOID DataBuffer ; - PVOID SenseInfoBuffer ; - struct _SCSI_REQUEST_BLOCK *NextSrb ; - PVOID OriginalRequest ; - PVOID SrbExtension ; - union __anonunion____missing_field_name_116 __annonCompField21 ; - UCHAR Cdb[16] ; + USHORT Length; + UCHAR Function; + UCHAR SrbStatus; + UCHAR ScsiStatus; + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; + UCHAR QueueTag; + UCHAR QueueAction; + UCHAR CdbLength; + UCHAR SenseInfoBufferLength; + ULONG SrbFlags; + ULONG DataTransferLength; + ULONG TimeOutValue; + PVOID DataBuffer; + PVOID SenseInfoBuffer; + struct _SCSI_REQUEST_BLOCK *NextSrb; + PVOID OriginalRequest; + PVOID SrbExtension; + union __anonunion____missing_field_name_116 __annonCompField21; + UCHAR Cdb[16]; }; struct _CDB6GENERIC { - UCHAR OperationCode ; - UCHAR Immediate : 1 ; - UCHAR CommandUniqueBits : 4 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR CommandUniqueBytes[3] ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved : 4 ; - UCHAR VendorUnique : 2 ; + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR CommandUniqueBits : 4; + UCHAR LogicalUnitNumber : 3; + UCHAR CommandUniqueBytes[3]; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved : 4; + UCHAR VendorUnique : 2; }; struct _CDB6READWRITE { - UCHAR OperationCode ; - UCHAR LogicalBlockMsb1 : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR LogicalBlockMsb0 ; - UCHAR LogicalBlockLsb ; - UCHAR TransferBlocks ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR LogicalBlockMsb1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR LogicalBlockMsb0; + UCHAR LogicalBlockLsb; + UCHAR TransferBlocks; + UCHAR Control; }; struct _CDB6INQUIRY { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR PageCode ; - UCHAR IReserved ; - UCHAR AllocationLength ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR PageCode; + UCHAR IReserved; + UCHAR AllocationLength; + UCHAR Control; }; struct _CDB6VERIFY { - UCHAR OperationCode ; - UCHAR Fixed : 1 ; - UCHAR ByteCompare : 1 ; - UCHAR Immediate : 1 ; - UCHAR Reserved : 2 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR VerificationLength[3] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Fixed : 1; + UCHAR ByteCompare : 1; + UCHAR Immediate : 1; + UCHAR Reserved : 2; + UCHAR LogicalUnitNumber : 3; + UCHAR VerificationLength[3]; + UCHAR Control; }; struct _CDB6FORMAT { - UCHAR OperationCode ; - UCHAR FormatControl : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR FReserved1 ; - UCHAR InterleaveMsb ; - UCHAR InterleaveLsb ; - UCHAR FReserved2 ; + UCHAR OperationCode; + UCHAR FormatControl : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR FReserved1; + UCHAR InterleaveMsb; + UCHAR InterleaveLsb; + UCHAR FReserved2; }; struct _CDB10 { - UCHAR OperationCode ; - UCHAR RelativeAddress : 1 ; - UCHAR Reserved1 : 2 ; - UCHAR ForceUnitAccess : 1 ; - UCHAR DisablePageOut : 1 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR LogicalBlockByte0 ; - UCHAR LogicalBlockByte1 ; - UCHAR LogicalBlockByte2 ; - UCHAR LogicalBlockByte3 ; - UCHAR Reserved2 ; - UCHAR TransferBlocksMsb ; - UCHAR TransferBlocksLsb ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR RelativeAddress : 1; + UCHAR Reserved1 : 2; + UCHAR ForceUnitAccess : 1; + UCHAR DisablePageOut : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR LogicalBlockByte0; + UCHAR LogicalBlockByte1; + UCHAR LogicalBlockByte2; + UCHAR LogicalBlockByte3; + UCHAR Reserved2; + UCHAR TransferBlocksMsb; + UCHAR TransferBlocksLsb; + UCHAR Control; }; struct _CDB12 { - UCHAR OperationCode ; - UCHAR RelativeAddress : 1 ; - UCHAR Reserved1 : 2 ; - UCHAR ForceUnitAccess : 1 ; - UCHAR DisablePageOut : 1 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR LogicalBlock[4] ; - UCHAR TransferLength[4] ; - UCHAR Reserved2 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR RelativeAddress : 1; + UCHAR Reserved1 : 2; + UCHAR ForceUnitAccess : 1; + UCHAR DisablePageOut : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR LogicalBlock[4]; + UCHAR TransferLength[4]; + UCHAR Reserved2; + UCHAR Control; }; struct _PAUSE_RESUME { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR Reserved2[6] ; - UCHAR Action ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2[6]; + UCHAR Action; + UCHAR Control; }; struct _READ_TOC { - UCHAR OperationCode ; - UCHAR Reserved0 : 1 ; - UCHAR Msf : 1 ; - UCHAR Reserved1 : 3 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR Format2 : 4 ; - UCHAR Reserved2 : 4 ; - UCHAR Reserved3[3] ; - UCHAR StartingTrack ; - UCHAR AllocationLength[2] ; - UCHAR Control : 6 ; - UCHAR Format : 2 ; + UCHAR OperationCode; + UCHAR Reserved0 : 1; + UCHAR Msf : 1; + UCHAR Reserved1 : 3; + UCHAR LogicalUnitNumber : 3; + UCHAR Format2 : 4; + UCHAR Reserved2 : 4; + UCHAR Reserved3[3]; + UCHAR StartingTrack; + UCHAR AllocationLength[2]; + UCHAR Control : 6; + UCHAR Format : 2; }; struct _READ_DISK_INFORMATION { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR Lun : 3 ; - UCHAR Reserved2[5] ; - UCHAR AllocationLength[2] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR Reserved2[5]; + UCHAR AllocationLength[2]; + UCHAR Control; }; struct _READ_TRACK_INFORMATION { - UCHAR OperationCode ; - UCHAR Track : 1 ; - UCHAR Reserved1 : 3 ; - UCHAR Reserved2 : 1 ; - UCHAR Lun : 3 ; - UCHAR BlockAddress[4] ; - UCHAR Reserved3 ; - UCHAR AllocationLength[2] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Track : 1; + UCHAR Reserved1 : 3; + UCHAR Reserved2 : 1; + UCHAR Lun : 3; + UCHAR BlockAddress[4]; + UCHAR Reserved3; + UCHAR AllocationLength[2]; + UCHAR Control; }; struct _READ_HEADER { - UCHAR OperationCode ; - UCHAR Reserved1 : 1 ; - UCHAR Msf : 1 ; - UCHAR Reserved2 : 3 ; - UCHAR Lun : 3 ; - UCHAR LogicalBlockAddress[4] ; - UCHAR Reserved3 ; - UCHAR AllocationLength[2] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 1; + UCHAR Msf : 1; + UCHAR Reserved2 : 3; + UCHAR Lun : 3; + UCHAR LogicalBlockAddress[4]; + UCHAR Reserved3; + UCHAR AllocationLength[2]; + UCHAR Control; }; struct _PLAY_AUDIO { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR StartingBlockAddress[4] ; - UCHAR Reserved2 ; - UCHAR PlayLength[2] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR StartingBlockAddress[4]; + UCHAR Reserved2; + UCHAR PlayLength[2]; + UCHAR Control; }; struct _PLAY_AUDIO_MSF { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR Reserved2 ; - UCHAR StartingM ; - UCHAR StartingS ; - UCHAR StartingF ; - UCHAR EndingM ; - UCHAR EndingS ; - UCHAR EndingF ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2; + UCHAR StartingM; + UCHAR StartingS; + UCHAR StartingF; + UCHAR EndingM; + UCHAR EndingS; + UCHAR EndingF; + UCHAR Control; }; struct _LBA { - UCHAR StartingBlockAddress[4] ; - UCHAR PlayLength[4] ; + UCHAR StartingBlockAddress[4]; + UCHAR PlayLength[4]; }; struct _MSF { - UCHAR Reserved1 ; - UCHAR StartingM ; - UCHAR StartingS ; - UCHAR StartingF ; - UCHAR EndingM ; - UCHAR EndingS ; - UCHAR EndingF ; - UCHAR Reserved2 ; + UCHAR Reserved1; + UCHAR StartingM; + UCHAR StartingS; + UCHAR StartingF; + UCHAR EndingM; + UCHAR EndingS; + UCHAR EndingF; + UCHAR Reserved2; }; union __anonunion____missing_field_name_117 { - struct _LBA LBA ; - struct _MSF MSF ; + struct _LBA LBA; + struct _MSF MSF; }; struct _PLAY_CD { - UCHAR OperationCode ; - UCHAR Reserved1 : 1 ; - UCHAR CMSF : 1 ; - UCHAR ExpectedSectorType : 3 ; - UCHAR Lun : 3 ; - union __anonunion____missing_field_name_117 __annonCompField22 ; - UCHAR Audio : 1 ; - UCHAR Composite : 1 ; - UCHAR Port1 : 1 ; - UCHAR Port2 : 1 ; - UCHAR Reserved2 : 3 ; - UCHAR Speed : 1 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 1; + UCHAR CMSF : 1; + UCHAR ExpectedSectorType : 3; + UCHAR Lun : 3; + union __anonunion____missing_field_name_117 __annonCompField22; + UCHAR Audio : 1; + UCHAR Composite : 1; + UCHAR Port1 : 1; + UCHAR Port2 : 1; + UCHAR Reserved2 : 3; + UCHAR Speed : 1; + UCHAR Control; }; struct _SCAN_CD { - UCHAR OperationCode ; - UCHAR RelativeAddress : 1 ; - UCHAR Reserved1 : 3 ; - UCHAR Direct : 1 ; - UCHAR Lun : 3 ; - UCHAR StartingAddress[4] ; - UCHAR Reserved2[3] ; - UCHAR Reserved3 : 6 ; - UCHAR Type : 2 ; - UCHAR Reserved4 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR RelativeAddress : 1; + UCHAR Reserved1 : 3; + UCHAR Direct : 1; + UCHAR Lun : 3; + UCHAR StartingAddress[4]; + UCHAR Reserved2[3]; + UCHAR Reserved3 : 6; + UCHAR Type : 2; + UCHAR Reserved4; + UCHAR Control; }; struct _STOP_PLAY_SCAN { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR Lun : 3 ; - UCHAR Reserved2[7] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR Reserved2[7]; + UCHAR Control; }; struct _SUBCHANNEL { - UCHAR OperationCode ; - UCHAR Reserved0 : 1 ; - UCHAR Msf : 1 ; - UCHAR Reserved1 : 3 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR Reserved2 : 6 ; - UCHAR SubQ : 1 ; - UCHAR Reserved3 : 1 ; - UCHAR Format ; - UCHAR Reserved4[2] ; - UCHAR TrackNumber ; - UCHAR AllocationLength[2] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved0 : 1; + UCHAR Msf : 1; + UCHAR Reserved1 : 3; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2 : 6; + UCHAR SubQ : 1; + UCHAR Reserved3 : 1; + UCHAR Format; + UCHAR Reserved4[2]; + UCHAR TrackNumber; + UCHAR AllocationLength[2]; + UCHAR Control; }; struct _READ_CD { - UCHAR OperationCode ; - UCHAR RelativeAddress : 1 ; - UCHAR Reserved0 : 1 ; - UCHAR ExpectedSectorType : 3 ; - UCHAR Lun : 3 ; - UCHAR StartingLBA[4] ; - UCHAR TransferBlocks[3] ; - UCHAR Reserved2 : 1 ; - UCHAR ErrorFlags : 2 ; - UCHAR IncludeEDC : 1 ; - UCHAR IncludeUserData : 1 ; - UCHAR HeaderCode : 2 ; - UCHAR IncludeSyncData : 1 ; - UCHAR SubChannelSelection : 3 ; - UCHAR Reserved3 : 5 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR RelativeAddress : 1; + UCHAR Reserved0 : 1; + UCHAR ExpectedSectorType : 3; + UCHAR Lun : 3; + UCHAR StartingLBA[4]; + UCHAR TransferBlocks[3]; + UCHAR Reserved2 : 1; + UCHAR ErrorFlags : 2; + UCHAR IncludeEDC : 1; + UCHAR IncludeUserData : 1; + UCHAR HeaderCode : 2; + UCHAR IncludeSyncData : 1; + UCHAR SubChannelSelection : 3; + UCHAR Reserved3 : 5; + UCHAR Control; }; struct _READ_CD_MSF { - UCHAR OperationCode ; - UCHAR RelativeAddress : 1 ; - UCHAR Reserved1 : 1 ; - UCHAR ExpectedSectorType : 3 ; - UCHAR Lun : 3 ; - UCHAR Reserved2 ; - UCHAR StartingM ; - UCHAR StartingS ; - UCHAR StartingF ; - UCHAR EndingM ; - UCHAR EndingS ; - UCHAR EndingF ; - UCHAR Reserved3 ; - UCHAR Reserved4 : 1 ; - UCHAR ErrorFlags : 2 ; - UCHAR IncludeEDC : 1 ; - UCHAR IncludeUserData : 1 ; - UCHAR HeaderCode : 2 ; - UCHAR IncludeSyncData : 1 ; - UCHAR SubChannelSelection : 3 ; - UCHAR Reserved5 : 5 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR RelativeAddress : 1; + UCHAR Reserved1 : 1; + UCHAR ExpectedSectorType : 3; + UCHAR Lun : 3; + UCHAR Reserved2; + UCHAR StartingM; + UCHAR StartingS; + UCHAR StartingF; + UCHAR EndingM; + UCHAR EndingS; + UCHAR EndingF; + UCHAR Reserved3; + UCHAR Reserved4 : 1; + UCHAR ErrorFlags : 2; + UCHAR IncludeEDC : 1; + UCHAR IncludeUserData : 1; + UCHAR HeaderCode : 2; + UCHAR IncludeSyncData : 1; + UCHAR SubChannelSelection : 3; + UCHAR Reserved5 : 5; + UCHAR Control; }; struct _PLXTR_READ_CDDA { - UCHAR OperationCode ; - UCHAR Reserved0 : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR LogicalBlockByte0 ; - UCHAR LogicalBlockByte1 ; - UCHAR LogicalBlockByte2 ; - UCHAR LogicalBlockByte3 ; - UCHAR TransferBlockByte0 ; - UCHAR TransferBlockByte1 ; - UCHAR TransferBlockByte2 ; - UCHAR TransferBlockByte3 ; - UCHAR SubCode ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved0 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR LogicalBlockByte0; + UCHAR LogicalBlockByte1; + UCHAR LogicalBlockByte2; + UCHAR LogicalBlockByte3; + UCHAR TransferBlockByte0; + UCHAR TransferBlockByte1; + UCHAR TransferBlockByte2; + UCHAR TransferBlockByte3; + UCHAR SubCode; + UCHAR Control; }; struct _NEC_READ_CDDA { - UCHAR OperationCode ; - UCHAR Reserved0 ; - UCHAR LogicalBlockByte0 ; - UCHAR LogicalBlockByte1 ; - UCHAR LogicalBlockByte2 ; - UCHAR LogicalBlockByte3 ; - UCHAR Reserved1 ; - UCHAR TransferBlockByte0 ; - UCHAR TransferBlockByte1 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved0; + UCHAR LogicalBlockByte0; + UCHAR LogicalBlockByte1; + UCHAR LogicalBlockByte2; + UCHAR LogicalBlockByte3; + UCHAR Reserved1; + UCHAR TransferBlockByte0; + UCHAR TransferBlockByte1; + UCHAR Control; }; struct _MODE_SENSE { - UCHAR OperationCode ; - UCHAR Reserved1 : 3 ; - UCHAR Dbd : 1 ; - UCHAR Reserved2 : 1 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR PageCode : 6 ; - UCHAR Pc : 2 ; - UCHAR Reserved3 ; - UCHAR AllocationLength ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 3; + UCHAR Dbd : 1; + UCHAR Reserved2 : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR PageCode : 6; + UCHAR Pc : 2; + UCHAR Reserved3; + UCHAR AllocationLength; + UCHAR Control; }; struct _MODE_SENSE10 { - UCHAR OperationCode ; - UCHAR Reserved1 : 3 ; - UCHAR Dbd : 1 ; - UCHAR Reserved2 : 1 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR PageCode : 6 ; - UCHAR Pc : 2 ; - UCHAR Reserved3[4] ; - UCHAR AllocationLength[2] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 3; + UCHAR Dbd : 1; + UCHAR Reserved2 : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR PageCode : 6; + UCHAR Pc : 2; + UCHAR Reserved3[4]; + UCHAR AllocationLength[2]; + UCHAR Control; }; struct _MODE_SELECT { - UCHAR OperationCode ; - UCHAR SPBit : 1 ; - UCHAR Reserved1 : 3 ; - UCHAR PFBit : 1 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR Reserved2[2] ; - UCHAR ParameterListLength ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR SPBit : 1; + UCHAR Reserved1 : 3; + UCHAR PFBit : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2[2]; + UCHAR ParameterListLength; + UCHAR Control; }; struct _MODE_SELECT10 { - UCHAR OperationCode ; - UCHAR SPBit : 1 ; - UCHAR Reserved1 : 3 ; - UCHAR PFBit : 1 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR Reserved2[5] ; - UCHAR ParameterListLength[2] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR SPBit : 1; + UCHAR Reserved1 : 3; + UCHAR PFBit : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2[5]; + UCHAR ParameterListLength[2]; + UCHAR Control; }; struct _LOCATE { - UCHAR OperationCode ; - UCHAR Immediate : 1 ; - UCHAR CPBit : 1 ; - UCHAR BTBit : 1 ; - UCHAR Reserved1 : 2 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR Reserved3 ; - UCHAR LogicalBlockAddress[4] ; - UCHAR Reserved4 ; - UCHAR Partition ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR CPBit : 1; + UCHAR BTBit : 1; + UCHAR Reserved1 : 2; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved3; + UCHAR LogicalBlockAddress[4]; + UCHAR Reserved4; + UCHAR Partition; + UCHAR Control; }; struct _LOGSENSE { - UCHAR OperationCode ; - UCHAR SPBit : 1 ; - UCHAR PPCBit : 1 ; - UCHAR Reserved1 : 3 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR PageCode : 6 ; - UCHAR PCBit : 2 ; - UCHAR Reserved2 ; - UCHAR Reserved3 ; - UCHAR ParameterPointer[2] ; - UCHAR AllocationLength[2] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR SPBit : 1; + UCHAR PPCBit : 1; + UCHAR Reserved1 : 3; + UCHAR LogicalUnitNumber : 3; + UCHAR PageCode : 6; + UCHAR PCBit : 2; + UCHAR Reserved2; + UCHAR Reserved3; + UCHAR ParameterPointer[2]; + UCHAR AllocationLength[2]; + UCHAR Control; }; struct _LOGSELECT { - UCHAR OperationCode ; - UCHAR SPBit : 1 ; - UCHAR PCRBit : 1 ; - UCHAR Reserved1 : 3 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR Reserved : 6 ; - UCHAR PCBit : 2 ; - UCHAR Reserved2[4] ; - UCHAR ParameterListLength[2] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR SPBit : 1; + UCHAR PCRBit : 1; + UCHAR Reserved1 : 3; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved : 6; + UCHAR PCBit : 2; + UCHAR Reserved2[4]; + UCHAR ParameterListLength[2]; + UCHAR Control; }; struct _PRINT { - UCHAR OperationCode ; - UCHAR Reserved : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR TransferLength[3] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR TransferLength[3]; + UCHAR Control; }; struct _SEEK { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR LogicalBlockAddress[4] ; - UCHAR Reserved2[3] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR LogicalBlockAddress[4]; + UCHAR Reserved2[3]; + UCHAR Control; }; struct _ERASE { - UCHAR OperationCode ; - UCHAR Long : 1 ; - UCHAR Immediate : 1 ; - UCHAR Reserved1 : 3 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR Reserved2[3] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Long : 1; + UCHAR Immediate : 1; + UCHAR Reserved1 : 3; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2[3]; + UCHAR Control; }; struct _START_STOP { - UCHAR OperationCode ; - UCHAR Immediate : 1 ; - UCHAR Reserved1 : 4 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR Reserved2[2] ; - UCHAR Start : 1 ; - UCHAR LoadEject : 1 ; - UCHAR Reserved3 : 6 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR Reserved1 : 4; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2[2]; + UCHAR Start : 1; + UCHAR LoadEject : 1; + UCHAR Reserved3 : 6; + UCHAR Control; }; struct _MEDIA_REMOVAL { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR Reserved2[2] ; - UCHAR Prevent : 1 ; - UCHAR Persistant : 1 ; - UCHAR Reserved3 : 6 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved2[2]; + UCHAR Prevent : 1; + UCHAR Persistant : 1; + UCHAR Reserved3 : 6; + UCHAR Control; }; struct _SEEK_BLOCK { - UCHAR OperationCode ; - UCHAR Immediate : 1 ; - UCHAR Reserved1 : 7 ; - UCHAR BlockAddress[3] ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved2 : 4 ; - UCHAR VendorUnique : 2 ; + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR Reserved1 : 7; + UCHAR BlockAddress[3]; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved2 : 4; + UCHAR VendorUnique : 2; }; struct _REQUEST_BLOCK_ADDRESS { - UCHAR OperationCode ; - UCHAR Reserved1[3] ; - UCHAR AllocationLength ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved2 : 4 ; - UCHAR VendorUnique : 2 ; + UCHAR OperationCode; + UCHAR Reserved1[3]; + UCHAR AllocationLength; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved2 : 4; + UCHAR VendorUnique : 2; }; struct _PARTITION { - UCHAR OperationCode ; - UCHAR Immediate : 1 ; - UCHAR Sel : 1 ; - UCHAR PartitionSelect : 6 ; - UCHAR Reserved1[3] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR Sel : 1; + UCHAR PartitionSelect : 6; + UCHAR Reserved1[3]; + UCHAR Control; }; struct _WRITE_TAPE_MARKS { - UCHAR OperationCode ; - UCHAR Immediate : 1 ; - UCHAR WriteSetMarks : 1 ; - UCHAR Reserved : 3 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR TransferLength[3] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR WriteSetMarks : 1; + UCHAR Reserved : 3; + UCHAR LogicalUnitNumber : 3; + UCHAR TransferLength[3]; + UCHAR Control; }; struct __anonstruct_Fields_119 { - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved : 4 ; - UCHAR VendorUnique : 2 ; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved : 4; + UCHAR VendorUnique : 2; }; union __anonunion_Byte6_118 { - UCHAR value ; - struct __anonstruct_Fields_119 Fields ; + UCHAR value; + struct __anonstruct_Fields_119 Fields; }; struct _SPACE_TAPE_MARKS { - UCHAR OperationCode ; - UCHAR Code : 3 ; - UCHAR Reserved : 2 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR NumMarksMSB ; - UCHAR NumMarks ; - UCHAR NumMarksLSB ; - union __anonunion_Byte6_118 Byte6 ; + UCHAR OperationCode; + UCHAR Code : 3; + UCHAR Reserved : 2; + UCHAR LogicalUnitNumber : 3; + UCHAR NumMarksMSB; + UCHAR NumMarks; + UCHAR NumMarksLSB; + union __anonunion_Byte6_118 Byte6; }; struct _READ_POSITION { - UCHAR Operation ; - UCHAR BlockType : 1 ; - UCHAR Reserved1 : 4 ; - UCHAR Lun : 3 ; - UCHAR Reserved2[7] ; - UCHAR Control ; + UCHAR Operation; + UCHAR BlockType : 1; + UCHAR Reserved1 : 4; + UCHAR Lun : 3; + UCHAR Reserved2[7]; + UCHAR Control; }; struct _CDB6READWRITETAPE { - UCHAR OperationCode ; - UCHAR VendorSpecific : 5 ; - UCHAR Reserved : 3 ; - UCHAR TransferLenMSB ; - UCHAR TransferLen ; - UCHAR TransferLenLSB ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved1 : 4 ; - UCHAR VendorUnique : 2 ; + UCHAR OperationCode; + UCHAR VendorSpecific : 5; + UCHAR Reserved : 3; + UCHAR TransferLenMSB; + UCHAR TransferLen; + UCHAR TransferLenLSB; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved1 : 4; + UCHAR VendorUnique : 2; }; struct _INIT_ELEMENT_STATUS { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR LogicalUnitNubmer : 3 ; - UCHAR Reserved2[3] ; - UCHAR Reserved3 : 7 ; - UCHAR NoBarCode : 1 ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNubmer : 3; + UCHAR Reserved2[3]; + UCHAR Reserved3 : 7; + UCHAR NoBarCode : 1; }; struct _INITIALIZE_ELEMENT_RANGE { - UCHAR OperationCode ; - UCHAR Range : 1 ; - UCHAR Reserved1 : 4 ; - UCHAR LogicalUnitNubmer : 3 ; - UCHAR FirstElementAddress[2] ; - UCHAR Reserved2[2] ; - UCHAR NumberOfElements[2] ; - UCHAR Reserved3 ; - UCHAR Reserved4 : 7 ; - UCHAR NoBarCode : 1 ; + UCHAR OperationCode; + UCHAR Range : 1; + UCHAR Reserved1 : 4; + UCHAR LogicalUnitNubmer : 3; + UCHAR FirstElementAddress[2]; + UCHAR Reserved2[2]; + UCHAR NumberOfElements[2]; + UCHAR Reserved3; + UCHAR Reserved4 : 7; + UCHAR NoBarCode : 1; }; struct _POSITION_TO_ELEMENT { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR TransportElementAddress[2] ; - UCHAR DestinationElementAddress[2] ; - UCHAR Reserved2[2] ; - UCHAR Flip : 1 ; - UCHAR Reserved3 : 7 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR TransportElementAddress[2]; + UCHAR DestinationElementAddress[2]; + UCHAR Reserved2[2]; + UCHAR Flip : 1; + UCHAR Reserved3 : 7; + UCHAR Control; }; struct _MOVE_MEDIUM { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR TransportElementAddress[2] ; - UCHAR SourceElementAddress[2] ; - UCHAR DestinationElementAddress[2] ; - UCHAR Reserved2[2] ; - UCHAR Flip : 1 ; - UCHAR Reserved3 : 7 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR TransportElementAddress[2]; + UCHAR SourceElementAddress[2]; + UCHAR DestinationElementAddress[2]; + UCHAR Reserved2[2]; + UCHAR Flip : 1; + UCHAR Reserved3 : 7; + UCHAR Control; }; struct _EXCHANGE_MEDIUM { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR TransportElementAddress[2] ; - UCHAR SourceElementAddress[2] ; - UCHAR Destination1ElementAddress[2] ; - UCHAR Destination2ElementAddress[2] ; - UCHAR Flip1 : 1 ; - UCHAR Flip2 : 1 ; - UCHAR Reserved3 : 6 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR TransportElementAddress[2]; + UCHAR SourceElementAddress[2]; + UCHAR Destination1ElementAddress[2]; + UCHAR Destination2ElementAddress[2]; + UCHAR Flip1 : 1; + UCHAR Flip2 : 1; + UCHAR Reserved3 : 6; + UCHAR Control; }; struct _READ_ELEMENT_STATUS { - UCHAR OperationCode ; - UCHAR ElementType : 4 ; - UCHAR VolTag : 1 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR StartingElementAddress[2] ; - UCHAR NumberOfElements[2] ; - UCHAR Reserved1 ; - UCHAR AllocationLength[3] ; - UCHAR Reserved2 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR ElementType : 4; + UCHAR VolTag : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR StartingElementAddress[2]; + UCHAR NumberOfElements[2]; + UCHAR Reserved1; + UCHAR AllocationLength[3]; + UCHAR Reserved2; + UCHAR Control; }; struct _SEND_VOLUME_TAG { - UCHAR OperationCode ; - UCHAR ElementType : 4 ; - UCHAR Reserved1 : 1 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR StartingElementAddress[2] ; - UCHAR Reserved2 ; - UCHAR ActionCode : 5 ; - UCHAR Reserved3 : 3 ; - UCHAR Reserved4[2] ; - UCHAR ParameterListLength[2] ; - UCHAR Reserved5 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR ElementType : 4; + UCHAR Reserved1 : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR StartingElementAddress[2]; + UCHAR Reserved2; + UCHAR ActionCode : 5; + UCHAR Reserved3 : 3; + UCHAR Reserved4[2]; + UCHAR ParameterListLength[2]; + UCHAR Reserved5; + UCHAR Control; }; struct _REQUEST_VOLUME_ELEMENT_ADDRESS { - UCHAR OperationCode ; - UCHAR ElementType : 4 ; - UCHAR VolTag : 1 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR StartingElementAddress[2] ; - UCHAR NumberElements[2] ; - UCHAR Reserved1 ; - UCHAR AllocationLength[3] ; - UCHAR Reserved2 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR ElementType : 4; + UCHAR VolTag : 1; + UCHAR LogicalUnitNumber : 3; + UCHAR StartingElementAddress[2]; + UCHAR NumberElements[2]; + UCHAR Reserved1; + UCHAR AllocationLength[3]; + UCHAR Reserved2; + UCHAR Control; }; struct _LOAD_UNLOAD { - UCHAR OperationCode ; - UCHAR Immediate : 1 ; - UCHAR Reserved1 : 4 ; - UCHAR Lun : 3 ; - UCHAR Reserved2[2] ; - UCHAR Start : 1 ; - UCHAR LoadEject : 1 ; - UCHAR Reserved3 : 6 ; - UCHAR Reserved4[3] ; - UCHAR Slot ; - UCHAR Reserved5[3] ; + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR Reserved1 : 4; + UCHAR Lun : 3; + UCHAR Reserved2[2]; + UCHAR Start : 1; + UCHAR LoadEject : 1; + UCHAR Reserved3 : 6; + UCHAR Reserved4[3]; + UCHAR Slot; + UCHAR Reserved5[3]; }; struct _MECH_STATUS { - UCHAR OperationCode ; - UCHAR Reserved : 5 ; - UCHAR Lun : 3 ; - UCHAR Reserved1[6] ; - UCHAR AllocationLength[2] ; - UCHAR Reserved2[1] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved : 5; + UCHAR Lun : 3; + UCHAR Reserved1[6]; + UCHAR AllocationLength[2]; + UCHAR Reserved2[1]; + UCHAR Control; }; struct _SYNCHRONIZE_CACHE10 { - UCHAR OperationCode ; - UCHAR RelAddr : 1 ; - UCHAR Immediate : 1 ; - UCHAR Reserved : 3 ; - UCHAR Lun : 3 ; - UCHAR LogicalBlockAddress[4] ; - UCHAR Reserved2 ; - UCHAR BlockCount[2] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR RelAddr : 1; + UCHAR Immediate : 1; + UCHAR Reserved : 3; + UCHAR Lun : 3; + UCHAR LogicalBlockAddress[4]; + UCHAR Reserved2; + UCHAR BlockCount[2]; + UCHAR Control; }; struct _GET_EVENT_STATUS_NOTIFICATION { - UCHAR OperationCode ; - UCHAR Immediate : 1 ; - UCHAR Reserved : 4 ; - UCHAR Lun : 3 ; - UCHAR Reserved2[2] ; - UCHAR NotificationClassRequest ; - UCHAR Reserved3[2] ; - UCHAR EventListLength[2] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR Reserved : 4; + UCHAR Lun : 3; + UCHAR Reserved2[2]; + UCHAR NotificationClassRequest; + UCHAR Reserved3[2]; + UCHAR EventListLength[2]; + UCHAR Control; }; struct _READ_DVD_STRUCTURE { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR Lun : 3 ; - UCHAR RMDBlockNumber[4] ; - UCHAR LayerNumber ; - UCHAR Format ; - UCHAR AllocationLength[2] ; - UCHAR Reserved3 : 6 ; - UCHAR AGID : 2 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR RMDBlockNumber[4]; + UCHAR LayerNumber; + UCHAR Format; + UCHAR AllocationLength[2]; + UCHAR Reserved3 : 6; + UCHAR AGID : 2; + UCHAR Control; }; struct _SEND_KEY { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR Lun : 3 ; - UCHAR Reserved2[6] ; - UCHAR ParameterListLength[2] ; - UCHAR KeyFormat : 6 ; - UCHAR AGID : 2 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR Reserved2[6]; + UCHAR ParameterListLength[2]; + UCHAR KeyFormat : 6; + UCHAR AGID : 2; + UCHAR Control; }; struct _REPORT_KEY { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR Lun : 3 ; - UCHAR LogicalBlockAddress[4] ; - UCHAR Reserved2[2] ; - UCHAR AllocationLength[2] ; - UCHAR KeyFormat : 6 ; - UCHAR AGID : 2 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR LogicalBlockAddress[4]; + UCHAR Reserved2[2]; + UCHAR AllocationLength[2]; + UCHAR KeyFormat : 6; + UCHAR AGID : 2; + UCHAR Control; }; struct _SET_READ_AHEAD { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR Lun : 3 ; - UCHAR TriggerLBA[4] ; - UCHAR ReadAheadLBA[4] ; - UCHAR Reserved2 ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR TriggerLBA[4]; + UCHAR ReadAheadLBA[4]; + UCHAR Reserved2; + UCHAR Control; }; struct _READ_FORMATTED_CAPACITIES { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR Lun : 3 ; - UCHAR Reserved2[5] ; - UCHAR AllocationLength[2] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR Reserved2[5]; + UCHAR AllocationLength[2]; + UCHAR Control; }; struct _REPORT_LUNS { - UCHAR OperationCode ; - UCHAR Reserved1[5] ; - UCHAR AllocationLength[4] ; - UCHAR Reserved2[1] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1[5]; + UCHAR AllocationLength[4]; + UCHAR Reserved2[1]; + UCHAR Control; }; union _CDB { - struct _CDB6GENERIC CDB6GENERIC ; - struct _CDB6GENERIC *PCDB6GENERIC ; - struct _CDB6READWRITE CDB6READWRITE ; - struct _CDB6READWRITE *PCDB6READWRITE ; - struct _CDB6INQUIRY CDB6INQUIRY ; - struct _CDB6INQUIRY *PCDB6INQUIRY ; - struct _CDB6VERIFY CDB6VERIFY ; - struct _CDB6VERIFY *PCDB6VERIFY ; - struct _CDB6FORMAT CDB6FORMAT ; - struct _CDB6FORMAT *PCDB6FORMAT ; - struct _CDB10 CDB10 ; - struct _CDB10 *PCDB10 ; - struct _CDB12 CDB12 ; - struct _CDB12 *PCDB12 ; - struct _PAUSE_RESUME PAUSE_RESUME ; - struct _PAUSE_RESUME *PPAUSE_RESUME ; - struct _READ_TOC READ_TOC ; - struct _READ_TOC *PREAD_TOC ; - struct _READ_DISK_INFORMATION READ_DISK_INFORMATION ; - struct _READ_DISK_INFORMATION *PREAD_DISK_INFORMATION ; - struct _READ_TRACK_INFORMATION READ_TRACK_INFORMATION ; - struct _READ_TRACK_INFORMATION *PREAD_TRACK_INFORMATION ; - struct _READ_HEADER READ_HEADER ; - struct _READ_HEADER *PREAD_HEADER ; - struct _PLAY_AUDIO PLAY_AUDIO ; - struct _PLAY_AUDIO *PPLAY_AUDIO ; - struct _PLAY_AUDIO_MSF PLAY_AUDIO_MSF ; - struct _PLAY_AUDIO_MSF *PPLAY_AUDIO_MSF ; - struct _PLAY_CD PLAY_CD ; - struct _PLAY_CD *PPLAY_CD ; - struct _SCAN_CD SCAN_CD ; - struct _SCAN_CD *PSCAN_CD ; - struct _STOP_PLAY_SCAN STOP_PLAY_SCAN ; - struct _STOP_PLAY_SCAN *PSTOP_PLAY_SCAN ; - struct _SUBCHANNEL SUBCHANNEL ; - struct _SUBCHANNEL *PSUBCHANNEL ; - struct _READ_CD READ_CD ; - struct _READ_CD *PREAD_CD ; - struct _READ_CD_MSF READ_CD_MSF ; - struct _READ_CD_MSF *PREAD_CD_MSF ; - struct _PLXTR_READ_CDDA PLXTR_READ_CDDA ; - struct _PLXTR_READ_CDDA *PPLXTR_READ_CDDA ; - struct _NEC_READ_CDDA NEC_READ_CDDA ; - struct _NEC_READ_CDDA *PNEC_READ_CDDA ; - struct _MODE_SENSE MODE_SENSE ; - struct _MODE_SENSE *PMODE_SENSE ; - struct _MODE_SENSE10 MODE_SENSE10 ; - struct _MODE_SENSE10 *PMODE_SENSE10 ; - struct _MODE_SELECT MODE_SELECT ; - struct _MODE_SELECT *PMODE_SELECT ; - struct _MODE_SELECT10 MODE_SELECT10 ; - struct _MODE_SELECT10 *PMODE_SELECT10 ; - struct _LOCATE LOCATE ; - struct _LOCATE *PLOCATE ; - struct _LOGSENSE LOGSENSE ; - struct _LOGSENSE *PLOGSENSE ; - struct _LOGSELECT LOGSELECT ; - struct _LOGSELECT *PLOGSELECT ; - struct _PRINT PRINT ; - struct _PRINT *PPRINT ; - struct _SEEK SEEK ; - struct _SEEK *PSEEK ; - struct _ERASE ERASE ; - struct _ERASE *PERASE ; - struct _START_STOP START_STOP ; - struct _START_STOP *PSTART_STOP ; - struct _MEDIA_REMOVAL MEDIA_REMOVAL ; - struct _MEDIA_REMOVAL *PMEDIA_REMOVAL ; - struct _SEEK_BLOCK SEEK_BLOCK ; - struct _SEEK_BLOCK *PSEEK_BLOCK ; - struct _REQUEST_BLOCK_ADDRESS REQUEST_BLOCK_ADDRESS ; - struct _REQUEST_BLOCK_ADDRESS *PREQUEST_BLOCK_ADDRESS ; - struct _PARTITION PARTITION ; - struct _PARTITION *PPARTITION ; - struct _WRITE_TAPE_MARKS WRITE_TAPE_MARKS ; - struct _WRITE_TAPE_MARKS *PWRITE_TAPE_MARKS ; - struct _SPACE_TAPE_MARKS SPACE_TAPE_MARKS ; - struct _SPACE_TAPE_MARKS *PSPACE_TAPE_MARKS ; - struct _READ_POSITION READ_POSITION ; - struct _READ_POSITION *PREAD_POSITION ; - struct _CDB6READWRITETAPE CDB6READWRITETAPE ; - struct _CDB6READWRITETAPE *PCDB6READWRITETAPE ; - struct _INIT_ELEMENT_STATUS INIT_ELEMENT_STATUS ; - struct _INIT_ELEMENT_STATUS *PINIT_ELEMENT_STATUS ; - struct _INITIALIZE_ELEMENT_RANGE INITIALIZE_ELEMENT_RANGE ; - struct _INITIALIZE_ELEMENT_RANGE *PINITIALIZE_ELEMENT_RANGE ; - struct _POSITION_TO_ELEMENT POSITION_TO_ELEMENT ; - struct _POSITION_TO_ELEMENT *PPOSITION_TO_ELEMENT ; - struct _MOVE_MEDIUM MOVE_MEDIUM ; - struct _MOVE_MEDIUM *PMOVE_MEDIUM ; - struct _EXCHANGE_MEDIUM EXCHANGE_MEDIUM ; - struct _EXCHANGE_MEDIUM *PEXCHANGE_MEDIUM ; - struct _READ_ELEMENT_STATUS READ_ELEMENT_STATUS ; - struct _READ_ELEMENT_STATUS *PREAD_ELEMENT_STATUS ; - struct _SEND_VOLUME_TAG SEND_VOLUME_TAG ; - struct _SEND_VOLUME_TAG *PSEND_VOLUME_TAG ; - struct _REQUEST_VOLUME_ELEMENT_ADDRESS REQUEST_VOLUME_ELEMENT_ADDRESS ; - struct _REQUEST_VOLUME_ELEMENT_ADDRESS *PREQUEST_VOLUME_ELEMENT_ADDRESS ; - struct _LOAD_UNLOAD LOAD_UNLOAD ; - struct _LOAD_UNLOAD *PLOAD_UNLOAD ; - struct _MECH_STATUS MECH_STATUS ; - struct _MECH_STATUS *PMECH_STATUS ; - struct _SYNCHRONIZE_CACHE10 SYNCHRONIZE_CACHE10 ; - struct _SYNCHRONIZE_CACHE10 *PSYNCHRONIZE_CACHE10 ; - struct _GET_EVENT_STATUS_NOTIFICATION GET_EVENT_STATUS_NOTIFICATION ; - struct _GET_EVENT_STATUS_NOTIFICATION *PGET_EVENT_STATUS_NOTIFICATION ; - struct _READ_DVD_STRUCTURE READ_DVD_STRUCTURE ; - struct _READ_DVD_STRUCTURE *PREAD_DVD_STRUCTURE ; - struct _SEND_KEY SEND_KEY ; - struct _SEND_KEY *PSEND_KEY ; - struct _REPORT_KEY REPORT_KEY ; - struct _REPORT_KEY *PREPORT_KEY ; - struct _SET_READ_AHEAD SET_READ_AHEAD ; - struct _SET_READ_AHEAD *PSET_READ_AHEAD ; - struct _READ_FORMATTED_CAPACITIES READ_FORMATTED_CAPACITIES ; - struct _READ_FORMATTED_CAPACITIES *PREAD_FORMATTED_CAPACITIES ; - struct _REPORT_LUNS REPORT_LUNS ; - struct _REPORT_LUNS *PREPORT_LUNS ; - ULONG AsUlong[4] ; - UCHAR AsByte[16] ; + struct _CDB6GENERIC CDB6GENERIC; + struct _CDB6GENERIC *PCDB6GENERIC; + struct _CDB6READWRITE CDB6READWRITE; + struct _CDB6READWRITE *PCDB6READWRITE; + struct _CDB6INQUIRY CDB6INQUIRY; + struct _CDB6INQUIRY *PCDB6INQUIRY; + struct _CDB6VERIFY CDB6VERIFY; + struct _CDB6VERIFY *PCDB6VERIFY; + struct _CDB6FORMAT CDB6FORMAT; + struct _CDB6FORMAT *PCDB6FORMAT; + struct _CDB10 CDB10; + struct _CDB10 *PCDB10; + struct _CDB12 CDB12; + struct _CDB12 *PCDB12; + struct _PAUSE_RESUME PAUSE_RESUME; + struct _PAUSE_RESUME *PPAUSE_RESUME; + struct _READ_TOC READ_TOC; + struct _READ_TOC *PREAD_TOC; + struct _READ_DISK_INFORMATION READ_DISK_INFORMATION; + struct _READ_DISK_INFORMATION *PREAD_DISK_INFORMATION; + struct _READ_TRACK_INFORMATION READ_TRACK_INFORMATION; + struct _READ_TRACK_INFORMATION *PREAD_TRACK_INFORMATION; + struct _READ_HEADER READ_HEADER; + struct _READ_HEADER *PREAD_HEADER; + struct _PLAY_AUDIO PLAY_AUDIO; + struct _PLAY_AUDIO *PPLAY_AUDIO; + struct _PLAY_AUDIO_MSF PLAY_AUDIO_MSF; + struct _PLAY_AUDIO_MSF *PPLAY_AUDIO_MSF; + struct _PLAY_CD PLAY_CD; + struct _PLAY_CD *PPLAY_CD; + struct _SCAN_CD SCAN_CD; + struct _SCAN_CD *PSCAN_CD; + struct _STOP_PLAY_SCAN STOP_PLAY_SCAN; + struct _STOP_PLAY_SCAN *PSTOP_PLAY_SCAN; + struct _SUBCHANNEL SUBCHANNEL; + struct _SUBCHANNEL *PSUBCHANNEL; + struct _READ_CD READ_CD; + struct _READ_CD *PREAD_CD; + struct _READ_CD_MSF READ_CD_MSF; + struct _READ_CD_MSF *PREAD_CD_MSF; + struct _PLXTR_READ_CDDA PLXTR_READ_CDDA; + struct _PLXTR_READ_CDDA *PPLXTR_READ_CDDA; + struct _NEC_READ_CDDA NEC_READ_CDDA; + struct _NEC_READ_CDDA *PNEC_READ_CDDA; + struct _MODE_SENSE MODE_SENSE; + struct _MODE_SENSE *PMODE_SENSE; + struct _MODE_SENSE10 MODE_SENSE10; + struct _MODE_SENSE10 *PMODE_SENSE10; + struct _MODE_SELECT MODE_SELECT; + struct _MODE_SELECT *PMODE_SELECT; + struct _MODE_SELECT10 MODE_SELECT10; + struct _MODE_SELECT10 *PMODE_SELECT10; + struct _LOCATE LOCATE; + struct _LOCATE *PLOCATE; + struct _LOGSENSE LOGSENSE; + struct _LOGSENSE *PLOGSENSE; + struct _LOGSELECT LOGSELECT; + struct _LOGSELECT *PLOGSELECT; + struct _PRINT PRINT; + struct _PRINT *PPRINT; + struct _SEEK SEEK; + struct _SEEK *PSEEK; + struct _ERASE ERASE; + struct _ERASE *PERASE; + struct _START_STOP START_STOP; + struct _START_STOP *PSTART_STOP; + struct _MEDIA_REMOVAL MEDIA_REMOVAL; + struct _MEDIA_REMOVAL *PMEDIA_REMOVAL; + struct _SEEK_BLOCK SEEK_BLOCK; + struct _SEEK_BLOCK *PSEEK_BLOCK; + struct _REQUEST_BLOCK_ADDRESS REQUEST_BLOCK_ADDRESS; + struct _REQUEST_BLOCK_ADDRESS *PREQUEST_BLOCK_ADDRESS; + struct _PARTITION PARTITION; + struct _PARTITION *PPARTITION; + struct _WRITE_TAPE_MARKS WRITE_TAPE_MARKS; + struct _WRITE_TAPE_MARKS *PWRITE_TAPE_MARKS; + struct _SPACE_TAPE_MARKS SPACE_TAPE_MARKS; + struct _SPACE_TAPE_MARKS *PSPACE_TAPE_MARKS; + struct _READ_POSITION READ_POSITION; + struct _READ_POSITION *PREAD_POSITION; + struct _CDB6READWRITETAPE CDB6READWRITETAPE; + struct _CDB6READWRITETAPE *PCDB6READWRITETAPE; + struct _INIT_ELEMENT_STATUS INIT_ELEMENT_STATUS; + struct _INIT_ELEMENT_STATUS *PINIT_ELEMENT_STATUS; + struct _INITIALIZE_ELEMENT_RANGE INITIALIZE_ELEMENT_RANGE; + struct _INITIALIZE_ELEMENT_RANGE *PINITIALIZE_ELEMENT_RANGE; + struct _POSITION_TO_ELEMENT POSITION_TO_ELEMENT; + struct _POSITION_TO_ELEMENT *PPOSITION_TO_ELEMENT; + struct _MOVE_MEDIUM MOVE_MEDIUM; + struct _MOVE_MEDIUM *PMOVE_MEDIUM; + struct _EXCHANGE_MEDIUM EXCHANGE_MEDIUM; + struct _EXCHANGE_MEDIUM *PEXCHANGE_MEDIUM; + struct _READ_ELEMENT_STATUS READ_ELEMENT_STATUS; + struct _READ_ELEMENT_STATUS *PREAD_ELEMENT_STATUS; + struct _SEND_VOLUME_TAG SEND_VOLUME_TAG; + struct _SEND_VOLUME_TAG *PSEND_VOLUME_TAG; + struct _REQUEST_VOLUME_ELEMENT_ADDRESS REQUEST_VOLUME_ELEMENT_ADDRESS; + struct _REQUEST_VOLUME_ELEMENT_ADDRESS *PREQUEST_VOLUME_ELEMENT_ADDRESS; + struct _LOAD_UNLOAD LOAD_UNLOAD; + struct _LOAD_UNLOAD *PLOAD_UNLOAD; + struct _MECH_STATUS MECH_STATUS; + struct _MECH_STATUS *PMECH_STATUS; + struct _SYNCHRONIZE_CACHE10 SYNCHRONIZE_CACHE10; + struct _SYNCHRONIZE_CACHE10 *PSYNCHRONIZE_CACHE10; + struct _GET_EVENT_STATUS_NOTIFICATION GET_EVENT_STATUS_NOTIFICATION; + struct _GET_EVENT_STATUS_NOTIFICATION *PGET_EVENT_STATUS_NOTIFICATION; + struct _READ_DVD_STRUCTURE READ_DVD_STRUCTURE; + struct _READ_DVD_STRUCTURE *PREAD_DVD_STRUCTURE; + struct _SEND_KEY SEND_KEY; + struct _SEND_KEY *PSEND_KEY; + struct _REPORT_KEY REPORT_KEY; + struct _REPORT_KEY *PREPORT_KEY; + struct _SET_READ_AHEAD SET_READ_AHEAD; + struct _SET_READ_AHEAD *PSET_READ_AHEAD; + struct _READ_FORMATTED_CAPACITIES READ_FORMATTED_CAPACITIES; + struct _READ_FORMATTED_CAPACITIES *PREAD_FORMATTED_CAPACITIES; + struct _REPORT_LUNS REPORT_LUNS; + struct _REPORT_LUNS *PREPORT_LUNS; + ULONG AsUlong[4]; + UCHAR AsByte[16]; }; typedef union _CDB *PCDB; #pragma pack(1) #pragma pack() struct _INQUIRYDATA { - UCHAR DeviceType : 5 ; - UCHAR DeviceTypeQualifier : 3 ; - UCHAR DeviceTypeModifier : 7 ; - UCHAR RemovableMedia : 1 ; - UCHAR Versions ; - UCHAR ResponseDataFormat : 4 ; - UCHAR HiSupport : 1 ; - UCHAR NormACA : 1 ; - UCHAR ReservedBit : 1 ; - UCHAR AERC : 1 ; - UCHAR AdditionalLength ; - UCHAR Reserved[2] ; - UCHAR SoftReset : 1 ; - UCHAR CommandQueue : 1 ; - UCHAR Reserved2 : 1 ; - UCHAR LinkedCommands : 1 ; - UCHAR Synchronous : 1 ; - UCHAR Wide16Bit : 1 ; - UCHAR Wide32Bit : 1 ; - UCHAR RelativeAddressing : 1 ; - UCHAR VendorId[8] ; - UCHAR ProductId[16] ; - UCHAR ProductRevisionLevel[4] ; - UCHAR VendorSpecific[20] ; - UCHAR Reserved3[40] ; + UCHAR DeviceType : 5; + UCHAR DeviceTypeQualifier : 3; + UCHAR DeviceTypeModifier : 7; + UCHAR RemovableMedia : 1; + UCHAR Versions; + UCHAR ResponseDataFormat : 4; + UCHAR HiSupport : 1; + UCHAR NormACA : 1; + UCHAR ReservedBit : 1; + UCHAR AERC : 1; + UCHAR AdditionalLength; + UCHAR Reserved[2]; + UCHAR SoftReset : 1; + UCHAR CommandQueue : 1; + UCHAR Reserved2 : 1; + UCHAR LinkedCommands : 1; + UCHAR Synchronous : 1; + UCHAR Wide16Bit : 1; + UCHAR Wide32Bit : 1; + UCHAR RelativeAddressing : 1; + UCHAR VendorId[8]; + UCHAR ProductId[16]; + UCHAR ProductRevisionLevel[4]; + UCHAR VendorSpecific[20]; + UCHAR Reserved3[40]; }; typedef struct _INQUIRYDATA *PINQUIRYDATA; struct _READ_CAPACITY_DATA { - ULONG LogicalBlockAddress ; - ULONG BytesPerBlock ; + ULONG LogicalBlockAddress; + ULONG BytesPerBlock; }; typedef struct _READ_CAPACITY_DATA READ_CAPACITY_DATA; typedef struct _READ_CAPACITY_DATA *PREAD_CAPACITY_DATA; struct _CD_DEVICE_EXTENSION { - PDEVICE_OBJECT TargetDeviceObject ; - PDEVICE_OBJECT TargetPdo ; - PDEVICE_OBJECT DeviceObject ; - ULONG PagingPathCount ; - KEVENT PagingPathCountEvent ; - PRKDPC Dpc ; - PKTIMER Timer ; - LONG Sync ; - UCHAR Active ; - UCHAR Paused ; - UCHAR PausedM ; - UCHAR PausedS ; - UCHAR PausedF ; - UCHAR LastEndM ; - UCHAR LastEndS ; - UCHAR LastEndF ; - BOOLEAN PlayActive ; + PDEVICE_OBJECT TargetDeviceObject; + PDEVICE_OBJECT TargetPdo; + PDEVICE_OBJECT DeviceObject; + ULONG PagingPathCount; + KEVENT PagingPathCountEvent; + PRKDPC Dpc; + PKTIMER Timer; + LONG Sync; + UCHAR Active; + UCHAR Paused; + UCHAR PausedM; + UCHAR PausedS; + UCHAR PausedF; + UCHAR LastEndM; + UCHAR LastEndS; + UCHAR LastEndF; + BOOLEAN PlayActive; }; typedef struct _CD_DEVICE_EXTENSION CD_DEVICE_EXTENSION; typedef struct _CD_DEVICE_EXTENSION *PCD_DEVICE_EXTENSION; struct _NEC_READ_TOC { - UCHAR OperationCode ; - UCHAR Type : 2 ; - UCHAR Reserved1 : 6 ; - UCHAR TrackNumber ; - UCHAR Reserved2[6] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Type : 2; + UCHAR Reserved1 : 6; + UCHAR TrackNumber; + UCHAR Reserved2[6]; + UCHAR Control; }; struct _NEC_PLAY_AUDIO { - UCHAR OperationCode ; - UCHAR PlayMode : 3 ; - UCHAR Reserved1 : 5 ; - UCHAR Minute ; - UCHAR Second ; - UCHAR Frame ; - UCHAR Reserved2[4] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR PlayMode : 3; + UCHAR Reserved1 : 5; + UCHAR Minute; + UCHAR Second; + UCHAR Frame; + UCHAR Reserved2[4]; + UCHAR Control; }; struct _NEC_SEEK_AUDIO { - UCHAR OperationCode ; - UCHAR Play : 1 ; - UCHAR Reserved1 : 7 ; - UCHAR Minute ; - UCHAR Second ; - UCHAR Frame ; - UCHAR Reserved2[4] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Play : 1; + UCHAR Reserved1 : 7; + UCHAR Minute; + UCHAR Second; + UCHAR Frame; + UCHAR Reserved2[4]; + UCHAR Control; }; struct _NEC_PAUSE_AUDIO { - UCHAR OperationCode ; - UCHAR Reserved1[8] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Reserved1[8]; + UCHAR Control; }; struct _NEC_READ_Q_CHANNEL { - UCHAR OperationCode ; - UCHAR TransferSize : 5 ; - UCHAR Reserved1 : 3 ; - UCHAR Reserved2[7] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR TransferSize : 5; + UCHAR Reserved1 : 3; + UCHAR Reserved2[7]; + UCHAR Control; }; struct _NEC_EJECT { - UCHAR OperationCode ; - UCHAR Immediate : 1 ; - UCHAR Reserved1 : 7 ; - UCHAR Reserved2[7] ; - UCHAR Control ; + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR Reserved1 : 7; + UCHAR Reserved2[7]; + UCHAR Control; }; union _NEC_CDB { - struct _NEC_READ_TOC NEC_READ_TOC ; - struct _NEC_READ_TOC *PNEC_READ_TOC ; - struct _NEC_PLAY_AUDIO NEC_PLAY_AUDIO ; - struct _NEC_PLAY_AUDIO *PNEC_PLAY_AUDIO ; - struct _NEC_SEEK_AUDIO NEC_SEEK_AUDIO ; - struct _NEC_SEEK_AUDIO *PNEC_SEEK_AUDIO ; - struct _NEC_PAUSE_AUDIO NEC_PAUSE_AUDIO ; - struct _NEC_PAUSE_AUDIO *PNEC_PAUSE_AUDIO ; - struct _NEC_READ_Q_CHANNEL NEC_READ_Q_CHANNEL ; - struct _NEC_READ_Q_CHANNEL *PNEC_READ_Q_CHANNEL ; - struct _NEC_EJECT NEC_EJECT ; - struct _NEC_EJECT *PNEC_EJECT ; + struct _NEC_READ_TOC NEC_READ_TOC; + struct _NEC_READ_TOC *PNEC_READ_TOC; + struct _NEC_PLAY_AUDIO NEC_PLAY_AUDIO; + struct _NEC_PLAY_AUDIO *PNEC_PLAY_AUDIO; + struct _NEC_SEEK_AUDIO NEC_SEEK_AUDIO; + struct _NEC_SEEK_AUDIO *PNEC_SEEK_AUDIO; + struct _NEC_PAUSE_AUDIO NEC_PAUSE_AUDIO; + struct _NEC_PAUSE_AUDIO *PNEC_PAUSE_AUDIO; + struct _NEC_READ_Q_CHANNEL NEC_READ_Q_CHANNEL; + struct _NEC_READ_Q_CHANNEL *PNEC_READ_Q_CHANNEL; + struct _NEC_EJECT NEC_EJECT; + struct _NEC_EJECT *PNEC_EJECT; }; typedef union _NEC_CDB *PNEC_CDB; struct _PNR_START_STOP { - UCHAR OperationCode ; - UCHAR Immediate : 1 ; - UCHAR Reserved1 : 4 ; - UCHAR Lun : 3 ; - UCHAR Reserved2 : 7 ; - UCHAR PCF : 1 ; - UCHAR Reserved3 ; - UCHAR Start : 1 ; - UCHAR Eject : 1 ; - UCHAR Reserved4 : 6 ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved5 : 4 ; - UCHAR Vendor : 2 ; + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR Reserved1 : 4; + UCHAR Lun : 3; + UCHAR Reserved2 : 7; + UCHAR PCF : 1; + UCHAR Reserved3; + UCHAR Start : 1; + UCHAR Eject : 1; + UCHAR Reserved4 : 6; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved5 : 4; + UCHAR Vendor : 2; }; struct _PNR_READ_TOC { - UCHAR OperationCode ; - UCHAR Reserved1 : 5 ; - UCHAR Lun : 3 ; - UCHAR Reserved2[3] ; - UCHAR TrackNumber ; - UCHAR Reserved3 ; - UCHAR AssignedLength[2] ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved4 : 4 ; - UCHAR Type : 2 ; + UCHAR OperationCode; + UCHAR Reserved1 : 5; + UCHAR Lun : 3; + UCHAR Reserved2[3]; + UCHAR TrackNumber; + UCHAR Reserved3; + UCHAR AssignedLength[2]; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved4 : 4; + UCHAR Type : 2; }; struct _PNR_PLAY_AUDIO { - UCHAR OperationCode ; - UCHAR PlayMode : 4 ; - UCHAR StopAddr : 1 ; - UCHAR Lun : 3 ; - UCHAR Reserved1 ; - UCHAR Minute ; - UCHAR Second ; - UCHAR Frame ; - UCHAR Reserved2[3] ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved3 : 4 ; - UCHAR Type : 2 ; + UCHAR OperationCode; + UCHAR PlayMode : 4; + UCHAR StopAddr : 1; + UCHAR Lun : 3; + UCHAR Reserved1; + UCHAR Minute; + UCHAR Second; + UCHAR Frame; + UCHAR Reserved2[3]; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved3 : 4; + UCHAR Type : 2; }; struct _PNR_SEEK_AUDIO { - UCHAR OperationCode ; - UCHAR PlayMode : 4 ; - UCHAR PlayBack : 1 ; - UCHAR Lun : 3 ; - UCHAR Reserved1 ; - UCHAR Minute ; - UCHAR Second ; - UCHAR Frame ; - UCHAR Reserved2[3] ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved3 : 4 ; - UCHAR Type : 2 ; + UCHAR OperationCode; + UCHAR PlayMode : 4; + UCHAR PlayBack : 1; + UCHAR Lun : 3; + UCHAR Reserved1; + UCHAR Minute; + UCHAR Second; + UCHAR Frame; + UCHAR Reserved2[3]; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved3 : 4; + UCHAR Type : 2; }; struct _PNR_PAUSE_AUDIO { - UCHAR OperationCode ; - UCHAR Reserved1 : 4 ; - UCHAR Pause : 1 ; - UCHAR Lun : 3 ; - UCHAR Reserved2[7] ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved3 : 4 ; - UCHAR Reserved4 : 2 ; + UCHAR OperationCode; + UCHAR Reserved1 : 4; + UCHAR Pause : 1; + UCHAR Lun : 3; + UCHAR Reserved2[7]; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved3 : 4; + UCHAR Reserved4 : 2; }; struct _PNR_AUDIO_STATUS { - UCHAR OperationCode ; - UCHAR Reserved1 : 4 ; - UCHAR Reserved2 : 1 ; - UCHAR Lun : 3 ; - UCHAR Reserved3[6] ; - UCHAR AssignedLength ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved4 : 4 ; - UCHAR Reserved5 : 2 ; + UCHAR OperationCode; + UCHAR Reserved1 : 4; + UCHAR Reserved2 : 1; + UCHAR Lun : 3; + UCHAR Reserved3[6]; + UCHAR AssignedLength; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved4 : 4; + UCHAR Reserved5 : 2; }; struct _PNR_READ_Q_CHANNEL { - UCHAR OperationCode ; - UCHAR Reserved1 : 4 ; - UCHAR Reserved2 : 1 ; - UCHAR Lun : 3 ; - UCHAR Reserved3[6] ; - UCHAR AssignedLength ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved4 : 4 ; - UCHAR Reserved5 : 2 ; + UCHAR OperationCode; + UCHAR Reserved1 : 4; + UCHAR Reserved2 : 1; + UCHAR Lun : 3; + UCHAR Reserved3[6]; + UCHAR AssignedLength; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved4 : 4; + UCHAR Reserved5 : 2; }; struct _PNR_EJECT { - UCHAR OperationCode ; - UCHAR Immediate : 1 ; - UCHAR Reserved1 : 4 ; - UCHAR Lun : 3 ; - UCHAR Reserved2[7] ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved4 : 4 ; - UCHAR Reserved5 : 2 ; + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR Reserved1 : 4; + UCHAR Lun : 3; + UCHAR Reserved2[7]; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved4 : 4; + UCHAR Reserved5 : 2; }; struct _PNR_READ_STATUS { - UCHAR OperationCode ; - UCHAR Reserved1 : 4 ; - UCHAR Lun : 3 ; - UCHAR PageCode : 5 ; - UCHAR PCField : 1 ; - UCHAR Reserved2[5] ; - UCHAR AllocationLengthMsb ; - UCHAR AllocationLengthLsb ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved3 : 4 ; - UCHAR Reserved4 : 2 ; + UCHAR OperationCode; + UCHAR Reserved1 : 4; + UCHAR Lun : 3; + UCHAR PageCode : 5; + UCHAR PCField : 1; + UCHAR Reserved2[5]; + UCHAR AllocationLengthMsb; + UCHAR AllocationLengthLsb; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved3 : 4; + UCHAR Reserved4 : 2; }; union _PIONEER_CDB { - struct _PNR_START_STOP PNR_START_STOP ; - struct _PNR_START_STOP *PPNR_START_STOP ; - struct _PNR_READ_TOC PNR_READ_TOC ; - struct _PNR_READ_TOC *PPNR_READ_TOC ; - struct _PNR_PLAY_AUDIO PNR_PLAY_AUDIO ; - struct _PNR_PLAY_AUDIO *PPNR_PLAY_AUDIO ; - struct _PNR_SEEK_AUDIO PNR_SEEK_AUDIO ; - struct _PNR_SEEK_AUDIO *PPNR_SEEK_AUDIO ; - struct _PNR_PAUSE_AUDIO PNR_PAUSE_AUDIO ; - struct _PNR_PAUSE_AUDIO *PPNR_PAUSE_AUDIO ; - struct _PNR_AUDIO_STATUS PNR_AUDIO_STATUS ; - struct _PNR_AUDIO_STATUS *PPNR_AUDIO_STATUS ; - struct _PNR_READ_Q_CHANNEL PNR_READ_Q_CHANNEL ; - struct _PNR_READ_Q_CHANNEL *PPNR_READ_Q_CHANNEL ; - struct _PNR_EJECT PNR_EJECT ; - struct _PNR_EJECT *PPNR_EJECT ; - struct _PNR_READ_STATUS PNR_READ_STATUS ; - struct _PNR_READ_STATUS *PPNR_READ_STATUS ; + struct _PNR_START_STOP PNR_START_STOP; + struct _PNR_START_STOP *PPNR_START_STOP; + struct _PNR_READ_TOC PNR_READ_TOC; + struct _PNR_READ_TOC *PPNR_READ_TOC; + struct _PNR_PLAY_AUDIO PNR_PLAY_AUDIO; + struct _PNR_PLAY_AUDIO *PPNR_PLAY_AUDIO; + struct _PNR_SEEK_AUDIO PNR_SEEK_AUDIO; + struct _PNR_SEEK_AUDIO *PPNR_SEEK_AUDIO; + struct _PNR_PAUSE_AUDIO PNR_PAUSE_AUDIO; + struct _PNR_PAUSE_AUDIO *PPNR_PAUSE_AUDIO; + struct _PNR_AUDIO_STATUS PNR_AUDIO_STATUS; + struct _PNR_AUDIO_STATUS *PPNR_AUDIO_STATUS; + struct _PNR_READ_Q_CHANNEL PNR_READ_Q_CHANNEL; + struct _PNR_READ_Q_CHANNEL *PPNR_READ_Q_CHANNEL; + struct _PNR_EJECT PNR_EJECT; + struct _PNR_EJECT *PPNR_EJECT; + struct _PNR_READ_STATUS PNR_READ_STATUS; + struct _PNR_READ_STATUS *PPNR_READ_STATUS; }; typedef union _PIONEER_CDB *PPNR_CDB; struct _READ_DISC_INFO { - UCHAR OperationCode ; - UCHAR Reserved : 5 ; - UCHAR LogicalUnitNumber : 3 ; - UCHAR Reserved1[7] ; - UCHAR AllocationLength[2] ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved2 : 4 ; - UCHAR VendorUniqueBits : 2 ; + UCHAR OperationCode; + UCHAR Reserved : 5; + UCHAR LogicalUnitNumber : 3; + UCHAR Reserved1[7]; + UCHAR AllocationLength[2]; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved2 : 4; + UCHAR VendorUniqueBits : 2; }; struct __anonstruct_PLAY_AUDIO_127 { - UCHAR OperationCode ; - UCHAR Immediate : 1 ; - UCHAR Right : 1 ; - UCHAR Left : 1 ; - UCHAR Reserved : 2 ; - UCHAR Lun : 3 ; - UCHAR StartingM ; - UCHAR StartingS ; - UCHAR StartingF ; - UCHAR Reserved1[2] ; - UCHAR EndingM ; - UCHAR EndingS ; - UCHAR EndingF ; - UCHAR Reserved2 ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved3 : 4 ; - UCHAR VendorUniqueBits : 2 ; + UCHAR OperationCode; + UCHAR Immediate : 1; + UCHAR Right : 1; + UCHAR Left : 1; + UCHAR Reserved : 2; + UCHAR Lun : 3; + UCHAR StartingM; + UCHAR StartingS; + UCHAR StartingF; + UCHAR Reserved1[2]; + UCHAR EndingM; + UCHAR EndingS; + UCHAR EndingF; + UCHAR Reserved2; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved3 : 4; + UCHAR VendorUniqueBits : 2; }; struct _PAUSE { - UCHAR OperationCode ; - UCHAR Reserved : 5 ; - UCHAR Lun : 3 ; - UCHAR Reserved1[9] ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved2 : 4 ; - UCHAR VendorUnqiueBits : 2 ; + UCHAR OperationCode; + UCHAR Reserved : 5; + UCHAR Lun : 3; + UCHAR Reserved1[9]; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved2 : 4; + UCHAR VendorUnqiueBits : 2; }; struct _EJECT { - UCHAR OperationCode ; - UCHAR Reserved : 5 ; - UCHAR Lun : 3 ; - UCHAR Reserved1[8] ; - UCHAR Eject : 1 ; - UCHAR Mode : 1 ; - UCHAR Reserved2 : 6 ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved3 : 4 ; - UCHAR VendorUnqiueBits : 2 ; + UCHAR OperationCode; + UCHAR Reserved : 5; + UCHAR Lun : 3; + UCHAR Reserved1[8]; + UCHAR Eject : 1; + UCHAR Mode : 1; + UCHAR Reserved2 : 6; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved3 : 4; + UCHAR VendorUnqiueBits : 2; }; struct _AUDIO_STATUS { - UCHAR OperationCode ; - UCHAR Reserved : 5 ; - UCHAR Lun : 3 ; - UCHAR Reserved1[9] ; - UCHAR Link : 1 ; - UCHAR Flag : 1 ; - UCHAR Reserved2 : 4 ; - UCHAR VendorUnqiueBits : 2 ; + UCHAR OperationCode; + UCHAR Reserved : 5; + UCHAR Lun : 3; + UCHAR Reserved1[9]; + UCHAR Link : 1; + UCHAR Flag : 1; + UCHAR Reserved2 : 4; + UCHAR VendorUnqiueBits : 2; }; struct _STOP_PLAY { - UCHAR OperationCode ; - UCHAR Reserved[11] ; + UCHAR OperationCode; + UCHAR Reserved[11]; }; union _HITACHICDB { - struct _READ_DISC_INFO READ_DISC_INFO ; - struct _READ_DISC_INFO *PREAD_DISC_INFO ; - struct __anonstruct_PLAY_AUDIO_127 PLAY_AUDIO ; - struct __anonstruct_PLAY_AUDIO_127 *PPLAY_AUDIO ; - struct _PAUSE PAUSE_AUDIO ; - struct _PAUSE *PPAUSE_AUDIO ; - struct _EJECT EJECT ; - struct _EJECT *PEJECT ; - struct _AUDIO_STATUS AUDIO_STATUS ; - struct _AUDIO_STATUS *PAUDIO_STATUS ; - struct _STOP_PLAY STOP_PLAY ; - struct _STOP_PLAY *PSTOP_PLAY ; + struct _READ_DISC_INFO READ_DISC_INFO; + struct _READ_DISC_INFO *PREAD_DISC_INFO; + struct __anonstruct_PLAY_AUDIO_127 PLAY_AUDIO; + struct __anonstruct_PLAY_AUDIO_127 *PPLAY_AUDIO; + struct _PAUSE PAUSE_AUDIO; + struct _PAUSE *PPAUSE_AUDIO; + struct _EJECT EJECT; + struct _EJECT *PEJECT; + struct _AUDIO_STATUS AUDIO_STATUS; + struct _AUDIO_STATUS *PAUDIO_STATUS; + struct _STOP_PLAY STOP_PLAY; + struct _STOP_PLAY *PSTOP_PLAY; }; typedef union _HITACHICDB *PHITACHICDB; -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -2638,469 +2666,436 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -extern void *memcpy(void * , void const * , size_t ) ; -extern int memcmp(void const * , void const * , - size_t ) ; -extern void *memset(void * , int , size_t ) ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; -extern NTSTATUS RtlWriteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName , - ULONG ValueType , - PVOID ValueData , - ULONG ValueLength ) ; - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; +extern void *memcpy(void *, void const *, size_t); +extern int memcmp(void const *, void const *, size_t); +extern void *memset(void *, int, size_t); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +extern NTSTATUS RtlWriteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName, ULONG ValueType, + PVOID ValueData, ULONG ValueLength); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -extern LONG InterlockedIncrement(PLONG Addend ) ; -extern LONG InterlockedDecrement(PLONG Addend ) ; -#pragma warning(disable:4035) +extern LONG InterlockedIncrement(PLONG Addend); +extern LONG InterlockedDecrement(PLONG Addend); +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; - void ExFreePool(PVOID P ) ; - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; - void MmUnlockPages(PMDL MemoryDescriptorList ) ; - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; - void MmFreeContiguousMemory(PVOID BaseAddress ) ; -extern PVOID MmLockPagableDataSection(PVOID AddressWithinSection ) ; - void MmResetDriverPaging(PVOID AddressWithinSection ) ; - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; - void IoFreeIrp(PIRP Irp ) ; - void IoFreeMdl(PMDL Mdl ) ; - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; - void IoReleaseCancelSpinLock(KIRQL Irql ) ; - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; -extern NTSTATUS IoOpenDeviceRegistryKey(PDEVICE_OBJECT DeviceObject , - ULONG DevInstKeyType , - ACCESS_MASK DesiredAccess , - PHANDLE DevInstRegKey ) ; - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -#pragma warning(disable:4200) -#pragma warning(default:4200) - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void PoStartNextPowerIrp(PIRP Irp ) ; - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; - void ObfDereferenceObject(PVOID Object ) ; - NTSTATUS ZwClose(HANDLE Handle ) ; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +void ExFreePool(PVOID P); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +void MmUnlockPages(PMDL MemoryDescriptorList); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +void MmFreeContiguousMemory(PVOID BaseAddress); +extern PVOID MmLockPagableDataSection(PVOID AddressWithinSection); +void MmResetDriverPaging(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoFreeIrp(PIRP Irp); +void IoFreeMdl(PMDL Mdl); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +extern NTSTATUS IoOpenDeviceRegistryKey(PDEVICE_OBJECT DeviceObject, + ULONG DevInstKeyType, + ACCESS_MASK DesiredAccess, + PHANDLE DevInstRegKey); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +void ObfDereferenceObject(PVOID Object); +NTSTATUS ZwClose(HANDLE Handle); #pragma once #pragma once -#pragma warning(disable:4200) -#pragma warning(default:4200) -void errorFn(void) -{ +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +void errorFn(void) { { - ERROR: assert(0); - goto ERROR; -} + ERROR: + assert(0); + goto ERROR; + } } -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -int routine ; -int myStatus ; -int myIrp_PendingReturned ; -void _BLAST_init(void) -{ +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +int routine; +int myStatus; +int myIrp_PendingReturned; +void _BLAST_init(void) { { - UNLOADED = 0; - NP = 1; - DC = 2; - SKIP1 = 3; - SKIP2 = 4; - MPR1 = 5; - MPR3 = 6; - IPC = 7; - s = UNLOADED; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - return; -} + UNLOADED = 0; + NP = 1; + DC = 2; + SKIP1 = 3; + SKIP2 = 4; + MPR1 = 5; + MPR3 = 6; + IPC = 7; + s = UNLOADED; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + return; + } } -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) ; -NTSTATUS CdAudioReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS CdAudioDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS CdAudioSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -BOOLEAN CdAudioIsPlayActive(PDEVICE_OBJECT DeviceObject ) ; -BOOLEAN NecSupportNeeded(PUCHAR InquiryData ) ; -NTSTATUS CdAudioNECDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS CdAudioPioneerDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS CdAudioDenonDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS CdAudioHitachiSendPauseCommand(PDEVICE_OBJECT DeviceObject ) ; -NTSTATUS CdAudioHitachiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS CdAudio535DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS CdAudio435DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS CdAudioAtapiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS CdAudioHPCdrDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void HpCdrProcessLastSession(PCDROM_TOC Toc ) ; -NTSTATUS HPCdrCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -NTSTATUS CdAudioPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS CdAudioForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void CdAudioUnload(PDRIVER_OBJECT DriverObject ) ; -#pragma alloc_text(INIT,DriverEntry) -#pragma alloc_text(PAGECDNC,CdAudioNECDeviceControl) -#pragma alloc_text(PAGECDOT,CdAudioHitachiSendPauseCommand) -#pragma alloc_text(PAGECDOT,CdAudioHitachiDeviceControl) -#pragma alloc_text(PAGECDOT,CdAudioDenonDeviceControl) -#pragma alloc_text(PAGECDNC,CdAudio435DeviceControl) -#pragma alloc_text(PAGECDNC,CdAudio535DeviceControl) -#pragma alloc_text(PAGECDOT,CdAudioPioneerDeviceControl) -#pragma alloc_text(PAGECDNC,CdAudioPan533DeviceControl) -#pragma alloc_text(PAGECDOT,CdAudioAtapiDeviceControl) -#pragma alloc_text(PAGECDOT,CdAudioLionOpticsDeviceControl) -#pragma alloc_text(PAGECDOT,CdAudioHPCdrDeviceControl) -#pragma alloc_text(PAGECDOT,HpCdrProcessLastSession) -#pragma alloc_text(PAGECDOT,HPCdrCompletion) -NTSTATUS SendSrbSynchronous(PCD_DEVICE_EXTENSION Extension , PSCSI_PASS_THROUGH Srb , - PVOID Buffer , ULONG BufferLength ) -{ ULONG ioctl ; - KEVENT event ; - PIRP irp ; - IO_STATUS_BLOCK ioStatus ; - NTSTATUS status = __VERIFIER_nondet_long() ; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath); +NTSTATUS CdAudioReadWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS CdAudioDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS CdAudioSendToNextDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +BOOLEAN CdAudioIsPlayActive(PDEVICE_OBJECT DeviceObject); +BOOLEAN NecSupportNeeded(PUCHAR InquiryData); +NTSTATUS CdAudioNECDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS CdAudioPioneerDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS CdAudioDenonDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS CdAudioHitachiSendPauseCommand(PDEVICE_OBJECT DeviceObject); +NTSTATUS CdAudioHitachiDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS CdAudio535DeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS CdAudio435DeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS CdAudioAtapiDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS CdAudioHPCdrDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void HpCdrProcessLastSession(PCDROM_TOC Toc); +NTSTATUS HPCdrCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); +NTSTATUS CdAudioPower(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS CdAudioForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void CdAudioUnload(PDRIVER_OBJECT DriverObject); +#pragma alloc_text(INIT, DriverEntry) +#pragma alloc_text(PAGECDNC, CdAudioNECDeviceControl) +#pragma alloc_text(PAGECDOT, CdAudioHitachiSendPauseCommand) +#pragma alloc_text(PAGECDOT, CdAudioHitachiDeviceControl) +#pragma alloc_text(PAGECDOT, CdAudioDenonDeviceControl) +#pragma alloc_text(PAGECDNC, CdAudio435DeviceControl) +#pragma alloc_text(PAGECDNC, CdAudio535DeviceControl) +#pragma alloc_text(PAGECDOT, CdAudioPioneerDeviceControl) +#pragma alloc_text(PAGECDNC, CdAudioPan533DeviceControl) +#pragma alloc_text(PAGECDOT, CdAudioAtapiDeviceControl) +#pragma alloc_text(PAGECDOT, CdAudioLionOpticsDeviceControl) +#pragma alloc_text(PAGECDOT, CdAudioHPCdrDeviceControl) +#pragma alloc_text(PAGECDOT, HpCdrProcessLastSession) +#pragma alloc_text(PAGECDOT, HPCdrCompletion) +NTSTATUS SendSrbSynchronous(PCD_DEVICE_EXTENSION Extension, + PSCSI_PASS_THROUGH Srb, PVOID Buffer, + ULONG BufferLength) { + ULONG ioctl; + KEVENT event; + PIRP irp; + IO_STATUS_BLOCK ioStatus; + NTSTATUS status = __VERIFIER_nondet_long(); { - irp = (void *)0; - Srb->Length = sizeof(SCSI_PASS_THROUGH ); - Srb->SenseInfoLength = 0; - Srb->SenseInfoOffset = 0; - if (Buffer) { - Srb->DataIn = 1; - Srb->DataTransferLength = BufferLength; - Srb->DataBufferOffset = (unsigned long )Buffer; - ioctl = ((4 << 16) | (3 << 14)) | (1029 << 2); - } else { - Srb->DataIn = 0; - Srb->DataTransferLength = 0; - Srb->DataBufferOffset = 0; - ioctl = ((4 << 16) | (3 << 14)) | (1025 << 2); - } - { -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - } - if (! irp) { - return (-1073741670L); - } else { - - } - if (status == 259L) { - { - KeWaitForSingleObject(& event, 0, 0, 0, (void *)0); - status = ioStatus.__annonCompField4.Status; + irp = (void *)0; + Srb->Length = sizeof(SCSI_PASS_THROUGH); + Srb->SenseInfoLength = 0; + Srb->SenseInfoOffset = 0; + if (Buffer) { + Srb->DataIn = 1; + Srb->DataTransferLength = BufferLength; + Srb->DataBufferOffset = (unsigned long)Buffer; + ioctl = ((4 << 16) | (3 << 14)) | (1029 << 2); + } else { + Srb->DataIn = 0; + Srb->DataTransferLength = 0; + Srb->DataBufferOffset = 0; + ioctl = ((4 << 16) | (3 << 14)) | (1025 << 2); } - } else { - + { /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + } + if (!irp) { + return (-1073741670L); + } else { + } + if (status == 259L) { + { + KeWaitForSingleObject(&event, 0, 0, 0, (void *)0); + status = ioStatus.__annonCompField4.Status; + } + } else { + } + return (status); } - return (status); } -} -NTSTATUS CdAudioAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) -{ NTSTATUS status ; - PDEVICE_OBJECT deviceObject ; - PCD_DEVICE_EXTENSION extension ; - ULONG regActive ; - HANDLE deviceParameterHandle ; - RTL_QUERY_REGISTRY_TABLE queryTable[2] ; - - { - { - regActive = 255; - status = IoOpenDeviceRegistryKey(PhysicalDeviceObject, 2, 131097L, & deviceParameterHandle); - } - if (! (status >= 0L)) { - regActive = 255; - goto AddDeviceEndRegistry; - } else { +NTSTATUS CdAudioAddDevice(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject) { + NTSTATUS status; + PDEVICE_OBJECT deviceObject; + PCD_DEVICE_EXTENSION extension; + ULONG regActive; + HANDLE deviceParameterHandle; + RTL_QUERY_REGISTRY_TABLE queryTable[2]; - } { - memset(& queryTable, 0, sizeof(queryTable)); - queryTable[0].Flags = 36; - queryTable[0].Name = "M\000a\000p\000T\000y\000p\000e\000"; - queryTable[0].EntryContext = & regActive; - queryTable[0].DefaultType = 4; - queryTable[0].DefaultData = (void *)0; - queryTable[0].DefaultLength = 0; - status = RtlQueryRegistryValues(1073741824, (WCHAR *)deviceParameterHandle, queryTable, - (void *)0, (void *)0); - } - if (! (status >= 0L)) { - regActive = 255; - } else { - if (regActive > 10UL) { + { + regActive = 255; + status = IoOpenDeviceRegistryKey(PhysicalDeviceObject, 2, 131097L, + &deviceParameterHandle); + } + if (!(status >= 0L)) { regActive = 255; + goto AddDeviceEndRegistry; } else { - } - } - { - ZwClose(deviceParameterHandle); - } - AddDeviceEndRegistry: - if (regActive > 10UL) { - if (regActive != 255UL) { + { + memset(&queryTable, 0, sizeof(queryTable)); + queryTable[0].Flags = 36; + queryTable[0].Name = "M\000a\000p\000T\000y\000p\000e\000"; + queryTable[0].EntryContext = ®Active; + queryTable[0].DefaultType = 4; + queryTable[0].DefaultData = (void *)0; + queryTable[0].DefaultLength = 0; + status = + RtlQueryRegistryValues(1073741824, (WCHAR *)deviceParameterHandle, + queryTable, (void *)0, (void *)0); + } + if (!(status >= 0L)) { regActive = 255; } else { - + if (regActive > 10UL) { + regActive = 255; + } else { + } } - } else { - - } - if (regActive == 0UL) { - return (0L); - } else { - - } - if (regActive == 8) { - goto switch_0_8; - } else { - if (regActive == 9) { - goto switch_0_9; + { ZwClose(deviceParameterHandle); } + AddDeviceEndRegistry: + if (regActive > 10UL) { + if (regActive != 255UL) { + regActive = 255; + } else { + } + } else { + } + if (regActive == 0UL) { + return (0L); + } else { + } + if (regActive == 8) { + goto switch_0_8; } else { - if (regActive == 10) { - goto switch_0_10; + if (regActive == 9) { + goto switch_0_9; } else { - if (regActive == 4) { - goto switch_0_4; + if (regActive == 10) { + goto switch_0_10; } else { - if (regActive == 6) { - goto switch_0_6; + if (regActive == 4) { + goto switch_0_4; } else { - if (regActive == 5) { - goto switch_0_5; + if (regActive == 6) { + goto switch_0_6; } else { - if (regActive == 2) { - goto switch_0_2; + if (regActive == 5) { + goto switch_0_5; } else { - if (regActive == 3) { - goto switch_0_3; + if (regActive == 2) { + goto switch_0_2; } else { - if (regActive == 1) { - goto switch_0_1; + if (regActive == 3) { + goto switch_0_3; } else { - if (regActive == 7) { - goto switch_0_7; + if (regActive == 1) { + goto switch_0_1; } else { - if (regActive == 255) { - goto switch_0_255; + if (regActive == 7) { + goto switch_0_7; } else { - { - goto switch_0_default; - if (0) { - switch_0_8: /* CIL Label */ - { - MmLockPagableDataSection((void *)(& CdAudioNECDeviceControl)); - } - goto switch_0_break; - switch_0_9: /* CIL Label */ ; - switch_0_10: /* CIL Label */ - { - MmLockPagableDataSection((void *)(& CdAudioPioneerDeviceControl)); - } - goto switch_0_break; - switch_0_4: /* CIL Label */ - { - MmLockPagableDataSection((void *)(& CdAudioDenonDeviceControl)); - } - goto switch_0_break; - switch_0_6: /* CIL Label */ ; - switch_0_5: /* CIL Label */ - { - MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl)); - } - goto switch_0_break; - switch_0_2: /* CIL Label */ - { - MmLockPagableDataSection((void *)(& CdAudio535DeviceControl)); - } - goto switch_0_break; - switch_0_3: /* CIL Label */ - { - MmLockPagableDataSection((void *)(& CdAudio435DeviceControl)); - } - goto switch_0_break; - switch_0_1: /* CIL Label */ - { - MmLockPagableDataSection((void *)(& CdAudioAtapiDeviceControl)); - } - goto switch_0_break; - switch_0_7: /* CIL Label */ + if (regActive == 255) { + goto switch_0_255; + } else { { - MmLockPagableDataSection((void *)(& CdAudioHPCdrDeviceControl)); + goto switch_0_default; + if (0) { + switch_0_8 : /* CIL Label */ + { + MmLockPagableDataSection( + (void *)(&CdAudioNECDeviceControl)); + } + goto switch_0_break; + switch_0_9: /* CIL Label */; + switch_0_10 : /* CIL Label */ + { + MmLockPagableDataSection( + (void *)(&CdAudioPioneerDeviceControl)); + } + goto switch_0_break; + switch_0_4 : /* CIL Label */ + { + MmLockPagableDataSection( + (void *)(&CdAudioDenonDeviceControl)); + } + goto switch_0_break; + switch_0_6: /* CIL Label */; + switch_0_5 : /* CIL Label */ + { + MmLockPagableDataSection( + (void *)(&CdAudioHitachiDeviceControl)); + } + goto switch_0_break; + switch_0_2 : /* CIL Label */ + { + MmLockPagableDataSection( + (void *)(&CdAudio535DeviceControl)); + } + goto switch_0_break; + switch_0_3 : /* CIL Label */ + { + MmLockPagableDataSection( + (void *)(&CdAudio435DeviceControl)); + } + goto switch_0_break; + switch_0_1 : /* CIL Label */ + { + MmLockPagableDataSection( + (void *)(&CdAudioAtapiDeviceControl)); + } + goto switch_0_break; + switch_0_7 : /* CIL Label */ + { + MmLockPagableDataSection( + (void *)(&CdAudioHPCdrDeviceControl)); + } + goto switch_0_break; + switch_0_255: /* CIL Label */; + switch_0_default: /* CIL Label */; + goto switch_0_break; + } else { + switch_0_break: /* CIL Label */; + } } - goto switch_0_break; - switch_0_255: /* CIL Label */ ; - switch_0_default: /* CIL Label */ ; - goto switch_0_break; - } else { - switch_0_break: /* CIL Label */ ; - } } } } @@ -3112,389 +3107,353 @@ NTSTATUS CdAudioAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalD } } } - } - { - status = IoCreateDevice(DriverObject, sizeof(CD_DEVICE_EXTENSION ), (void *)0, 2, - 0, 0, & deviceObject); - } - if (! (status >= 0L)) { - return (status); - } else { - - } - deviceObject->Flags |= 16UL; - if (deviceObject->Flags & 16384UL) { - - } else { - deviceObject->Flags |= 8192UL; - } - { - extension = deviceObject->DeviceExtension; - memset(extension, 0, sizeof(CD_DEVICE_EXTENSION )); - extension->TargetDeviceObject = IoAttachDeviceToDeviceStack(deviceObject, PhysicalDeviceObject); - } - if (! extension->TargetDeviceObject) { { -/* IoDeleteDevice(deviceObject); */ /* INLINED */ + status = IoCreateDevice(DriverObject, sizeof(CD_DEVICE_EXTENSION), + (void *)0, 2, 0, 0, &deviceObject); + } + if (!(status >= 0L)) { + return (status); + } else { } - return (-1073741810L); - } else { + deviceObject->Flags |= 16UL; + if (deviceObject->Flags & 16384UL) { + } else { + deviceObject->Flags |= 8192UL; + } + { + extension = deviceObject->DeviceExtension; + memset(extension, 0, sizeof(CD_DEVICE_EXTENSION)); + extension->TargetDeviceObject = + IoAttachDeviceToDeviceStack(deviceObject, PhysicalDeviceObject); + } + if (!extension->TargetDeviceObject) { + { /* IoDeleteDevice(deviceObject); */ /* INLINED */ + } + return (-1073741810L); + } else { + } + { + /* KeInitializeEvent(& extension->PagingPathCountEvent, 1, 1); */ /* INLINED + */ + extension->Active = (unsigned char)regActive; + extension->DeviceObject = deviceObject; + extension->TargetPdo = PhysicalDeviceObject; + deviceObject->Flags &= 4294967167UL; + } + return (0L); } - { -/* KeInitializeEvent(& extension->PagingPathCountEvent, 1, 1); */ /* INLINED */ - extension->Active = (unsigned char )regActive; - extension->DeviceObject = deviceObject; - extension->TargetPdo = PhysicalDeviceObject; - deviceObject->Flags &= 4294967167UL; - } - return (0L); -} } -NTSTATUS CdAudioSignalCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PKEVENT Event ) -{ +NTSTATUS CdAudioSignalCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PKEVENT Event) { { - { - KeSetEvent(Event, 0, 0); + { KeSetEvent(Event, 0, 0); } + return (-1073741802L); } - return (-1073741802L); -} } -NTSTATUS CdAudioStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PCD_DEVICE_EXTENSION deviceExtension ; - NTSTATUS status ; - SCSI_PASS_THROUGH srb ; - PCDB cdb ; - PUCHAR inquiryDataPtr ; - UCHAR attempt ; - PVOID tmp ; - UCHAR tmp___0 ; - BOOLEAN tmp___1 ; - int tmp___2 ; - int tmp___3 ; - int tmp___4 ; - int tmp___5 ; - int tmp___6 ; - int tmp___7 ; - int tmp___8 ; - int tmp___9 ; - int tmp___10 ; - int tmp___11 ; - int tmp___12 ; - int tmp___13 ; - int tmp___14 ; - int tmp___15 ; - HANDLE deviceParameterHandle ; - ULONG keyValue ; +NTSTATUS CdAudioStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PCD_DEVICE_EXTENSION deviceExtension; + NTSTATUS status; + SCSI_PASS_THROUGH srb; + PCDB cdb; + PUCHAR inquiryDataPtr; + UCHAR attempt; + PVOID tmp; + UCHAR tmp___0; + BOOLEAN tmp___1; + int tmp___2; + int tmp___3; + int tmp___4; + int tmp___5; + int tmp___6; + int tmp___7; + int tmp___8; + int tmp___9; + int tmp___10; + int tmp___11; + int tmp___12; + int tmp___13; + int tmp___14; + int tmp___15; + HANDLE deviceParameterHandle; + ULONG keyValue; { - { - deviceExtension = DeviceObject->DeviceExtension; - status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); - } - if (! (status >= 0L)) { - return (status); - } else { - - } - deviceExtension->Paused = 0; - deviceExtension->PausedM = 0; - deviceExtension->PausedS = 0; - deviceExtension->PausedF = 0; - deviceExtension->LastEndM = 0; - deviceExtension->LastEndS = 0; - deviceExtension->LastEndF = 0; - if ((int )deviceExtension->Active == 255) { { - cdb = (union _CDB *)(srb.Cdb); - inquiryDataPtr = (void *)0; - attempt = 0; - tmp = ExAllocatePoolWithTag(4, 36, 541156419UL); - inquiryDataPtr = (UCHAR *)tmp; + deviceExtension = DeviceObject->DeviceExtension; + status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); } - if (! inquiryDataPtr) { - deviceExtension->Active = 0; - return (0L); + if (!(status >= 0L)) { + return (status); } else { - } - status = -1073741823L; - { - while (1) { - while_1_continue: /* CIL Label */ ; - if (! (status >= 0L)) { - tmp___0 = attempt; - attempt = (UCHAR )((int )attempt + 1); - if (tmp___0 < 4) { - - } else { - goto while_1_break; - } - } else { - goto while_1_break; - } + deviceExtension->Paused = 0; + deviceExtension->PausedM = 0; + deviceExtension->PausedS = 0; + deviceExtension->PausedF = 0; + deviceExtension->LastEndM = 0; + deviceExtension->LastEndS = 0; + deviceExtension->LastEndF = 0; + if ((int)deviceExtension->Active == 255) { { - memset(& srb, 0, sizeof(SCSI_PASS_THROUGH )); - memset(inquiryDataPtr, 0, 36); - cdb->CDB6INQUIRY.OperationCode = 18; - cdb->CDB6INQUIRY.AllocationLength = 36; - srb.CdbLength = 6; - srb.TimeOutValue = 10; - status = SendSrbSynchronous(deviceExtension, & srb, inquiryDataPtr, 36); + cdb = (union _CDB *)(srb.Cdb); + inquiryDataPtr = (void *)0; + attempt = 0; + tmp = ExAllocatePoolWithTag(4, 36, 541156419UL); + inquiryDataPtr = (UCHAR *)tmp; } - } - while_1_break: /* CIL Label */ ; - } - if (! (status >= 0L)) { - { -/* ExFreePool(inquiryDataPtr); */ /* INLINED */ - deviceExtension->Active = 0; + if (!inquiryDataPtr) { + deviceExtension->Active = 0; + return (0L); + } else { } - return (0L); - } else { - - } - { - deviceExtension->Active = 0; - tmp___2 = memcmp(inquiryDataPtr + 8, "NEC ", 8); - } - if (tmp___2) { - - } else { + status = -1073741823L; { - tmp___1 = NecSupportNeeded(inquiryDataPtr); + while (1) { + while_1_continue: /* CIL Label */; + if (!(status >= 0L)) { + tmp___0 = attempt; + attempt = (UCHAR)((int)attempt + 1); + if (tmp___0 < 4) { + + } else { + goto while_1_break; + } + } else { + goto while_1_break; + } + { + memset(&srb, 0, sizeof(SCSI_PASS_THROUGH)); + memset(inquiryDataPtr, 0, 36); + cdb->CDB6INQUIRY.OperationCode = 18; + cdb->CDB6INQUIRY.AllocationLength = 36; + srb.CdbLength = 6; + srb.TimeOutValue = 10; + status = + SendSrbSynchronous(deviceExtension, &srb, inquiryDataPtr, 36); + } + } + while_1_break: /* CIL Label */; } - if (tmp___1) { + if (!(status >= 0L)) { { - MmLockPagableDataSection((void *)(& CdAudioNECDeviceControl)); - deviceExtension->Active = 8; + /* ExFreePool(inquiryDataPtr); */ /* INLINED */ + deviceExtension->Active = 0; } + return (0L); } else { - } - } - { - tmp___3 = memcmp(inquiryDataPtr + 8, "PIONEER ", 8); - } - if (tmp___3) { - - } else { { - tmp___4 = memcmp(inquiryDataPtr + 16, "CD-ROM DRM-600", 15); + deviceExtension->Active = 0; + tmp___2 = memcmp(inquiryDataPtr + 8, "NEC ", 8); } - if (tmp___4) { + if (tmp___2) { } else { - { - MmLockPagableDataSection((void *)(& CdAudioPioneerDeviceControl)); - deviceExtension->Active = 9; + { tmp___1 = NecSupportNeeded(inquiryDataPtr); } + if (tmp___1) { + { + MmLockPagableDataSection((void *)(&CdAudioNECDeviceControl)); + deviceExtension->Active = 8; + } + } else { } } - } - if ((int )*(inquiryDataPtr + 8) == 68) { - if ((int )*(inquiryDataPtr + 9) == 69) { - if ((int )*(inquiryDataPtr + 10) == 78) { - if ((int )*(inquiryDataPtr + 16) == 68) { - if ((int )*(inquiryDataPtr + 17) == 82) { - if ((int )*(inquiryDataPtr + 18) == 68) { - if ((int )*(inquiryDataPtr + 20) == 50) { - if ((int )*(inquiryDataPtr + 21) == 53) { - if ((int )*(inquiryDataPtr + 22) == 88) { - { - MmLockPagableDataSection((void *)(& CdAudioDenonDeviceControl)); - deviceExtension->Active = 4; + { tmp___3 = memcmp(inquiryDataPtr + 8, "PIONEER ", 8); } + if (tmp___3) { + + } else { + { tmp___4 = memcmp(inquiryDataPtr + 16, "CD-ROM DRM-600", 15); } + if (tmp___4) { + + } else { + { + MmLockPagableDataSection((void *)(&CdAudioPioneerDeviceControl)); + deviceExtension->Active = 9; + } + } + } + if ((int)*(inquiryDataPtr + 8) == 68) { + if ((int)*(inquiryDataPtr + 9) == 69) { + if ((int)*(inquiryDataPtr + 10) == 78) { + if ((int)*(inquiryDataPtr + 16) == 68) { + if ((int)*(inquiryDataPtr + 17) == 82) { + if ((int)*(inquiryDataPtr + 18) == 68) { + if ((int)*(inquiryDataPtr + 20) == 50) { + if ((int)*(inquiryDataPtr + 21) == 53) { + if ((int)*(inquiryDataPtr + 22) == 88) { + { + MmLockPagableDataSection( + (void *)(&CdAudioDenonDeviceControl)); + deviceExtension->Active = 4; + } + } else { } } else { - } } else { - } } else { - } } else { - } } else { - } } else { - } } else { - } } else { - } - } else { - - } - { - tmp___5 = memcmp(inquiryDataPtr + 8, "CHINON", 6); - } - if (tmp___5) { + { tmp___5 = memcmp(inquiryDataPtr + 8, "CHINON", 6); } + if (tmp___5) { - } else { - if ((int )*(inquiryDataPtr + 27) == 53) { - if ((int )*(inquiryDataPtr + 28) == 51) { - if ((int )*(inquiryDataPtr + 29) == 53) { - if ((int )*(inquiryDataPtr + 32) == 81) { - { - MmLockPagableDataSection((void *)(& CdAudio535DeviceControl)); - deviceExtension->Active = 2; + } else { + if ((int)*(inquiryDataPtr + 27) == 53) { + if ((int)*(inquiryDataPtr + 28) == 51) { + if ((int)*(inquiryDataPtr + 29) == 53) { + if ((int)*(inquiryDataPtr + 32) == 81) { + { + MmLockPagableDataSection((void *)(&CdAudio535DeviceControl)); + deviceExtension->Active = 2; + } + } else { } } else { - } } else { - } } else { - } - } else { - - } - if ((int )*(inquiryDataPtr + 27) == 52) { - if ((int )*(inquiryDataPtr + 28) == 51) { - if ((int )*(inquiryDataPtr + 29) == 53) { - goto _L; - } else { - if ((int )*(inquiryDataPtr + 29) == 49) { - _L: /* CIL Label */ - if ((int )*(inquiryDataPtr + 32) == 77) { - { - MmLockPagableDataSection((void *)(& CdAudio435DeviceControl)); - deviceExtension->Active = 3; - } - } else { - if ((int )*(inquiryDataPtr + 32) == 78) { + if ((int)*(inquiryDataPtr + 27) == 52) { + if ((int)*(inquiryDataPtr + 28) == 51) { + if ((int)*(inquiryDataPtr + 29) == 53) { + goto _L; + } else { + if ((int)*(inquiryDataPtr + 29) == 49) { + _L: /* CIL Label */ + if ((int)*(inquiryDataPtr + 32) == 77) { { - MmLockPagableDataSection((void *)(& CdAudio435DeviceControl)); - deviceExtension->Active = 3; + MmLockPagableDataSection( + (void *)(&CdAudio435DeviceControl)); + deviceExtension->Active = 3; } } else { - if ((int )*(inquiryDataPtr + 32) == 83) { + if ((int)*(inquiryDataPtr + 32) == 78) { { - MmLockPagableDataSection((void *)(& CdAudio435DeviceControl)); - deviceExtension->Active = 3; + MmLockPagableDataSection( + (void *)(&CdAudio435DeviceControl)); + deviceExtension->Active = 3; } } else { - if ((int )*(inquiryDataPtr + 32) == 85) { + if ((int)*(inquiryDataPtr + 32) == 83) { { - MmLockPagableDataSection((void *)(& CdAudio435DeviceControl)); - deviceExtension->Active = 3; + MmLockPagableDataSection( + (void *)(&CdAudio435DeviceControl)); + deviceExtension->Active = 3; } } else { - if ((int )*(inquiryDataPtr + 32) == 72) { + if ((int)*(inquiryDataPtr + 32) == 85) { { - MmLockPagableDataSection((void *)(& CdAudio435DeviceControl)); - deviceExtension->Active = 3; + MmLockPagableDataSection( + (void *)(&CdAudio435DeviceControl)); + deviceExtension->Active = 3; } } else { - + if ((int)*(inquiryDataPtr + 32) == 72) { + { + MmLockPagableDataSection( + (void *)(&CdAudio435DeviceControl)); + deviceExtension->Active = 3; + } + } else { + } } } } } + } else { } - } else { - } + } else { } } else { - } - } else { - } - } - { - tmp___6 = memcmp(inquiryDataPtr + 8, "HITACHI ", 8); - } - if (tmp___6) { + { tmp___6 = memcmp(inquiryDataPtr + 8, "HITACHI ", 8); } + if (tmp___6) { - } else { - { - tmp___7 = memcmp(inquiryDataPtr + 16, "CDR-3650/1650S ", 16); - } - if (tmp___7) { - { - tmp___8 = memcmp(inquiryDataPtr + 16, "CDR-1750S ", 16); - } - if (tmp___8) { + } else { + { tmp___7 = memcmp(inquiryDataPtr + 16, "CDR-3650/1650S ", 16); } + if (tmp___7) { + { tmp___8 = memcmp(inquiryDataPtr + 16, "CDR-1750S ", 16); } + if (tmp___8) { + } else { + { + MmLockPagableDataSection((void *)(&CdAudioHitachiDeviceControl)); + deviceExtension->Active = 6; + } + } } else { { - MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl)); - deviceExtension->Active = 6; + MmLockPagableDataSection((void *)(&CdAudioHitachiDeviceControl)); + deviceExtension->Active = 6; } } - } else { - { - MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl)); - deviceExtension->Active = 6; - } } - } - { - tmp___9 = memcmp(inquiryDataPtr + 8, "WEARNES ", 8); - } - if (tmp___9) { - _L___0: /* CIL Label */ + { tmp___9 = memcmp(inquiryDataPtr + 8, "WEARNES ", 8); } + if (tmp___9) { + _L___0 : /* CIL Label */ { - tmp___11 = memcmp(inquiryDataPtr + 8, "OTI ", 8); + tmp___11 = memcmp(inquiryDataPtr + 8, "OTI ", 8); } - if (tmp___11) { - - } else { - { - tmp___12 = memcmp(inquiryDataPtr + 16, "DOLPHIN ", 8); - } - if (tmp___12) { + if (tmp___11) { } else { - { - MmLockPagableDataSection((void *)(& CdAudioAtapiDeviceControl)); - deviceExtension->Active = 1; - *(inquiryDataPtr + 25) = (unsigned char)0; + { tmp___12 = memcmp(inquiryDataPtr + 16, "DOLPHIN ", 8); } + if (tmp___12) { + + } else { + { + MmLockPagableDataSection((void *)(&CdAudioAtapiDeviceControl)); + deviceExtension->Active = 1; + *(inquiryDataPtr + 25) = (unsigned char)0; + } } } - } - } else { - { - tmp___10 = memcmp(inquiryDataPtr + 16, "RUB", 3); - } - if (tmp___10) { - goto _L___0; } else { - { - MmLockPagableDataSection((void *)(& CdAudioAtapiDeviceControl)); - deviceExtension->Active = 1; - *(inquiryDataPtr + 25) = (unsigned char)0; + { tmp___10 = memcmp(inquiryDataPtr + 16, "RUB", 3); } + if (tmp___10) { + goto _L___0; + } else { + { + MmLockPagableDataSection((void *)(&CdAudioAtapiDeviceControl)); + deviceExtension->Active = 1; + *(inquiryDataPtr + 25) = (unsigned char)0; + } } } - } - { - tmp___13 = memcmp(inquiryDataPtr + 8, "FUJITSU ", 8); - } - if (tmp___13) { + { tmp___13 = memcmp(inquiryDataPtr + 8, "FUJITSU ", 8); } + if (tmp___13) { - } else { - if ((int )*(inquiryDataPtr + 16) == 67) { - if ((int )*(inquiryDataPtr + 17) == 68) { - if ((int )*(inquiryDataPtr + 18) == 82) { - if ((int )*(inquiryDataPtr + 20) == 51) { - if ((int )*(inquiryDataPtr + 21) == 54) { - if ((int )*(inquiryDataPtr + 22) == 53) { - if ((int )*(inquiryDataPtr + 23) == 48) { - { - MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl)); - deviceExtension->Active = 6; - *(inquiryDataPtr + 25) = (unsigned char)0; + } else { + if ((int)*(inquiryDataPtr + 16) == 67) { + if ((int)*(inquiryDataPtr + 17) == 68) { + if ((int)*(inquiryDataPtr + 18) == 82) { + if ((int)*(inquiryDataPtr + 20) == 51) { + if ((int)*(inquiryDataPtr + 21) == 54) { + if ((int)*(inquiryDataPtr + 22) == 53) { + if ((int)*(inquiryDataPtr + 23) == 48) { + { + MmLockPagableDataSection( + (void *)(&CdAudioHitachiDeviceControl)); + deviceExtension->Active = 6; + *(inquiryDataPtr + 25) = (unsigned char)0; + } + } else { + goto _L___6; } } else { goto _L___6; @@ -3512,928 +3471,1043 @@ NTSTATUS CdAudioStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) goto _L___6; } } else { - goto _L___6; - } - } else { - _L___6: /* CIL Label */ - if ((int )*(inquiryDataPtr + 16) == 70) { - if ((int )*(inquiryDataPtr + 17) == 77) { - if ((int )*(inquiryDataPtr + 18) == 67) { - if ((int )*(inquiryDataPtr + 21) == 49) { - if ((int )*(inquiryDataPtr + 22) == 48) { - if ((int )*(inquiryDataPtr + 23) == 49) { - { - MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl)); - deviceExtension->Active = 5; - *(inquiryDataPtr + 25) = (unsigned char)0; - } - } else { - if ((int )*(inquiryDataPtr + 23) == 50) { + _L___6: /* CIL Label */ + if ((int)*(inquiryDataPtr + 16) == 70) { + if ((int)*(inquiryDataPtr + 17) == 77) { + if ((int)*(inquiryDataPtr + 18) == 67) { + if ((int)*(inquiryDataPtr + 21) == 49) { + if ((int)*(inquiryDataPtr + 22) == 48) { + if ((int)*(inquiryDataPtr + 23) == 49) { { - MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl)); - deviceExtension->Active = 5; - *(inquiryDataPtr + 25) = (unsigned char)0; + MmLockPagableDataSection( + (void *)(&CdAudioHitachiDeviceControl)); + deviceExtension->Active = 5; + *(inquiryDataPtr + 25) = (unsigned char)0; } } else { - + if ((int)*(inquiryDataPtr + 23) == 50) { + { + MmLockPagableDataSection( + (void *)(&CdAudioHitachiDeviceControl)); + deviceExtension->Active = 5; + *(inquiryDataPtr + 25) = (unsigned char)0; + } + } else { + } } + } else { } } else { - } } else { - } } else { - } } else { - } - } else { + } + } + { tmp___14 = memcmp(inquiryDataPtr + 8, "HP ", 8); } + if (tmp___14) { + + } else { + { tmp___15 = memcmp(inquiryDataPtr + 16, "C4324/C4325", 11); } + if (tmp___15) { + } else { + { + MmLockPagableDataSection((void *)(&CdAudioHPCdrDeviceControl)); + deviceExtension->Active = 7; + } } } + { /* ExFreePool(inquiryDataPtr); */ /* INLINED */ + } + } else { } { - tmp___14 = memcmp(inquiryDataPtr + 8, "HP ", 8); + keyValue = (unsigned long)deviceExtension->Active; + status = IoOpenDeviceRegistryKey(deviceExtension->TargetPdo, 2, 131078L, + &deviceParameterHandle); } - if (tmp___14) { - + if (!(status >= 0L)) { + return (0L); } else { - { - tmp___15 = memcmp(inquiryDataPtr + 16, "C4324/C4325", 11); - } - if (tmp___15) { - - } else { - { - MmLockPagableDataSection((void *)(& CdAudioHPCdrDeviceControl)); - deviceExtension->Active = 7; - } - } } { -/* ExFreePool(inquiryDataPtr); */ /* INLINED */ + status = RtlWriteRegistryValue(1073741824, (WCHAR *)deviceParameterHandle, + "M\000a\000p\000T\000y\000p\000e\000", 4, + &keyValue, sizeof(keyValue)); } - } else { + if (!(status >= 0L)) { - } - { - keyValue = (unsigned long )deviceExtension->Active; - status = IoOpenDeviceRegistryKey(deviceExtension->TargetPdo, 2, 131078L, & deviceParameterHandle); - } - if (! (status >= 0L)) { + } else { + } + { ZwClose(deviceParameterHandle); } return (0L); - } else { - } - { - status = RtlWriteRegistryValue(1073741824, (WCHAR *)deviceParameterHandle, "M\000a\000p\000T\000y\000p\000e\000", - 4, & keyValue, sizeof(keyValue)); - } - if (! (status >= 0L)) { - - } else { - - } - { - ZwClose(deviceParameterHandle); - } - return (0L); -} } -NTSTATUS CdAudioPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - NTSTATUS status ; - BOOLEAN setPagable ; - PCD_DEVICE_EXTENSION deviceExtension ; - NTSTATUS tmp ; - NTSTATUS tmp___0 ; +NTSTATUS CdAudioPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + NTSTATUS status; + BOOLEAN setPagable; + PCD_DEVICE_EXTENSION deviceExtension; + NTSTATUS tmp; + NTSTATUS tmp___0; { - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - status = -1073741637L; - if (irpSp->MinorFunction == 0) { - goto switch_2_0; - } else { - if (irpSp->MinorFunction == 22) { - goto switch_2_22; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + status = -1073741637L; + if (irpSp->MinorFunction == 0) { + goto switch_2_0; } else { - { - goto switch_2_default; - if (0) { - switch_2_0: /* CIL Label */ + if (irpSp->MinorFunction == 22) { + goto switch_2_22; + } else { { - status = CdAudioStartDevice(DeviceObject, Irp); - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); - } - return (status); - switch_2_22: /* CIL Label */ ; - if ((int )irpSp->Parameters.UsageNotification.Type != 1) { + goto switch_2_default; + if (0) { + switch_2_0 : /* CIL Label */ { - tmp = CdAudioSendToNextDriver(DeviceObject, Irp); + status = CdAudioStartDevice(DeviceObject, Irp); + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); } - return (tmp); - } else { - - } - { - deviceExtension = DeviceObject->DeviceExtension; - status = KeWaitForSingleObject(& deviceExtension->PagingPathCountEvent, 0, - 0, 0, (void *)0); - setPagable = 0; - } - if (! irpSp->Parameters.UsageNotification.InPath) { - if (deviceExtension->PagingPathCount == 1UL) { - if (DeviceObject->Flags & 16384UL) { - + return (status); + switch_2_22: /* CIL Label */; + if ((int)irpSp->Parameters.UsageNotification.Type != 1) { + { tmp = CdAudioSendToNextDriver(DeviceObject, Irp); } + return (tmp); } else { - DeviceObject->Flags |= 8192UL; - setPagable = 1; } - } else { - - } - } else { - - } - { - status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); - } - if (status >= 0L) { - if (irpSp->Parameters.UsageNotification.InPath) { { - InterlockedIncrement(& deviceExtension->PagingPathCount); + deviceExtension = DeviceObject->DeviceExtension; + status = KeWaitForSingleObject( + &deviceExtension->PagingPathCountEvent, 0, 0, 0, (void *)0); + setPagable = 0; } - } else { - { - InterlockedDecrement(& deviceExtension->PagingPathCount); + if (!irpSp->Parameters.UsageNotification.InPath) { + if (deviceExtension->PagingPathCount == 1UL) { + if (DeviceObject->Flags & 16384UL) { + + } else { + DeviceObject->Flags |= 8192UL; + setPagable = 1; + } + } else { + } + } else { } - } - if (irpSp->Parameters.UsageNotification.InPath) { - if (deviceExtension->PagingPathCount == 1UL) { - DeviceObject->Flags &= 4294959103UL; + { status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); } + if (status >= 0L) { + if (irpSp->Parameters.UsageNotification.InPath) { + { InterlockedIncrement(&deviceExtension->PagingPathCount); } + } else { + { InterlockedDecrement(&deviceExtension->PagingPathCount); } + } + if (irpSp->Parameters.UsageNotification.InPath) { + if (deviceExtension->PagingPathCount == 1UL) { + DeviceObject->Flags &= 4294959103UL; + } else { + } + } else { + } } else { - + if ((int)setPagable == 1) { + DeviceObject->Flags &= 4294959103UL; + setPagable = 0; + } else { + } } - } else { - + { + KeSetEvent(&deviceExtension->PagingPathCountEvent, 0, 0); + IofCompleteRequest(Irp, 0); + } + return (status); + goto switch_2_break; + switch_2_default : /* CIL Label */ + { + tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); } - } else { - if ((int )setPagable == 1) { - DeviceObject->Flags &= 4294959103UL; - setPagable = 0; + return (tmp___0); } else { - + switch_2_break: /* CIL Label */; } } - { - KeSetEvent(& deviceExtension->PagingPathCountEvent, 0, 0); - IofCompleteRequest(Irp, 0); - } - return (status); - goto switch_2_break; - switch_2_default: /* CIL Label */ - { - tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); - } - return (tmp___0); - } else { - switch_2_break: /* CIL Label */ ; - } } } + return (0L); } - return (0L); -} } -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) -{ ULONG i = __VERIFIER_nondet_long() ; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, + PUNICODE_STRING RegistryPath) { + ULONG i = __VERIFIER_nondet_long(); { - DriverObject->MajorFunction[i] = & CdAudioSendToNextDriver; - DriverObject->MajorFunction[3] = & CdAudioReadWrite; - DriverObject->MajorFunction[4] = & CdAudioReadWrite; - DriverObject->MajorFunction[14] = & CdAudioDeviceControl; - DriverObject->MajorFunction[27] = & CdAudioPnp; - DriverObject->MajorFunction[22] = & CdAudioPower; - (DriverObject->DriverExtension)->AddDevice = & CdAudioAddDevice; - DriverObject->DriverUnload = & CdAudioUnload; - return (0L); -} -} -BOOLEAN NecSupportNeeded(PUCHAR InquiryData ) -{ PINQUIRYDATA inquiryData ; - ULONG i = __VERIFIER_nondet_long() ; - PUCHAR badDriveList[12] ; - SIZE_T tmp ; - - { - { - inquiryData = (struct _INQUIRYDATA *)InquiryData; - badDriveList[0] = "CD-ROM DRIVE:80 "; - badDriveList[1] = "CD-ROM DRIVE:82 "; - badDriveList[2] = "CD-ROM DRIVE:83 "; - badDriveList[3] = "CD-ROM DRIVE:84 "; - badDriveList[4] = "CD-ROM DRIVE:841"; - badDriveList[5] = "CD-ROM DRIVE:38 "; - badDriveList[6] = "CD-ROM DRIVE 4 M"; - badDriveList[7] = "CD-ROM DRIVE:500"; - badDriveList[8] = "CD-ROM DRIVE:400"; - badDriveList[9] = "CD-ROM DRIVE:401"; - badDriveList[10] = "CD-ROM DRIVE:501"; - badDriveList[11] = "CD-ROM DRIVE:900"; - tmp = RtlCompareMemory(inquiryData->ProductId, badDriveList[i], 16); - } - if (tmp == 16UL) { - return (1); - } else { - + DriverObject->MajorFunction[i] = &CdAudioSendToNextDriver; + DriverObject->MajorFunction[3] = &CdAudioReadWrite; + DriverObject->MajorFunction[4] = &CdAudioReadWrite; + DriverObject->MajorFunction[14] = &CdAudioDeviceControl; + DriverObject->MajorFunction[27] = &CdAudioPnp; + DriverObject->MajorFunction[22] = &CdAudioPower; + (DriverObject->DriverExtension)->AddDevice = &CdAudioAddDevice; + DriverObject->DriverUnload = &CdAudioUnload; + return (0L); } - return (0); } -} -NTSTATUS CdAudioReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PCD_DEVICE_EXTENSION deviceExtension ; - NTSTATUS tmp ; +BOOLEAN NecSupportNeeded(PUCHAR InquiryData) { + PINQUIRYDATA inquiryData; + ULONG i = __VERIFIER_nondet_long(); + PUCHAR badDriveList[12]; + SIZE_T tmp; { - deviceExtension = DeviceObject->DeviceExtension; - if (deviceExtension->PlayActive) { { - Irp->IoStatus.__annonCompField4.Status = -2147483631L; - myStatus = -2147483631L; - IofCompleteRequest(Irp, 0); + inquiryData = (struct _INQUIRYDATA *)InquiryData; + badDriveList[0] = "CD-ROM DRIVE:80 "; + badDriveList[1] = "CD-ROM DRIVE:82 "; + badDriveList[2] = "CD-ROM DRIVE:83 "; + badDriveList[3] = "CD-ROM DRIVE:84 "; + badDriveList[4] = "CD-ROM DRIVE:841"; + badDriveList[5] = "CD-ROM DRIVE:38 "; + badDriveList[6] = "CD-ROM DRIVE 4 M"; + badDriveList[7] = "CD-ROM DRIVE:500"; + badDriveList[8] = "CD-ROM DRIVE:400"; + badDriveList[9] = "CD-ROM DRIVE:401"; + badDriveList[10] = "CD-ROM DRIVE:501"; + badDriveList[11] = "CD-ROM DRIVE:900"; + tmp = RtlCompareMemory(inquiryData->ProductId, badDriveList[i], 16); } - return (-2147483631L); - } else { - + if (tmp == 16UL) { + return (1); + } else { + } + return (0); } +} +NTSTATUS CdAudioReadWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PCD_DEVICE_EXTENSION deviceExtension; + NTSTATUS tmp; + { - tmp = CdAudioSendToNextDriver(DeviceObject, Irp); + deviceExtension = DeviceObject->DeviceExtension; + if (deviceExtension->PlayActive) { + { + Irp->IoStatus.__annonCompField4.Status = -2147483631L; + myStatus = -2147483631L; + IofCompleteRequest(Irp, 0); + } + return (-2147483631L); + } else { + } + { tmp = CdAudioSendToNextDriver(DeviceObject, Irp); } + return (tmp); } - return (tmp); -} } -NTSTATUS CdAudioDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PCD_DEVICE_EXTENSION deviceExtension ; - NTSTATUS status ; +NTSTATUS CdAudioDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PCD_DEVICE_EXTENSION deviceExtension; + NTSTATUS status; { - deviceExtension = DeviceObject->DeviceExtension; - if (deviceExtension->Active == 2) { - goto switch_3_2; - } else { - if (deviceExtension->Active == 3) { - goto switch_3_3; + deviceExtension = DeviceObject->DeviceExtension; + if (deviceExtension->Active == 2) { + goto switch_3_2; } else { - if (deviceExtension->Active == 1) { - goto switch_3_1; + if (deviceExtension->Active == 3) { + goto switch_3_3; } else { - if (deviceExtension->Active == 7) { - goto switch_3_7; + if (deviceExtension->Active == 1) { + goto switch_3_1; } else { - { - goto switch_3_default; - if (0) { - switch_3_2: /* CIL Label */ - { - status = CdAudio535DeviceControl(DeviceObject, Irp); - } - goto switch_3_break; - switch_3_3: /* CIL Label */ - { - status = CdAudio435DeviceControl(DeviceObject, Irp); - } - goto switch_3_break; - switch_3_1: /* CIL Label */ - { - status = CdAudioAtapiDeviceControl(DeviceObject, Irp); - } - goto switch_3_break; - switch_3_7: /* CIL Label */ - { - status = CdAudioHPCdrDeviceControl(DeviceObject, Irp); - } - goto switch_3_break; - switch_3_default: /* CIL Label */ + if (deviceExtension->Active == 7) { + goto switch_3_7; + } else { { - deviceExtension->Active = 0; - status = CdAudioSendToNextDriver(DeviceObject, Irp); + goto switch_3_default; + if (0) { + switch_3_2 : /* CIL Label */ + { + status = CdAudio535DeviceControl(DeviceObject, Irp); + } + goto switch_3_break; + switch_3_3 : /* CIL Label */ + { + status = CdAudio435DeviceControl(DeviceObject, Irp); + } + goto switch_3_break; + switch_3_1 : /* CIL Label */ + { + status = CdAudioAtapiDeviceControl(DeviceObject, Irp); + } + goto switch_3_break; + switch_3_7 : /* CIL Label */ + { + status = CdAudioHPCdrDeviceControl(DeviceObject, Irp); + } + goto switch_3_break; + switch_3_default : /* CIL Label */ + { + deviceExtension->Active = 0; + status = CdAudioSendToNextDriver(DeviceObject, Irp); + } + } else { + switch_3_break: /* CIL Label */; + } } - } else { - switch_3_break: /* CIL Label */ ; - } } } } } + return (status); } - return (status); } -} -NTSTATUS CdAudioSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PCD_DEVICE_EXTENSION deviceExtension ; - NTSTATUS tmp ; +NTSTATUS CdAudioSendToNextDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PCD_DEVICE_EXTENSION deviceExtension; + NTSTATUS tmp; { - deviceExtension = DeviceObject->DeviceExtension; - if (s == NP) { - s = SKIP1; - } else { + deviceExtension = DeviceObject->DeviceExtension; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } { - errorFn(); + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); } + return (tmp); } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); - } - return (tmp); -} } -BOOLEAN CdAudioIsPlayActive(PDEVICE_OBJECT DeviceObject ) -{ PCD_DEVICE_EXTENSION deviceExtension ; - PIRP irp_CdAudioIsPlayActive = __VERIFIER_nondet_pointer() ; - IO_STATUS_BLOCK ioStatus ; - KEVENT event ; - NTSTATUS status = __VERIFIER_nondet_long() ; - PSUB_Q_CURRENT_POSITION currentBuffer ; - BOOLEAN returnValue ; - PVOID tmp ; +BOOLEAN CdAudioIsPlayActive(PDEVICE_OBJECT DeviceObject) { + PCD_DEVICE_EXTENSION deviceExtension; + PIRP irp_CdAudioIsPlayActive = __VERIFIER_nondet_pointer(); + IO_STATUS_BLOCK ioStatus; + KEVENT event; + NTSTATUS status = __VERIFIER_nondet_long(); + PSUB_Q_CURRENT_POSITION currentBuffer; + BOOLEAN returnValue; + PVOID tmp; { - deviceExtension = DeviceObject->DeviceExtension; - if (! deviceExtension->PlayActive) { - return (0); - } else { - - } - { - tmp = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CURRENT_POSITION ), 541156419UL); - currentBuffer = tmp; - } - if ((unsigned int )currentBuffer == (unsigned int )((void *)0)) { - return (0); - } else { - - } - { - ((struct _CDROM_SUB_Q_DATA_FORMAT *)currentBuffer)->Format = 1; - ((struct _CDROM_SUB_Q_DATA_FORMAT *)currentBuffer)->Track = 0; -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - } - if ((unsigned int )irp_CdAudioIsPlayActive == (unsigned int )((void *)0)) { - { -/* ExFreePool(currentBuffer); */ /* INLINED */ + deviceExtension = DeviceObject->DeviceExtension; + if (!deviceExtension->PlayActive) { + return (0); + } else { } - return (0); - } else { - - } - if (status == 259L) { { - KeWaitForSingleObject(& event, 5, 0, 0, (void *)0); - status = ioStatus.__annonCompField4.Status; + tmp = + ExAllocatePoolWithTag(4, sizeof(SUB_Q_CURRENT_POSITION), 541156419UL); + currentBuffer = tmp; + } + if ((unsigned int)currentBuffer == (unsigned int)((void *)0)) { + return (0); + } else { } - } else { - - } - if (! (status >= 0L)) { { -/* ExFreePool(currentBuffer); */ /* INLINED */ + ((struct _CDROM_SUB_Q_DATA_FORMAT *)currentBuffer)->Format = 1; + ((struct _CDROM_SUB_Q_DATA_FORMAT *)currentBuffer)->Track = 0; + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ } - return (0); - } else { - - } - if ((int )currentBuffer->Header.AudioStatus == 17) { - returnValue = 1; - } else { - returnValue = 0; - deviceExtension->PlayActive = 0; - } - { -/* ExFreePool(currentBuffer); */ /* INLINED */ + if ((unsigned int)irp_CdAudioIsPlayActive == (unsigned int)((void *)0)) { + { /* ExFreePool(currentBuffer); */ /* INLINED */ + } + return (0); + } else { + } + if (status == 259L) { + { + KeWaitForSingleObject(&event, 5, 0, 0, (void *)0); + status = ioStatus.__annonCompField4.Status; + } + } else { + } + if (!(status >= 0L)) { + { /* ExFreePool(currentBuffer); */ /* INLINED */ + } + return (0); + } else { + } + if ((int)currentBuffer->Header.AudioStatus == 17) { + returnValue = 1; + } else { + returnValue = 0; + deviceExtension->PlayActive = 0; + } + { /* ExFreePool(currentBuffer); */ /* INLINED */ + } + return (returnValue); } - return (returnValue); -} } -NTSTATUS CdAudioNECDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION currentIrpStack ; - PCD_DEVICE_EXTENSION deviceExtension ; - PCDROM_TOC cdaudioDataOut ; - SCSI_PASS_THROUGH srb ; - PNEC_CDB cdb ; - NTSTATUS status ; - ULONG i ; - ULONG bytesTransfered ; - PUCHAR Toc ; - ULONG retryCount ; - ULONG address ; - LARGE_INTEGER delay ; - BOOLEAN tmp ; - PVOID tmp___0 ; - BOOLEAN tmp___1 ; - PVOID tmp___2 ; - ULONG tracksToReturn ; - ULONG tracksOnCd ; - ULONG tracksInBuffer ; - ULONG dataLength ; - NTSTATUS tmp___3 ; - PCDROM_PLAY_AUDIO_MSF inputBuffer ; - PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ; - PSUB_Q_CURRENT_POSITION userPtr ; - PUCHAR SubQPtr ; - PVOID tmp___4 ; - ULONG tmp___5 ; - NTSTATUS tmp___6 ; +NTSTATUS CdAudioNECDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION currentIrpStack; + PCD_DEVICE_EXTENSION deviceExtension; + PCDROM_TOC cdaudioDataOut; + SCSI_PASS_THROUGH srb; + PNEC_CDB cdb; + NTSTATUS status; + ULONG i; + ULONG bytesTransfered; + PUCHAR Toc; + ULONG retryCount; + ULONG address; + LARGE_INTEGER delay; + BOOLEAN tmp; + PVOID tmp___0; + BOOLEAN tmp___1; + PVOID tmp___2; + ULONG tracksToReturn; + ULONG tracksOnCd; + ULONG tracksInBuffer; + ULONG dataLength; + NTSTATUS tmp___3; + PCDROM_PLAY_AUDIO_MSF inputBuffer; + PCDROM_SEEK_AUDIO_MSF inputBuffer___0; + PSUB_Q_CURRENT_POSITION userPtr; + PUCHAR SubQPtr; + PVOID tmp___4; + ULONG tmp___5; + NTSTATUS tmp___6; { - currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - deviceExtension = DeviceObject->DeviceExtension; - cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer; - cdb = (union _NEC_CDB *)(srb.Cdb); - retryCount = 0; - NECRestart: - { - memset(cdb, 0, 12); - } - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (14 << 2))) { - goto switch_4_exp_0; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) { - goto switch_4_exp_1; + currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + deviceExtension = DeviceObject->DeviceExtension; + cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer; + cdb = (union _NEC_CDB *)(srb.Cdb); + retryCount = 0; + NECRestart : { memset(cdb, 0, 12); } + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (14 << 2))) { + goto switch_4_exp_0; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) { - goto switch_4_exp_2; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + ((2 << 16) | (1 << 14))) { + goto switch_4_exp_1; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) { - goto switch_4_exp_3; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (2 << 2))) { + goto switch_4_exp_2; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) { - goto switch_4_exp_4; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (6 << 2))) { + goto switch_4_exp_3; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) { - goto switch_4_exp_5; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (1 << 2))) { + goto switch_4_exp_4; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) { - goto switch_4_exp_6; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (3 << 2))) { + goto switch_4_exp_5; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) { - goto switch_4_exp_7; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (4 << 2))) { + goto switch_4_exp_6; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) { - goto switch_4_exp_8; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (11 << 2))) { + goto switch_4_exp_7; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) { - goto switch_4_exp_9; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (514 << 2))) { + goto switch_4_exp_8; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) { - goto switch_4_exp_10; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (13 << 2))) { + goto switch_4_exp_9; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) { - goto switch_4_exp_11; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (5 << 2))) { + goto switch_4_exp_10; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_4_exp_12; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (10 << 2))) { + goto switch_4_exp_11; } else { - { - goto switch_4_default; - if (0) { - switch_4_exp_0: /* CIL Label */ ; - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[1]))) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - goto switch_4_break; - } else { - - } - { - tmp = CdAudioIsPlayActive(DeviceObject); - } - if (tmp) { - Irp->IoStatus.Information = 0; - status = -2147483631L; - goto switch_4_break; - } else { - - } - { - tmp___0 = ExAllocatePoolWithTag(4, 1022, 541156419UL); - Toc = (UCHAR *)tmp___0; - } - if ((unsigned int )Toc == (unsigned int )((void *)0)) { - status = -1073741670L; - Irp->IoStatus.Information = 0; - goto SetStatusAndReturn; - } else { - - } + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_4_exp_12; + } else { { - memset(Toc, 0, 1022); - srb.CdbLength = 10; - cdb->NEC_READ_TOC.OperationCode = 222; - cdb->NEC_READ_TOC.Type = 3; - cdb->NEC_READ_TOC.TrackNumber = 176; - srb.TimeOutValue = 10; - status = SendSrbSynchronous(deviceExtension, & srb, - Toc, 1022); - } - if (! (status >= 0L)) { - if (status != -1073741764L) { + goto switch_4_default; + if (0) { + switch_4_exp_0: /* CIL Label */; + if (currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength < + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[1]))) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + goto switch_4_break; + } else { + } + { tmp = CdAudioIsPlayActive(DeviceObject); } + if (tmp) { + Irp->IoStatus.Information = 0; + status = -2147483631L; + goto switch_4_break; + } else { + } { -/* ExFreePool(Toc); */ /* INLINED */ - Irp->IoStatus.Information = 0; + tmp___0 = ExAllocatePoolWithTag( + 4, 1022, 541156419UL); + Toc = (UCHAR *)tmp___0; } - goto SetStatusAndReturn; - } else { - status = 0L; - } - } else { - status = 0L; - } - { - bytesTransfered = (long )(& ((CDROM_TOC *)0)->TrackData[1]); - Irp->IoStatus.Information = bytesTransfered; - memset(cdaudioDataOut, 0, bytesTransfered); - cdaudioDataOut->Length[0] = (unsigned char )((bytesTransfered - 2UL) >> 8); - cdaudioDataOut->Length[1] = (unsigned char )((bytesTransfered - 2UL) & 255UL); - } - if (*((ULONG *)(Toc + 14)) == 0UL) { + if ((unsigned int)Toc == + (unsigned int)((void *)0)) { + status = -1073741670L; + Irp->IoStatus.Information = 0; + goto SetStatusAndReturn; + } else { + } + { + memset(Toc, 0, 1022); + srb.CdbLength = 10; + cdb->NEC_READ_TOC.OperationCode = 222; + cdb->NEC_READ_TOC.Type = 3; + cdb->NEC_READ_TOC.TrackNumber = 176; + srb.TimeOutValue = 10; + status = SendSrbSynchronous( + deviceExtension, &srb, Toc, 1022); + } + if (!(status >= 0L)) { + if (status != -1073741764L) { + { + /* ExFreePool(Toc); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; + } else { + status = 0L; + } + } else { + status = 0L; + } + { + bytesTransfered = + (long)(&((CDROM_TOC *)0)->TrackData[1]); + Irp->IoStatus.Information = bytesTransfered; + memset(cdaudioDataOut, 0, bytesTransfered); + cdaudioDataOut->Length[0] = + (unsigned char)((bytesTransfered - + 2UL) >> + 8); + cdaudioDataOut->Length[1] = + (unsigned char)((bytesTransfered - + 2UL) & + 255UL); + } + if (*((ULONG *)(Toc + 14)) == 0UL) { + { + /* ExFreePool(Toc); */ /* INLINED */ + } + goto switch_4_break; + } else { + } + { + cdaudioDataOut->FirstTrack = 1; + cdaudioDataOut->LastTrack = 2; + cdaudioDataOut->TrackData[0].Reserved = 0; + cdaudioDataOut->TrackData[0].Control = + (((int)*(Toc + 2) & 15) << 4) | + ((int)*(Toc + 2) >> 4); + cdaudioDataOut->TrackData[0].TrackNumber = + 1; + cdaudioDataOut->TrackData[0].Reserved1 = 0; + address = + (((((int)*(Toc + 15) & 240) >> 4) * 10 + + ((int)*(Toc + 15) & 15)) * + 60 + + ((((int)*(Toc + 16) & 240) >> 4) * 10 + + ((int)*(Toc + 16) & 15))) * + 75 + + ((((int)*(Toc + 17) & 240) >> 4) * 10 + + ((int)*(Toc + 17) & 15)); + cdaudioDataOut->TrackData[0].Address[0] = + (unsigned char)(address >> 24); + cdaudioDataOut->TrackData[0].Address[1] = + (unsigned char)(address >> 16); + cdaudioDataOut->TrackData[0].Address[2] = + (unsigned char)(address >> 8); + cdaudioDataOut->TrackData[0].Address[3] = + (unsigned char)address; + /* ExFreePool(Toc); */ /* INLINED */ + } + goto switch_4_break; + switch_4_exp_1 : /* CIL Label */ { -/* ExFreePool(Toc); */ /* INLINED */ + tmp___1 = CdAudioIsPlayActive(DeviceObject); } - goto switch_4_break; - } else { - - } - { - cdaudioDataOut->FirstTrack = 1; - cdaudioDataOut->LastTrack = 2; - cdaudioDataOut->TrackData[0].Reserved = 0; - cdaudioDataOut->TrackData[0].Control = (((int )*(Toc + 2) & 15) << 4) | ((int )*(Toc + 2) >> 4); - cdaudioDataOut->TrackData[0].TrackNumber = 1; - cdaudioDataOut->TrackData[0].Reserved1 = 0; - address = (((((int )*(Toc + 15) & 240) >> 4) * 10 + ((int )*(Toc + 15) & 15)) * 60 + ((((int )*(Toc + 16) & 240) >> 4) * 10 + ((int )*(Toc + 16) & 15))) * 75 + ((((int )*(Toc + 17) & 240) >> 4) * 10 + ((int )*(Toc + 17) & 15)); - cdaudioDataOut->TrackData[0].Address[0] = (unsigned char )(address >> 24); - cdaudioDataOut->TrackData[0].Address[1] = (unsigned char )(address >> 16); - cdaudioDataOut->TrackData[0].Address[2] = (unsigned char )(address >> 8); - cdaudioDataOut->TrackData[0].Address[3] = (unsigned char )address; -/* ExFreePool(Toc); */ /* INLINED */ - } - goto switch_4_break; - switch_4_exp_1: /* CIL Label */ - { - tmp___1 = CdAudioIsPlayActive(DeviceObject); - } - if (tmp___1) { - status = -2147483631L; - Irp->IoStatus.Information = 0; - goto switch_4_break; - } else { - - } - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - goto switch_4_break; - } else { - - } - { - tmp___2 = ExAllocatePoolWithTag(4, 1022, 541156419UL); - Toc = (UCHAR *)tmp___2; - } - if ((unsigned int )Toc == (unsigned int )((void *)0)) { - status = -1073741670L; - Irp->IoStatus.Information = 0; - goto SetStatusAndReturn; - } else { - - } - { - memset(Toc, 0, 1022); - srb.CdbLength = 10; - cdb->NEC_READ_TOC.OperationCode = 222; - cdb->NEC_READ_TOC.Type = 3; - srb.TimeOutValue = 10; - status = SendSrbSynchronous(deviceExtension, & srb, - Toc, 1022); - } - if (! (status >= 0L)) { - if (status != -1073741764L) { - if (status != -1073741764L) { - { + if (tmp___1) { + status = -2147483631L; + Irp->IoStatus.Information = 0; + goto switch_4_break; + } else { + } + if (currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength < + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[0]))) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + goto switch_4_break; + } else { + } + { + tmp___2 = ExAllocatePoolWithTag( + 4, 1022, 541156419UL); + Toc = (UCHAR *)tmp___2; + } + if ((unsigned int)Toc == + (unsigned int)((void *)0)) { + status = -1073741670L; Irp->IoStatus.Information = 0; -/* ExFreePool(Toc); */ /* INLINED */ - } goto SetStatusAndReturn; } else { - } - } else { - status = 0L; - } - } else { - status = 0L; - } - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) { - bytesTransfered = sizeof(CDROM_TOC ); - } else { - bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength; - } - cdaudioDataOut->FirstTrack = (((int )*(Toc + 9) & 240) >> 4) * 10 + ((int )*(Toc + 9) & 15); - cdaudioDataOut->LastTrack = (((int )*(Toc + 19) & 240) >> 4) * 10 + ((int )*(Toc + 19) & 15); - tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1; - dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL; - cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8); - cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL); - tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0])); - tracksInBuffer /= (ULONG )sizeof(TRACK_DATA ); - if (tracksInBuffer < tracksOnCd) { - tracksToReturn = tracksInBuffer; - } else { - tracksToReturn = tracksOnCd; - } - i = 0; - { - while (1) { - while_5_continue: /* CIL Label */ ; - if (i < tracksToReturn) { - - } else { - goto while_5_break; - } - cdaudioDataOut->TrackData[i].Reserved = 0; - cdaudioDataOut->TrackData[i].Control = (((int )*(Toc + (i * 10UL + 32UL)) & 15) << 4) | ((int )*(Toc + (i * 10UL + 32UL)) >> 4); - cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack); - cdaudioDataOut->TrackData[i].Reserved1 = 0; - cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + (i * 10UL + 39UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 10UL + 39UL)) & 15); - cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + (i * 10UL + 40UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 10UL + 40UL)) & 15); - cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + (i * 10UL + 41UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 10UL + 41UL)) & 15); - i += 1UL; - } - while_5_break: /* CIL Label */ ; - } - if (tracksInBuffer > tracksOnCd) { - cdaudioDataOut->TrackData[i].Reserved = 0; - cdaudioDataOut->TrackData[i].Control = 16; - cdaudioDataOut->TrackData[i].TrackNumber = 170; - cdaudioDataOut->TrackData[i].Reserved1 = 0; - cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 29) & 240) >> 4) * 10 + ((int )*(Toc + 29) & 15); - cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 30) & 240) >> 4) * 10 + ((int )*(Toc + 30) & 15); - cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 31) & 240) >> 4) * 10 + ((int )*(Toc + 31) & 15); - i += 1UL; - } else { - - } - { - Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i])); -/* ExFreePool(Toc); */ /* INLINED */ - } - goto switch_4_break; - switch_4_exp_2: /* CIL Label */ - { - deviceExtension->PlayActive = 0; - tmp___3 = CdAudioSendToNextDriver(DeviceObject, Irp); - } - return (tmp___3); - goto switch_4_break; - switch_4_exp_3: /* CIL Label */ - inputBuffer = Irp->AssociatedIrp.SystemBuffer; - if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) { - status = -1073741820L; - Irp->IoStatus.Information = 0; - goto switch_4_break; - } else { + { + memset(Toc, 0, 1022); + srb.CdbLength = 10; + cdb->NEC_READ_TOC.OperationCode = 222; + cdb->NEC_READ_TOC.Type = 3; + srb.TimeOutValue = 10; + status = SendSrbSynchronous( + deviceExtension, &srb, Toc, 1022); + } + if (!(status >= 0L)) { + if (status != -1073741764L) { + if (status != -1073741764L) { + { + Irp->IoStatus.Information = 0; + /* ExFreePool(Toc); */ /* INLINED */ + } + goto SetStatusAndReturn; + } else { + } + } else { + status = 0L; + } + } else { + status = 0L; + } + if (currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength > + (ULONG)sizeof(CDROM_TOC)) { + bytesTransfered = sizeof(CDROM_TOC); + } else { + bytesTransfered = + currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength; + } + cdaudioDataOut->FirstTrack = + (((int)*(Toc + 9) & 240) >> 4) * 10 + + ((int)*(Toc + 9) & 15); + cdaudioDataOut->LastTrack = + (((int)*(Toc + 19) & 240) >> 4) * 10 + + ((int)*(Toc + 19) & 15); + tracksOnCd = + ((int)cdaudioDataOut->LastTrack - + (int)cdaudioDataOut->FirstTrack) + + 1; + dataLength = + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[tracksOnCd])) - + 2UL; + cdaudioDataOut->Length[0] = + (unsigned char)(dataLength >> 8); + cdaudioDataOut->Length[1] = + (unsigned char)(dataLength & 255UL); + tracksInBuffer = + currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength - + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[0])); + tracksInBuffer /= (ULONG)sizeof(TRACK_DATA); + if (tracksInBuffer < tracksOnCd) { + tracksToReturn = tracksInBuffer; + } else { + tracksToReturn = tracksOnCd; + } + i = 0; + { + while (1) { + while_5_continue: /* CIL Label */; + if (i < tracksToReturn) { - } - { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->NEC_PLAY_AUDIO.OperationCode = 216; - cdb->NEC_PLAY_AUDIO.PlayMode = 1; - cdb->NEC_PLAY_AUDIO.Minute = ((int )inputBuffer->StartingM / 10 << 4) + (int )inputBuffer->StartingM % 10; - cdb->NEC_PLAY_AUDIO.Second = ((int )inputBuffer->StartingS / 10 << 4) + (int )inputBuffer->StartingS % 10; - cdb->NEC_PLAY_AUDIO.Frame = ((int )inputBuffer->StartingF / 10 << 4) + (int )inputBuffer->StartingF % 10; - cdb->NEC_PLAY_AUDIO.Control = 64; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); - } - if (status >= 0L) { + } else { + goto while_5_break; + } + cdaudioDataOut->TrackData[i].Reserved = 0; + cdaudioDataOut->TrackData[i].Control = + (((int)*(Toc + (i * 10UL + 32UL)) & + 15) + << 4) | + ((int)*(Toc + (i * 10UL + 32UL)) >> + 4); + cdaudioDataOut->TrackData[i].TrackNumber = + (unsigned char)(i + + (ULONG)cdaudioDataOut + ->FirstTrack); + cdaudioDataOut->TrackData[i].Reserved1 = + 0; + cdaudioDataOut->TrackData[i].Address[0] = + 0; + cdaudioDataOut->TrackData[i].Address[1] = + (((int)*(Toc + (i * 10UL + 39UL)) & + 240) >> + 4) * + 10 + + ((int)*(Toc + (i * 10UL + 39UL)) & + 15); + cdaudioDataOut->TrackData[i].Address[2] = + (((int)*(Toc + (i * 10UL + 40UL)) & + 240) >> + 4) * + 10 + + ((int)*(Toc + (i * 10UL + 40UL)) & + 15); + cdaudioDataOut->TrackData[i].Address[3] = + (((int)*(Toc + (i * 10UL + 41UL)) & + 240) >> + 4) * + 10 + + ((int)*(Toc + (i * 10UL + 41UL)) & + 15); + i += 1UL; + } + while_5_break: /* CIL Label */; + } + if (tracksInBuffer > tracksOnCd) { + cdaudioDataOut->TrackData[i].Reserved = 0; + cdaudioDataOut->TrackData[i].Control = 16; + cdaudioDataOut->TrackData[i].TrackNumber = + 170; + cdaudioDataOut->TrackData[i].Reserved1 = 0; + cdaudioDataOut->TrackData[i].Address[0] = 0; + cdaudioDataOut->TrackData[i].Address[1] = + (((int)*(Toc + 29) & 240) >> 4) * 10 + + ((int)*(Toc + 29) & 15); + cdaudioDataOut->TrackData[i].Address[2] = + (((int)*(Toc + 30) & 240) >> 4) * 10 + + ((int)*(Toc + 30) & 15); + cdaudioDataOut->TrackData[i].Address[3] = + (((int)*(Toc + 31) & 240) >> 4) * 10 + + ((int)*(Toc + 31) & 15); + i += 1UL; + } else { + } + { + Irp->IoStatus + .Information = (unsigned long)(( + long)(&((CDROM_TOC *)0)->TrackData[i])); + /* ExFreePool(Toc); */ /* INLINED */ + } + goto switch_4_break; + switch_4_exp_2 : /* CIL Label */ { - deviceExtension->PlayActive = 1; - memset(cdb, 0, 12); - cdb->NEC_PLAY_AUDIO.OperationCode = 217; - cdb->NEC_PLAY_AUDIO.PlayMode = 3; - cdb->NEC_PLAY_AUDIO.Minute = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10; - cdb->NEC_PLAY_AUDIO.Second = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10; - cdb->NEC_PLAY_AUDIO.Frame = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10; - cdb->NEC_PLAY_AUDIO.Control = 64; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); + deviceExtension->PlayActive = 0; + tmp___3 = CdAudioSendToNextDriver( + DeviceObject, Irp); } - } else { - - } - goto switch_4_break; - switch_4_exp_4: /* CIL Label */ - inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer; - if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) { - status = -1073741820L; - Irp->IoStatus.Information = 0; - goto switch_4_break; - } else { - - } - { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->NEC_SEEK_AUDIO.OperationCode = 216; - cdb->NEC_SEEK_AUDIO.Minute = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10; - cdb->NEC_SEEK_AUDIO.Second = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10; - cdb->NEC_SEEK_AUDIO.Frame = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10; - cdb->NEC_SEEK_AUDIO.Control = 64; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); - } - goto switch_4_break; - switch_4_exp_5: /* CIL Label */ - { - deviceExtension->PlayActive = 0; - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->NEC_PAUSE_AUDIO.OperationCode = 218; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); - } - goto switch_4_break; - switch_4_exp_6: /* CIL Label */ - { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->NEC_PLAY_AUDIO.OperationCode = 217; - cdb->NEC_PLAY_AUDIO.PlayMode = 3; - cdb->NEC_PLAY_AUDIO.Control = 192; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); - } - goto switch_4_break; - switch_4_exp_7: /* CIL Label */ - { - userPtr = Irp->AssociatedIrp.SystemBuffer; - tmp___4 = ExAllocatePoolWithTag(4, 10, 541156419UL); - SubQPtr = tmp___4; - } - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - if (SubQPtr) { + return (tmp___3); + goto switch_4_break; + switch_4_exp_3: /* CIL Label */ + inputBuffer = Irp->AssociatedIrp.SystemBuffer; + if (currentIrpStack->Parameters + .DeviceIoControl.InputBufferLength < + (ULONG)sizeof(CDROM_PLAY_AUDIO_MSF)) { + status = -1073741820L; + Irp->IoStatus.Information = 0; + goto switch_4_break; + } else { + } { -/* ExFreePool(SubQPtr); */ /* INLINED */ + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->NEC_PLAY_AUDIO.OperationCode = 216; + cdb->NEC_PLAY_AUDIO.PlayMode = 1; + cdb->NEC_PLAY_AUDIO.Minute = + ((int)inputBuffer->StartingM / 10 + << 4) + + (int)inputBuffer->StartingM % 10; + cdb->NEC_PLAY_AUDIO.Second = + ((int)inputBuffer->StartingS / 10 + << 4) + + (int)inputBuffer->StartingS % 10; + cdb->NEC_PLAY_AUDIO.Frame = + ((int)inputBuffer->StartingF / 10 + << 4) + + (int)inputBuffer->StartingF % 10; + cdb->NEC_PLAY_AUDIO.Control = 64; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); } - } else { - + if (status >= 0L) { + { + deviceExtension->PlayActive = 1; + memset(cdb, 0, 12); + cdb->NEC_PLAY_AUDIO.OperationCode = 217; + cdb->NEC_PLAY_AUDIO.PlayMode = 3; + cdb->NEC_PLAY_AUDIO.Minute = + ((int)inputBuffer->EndingM / 10 + << 4) + + (int)inputBuffer->EndingM % 10; + cdb->NEC_PLAY_AUDIO.Second = + ((int)inputBuffer->EndingS / 10 + << 4) + + (int)inputBuffer->EndingS % 10; + cdb->NEC_PLAY_AUDIO.Frame = + ((int)inputBuffer->EndingF / 10 + << 4) + + (int)inputBuffer->EndingF % 10; + cdb->NEC_PLAY_AUDIO.Control = 64; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + } else { + } + goto switch_4_break; + switch_4_exp_4: /* CIL Label */ + inputBuffer___0 = + Irp->AssociatedIrp.SystemBuffer; + if (currentIrpStack->Parameters + .DeviceIoControl.InputBufferLength < + (ULONG)sizeof(CDROM_SEEK_AUDIO_MSF)) { + status = -1073741820L; + Irp->IoStatus.Information = 0; + goto switch_4_break; + } else { + } + { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->NEC_SEEK_AUDIO.OperationCode = 216; + cdb->NEC_SEEK_AUDIO.Minute = + ((int)inputBuffer___0->M / 10 << 4) + + (int)inputBuffer___0->M % 10; + cdb->NEC_SEEK_AUDIO.Second = + ((int)inputBuffer___0->S / 10 << 4) + + (int)inputBuffer___0->S % 10; + cdb->NEC_SEEK_AUDIO.Frame = + ((int)inputBuffer___0->F / 10 << 4) + + (int)inputBuffer___0->F % 10; + cdb->NEC_SEEK_AUDIO.Control = 64; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + goto switch_4_break; + switch_4_exp_5 : /* CIL Label */ + { + deviceExtension->PlayActive = 0; + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->NEC_PAUSE_AUDIO.OperationCode = 218; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); } - goto switch_4_break; - } else { - - } - if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) { - status = -1073741670L; - Irp->IoStatus.Information = 0; - goto SetStatusAndReturn; - } else { - - } - { - memset(SubQPtr, 0, 10); - } - if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) { + goto switch_4_break; + switch_4_exp_6 : /* CIL Label */ { -/* ExFreePool(SubQPtr); */ /* INLINED */ - status = -1073741823L; - Irp->IoStatus.Information = 0; + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->NEC_PLAY_AUDIO.OperationCode = 217; + cdb->NEC_PLAY_AUDIO.PlayMode = 3; + cdb->NEC_PLAY_AUDIO.Control = 192; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); } - goto SetStatusAndReturn; - } else { - - } - NECSeek: - { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->NEC_READ_Q_CHANNEL.OperationCode = 221; - cdb->NEC_READ_Q_CHANNEL.TransferSize = 10; - status = SendSrbSynchronous(deviceExtension, & srb, - SubQPtr, 10); - } - if (status >= 0L) { - goto _L; - } else { - if (status == -1073741764L) { - _L: /* CIL Label */ - userPtr->Header.Reserved = 0; - if ((int )*(SubQPtr + 0) == 0) { - userPtr->Header.AudioStatus = 17; - } else { - if ((int )*(SubQPtr + 0) == 1) { - userPtr->Header.AudioStatus = 18; - deviceExtension->PlayActive = 0; + goto switch_4_break; + switch_4_exp_7 : /* CIL Label */ + { + userPtr = Irp->AssociatedIrp.SystemBuffer; + tmp___4 = + ExAllocatePoolWithTag(4, 10, 541156419UL); + SubQPtr = tmp___4; + } + if (currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength < + (ULONG)sizeof(SUB_Q_CURRENT_POSITION)) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + if (SubQPtr) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + } } else { - if ((int )*(SubQPtr + 0) == 2) { - userPtr->Header.AudioStatus = 18; - deviceExtension->PlayActive = 0; + } + goto switch_4_break; + } else { + } + if ((unsigned int)SubQPtr == + (unsigned int)((void *)0)) { + status = -1073741670L; + Irp->IoStatus.Information = 0; + goto SetStatusAndReturn; + } else { + } + { memset(SubQPtr, 0, 10); } + if ((int)((struct _CDROM_SUB_Q_DATA_FORMAT *) + userPtr) + ->Format != 1) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + status = -1073741823L; + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; + } else { + } + NECSeek : { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->NEC_READ_Q_CHANNEL.OperationCode = 221; + cdb->NEC_READ_Q_CHANNEL.TransferSize = 10; + status = SendSrbSynchronous( + deviceExtension, &srb, SubQPtr, 10); + } + if (status >= 0L) { + goto _L; + } else { + if (status == -1073741764L) { + _L: /* CIL Label */ + userPtr->Header.Reserved = 0; + if ((int)*(SubQPtr + 0) == 0) { + userPtr->Header.AudioStatus = 17; } else { - if ((int )*(SubQPtr + 0) == 3) { - userPtr->Header.AudioStatus = 19; + if ((int)*(SubQPtr + 0) == 1) { + userPtr->Header.AudioStatus = 18; deviceExtension->PlayActive = 0; } else { - deviceExtension->PlayActive = 0; + if ((int)*(SubQPtr + 0) == 2) { + userPtr->Header.AudioStatus = 18; + deviceExtension->PlayActive = 0; + } else { + if ((int)*(SubQPtr + 0) == 3) { + userPtr->Header.AudioStatus = 19; + deviceExtension->PlayActive = 0; + } else { + deviceExtension->PlayActive = 0; + } + } } } - } - } - userPtr->Header.DataLength[0] = 0; - userPtr->Header.DataLength[0] = 12; - userPtr->FormatCode = 1; - userPtr->Control = (int )*(SubQPtr + 1) & 15; - userPtr->ADR = 0; - userPtr->TrackNumber = (((int )*(SubQPtr + 2) & 240) >> 4) * 10 + ((int )*(SubQPtr + 2) & 15); - userPtr->IndexNumber = (((int )*(SubQPtr + 3) & 240) >> 4) * 10 + ((int )*(SubQPtr + 3) & 15); - userPtr->AbsoluteAddress[0] = 0; - userPtr->AbsoluteAddress[1] = (((int )*(SubQPtr + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr + 7) & 15); - userPtr->AbsoluteAddress[2] = (((int )*(SubQPtr + 8) & 240) >> 4) * 10 + ((int )*(SubQPtr + 8) & 15); - userPtr->AbsoluteAddress[3] = (((int )*(SubQPtr + 9) & 240) >> 4) * 10 + ((int )*(SubQPtr + 9) & 15); - userPtr->TrackRelativeAddress[0] = 0; - userPtr->TrackRelativeAddress[1] = (((int )*(SubQPtr + 4) & 240) >> 4) * 10 + ((int )*(SubQPtr + 4) & 15); - userPtr->TrackRelativeAddress[2] = (((int )*(SubQPtr + 5) & 240) >> 4) * 10 + ((int )*(SubQPtr + 5) & 15); - userPtr->TrackRelativeAddress[3] = (((int )*(SubQPtr + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr + 6) & 15); - Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION ); - if ((int )userPtr->TrackNumber > 100) { - { - delay.QuadPart = -5000000; - KeDelayExecutionThread(0, 0, & delay); - tmp___5 = retryCount; - retryCount += 1UL; - } - if (tmp___5 < 4UL) { - goto NECSeek; + userPtr->Header.DataLength[0] = 0; + userPtr->Header.DataLength[0] = 12; + userPtr->FormatCode = 1; + userPtr->Control = + (int)*(SubQPtr + 1) & 15; + userPtr->ADR = 0; + userPtr->TrackNumber = + (((int)*(SubQPtr + 2) & 240) >> 4) * + 10 + + ((int)*(SubQPtr + 2) & 15); + userPtr->IndexNumber = + (((int)*(SubQPtr + 3) & 240) >> 4) * + 10 + + ((int)*(SubQPtr + 3) & 15); + userPtr->AbsoluteAddress[0] = 0; + userPtr->AbsoluteAddress[1] = + (((int)*(SubQPtr + 7) & 240) >> 4) * + 10 + + ((int)*(SubQPtr + 7) & 15); + userPtr->AbsoluteAddress[2] = + (((int)*(SubQPtr + 8) & 240) >> 4) * + 10 + + ((int)*(SubQPtr + 8) & 15); + userPtr->AbsoluteAddress[3] = + (((int)*(SubQPtr + 9) & 240) >> 4) * + 10 + + ((int)*(SubQPtr + 9) & 15); + userPtr->TrackRelativeAddress[0] = 0; + userPtr->TrackRelativeAddress[1] = + (((int)*(SubQPtr + 4) & 240) >> 4) * + 10 + + ((int)*(SubQPtr + 4) & 15); + userPtr->TrackRelativeAddress[2] = + (((int)*(SubQPtr + 5) & 240) >> 4) * + 10 + + ((int)*(SubQPtr + 5) & 15); + userPtr->TrackRelativeAddress[3] = + (((int)*(SubQPtr + 6) & 240) >> 4) * + 10 + + ((int)*(SubQPtr + 6) & 15); + Irp->IoStatus.Information = + sizeof(SUB_Q_CURRENT_POSITION); + if ((int)userPtr->TrackNumber > 100) { + { + delay.QuadPart = -5000000; + KeDelayExecutionThread(0, 0, &delay); + tmp___5 = retryCount; + retryCount += 1UL; + } + if (tmp___5 < 4UL) { + goto NECSeek; + } else { + Irp->IoStatus.Information = 0; + status = -1073741434L; + } + } else { + status = 0L; + } } else { - Irp->IoStatus.Information = 0; - status = -1073741434L; + { + memset(userPtr, 0, + sizeof(SUB_Q_CURRENT_POSITION)); + Irp->IoStatus.Information = 0; + } } - } else { - status = 0L; } - } else { { - memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION )); - Irp->IoStatus.Information = 0; + /* ExFreePool(SubQPtr); */ /* INLINED */ } + goto switch_4_break; + switch_4_exp_8 : /* CIL Label */ + { + deviceExtension->PlayActive = 0; + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->NEC_EJECT.OperationCode = 220; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + Irp->IoStatus.Information = 0; + } + goto switch_4_break; + switch_4_exp_9: /* CIL Label */; + switch_4_exp_10: /* CIL Label */; + switch_4_exp_11: /* CIL Label */ + Irp->IoStatus.Information = 0; + status = -1073741808L; + goto switch_4_break; + switch_4_exp_12 : /* CIL Label */ + { + CdAudioIsPlayActive(DeviceObject); + } + switch_4_default : /* CIL Label */ + { + tmp___6 = CdAudioSendToNextDriver( + DeviceObject, Irp); + } + return (tmp___6); + goto switch_4_break; + } else { + switch_4_break: /* CIL Label */; } } - { -/* ExFreePool(SubQPtr); */ /* INLINED */ - } - goto switch_4_break; - switch_4_exp_8: /* CIL Label */ - { - deviceExtension->PlayActive = 0; - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->NEC_EJECT.OperationCode = 220; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); - Irp->IoStatus.Information = 0; - } - goto switch_4_break; - switch_4_exp_9: /* CIL Label */ ; - switch_4_exp_10: /* CIL Label */ ; - switch_4_exp_11: /* CIL Label */ - Irp->IoStatus.Information = 0; - status = -1073741808L; - goto switch_4_break; - switch_4_exp_12: /* CIL Label */ - { - CdAudioIsPlayActive(DeviceObject); - } - switch_4_default: /* CIL Label */ - { - tmp___6 = CdAudioSendToNextDriver(DeviceObject, Irp); - } - return (tmp___6); - goto switch_4_break; - } else { - switch_4_break: /* CIL Label */ ; - } } } } @@ -4447,612 +4521,712 @@ NTSTATUS CdAudioNECDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } - } - SetStatusAndReturn: - if (status == -2147483626L) { - if ((int )currentIrpStack->Flags & 2) { - status = -1073741435L; - goto NECRestart; + SetStatusAndReturn: + if (status == -2147483626L) { + if ((int)currentIrpStack->Flags & 2) { + status = -1073741435L; + goto NECRestart; + } else { + } + { + /* IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } } else { - } { -/* IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */ - Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); } - } else { - - } - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + return (status); } - return (status); } -} -NTSTATUS CdAudioPioneerDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION currentIrpStack ; - PCD_DEVICE_EXTENSION deviceExtension ; - PCDROM_TOC cdaudioDataOut ; - SCSI_PASS_THROUGH srb ; - PPNR_CDB cdb ; - PCDB scsiCdb ; - NTSTATUS status ; - ULONG i ; - ULONG retry ; - PUCHAR Toc ; - BOOLEAN tmp ; - PVOID tmp___0 ; - ULONG tracksToReturn ; - ULONG tracksOnCd ; - ULONG tracksInBuffer ; - ULONG dataLength ; - NTSTATUS tmp___1 ; - PCDROM_PLAY_AUDIO_MSF inputBuffer ; - ULONG tmp___2 ; - ULONG tmp___3 ; - PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ; - ULONG tmp___4 ; - PSUB_Q_CURRENT_POSITION userPtr ; - PUCHAR SubQPtr ; - PVOID tmp___5 ; - ULONG tmp___6 ; - ULONG tmp___7 ; - NTSTATUS tmp___8 ; +NTSTATUS CdAudioPioneerDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION currentIrpStack; + PCD_DEVICE_EXTENSION deviceExtension; + PCDROM_TOC cdaudioDataOut; + SCSI_PASS_THROUGH srb; + PPNR_CDB cdb; + PCDB scsiCdb; + NTSTATUS status; + ULONG i; + ULONG retry; + PUCHAR Toc; + BOOLEAN tmp; + PVOID tmp___0; + ULONG tracksToReturn; + ULONG tracksOnCd; + ULONG tracksInBuffer; + ULONG dataLength; + NTSTATUS tmp___1; + PCDROM_PLAY_AUDIO_MSF inputBuffer; + ULONG tmp___2; + ULONG tmp___3; + PCDROM_SEEK_AUDIO_MSF inputBuffer___0; + ULONG tmp___4; + PSUB_Q_CURRENT_POSITION userPtr; + PUCHAR SubQPtr; + PVOID tmp___5; + ULONG tmp___6; + ULONG tmp___7; + NTSTATUS tmp___8; { - currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - deviceExtension = DeviceObject->DeviceExtension; - cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer; - cdb = (union _PIONEER_CDB *)(srb.Cdb); - scsiCdb = (union _CDB *)(srb.Cdb); - PioneerRestart: - { - memset(cdb, 0, 12); - } - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) { - goto switch_6_exp_13; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) { - goto switch_6_exp_14; + currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + deviceExtension = DeviceObject->DeviceExtension; + cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer; + cdb = (union _PIONEER_CDB *)(srb.Cdb); + scsiCdb = (union _CDB *)(srb.Cdb); + PioneerRestart : { memset(cdb, 0, 12); } + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + ((2 << 16) | (1 << 14))) { + goto switch_6_exp_13; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) { - goto switch_6_exp_15; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (2 << 2))) { + goto switch_6_exp_14; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) { - goto switch_6_exp_16; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (6 << 2))) { + goto switch_6_exp_15; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) { - goto switch_6_exp_17; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (1 << 2))) { + goto switch_6_exp_16; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) { - goto switch_6_exp_18; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (3 << 2))) { + goto switch_6_exp_17; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) { - goto switch_6_exp_19; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (4 << 2))) { + goto switch_6_exp_18; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) { - goto switch_6_exp_20; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (11 << 2))) { + goto switch_6_exp_19; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) { - goto switch_6_exp_21; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (514 << 2))) { + goto switch_6_exp_20; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) { - goto switch_6_exp_22; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (13 << 2))) { + goto switch_6_exp_21; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) { - goto switch_6_exp_23; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (5 << 2))) { + goto switch_6_exp_22; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_6_exp_24; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (10 << 2))) { + goto switch_6_exp_23; } else { - { - goto switch_6_default; - if (0) { - switch_6_exp_13: /* CIL Label */ ; - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - goto switch_6_break; - } else { - - } - { - tmp = CdAudioIsPlayActive(DeviceObject); - } - if (tmp) { - status = -2147483631L; - Irp->IoStatus.Information = 0; - goto switch_6_break; - } else { - - } - { - tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ), - 541156419UL); - Toc = (UCHAR *)tmp___0; - } - if ((unsigned int )Toc == (unsigned int )((void *)0)) { - status = -1073741670L; - Irp->IoStatus.Information = 0; - goto SetStatusAndReturn; - } else { - - } - { - memset(Toc, 0, sizeof(CDROM_TOC )); - } - if ((int )deviceExtension->Active == 9) { - cdb->PNR_START_STOP.Immediate = 1; - } else { - cdb->PNR_START_STOP.Immediate = 0; - } - { - cdb->PNR_START_STOP.OperationCode = 27; - cdb->PNR_START_STOP.Start = 1; - srb.CdbLength = 6; - srb.TimeOutValue = 10; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); - } - if (! (status >= 0L)) { - { -/* ExFreePool(Toc); */ /* INLINED */ - Irp->IoStatus.Information = 0; - } - goto SetStatusAndReturn; - } else { - - } - { - memset(cdb, 0, 12); - srb.CdbLength = 10; - cdb->PNR_READ_TOC.OperationCode = 193; - cdb->PNR_READ_TOC.AssignedLength[1] = 4; - cdb->PNR_READ_TOC.Type = 0; - srb.TimeOutValue = 10; - status = SendSrbSynchronous(deviceExtension, & srb, Toc, - 4); - } - if (! (status >= 0L)) { - { -/* ExFreePool(Toc); */ /* INLINED */ - Irp->IoStatus.Information = 0; - } - goto SetStatusAndReturn; - } else { - - } - cdaudioDataOut->FirstTrack = (((int )*(Toc + 0) & 240) >> 4) * 10 + ((int )*(Toc + 0) & 15); - cdaudioDataOut->LastTrack = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15); - tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1; - dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL; - cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8); - cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL); - tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0])); - tracksInBuffer /= (ULONG )sizeof(TRACK_DATA ); - if (tracksInBuffer < tracksOnCd) { - tracksToReturn = tracksInBuffer; - } else { - tracksToReturn = tracksOnCd; - } - i = 0; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_6_exp_24; + } else { { - while (1) { - while_7_continue: /* CIL Label */ ; - if (i < tracksToReturn) { - - } else { - goto while_7_break; - } - { - memset(cdb, 0, 12); - cdb->PNR_READ_TOC.OperationCode = 193; - cdb->PNR_READ_TOC.TrackNumber = (unsigned char )(((i + (ULONG )cdaudioDataOut->FirstTrack) / 10UL << 4) + (i + (ULONG )cdaudioDataOut->FirstTrack) % 10UL); - cdb->PNR_READ_TOC.AssignedLength[1] = 4; - cdb->PNR_READ_TOC.Type = 2; - srb.TimeOutValue = 10; - status = SendSrbSynchronous(deviceExtension, & srb, - Toc, 4); - } - if (! (status >= 0L)) { + goto switch_6_default; + if (0) { + switch_6_exp_13: /* CIL Label */; + if (currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength < + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[0]))) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + goto switch_6_break; + } else { + } + { tmp = CdAudioIsPlayActive(DeviceObject); } + if (tmp) { + status = -2147483631L; + Irp->IoStatus.Information = 0; + goto switch_6_break; + } else { + } { -/* ExFreePool(Toc); */ /* INLINED */ - Irp->IoStatus.Information = 0; + tmp___0 = ExAllocatePoolWithTag( + 4, sizeof(CDROM_TOC), 541156419UL); + Toc = (UCHAR *)tmp___0; + } + if ((unsigned int)Toc == + (unsigned int)((void *)0)) { + status = -1073741670L; + Irp->IoStatus.Information = 0; + goto SetStatusAndReturn; + } else { + } + { memset(Toc, 0, sizeof(CDROM_TOC)); } + if ((int)deviceExtension->Active == 9) { + cdb->PNR_START_STOP.Immediate = 1; + } else { + cdb->PNR_START_STOP.Immediate = 0; } - goto SetStatusAndReturn; - } else { - - } - cdaudioDataOut->TrackData[i].Reserved = 0; - cdaudioDataOut->TrackData[i].Control = *(Toc + 0); - cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack); - cdaudioDataOut->TrackData[i].Reserved1 = 0; - cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15); - cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15); - cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 3) & 240) >> 4) * 10 + ((int )*(Toc + 3) & 15); - i += 1UL; - } - while_7_break: /* CIL Label */ ; - } - if (tracksInBuffer > tracksOnCd) { - { - memset(cdb, 0, 12); - cdb->PNR_READ_TOC.OperationCode = 193; - cdb->PNR_READ_TOC.AssignedLength[1] = 4; - cdb->PNR_READ_TOC.Type = 1; - srb.TimeOutValue = 10; - status = SendSrbSynchronous(deviceExtension, & srb, - Toc, 4); - } - if (! (status >= 0L)) { { -/* ExFreePool(Toc); */ /* INLINED */ - Irp->IoStatus.Information = 0; + cdb->PNR_START_STOP.OperationCode = 27; + cdb->PNR_START_STOP.Start = 1; + srb.CdbLength = 6; + srb.TimeOutValue = 10; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); } - goto SetStatusAndReturn; - } else { - - } - cdaudioDataOut->TrackData[i].Reserved = 0; - cdaudioDataOut->TrackData[i].Control = 16; - cdaudioDataOut->TrackData[i].TrackNumber = 170; - cdaudioDataOut->TrackData[i].Reserved1 = 0; - cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 0) & 240) >> 4) * 10 + ((int )*(Toc + 0) & 15); - cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15); - cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15); - i += 1UL; - } else { - - } - { - Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i])); -/* ExFreePool(Toc); */ /* INLINED */ - } - goto switch_6_break; - switch_6_exp_14: /* CIL Label */ - { - deviceExtension->PlayActive = 0; - tmp___1 = CdAudioSendToNextDriver(DeviceObject, Irp); - } - return (tmp___1); - goto switch_6_break; - switch_6_exp_15: /* CIL Label */ - inputBuffer = Irp->AssociatedIrp.SystemBuffer; - Irp->IoStatus.Information = 0; - if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) { - status = -1073741820L; - goto switch_6_break; - } else { - - } - retry = 5; - { - while (1) { - while_8_continue: /* CIL Label */ ; - { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->PNR_SEEK_AUDIO.OperationCode = 200; - cdb->PNR_SEEK_AUDIO.Minute = ((int )inputBuffer->StartingM / 10 << 4) + (int )inputBuffer->StartingM % 10; - cdb->PNR_SEEK_AUDIO.Second = ((int )inputBuffer->StartingS / 10 << 4) + (int )inputBuffer->StartingS % 10; - cdb->PNR_SEEK_AUDIO.Frame = ((int )inputBuffer->StartingF / 10 << 4) + (int )inputBuffer->StartingF % 10; - cdb->PNR_SEEK_AUDIO.Type = 1; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); - } - if (! (status >= 0L)) { - tmp___2 = retry; - retry -= 1UL; - if (tmp___2 > 0UL) { - + if (!(status >= 0L)) { + { + /* ExFreePool(Toc); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; } else { - goto while_8_break; } - } else { - goto while_8_break; - } - } - while_8_break: /* CIL Label */ ; - } - if (status >= 0L) { - { - memset(cdb, 0, 12); - retry = 5; - } - { - while (1) { - while_9_continue: /* CIL Label */ ; { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->PNR_PLAY_AUDIO.OperationCode = 201; - cdb->PNR_PLAY_AUDIO.StopAddr = 1; - cdb->PNR_PLAY_AUDIO.Minute = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10; - cdb->PNR_PLAY_AUDIO.Second = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10; - cdb->PNR_PLAY_AUDIO.Frame = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10; - cdb->PNR_PLAY_AUDIO.Type = 1; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); + memset(cdb, 0, 12); + srb.CdbLength = 10; + cdb->PNR_READ_TOC.OperationCode = 193; + cdb->PNR_READ_TOC.AssignedLength[1] = 4; + cdb->PNR_READ_TOC.Type = 0; + srb.TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, + &srb, Toc, 4); + } + if (!(status >= 0L)) { + { + /* ExFreePool(Toc); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; + } else { + } + cdaudioDataOut->FirstTrack = + (((int)*(Toc + 0) & 240) >> 4) * 10 + + ((int)*(Toc + 0) & 15); + cdaudioDataOut->LastTrack = + (((int)*(Toc + 1) & 240) >> 4) * 10 + + ((int)*(Toc + 1) & 15); + tracksOnCd = ((int)cdaudioDataOut->LastTrack - + (int)cdaudioDataOut->FirstTrack) + + 1; + dataLength = + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[tracksOnCd])) - + 2UL; + cdaudioDataOut->Length[0] = + (unsigned char)(dataLength >> 8); + cdaudioDataOut->Length[1] = + (unsigned char)(dataLength & 255UL); + tracksInBuffer = + currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength - + (unsigned long)(( + long)(&((CDROM_TOC *)0)->TrackData[0])); + tracksInBuffer /= (ULONG)sizeof(TRACK_DATA); + if (tracksInBuffer < tracksOnCd) { + tracksToReturn = tracksInBuffer; + } else { + tracksToReturn = tracksOnCd; } - if (! (status >= 0L)) { - tmp___3 = retry; - retry -= 1UL; - if (tmp___3 > 0UL) { + i = 0; + { + while (1) { + while_7_continue: /* CIL Label */; + if (i < tracksToReturn) { + } else { + goto while_7_break; + } + { + memset(cdb, 0, 12); + cdb->PNR_READ_TOC.OperationCode = 193; + cdb->PNR_READ_TOC.TrackNumber = + (unsigned char)(((i + + (ULONG)cdaudioDataOut + ->FirstTrack) / + 10UL + << 4) + + (i + + (ULONG)cdaudioDataOut + ->FirstTrack) % + 10UL); + cdb->PNR_READ_TOC.AssignedLength[1] = 4; + cdb->PNR_READ_TOC.Type = 2; + srb.TimeOutValue = 10; + status = SendSrbSynchronous( + deviceExtension, &srb, Toc, 4); + } + if (!(status >= 0L)) { + { + /* ExFreePool(Toc); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; + } else { + } + cdaudioDataOut->TrackData[i].Reserved = 0; + cdaudioDataOut->TrackData[i].Control = + *(Toc + 0); + cdaudioDataOut->TrackData[i].TrackNumber = + (unsigned char)(i + + (ULONG)cdaudioDataOut + ->FirstTrack); + cdaudioDataOut->TrackData[i].Reserved1 = 0; + cdaudioDataOut->TrackData[i].Address[0] = 0; + cdaudioDataOut->TrackData[i].Address[1] = + (((int)*(Toc + 1) & 240) >> 4) * 10 + + ((int)*(Toc + 1) & 15); + cdaudioDataOut->TrackData[i].Address[2] = + (((int)*(Toc + 2) & 240) >> 4) * 10 + + ((int)*(Toc + 2) & 15); + cdaudioDataOut->TrackData[i].Address[3] = + (((int)*(Toc + 3) & 240) >> 4) * 10 + + ((int)*(Toc + 3) & 15); + i += 1UL; + } + while_7_break: /* CIL Label */; + } + if (tracksInBuffer > tracksOnCd) { + { + memset(cdb, 0, 12); + cdb->PNR_READ_TOC.OperationCode = 193; + cdb->PNR_READ_TOC.AssignedLength[1] = 4; + cdb->PNR_READ_TOC.Type = 1; + srb.TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, + &srb, Toc, 4); + } + if (!(status >= 0L)) { + { + /* ExFreePool(Toc); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; } else { - goto while_9_break; } + cdaudioDataOut->TrackData[i].Reserved = 0; + cdaudioDataOut->TrackData[i].Control = 16; + cdaudioDataOut->TrackData[i].TrackNumber = + 170; + cdaudioDataOut->TrackData[i].Reserved1 = 0; + cdaudioDataOut->TrackData[i].Address[0] = 0; + cdaudioDataOut->TrackData[i].Address[1] = + (((int)*(Toc + 0) & 240) >> 4) * 10 + + ((int)*(Toc + 0) & 15); + cdaudioDataOut->TrackData[i].Address[2] = + (((int)*(Toc + 1) & 240) >> 4) * 10 + + ((int)*(Toc + 1) & 15); + cdaudioDataOut->TrackData[i].Address[3] = + (((int)*(Toc + 2) & 240) >> 4) * 10 + + ((int)*(Toc + 2) & 15); + i += 1UL; } else { - goto while_9_break; } - } - while_9_break: /* CIL Label */ ; - } - if (status >= 0L) { - deviceExtension->PlayActive = 1; - } else { - - } - } else { - - } - goto switch_6_break; - switch_6_exp_16: /* CIL Label */ - inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer; - Irp->IoStatus.Information = 0; - if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) { - status = -1073741820L; - goto switch_6_break; - } else { - - } - retry = 5; - { - while (1) { - while_10_continue: /* CIL Label */ ; + { + Irp->IoStatus.Information = (unsigned long)(( + long)(&((CDROM_TOC *)0)->TrackData[i])); + /* ExFreePool(Toc); */ /* INLINED */ + } + goto switch_6_break; + switch_6_exp_14 : /* CIL Label */ { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->PNR_SEEK_AUDIO.OperationCode = 200; - cdb->PNR_SEEK_AUDIO.Minute = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10; - cdb->PNR_SEEK_AUDIO.Second = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10; - cdb->PNR_SEEK_AUDIO.Frame = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10; - cdb->PNR_SEEK_AUDIO.Type = 1; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); + deviceExtension->PlayActive = 0; + tmp___1 = + CdAudioSendToNextDriver(DeviceObject, Irp); } - if (! (status >= 0L)) { - tmp___4 = retry; - retry -= 1UL; - if (tmp___4 > 0UL) { - + return (tmp___1); + goto switch_6_break; + switch_6_exp_15: /* CIL Label */ + inputBuffer = Irp->AssociatedIrp.SystemBuffer; + Irp->IoStatus.Information = 0; + if (currentIrpStack->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(CDROM_PLAY_AUDIO_MSF)) { + status = -1073741820L; + goto switch_6_break; } else { - goto while_10_break; } - } else { - goto while_10_break; - } - } - while_10_break: /* CIL Label */ ; - } - goto switch_6_break; - switch_6_exp_17: /* CIL Label */ - { - Irp->IoStatus.Information = 0; - deviceExtension->PlayActive = 0; - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->PNR_PAUSE_AUDIO.OperationCode = 202; - cdb->PNR_PAUSE_AUDIO.Pause = 1; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); - } - goto switch_6_break; - switch_6_exp_18: /* CIL Label */ - { - Irp->IoStatus.Information = 0; - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->PNR_PAUSE_AUDIO.OperationCode = 202; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); - } - goto switch_6_break; - switch_6_exp_19: /* CIL Label */ - { - userPtr = Irp->AssociatedIrp.SystemBuffer; - tmp___5 = ExAllocatePoolWithTag(4, 9, 541156419UL); - SubQPtr = tmp___5; - } - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - if (SubQPtr) { + retry = 5; { -/* ExFreePool(SubQPtr); */ /* INLINED */ + while (1) { + while_8_continue: /* CIL Label */; + { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->PNR_SEEK_AUDIO.OperationCode = 200; + cdb->PNR_SEEK_AUDIO.Minute = + ((int)inputBuffer->StartingM / 10 + << 4) + + (int)inputBuffer->StartingM % 10; + cdb->PNR_SEEK_AUDIO.Second = + ((int)inputBuffer->StartingS / 10 + << 4) + + (int)inputBuffer->StartingS % 10; + cdb->PNR_SEEK_AUDIO.Frame = + ((int)inputBuffer->StartingF / 10 + << 4) + + (int)inputBuffer->StartingF % 10; + cdb->PNR_SEEK_AUDIO.Type = 1; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + if (!(status >= 0L)) { + tmp___2 = retry; + retry -= 1UL; + if (tmp___2 > 0UL) { + + } else { + goto while_8_break; + } + } else { + goto while_8_break; + } + } + while_8_break: /* CIL Label */; } - } else { + if (status >= 0L) { + { + memset(cdb, 0, 12); + retry = 5; + } + { + while (1) { + while_9_continue: /* CIL Label */; + { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->PNR_PLAY_AUDIO.OperationCode = 201; + cdb->PNR_PLAY_AUDIO.StopAddr = 1; + cdb->PNR_PLAY_AUDIO.Minute = + ((int)inputBuffer->EndingM / 10 + << 4) + + (int)inputBuffer->EndingM % 10; + cdb->PNR_PLAY_AUDIO.Second = + ((int)inputBuffer->EndingS / 10 + << 4) + + (int)inputBuffer->EndingS % 10; + cdb->PNR_PLAY_AUDIO.Frame = + ((int)inputBuffer->EndingF / 10 + << 4) + + (int)inputBuffer->EndingF % 10; + cdb->PNR_PLAY_AUDIO.Type = 1; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, + 0); + } + if (!(status >= 0L)) { + tmp___3 = retry; + retry -= 1UL; + if (tmp___3 > 0UL) { - } - goto switch_6_break; - } else { + } else { + goto while_9_break; + } + } else { + goto while_9_break; + } + } + while_9_break: /* CIL Label */; + } + if (status >= 0L) { + deviceExtension->PlayActive = 1; + } else { + } + } else { + } + goto switch_6_break; + switch_6_exp_16: /* CIL Label */ + inputBuffer___0 = + Irp->AssociatedIrp.SystemBuffer; + Irp->IoStatus.Information = 0; + if (currentIrpStack->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(CDROM_SEEK_AUDIO_MSF)) { + status = -1073741820L; + goto switch_6_break; + } else { + } + retry = 5; + { + while (1) { + while_10_continue: /* CIL Label */; + { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->PNR_SEEK_AUDIO.OperationCode = 200; + cdb->PNR_SEEK_AUDIO.Minute = + ((int)inputBuffer___0->M / 10 << 4) + + (int)inputBuffer___0->M % 10; + cdb->PNR_SEEK_AUDIO.Second = + ((int)inputBuffer___0->S / 10 << 4) + + (int)inputBuffer___0->S % 10; + cdb->PNR_SEEK_AUDIO.Frame = + ((int)inputBuffer___0->F / 10 << 4) + + (int)inputBuffer___0->F % 10; + cdb->PNR_SEEK_AUDIO.Type = 1; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + if (!(status >= 0L)) { + tmp___4 = retry; + retry -= 1UL; + if (tmp___4 > 0UL) { - } - if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) { + } else { + goto while_10_break; + } + } else { + goto while_10_break; + } + } + while_10_break: /* CIL Label */; + } + goto switch_6_break; + switch_6_exp_17 : /* CIL Label */ { - memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION )); - status = -1073741670L; - Irp->IoStatus.Information = 0; + Irp->IoStatus.Information = 0; + deviceExtension->PlayActive = 0; + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->PNR_PAUSE_AUDIO.OperationCode = 202; + cdb->PNR_PAUSE_AUDIO.Pause = 1; + status = SendSrbSynchronous(deviceExtension, + &srb, (void *)0, 0); } - goto SetStatusAndReturn; - } else { - - } - if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) { + goto switch_6_break; + switch_6_exp_18 : /* CIL Label */ { -/* ExFreePool(SubQPtr); */ /* INLINED */ - memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION )); - Irp->IoStatus.Information = 0; - status = -1073741808L; + Irp->IoStatus.Information = 0; + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->PNR_PAUSE_AUDIO.OperationCode = 202; + status = SendSrbSynchronous(deviceExtension, + &srb, (void *)0, 0); } - goto SetStatusAndReturn; - } else { - - } - retry = 5; - { - while (1) { - while_11_continue: /* CIL Label */ ; + goto switch_6_break; + switch_6_exp_19 : /* CIL Label */ { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->PNR_AUDIO_STATUS.OperationCode = 204; - cdb->PNR_AUDIO_STATUS.AssignedLength = 6; - status = SendSrbSynchronous(deviceExtension, & srb, - SubQPtr, 6); - } - if (! (status >= 0L)) { - tmp___6 = retry; - retry -= 1UL; - if (tmp___6 > 0UL) { - if (status != -1073741661L) { - + userPtr = Irp->AssociatedIrp.SystemBuffer; + tmp___5 = + ExAllocatePoolWithTag(4, 9, 541156419UL); + SubQPtr = tmp___5; + } + if (currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof(SUB_Q_CURRENT_POSITION)) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + if (SubQPtr) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + } } else { - goto while_11_break; } + goto switch_6_break; } else { - goto while_11_break; } - } else { - goto while_11_break; - } - } - while_11_break: /* CIL Label */ ; - } - if (status >= 0L) { - userPtr->Header.Reserved = 0; - if ((int )*(SubQPtr + 0) == 0) { - userPtr->Header.AudioStatus = 17; - } else { - if ((int )*(SubQPtr + 0) == 1) { - deviceExtension->PlayActive = 0; - userPtr->Header.AudioStatus = 18; + if ((unsigned int)SubQPtr == + (unsigned int)((void *)0)) { + { + memset(userPtr, 0, + sizeof(SUB_Q_CURRENT_POSITION)); + status = -1073741670L; + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; } else { - if ((int )*(SubQPtr + 0) == 2) { - deviceExtension->PlayActive = 0; - userPtr->Header.AudioStatus = 18; + } + if ((int)((struct _CDROM_SUB_Q_DATA_FORMAT *) + userPtr) + ->Format != 1) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + memset(userPtr, 0, + sizeof(SUB_Q_CURRENT_POSITION)); + Irp->IoStatus.Information = 0; + status = -1073741808L; + } + goto SetStatusAndReturn; + } else { + } + retry = 5; + { + while (1) { + while_11_continue: /* CIL Label */; + { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->PNR_AUDIO_STATUS.OperationCode = 204; + cdb->PNR_AUDIO_STATUS.AssignedLength = 6; + status = SendSrbSynchronous( + deviceExtension, &srb, SubQPtr, 6); + } + if (!(status >= 0L)) { + tmp___6 = retry; + retry -= 1UL; + if (tmp___6 > 0UL) { + if (status != -1073741661L) { + + } else { + goto while_11_break; + } + } else { + goto while_11_break; + } + } else { + goto while_11_break; + } + } + while_11_break: /* CIL Label */; + } + if (status >= 0L) { + userPtr->Header.Reserved = 0; + if ((int)*(SubQPtr + 0) == 0) { + userPtr->Header.AudioStatus = 17; } else { - if ((int )*(SubQPtr + 0) == 3) { - userPtr->Header.AudioStatus = 19; + if ((int)*(SubQPtr + 0) == 1) { deviceExtension->PlayActive = 0; + userPtr->Header.AudioStatus = 18; } else { - deviceExtension->PlayActive = 0; + if ((int)*(SubQPtr + 0) == 2) { + deviceExtension->PlayActive = 0; + userPtr->Header.AudioStatus = 18; + } else { + if ((int)*(SubQPtr + 0) == 3) { + userPtr->Header.AudioStatus = 19; + deviceExtension->PlayActive = 0; + } else { + deviceExtension->PlayActive = 0; + } + } } } + } else { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; } - } - } else { + { + memset(cdb, 0, 12); + retry = 5; + } + { + while (1) { + while_12_continue: /* CIL Label */; + { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->PNR_READ_Q_CHANNEL.OperationCode = + 194; + cdb->PNR_READ_Q_CHANNEL.AssignedLength = + 9; + status = SendSrbSynchronous( + deviceExtension, &srb, SubQPtr, 9); + } + if (!(status >= 0L)) { + tmp___7 = retry; + retry -= 1UL; + if (tmp___7 > 0UL) { + + } else { + goto while_12_break; + } + } else { + goto while_12_break; + } + } + while_12_break: /* CIL Label */; + } + if (status >= 0L) { + userPtr->Header.DataLength[0] = 0; + userPtr->Header.DataLength[0] = 12; + userPtr->FormatCode = 1; + userPtr->Control = (int)*(SubQPtr + 0) & 15; + userPtr->ADR = 0; + userPtr->TrackNumber = + (((int)*(SubQPtr + 1) & 240) >> 4) * 10 + + ((int)*(SubQPtr + 1) & 15); + userPtr->IndexNumber = + (((int)*(SubQPtr + 2) & 240) >> 4) * 10 + + ((int)*(SubQPtr + 2) & 15); + userPtr->AbsoluteAddress[0] = 0; + userPtr->AbsoluteAddress[1] = + (((int)*(SubQPtr + 6) & 240) >> 4) * 10 + + ((int)*(SubQPtr + 6) & 15); + userPtr->AbsoluteAddress[2] = + (((int)*(SubQPtr + 7) & 240) >> 4) * 10 + + ((int)*(SubQPtr + 7) & 15); + userPtr->AbsoluteAddress[3] = + (((int)*(SubQPtr + 8) & 240) >> 4) * 10 + + ((int)*(SubQPtr + 8) & 15); + userPtr->TrackRelativeAddress[0] = 0; + userPtr->TrackRelativeAddress[1] = + (((int)*(SubQPtr + 3) & 240) >> 4) * 10 + + ((int)*(SubQPtr + 3) & 15); + userPtr->TrackRelativeAddress[2] = + (((int)*(SubQPtr + 4) & 240) >> 4) * 10 + + ((int)*(SubQPtr + 4) & 15); + userPtr->TrackRelativeAddress[3] = + (((int)*(SubQPtr + 5) & 240) >> 4) * 10 + + ((int)*(SubQPtr + 5) & 15); + Irp->IoStatus.Information = + sizeof(SUB_Q_CURRENT_POSITION); + } else { + Irp->IoStatus.Information = 0; + } + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + } + goto switch_6_break; + switch_6_exp_20: /* CIL Label */ + Irp->IoStatus.Information = 0; + deviceExtension->PlayActive = 0; + if ((int)deviceExtension->Active == 9) { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->PNR_EJECT.OperationCode = 192; + cdb->PNR_EJECT.Immediate = 1; + } else { + srb.CdbLength = 6; + scsiCdb->START_STOP.OperationCode = 27; + scsiCdb->START_STOP.LoadEject = 1; + scsiCdb->START_STOP.Start = 0; + } + { + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + goto switch_6_break; + switch_6_exp_21: /* CIL Label */; + switch_6_exp_22: /* CIL Label */; + switch_6_exp_23: /* CIL Label */ + Irp->IoStatus.Information = 0; + status = -1073741808L; + goto switch_6_break; + switch_6_exp_24 : /* CIL Label */ { -/* ExFreePool(SubQPtr); */ /* INLINED */ - Irp->IoStatus.Information = 0; + CdAudioIsPlayActive(DeviceObject); } - goto SetStatusAndReturn; - } - { - memset(cdb, 0, 12); - retry = 5; - } - { - while (1) { - while_12_continue: /* CIL Label */ ; + switch_6_default : /* CIL Label */ { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->PNR_READ_Q_CHANNEL.OperationCode = 194; - cdb->PNR_READ_Q_CHANNEL.AssignedLength = 9; - status = SendSrbSynchronous(deviceExtension, & srb, - SubQPtr, 9); + tmp___8 = + CdAudioSendToNextDriver(DeviceObject, Irp); } - if (! (status >= 0L)) { - tmp___7 = retry; - retry -= 1UL; - if (tmp___7 > 0UL) { - - } else { - goto while_12_break; - } + return (tmp___8); + goto switch_6_break; } else { - goto while_12_break; + switch_6_break: /* CIL Label */; } } - while_12_break: /* CIL Label */ ; - } - if (status >= 0L) { - userPtr->Header.DataLength[0] = 0; - userPtr->Header.DataLength[0] = 12; - userPtr->FormatCode = 1; - userPtr->Control = (int )*(SubQPtr + 0) & 15; - userPtr->ADR = 0; - userPtr->TrackNumber = (((int )*(SubQPtr + 1) & 240) >> 4) * 10 + ((int )*(SubQPtr + 1) & 15); - userPtr->IndexNumber = (((int )*(SubQPtr + 2) & 240) >> 4) * 10 + ((int )*(SubQPtr + 2) & 15); - userPtr->AbsoluteAddress[0] = 0; - userPtr->AbsoluteAddress[1] = (((int )*(SubQPtr + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr + 6) & 15); - userPtr->AbsoluteAddress[2] = (((int )*(SubQPtr + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr + 7) & 15); - userPtr->AbsoluteAddress[3] = (((int )*(SubQPtr + 8) & 240) >> 4) * 10 + ((int )*(SubQPtr + 8) & 15); - userPtr->TrackRelativeAddress[0] = 0; - userPtr->TrackRelativeAddress[1] = (((int )*(SubQPtr + 3) & 240) >> 4) * 10 + ((int )*(SubQPtr + 3) & 15); - userPtr->TrackRelativeAddress[2] = (((int )*(SubQPtr + 4) & 240) >> 4) * 10 + ((int )*(SubQPtr + 4) & 15); - userPtr->TrackRelativeAddress[3] = (((int )*(SubQPtr + 5) & 240) >> 4) * 10 + ((int )*(SubQPtr + 5) & 15); - Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION ); - } else { - Irp->IoStatus.Information = 0; - } - { -/* ExFreePool(SubQPtr); */ /* INLINED */ - } - goto switch_6_break; - switch_6_exp_20: /* CIL Label */ - Irp->IoStatus.Information = 0; - deviceExtension->PlayActive = 0; - if ((int )deviceExtension->Active == 9) { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->PNR_EJECT.OperationCode = 192; - cdb->PNR_EJECT.Immediate = 1; - } else { - srb.CdbLength = 6; - scsiCdb->START_STOP.OperationCode = 27; - scsiCdb->START_STOP.LoadEject = 1; - scsiCdb->START_STOP.Start = 0; - } - { - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); - } - goto switch_6_break; - switch_6_exp_21: /* CIL Label */ ; - switch_6_exp_22: /* CIL Label */ ; - switch_6_exp_23: /* CIL Label */ - Irp->IoStatus.Information = 0; - status = -1073741808L; - goto switch_6_break; - switch_6_exp_24: /* CIL Label */ - { - CdAudioIsPlayActive(DeviceObject); - } - switch_6_default: /* CIL Label */ - { - tmp___8 = CdAudioSendToNextDriver(DeviceObject, Irp); - } - return (tmp___8); - goto switch_6_break; - } else { - switch_6_break: /* CIL Label */ ; - } } } } @@ -5065,541 +5239,684 @@ NTSTATUS CdAudioPioneerDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } - } - SetStatusAndReturn: - if (status == -2147483626L) { - if ((int )currentIrpStack->Flags & 2) { - status = -1073741435L; - goto PioneerRestart; + SetStatusAndReturn: + if (status == -2147483626L) { + if ((int)currentIrpStack->Flags & 2) { + status = -1073741435L; + goto PioneerRestart; + } else { + } + { + /* IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } } else { - } { -/* IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */ - Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); } - } else { - - } - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + return (status); } - return (status); -} } -NTSTATUS CdAudioDenonDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION currentIrpStack ; - PCD_DEVICE_EXTENSION deviceExtension ; - PCDROM_TOC cdaudioDataOut ; - SCSI_PASS_THROUGH srb ; - PCDB cdb ; - NTSTATUS status ; - ULONG i ; - ULONG bytesTransfered ; - PUCHAR Toc ; - BOOLEAN tmp ; - PVOID tmp___0 ; - ULONG tracksToReturn ; - ULONG tracksOnCd ; - ULONG tracksInBuffer ; - ULONG dataLength ; - PCDROM_PLAY_AUDIO_MSF inputBuffer ; - PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ; - PUCHAR SubQPtr ; - PVOID tmp___1 ; - PSUB_Q_CURRENT_POSITION userPtr ; - PUCHAR SubQPtr___0 ; - PVOID tmp___2 ; - NTSTATUS tmp___3 ; +NTSTATUS CdAudioDenonDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION currentIrpStack; + PCD_DEVICE_EXTENSION deviceExtension; + PCDROM_TOC cdaudioDataOut; + SCSI_PASS_THROUGH srb; + PCDB cdb; + NTSTATUS status; + ULONG i; + ULONG bytesTransfered; + PUCHAR Toc; + BOOLEAN tmp; + PVOID tmp___0; + ULONG tracksToReturn; + ULONG tracksOnCd; + ULONG tracksInBuffer; + ULONG dataLength; + PCDROM_PLAY_AUDIO_MSF inputBuffer; + PCDROM_SEEK_AUDIO_MSF inputBuffer___0; + PUCHAR SubQPtr; + PVOID tmp___1; + PSUB_Q_CURRENT_POSITION userPtr; + PUCHAR SubQPtr___0; + PVOID tmp___2; + NTSTATUS tmp___3; { - currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - deviceExtension = DeviceObject->DeviceExtension; - cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer; - cdb = (union _CDB *)(srb.Cdb); - DenonRestart: - { - memset(cdb, 0, 12); - } - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (14 << 2))) { - goto switch_13_exp_25; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) { - goto switch_13_exp_26; + currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + deviceExtension = DeviceObject->DeviceExtension; + cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer; + cdb = (union _CDB *)(srb.Cdb); + DenonRestart : { memset(cdb, 0, 12); } + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (14 << 2))) { + goto switch_13_exp_25; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) { - goto switch_13_exp_27; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + ((2 << 16) | (1 << 14))) { + goto switch_13_exp_26; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) { - goto switch_13_exp_28; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (6 << 2))) { + goto switch_13_exp_27; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) { - goto switch_13_exp_29; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (2 << 2))) { + goto switch_13_exp_28; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) { - goto switch_13_exp_30; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (1 << 2))) { + goto switch_13_exp_29; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) { - goto switch_13_exp_31; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (3 << 2))) { + goto switch_13_exp_30; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) { - goto switch_13_exp_32; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (4 << 2))) { + goto switch_13_exp_31; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) { - goto switch_13_exp_33; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (11 << 2))) { + goto switch_13_exp_32; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) { - goto switch_13_exp_34; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (514 << 2))) { + goto switch_13_exp_33; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) { - goto switch_13_exp_35; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (13 << 2))) { + goto switch_13_exp_34; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) { - goto switch_13_exp_36; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (5 << 2))) { + goto switch_13_exp_35; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_13_exp_37; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (10 << 2))) { + goto switch_13_exp_36; } else { - { - goto switch_13_default; - if (0) { - switch_13_exp_25: /* CIL Label */ - status = -1073741808L; - Irp->IoStatus.Information = 0; - goto switch_13_break; - switch_13_exp_26: /* CIL Label */ ; - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - goto switch_13_break; - } else { - - } - { - tmp = CdAudioIsPlayActive(DeviceObject); - } - if (tmp) { - status = -2147483631L; - Irp->IoStatus.Information = 0; - goto switch_13_break; - } else { - - } - { - tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ), - 541156419UL); - Toc = (UCHAR *)tmp___0; - } - if ((unsigned int )Toc == (unsigned int )((void *)0)) { - status = -1073741670L; - Irp->IoStatus.Information = 0; - goto SetStatusAndReturn; - } else { - - } + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_13_exp_37; + } else { { - memset(Toc, 0, sizeof(CDROM_TOC )); - cdb->CDB6GENERIC.OperationCode = 233; - srb.TimeOutValue = 10; - srb.CdbLength = 6; - status = SendSrbSynchronous(deviceExtension, & srb, - Toc, sizeof(CDROM_TOC )); - } - if (! (status >= 0L)) { - if (status != -1073741764L) { - if (status != -1073741764L) { - { -/* ExFreePool(Toc); */ /* INLINED */ + goto switch_13_default; + if (0) { + switch_13_exp_25: /* CIL Label */ + status = -1073741808L; + Irp->IoStatus.Information = 0; + goto switch_13_break; + switch_13_exp_26: /* CIL Label */; + if (currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength < + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[0]))) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + goto switch_13_break; + } else { + } + { tmp = CdAudioIsPlayActive(DeviceObject); } + if (tmp) { + status = -2147483631L; + Irp->IoStatus.Information = 0; + goto switch_13_break; + } else { + } + { + tmp___0 = ExAllocatePoolWithTag( + 4, sizeof(CDROM_TOC), 541156419UL); + Toc = (UCHAR *)tmp___0; + } + if ((unsigned int)Toc == + (unsigned int)((void *)0)) { + status = -1073741670L; Irp->IoStatus.Information = 0; - } goto SetStatusAndReturn; } else { - } - } else { + { + memset(Toc, 0, sizeof(CDROM_TOC)); + cdb->CDB6GENERIC.OperationCode = 233; + srb.TimeOutValue = 10; + srb.CdbLength = 6; + status = SendSrbSynchronous( + deviceExtension, &srb, Toc, + sizeof(CDROM_TOC)); + } + if (!(status >= 0L)) { + if (status != -1073741764L) { + if (status != -1073741764L) { + { + /* ExFreePool(Toc); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; + } else { + } + } else { + } + } else { + } + status = 0L; + if (currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength > + srb.DataTransferLength) { + bytesTransfered = srb.DataTransferLength; + } else { + bytesTransfered = + currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength; + } + cdaudioDataOut->FirstTrack = + (((int)*(Toc + 1) & 240) >> 4) * 10 + + ((int)*(Toc + 1) & 15); + cdaudioDataOut->LastTrack = + (((int)*(Toc + 5) & 240) >> 4) * 10 + + ((int)*(Toc + 5) & 15); + tracksOnCd = + ((int)cdaudioDataOut->LastTrack - + (int)cdaudioDataOut->FirstTrack) + + 1; + dataLength = + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[tracksOnCd])) - + 2UL; + cdaudioDataOut->Length[0] = + (unsigned char)(dataLength >> 8); + cdaudioDataOut->Length[1] = + (unsigned char)(dataLength & 255UL); + tracksInBuffer = + currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength - + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[0])); + tracksInBuffer /= (ULONG)sizeof(TRACK_DATA); + if (tracksInBuffer < tracksOnCd) { + tracksToReturn = tracksInBuffer; + } else { + tracksToReturn = tracksOnCd; + } + i = 0; + { + while (1) { + while_14_continue: /* CIL Label */; + if (i < tracksToReturn) { + } else { + goto while_14_break; + } + cdaudioDataOut->TrackData[i].Reserved = 0; + cdaudioDataOut->TrackData[i].Control = + *(Toc + (i * 4UL + 12UL)); + cdaudioDataOut->TrackData[i].TrackNumber = + (unsigned char)(i + + (ULONG)cdaudioDataOut + ->FirstTrack); + cdaudioDataOut->TrackData[i].Reserved1 = + 0; + cdaudioDataOut->TrackData[i].Address[0] = + 0; + cdaudioDataOut->TrackData[i].Address[1] = + (((int)*(Toc + (i * 4UL + 13UL)) & + 240) >> + 4) * + 10 + + ((int)*(Toc + (i * 4UL + 13UL)) & 15); + cdaudioDataOut->TrackData[i].Address[2] = + (((int)*(Toc + (i * 4UL + 14UL)) & + 240) >> + 4) * + 10 + + ((int)*(Toc + (i * 4UL + 14UL)) & 15); + cdaudioDataOut->TrackData[i].Address[3] = + (((int)*(Toc + (i * 4UL + 15UL)) & + 240) >> + 4) * + 10 + + ((int)*(Toc + (i * 4UL + 15UL)) & 15); + i += 1UL; + } + while_14_break: /* CIL Label */; + } + if (tracksInBuffer > tracksOnCd) { + cdaudioDataOut->TrackData[i].Reserved = 0; + cdaudioDataOut->TrackData[i].Control = 0; + cdaudioDataOut->TrackData[i].TrackNumber = + 170; + cdaudioDataOut->TrackData[i].Reserved1 = 0; + cdaudioDataOut->TrackData[i].Address[0] = 0; + cdaudioDataOut->TrackData[i].Address[1] = + (((int)*(Toc + 9) & 240) >> 4) * 10 + + ((int)*(Toc + 9) & 15); + cdaudioDataOut->TrackData[i].Address[2] = + (((int)*(Toc + 10) & 240) >> 4) * 10 + + ((int)*(Toc + 10) & 15); + cdaudioDataOut->TrackData[i].Address[3] = + (((int)*(Toc + 11) & 240) >> 4) * 10 + + ((int)*(Toc + 11) & 15); + i += 1UL; + } else { + } + { + Irp->IoStatus + .Information = (unsigned long)(( + long)(&((CDROM_TOC *)0)->TrackData[i])); + deviceExtension->Paused = 0; + deviceExtension->PausedM = 0; + deviceExtension->PausedS = 0; + deviceExtension->PausedF = 0; + deviceExtension->LastEndM = 0; + deviceExtension->LastEndS = 0; + deviceExtension->LastEndF = 0; + /* ExFreePool(Toc); */ /* INLINED */ + } + goto switch_13_break; + switch_13_exp_27: /* CIL Label */; + switch_13_exp_28 : /* CIL Label */ + { + inputBuffer = Irp->AssociatedIrp.SystemBuffer; + Irp->IoStatus.Information = 0; + deviceExtension->PlayActive = 0; + srb.CdbLength = 6; + srb.TimeOutValue = 10; + cdb->CDB6GENERIC.OperationCode = 231; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); } - } else { - - } - status = 0L; - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > srb.DataTransferLength) { - bytesTransfered = srb.DataTransferLength; - } else { - bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength; - } - cdaudioDataOut->FirstTrack = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15); - cdaudioDataOut->LastTrack = (((int )*(Toc + 5) & 240) >> 4) * 10 + ((int )*(Toc + 5) & 15); - tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1; - dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL; - cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8); - cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL); - tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0])); - tracksInBuffer /= (ULONG )sizeof(TRACK_DATA ); - if (tracksInBuffer < tracksOnCd) { - tracksToReturn = tracksInBuffer; - } else { - tracksToReturn = tracksOnCd; - } - i = 0; - { - while (1) { - while_14_continue: /* CIL Label */ ; - if (i < tracksToReturn) { - - } else { - goto while_14_break; - } - cdaudioDataOut->TrackData[i].Reserved = 0; - cdaudioDataOut->TrackData[i].Control = *(Toc + (i * 4UL + 12UL)); - cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack); - cdaudioDataOut->TrackData[i].Reserved1 = 0; - cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + (i * 4UL + 13UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 4UL + 13UL)) & 15); - cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + (i * 4UL + 14UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 4UL + 14UL)) & 15); - cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + (i * 4UL + 15UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 4UL + 15UL)) & 15); - i += 1UL; - } - while_14_break: /* CIL Label */ ; - } - if (tracksInBuffer > tracksOnCd) { - cdaudioDataOut->TrackData[i].Reserved = 0; - cdaudioDataOut->TrackData[i].Control = 0; - cdaudioDataOut->TrackData[i].TrackNumber = 170; - cdaudioDataOut->TrackData[i].Reserved1 = 0; - cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 9) & 240) >> 4) * 10 + ((int )*(Toc + 9) & 15); - cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 10) & 240) >> 4) * 10 + ((int )*(Toc + 10) & 15); - cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 11) & 240) >> 4) * 10 + ((int )*(Toc + 11) & 15); - i += 1UL; - } else { - - } - { - Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i])); - deviceExtension->Paused = 0; - deviceExtension->PausedM = 0; - deviceExtension->PausedS = 0; - deviceExtension->PausedF = 0; - deviceExtension->LastEndM = 0; - deviceExtension->LastEndS = 0; - deviceExtension->LastEndF = 0; -/* ExFreePool(Toc); */ /* INLINED */ - } - goto switch_13_break; - switch_13_exp_27: /* CIL Label */ ; - switch_13_exp_28: /* CIL Label */ - { - inputBuffer = Irp->AssociatedIrp.SystemBuffer; - Irp->IoStatus.Information = 0; - deviceExtension->PlayActive = 0; - srb.CdbLength = 6; - srb.TimeOutValue = 10; - cdb->CDB6GENERIC.OperationCode = 231; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); - } - if (status >= 0L) { - deviceExtension->Paused = 0; - deviceExtension->PausedM = 0; - deviceExtension->PausedS = 0; - deviceExtension->PausedF = 0; - deviceExtension->LastEndM = 0; - deviceExtension->LastEndS = 0; - deviceExtension->LastEndF = 0; - } else { - - } - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (2 << 2))) { - goto SetStatusAndReturn; - } else { - - } - if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) { - status = -1073741820L; - goto switch_13_break; - } else { - - } - { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->CDB10.OperationCode = 34; - cdb->CDB10.LogicalBlockByte0 = ((int )inputBuffer->StartingM / 10 << 4) + (int )inputBuffer->StartingM % 10; - cdb->CDB10.LogicalBlockByte1 = ((int )inputBuffer->StartingS / 10 << 4) + (int )inputBuffer->StartingS % 10; - cdb->CDB10.LogicalBlockByte2 = ((int )inputBuffer->StartingF / 10 << 4) + (int )inputBuffer->StartingF % 10; - cdb->CDB10.LogicalBlockByte3 = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10; - cdb->CDB10.Reserved2 = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10; - cdb->CDB10.TransferBlocksMsb = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); - } - if (status >= 0L) { - deviceExtension->PlayActive = 1; - deviceExtension->Paused = 0; - deviceExtension->LastEndM = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10; - deviceExtension->LastEndS = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10; - deviceExtension->LastEndF = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10; - } else { - if (status == -1073741808L) { - status = -1073741803L; - } else { - - } - } - goto switch_13_break; - switch_13_exp_29: /* CIL Label */ - inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer; - Irp->IoStatus.Information = 0; - if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) { - status = -1073741820L; - goto switch_13_break; - } else { - - } - { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->CDB10.OperationCode = 34; - cdb->CDB10.LogicalBlockByte0 = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10; - cdb->CDB10.LogicalBlockByte1 = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10; - cdb->CDB10.LogicalBlockByte2 = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10; - cdb->CDB10.LogicalBlockByte3 = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10; - cdb->CDB10.Reserved2 = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10; - cdb->CDB10.TransferBlocksMsb = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); - } - if (status >= 0L) { - deviceExtension->Paused = 1; - deviceExtension->PausedM = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10; - deviceExtension->PausedS = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10; - deviceExtension->PausedF = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10; - deviceExtension->LastEndM = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10; - deviceExtension->LastEndS = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10; - deviceExtension->LastEndF = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10; - } else { - if (status == -1073741808L) { - status = -1073741803L; - } else { - - } - } - goto switch_13_break; - switch_13_exp_30: /* CIL Label */ - { - tmp___1 = ExAllocatePoolWithTag(4, 10, 541156419UL); - SubQPtr = tmp___1; - Irp->IoStatus.Information = 0; - deviceExtension->PlayActive = 0; - } - if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) { - status = -1073741670L; - goto SetStatusAndReturn; - } else { - - } - if ((int )deviceExtension->Paused == 1) { - { -/* ExFreePool(SubQPtr); */ /* INLINED */ - status = 0L; - } - goto SetStatusAndReturn; - } else { - - } - { - srb.CdbLength = 6; - srb.TimeOutValue = 10; - cdb->CDB6GENERIC.OperationCode = 235; - cdb->CDB6GENERIC.CommandUniqueBytes[2] = 10; - status = SendSrbSynchronous(deviceExtension, & srb, - SubQPtr, 10); - } - if (! (status >= 0L)) { + if (status >= 0L) { + deviceExtension->Paused = 0; + deviceExtension->PausedM = 0; + deviceExtension->PausedS = 0; + deviceExtension->PausedF = 0; + deviceExtension->LastEndM = 0; + deviceExtension->LastEndS = 0; + deviceExtension->LastEndF = 0; + } else { + } + if (currentIrpStack->Parameters + .DeviceIoControl.IoControlCode == + (ULONG)(((2 << 16) | (1 << 14)) | + (2 << 2))) { + goto SetStatusAndReturn; + } else { + } + if (currentIrpStack->Parameters + .DeviceIoControl.InputBufferLength < + (ULONG)sizeof(CDROM_PLAY_AUDIO_MSF)) { + status = -1073741820L; + goto switch_13_break; + } else { + } + { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->CDB10.OperationCode = 34; + cdb->CDB10.LogicalBlockByte0 = + ((int)inputBuffer->StartingM / 10 + << 4) + + (int)inputBuffer->StartingM % 10; + cdb->CDB10.LogicalBlockByte1 = + ((int)inputBuffer->StartingS / 10 + << 4) + + (int)inputBuffer->StartingS % 10; + cdb->CDB10.LogicalBlockByte2 = + ((int)inputBuffer->StartingF / 10 + << 4) + + (int)inputBuffer->StartingF % 10; + cdb->CDB10.LogicalBlockByte3 = + ((int)inputBuffer->EndingM / 10 << 4) + + (int)inputBuffer->EndingM % 10; + cdb->CDB10.Reserved2 = + ((int)inputBuffer->EndingS / 10 << 4) + + (int)inputBuffer->EndingS % 10; + cdb->CDB10.TransferBlocksMsb = + ((int)inputBuffer->EndingF / 10 << 4) + + (int)inputBuffer->EndingF % 10; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + if (status >= 0L) { + deviceExtension->PlayActive = 1; + deviceExtension->Paused = 0; + deviceExtension->LastEndM = + ((int)inputBuffer->EndingM / 10 << 4) + + (int)inputBuffer->EndingM % 10; + deviceExtension->LastEndS = + ((int)inputBuffer->EndingS / 10 << 4) + + (int)inputBuffer->EndingS % 10; + deviceExtension->LastEndF = + ((int)inputBuffer->EndingF / 10 << 4) + + (int)inputBuffer->EndingF % 10; + } else { + if (status == -1073741808L) { + status = -1073741803L; + } else { + } + } + goto switch_13_break; + switch_13_exp_29: /* CIL Label */ + inputBuffer___0 = + Irp->AssociatedIrp.SystemBuffer; + Irp->IoStatus.Information = 0; + if (currentIrpStack->Parameters + .DeviceIoControl.InputBufferLength < + (ULONG)sizeof(CDROM_SEEK_AUDIO_MSF)) { + status = -1073741820L; + goto switch_13_break; + } else { + } + { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->CDB10.OperationCode = 34; + cdb->CDB10.LogicalBlockByte0 = + ((int)inputBuffer___0->M / 10 << 4) + + (int)inputBuffer___0->M % 10; + cdb->CDB10.LogicalBlockByte1 = + ((int)inputBuffer___0->S / 10 << 4) + + (int)inputBuffer___0->S % 10; + cdb->CDB10.LogicalBlockByte2 = + ((int)inputBuffer___0->F / 10 << 4) + + (int)inputBuffer___0->F % 10; + cdb->CDB10.LogicalBlockByte3 = + ((int)inputBuffer___0->M / 10 << 4) + + (int)inputBuffer___0->M % 10; + cdb->CDB10.Reserved2 = + ((int)inputBuffer___0->S / 10 << 4) + + (int)inputBuffer___0->S % 10; + cdb->CDB10.TransferBlocksMsb = + ((int)inputBuffer___0->F / 10 << 4) + + (int)inputBuffer___0->F % 10; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + if (status >= 0L) { + deviceExtension->Paused = 1; + deviceExtension->PausedM = + ((int)inputBuffer___0->M / 10 << 4) + + (int)inputBuffer___0->M % 10; + deviceExtension->PausedS = + ((int)inputBuffer___0->S / 10 << 4) + + (int)inputBuffer___0->S % 10; + deviceExtension->PausedF = + ((int)inputBuffer___0->F / 10 << 4) + + (int)inputBuffer___0->F % 10; + deviceExtension->LastEndM = + ((int)inputBuffer___0->M / 10 << 4) + + (int)inputBuffer___0->M % 10; + deviceExtension->LastEndS = + ((int)inputBuffer___0->S / 10 << 4) + + (int)inputBuffer___0->S % 10; + deviceExtension->LastEndF = + ((int)inputBuffer___0->F / 10 << 4) + + (int)inputBuffer___0->F % 10; + } else { + if (status == -1073741808L) { + status = -1073741803L; + } else { + } + } + goto switch_13_break; + switch_13_exp_30 : /* CIL Label */ { -/* ExFreePool(SubQPtr); */ /* INLINED */ + tmp___1 = + ExAllocatePoolWithTag(4, 10, 541156419UL); + SubQPtr = tmp___1; + Irp->IoStatus.Information = 0; + deviceExtension->PlayActive = 0; } - goto SetStatusAndReturn; - } else { - - } - { - deviceExtension->PausedM = *(SubQPtr + 7); - deviceExtension->PausedS = *(SubQPtr + 8); - deviceExtension->PausedF = *(SubQPtr + 9); - memset(cdb, 0, 12); - srb.CdbLength = 6; - srb.TimeOutValue = 10; - cdb->CDB6GENERIC.OperationCode = 231; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); - } - if (! (status >= 0L)) { + if ((unsigned int)SubQPtr == + (unsigned int)((void *)0)) { + status = -1073741670L; + goto SetStatusAndReturn; + } else { + } + if ((int)deviceExtension->Paused == 1) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + status = 0L; + } + goto SetStatusAndReturn; + } else { + } + { + srb.CdbLength = 6; + srb.TimeOutValue = 10; + cdb->CDB6GENERIC.OperationCode = 235; + cdb->CDB6GENERIC.CommandUniqueBytes[2] = 10; + status = SendSrbSynchronous( + deviceExtension, &srb, SubQPtr, 10); + } + if (!(status >= 0L)) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + } + goto SetStatusAndReturn; + } else { + } + { + deviceExtension->PausedM = *(SubQPtr + 7); + deviceExtension->PausedS = *(SubQPtr + 8); + deviceExtension->PausedF = *(SubQPtr + 9); + memset(cdb, 0, 12); + srb.CdbLength = 6; + srb.TimeOutValue = 10; + cdb->CDB6GENERIC.OperationCode = 231; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + if (!(status >= 0L)) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + } + goto SetStatusAndReturn; + } else { + } + { + deviceExtension->Paused = 1; + deviceExtension->PausedM = *(SubQPtr + 7); + deviceExtension->PausedS = *(SubQPtr + 8); + deviceExtension->PausedF = *(SubQPtr + 9); + /* ExFreePool(SubQPtr); */ /* INLINED */ + } + goto switch_13_break; + switch_13_exp_31: /* CIL Label */ + Irp->IoStatus.Information = 0; + if ((int)deviceExtension->Paused == 0) { + status = -1073741823L; + goto SetStatusAndReturn; + } else { + } + { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->CDB10.OperationCode = 34; + cdb->CDB10.LogicalBlockByte0 = + deviceExtension->PausedM; + cdb->CDB10.LogicalBlockByte1 = + deviceExtension->PausedS; + cdb->CDB10.LogicalBlockByte2 = + deviceExtension->PausedF; + cdb->CDB10.LogicalBlockByte3 = + deviceExtension->LastEndM; + cdb->CDB10.Reserved2 = + deviceExtension->LastEndS; + cdb->CDB10.TransferBlocksMsb = + deviceExtension->LastEndF; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + if (status >= 0L) { + deviceExtension->Paused = 0; + } else { + } + goto switch_13_break; + switch_13_exp_32 : /* CIL Label */ { -/* ExFreePool(SubQPtr); */ /* INLINED */ + userPtr = Irp->AssociatedIrp.SystemBuffer; + tmp___2 = ExAllocatePoolWithTag( + 4, sizeof(SUB_Q_CHANNEL_DATA), + 541156419UL); + SubQPtr___0 = tmp___2; } - goto SetStatusAndReturn; - } else { - - } - { - deviceExtension->Paused = 1; - deviceExtension->PausedM = *(SubQPtr + 7); - deviceExtension->PausedS = *(SubQPtr + 8); - deviceExtension->PausedF = *(SubQPtr + 9); -/* ExFreePool(SubQPtr); */ /* INLINED */ - } - goto switch_13_break; - switch_13_exp_31: /* CIL Label */ - Irp->IoStatus.Information = 0; - if ((int )deviceExtension->Paused == 0) { - status = -1073741823L; - goto SetStatusAndReturn; - } else { - - } - { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->CDB10.OperationCode = 34; - cdb->CDB10.LogicalBlockByte0 = deviceExtension->PausedM; - cdb->CDB10.LogicalBlockByte1 = deviceExtension->PausedS; - cdb->CDB10.LogicalBlockByte2 = deviceExtension->PausedF; - cdb->CDB10.LogicalBlockByte3 = deviceExtension->LastEndM; - cdb->CDB10.Reserved2 = deviceExtension->LastEndS; - cdb->CDB10.TransferBlocksMsb = deviceExtension->LastEndF; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); - } - if (status >= 0L) { - deviceExtension->Paused = 0; - } else { - - } - goto switch_13_break; - switch_13_exp_32: /* CIL Label */ - { - userPtr = Irp->AssociatedIrp.SystemBuffer; - tmp___2 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ), - 541156419UL); - SubQPtr___0 = tmp___2; - } - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - if (SubQPtr___0) { + if (currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength < + (ULONG)sizeof(SUB_Q_CURRENT_POSITION)) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + if (SubQPtr___0) { + { + /* ExFreePool(SubQPtr___0); */ /* INLINED */ + } + } else { + } + goto switch_13_break; + } else { + } + if ((unsigned int)SubQPtr___0 == + (unsigned int)((void *)0)) { + { + memset(userPtr, 0, + sizeof(SUB_Q_CURRENT_POSITION)); + status = -1073741670L; + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; + } else { + } + if ((int)((struct _CDROM_SUB_Q_DATA_FORMAT *) + userPtr) + ->Format != 1) { + { + /* ExFreePool(SubQPtr___0); */ /* INLINED */ + memset(userPtr, 0, + sizeof(SUB_Q_CURRENT_POSITION)); + status = -1073741823L; + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; + } else { + } { -/* ExFreePool(SubQPtr___0); */ /* INLINED */ + srb.CdbLength = 6; + srb.TimeOutValue = 10; + cdb->CDB6GENERIC.OperationCode = 235; + cdb->CDB6GENERIC.CommandUniqueBytes[2] = 10; + status = SendSrbSynchronous( + deviceExtension, &srb, SubQPtr___0, 10); } - } else { - + if (status >= 0L) { + userPtr->Header.Reserved = 0; + if ((int)deviceExtension->Paused == 1) { + deviceExtension->PlayActive = 0; + userPtr->Header.AudioStatus = 18; + } else { + if ((int)*(SubQPtr___0 + 0) == 1) { + userPtr->Header.AudioStatus = 17; + } else { + if ((int)*(SubQPtr___0 + 0) == 0) { + userPtr->Header.AudioStatus = 19; + deviceExtension->PlayActive = 0; + } else { + deviceExtension->PlayActive = 0; + } + } + } + userPtr->Header.DataLength[0] = 0; + userPtr->Header.DataLength[0] = 12; + userPtr->FormatCode = 1; + userPtr->Control = *(SubQPtr___0 + 1); + userPtr->ADR = 0; + userPtr->TrackNumber = + (((int)*(SubQPtr___0 + 2) & 240) >> 4) * + 10 + + ((int)*(SubQPtr___0 + 2) & 15); + userPtr->IndexNumber = + (((int)*(SubQPtr___0 + 3) & 240) >> 4) * + 10 + + ((int)*(SubQPtr___0 + 3) & 15); + userPtr->AbsoluteAddress[0] = 0; + userPtr->AbsoluteAddress[1] = + (((int)*(SubQPtr___0 + 7) & 240) >> 4) * + 10 + + ((int)*(SubQPtr___0 + 7) & 15); + userPtr->AbsoluteAddress[2] = + (((int)*(SubQPtr___0 + 8) & 240) >> 4) * + 10 + + ((int)*(SubQPtr___0 + 8) & 15); + userPtr->AbsoluteAddress[3] = + (((int)*(SubQPtr___0 + 9) & 240) >> 4) * + 10 + + ((int)*(SubQPtr___0 + 9) & 15); + userPtr->TrackRelativeAddress[0] = 0; + userPtr->TrackRelativeAddress[1] = + (((int)*(SubQPtr___0 + 4) & 240) >> 4) * + 10 + + ((int)*(SubQPtr___0 + 4) & 15); + userPtr->TrackRelativeAddress[2] = + (((int)*(SubQPtr___0 + 5) & 240) >> 4) * + 10 + + ((int)*(SubQPtr___0 + 5) & 15); + userPtr->TrackRelativeAddress[3] = + (((int)*(SubQPtr___0 + 6) & 240) >> 4) * + 10 + + ((int)*(SubQPtr___0 + 6) & 15); + Irp->IoStatus.Information = + sizeof(SUB_Q_CURRENT_POSITION); + } else { + Irp->IoStatus.Information = 0; + } + { + /* ExFreePool(SubQPtr___0); */ /* INLINED */ + } + goto switch_13_break; + switch_13_exp_33 : /* CIL Label */ + { + Irp->IoStatus.Information = 0; + deviceExtension->PlayActive = 0; + srb.CdbLength = 6; + srb.TimeOutValue = 10; + cdb->CDB6GENERIC.OperationCode = 230; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); } - goto switch_13_break; - } else { - - } - if ((unsigned int )SubQPtr___0 == (unsigned int )((void *)0)) { + goto switch_13_break; + switch_13_exp_34: /* CIL Label */; + switch_13_exp_35: /* CIL Label */; + switch_13_exp_36: /* CIL Label */ + Irp->IoStatus.Information = 0; + status = -1073741808L; + goto switch_13_break; + switch_13_exp_37 : /* CIL Label */ { - memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION )); - status = -1073741670L; - Irp->IoStatus.Information = 0; + CdAudioIsPlayActive(DeviceObject); } - goto SetStatusAndReturn; - } else { - - } - if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) { + switch_13_default : /* CIL Label */ { -/* ExFreePool(SubQPtr___0); */ /* INLINED */ - memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION )); - status = -1073741823L; - Irp->IoStatus.Information = 0; + tmp___3 = CdAudioSendToNextDriver( + DeviceObject, Irp); } - goto SetStatusAndReturn; - } else { - - } - { - srb.CdbLength = 6; - srb.TimeOutValue = 10; - cdb->CDB6GENERIC.OperationCode = 235; - cdb->CDB6GENERIC.CommandUniqueBytes[2] = 10; - status = SendSrbSynchronous(deviceExtension, & srb, - SubQPtr___0, 10); - } - if (status >= 0L) { - userPtr->Header.Reserved = 0; - if ((int )deviceExtension->Paused == 1) { - deviceExtension->PlayActive = 0; - userPtr->Header.AudioStatus = 18; + return (tmp___3); + goto switch_13_break; } else { - if ((int )*(SubQPtr___0 + 0) == 1) { - userPtr->Header.AudioStatus = 17; - } else { - if ((int )*(SubQPtr___0 + 0) == 0) { - userPtr->Header.AudioStatus = 19; - deviceExtension->PlayActive = 0; - } else { - deviceExtension->PlayActive = 0; - } - } + switch_13_break: /* CIL Label */; } - userPtr->Header.DataLength[0] = 0; - userPtr->Header.DataLength[0] = 12; - userPtr->FormatCode = 1; - userPtr->Control = *(SubQPtr___0 + 1); - userPtr->ADR = 0; - userPtr->TrackNumber = (((int )*(SubQPtr___0 + 2) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 2) & 15); - userPtr->IndexNumber = (((int )*(SubQPtr___0 + 3) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 3) & 15); - userPtr->AbsoluteAddress[0] = 0; - userPtr->AbsoluteAddress[1] = (((int )*(SubQPtr___0 + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 7) & 15); - userPtr->AbsoluteAddress[2] = (((int )*(SubQPtr___0 + 8) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 8) & 15); - userPtr->AbsoluteAddress[3] = (((int )*(SubQPtr___0 + 9) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 9) & 15); - userPtr->TrackRelativeAddress[0] = 0; - userPtr->TrackRelativeAddress[1] = (((int )*(SubQPtr___0 + 4) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 4) & 15); - userPtr->TrackRelativeAddress[2] = (((int )*(SubQPtr___0 + 5) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 5) & 15); - userPtr->TrackRelativeAddress[3] = (((int )*(SubQPtr___0 + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 6) & 15); - Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION ); - } else { - Irp->IoStatus.Information = 0; - } - { -/* ExFreePool(SubQPtr___0); */ /* INLINED */ - } - goto switch_13_break; - switch_13_exp_33: /* CIL Label */ - { - Irp->IoStatus.Information = 0; - deviceExtension->PlayActive = 0; - srb.CdbLength = 6; - srb.TimeOutValue = 10; - cdb->CDB6GENERIC.OperationCode = 230; - status = SendSrbSynchronous(deviceExtension, & srb, - (void *)0, 0); - } - goto switch_13_break; - switch_13_exp_34: /* CIL Label */ ; - switch_13_exp_35: /* CIL Label */ ; - switch_13_exp_36: /* CIL Label */ - Irp->IoStatus.Information = 0; - status = -1073741808L; - goto switch_13_break; - switch_13_exp_37: /* CIL Label */ - { - CdAudioIsPlayActive(DeviceObject); - } - switch_13_default: /* CIL Label */ - { - tmp___3 = CdAudioSendToNextDriver(DeviceObject, Irp); } - return (tmp___3); - goto switch_13_break; - } else { - switch_13_break: /* CIL Label */ ; - } } } } @@ -5613,1091 +5930,738 @@ NTSTATUS CdAudioDenonDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } - } - SetStatusAndReturn: - if (status == -2147483626L) { - if ((int )currentIrpStack->Flags & 2) { - status = -1073741435L; - goto DenonRestart; + SetStatusAndReturn: + if (status == -2147483626L) { + if ((int)currentIrpStack->Flags & 2) { + status = -1073741435L; + goto DenonRestart; + } else { + } + { + /* IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } } else { - } { -/* IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */ - Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); } - } else { - - } - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + return (status); } - return (status); } -} -NTSTATUS CdAudioHitachiSendPauseCommand(PDEVICE_OBJECT DeviceObject ) -{ PCD_DEVICE_EXTENSION deviceExtension ; - SCSI_PASS_THROUGH srb ; - PHITACHICDB cdb ; - NTSTATUS status ; - PUCHAR PausePos ; - PVOID tmp ; - - { - { - deviceExtension = DeviceObject->DeviceExtension; - cdb = (union _HITACHICDB *)(srb.Cdb); - tmp = ExAllocatePoolWithTag(4, 3, 541156419UL); - PausePos = (UCHAR *)tmp; - } - if ((unsigned int )PausePos == (unsigned int )((void *)0)) { - return (-1073741670L); - } else { +NTSTATUS CdAudioHitachiSendPauseCommand(PDEVICE_OBJECT DeviceObject) { + PCD_DEVICE_EXTENSION deviceExtension; + SCSI_PASS_THROUGH srb; + PHITACHICDB cdb; + NTSTATUS status; + PUCHAR PausePos; + PVOID tmp; - } { - memset(PausePos, 0, 3); - memset(cdb, 0, 12); - srb.CdbLength = 12; - srb.TimeOutValue = 10; - cdb->PAUSE_AUDIO.OperationCode = 225; - status = SendSrbSynchronous(deviceExtension, & srb, PausePos, 3); -/* ExFreePool(PausePos); */ /* INLINED */ + { + deviceExtension = DeviceObject->DeviceExtension; + cdb = (union _HITACHICDB *)(srb.Cdb); + tmp = ExAllocatePoolWithTag(4, 3, 541156419UL); + PausePos = (UCHAR *)tmp; + } + if ((unsigned int)PausePos == (unsigned int)((void *)0)) { + return (-1073741670L); + } else { + } + { + memset(PausePos, 0, 3); + memset(cdb, 0, 12); + srb.CdbLength = 12; + srb.TimeOutValue = 10; + cdb->PAUSE_AUDIO.OperationCode = 225; + status = SendSrbSynchronous(deviceExtension, &srb, PausePos, 3); + /* ExFreePool(PausePos); */ /* INLINED */ + } + return (status); } - return (status); } -} -NTSTATUS CdAudioHitachiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION currentIrpStack ; - PCD_DEVICE_EXTENSION deviceExtension ; - PCDROM_TOC cdaudioDataOut ; - SCSI_PASS_THROUGH srb ; - PHITACHICDB cdb ; - NTSTATUS status ; - ULONG i ; - ULONG bytesTransfered ; - PUCHAR Toc ; - BOOLEAN tmp ; - PVOID tmp___0 ; - ULONG tracksToReturn ; - ULONG tracksOnCd ; - ULONG tracksInBuffer ; - ULONG dataLength ; - ULONG tracksToReturn___0 ; - ULONG tracksOnCd___0 ; - ULONG tracksInBuffer___0 ; - ULONG dataLength___0 ; - NTSTATUS tmp___1 ; - PCDROM_PLAY_AUDIO_MSF inputBuffer ; - PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ; - PUCHAR PausePos ; - PVOID tmp___2 ; - PSUB_Q_CURRENT_POSITION userPtr ; - PUCHAR SubQPtr ; - PVOID tmp___3 ; - PUCHAR EjectStatus ; - PVOID tmp___4 ; - NTSTATUS tmp___5 ; +NTSTATUS CdAudioHitachiDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION currentIrpStack; + PCD_DEVICE_EXTENSION deviceExtension; + PCDROM_TOC cdaudioDataOut; + SCSI_PASS_THROUGH srb; + PHITACHICDB cdb; + NTSTATUS status; + ULONG i; + ULONG bytesTransfered; + PUCHAR Toc; + BOOLEAN tmp; + PVOID tmp___0; + ULONG tracksToReturn; + ULONG tracksOnCd; + ULONG tracksInBuffer; + ULONG dataLength; + ULONG tracksToReturn___0; + ULONG tracksOnCd___0; + ULONG tracksInBuffer___0; + ULONG dataLength___0; + NTSTATUS tmp___1; + PCDROM_PLAY_AUDIO_MSF inputBuffer; + PCDROM_SEEK_AUDIO_MSF inputBuffer___0; + PUCHAR PausePos; + PVOID tmp___2; + PSUB_Q_CURRENT_POSITION userPtr; + PUCHAR SubQPtr; + PVOID tmp___3; + PUCHAR EjectStatus; + PVOID tmp___4; + NTSTATUS tmp___5; { - currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - deviceExtension = DeviceObject->DeviceExtension; - cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer; - cdb = (union _HITACHICDB *)(srb.Cdb); - HitachiRestart: - { - memset(cdb, 0, 12); - } - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) { - goto switch_15_exp_38; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) { - goto switch_15_exp_39; + currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + deviceExtension = DeviceObject->DeviceExtension; + cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer; + cdb = (union _HITACHICDB *)(srb.Cdb); + HitachiRestart : { memset(cdb, 0, 12); } + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + ((2 << 16) | (1 << 14))) { + goto switch_15_exp_38; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) { - goto switch_15_exp_40; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (2 << 2))) { + goto switch_15_exp_39; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) { - goto switch_15_exp_41; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (6 << 2))) { + goto switch_15_exp_40; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) { - goto switch_15_exp_42; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (1 << 2))) { + goto switch_15_exp_41; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) { - goto switch_15_exp_43; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (3 << 2))) { + goto switch_15_exp_42; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) { - goto switch_15_exp_44; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (4 << 2))) { + goto switch_15_exp_43; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) { - goto switch_15_exp_45; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (11 << 2))) { + goto switch_15_exp_44; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) { - goto switch_15_exp_46; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (514 << 2))) { + goto switch_15_exp_45; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) { - goto switch_15_exp_47; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (13 << 2))) { + goto switch_15_exp_46; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) { - goto switch_15_exp_48; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (5 << 2))) { + goto switch_15_exp_47; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_15_exp_49; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (10 << 2))) { + goto switch_15_exp_48; } else { - { - goto switch_15_default; - if (0) { - switch_15_exp_38: /* CIL Label */ ; - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - goto switch_15_break; - } else { - - } - { - tmp = CdAudioIsPlayActive(DeviceObject); - } - if (tmp) { - status = -2147483631L; - Irp->IoStatus.Information = 0; - goto switch_15_break; - } else { - - } - { - tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ), - 541156419UL); - Toc = (UCHAR *)tmp___0; - } - if ((unsigned int )Toc == (unsigned int )((void *)0)) { - status = -1073741670L; - Irp->IoStatus.Information = 0; - goto SetStatusAndReturn; - } else { - - } - { - memset(Toc, 0, sizeof(CDROM_TOC )); - srb.CdbLength = 12; - } - if ((int )deviceExtension->Active == 5) { - cdb->READ_DISC_INFO.OperationCode = 227; - } else { - cdb->READ_DISC_INFO.OperationCode = 232; - } + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_15_exp_49; + } else { { - cdb->READ_DISC_INFO.AllocationLength[0] = sizeof(CDROM_TOC ) >> 8; - cdb->READ_DISC_INFO.AllocationLength[1] = sizeof(CDROM_TOC ) & 255U; - srb.TimeOutValue = 10; - status = SendSrbSynchronous(deviceExtension, & srb, Toc, - sizeof(CDROM_TOC )); - } - if (! (status >= 0L)) { - if (status != -1073741764L) { - if (status != -1073741764L) { - { -/* ExFreePool(Toc); */ /* INLINED */ + goto switch_15_default; + if (0) { + switch_15_exp_38: /* CIL Label */; + if (currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength < + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[0]))) { + status = -1073741789L; Irp->IoStatus.Information = 0; - } - goto SetStatusAndReturn; + goto switch_15_break; } else { - } - } else { - status = 0L; - } - } else { - status = 0L; - } - if ((int )deviceExtension->Active == 6) { - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) { - bytesTransfered = sizeof(CDROM_TOC ); - } else { - bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength; - } - cdaudioDataOut->FirstTrack = *(Toc + 2); - cdaudioDataOut->LastTrack = *(Toc + 3); - tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1; - dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL; - cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8); - cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL); - tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0])); - tracksInBuffer /= (ULONG )sizeof(TRACK_DATA ); - if (tracksInBuffer < tracksOnCd) { - tracksToReturn = tracksInBuffer; - } else { - tracksToReturn = tracksOnCd; - } - i = 0; - { - while (1) { - while_16_continue: /* CIL Label */ ; - if (i < tracksToReturn) { - + { tmp = CdAudioIsPlayActive(DeviceObject); } + if (tmp) { + status = -2147483631L; + Irp->IoStatus.Information = 0; + goto switch_15_break; } else { - goto while_16_break; } - cdaudioDataOut->TrackData[i].Reserved = 0; - cdaudioDataOut->TrackData[i].Control = (((int )*(Toc + (i * 4UL + 8UL)) & 15) << 4) | ((int )*(Toc + (i * 4UL + 8UL)) >> 4); - cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack); - cdaudioDataOut->TrackData[i].Reserved1 = 0; - cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = *(Toc + (i * 4UL + 9UL)); - cdaudioDataOut->TrackData[i].Address[2] = *(Toc + (i * 4UL + 10UL)); - cdaudioDataOut->TrackData[i].Address[3] = *(Toc + (i * 4UL + 11UL)); - i += 1UL; - } - while_16_break: /* CIL Label */ ; - } - if (tracksInBuffer > tracksOnCd) { - cdaudioDataOut->TrackData[i].Reserved = 0; - cdaudioDataOut->TrackData[i].Control = 16; - cdaudioDataOut->TrackData[i].TrackNumber = 170; - cdaudioDataOut->TrackData[i].Reserved1 = 0; - cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = *(Toc + 5); - cdaudioDataOut->TrackData[i].Address[2] = *(Toc + 6); - cdaudioDataOut->TrackData[i].Address[3] = *(Toc + 7); - i += 1UL; - } else { - - } - Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i])); - deviceExtension->Paused = 0; - deviceExtension->PausedM = 0; - deviceExtension->PausedS = 0; - deviceExtension->PausedF = 0; - deviceExtension->LastEndM = 0; - deviceExtension->LastEndS = 0; - deviceExtension->LastEndF = 0; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) { - bytesTransfered = sizeof(CDROM_TOC ); - } else { - bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength; - } - cdaudioDataOut->FirstTrack = *(Toc + 1); - cdaudioDataOut->LastTrack = *(Toc + 2); - tracksOnCd___0 = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1; - dataLength___0 = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd___0])) - 2UL; - cdaudioDataOut->Length[0] = (unsigned char )(dataLength___0 >> 8); - cdaudioDataOut->Length[1] = (unsigned char )(dataLength___0 & 255UL); - tracksInBuffer___0 = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0])); - tracksInBuffer___0 /= (ULONG )sizeof(TRACK_DATA ); - if (tracksInBuffer___0 < tracksOnCd___0) { - tracksToReturn___0 = tracksInBuffer___0; - } else { - tracksToReturn___0 = tracksOnCd___0; - } - i = 0; - { - while (1) { - while_17_continue: /* CIL Label */ ; - if (i < tracksToReturn___0) { - + { + tmp___0 = ExAllocatePoolWithTag( + 4, sizeof(CDROM_TOC), 541156419UL); + Toc = (UCHAR *)tmp___0; + } + if ((unsigned int)Toc == + (unsigned int)((void *)0)) { + status = -1073741670L; + Irp->IoStatus.Information = 0; + goto SetStatusAndReturn; } else { - goto while_17_break; } - cdaudioDataOut->TrackData[i].Reserved = 0; - if ((int )*(Toc + (i * 3UL + 6UL)) & 128) { - cdaudioDataOut->TrackData[i].Control = 4; + { + memset(Toc, 0, sizeof(CDROM_TOC)); + srb.CdbLength = 12; + } + if ((int)deviceExtension->Active == 5) { + cdb->READ_DISC_INFO.OperationCode = 227; } else { - cdaudioDataOut->TrackData[i].Control = 0; + cdb->READ_DISC_INFO.OperationCode = 232; } - cdaudioDataOut->TrackData[i].Adr = 0; - cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack); - cdaudioDataOut->TrackData[i].Reserved1 = 0; - cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = (int )*(Toc + (i * 3UL + 6UL)) & 127; - cdaudioDataOut->TrackData[i].Address[2] = *(Toc + (i * 3UL + 7UL)); - cdaudioDataOut->TrackData[i].Address[3] = *(Toc + (i * 3UL + 8UL)); - i += 1UL; - } - while_17_break: /* CIL Label */ ; - } - if (tracksInBuffer___0 > tracksOnCd___0) { - cdaudioDataOut->TrackData[i].Reserved = 0; - cdaudioDataOut->TrackData[i].Control = 16; - cdaudioDataOut->TrackData[i].TrackNumber = 170; - cdaudioDataOut->TrackData[i].Reserved1 = 0; - cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = *(Toc + 3); - cdaudioDataOut->TrackData[i].Address[2] = *(Toc + 4); - cdaudioDataOut->TrackData[i].Address[3] = *(Toc + 5); - i += 1UL; - } else { - - } - Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i])); - } - { -/* ExFreePool(Toc); */ /* INLINED */ - } - goto switch_15_break; - switch_15_exp_39: /* CIL Label */ - { - deviceExtension->PlayActive = 0; - Irp->IoStatus.Information = 0; - CdAudioHitachiSendPauseCommand(DeviceObject); - deviceExtension->Paused = 0; - deviceExtension->PausedM = 0; - deviceExtension->PausedS = 0; - deviceExtension->PausedF = 0; - deviceExtension->LastEndM = 0; - deviceExtension->LastEndS = 0; - deviceExtension->LastEndF = 0; - tmp___1 = CdAudioSendToNextDriver(DeviceObject, Irp); - } - return (tmp___1); - goto switch_15_break; - switch_15_exp_40: /* CIL Label */ - inputBuffer = Irp->AssociatedIrp.SystemBuffer; - Irp->IoStatus.Information = 0; - if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) { - status = -1073741820L; - goto switch_15_break; - } else { - - } - { - CdAudioHitachiSendPauseCommand(DeviceObject); - srb.CdbLength = 12; - srb.TimeOutValue = 10; - cdb->PLAY_AUDIO.OperationCode = 224; - cdb->PLAY_AUDIO.Immediate = 1; - cdb->PLAY_AUDIO.StartingM = inputBuffer->StartingM; - cdb->PLAY_AUDIO.StartingS = inputBuffer->StartingS; - cdb->PLAY_AUDIO.StartingF = inputBuffer->StartingF; - cdb->PLAY_AUDIO.EndingM = inputBuffer->EndingM; - cdb->PLAY_AUDIO.EndingS = inputBuffer->EndingS; - cdb->PLAY_AUDIO.EndingF = inputBuffer->EndingF; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); - } - if (status >= 0L) { - deviceExtension->PlayActive = 1; - deviceExtension->Paused = 0; - deviceExtension->PausedM = inputBuffer->StartingM; - deviceExtension->PausedS = inputBuffer->StartingS; - deviceExtension->PausedF = inputBuffer->StartingF; - deviceExtension->LastEndM = inputBuffer->EndingM; - deviceExtension->LastEndS = inputBuffer->EndingS; - deviceExtension->LastEndF = inputBuffer->EndingF; - } else { - - } - goto switch_15_break; - switch_15_exp_41: /* CIL Label */ - inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer; - Irp->IoStatus.Information = 0; - if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) { - status = -1073741820L; - goto switch_15_break; - } else { - - } - { - CdAudioHitachiSendPauseCommand(DeviceObject); - srb.CdbLength = 12; - srb.TimeOutValue = 10; - cdb->PLAY_AUDIO.OperationCode = 224; - cdb->PLAY_AUDIO.Immediate = 1; - cdb->PLAY_AUDIO.StartingM = inputBuffer___0->M; - cdb->PLAY_AUDIO.StartingS = inputBuffer___0->S; - cdb->PLAY_AUDIO.StartingF = inputBuffer___0->F; - cdb->PLAY_AUDIO.EndingM = inputBuffer___0->M; - cdb->PLAY_AUDIO.EndingS = inputBuffer___0->S; - cdb->PLAY_AUDIO.EndingF = inputBuffer___0->F; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); - } - if (status >= 0L) { - deviceExtension->PausedM = inputBuffer___0->M; - deviceExtension->PausedS = inputBuffer___0->S; - deviceExtension->PausedF = inputBuffer___0->F; - deviceExtension->LastEndM = inputBuffer___0->M; - deviceExtension->LastEndS = inputBuffer___0->S; - deviceExtension->LastEndF = inputBuffer___0->F; - } else { - - } - goto switch_15_break; - switch_15_exp_42: /* CIL Label */ - { - tmp___2 = ExAllocatePoolWithTag(4, 3, 541156419UL); - PausePos = tmp___2; - Irp->IoStatus.Information = 0; - } - if ((unsigned int )PausePos == (unsigned int )((void *)0)) { - status = -1073741670L; - goto SetStatusAndReturn; - } else { - - } - { - deviceExtension->PlayActive = 0; - memset(PausePos, 0, 3); - srb.CdbLength = 12; - srb.TimeOutValue = 10; - cdb->PAUSE_AUDIO.OperationCode = 225; - status = SendSrbSynchronous(deviceExtension, & srb, PausePos, - 3); - deviceExtension->Paused = 1; - deviceExtension->PausedM = *(PausePos + 0); - deviceExtension->PausedS = *(PausePos + 1); - deviceExtension->PausedF = *(PausePos + 2); -/* ExFreePool(PausePos); */ /* INLINED */ - } - goto switch_15_break; - switch_15_exp_43: /* CIL Label */ - { - Irp->IoStatus.Information = 0; - CdAudioHitachiSendPauseCommand(DeviceObject); - srb.CdbLength = 12; - srb.TimeOutValue = 10; - cdb->PLAY_AUDIO.OperationCode = 224; - cdb->PLAY_AUDIO.Immediate = 1; - cdb->PLAY_AUDIO.StartingM = deviceExtension->PausedM; - cdb->PLAY_AUDIO.StartingS = deviceExtension->PausedS; - cdb->PLAY_AUDIO.StartingF = deviceExtension->PausedF; - cdb->PLAY_AUDIO.EndingM = deviceExtension->LastEndM; - cdb->PLAY_AUDIO.EndingS = deviceExtension->LastEndS; - cdb->PLAY_AUDIO.EndingF = deviceExtension->LastEndF; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); - } - if (status >= 0L) { - deviceExtension->Paused = 0; - } else { - - } - goto switch_15_break; - switch_15_exp_44: /* CIL Label */ - { - userPtr = Irp->AssociatedIrp.SystemBuffer; - tmp___3 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ), - 541156419UL); - SubQPtr = tmp___3; - } - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - if (SubQPtr) { { -/* ExFreePool(SubQPtr); */ /* INLINED */ + cdb->READ_DISC_INFO.AllocationLength[0] = + sizeof(CDROM_TOC) >> 8; + cdb->READ_DISC_INFO.AllocationLength[1] = + sizeof(CDROM_TOC) & 255U; + srb.TimeOutValue = 10; + status = SendSrbSynchronous( + deviceExtension, &srb, Toc, + sizeof(CDROM_TOC)); } - } else { - - } - goto switch_15_break; - } else { - - } - if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) { - status = -1073741670L; - Irp->IoStatus.Information = 0; - goto SetStatusAndReturn; - } else { - - } - if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) { - { -/* ExFreePool(SubQPtr); */ /* INLINED */ - status = -1073741823L; - Irp->IoStatus.Information = 0; - } - goto SetStatusAndReturn; - } else { - - } - srb.CdbLength = 12; - srb.TimeOutValue = 10; - cdb->AUDIO_STATUS.OperationCode = 229; - Retry: - { - status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr, - sizeof(SUB_Q_CHANNEL_DATA )); - } - if (status >= 0L) { - goto _L; - } else { - if (status == -1073741764L) { - _L: /* CIL Label */ - if (((int )*(SubQPtr + 1) & 15) != 1) { - goto Retry; + if (!(status >= 0L)) { + if (status != -1073741764L) { + if (status != -1073741764L) { + { + /* ExFreePool(Toc); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; + } else { + } + } else { + status = 0L; + } } else { - + status = 0L; } - userPtr->Header.Reserved = 0; - if ((int )deviceExtension->Paused == 1) { - deviceExtension->PlayActive = 0; - userPtr->Header.AudioStatus = 18; + if ((int)deviceExtension->Active == 6) { + if (currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength > + (ULONG)sizeof(CDROM_TOC)) { + bytesTransfered = sizeof(CDROM_TOC); + } else { + bytesTransfered = + currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength; + } + cdaudioDataOut->FirstTrack = *(Toc + 2); + cdaudioDataOut->LastTrack = *(Toc + 3); + tracksOnCd = + ((int)cdaudioDataOut->LastTrack - + (int)cdaudioDataOut->FirstTrack) + + 1; + dataLength = + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[tracksOnCd])) - + 2UL; + cdaudioDataOut->Length[0] = + (unsigned char)(dataLength >> 8); + cdaudioDataOut->Length[1] = + (unsigned char)(dataLength & 255UL); + tracksInBuffer = + currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength - + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[0])); + tracksInBuffer /= (ULONG)sizeof(TRACK_DATA); + if (tracksInBuffer < tracksOnCd) { + tracksToReturn = tracksInBuffer; + } else { + tracksToReturn = tracksOnCd; + } + i = 0; + { + while (1) { + while_16_continue: /* CIL Label */; + if (i < tracksToReturn) { + + } else { + goto while_16_break; + } + cdaudioDataOut->TrackData[i].Reserved = 0; + cdaudioDataOut->TrackData[i].Control = + (((int)*(Toc + (i * 4UL + 8UL)) & 15) + << 4) | + ((int)*(Toc + (i * 4UL + 8UL)) >> 4); + cdaudioDataOut->TrackData[i].TrackNumber = + (unsigned char)(i + + (ULONG)cdaudioDataOut + ->FirstTrack); + cdaudioDataOut->TrackData[i].Reserved1 = + 0; + cdaudioDataOut->TrackData[i].Address[0] = + 0; + cdaudioDataOut->TrackData[i].Address[1] = + *(Toc + (i * 4UL + 9UL)); + cdaudioDataOut->TrackData[i].Address[2] = + *(Toc + (i * 4UL + 10UL)); + cdaudioDataOut->TrackData[i].Address[3] = + *(Toc + (i * 4UL + 11UL)); + i += 1UL; + } + while_16_break: /* CIL Label */; + } + if (tracksInBuffer > tracksOnCd) { + cdaudioDataOut->TrackData[i].Reserved = 0; + cdaudioDataOut->TrackData[i].Control = 16; + cdaudioDataOut->TrackData[i].TrackNumber = + 170; + cdaudioDataOut->TrackData[i].Reserved1 = 0; + cdaudioDataOut->TrackData[i].Address[0] = 0; + cdaudioDataOut->TrackData[i].Address[1] = + *(Toc + 5); + cdaudioDataOut->TrackData[i].Address[2] = + *(Toc + 6); + cdaudioDataOut->TrackData[i].Address[3] = + *(Toc + 7); + i += 1UL; + } else { + } + Irp->IoStatus.Information = (unsigned long)(( + long)(&((CDROM_TOC *)0)->TrackData[i])); + deviceExtension->Paused = 0; + deviceExtension->PausedM = 0; + deviceExtension->PausedS = 0; + deviceExtension->PausedF = 0; + deviceExtension->LastEndM = 0; + deviceExtension->LastEndS = 0; + deviceExtension->LastEndF = 0; } else { - if ((int )*(SubQPtr + 0) == 1) { - userPtr->Header.AudioStatus = 17; + if (currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength > + (ULONG)sizeof(CDROM_TOC)) { + bytesTransfered = sizeof(CDROM_TOC); } else { - if ((int )*(SubQPtr + 0) == 0) { - userPtr->Header.AudioStatus = 19; - deviceExtension->PlayActive = 0; - } else { - deviceExtension->PlayActive = 0; + bytesTransfered = + currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength; + } + cdaudioDataOut->FirstTrack = *(Toc + 1); + cdaudioDataOut->LastTrack = *(Toc + 2); + tracksOnCd___0 = + ((int)cdaudioDataOut->LastTrack - + (int)cdaudioDataOut->FirstTrack) + + 1; + dataLength___0 = + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData + [tracksOnCd___0])) - + 2UL; + cdaudioDataOut->Length[0] = + (unsigned char)(dataLength___0 >> 8); + cdaudioDataOut->Length[1] = + (unsigned char)(dataLength___0 & 255UL); + tracksInBuffer___0 = + currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength - + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[0])); + tracksInBuffer___0 /= + (ULONG)sizeof(TRACK_DATA); + if (tracksInBuffer___0 < tracksOnCd___0) { + tracksToReturn___0 = tracksInBuffer___0; + } else { + tracksToReturn___0 = tracksOnCd___0; + } + i = 0; + { + while (1) { + while_17_continue: /* CIL Label */; + if (i < tracksToReturn___0) { + + } else { + goto while_17_break; + } + cdaudioDataOut->TrackData[i].Reserved = 0; + if ((int)*(Toc + (i * 3UL + 6UL)) & 128) { + cdaudioDataOut->TrackData[i].Control = + 4; + } else { + cdaudioDataOut->TrackData[i].Control = + 0; + } + cdaudioDataOut->TrackData[i].Adr = 0; + cdaudioDataOut->TrackData[i].TrackNumber = + (unsigned char)(i + + (ULONG)cdaudioDataOut + ->FirstTrack); + cdaudioDataOut->TrackData[i].Reserved1 = + 0; + cdaudioDataOut->TrackData[i].Address[0] = + 0; + cdaudioDataOut->TrackData[i].Address[1] = + (int)*(Toc + (i * 3UL + 6UL)) & 127; + cdaudioDataOut->TrackData[i].Address[2] = + *(Toc + (i * 3UL + 7UL)); + cdaudioDataOut->TrackData[i].Address[3] = + *(Toc + (i * 3UL + 8UL)); + i += 1UL; } + while_17_break: /* CIL Label */; + } + if (tracksInBuffer___0 > tracksOnCd___0) { + cdaudioDataOut->TrackData[i].Reserved = 0; + cdaudioDataOut->TrackData[i].Control = 16; + cdaudioDataOut->TrackData[i].TrackNumber = + 170; + cdaudioDataOut->TrackData[i].Reserved1 = 0; + cdaudioDataOut->TrackData[i].Address[0] = 0; + cdaudioDataOut->TrackData[i].Address[1] = + *(Toc + 3); + cdaudioDataOut->TrackData[i].Address[2] = + *(Toc + 4); + cdaudioDataOut->TrackData[i].Address[3] = + *(Toc + 5); + i += 1UL; + } else { } + Irp->IoStatus.Information = (unsigned long)(( + long)(&((CDROM_TOC *)0)->TrackData[i])); } - userPtr->Header.DataLength[0] = 0; - userPtr->Header.DataLength[0] = 12; - userPtr->FormatCode = 1; - userPtr->Control = ((int )*(SubQPtr + 1) & 240) >> 4; - userPtr->ADR = (int )*(SubQPtr + 1) & 15; - userPtr->TrackNumber = *(SubQPtr + 2); - userPtr->IndexNumber = *(SubQPtr + 3); - userPtr->AbsoluteAddress[0] = 0; - userPtr->AbsoluteAddress[1] = *(SubQPtr + 8); - userPtr->AbsoluteAddress[2] = *(SubQPtr + 9); - userPtr->AbsoluteAddress[3] = *(SubQPtr + 10); - userPtr->TrackRelativeAddress[0] = 0; - userPtr->TrackRelativeAddress[1] = *(SubQPtr + 4); - userPtr->TrackRelativeAddress[2] = *(SubQPtr + 5); - userPtr->TrackRelativeAddress[3] = *(SubQPtr + 6); - Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION ); - status = 0L; - } else { + { + /* ExFreePool(Toc); */ /* INLINED */ + } + goto switch_15_break; + switch_15_exp_39 : /* CIL Label */ + { + deviceExtension->PlayActive = 0; Irp->IoStatus.Information = 0; - } - } - { -/* ExFreePool(SubQPtr); */ /* INLINED */ - } - goto switch_15_break; - switch_15_exp_45: /* CIL Label */ - { - tmp___4 = ExAllocatePoolWithTag(4, 1, 541156419UL); - EjectStatus = tmp___4; - Irp->IoStatus.Information = 0; - } - if ((unsigned int )EjectStatus == (unsigned int )((void *)0)) { - status = -1073741670L; - goto SetStatusAndReturn; - } else { - - } - { - deviceExtension->PlayActive = 0; - srb.CdbLength = 12; - srb.TimeOutValue = 10; - cdb->EJECT.OperationCode = 228; - cdb->EJECT.Eject = 1; - status = SendSrbSynchronous(deviceExtension, & srb, EjectStatus, - 1); - } - if (status >= 0L) { - deviceExtension->Paused = 0; - deviceExtension->PausedM = 0; - deviceExtension->PausedS = 0; - deviceExtension->PausedF = 0; - deviceExtension->LastEndM = 0; - deviceExtension->LastEndS = 0; - deviceExtension->LastEndF = 0; - } else { - - } - { -/* ExFreePool(EjectStatus); */ /* INLINED */ - } - goto switch_15_break; - switch_15_exp_46: /* CIL Label */ ; - switch_15_exp_47: /* CIL Label */ ; - switch_15_exp_48: /* CIL Label */ - Irp->IoStatus.Information = 0; - status = -1073741808L; - goto switch_15_break; - switch_15_exp_49: /* CIL Label */ - { - CdAudioIsPlayActive(DeviceObject); - } - switch_15_default: /* CIL Label */ - { - tmp___5 = CdAudioSendToNextDriver(DeviceObject, Irp); - } - return (tmp___5); - goto switch_15_break; - } else { - switch_15_break: /* CIL Label */ ; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - SetStatusAndReturn: - if (status == -2147483626L) { - if ((int )currentIrpStack->Flags & 2) { - status = -1073741435L; - goto HitachiRestart; - } else { - - } - { -/* IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */ - Irp->IoStatus.Information = 0; - } - } else { - - } - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); - } - return (status); -} -} -NTSTATUS CdAudio535DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION currentIrpStack ; - PCD_DEVICE_EXTENSION deviceExtension ; - PCDROM_TOC cdaudioDataOut ; - SCSI_PASS_THROUGH srb ; - PREAD_CAPACITY_DATA lastSession ; - PCDB cdb ; - NTSTATUS status ; - ULONG i ; - ULONG bytesTransfered ; - PUCHAR Toc ; - ULONG destblock ; - BOOLEAN tmp ; - PVOID tmp___0 ; - BOOLEAN tmp___1 ; - PVOID tmp___2 ; - ULONG tracksToReturn ; - ULONG tracksOnCd ; - ULONG tracksInBuffer ; - PSUB_Q_CURRENT_POSITION userPtr ; - PUCHAR SubQPtr ; - PVOID tmp___3 ; - PCDROM_PLAY_AUDIO_MSF inputBuffer ; - PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ; - NTSTATUS tmp___4 ; - - { - { - currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - deviceExtension = DeviceObject->DeviceExtension; - cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer; - cdb = (union _CDB *)(srb.Cdb); - memset(cdb, 0, 12); - } - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (14 << 2))) { - goto switch_18_exp_50; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) { - goto switch_18_exp_51; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) { - goto switch_18_exp_52; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) { - goto switch_18_exp_53; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) { - goto switch_18_exp_54; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) { - goto switch_18_exp_55; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) { - goto switch_18_exp_56; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) { - goto switch_18_exp_57; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) { - goto switch_18_exp_58; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_18_exp_59; - } else { - { - goto switch_18_default; - if (0) { - switch_18_exp_50: /* CIL Label */ - { - tmp = CdAudioIsPlayActive(DeviceObject); - } - if (tmp) { - status = -2147483631L; - Irp->IoStatus.Information = 0; - goto switch_18_break; - } else { - - } - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[1]))) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - goto switch_18_break; - } else { - - } - { - tmp___0 = ExAllocatePoolWithTag(4, sizeof(READ_CAPACITY_DATA ), - 541156419UL); - lastSession = tmp___0; - } - if ((unsigned int )lastSession == (unsigned int )((void *)0)) { - status = -1073741670L; - Irp->IoStatus.Information = 0; - goto SetStatusAndReturn; - } else { - - } - { - memset(lastSession, 0, sizeof(READ_CAPACITY_DATA )); - srb.CdbLength = 10; - cdb->CDB10.OperationCode = 38; - srb.TimeOutValue = 10; - status = SendSrbSynchronous(deviceExtension, & srb, lastSession, - sizeof(READ_CAPACITY_DATA )); - } - if (! (status >= 0L)) { - { -/* ExFreePool(lastSession); */ /* INLINED */ - Irp->IoStatus.Information = 0; - } - goto SetStatusAndReturn; - } else { - status = 0L; - } - { - bytesTransfered = (long )(& ((CDROM_TOC *)0)->TrackData[1]); - Irp->IoStatus.Information = bytesTransfered; - memset(cdaudioDataOut, 0, bytesTransfered); - cdaudioDataOut->Length[0] = (unsigned char )((bytesTransfered - 2UL) >> 8); - cdaudioDataOut->Length[1] = (unsigned char )((bytesTransfered - 2UL) & 255UL); - } - if (lastSession->LogicalBlockAddress == 0UL) { - { -/* ExFreePool(lastSession); */ /* INLINED */ - } - goto switch_18_break; - } else { - - } - { - cdaudioDataOut->FirstTrack = 1; - cdaudioDataOut->LastTrack = 2; - *((ULONG *)(& cdaudioDataOut->TrackData[0].Address[0])) = lastSession->LogicalBlockAddress; -/* ExFreePool(lastSession); */ /* INLINED */ - } - goto switch_18_break; - switch_18_exp_51: /* CIL Label */ ; - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - goto switch_18_break; - } else { - - } - { - tmp___1 = CdAudioIsPlayActive(DeviceObject); - } - if (tmp___1) { - status = -2147483631L; - Irp->IoStatus.Information = 0; - goto switch_18_break; - } else { - - } - { - tmp___2 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ), 541156419UL); - Toc = (UCHAR *)tmp___2; - } - if ((unsigned int )Toc == (unsigned int )((void *)0)) { - status = -1073741670L; - Irp->IoStatus.Information = 0; - goto SetStatusAndReturn; - } else { - - } - { - memset(Toc, 0, sizeof(CDROM_TOC )); - cdb->CDB10.OperationCode = 67; - cdb->CDB10.Reserved1 = 1; - cdb->CDB10.TransferBlocksMsb = sizeof(CDROM_TOC ) >> 8; - cdb->CDB10.TransferBlocksLsb = sizeof(CDROM_TOC ) & 255U; - srb.TimeOutValue = 10; - srb.CdbLength = 10; - status = SendSrbSynchronous(deviceExtension, & srb, Toc, sizeof(CDROM_TOC )); - } - if (! (status >= 0L)) { - if (status != -1073741764L) { - if (status != -1073741764L) { + CdAudioHitachiSendPauseCommand(DeviceObject); + deviceExtension->Paused = 0; + deviceExtension->PausedM = 0; + deviceExtension->PausedS = 0; + deviceExtension->PausedF = 0; + deviceExtension->LastEndM = 0; + deviceExtension->LastEndS = 0; + deviceExtension->LastEndF = 0; + tmp___1 = + CdAudioSendToNextDriver(DeviceObject, Irp); + } + return (tmp___1); + goto switch_15_break; + switch_15_exp_40: /* CIL Label */ + inputBuffer = Irp->AssociatedIrp.SystemBuffer; + Irp->IoStatus.Information = 0; + if (currentIrpStack->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(CDROM_PLAY_AUDIO_MSF)) { + status = -1073741820L; + goto switch_15_break; + } else { + } + { + CdAudioHitachiSendPauseCommand(DeviceObject); + srb.CdbLength = 12; + srb.TimeOutValue = 10; + cdb->PLAY_AUDIO.OperationCode = 224; + cdb->PLAY_AUDIO.Immediate = 1; + cdb->PLAY_AUDIO.StartingM = + inputBuffer->StartingM; + cdb->PLAY_AUDIO.StartingS = + inputBuffer->StartingS; + cdb->PLAY_AUDIO.StartingF = + inputBuffer->StartingF; + cdb->PLAY_AUDIO.EndingM = + inputBuffer->EndingM; + cdb->PLAY_AUDIO.EndingS = + inputBuffer->EndingS; + cdb->PLAY_AUDIO.EndingF = + inputBuffer->EndingF; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + if (status >= 0L) { + deviceExtension->PlayActive = 1; + deviceExtension->Paused = 0; + deviceExtension->PausedM = + inputBuffer->StartingM; + deviceExtension->PausedS = + inputBuffer->StartingS; + deviceExtension->PausedF = + inputBuffer->StartingF; + deviceExtension->LastEndM = + inputBuffer->EndingM; + deviceExtension->LastEndS = + inputBuffer->EndingS; + deviceExtension->LastEndF = + inputBuffer->EndingF; + } else { + } + goto switch_15_break; + switch_15_exp_41: /* CIL Label */ + inputBuffer___0 = + Irp->AssociatedIrp.SystemBuffer; + Irp->IoStatus.Information = 0; + if (currentIrpStack->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(CDROM_SEEK_AUDIO_MSF)) { + status = -1073741820L; + goto switch_15_break; + } else { + } + { + CdAudioHitachiSendPauseCommand(DeviceObject); + srb.CdbLength = 12; + srb.TimeOutValue = 10; + cdb->PLAY_AUDIO.OperationCode = 224; + cdb->PLAY_AUDIO.Immediate = 1; + cdb->PLAY_AUDIO.StartingM = + inputBuffer___0->M; + cdb->PLAY_AUDIO.StartingS = + inputBuffer___0->S; + cdb->PLAY_AUDIO.StartingF = + inputBuffer___0->F; + cdb->PLAY_AUDIO.EndingM = inputBuffer___0->M; + cdb->PLAY_AUDIO.EndingS = inputBuffer___0->S; + cdb->PLAY_AUDIO.EndingF = inputBuffer___0->F; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + if (status >= 0L) { + deviceExtension->PausedM = inputBuffer___0->M; + deviceExtension->PausedS = inputBuffer___0->S; + deviceExtension->PausedF = inputBuffer___0->F; + deviceExtension->LastEndM = + inputBuffer___0->M; + deviceExtension->LastEndS = + inputBuffer___0->S; + deviceExtension->LastEndF = + inputBuffer___0->F; + } else { + } + goto switch_15_break; + switch_15_exp_42 : /* CIL Label */ { -/* ExFreePool(Toc); */ /* INLINED */ - Irp->IoStatus.Information = 0; + tmp___2 = + ExAllocatePoolWithTag(4, 3, 541156419UL); + PausePos = tmp___2; + Irp->IoStatus.Information = 0; } - goto SetStatusAndReturn; - } else { - - } - } else { - status = 0L; - } - } else { - status = 0L; - } - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) { - bytesTransfered = sizeof(CDROM_TOC ); - } else { - bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength; - } - cdaudioDataOut->Length[0] = *(Toc + 0); - cdaudioDataOut->Length[1] = *(Toc + 1); - cdaudioDataOut->FirstTrack = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15); - cdaudioDataOut->LastTrack = (((int )*(Toc + 3) & 240) >> 4) * 10 + ((int )*(Toc + 3) & 15); - tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1; - tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0])); - tracksInBuffer /= (ULONG )sizeof(TRACK_DATA ); - if (tracksInBuffer < tracksOnCd) { - tracksToReturn = tracksInBuffer; - } else { - tracksToReturn = tracksOnCd; - } - i = 0; - { - while (1) { - while_19_continue: /* CIL Label */ ; - if (i < tracksToReturn) { - - } else { - goto while_19_break; - } - cdaudioDataOut->TrackData[i].Reserved = 0; - cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL)); - cdaudioDataOut->TrackData[i].TrackNumber = (((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 240) >> 4) * 10 + ((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 15); - cdaudioDataOut->TrackData[i].Reserved1 = 0; - cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL)); - cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL)); - cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL)); - i += 1UL; - } - while_19_break: /* CIL Label */ ; - } - if (tracksInBuffer > tracksOnCd) { - cdaudioDataOut->TrackData[i].Reserved = 0; - cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL)); - cdaudioDataOut->TrackData[i].TrackNumber = *(Toc + ((i * 8UL + 4UL) + 2UL)); - cdaudioDataOut->TrackData[i].Reserved1 = 0; - cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL)); - cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL)); - cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL)); - i += 1UL; - } else { - - } - { - Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i])); -/* ExFreePool(Toc); */ /* INLINED */ - } - goto switch_18_break; - switch_18_exp_52: /* CIL Label */ - { - userPtr = Irp->AssociatedIrp.SystemBuffer; - tmp___3 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CURRENT_POSITION ), - 541156419UL); - SubQPtr = tmp___3; - } - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - if (SubQPtr) { - { -/* ExFreePool(SubQPtr); */ /* INLINED */ - } - } else { - - } - goto switch_18_break; - } else { - - } - if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) { - { - memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION )); - status = -1073741670L; - Irp->IoStatus.Information = 0; - } - goto SetStatusAndReturn; - } else { - - } - if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) { - { -/* ExFreePool(SubQPtr); */ /* INLINED */ - memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION )); - status = -1073741823L; - Irp->IoStatus.Information = 0; - } - goto SetStatusAndReturn; - } else { - - } - { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->SUBCHANNEL.OperationCode = 66; - cdb->SUBCHANNEL.Msf = 1; - cdb->SUBCHANNEL.SubQ = 1; - cdb->SUBCHANNEL.Format = 1; - cdb->SUBCHANNEL.AllocationLength[1] = sizeof(SUB_Q_CURRENT_POSITION ); - status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr, - sizeof(SUB_Q_CURRENT_POSITION )); - } - if (status >= 0L) { - if ((int )*(SubQPtr + 1) == 17) { - deviceExtension->PlayActive = 1; - } else { - deviceExtension->PlayActive = 0; - } - userPtr->Header.Reserved = 0; - userPtr->Header.AudioStatus = *(SubQPtr + 1); - userPtr->Header.DataLength[0] = 0; - userPtr->Header.DataLength[1] = 12; - userPtr->FormatCode = 1; - userPtr->Control = *(SubQPtr + 5); - userPtr->ADR = 0; - userPtr->TrackNumber = (((int )*(SubQPtr + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr + 6) & 15); - userPtr->IndexNumber = (((int )*(SubQPtr + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr + 7) & 15); - userPtr->AbsoluteAddress[0] = 0; - userPtr->AbsoluteAddress[1] = *(SubQPtr + 9); - userPtr->AbsoluteAddress[2] = *(SubQPtr + 10); - userPtr->AbsoluteAddress[3] = *(SubQPtr + 11); - userPtr->TrackRelativeAddress[0] = 0; - userPtr->TrackRelativeAddress[1] = *(SubQPtr + 13); - userPtr->TrackRelativeAddress[2] = *(SubQPtr + 14); - userPtr->TrackRelativeAddress[3] = *(SubQPtr + 15); - Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION ); - } else { - Irp->IoStatus.Information = 0; - } - { -/* ExFreePool(SubQPtr); */ /* INLINED */ - } - goto switch_18_break; - switch_18_exp_53: /* CIL Label */ - inputBuffer = Irp->AssociatedIrp.SystemBuffer; - Irp->IoStatus.Information = 0; - if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) { - status = -1073741820L; - goto switch_18_break; - } else { - - } - if ((int )inputBuffer->StartingM == (int )inputBuffer->EndingM) { - if ((int )inputBuffer->StartingS == (int )inputBuffer->EndingS) { - if ((int )inputBuffer->StartingF == (int )inputBuffer->EndingF) { - cdb->PAUSE_RESUME.OperationCode = 75; - cdb->PAUSE_RESUME.Action = 0; - } else { - goto _L___0; - } - } else { - goto _L___0; - } - } else { - _L___0: /* CIL Label */ - cdb->PLAY_AUDIO_MSF.OperationCode = 71; - cdb->PLAY_AUDIO_MSF.StartingM = inputBuffer->StartingM; - cdb->PLAY_AUDIO_MSF.StartingS = inputBuffer->StartingS; - cdb->PLAY_AUDIO_MSF.StartingF = inputBuffer->StartingF; - cdb->PLAY_AUDIO_MSF.EndingM = inputBuffer->EndingM; - cdb->PLAY_AUDIO_MSF.EndingS = inputBuffer->EndingS; - cdb->PLAY_AUDIO_MSF.EndingF = inputBuffer->EndingF; - } - { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); - } - if (status >= 0L) { - if ((int )cdb->PLAY_AUDIO_MSF.OperationCode == 71) { - deviceExtension->PlayActive = 1; - } else { - - } - } else { - - } - goto switch_18_break; - switch_18_exp_54: /* CIL Label */ - inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer; - Irp->IoStatus.Information = 0; - if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) { - status = -1073741820L; - goto switch_18_break; - } else { - - } - { - destblock = (((unsigned long )inputBuffer___0->M * 60UL + (unsigned long )inputBuffer___0->S) * 75UL + (unsigned long )inputBuffer___0->F) - 150UL; - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->SEEK.OperationCode = 43; - cdb->SEEK.LogicalBlockAddress[0] = (int )((unsigned char )(destblock >> 24)) & 255; - cdb->SEEK.LogicalBlockAddress[1] = (int )((unsigned char )(destblock >> 16)) & 255; - cdb->SEEK.LogicalBlockAddress[2] = (int )((unsigned char )(destblock >> 8)) & 255; - cdb->SEEK.LogicalBlockAddress[3] = (unsigned char )(destblock & 255UL); - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); - } - if (! (status >= 0L)) { - - } else { - - } - goto switch_18_break; - switch_18_exp_55: /* CIL Label */ - { - Irp->IoStatus.Information = 0; - deviceExtension->PlayActive = 0; - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->CDB10.OperationCode = 192; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); - } - goto switch_18_break; - switch_18_exp_56: /* CIL Label */ ; - switch_18_exp_57: /* CIL Label */ ; - switch_18_exp_58: /* CIL Label */ - Irp->IoStatus.Information = 0; - status = -1073741808L; - goto switch_18_break; - switch_18_exp_59: /* CIL Label */ - { - CdAudioIsPlayActive(DeviceObject); - } - switch_18_default: /* CIL Label */ - { - tmp___4 = CdAudioSendToNextDriver(DeviceObject, Irp); + if ((unsigned int)PausePos == + (unsigned int)((void *)0)) { + status = -1073741670L; + goto SetStatusAndReturn; + } else { + } + { + deviceExtension->PlayActive = 0; + memset(PausePos, 0, 3); + srb.CdbLength = 12; + srb.TimeOutValue = 10; + cdb->PAUSE_AUDIO.OperationCode = 225; + status = SendSrbSynchronous( + deviceExtension, &srb, PausePos, 3); + deviceExtension->Paused = 1; + deviceExtension->PausedM = *(PausePos + 0); + deviceExtension->PausedS = *(PausePos + 1); + deviceExtension->PausedF = *(PausePos + 2); + /* ExFreePool(PausePos); */ /* INLINED */ + } + goto switch_15_break; + switch_15_exp_43 : /* CIL Label */ + { + Irp->IoStatus.Information = 0; + CdAudioHitachiSendPauseCommand(DeviceObject); + srb.CdbLength = 12; + srb.TimeOutValue = 10; + cdb->PLAY_AUDIO.OperationCode = 224; + cdb->PLAY_AUDIO.Immediate = 1; + cdb->PLAY_AUDIO.StartingM = + deviceExtension->PausedM; + cdb->PLAY_AUDIO.StartingS = + deviceExtension->PausedS; + cdb->PLAY_AUDIO.StartingF = + deviceExtension->PausedF; + cdb->PLAY_AUDIO.EndingM = + deviceExtension->LastEndM; + cdb->PLAY_AUDIO.EndingS = + deviceExtension->LastEndS; + cdb->PLAY_AUDIO.EndingF = + deviceExtension->LastEndF; + status = SendSrbSynchronous(deviceExtension, + &srb, (void *)0, 0); + } + if (status >= 0L) { + deviceExtension->Paused = 0; + } else { + } + goto switch_15_break; + switch_15_exp_44 : /* CIL Label */ + { + userPtr = Irp->AssociatedIrp.SystemBuffer; + tmp___3 = ExAllocatePoolWithTag( + 4, sizeof(SUB_Q_CHANNEL_DATA), 541156419UL); + SubQPtr = tmp___3; + } + if (currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof(SUB_Q_CURRENT_POSITION)) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + if (SubQPtr) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + } + } else { + } + goto switch_15_break; + } else { + } + if ((unsigned int)SubQPtr == + (unsigned int)((void *)0)) { + status = -1073741670L; + Irp->IoStatus.Information = 0; + goto SetStatusAndReturn; + } else { + } + if ((int)((struct _CDROM_SUB_Q_DATA_FORMAT *) + userPtr) + ->Format != 1) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + status = -1073741823L; + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; + } else { + } + srb.CdbLength = 12; + srb.TimeOutValue = 10; + cdb->AUDIO_STATUS.OperationCode = 229; + Retry : { + status = SendSrbSynchronous( + deviceExtension, &srb, SubQPtr, + sizeof(SUB_Q_CHANNEL_DATA)); + } + if (status >= 0L) { + goto _L; + } else { + if (status == -1073741764L) { + _L: /* CIL Label */ + if (((int)*(SubQPtr + 1) & 15) != 1) { + goto Retry; + } else { + } + userPtr->Header.Reserved = 0; + if ((int)deviceExtension->Paused == 1) { + deviceExtension->PlayActive = 0; + userPtr->Header.AudioStatus = 18; + } else { + if ((int)*(SubQPtr + 0) == 1) { + userPtr->Header.AudioStatus = 17; + } else { + if ((int)*(SubQPtr + 0) == 0) { + userPtr->Header.AudioStatus = 19; + deviceExtension->PlayActive = 0; + } else { + deviceExtension->PlayActive = 0; + } + } + } + userPtr->Header.DataLength[0] = 0; + userPtr->Header.DataLength[0] = 12; + userPtr->FormatCode = 1; + userPtr->Control = + ((int)*(SubQPtr + 1) & 240) >> 4; + userPtr->ADR = (int)*(SubQPtr + 1) & 15; + userPtr->TrackNumber = *(SubQPtr + 2); + userPtr->IndexNumber = *(SubQPtr + 3); + userPtr->AbsoluteAddress[0] = 0; + userPtr->AbsoluteAddress[1] = + *(SubQPtr + 8); + userPtr->AbsoluteAddress[2] = + *(SubQPtr + 9); + userPtr->AbsoluteAddress[3] = + *(SubQPtr + 10); + userPtr->TrackRelativeAddress[0] = 0; + userPtr->TrackRelativeAddress[1] = + *(SubQPtr + 4); + userPtr->TrackRelativeAddress[2] = + *(SubQPtr + 5); + userPtr->TrackRelativeAddress[3] = + *(SubQPtr + 6); + Irp->IoStatus.Information = + sizeof(SUB_Q_CURRENT_POSITION); + status = 0L; + } else { + Irp->IoStatus.Information = 0; + } + } + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + } + goto switch_15_break; + switch_15_exp_45 : /* CIL Label */ + { + tmp___4 = + ExAllocatePoolWithTag(4, 1, 541156419UL); + EjectStatus = tmp___4; + Irp->IoStatus.Information = 0; + } + if ((unsigned int)EjectStatus == + (unsigned int)((void *)0)) { + status = -1073741670L; + goto SetStatusAndReturn; + } else { + } + { + deviceExtension->PlayActive = 0; + srb.CdbLength = 12; + srb.TimeOutValue = 10; + cdb->EJECT.OperationCode = 228; + cdb->EJECT.Eject = 1; + status = SendSrbSynchronous( + deviceExtension, &srb, EjectStatus, 1); + } + if (status >= 0L) { + deviceExtension->Paused = 0; + deviceExtension->PausedM = 0; + deviceExtension->PausedS = 0; + deviceExtension->PausedF = 0; + deviceExtension->LastEndM = 0; + deviceExtension->LastEndS = 0; + deviceExtension->LastEndF = 0; + } else { + } + { + /* ExFreePool(EjectStatus); */ /* INLINED */ + } + goto switch_15_break; + switch_15_exp_46: /* CIL Label */; + switch_15_exp_47: /* CIL Label */; + switch_15_exp_48: /* CIL Label */ + Irp->IoStatus.Information = 0; + status = -1073741808L; + goto switch_15_break; + switch_15_exp_49 : /* CIL Label */ + { + CdAudioIsPlayActive(DeviceObject); + } + switch_15_default : /* CIL Label */ + { + tmp___5 = + CdAudioSendToNextDriver(DeviceObject, Irp); + } + return (tmp___5); + goto switch_15_break; + } else { + switch_15_break: /* CIL Label */; + } + } + } } - return (tmp___4); - goto switch_18_break; - } else { - switch_18_break: /* CIL Label */ ; - } } } } @@ -6708,148 +6672,237 @@ NTSTATUS CdAudio535DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } - } - SetStatusAndReturn: - if (status == -2147483626L) { + SetStatusAndReturn: + if (status == -2147483626L) { + if ((int)currentIrpStack->Flags & 2) { + status = -1073741435L; + goto HitachiRestart; + } else { + } + { + /* IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } + } else { + } { -/* IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */ - Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); } - } else { - - } - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + return (status); } - return (status); -} } -NTSTATUS CdAudio435DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION currentIrpStack ; - PCD_DEVICE_EXTENSION deviceExtension ; - PCDROM_TOC cdaudioDataOut ; - SCSI_PASS_THROUGH srb ; - PCDB cdb ; - NTSTATUS status ; - ULONG i ; - ULONG bytesTransfered ; - PUCHAR Toc ; - BOOLEAN tmp ; - PVOID tmp___0 ; - ULONG tracksToReturn ; - ULONG tracksOnCd ; - ULONG tracksInBuffer ; - PCDROM_PLAY_AUDIO_MSF inputBuffer ; - PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ; - PUCHAR SubQPtr ; - PVOID tmp___1 ; - PSUB_Q_CURRENT_POSITION userPtr ; - PUCHAR SubQPtr___0 ; - PVOID tmp___2 ; - NTSTATUS tmp___3 ; - BOOLEAN tmp___4 ; - NTSTATUS tmp___5 ; +NTSTATUS CdAudio535DeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION currentIrpStack; + PCD_DEVICE_EXTENSION deviceExtension; + PCDROM_TOC cdaudioDataOut; + SCSI_PASS_THROUGH srb; + PREAD_CAPACITY_DATA lastSession; + PCDB cdb; + NTSTATUS status; + ULONG i; + ULONG bytesTransfered; + PUCHAR Toc; + ULONG destblock; + BOOLEAN tmp; + PVOID tmp___0; + BOOLEAN tmp___1; + PVOID tmp___2; + ULONG tracksToReturn; + ULONG tracksOnCd; + ULONG tracksInBuffer; + PSUB_Q_CURRENT_POSITION userPtr; + PUCHAR SubQPtr; + PVOID tmp___3; + PCDROM_PLAY_AUDIO_MSF inputBuffer; + PCDROM_SEEK_AUDIO_MSF inputBuffer___0; + NTSTATUS tmp___4; { - { - currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - deviceExtension = DeviceObject->DeviceExtension; - cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer; - cdb = (union _CDB *)(srb.Cdb); - memset(cdb, 0, 12); - } - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) { - goto switch_20_exp_60; - } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) { - goto switch_20_exp_61; + { + currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + deviceExtension = DeviceObject->DeviceExtension; + cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer; + cdb = (union _CDB *)(srb.Cdb); + memset(cdb, 0, 12); + } + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (14 << 2))) { + goto switch_18_exp_50; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) { - goto switch_20_exp_62; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + ((2 << 16) | (1 << 14))) { + goto switch_18_exp_51; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) { - goto switch_20_exp_63; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (11 << 2))) { + goto switch_18_exp_52; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) { - goto switch_20_exp_64; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (6 << 2))) { + goto switch_18_exp_53; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) { - goto switch_20_exp_65; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (1 << 2))) { + goto switch_18_exp_54; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) { - goto switch_20_exp_66; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (514 << 2))) { + goto switch_18_exp_55; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) { - goto switch_20_exp_67; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (13 << 2))) { + goto switch_18_exp_56; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) { - goto switch_20_exp_68; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (5 << 2))) { + goto switch_18_exp_57; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) { - goto switch_20_exp_69; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (10 << 2))) { + goto switch_18_exp_58; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) { - goto switch_20_exp_70; + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_18_exp_59; } else { - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_20_exp_71; - } else { - { - goto switch_20_default; + { + goto switch_18_default; if (0) { - switch_20_exp_60: /* CIL Label */ ; - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) { + switch_18_exp_50 : /* CIL Label */ + { + tmp = CdAudioIsPlayActive(DeviceObject); + } + if (tmp) { + status = -2147483631L; + Irp->IoStatus.Information = 0; + goto switch_18_break; + } else { + } + if (currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength < + (unsigned long)(( + long)(&((CDROM_TOC *)0)->TrackData[1]))) { status = -1073741789L; Irp->IoStatus.Information = 0; - goto switch_20_break; + goto switch_18_break; } else { - } { - tmp = CdAudioIsPlayActive(DeviceObject); + tmp___0 = ExAllocatePoolWithTag( + 4, sizeof(READ_CAPACITY_DATA), 541156419UL); + lastSession = tmp___0; } - if (tmp) { + if ((unsigned int)lastSession == + (unsigned int)((void *)0)) { + status = -1073741670L; + Irp->IoStatus.Information = 0; + goto SetStatusAndReturn; + } else { + } + { + memset(lastSession, 0, + sizeof(READ_CAPACITY_DATA)); + srb.CdbLength = 10; + cdb->CDB10.OperationCode = 38; + srb.TimeOutValue = 10; + status = SendSrbSynchronous( + deviceExtension, &srb, lastSession, + sizeof(READ_CAPACITY_DATA)); + } + if (!(status >= 0L)) { + { + /* ExFreePool(lastSession); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; + } else { + status = 0L; + } + { + bytesTransfered = + (long)(&((CDROM_TOC *)0)->TrackData[1]); + Irp->IoStatus.Information = bytesTransfered; + memset(cdaudioDataOut, 0, bytesTransfered); + cdaudioDataOut->Length[0] = + (unsigned char)((bytesTransfered - 2UL) >> 8); + cdaudioDataOut->Length[1] = + (unsigned char)((bytesTransfered - 2UL) & + 255UL); + } + if (lastSession->LogicalBlockAddress == 0UL) { + { + /* ExFreePool(lastSession); */ /* INLINED */ + } + goto switch_18_break; + } else { + } + { + cdaudioDataOut->FirstTrack = 1; + cdaudioDataOut->LastTrack = 2; + *((ULONG *)(&cdaudioDataOut->TrackData[0] + .Address[0])) = + lastSession->LogicalBlockAddress; + /* ExFreePool(lastSession); */ /* INLINED */ + } + goto switch_18_break; + switch_18_exp_51: /* CIL Label */; + if (currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength < + (unsigned long)(( + long)(&((CDROM_TOC *)0)->TrackData[0]))) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + goto switch_18_break; + } else { + } + { tmp___1 = CdAudioIsPlayActive(DeviceObject); } + if (tmp___1) { status = -2147483631L; Irp->IoStatus.Information = 0; - goto switch_20_break; + goto switch_18_break; } else { - } { - tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ), - 541156419UL); - Toc = (UCHAR *)tmp___0; + tmp___2 = ExAllocatePoolWithTag( + 4, sizeof(CDROM_TOC), 541156419UL); + Toc = (UCHAR *)tmp___2; } - if ((unsigned int )Toc == (unsigned int )((void *)0)) { + if ((unsigned int)Toc == + (unsigned int)((void *)0)) { status = -1073741670L; Irp->IoStatus.Information = 0; goto SetStatusAndReturn; } else { - } { - memset(Toc, 0, sizeof(CDROM_TOC )); - cdb->READ_TOC.OperationCode = 67; - cdb->READ_TOC.Msf = 1; - cdb->READ_TOC.AllocationLength[0] = sizeof(CDROM_TOC ) >> 8; - cdb->READ_TOC.AllocationLength[1] = sizeof(CDROM_TOC ) & 255U; - srb.TimeOutValue = 10; - srb.CdbLength = 10; - status = SendSrbSynchronous(deviceExtension, & srb, Toc, - sizeof(CDROM_TOC )); + memset(Toc, 0, sizeof(CDROM_TOC)); + cdb->CDB10.OperationCode = 67; + cdb->CDB10.Reserved1 = 1; + cdb->CDB10.TransferBlocksMsb = + sizeof(CDROM_TOC) >> 8; + cdb->CDB10.TransferBlocksLsb = + sizeof(CDROM_TOC) & 255U; + srb.TimeOutValue = 10; + srb.CdbLength = 10; + status = + SendSrbSynchronous(deviceExtension, &srb, Toc, + sizeof(CDROM_TOC)); } - if (! (status >= 0L)) { + if (!(status >= 0L)) { if (status != -1073741764L) { if (status != -1073741764L) { { -/* ExFreePool(Toc); */ /* INLINED */ - Irp->IoStatus.Information = 0; + /* ExFreePool(Toc); */ /* INLINED */ + Irp->IoStatus.Information = 0; } goto SetStatusAndReturn; } else { - } } else { status = 0L; @@ -6857,18 +6910,32 @@ NTSTATUS CdAudio435DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } else { status = 0L; } - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) { - bytesTransfered = sizeof(CDROM_TOC ); + if (currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength > + (ULONG)sizeof(CDROM_TOC)) { + bytesTransfered = sizeof(CDROM_TOC); } else { - bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength; + bytesTransfered = + currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength; } cdaudioDataOut->Length[0] = *(Toc + 0); cdaudioDataOut->Length[1] = *(Toc + 1); - cdaudioDataOut->FirstTrack = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15); - cdaudioDataOut->LastTrack = (((int )*(Toc + 3) & 240) >> 4) * 10 + ((int )*(Toc + 3) & 15); - tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1; - tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0])); - tracksInBuffer /= (ULONG )sizeof(TRACK_DATA ); + cdaudioDataOut->FirstTrack = + (((int)*(Toc + 2) & 240) >> 4) * 10 + + ((int)*(Toc + 2) & 15); + cdaudioDataOut->LastTrack = + (((int)*(Toc + 3) & 240) >> 4) * 10 + + ((int)*(Toc + 3) & 15); + tracksOnCd = ((int)cdaudioDataOut->LastTrack - + (int)cdaudioDataOut->FirstTrack) + + 1; + tracksInBuffer = + currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength - + (unsigned long)(( + long)(&((CDROM_TOC *)0)->TrackData[0])); + tracksInBuffer /= (ULONG)sizeof(TRACK_DATA); if (tracksInBuffer < tracksOnCd) { tracksToReturn = tracksInBuffer; } else { @@ -6876,379 +6943,921 @@ NTSTATUS CdAudio435DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } i = 0; { - while (1) { - while_21_continue: /* CIL Label */ ; - if (i < tracksToReturn) { + while (1) { + while_19_continue: /* CIL Label */; + if (i < tracksToReturn) { - } else { - goto while_21_break; + } else { + goto while_19_break; + } + cdaudioDataOut->TrackData[i].Reserved = 0; + cdaudioDataOut->TrackData[i].Control = + *(Toc + ((i * 8UL + 4UL) + 1UL)); + cdaudioDataOut->TrackData[i].TrackNumber = + (((int)*(Toc + ((i * 8UL + 4UL) + 2UL)) & + 240) >> + 4) * + 10 + + ((int)*(Toc + ((i * 8UL + 4UL) + 2UL)) & + 15); + cdaudioDataOut->TrackData[i].Reserved1 = 0; + cdaudioDataOut->TrackData[i].Address[0] = 0; + cdaudioDataOut->TrackData[i].Address[1] = + *(Toc + ((i * 8UL + 4UL) + 5UL)); + cdaudioDataOut->TrackData[i].Address[2] = + *(Toc + ((i * 8UL + 4UL) + 6UL)); + cdaudioDataOut->TrackData[i].Address[3] = + *(Toc + ((i * 8UL + 4UL) + 7UL)); + i += 1UL; } - cdaudioDataOut->TrackData[i].Reserved = 0; - cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL)); - cdaudioDataOut->TrackData[i].TrackNumber = (((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 240) >> 4) * 10 + ((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 15); - cdaudioDataOut->TrackData[i].Reserved1 = 0; - cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL)); - cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL)); - cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL)); - i += 1UL; - } - while_21_break: /* CIL Label */ ; + while_19_break: /* CIL Label */; } if (tracksInBuffer > tracksOnCd) { cdaudioDataOut->TrackData[i].Reserved = 0; - cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL)); - cdaudioDataOut->TrackData[i].TrackNumber = *(Toc + ((i * 8UL + 4UL) + 2UL)); + cdaudioDataOut->TrackData[i].Control = + *(Toc + ((i * 8UL + 4UL) + 1UL)); + cdaudioDataOut->TrackData[i].TrackNumber = + *(Toc + ((i * 8UL + 4UL) + 2UL)); cdaudioDataOut->TrackData[i].Reserved1 = 0; cdaudioDataOut->TrackData[i].Address[0] = 0; - cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL)); - cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL)); - cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL)); + cdaudioDataOut->TrackData[i].Address[1] = + *(Toc + ((i * 8UL + 4UL) + 5UL)); + cdaudioDataOut->TrackData[i].Address[2] = + *(Toc + ((i * 8UL + 4UL) + 6UL)); + cdaudioDataOut->TrackData[i].Address[3] = + *(Toc + ((i * 8UL + 4UL) + 7UL)); i += 1UL; } else { - - } - { - Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i])); - deviceExtension->Paused = 0; - deviceExtension->PausedM = 0; - deviceExtension->PausedS = 0; - deviceExtension->PausedF = 0; - deviceExtension->LastEndM = 0; - deviceExtension->LastEndS = 0; - deviceExtension->LastEndF = 0; -/* ExFreePool(Toc); */ /* INLINED */ } - goto switch_20_break; - switch_20_exp_61: /* CIL Label */ ; - switch_20_exp_62: /* CIL Label */ { - inputBuffer = Irp->AssociatedIrp.SystemBuffer; - Irp->IoStatus.Information = 0; - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->CDB10.OperationCode = 198; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); + Irp->IoStatus.Information = (unsigned long)(( + long)(&((CDROM_TOC *)0)->TrackData[i])); + /* ExFreePool(Toc); */ /* INLINED */ } - if (status >= 0L) { - deviceExtension->PlayActive = 0; - deviceExtension->Paused = 0; - deviceExtension->PausedM = 0; - deviceExtension->PausedS = 0; - deviceExtension->PausedF = 0; - deviceExtension->LastEndM = 0; - deviceExtension->LastEndS = 0; - deviceExtension->LastEndF = 0; + goto switch_18_break; + switch_18_exp_52 : /* CIL Label */ + { + userPtr = Irp->AssociatedIrp.SystemBuffer; + tmp___3 = ExAllocatePoolWithTag( + 4, sizeof(SUB_Q_CURRENT_POSITION), 541156419UL); + SubQPtr = tmp___3; + } + if (currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof(SUB_Q_CURRENT_POSITION)) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + if (SubQPtr) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + } + } else { + } + goto switch_18_break; } else { - } - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (2 << 2))) { + if ((unsigned int)SubQPtr == + (unsigned int)((void *)0)) { + { + memset(userPtr, 0, + sizeof(SUB_Q_CURRENT_POSITION)); + status = -1073741670L; + Irp->IoStatus.Information = 0; + } goto SetStatusAndReturn; } else { - } - if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) { - status = -1073741820L; - goto switch_20_break; + if ((int)((struct _CDROM_SUB_Q_DATA_FORMAT *) + userPtr) + ->Format != 1) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + memset(userPtr, 0, + sizeof(SUB_Q_CURRENT_POSITION)); + status = -1073741823L; + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; } else { - } { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->PLAY_AUDIO_MSF.OperationCode = 71; - cdb->PLAY_AUDIO_MSF.StartingM = inputBuffer->StartingM; - cdb->PLAY_AUDIO_MSF.StartingS = inputBuffer->StartingS; - cdb->PLAY_AUDIO_MSF.StartingF = inputBuffer->StartingF; - cdb->PLAY_AUDIO_MSF.EndingM = inputBuffer->EndingM; - cdb->PLAY_AUDIO_MSF.EndingS = inputBuffer->EndingS; - cdb->PLAY_AUDIO_MSF.EndingF = inputBuffer->EndingF; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->SUBCHANNEL.OperationCode = 66; + cdb->SUBCHANNEL.Msf = 1; + cdb->SUBCHANNEL.SubQ = 1; + cdb->SUBCHANNEL.Format = 1; + cdb->SUBCHANNEL.AllocationLength[1] = + sizeof(SUB_Q_CURRENT_POSITION); + status = SendSrbSynchronous( + deviceExtension, &srb, SubQPtr, + sizeof(SUB_Q_CURRENT_POSITION)); } if (status >= 0L) { - deviceExtension->PlayActive = 1; - deviceExtension->Paused = 0; - deviceExtension->LastEndM = inputBuffer->EndingM; - deviceExtension->LastEndS = inputBuffer->EndingS; - deviceExtension->LastEndF = inputBuffer->EndingF; + if ((int)*(SubQPtr + 1) == 17) { + deviceExtension->PlayActive = 1; + } else { + deviceExtension->PlayActive = 0; + } + userPtr->Header.Reserved = 0; + userPtr->Header.AudioStatus = *(SubQPtr + 1); + userPtr->Header.DataLength[0] = 0; + userPtr->Header.DataLength[1] = 12; + userPtr->FormatCode = 1; + userPtr->Control = *(SubQPtr + 5); + userPtr->ADR = 0; + userPtr->TrackNumber = + (((int)*(SubQPtr + 6) & 240) >> 4) * 10 + + ((int)*(SubQPtr + 6) & 15); + userPtr->IndexNumber = + (((int)*(SubQPtr + 7) & 240) >> 4) * 10 + + ((int)*(SubQPtr + 7) & 15); + userPtr->AbsoluteAddress[0] = 0; + userPtr->AbsoluteAddress[1] = *(SubQPtr + 9); + userPtr->AbsoluteAddress[2] = *(SubQPtr + 10); + userPtr->AbsoluteAddress[3] = *(SubQPtr + 11); + userPtr->TrackRelativeAddress[0] = 0; + userPtr->TrackRelativeAddress[1] = + *(SubQPtr + 13); + userPtr->TrackRelativeAddress[2] = + *(SubQPtr + 14); + userPtr->TrackRelativeAddress[3] = + *(SubQPtr + 15); + Irp->IoStatus.Information = + sizeof(SUB_Q_CURRENT_POSITION); } else { - + Irp->IoStatus.Information = 0; } - goto switch_20_break; - switch_20_exp_63: /* CIL Label */ - inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer; + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + } + goto switch_18_break; + switch_18_exp_53: /* CIL Label */ + inputBuffer = Irp->AssociatedIrp.SystemBuffer; Irp->IoStatus.Information = 0; - if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) { + if (currentIrpStack->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(CDROM_PLAY_AUDIO_MSF)) { status = -1073741820L; - goto switch_20_break; + goto switch_18_break; } else { - + } + if ((int)inputBuffer->StartingM == + (int)inputBuffer->EndingM) { + if ((int)inputBuffer->StartingS == + (int)inputBuffer->EndingS) { + if ((int)inputBuffer->StartingF == + (int)inputBuffer->EndingF) { + cdb->PAUSE_RESUME.OperationCode = 75; + cdb->PAUSE_RESUME.Action = 0; + } else { + goto _L___0; + } + } else { + goto _L___0; + } + } else { + _L___0: /* CIL Label */ + cdb->PLAY_AUDIO_MSF.OperationCode = 71; + cdb->PLAY_AUDIO_MSF.StartingM = + inputBuffer->StartingM; + cdb->PLAY_AUDIO_MSF.StartingS = + inputBuffer->StartingS; + cdb->PLAY_AUDIO_MSF.StartingF = + inputBuffer->StartingF; + cdb->PLAY_AUDIO_MSF.EndingM = + inputBuffer->EndingM; + cdb->PLAY_AUDIO_MSF.EndingS = + inputBuffer->EndingS; + cdb->PLAY_AUDIO_MSF.EndingF = + inputBuffer->EndingF; } { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->CDB10.OperationCode = 71; - cdb->PLAY_AUDIO_MSF.StartingM = inputBuffer___0->M; - cdb->PLAY_AUDIO_MSF.StartingS = inputBuffer___0->S; - cdb->PLAY_AUDIO_MSF.StartingF = inputBuffer___0->F; - cdb->PLAY_AUDIO_MSF.EndingM = inputBuffer___0->M; - cdb->PLAY_AUDIO_MSF.EndingS = inputBuffer___0->S; - cdb->PLAY_AUDIO_MSF.EndingF = inputBuffer___0->F; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); + srb.CdbLength = 10; + srb.TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, &srb, + (void *)0, 0); } if (status >= 0L) { - deviceExtension->Paused = 1; - deviceExtension->PausedM = inputBuffer___0->M; - deviceExtension->PausedS = inputBuffer___0->S; - deviceExtension->PausedF = inputBuffer___0->F; - deviceExtension->LastEndM = inputBuffer___0->M; - deviceExtension->LastEndS = inputBuffer___0->S; - deviceExtension->LastEndF = inputBuffer___0->F; - } else { - if (status == -1073741808L) { - status = -1073741803L; + if ((int)cdb->PLAY_AUDIO_MSF.OperationCode == + 71) { + deviceExtension->PlayActive = 1; } else { - } + } else { } - goto switch_20_break; - switch_20_exp_64: /* CIL Label */ - { - tmp___1 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ), - 541156419UL); - SubQPtr = tmp___1; + goto switch_18_break; + switch_18_exp_54: /* CIL Label */ + inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer; Irp->IoStatus.Information = 0; + if (currentIrpStack->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(CDROM_SEEK_AUDIO_MSF)) { + status = -1073741820L; + goto switch_18_break; + } else { } - if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) { - status = -1073741670L; - goto SetStatusAndReturn; + { + destblock = + (((unsigned long)inputBuffer___0->M * 60UL + + (unsigned long)inputBuffer___0->S) * + 75UL + + (unsigned long)inputBuffer___0->F) - + 150UL; + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->SEEK.OperationCode = 43; + cdb->SEEK.LogicalBlockAddress[0] = + (int)((unsigned char)(destblock >> 24)) & 255; + cdb->SEEK.LogicalBlockAddress[1] = + (int)((unsigned char)(destblock >> 16)) & 255; + cdb->SEEK.LogicalBlockAddress[2] = + (int)((unsigned char)(destblock >> 8)) & 255; + cdb->SEEK.LogicalBlockAddress[3] = + (unsigned char)(destblock & 255UL); + status = SendSrbSynchronous(deviceExtension, &srb, + (void *)0, 0); + } + if (!(status >= 0L)) { + } else { + } + goto switch_18_break; + switch_18_exp_55 : /* CIL Label */ + { + Irp->IoStatus.Information = 0; + deviceExtension->PlayActive = 0; + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->CDB10.OperationCode = 192; + status = SendSrbSynchronous(deviceExtension, &srb, + (void *)0, 0); + } + goto switch_18_break; + switch_18_exp_56: /* CIL Label */; + switch_18_exp_57: /* CIL Label */; + switch_18_exp_58: /* CIL Label */ + Irp->IoStatus.Information = 0; + status = -1073741808L; + goto switch_18_break; + switch_18_exp_59 : /* CIL Label */ + { + CdAudioIsPlayActive(DeviceObject); + } + switch_18_default : /* CIL Label */ + { + tmp___4 = + CdAudioSendToNextDriver(DeviceObject, Irp); + } + return (tmp___4); + goto switch_18_break; + } else { + switch_18_break: /* CIL Label */; + } + } + } + } + } + } + } + } + } + } + } + } + SetStatusAndReturn: + if (status == -2147483626L) { + { + /* IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } + } else { + } + { + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } +} +NTSTATUS CdAudio435DeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION currentIrpStack; + PCD_DEVICE_EXTENSION deviceExtension; + PCDROM_TOC cdaudioDataOut; + SCSI_PASS_THROUGH srb; + PCDB cdb; + NTSTATUS status; + ULONG i; + ULONG bytesTransfered; + PUCHAR Toc; + BOOLEAN tmp; + PVOID tmp___0; + ULONG tracksToReturn; + ULONG tracksOnCd; + ULONG tracksInBuffer; + PCDROM_PLAY_AUDIO_MSF inputBuffer; + PCDROM_SEEK_AUDIO_MSF inputBuffer___0; + PUCHAR SubQPtr; + PVOID tmp___1; + PSUB_Q_CURRENT_POSITION userPtr; + PUCHAR SubQPtr___0; + PVOID tmp___2; + NTSTATUS tmp___3; + BOOLEAN tmp___4; + NTSTATUS tmp___5; + + { + { + currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + deviceExtension = DeviceObject->DeviceExtension; + cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer; + cdb = (union _CDB *)(srb.Cdb); + memset(cdb, 0, 12); + } + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + ((2 << 16) | (1 << 14))) { + goto switch_20_exp_60; + } else { + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (6 << 2))) { + goto switch_20_exp_61; + } else { + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (2 << 2))) { + goto switch_20_exp_62; + } else { + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (1 << 2))) { + goto switch_20_exp_63; + } else { + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (3 << 2))) { + goto switch_20_exp_64; + } else { + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (4 << 2))) { + goto switch_20_exp_65; + } else { + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (((2 << 16) | (1 << 14)) | (11 << 2))) { + goto switch_20_exp_66; + } else { + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (514 << 2))) { + goto switch_20_exp_67; + } else { + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (13 << 2))) { + goto switch_20_exp_68; + } else { + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (5 << 2))) { + goto switch_20_exp_69; + } else { + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (10 << 2))) { + goto switch_20_exp_70; + } else { + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (((2 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_20_exp_71; + } else { + { + goto switch_20_default; + if (0) { + switch_20_exp_60: /* CIL Label */; + if (currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength < + (unsigned long)(( + long)(&((CDROM_TOC *)0) + ->TrackData[0]))) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + goto switch_20_break; + } else { + } + { tmp = CdAudioIsPlayActive(DeviceObject); } + if (tmp) { + status = -2147483631L; + Irp->IoStatus.Information = 0; + goto switch_20_break; + } else { + } + { + tmp___0 = ExAllocatePoolWithTag( + 4, sizeof(CDROM_TOC), 541156419UL); + Toc = (UCHAR *)tmp___0; + } + if ((unsigned int)Toc == + (unsigned int)((void *)0)) { + status = -1073741670L; + Irp->IoStatus.Information = 0; + goto SetStatusAndReturn; + } else { + } + { + memset(Toc, 0, sizeof(CDROM_TOC)); + cdb->READ_TOC.OperationCode = 67; + cdb->READ_TOC.Msf = 1; + cdb->READ_TOC.AllocationLength[0] = + sizeof(CDROM_TOC) >> 8; + cdb->READ_TOC.AllocationLength[1] = + sizeof(CDROM_TOC) & 255U; + srb.TimeOutValue = 10; + srb.CdbLength = 10; + status = SendSrbSynchronous( + deviceExtension, &srb, Toc, + sizeof(CDROM_TOC)); + } + if (!(status >= 0L)) { + if (status != -1073741764L) { + if (status != -1073741764L) { + { + /* ExFreePool(Toc); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; + } else { + } + } else { + status = 0L; + } + } else { + status = 0L; + } + if (currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength > + (ULONG)sizeof(CDROM_TOC)) { + bytesTransfered = sizeof(CDROM_TOC); + } else { + bytesTransfered = + currentIrpStack->Parameters + .DeviceIoControl.OutputBufferLength; + } + cdaudioDataOut->Length[0] = *(Toc + 0); + cdaudioDataOut->Length[1] = *(Toc + 1); + cdaudioDataOut->FirstTrack = + (((int)*(Toc + 2) & 240) >> 4) * 10 + + ((int)*(Toc + 2) & 15); + cdaudioDataOut->LastTrack = + (((int)*(Toc + 3) & 240) >> 4) * 10 + + ((int)*(Toc + 3) & 15); + tracksOnCd = ((int)cdaudioDataOut->LastTrack - + (int)cdaudioDataOut->FirstTrack) + + 1; + tracksInBuffer = + currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength - + (unsigned long)(( + long)(&((CDROM_TOC *)0)->TrackData[0])); + tracksInBuffer /= (ULONG)sizeof(TRACK_DATA); + if (tracksInBuffer < tracksOnCd) { + tracksToReturn = tracksInBuffer; + } else { + tracksToReturn = tracksOnCd; + } + i = 0; + { + while (1) { + while_21_continue: /* CIL Label */; + if (i < tracksToReturn) { - } - if ((int )deviceExtension->Paused == 1) { + } else { + goto while_21_break; + } + cdaudioDataOut->TrackData[i].Reserved = 0; + cdaudioDataOut->TrackData[i].Control = + *(Toc + ((i * 8UL + 4UL) + 1UL)); + cdaudioDataOut->TrackData[i].TrackNumber = + (((int)*(Toc + + ((i * 8UL + 4UL) + 2UL)) & + 240) >> + 4) * + 10 + + ((int)*(Toc + ((i * 8UL + 4UL) + 2UL)) & + 15); + cdaudioDataOut->TrackData[i].Reserved1 = 0; + cdaudioDataOut->TrackData[i].Address[0] = 0; + cdaudioDataOut->TrackData[i].Address[1] = + *(Toc + ((i * 8UL + 4UL) + 5UL)); + cdaudioDataOut->TrackData[i].Address[2] = + *(Toc + ((i * 8UL + 4UL) + 6UL)); + cdaudioDataOut->TrackData[i].Address[3] = + *(Toc + ((i * 8UL + 4UL) + 7UL)); + i += 1UL; + } + while_21_break: /* CIL Label */; + } + if (tracksInBuffer > tracksOnCd) { + cdaudioDataOut->TrackData[i].Reserved = 0; + cdaudioDataOut->TrackData[i].Control = + *(Toc + ((i * 8UL + 4UL) + 1UL)); + cdaudioDataOut->TrackData[i].TrackNumber = + *(Toc + ((i * 8UL + 4UL) + 2UL)); + cdaudioDataOut->TrackData[i].Reserved1 = 0; + cdaudioDataOut->TrackData[i].Address[0] = 0; + cdaudioDataOut->TrackData[i].Address[1] = + *(Toc + ((i * 8UL + 4UL) + 5UL)); + cdaudioDataOut->TrackData[i].Address[2] = + *(Toc + ((i * 8UL + 4UL) + 6UL)); + cdaudioDataOut->TrackData[i].Address[3] = + *(Toc + ((i * 8UL + 4UL) + 7UL)); + i += 1UL; + } else { + } + { + Irp->IoStatus.Information = (unsigned long)(( + long)(&((CDROM_TOC *)0)->TrackData[i])); + deviceExtension->Paused = 0; + deviceExtension->PausedM = 0; + deviceExtension->PausedS = 0; + deviceExtension->PausedF = 0; + deviceExtension->LastEndM = 0; + deviceExtension->LastEndS = 0; + deviceExtension->LastEndF = 0; + /* ExFreePool(Toc); */ /* INLINED */ + } + goto switch_20_break; + switch_20_exp_61: /* CIL Label */; + switch_20_exp_62 : /* CIL Label */ { -/* ExFreePool(SubQPtr); */ /* INLINED */ - status = 0L; + inputBuffer = Irp->AssociatedIrp.SystemBuffer; + Irp->IoStatus.Information = 0; + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->CDB10.OperationCode = 198; + status = SendSrbSynchronous(deviceExtension, + &srb, (void *)0, 0); } - goto SetStatusAndReturn; - } else { - - } - { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->SUBCHANNEL.OperationCode = 66; - cdb->SUBCHANNEL.Msf = 1; - cdb->SUBCHANNEL.SubQ = 1; - cdb->SUBCHANNEL.AllocationLength[1] = sizeof(SUB_Q_CHANNEL_DATA ); - status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr, - sizeof(SUB_Q_CHANNEL_DATA )); - } - if (! (status >= 0L)) { + if (status >= 0L) { + deviceExtension->PlayActive = 0; + deviceExtension->Paused = 0; + deviceExtension->PausedM = 0; + deviceExtension->PausedS = 0; + deviceExtension->PausedF = 0; + deviceExtension->LastEndM = 0; + deviceExtension->LastEndS = 0; + deviceExtension->LastEndF = 0; + } else { + } + if (currentIrpStack->Parameters.DeviceIoControl + .IoControlCode == + (ULONG)(((2 << 16) | (1 << 14)) | + (2 << 2))) { + goto SetStatusAndReturn; + } else { + } + if (currentIrpStack->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(CDROM_PLAY_AUDIO_MSF)) { + status = -1073741820L; + goto switch_20_break; + } else { + } + { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->PLAY_AUDIO_MSF.OperationCode = 71; + cdb->PLAY_AUDIO_MSF.StartingM = + inputBuffer->StartingM; + cdb->PLAY_AUDIO_MSF.StartingS = + inputBuffer->StartingS; + cdb->PLAY_AUDIO_MSF.StartingF = + inputBuffer->StartingF; + cdb->PLAY_AUDIO_MSF.EndingM = + inputBuffer->EndingM; + cdb->PLAY_AUDIO_MSF.EndingS = + inputBuffer->EndingS; + cdb->PLAY_AUDIO_MSF.EndingF = + inputBuffer->EndingF; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + if (status >= 0L) { + deviceExtension->PlayActive = 1; + deviceExtension->Paused = 0; + deviceExtension->LastEndM = + inputBuffer->EndingM; + deviceExtension->LastEndS = + inputBuffer->EndingS; + deviceExtension->LastEndF = + inputBuffer->EndingF; + } else { + } + goto switch_20_break; + switch_20_exp_63: /* CIL Label */ + inputBuffer___0 = + Irp->AssociatedIrp.SystemBuffer; + Irp->IoStatus.Information = 0; + if (currentIrpStack->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(CDROM_SEEK_AUDIO_MSF)) { + status = -1073741820L; + goto switch_20_break; + } else { + } + { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->CDB10.OperationCode = 71; + cdb->PLAY_AUDIO_MSF.StartingM = + inputBuffer___0->M; + cdb->PLAY_AUDIO_MSF.StartingS = + inputBuffer___0->S; + cdb->PLAY_AUDIO_MSF.StartingF = + inputBuffer___0->F; + cdb->PLAY_AUDIO_MSF.EndingM = + inputBuffer___0->M; + cdb->PLAY_AUDIO_MSF.EndingS = + inputBuffer___0->S; + cdb->PLAY_AUDIO_MSF.EndingF = + inputBuffer___0->F; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + if (status >= 0L) { + deviceExtension->Paused = 1; + deviceExtension->PausedM = inputBuffer___0->M; + deviceExtension->PausedS = inputBuffer___0->S; + deviceExtension->PausedF = inputBuffer___0->F; + deviceExtension->LastEndM = + inputBuffer___0->M; + deviceExtension->LastEndS = + inputBuffer___0->S; + deviceExtension->LastEndF = + inputBuffer___0->F; + } else { + if (status == -1073741808L) { + status = -1073741803L; + } else { + } + } + goto switch_20_break; + switch_20_exp_64 : /* CIL Label */ { -/* ExFreePool(SubQPtr); */ /* INLINED */ + tmp___1 = ExAllocatePoolWithTag( + 4, sizeof(SUB_Q_CHANNEL_DATA), 541156419UL); + SubQPtr = tmp___1; + Irp->IoStatus.Information = 0; } - goto SetStatusAndReturn; - } else { - - } - { - deviceExtension->PausedM = *(SubQPtr + 9); - deviceExtension->PausedS = *(SubQPtr + 10); - deviceExtension->PausedF = *(SubQPtr + 11); - memset(cdb, 0, 12); - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->CDB10.OperationCode = 198; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); - } - if (! (status >= 0L)) { + if ((unsigned int)SubQPtr == + (unsigned int)((void *)0)) { + status = -1073741670L; + goto SetStatusAndReturn; + } else { + } + if ((int)deviceExtension->Paused == 1) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + status = 0L; + } + goto SetStatusAndReturn; + } else { + } + { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->SUBCHANNEL.OperationCode = 66; + cdb->SUBCHANNEL.Msf = 1; + cdb->SUBCHANNEL.SubQ = 1; + cdb->SUBCHANNEL.AllocationLength[1] = + sizeof(SUB_Q_CHANNEL_DATA); + status = SendSrbSynchronous( + deviceExtension, &srb, SubQPtr, + sizeof(SUB_Q_CHANNEL_DATA)); + } + if (!(status >= 0L)) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + } + goto SetStatusAndReturn; + } else { + } + { + deviceExtension->PausedM = *(SubQPtr + 9); + deviceExtension->PausedS = *(SubQPtr + 10); + deviceExtension->PausedF = *(SubQPtr + 11); + memset(cdb, 0, 12); + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->CDB10.OperationCode = 198; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + if (!(status >= 0L)) { + { + /* ExFreePool(SubQPtr); */ /* INLINED */ + } + goto SetStatusAndReturn; + } else { + } + { + deviceExtension->PlayActive = 0; + deviceExtension->Paused = 1; + deviceExtension->PausedM = *(SubQPtr + 9); + deviceExtension->PausedS = *(SubQPtr + 10); + deviceExtension->PausedF = *(SubQPtr + 11); + /* ExFreePool(SubQPtr); */ /* INLINED */ + } + goto switch_20_break; + switch_20_exp_65: /* CIL Label */ + Irp->IoStatus.Information = 0; + if ((int)deviceExtension->Paused == 0) { + status = -1073741823L; + goto SetStatusAndReturn; + } else { + } + { + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->PLAY_AUDIO_MSF.OperationCode = 71; + cdb->PLAY_AUDIO_MSF.StartingM = + deviceExtension->PausedM; + cdb->PLAY_AUDIO_MSF.StartingS = + deviceExtension->PausedS; + cdb->PLAY_AUDIO_MSF.StartingF = + deviceExtension->PausedF; + cdb->PLAY_AUDIO_MSF.EndingM = + deviceExtension->LastEndM; + cdb->PLAY_AUDIO_MSF.EndingS = + deviceExtension->LastEndS; + cdb->PLAY_AUDIO_MSF.EndingF = + deviceExtension->LastEndF; + status = SendSrbSynchronous( + deviceExtension, &srb, (void *)0, 0); + } + if (status >= 0L) { + deviceExtension->PlayActive = 1; + deviceExtension->Paused = 0; + } else { + } + goto switch_20_break; + switch_20_exp_66 : /* CIL Label */ { -/* ExFreePool(SubQPtr); */ /* INLINED */ - } - goto SetStatusAndReturn; - } else { - - } - { - deviceExtension->PlayActive = 0; - deviceExtension->Paused = 1; - deviceExtension->PausedM = *(SubQPtr + 9); - deviceExtension->PausedS = *(SubQPtr + 10); - deviceExtension->PausedF = *(SubQPtr + 11); -/* ExFreePool(SubQPtr); */ /* INLINED */ - } - goto switch_20_break; - switch_20_exp_65: /* CIL Label */ - Irp->IoStatus.Information = 0; - if ((int )deviceExtension->Paused == 0) { - status = -1073741823L; - goto SetStatusAndReturn; - } else { - - } - { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->PLAY_AUDIO_MSF.OperationCode = 71; - cdb->PLAY_AUDIO_MSF.StartingM = deviceExtension->PausedM; - cdb->PLAY_AUDIO_MSF.StartingS = deviceExtension->PausedS; - cdb->PLAY_AUDIO_MSF.StartingF = deviceExtension->PausedF; - cdb->PLAY_AUDIO_MSF.EndingM = deviceExtension->LastEndM; - cdb->PLAY_AUDIO_MSF.EndingS = deviceExtension->LastEndS; - cdb->PLAY_AUDIO_MSF.EndingF = deviceExtension->LastEndF; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); - } - if (status >= 0L) { - deviceExtension->PlayActive = 1; - deviceExtension->Paused = 0; - } else { - - } - goto switch_20_break; - switch_20_exp_66: /* CIL Label */ - { - userPtr = Irp->AssociatedIrp.SystemBuffer; - tmp___2 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ), - 541156419UL); - SubQPtr___0 = tmp___2; - } - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - if (SubQPtr___0) { + userPtr = Irp->AssociatedIrp.SystemBuffer; + tmp___2 = ExAllocatePoolWithTag( + 4, sizeof(SUB_Q_CHANNEL_DATA), 541156419UL); + SubQPtr___0 = tmp___2; + } + if (currentIrpStack->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof(SUB_Q_CURRENT_POSITION)) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + if (SubQPtr___0) { + { + /* ExFreePool(SubQPtr___0); */ /* INLINED */ + } + } else { + } + goto switch_20_break; + } else { + } + if ((unsigned int)SubQPtr___0 == + (unsigned int)((void *)0)) { + { + memset(userPtr, 0, + sizeof(SUB_Q_CURRENT_POSITION)); + status = -1073741670L; + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; + } else { + } + if ((int)((struct _CDROM_SUB_Q_DATA_FORMAT *) + userPtr) + ->Format != 1) { + { + /* ExFreePool(SubQPtr___0); */ /* INLINED */ + memset(userPtr, 0, + sizeof(SUB_Q_CURRENT_POSITION)); + status = -1073741823L; + Irp->IoStatus.Information = 0; + } + goto SetStatusAndReturn; + } else { + } { -/* ExFreePool(SubQPtr___0); */ /* INLINED */ + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->SUBCHANNEL.OperationCode = 66; + cdb->SUBCHANNEL.Msf = 1; + cdb->SUBCHANNEL.SubQ = 1; + cdb->SUBCHANNEL.AllocationLength[1] = + sizeof(SUB_Q_CHANNEL_DATA); + status = SendSrbSynchronous( + deviceExtension, &srb, SubQPtr___0, + sizeof(SUB_Q_CHANNEL_DATA)); } - } else { - - } - goto switch_20_break; - } else { - - } - if ((unsigned int )SubQPtr___0 == (unsigned int )((void *)0)) { + if (status >= 0L) { + userPtr->Header.Reserved = 0; + if ((int)deviceExtension->Paused == 1) { + deviceExtension->PlayActive = 0; + userPtr->Header.AudioStatus = 18; + } else { + if ((int)*(SubQPtr___0 + 1) == 17) { + deviceExtension->PlayActive = 1; + userPtr->Header.AudioStatus = 17; + } else { + deviceExtension->PlayActive = 0; + userPtr->Header.AudioStatus = 19; + } + } + userPtr->Header.DataLength[0] = 0; + userPtr->Header.DataLength[1] = 12; + userPtr->FormatCode = 1; + userPtr->Control = *(SubQPtr___0 + 5); + userPtr->ADR = 0; + userPtr->TrackNumber = + (((int)*(SubQPtr___0 + 6) & 240) >> 4) * + 10 + + ((int)*(SubQPtr___0 + 6) & 15); + userPtr->IndexNumber = + (((int)*(SubQPtr___0 + 7) & 240) >> 4) * + 10 + + ((int)*(SubQPtr___0 + 7) & 15); + userPtr->AbsoluteAddress[0] = 0; + userPtr->AbsoluteAddress[1] = + *(SubQPtr___0 + 9); + userPtr->AbsoluteAddress[2] = + *(SubQPtr___0 + 10); + userPtr->AbsoluteAddress[3] = + *(SubQPtr___0 + 11); + userPtr->TrackRelativeAddress[0] = 0; + userPtr->TrackRelativeAddress[1] = + *(SubQPtr___0 + 13); + userPtr->TrackRelativeAddress[2] = + *(SubQPtr___0 + 14); + userPtr->TrackRelativeAddress[3] = + *(SubQPtr___0 + 15); + Irp->IoStatus.Information = + sizeof(SUB_Q_CURRENT_POSITION); + } else { + Irp->IoStatus.Information = 0; + } + { + /* ExFreePool(SubQPtr___0); */ /* INLINED */ + } + goto switch_20_break; + switch_20_exp_67 : /* CIL Label */ { - memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION )); - status = -1073741670L; - Irp->IoStatus.Information = 0; + Irp->IoStatus.Information = 0; + srb.CdbLength = 10; + srb.TimeOutValue = 10; + cdb->CDB10.OperationCode = 192; + status = SendSrbSynchronous(deviceExtension, + &srb, (void *)0, 0); + deviceExtension->Paused = 0; + deviceExtension->PausedM = 0; + deviceExtension->PausedS = 0; + deviceExtension->PausedF = 0; + deviceExtension->LastEndM = 0; + deviceExtension->LastEndS = 0; + deviceExtension->LastEndF = 0; } - goto SetStatusAndReturn; - } else { - - } - if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) { + goto switch_20_break; + switch_20_exp_68: /* CIL Label */; + switch_20_exp_69: /* CIL Label */; + switch_20_exp_70: /* CIL Label */ + Irp->IoStatus.Information = 0; + status = -1073741808L; + goto switch_20_break; + switch_20_exp_71 : /* CIL Label */ { -/* ExFreePool(SubQPtr___0); */ /* INLINED */ - memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION )); - status = -1073741823L; - Irp->IoStatus.Information = 0; + tmp___4 = CdAudioIsPlayActive(DeviceObject); } - goto SetStatusAndReturn; - } else { - - } - { - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->SUBCHANNEL.OperationCode = 66; - cdb->SUBCHANNEL.Msf = 1; - cdb->SUBCHANNEL.SubQ = 1; - cdb->SUBCHANNEL.AllocationLength[1] = sizeof(SUB_Q_CHANNEL_DATA ); - status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr___0, - sizeof(SUB_Q_CHANNEL_DATA )); - } - if (status >= 0L) { - userPtr->Header.Reserved = 0; - if ((int )deviceExtension->Paused == 1) { - deviceExtension->PlayActive = 0; - userPtr->Header.AudioStatus = 18; - } else { - if ((int )*(SubQPtr___0 + 1) == 17) { + if ((int)tmp___4 == 1) { deviceExtension->PlayActive = 1; - userPtr->Header.AudioStatus = 17; + status = 0L; + Irp->IoStatus.Information = 0; + goto SetStatusAndReturn; } else { - deviceExtension->PlayActive = 0; - userPtr->Header.AudioStatus = 19; + { + deviceExtension->PlayActive = 0; + tmp___3 = CdAudioSendToNextDriver( + DeviceObject, Irp); + } + return (tmp___3); } - } - userPtr->Header.DataLength[0] = 0; - userPtr->Header.DataLength[1] = 12; - userPtr->FormatCode = 1; - userPtr->Control = *(SubQPtr___0 + 5); - userPtr->ADR = 0; - userPtr->TrackNumber = (((int )*(SubQPtr___0 + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 6) & 15); - userPtr->IndexNumber = (((int )*(SubQPtr___0 + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 7) & 15); - userPtr->AbsoluteAddress[0] = 0; - userPtr->AbsoluteAddress[1] = *(SubQPtr___0 + 9); - userPtr->AbsoluteAddress[2] = *(SubQPtr___0 + 10); - userPtr->AbsoluteAddress[3] = *(SubQPtr___0 + 11); - userPtr->TrackRelativeAddress[0] = 0; - userPtr->TrackRelativeAddress[1] = *(SubQPtr___0 + 13); - userPtr->TrackRelativeAddress[2] = *(SubQPtr___0 + 14); - userPtr->TrackRelativeAddress[3] = *(SubQPtr___0 + 15); - Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION ); - } else { - Irp->IoStatus.Information = 0; - } - { -/* ExFreePool(SubQPtr___0); */ /* INLINED */ - } - goto switch_20_break; - switch_20_exp_67: /* CIL Label */ - { - Irp->IoStatus.Information = 0; - srb.CdbLength = 10; - srb.TimeOutValue = 10; - cdb->CDB10.OperationCode = 192; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, - 0); - deviceExtension->Paused = 0; - deviceExtension->PausedM = 0; - deviceExtension->PausedS = 0; - deviceExtension->PausedF = 0; - deviceExtension->LastEndM = 0; - deviceExtension->LastEndS = 0; - deviceExtension->LastEndF = 0; - } - goto switch_20_break; - switch_20_exp_68: /* CIL Label */ ; - switch_20_exp_69: /* CIL Label */ ; - switch_20_exp_70: /* CIL Label */ - Irp->IoStatus.Information = 0; - status = -1073741808L; - goto switch_20_break; - switch_20_exp_71: /* CIL Label */ - { - tmp___4 = CdAudioIsPlayActive(DeviceObject); - } - if ((int )tmp___4 == 1) { - deviceExtension->PlayActive = 1; - status = 0L; - Irp->IoStatus.Information = 0; - goto SetStatusAndReturn; - } else { + goto switch_20_break; + switch_20_default : /* CIL Label */ { - deviceExtension->PlayActive = 0; - tmp___3 = CdAudioSendToNextDriver(DeviceObject, Irp); + tmp___5 = + CdAudioSendToNextDriver(DeviceObject, Irp); + } + return (tmp___5); + goto switch_20_break; + } else { + switch_20_break: /* CIL Label */; } - return (tmp___3); - } - goto switch_20_break; - switch_20_default: /* CIL Label */ - { - tmp___5 = CdAudioSendToNextDriver(DeviceObject, Irp); } - return (tmp___5); - goto switch_20_break; - } else { - switch_20_break: /* CIL Label */ ; - } } } } @@ -7261,315 +7870,286 @@ NTSTATUS CdAudio435DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } - } - SetStatusAndReturn: - if (status == -2147483626L) { + SetStatusAndReturn: + if (status == -2147483626L) { + { + /* IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */ + Irp->IoStatus.Information = 0; + } + } else { + } { -/* IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */ - Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); } - } else { - - } - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + return (status); } - return (status); } -} -NTSTATUS CdAudioAtapiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ NTSTATUS status ; - PCD_DEVICE_EXTENSION deviceExtension ; - PIO_STACK_LOCATION currentIrpStack ; - SCSI_PASS_THROUGH srb ; - PHITACHICDB cdb ; - NTSTATUS tmp ; +NTSTATUS CdAudioAtapiDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + NTSTATUS status; + PCD_DEVICE_EXTENSION deviceExtension; + PIO_STACK_LOCATION currentIrpStack; + SCSI_PASS_THROUGH srb; + PHITACHICDB cdb; + NTSTATUS tmp; { - deviceExtension = DeviceObject->DeviceExtension; - currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - cdb = (union _HITACHICDB *)(srb.Cdb); - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (2 << 2))) { - { - Irp->IoStatus.Information = 0; - deviceExtension->PlayActive = 0; - memset(& srb, 0, sizeof(SCSI_PASS_THROUGH )); - cdb->STOP_PLAY.OperationCode = 78; - srb.CdbLength = 12; - srb.TimeOutValue = 10; - status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, 0); - } - if (! (status >= 0L)) { + deviceExtension = DeviceObject->DeviceExtension; + currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + cdb = (union _HITACHICDB *)(srb.Cdb); + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (ULONG)(((2 << 16) | (1 << 14)) | (2 << 2))) { { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + Irp->IoStatus.Information = 0; + deviceExtension->PlayActive = 0; + memset(&srb, 0, sizeof(SCSI_PASS_THROUGH)); + cdb->STOP_PLAY.OperationCode = 78; + srb.CdbLength = 12; + srb.TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, &srb, (void *)0, 0); + } + if (!(status >= 0L)) { + { + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } else { } - return (status); } else { - + { tmp = CdAudioSendToNextDriver(DeviceObject, Irp); } + return (tmp); } - } else { { - tmp = CdAudioSendToNextDriver(DeviceObject, Irp); + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); } - return (tmp); - } - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + return (status); } - return (status); } -} -void HpCdrProcessLastSession(PCDROM_TOC Toc ) -{ ULONG index ; +void HpCdrProcessLastSession(PCDROM_TOC Toc) { + ULONG index; { - index = Toc->FirstTrack; - if (index) { - index -= 1UL; - Toc->FirstTrack = Toc->TrackData[0].Reserved; - Toc->LastTrack = Toc->TrackData[index].Reserved; - Toc->TrackData[0] = Toc->TrackData[index]; - } else { - Toc->LastTrack = 0; - Toc->FirstTrack = Toc->LastTrack; + index = Toc->FirstTrack; + if (index) { + index -= 1UL; + Toc->FirstTrack = Toc->TrackData[0].Reserved; + Toc->LastTrack = Toc->TrackData[index].Reserved; + Toc->TrackData[0] = Toc->TrackData[index]; + } else { + Toc->LastTrack = 0; + Toc->FirstTrack = Toc->LastTrack; + } + return; } - return; -} } -NTSTATUS HPCdrCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) -{ +NTSTATUS HPCdrCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context) { { - if (myIrp_PendingReturned) { - if (pended == 0) { - pended = 1; + if (myIrp_PendingReturned) { + if (pended == 0) { + pended = 1; + } else { + { errorFn(); } + } + (Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation) + ->Control = (int)(Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation) + ->Control | + 1; } else { + } + if ((long)myStatus >= 0L) { { - errorFn(); + HpCdrProcessLastSession( + (struct _CDROM_TOC *)Irp->AssociatedIrp.SystemBuffer); } + } else { } - (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1; - } else { - + return (myStatus); } - if ((long )myStatus >= 0L) { - { - HpCdrProcessLastSession((struct _CDROM_TOC *)Irp->AssociatedIrp.SystemBuffer); - } - } else { +} +NTSTATUS CdAudioHPCdrDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION currentIrpStack; + PIO_STACK_LOCATION nextIrpStack; + PCD_DEVICE_EXTENSION deviceExtension; + PIO_STACK_LOCATION irpSp; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___0; + NTSTATUS tmp; + NTSTATUS tmp___0; + { + currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + nextIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + deviceExtension = DeviceObject->DeviceExtension; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (ULONG)(((2 << 16) | (1 << 14)) | (14 << 2))) { + { + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + memcpy(nextIrpSp, irpSp, + (long)(&((IO_STACK_LOCATION *)0)->CompletionRoutine)); + nextIrpSp->Control = 0; + } + if (s != NP) { + { errorFn(); } + } else { + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + routine = 0; + compFptr = &HPCdrCompletion; + } + } + { + irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpSp___0->CompletionRoutine = &HPCdrCompletion; + irpSp___0->Context = deviceExtension; + irpSp___0->Control = 0; + irpSp___0->Control = 64; + irpSp___0->Control = (int)irpSp___0->Control | 128; + irpSp___0->Control = (int)irpSp___0->Control | 32; + tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); + } + return (tmp); + } else { + { tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); } + return (tmp___0); + } + return (-1073741823L); } - return (myStatus); -} } -NTSTATUS CdAudioHPCdrDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION currentIrpStack ; - PIO_STACK_LOCATION nextIrpStack ; - PCD_DEVICE_EXTENSION deviceExtension ; - PIO_STACK_LOCATION irpSp ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___0 ; - NTSTATUS tmp ; - NTSTATUS tmp___0 ; +NTSTATUS CdAudioForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PCD_DEVICE_EXTENSION deviceExtension; + KEVENT event; + NTSTATUS status; + PIO_STACK_LOCATION irpSp; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___0; { - currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - deviceExtension = DeviceObject->DeviceExtension; - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (14 << 2))) { { - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine)); - nextIrpSp->Control = 0; + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + deviceExtension = + (struct _CD_DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + memcpy(nextIrpSp, irpSp, + (long)(&((IO_STACK_LOCATION *)0)->CompletionRoutine)); + nextIrpSp->Control = 0; } if (s != NP) { - { - errorFn(); - } + { errorFn(); } } else { if (compRegistered != 0) { - { - errorFn(); - } + { errorFn(); } } else { compRegistered = 1; - routine = 0; - compFptr = & HPCdrCompletion; + routine = 1; + compFptr = &CdAudioSignalCompletion; } } { - irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp___0->CompletionRoutine = & HPCdrCompletion; - irpSp___0->Context = deviceExtension; - irpSp___0->Control = 0; - irpSp___0->Control = 64; - irpSp___0->Control = (int )irpSp___0->Control | 128; - irpSp___0->Control = (int )irpSp___0->Control | 32; - tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); - } - return (tmp); - } else { - { - tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); - } - return (tmp___0); - } - return (-1073741823L); -} -} -NTSTATUS CdAudioForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PCD_DEVICE_EXTENSION deviceExtension ; - KEVENT event ; - NTSTATUS status ; - PIO_STACK_LOCATION irpSp ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___0 ; - - { - { -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - deviceExtension = (struct _CD_DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine)); - nextIrpSp->Control = 0; - } - if (s != NP) { - { - errorFn(); + irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpSp___0->CompletionRoutine = &CdAudioSignalCompletion; + irpSp___0->Context = &event; + irpSp___0->Control = 0; + irpSp___0->Control = 64; + irpSp___0->Control = (int)irpSp___0->Control | 128; + irpSp___0->Control = (int)irpSp___0->Control | 32; + status = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); + status = 259L; } - } else { - if (compRegistered != 0) { + if (status) { { - errorFn(); + KeWaitForSingleObject(&event, 0, 0, 0, (void *)0); + status = Irp->IoStatus.__annonCompField4.Status; + status = myStatus; } } else { - compRegistered = 1; - routine = 1; - compFptr = & CdAudioSignalCompletion; - } - } - { - irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp___0->CompletionRoutine = & CdAudioSignalCompletion; - irpSp___0->Context = & event; - irpSp___0->Control = 0; - irpSp___0->Control = 64; - irpSp___0->Control = (int )irpSp___0->Control | 128; - irpSp___0->Control = (int )irpSp___0->Control | 32; - status = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); - status = 259L; - } - if (status) { - { - KeWaitForSingleObject(& event, 0, 0, 0, (void *)0); - status = Irp->IoStatus.__annonCompField4.Status; - status = myStatus; } - } else { - + return (status); } - return (status); -} } -void CdAudioUnload(PDRIVER_OBJECT DriverObject ) -{ +void CdAudioUnload(PDRIVER_OBJECT DriverObject) { - { - return; -} + { return; } } -NTSTATUS CdAudioPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PCD_DEVICE_EXTENSION deviceExtension ; - NTSTATUS tmp ; +NTSTATUS CdAudioPower(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PCD_DEVICE_EXTENSION deviceExtension; + NTSTATUS tmp; { - { -/* PoStartNextPowerIrp(Irp); */ /* INLINED */ - } - if (s == NP) { - s = SKIP1; - } else { + { /* PoStartNextPowerIrp(Irp); */ /* INLINED */ + } + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } { - errorFn(); + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + deviceExtension = + (struct _CD_DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + tmp = PoCallDriver(deviceExtension->TargetDeviceObject, Irp); } + return (tmp); } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - deviceExtension = (struct _CD_DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - tmp = PoCallDriver(deviceExtension->TargetDeviceObject, Irp); - } - return (tmp); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) -IRP *pirp ; -void stub_driver_init(void) -{ - - { - s = NP; - customIrp = 0; - setEventCalled = customIrp; - lowerDriverReturn = setEventCalled; - compRegistered = lowerDriverReturn; - compFptr = compRegistered; - pended = compFptr; - return; -} -} -int main(void) -{ DRIVER_OBJECT d ; - NTSTATUS status = __VERIFIER_nondet_long() ; - IRP irp ; - int we_should_unload = __VERIFIER_nondet_int() ; - int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - int irp_choice = __VERIFIER_nondet_int() ; - DEVICE_OBJECT devobj ; - devobj.DeviceExtension = malloc(sizeof (CD_DEVICE_EXTENSION)); - irp.Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation = malloc(sizeof (IO_STACK_LOCATION)); - irp.AssociatedIrp.SystemBuffer = malloc(sizeof (CDROM_TOC)); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +IRP *pirp; +void stub_driver_init(void) { { - { - pirp = & irp; - _BLAST_init(); - } - if (status >= 0L) { s = NP; customIrp = 0; setEventCalled = customIrp; @@ -7577,128 +8157,140 @@ int main(void) compRegistered = lowerDriverReturn; compFptr = compRegistered; pended = compFptr; - pirp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (irp_choice == 0) { - pirp->IoStatus.__annonCompField4.Status = -1073741637L; - myStatus = -1073741637L; - } else { + return; + } +} +int main(void) { + DRIVER_OBJECT d; + NTSTATUS status = __VERIFIER_nondet_long(); + IRP irp; + int we_should_unload = __VERIFIER_nondet_int(); + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + int irp_choice = __VERIFIER_nondet_int(); + DEVICE_OBJECT devobj; + devobj.DeviceExtension = malloc(sizeof(CD_DEVICE_EXTENSION)); + irp.Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation = + malloc(sizeof(IO_STACK_LOCATION)); + irp.AssociatedIrp.SystemBuffer = malloc(sizeof(CDROM_TOC)); - } + { { - stub_driver_init(); - } - if (! (status >= 0L)) { - return (-1); - } else { - + pirp = &irp; + _BLAST_init(); } - if (__BLAST_NONDET___0 == 2) { - goto switch_22_2; - } else { - if (__BLAST_NONDET___0 == 3) { - goto switch_22_3; + if (status >= 0L) { + s = NP; + customIrp = 0; + setEventCalled = customIrp; + lowerDriverReturn = setEventCalled; + compRegistered = lowerDriverReturn; + compFptr = compRegistered; + pended = compFptr; + pirp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (irp_choice == 0) { + pirp->IoStatus.__annonCompField4.Status = -1073741637L; + myStatus = -1073741637L; + } else { + } + { stub_driver_init(); } + if (!(status >= 0L)) { + return (-1); + } else { + } + if (__BLAST_NONDET___0 == 2) { + goto switch_22_2; } else { - if (__BLAST_NONDET___0 == 4) { - goto switch_22_4; + if (__BLAST_NONDET___0 == 3) { + goto switch_22_3; } else { - { - goto switch_22_default; - if (0) { - switch_22_2: /* CIL Label */ - { - status = CdAudioDeviceControl(& devobj, pirp); - } - goto switch_22_break; - switch_22_3: /* CIL Label */ - { - status = CdAudioPnp(& devobj, pirp); - } - goto switch_22_break; - switch_22_4: /* CIL Label */ + if (__BLAST_NONDET___0 == 4) { + goto switch_22_4; + } else { { - status = CdAudioPower(& devobj, pirp); + goto switch_22_default; + if (0) { + switch_22_2 : /* CIL Label */ + { + status = CdAudioDeviceControl(&devobj, pirp); + } + goto switch_22_break; + switch_22_3 : /* CIL Label */ + { + status = CdAudioPnp(&devobj, pirp); + } + goto switch_22_break; + switch_22_4 : /* CIL Label */ + { + status = CdAudioPower(&devobj, pirp); + } + goto switch_22_break; + switch_22_default: /* CIL Label */; + return (-1); + } else { + switch_22_break: /* CIL Label */; + } } - goto switch_22_break; - switch_22_default: /* CIL Label */ ; - return (-1); - } else { - switch_22_break: /* CIL Label */ ; - } } } } - } - if (we_should_unload) { - { -/* CdAudioUnload(& d); */ /* INLINED */ + if (we_should_unload) { + { /* CdAudioUnload(& d); */ /* INLINED */ + } + } else { } } else { - - } - } else { - - } - if (pended == 1) { - if (s == NP) { - s = NP; - } else { - goto _L___2; } - } else { - _L___2: /* CIL Label */ if (pended == 1) { - if (s == MPR3) { - s = MPR3; + if (s == NP) { + s = NP; } else { - goto _L___1; + goto _L___2; } } else { - _L___1: /* CIL Label */ - if (s == UNLOADED) { - + _L___2: /* CIL Label */ + if (pended == 1) { + if (s == MPR3) { + s = MPR3; + } else { + goto _L___1; + } } else { - if (status == -1L) { + _L___1: /* CIL Label */ + if (s == UNLOADED) { } else { - if (s != SKIP2) { - if (s != IPC) { - if (s != DC) { - { - errorFn(); - } - } else { - goto _L___0; - } - } else { - goto _L___0; - } + if (status == -1L) { + } else { - _L___0: /* CIL Label */ - if (pended == 1) { - if (status != 259L) { - { - errorFn(); + if (s != SKIP2) { + if (s != IPC) { + if (s != DC) { + { errorFn(); } + } else { + goto _L___0; } } else { - + goto _L___0; } } else { - if (s == DC) { - if (status == 259L) { - { - errorFn(); - } + _L___0: /* CIL Label */ + if (pended == 1) { + if (status != 259L) { + { errorFn(); } } else { - } } else { - if (status != (NTSTATUS )lowerDriverReturn) { - { - errorFn(); + if (s == DC) { + if (status == 259L) { + { errorFn(); } + } else { } } else { - + if (status != (NTSTATUS)lowerDriverReturn) { + { errorFn(); } + } else { + } } } } @@ -7706,1127 +8298,993 @@ int main(void) } } } + return (status); } - return (status); } -} -char _SLAM_alloc_dummy ; -//extern int ( /* missing proto */ malloc)() ; -char *nondet_malloc(int i ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - int tmp ; +char *nondet_malloc(int i) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + int tmp; { - if (__BLAST_NONDET___0) { - return ((char *)0); - } else { - { - tmp = malloc(i); + if (__BLAST_NONDET___0) { + return ((char *)0); + } else { + { tmp = malloc(i); } + return ((char *)tmp); } - return ((char *)tmp); } } -} - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; -void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) -{ +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; -void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) -{ +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; -PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , SIZE_T NumberOfBytes , - ULONG Tag ) -{ PVOID x ; - char *tmp ; +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag) { + PVOID x; + char *tmp; { - { - tmp = nondet_malloc(NumberOfBytes); - x = tmp; + { + tmp = nondet_malloc(NumberOfBytes); + x = tmp; + } + return (x); } - return (x); -} } - void ExFreePool(PVOID P ) ; -void ExFreePool(PVOID P ) -{ +void ExFreePool(PVOID P); +void ExFreePool(PVOID P) { - { - return; -} + { return; } } - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; -PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , BOOLEAN SecondaryBuffer , - BOOLEAN ChargeQuota , PIRP Irp ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - char *tmp ; +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET___0 == 0) { - goto switch_23_0; - } else { - { - goto switch_23_default; - if (0) { - switch_23_0: /* CIL Label */ + if (__BLAST_NONDET___0 == 0) { + goto switch_23_0; + } else { { - tmp = nondet_malloc(sizeof(MDL )); + goto switch_23_default; + if (0) { + switch_23_0 : /* CIL Label */ + { + tmp = nondet_malloc(sizeof(MDL)); + } + return ((void *)tmp); + switch_23_default: /* CIL Label */; + return ((void *)0); + } else { + switch_23_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_23_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_23_break: /* CIL Label */ ; - } } } } -} - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; -PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , PDEVICE_OBJECT TargetDevice ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_24_0; - } else { - { - goto switch_24_default; - if (0) { - switch_24_0: /* CIL Label */ ; - return (TargetDevice); - switch_24_default: /* CIL Label */ ; - return ((void *)0); + if (__BLAST_NONDET___0 == 0) { + goto switch_24_0; } else { - switch_24_break: /* CIL Label */ ; - } + { + goto switch_24_default; + if (0) { + switch_24_0: /* CIL Label */; + return (TargetDevice); + switch_24_default: /* CIL Label */; + return ((void *)0); + } else { + switch_24_break: /* CIL Label */; + } + } } } } -} - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , PDEVICE_OBJECT DeviceObject , - PVOID Buffer , ULONG Length , PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - int tmp ; +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + int tmp; { - customIrp = 1; - if (__BLAST_NONDET___0 == 0) { - goto switch_25_0; - } else { - { - goto switch_25_default; - if (0) { - switch_25_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET___0 == 0) { + goto switch_25_0; + } else { { - tmp = malloc(sizeof(IRP )); + goto switch_25_default; + if (0) { + switch_25_0 : /* CIL Label */ + { + tmp = malloc(sizeof(IRP)); + } + return ((void *)tmp); + switch_25_default: /* CIL Label */; + return ((void *)0); + } else { + switch_25_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_25_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_25_break: /* CIL Label */ ; - } } } } -} - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , BOOLEAN InternalDeviceIoControl , - PKEVENT Event , PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - int tmp ; +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + int tmp; { - customIrp = 1; - if (__BLAST_NONDET___0 == 0) { - goto switch_26_0; - } else { - { - goto switch_26_default; - if (0) { - switch_26_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET___0 == 0) { + goto switch_26_0; + } else { { - tmp = malloc(sizeof(IRP )); + goto switch_26_default; + if (0) { + switch_26_0 : /* CIL Label */ + { + tmp = malloc(sizeof(IRP)); + } + return ((void *)tmp); + switch_26_default: /* CIL Label */; + return ((void *)0); + } else { + switch_26_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_26_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_26_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; -NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - int tmp ; +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + int tmp; { - if (__BLAST_NONDET___0 == 0) { - goto switch_27_0; - } else { - { - goto switch_27_default; - if (0) { - switch_27_0: /* CIL Label */ + if (__BLAST_NONDET___0 == 0) { + goto switch_27_0; + } else { { - tmp = malloc(sizeof(DEVICE_OBJECT )); - *DeviceObject = (void *)tmp; + goto switch_27_default; + if (0) { + switch_27_0 : /* CIL Label */ + { + tmp = malloc(sizeof(DEVICE_OBJECT)); + *DeviceObject = (void *)tmp; + } + return (0L); + switch_27_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_27_break: /* CIL Label */; + } } - return (0L); - switch_27_default: /* CIL Label */ ; - return (-1073741823L); - } else { - switch_27_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; -NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , PUNICODE_STRING DeviceName ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_28_0; - } else { - { - goto switch_28_default; - if (0) { - switch_28_0: /* CIL Label */ ; - return (0L); - switch_28_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_28_0; } else { - switch_28_break: /* CIL Label */ ; - } + { + goto switch_28_default; + if (0) { + switch_28_0: /* CIL Label */; + return (0L); + switch_28_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_28_break: /* CIL Label */; + } + } } } } -} - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; -void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) -{ +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject) { - { - return; -} + { return; } } - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_29_0; - } else { - { - goto switch_29_default; - if (0) { - switch_29_0: /* CIL Label */ ; - return (0L); - switch_29_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_29_0; } else { - switch_29_break: /* CIL Label */ ; - } + { + goto switch_29_default; + if (0) { + switch_29_0: /* CIL Label */; + return (0L); + switch_29_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_29_break: /* CIL Label */; + } + } } } } -} - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; -void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) -{ +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice) { - { - return; -} + { return; } } - void IoFreeIrp(PIRP Irp ) ; -void IoFreeIrp(PIRP Irp ) -{ +void IoFreeIrp(PIRP Irp); +void IoFreeIrp(PIRP Irp) { - { - return; -} + { return; } } - void IoFreeMdl(PMDL Mdl ) ; -void IoFreeMdl(PMDL Mdl ) -{ +void IoFreeMdl(PMDL Mdl); +void IoFreeMdl(PMDL Mdl) { - { - return; -} + { return; } } - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; -PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) -{ char *tmp ; +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) { + char *tmp; { - { - tmp = nondet_malloc(sizeof(CONFIGURATION_INFORMATION )); + { tmp = nondet_malloc(sizeof(CONFIGURATION_INFORMATION)); } + return ((void *)tmp); } - return ((void *)tmp); -} } - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; -NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , PULONG BusNumber , PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_30_0; - } else { - { - goto switch_30_default; - if (0) { - switch_30_0: /* CIL Label */ ; - return (0L); - switch_30_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_30_0; } else { - switch_30_break: /* CIL Label */ ; - } + { + goto switch_30_default; + if (0) { + switch_30_0: /* CIL Label */; + return (0L); + switch_30_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_30_break: /* CIL Label */; + } + } } } } -} - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_31_0; - } else { - { - goto switch_31_default; - if (0) { - switch_31_0: /* CIL Label */ ; - return (0L); - switch_31_default: /* CIL Label */ ; - return (-1073741808L); + if (__BLAST_NONDET___0 == 0) { + goto switch_31_0; } else { - switch_31_break: /* CIL Label */ ; - } + { + goto switch_31_default; + if (0) { + switch_31_0: /* CIL Label */; + return (0L); + switch_31_default: /* CIL Label */; + return (-1073741808L); + } else { + switch_31_break: /* CIL Label */; + } + } } } } -} - void IoReleaseCancelSpinLock(KIRQL Irql ) ; -void IoReleaseCancelSpinLock(KIRQL Irql ) -{ +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoReleaseCancelSpinLock(KIRQL Irql) { - { - return; -} + { return; } } - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , BOOLEAN Enable ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_32_0; - } else { - { - goto switch_32_default; - if (0) { - switch_32_0: /* CIL Label */ ; - return (0L); - switch_32_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_32_0; } else { - switch_32_break: /* CIL Label */ ; - } + { + goto switch_32_default; + if (0) { + switch_32_0: /* CIL Label */; + return (0L); + switch_32_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_32_break: /* CIL Label */; + } + } } } } -} - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; -void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) -{ +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject) { - { - return; -} + { return; } } -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { - if (s == NP) { - s = MPR1; - } else { - { - errorFn(); + if (s == NP) { + s = MPR1; + } else { + { errorFn(); } } + return; } - return; -} } - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - NTSTATUS returnVal2 ; - int compRetStatus ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; - NTSTATUS tmp___0 ; +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + NTSTATUS returnVal2; + int compRetStatus; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; + NTSTATUS tmp___0; { - if (compRegistered) { - if (routine == 0) { - { - tmp = HPCdrCompletion(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - } else { - if (routine == 1) { + if (compRegistered) { + if (routine == 0) { { - tmp___0 = CdAudioSignalCompletion(DeviceObject, Irp, lcontext); - compRetStatus = tmp___0; + tmp = HPCdrCompletion(DeviceObject, Irp, lcontext); + compRetStatus = tmp; } } else { - + if (routine == 1) { + { + tmp___0 = CdAudioSignalCompletion(DeviceObject, Irp, lcontext); + compRetStatus = tmp___0; + } + } else { + } } - } - if ((long )compRetStatus == -1073741802L) { - { - stubMoreProcessingRequired(); + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (myIrp_PendingReturned) { - returnVal2 = 259L; - } else { - if (__BLAST_NONDET___0 == 0) { - goto switch_33_0; + if (myIrp_PendingReturned) { + returnVal2 = 259L; } else { - if (__BLAST_NONDET___0 == 1) { - goto switch_33_1; + if (__BLAST_NONDET___0 == 0) { + goto switch_33_0; } else { - { - goto switch_33_default; - if (0) { - switch_33_0: /* CIL Label */ - returnVal2 = 0L; - goto switch_33_break; - switch_33_1: /* CIL Label */ - returnVal2 = -1073741823L; - goto switch_33_break; - switch_33_default: /* CIL Label */ - returnVal2 = 259L; - goto switch_33_break; + if (__BLAST_NONDET___0 == 1) { + goto switch_33_1; } else { - switch_33_break: /* CIL Label */ ; - } + { + goto switch_33_default; + if (0) { + switch_33_0: /* CIL Label */ + returnVal2 = 0L; + goto switch_33_break; + switch_33_1: /* CIL Label */ + returnVal2 = -1073741823L; + goto switch_33_break; + switch_33_default: /* CIL Label */ + returnVal2 = 259L; + goto switch_33_break; + } else { + switch_33_break: /* CIL Label */; + } + } } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal2; - } else { - if (s == MPR1) { - if (returnVal2 == 259L) { - s = MPR3; - lowerDriverReturn = returnVal2; - } else { - s = NP; - lowerDriverReturn = returnVal2; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal2; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal2; + if (s == MPR1) { + if (returnVal2 == 259L) { + s = MPR3; + lowerDriverReturn = returnVal2; + } else { + s = NP; + lowerDriverReturn = returnVal2; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal2; + } else { + { errorFn(); } } } } + return (returnVal2); } - return (returnVal2); } -} - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; -void IofCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) -{ +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost) { { - if (s == NP) { - s = DC; - } else { - { - errorFn(); + if (s == NP) { + s = DC; + } else { + { errorFn(); } } + return; } - return; } -} - KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ; -KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) -{ +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock); +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock) { - { - return ((unsigned char)0); + { return ((unsigned char)0); } } -} - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; -NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , BOOLEAN Alertable , PLARGE_INTEGER Interval ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_34_0; - } else { - { - goto switch_34_default; - if (0) { - switch_34_0: /* CIL Label */ ; - return (0L); - switch_34_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_34_0; } else { - switch_34_break: /* CIL Label */ ; - } + { + goto switch_34_default; + if (0) { + switch_34_0: /* CIL Label */; + return (0L); + switch_34_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_34_break: /* CIL Label */; + } + } } } } -} - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; -void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , BOOLEAN State ) -{ +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State) { - { - return; + { return; } } -} - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; -void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , LONG Count , LONG Limit ) -{ +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit) { - { - return; + { return; } } -} - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; -void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) -{ +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock) { - { - return; + { return; } } -} - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; -LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , LONG Adjustment , - BOOLEAN Wait ) -{ LONG r = __VERIFIER_nondet_long() ; +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait) { + LONG r = __VERIFIER_nondet_long(); - { - return (r); + { return (r); } } -} - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; -void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , KIRQL NewIrql ) -{ +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql) { - { - return; + { return; } } -} - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; -LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , BOOLEAN Wait ) -{ LONG l = __VERIFIER_nondet_long() ; +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait) { + LONG l = __VERIFIER_nondet_long(); { - setEventCalled = 1; - return (l); -} + setEventCalled = 1; + return (l); + } } - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; -NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , PLARGE_INTEGER Timeout ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (s == MPR3) { - if (setEventCalled == 1) { - s = NP; - setEventCalled = 0; - } else { - goto _L; - } - } else { - _L: /* CIL Label */ - if (customIrp == 1) { - s = NP; - customIrp = 0; + if (s == MPR3) { + if (setEventCalled == 1) { + s = NP; + setEventCalled = 0; + } else { + goto _L; + } } else { - if (s == MPR3) { - { - errorFn(); - } + _L: /* CIL Label */ + if (customIrp == 1) { + s = NP; + customIrp = 0; } else { - + if (s == MPR3) { + { errorFn(); } + } else { + } } } - } - if (__BLAST_NONDET___0 == 0) { - goto switch_35_0; - } else { - { - goto switch_35_default; - if (0) { - switch_35_0: /* CIL Label */ ; - return (0L); - switch_35_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_35_0; } else { - switch_35_break: /* CIL Label */ ; - } + { + goto switch_35_default; + if (0) { + switch_35_0: /* CIL Label */; + return (0L); + switch_35_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_35_break: /* CIL Label */; + } + } } } } -} - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; -PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , PHYSICAL_ADDRESS HighestAcceptableAddress ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - int tmp ; +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + int tmp; { - if (__BLAST_NONDET___0 == 0) { - goto switch_36_0; - } else { - if (__BLAST_NONDET___0 == 1) { - goto switch_36_1; + if (__BLAST_NONDET___0 == 0) { + goto switch_36_0; } else { - if (0) { - switch_36_0: /* CIL Label */ + if (__BLAST_NONDET___0 == 1) { + goto switch_36_1; + } else { + if (0) { + switch_36_0 : /* CIL Label */ { - tmp = malloc(NumberOfBytes); + tmp = malloc(NumberOfBytes); + } + return (tmp); + switch_36_1: /* CIL Label */; + return ((void *)0); + } else { + switch_36_break: /* CIL Label */; } - return (tmp); - switch_36_1: /* CIL Label */ ; - return ((void *)0); - } else { - switch_36_break: /* CIL Label */ ; } } + return ((void *)0); } - return ((void *)0); } -} - void MmFreeContiguousMemory(PVOID BaseAddress ) ; -void MmFreeContiguousMemory(PVOID BaseAddress ) -{ +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmFreeContiguousMemory(PVOID BaseAddress) { - { - return; + { return; } } -} - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; -PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , PVOID BaseAddress , - ULONG BugCheckOnFailure , MM_PAGE_PRIORITY Priority ) -{ +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority) { - { - return ((void *)0); + { return ((void *)0); } } -} - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; -PVOID MmPageEntireDriver(PVOID AddressWithinSection ) -{ +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection) { - { - return ((void *)0); + { return ((void *)0); } } -} - void MmResetDriverPaging(PVOID AddressWithinSection ) ; -void MmResetDriverPaging(PVOID AddressWithinSection ) -{ +void MmResetDriverPaging(PVOID AddressWithinSection); +void MmResetDriverPaging(PVOID AddressWithinSection) { - { - return; + { return; } } -} - void MmUnlockPages(PMDL MemoryDescriptorList ) ; -void MmUnlockPages(PMDL MemoryDescriptorList ) -{ +void MmUnlockPages(PMDL MemoryDescriptorList); +void MmUnlockPages(PMDL MemoryDescriptorList) { - { - return; + { return; } } -} - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; -NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , ACCESS_MASK DesiredAccess , POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , PVOID *Object , POBJECT_HANDLE_INFORMATION HandleInformation ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_37_0; - } else { - { - goto switch_37_default; - if (0) { - switch_37_0: /* CIL Label */ ; - return (0L); - switch_37_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_37_0; } else { - switch_37_break: /* CIL Label */ ; - } + { + goto switch_37_default; + if (0) { + switch_37_0: /* CIL Label */; + return (0L); + switch_37_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_37_break: /* CIL Label */; + } + } } } } -} - void ObfDereferenceObject(PVOID Object ) ; -void ObfDereferenceObject(PVOID Object ) -{ +void ObfDereferenceObject(PVOID Object); +void ObfDereferenceObject(PVOID Object) { - { - return; + { return; } } -} - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - int compRetStatus ; - NTSTATUS returnVal ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; - NTSTATUS tmp___0 ; +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + int compRetStatus; + NTSTATUS returnVal; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; + NTSTATUS tmp___0; { - if (compRegistered) { - if (routine == 0) { - { - tmp = HPCdrCompletion(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - } else { - if (routine == 1) { + if (compRegistered) { + if (routine == 0) { { - tmp___0 = CdAudioSignalCompletion(DeviceObject, Irp, lcontext); - compRetStatus = tmp___0; + tmp = HPCdrCompletion(DeviceObject, Irp, lcontext); + compRetStatus = tmp; } } else { - + if (routine == 1) { + { + tmp___0 = CdAudioSignalCompletion(DeviceObject, Irp, lcontext); + compRetStatus = tmp___0; + } + } else { + } } - } - if ((long )compRetStatus == -1073741802L) { - { - stubMoreProcessingRequired(); + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET___0 == 0) { - goto switch_38_0; - } else { - if (__BLAST_NONDET___0 == 1) { - goto switch_38_1; + if (__BLAST_NONDET___0 == 0) { + goto switch_38_0; } else { - { - goto switch_38_default; - if (0) { - switch_38_0: /* CIL Label */ - returnVal = 0L; - goto switch_38_break; - switch_38_1: /* CIL Label */ - returnVal = -1073741823L; - goto switch_38_break; - switch_38_default: /* CIL Label */ - returnVal = 259L; - goto switch_38_break; + if (__BLAST_NONDET___0 == 1) { + goto switch_38_1; } else { - switch_38_break: /* CIL Label */ ; - } + { + goto switch_38_default; + if (0) { + switch_38_0: /* CIL Label */ + returnVal = 0L; + goto switch_38_break; + switch_38_1: /* CIL Label */ + returnVal = -1073741823L; + goto switch_38_break; + switch_38_default: /* CIL Label */ + returnVal = 259L; + goto switch_38_break; + } else { + switch_38_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal; - } else { - if (s == MPR1) { - if (returnVal == 259L) { - s = MPR3; - lowerDriverReturn = returnVal; - } else { - s = NP; - lowerDriverReturn = returnVal; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal; + if (s == MPR1) { + if (returnVal == 259L) { + s = MPR3; + lowerDriverReturn = returnVal; + } else { + s = NP; + lowerDriverReturn = returnVal; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal; + } else { + { errorFn(); } } } } + return (returnVal); } - return (returnVal); -} } - void PoStartNextPowerIrp(PIRP Irp ) ; -void PoStartNextPowerIrp(PIRP Irp ) -{ +void PoStartNextPowerIrp(PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp) { - { - return; -} + { return; } } - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; -NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , ULONG DesiredAccess , POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , PCLIENT_ID ClientId , void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_39_0; - } else { - { - goto switch_39_default; - if (0) { - switch_39_0: /* CIL Label */ ; - return (0L); - switch_39_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_39_0; } else { - switch_39_break: /* CIL Label */ ; - } + { + goto switch_39_default; + if (0) { + switch_39_0: /* CIL Label */; + return (0L); + switch_39_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_39_break: /* CIL Label */; + } + } } } } -} - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_40_0; - } else { - { - goto switch_40_default; - if (0) { - switch_40_0: /* CIL Label */ ; - return (0L); - switch_40_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_40_0; } else { - switch_40_break: /* CIL Label */ ; - } + { + goto switch_40_default; + if (0) { + switch_40_0: /* CIL Label */; + return (0L); + switch_40_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_40_break: /* CIL Label */; + } + } } } } -} - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; -NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_41_0; - } else { - { - goto switch_41_default; - if (0) { - switch_41_0: /* CIL Label */ ; - return (0L); - switch_41_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_41_0; } else { - switch_41_break: /* CIL Label */ ; - } + { + goto switch_41_default; + if (0) { + switch_41_0: /* CIL Label */; + return (0L); + switch_41_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_41_break: /* CIL Label */; + } + } } } } -} - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; -SIZE_T RtlCompareMemory(void const *Source1 , void const *Source2 , - SIZE_T Length ) -{ SIZE_T r = __VERIFIER_nondet_long() ; +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length) { + SIZE_T r = __VERIFIER_nondet_long(); - { - return (r); -} + { return (r); } } - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; -void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) -{ +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString) { - { - return; -} + { return; } } - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; -NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , PCWSTR ValueName ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_42_0; - } else { - { - goto switch_42_default; - if (0) { - switch_42_0: /* CIL Label */ ; - return (0L); - switch_42_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_42_0; } else { - switch_42_break: /* CIL Label */ ; - } + { + goto switch_42_default; + if (0) { + switch_42_0: /* CIL Label */; + return (0L); + switch_42_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_42_break: /* CIL Label */; + } + } } } } -} - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; -void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) -{ +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString) { - { - return; -} + { return; } } - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; -void RtlInitString(PSTRING DestinationString , PCSZ SourceString ) -{ +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString) { - { - return; -} + { return; } } - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; -void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) -{ +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString) { - { - return; -} + { return; } } - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; -NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , PVOID Environment ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_43_0; - } else { - { - goto switch_43_default; - if (0) { - switch_43_0: /* CIL Label */ ; - return (0L); - switch_43_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_43_0; } else { - switch_43_break: /* CIL Label */ ; - } + { + goto switch_43_default; + if (0) { + switch_43_0: /* CIL Label */; + return (0L); + switch_43_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_43_break: /* CIL Label */; + } + } } } } -} - NTSTATUS ZwClose(HANDLE Handle ) ; -NTSTATUS ZwClose(HANDLE Handle ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS ZwClose(HANDLE Handle); +NTSTATUS ZwClose(HANDLE Handle) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_44_0; - } else { - { - goto switch_44_default; - if (0) { - switch_44_0: /* CIL Label */ ; - return (0L); - switch_44_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_44_0; } else { - switch_44_break: /* CIL Label */ ; - } + { + goto switch_44_default; + if (0) { + switch_44_0: /* CIL Label */; + return (0L); + switch_44_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_44_break: /* CIL Label */; + } + } } } } -} diff --git a/test/ntdrivers/diskperf_false.i.cil.c b/test/ntdrivers/diskperf_false.i.cil.c index b3b256d9f..d5525c8da 100644 --- a/test/ntdrivers/diskperf_false.i.cil.c +++ b/test/ntdrivers/diskperf_false.i.cil.c @@ -9,7 +9,7 @@ extern void *__VERIFIER_nondet_pointer(void); /* Generated by CIL v. 1.3.6 */ /* print_CIL_Input is true */ -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) typedef unsigned short wchar_t; typedef unsigned long ULONG_PTR; @@ -22,7 +22,7 @@ typedef long LONG; typedef wchar_t WCHAR; typedef WCHAR *PWCHAR; typedef WCHAR *PWSTR; -typedef WCHAR const *PCWSTR; +typedef WCHAR const *PCWSTR; typedef CHAR *PCHAR; typedef LONG *PLONG; typedef unsigned char UCHAR; @@ -39,72 +39,69 @@ typedef ULONG LCID; typedef LONG NTSTATUS; typedef long long LONGLONG; struct __anonstruct____missing_field_name_1 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; struct __anonstruct_u_2 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; union _LARGE_INTEGER { - struct __anonstruct____missing_field_name_1 __annonCompField1 ; - struct __anonstruct_u_2 u ; - LONGLONG QuadPart ; + struct __anonstruct____missing_field_name_1 __annonCompField1; + struct __anonstruct_u_2 u; + LONGLONG QuadPart; }; typedef union _LARGE_INTEGER LARGE_INTEGER; typedef LARGE_INTEGER *PLARGE_INTEGER; struct _LUID { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; typedef struct _LUID LUID; typedef LARGE_INTEGER PHYSICAL_ADDRESS; -enum _EVENT_TYPE { - NotificationEvent = 0, - SynchronizationEvent = 1 -} ; +enum _EVENT_TYPE { NotificationEvent = 0, SynchronizationEvent = 1 }; typedef enum _EVENT_TYPE EVENT_TYPE; -typedef char const *PCSZ; +typedef char const *PCSZ; struct _STRING { - USHORT Length ; - USHORT MaximumLength ; - PCHAR Buffer ; + USHORT Length; + USHORT MaximumLength; + PCHAR Buffer; }; typedef struct _STRING STRING; typedef STRING *PSTRING; typedef PSTRING PANSI_STRING; struct _UNICODE_STRING { - USHORT Length ; - USHORT MaximumLength ; - PWSTR Buffer ; + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; }; typedef struct _UNICODE_STRING UNICODE_STRING; typedef UNICODE_STRING *PUNICODE_STRING; typedef UCHAR BOOLEAN; struct _LIST_ENTRY { - struct _LIST_ENTRY *Flink ; - struct _LIST_ENTRY *Blink ; + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; }; typedef struct _LIST_ENTRY LIST_ENTRY; typedef struct _LIST_ENTRY *PLIST_ENTRY; struct _OBJECT_ATTRIBUTES { - ULONG Length ; - HANDLE RootDirectory ; - PUNICODE_STRING ObjectName ; - ULONG Attributes ; - PVOID SecurityDescriptor ; - PVOID SecurityQualityOfService ; + ULONG Length; + HANDLE RootDirectory; + PUNICODE_STRING ObjectName; + ULONG Attributes; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; }; typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES; typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; struct _GUID { - unsigned long Data1 ; - unsigned short Data2 ; - unsigned short Data3 ; - unsigned char Data4[8] ; + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; }; typedef struct _GUID GUID; -typedef GUID const *LPCGUID; +typedef GUID const *LPCGUID; typedef unsigned int size_t; typedef UCHAR KIRQL; struct _KTHREAD; @@ -120,82 +117,85 @@ typedef struct _OBJECT_TYPE *POBJECT_TYPE; typedef CCHAR KPROCESSOR_MODE; struct _KAPC; struct _KAPC; -typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ); +typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); struct _KAPC { - CSHORT Type ; - CSHORT Size ; - ULONG Spare0 ; - struct _KTHREAD *Thread ; - LIST_ENTRY ApcListEntry ; - void (*KernelRoutine)(struct _KAPC *Apc , PKNORMAL_ROUTINE *NormalRoutine , PVOID *NormalContext , - PVOID *SystemArgument1 , PVOID *SystemArgument2 ) ; - void (*RundownRoutine)(struct _KAPC *Apc ) ; - void (*NormalRoutine)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ) ; - PVOID NormalContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - CCHAR ApcStateIndex ; - KPROCESSOR_MODE ApcMode ; - BOOLEAN Inserted ; + CSHORT Type; + CSHORT Size; + ULONG Spare0; + struct _KTHREAD *Thread; + LIST_ENTRY ApcListEntry; + void (*KernelRoutine)(struct _KAPC *Apc, PKNORMAL_ROUTINE *NormalRoutine, + PVOID *NormalContext, PVOID *SystemArgument1, + PVOID *SystemArgument2); + void (*RundownRoutine)(struct _KAPC *Apc); + void (*NormalRoutine)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); + PVOID NormalContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + CCHAR ApcStateIndex; + KPROCESSOR_MODE ApcMode; + BOOLEAN Inserted; }; typedef struct _KAPC KAPC; struct _KDPC; struct _KDPC; struct _KDPC { - CSHORT Type ; - UCHAR Number ; - UCHAR Importance ; - LIST_ENTRY DpcListEntry ; - void (*DeferredRoutine)(struct _KDPC *Dpc , PVOID DeferredContext , PVOID SystemArgument1 , - PVOID SystemArgument2 ) ; - PVOID DeferredContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - PULONG_PTR Lock ; + CSHORT Type; + UCHAR Number; + UCHAR Importance; + LIST_ENTRY DpcListEntry; + void (*DeferredRoutine)(struct _KDPC *Dpc, PVOID DeferredContext, + PVOID SystemArgument1, PVOID SystemArgument2); + PVOID DeferredContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + PULONG_PTR Lock; }; typedef struct _KDPC KDPC; typedef struct _KDPC *PKDPC; struct _MDL { - struct _MDL *Next ; - CSHORT Size ; - CSHORT MdlFlags ; - struct _EPROCESS *Process ; - PVOID MappedSystemVa ; - PVOID StartVa ; - ULONG ByteCount ; - ULONG ByteOffset ; + struct _MDL *Next; + CSHORT Size; + CSHORT MdlFlags; + struct _EPROCESS *Process; + PVOID MappedSystemVa; + PVOID StartVa; + ULONG ByteCount; + ULONG ByteOffset; }; typedef struct _MDL MDL; typedef struct _MDL *PMDL; typedef PVOID PACCESS_TOKEN; typedef PVOID PSECURITY_DESCRIPTOR; typedef ULONG ACCESS_MASK; -#pragma pack(push,4) +#pragma pack(push, 4) struct _LUID_AND_ATTRIBUTES { - LUID Luid ; - ULONG Attributes ; + LUID Luid; + ULONG Attributes; }; typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES; #pragma pack(pop) struct _PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[1] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[1]; }; typedef struct _PRIVILEGE_SET PRIVILEGE_SET; enum _SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous = 0, - SecurityIdentification = 1, - SecurityImpersonation = 2, - SecurityDelegation = 3 -} ; + SecurityAnonymous = 0, + SecurityIdentification = 1, + SecurityImpersonation = 2, + SecurityDelegation = 3 +}; typedef enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL; typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE; struct _SECURITY_QUALITY_OF_SERVICE { - ULONG Length ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode ; - BOOLEAN EffectiveOnly ; + ULONG Length; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; + BOOLEAN EffectiveOnly; }; typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE; typedef ULONG SECURITY_INFORMATION; @@ -203,581 +203,578 @@ typedef LONG KPRIORITY; typedef ULONG_PTR KSPIN_LOCK; typedef KSPIN_LOCK *PKSPIN_LOCK; struct _RTL_QUERY_REGISTRY_TABLE { - NTSTATUS (*QueryRoutine)(PWSTR ValueName , ULONG ValueType , - PVOID ValueData , ULONG ValueLength , - PVOID Context , PVOID EntryContext ) ; - ULONG Flags ; - PWSTR Name ; - PVOID EntryContext ; - ULONG DefaultType ; - PVOID DefaultData ; - ULONG DefaultLength ; + NTSTATUS(*QueryRoutine) + (PWSTR ValueName, ULONG ValueType, PVOID ValueData, ULONG ValueLength, + PVOID Context, PVOID EntryContext); + ULONG Flags; + PWSTR Name; + PVOID EntryContext; + ULONG DefaultType; + PVOID DefaultData; + ULONG DefaultLength; }; typedef struct _RTL_QUERY_REGISTRY_TABLE *PRTL_QUERY_REGISTRY_TABLE; union __anonunion____missing_field_name_6 { - NTSTATUS Status ; - PVOID Pointer ; + NTSTATUS Status; + PVOID Pointer; }; struct _IO_STATUS_BLOCK { - union __anonunion____missing_field_name_6 __annonCompField4 ; - ULONG_PTR Information ; + union __anonunion____missing_field_name_6 __annonCompField4; + ULONG_PTR Information; }; typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK; typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK; enum _FILE_INFORMATION_CLASS { - FileDirectoryInformation = 1, - FileFullDirectoryInformation = 2, - FileBothDirectoryInformation = 3, - FileBasicInformation = 4, - FileStandardInformation = 5, - FileInternalInformation = 6, - FileEaInformation = 7, - FileAccessInformation = 8, - FileNameInformation = 9, - FileRenameInformation = 10, - FileLinkInformation = 11, - FileNamesInformation = 12, - FileDispositionInformation = 13, - FilePositionInformation = 14, - FileFullEaInformation = 15, - FileModeInformation = 16, - FileAlignmentInformation = 17, - FileAllInformation = 18, - FileAllocationInformation = 19, - FileEndOfFileInformation = 20, - FileAlternateNameInformation = 21, - FileStreamInformation = 22, - FilePipeInformation = 23, - FilePipeLocalInformation = 24, - FilePipeRemoteInformation = 25, - FileMailslotQueryInformation = 26, - FileMailslotSetInformation = 27, - FileCompressionInformation = 28, - FileObjectIdInformation = 29, - FileCompletionInformation = 30, - FileMoveClusterInformation = 31, - FileQuotaInformation = 32, - FileReparsePointInformation = 33, - FileNetworkOpenInformation = 34, - FileAttributeTagInformation = 35, - FileTrackingInformation = 36, - FileMaximumInformation = 37 -} ; + FileDirectoryInformation = 1, + FileFullDirectoryInformation = 2, + FileBothDirectoryInformation = 3, + FileBasicInformation = 4, + FileStandardInformation = 5, + FileInternalInformation = 6, + FileEaInformation = 7, + FileAccessInformation = 8, + FileNameInformation = 9, + FileRenameInformation = 10, + FileLinkInformation = 11, + FileNamesInformation = 12, + FileDispositionInformation = 13, + FilePositionInformation = 14, + FileFullEaInformation = 15, + FileModeInformation = 16, + FileAlignmentInformation = 17, + FileAllInformation = 18, + FileAllocationInformation = 19, + FileEndOfFileInformation = 20, + FileAlternateNameInformation = 21, + FileStreamInformation = 22, + FilePipeInformation = 23, + FilePipeLocalInformation = 24, + FilePipeRemoteInformation = 25, + FileMailslotQueryInformation = 26, + FileMailslotSetInformation = 27, + FileCompressionInformation = 28, + FileObjectIdInformation = 29, + FileCompletionInformation = 30, + FileMoveClusterInformation = 31, + FileQuotaInformation = 32, + FileReparsePointInformation = 33, + FileNetworkOpenInformation = 34, + FileAttributeTagInformation = 35, + FileTrackingInformation = 36, + FileMaximumInformation = 37 +}; typedef enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS; struct _FILE_BASIC_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + ULONG FileAttributes; }; typedef struct _FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION; struct _FILE_STANDARD_INFORMATION { - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG NumberOfLinks ; - BOOLEAN DeletePending ; - BOOLEAN Directory ; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG NumberOfLinks; + BOOLEAN DeletePending; + BOOLEAN Directory; }; typedef struct _FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION; struct _FILE_NETWORK_OPEN_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG FileAttributes; }; typedef struct _FILE_NETWORK_OPEN_INFORMATION *PFILE_NETWORK_OPEN_INFORMATION; enum _FSINFOCLASS { - FileFsVolumeInformation = 1, - FileFsLabelInformation = 2, - FileFsSizeInformation = 3, - FileFsDeviceInformation = 4, - FileFsAttributeInformation = 5, - FileFsControlInformation = 6, - FileFsFullSizeInformation = 7, - FileFsObjectIdInformation = 8, - FileFsMaximumInformation = 9 -} ; + FileFsVolumeInformation = 1, + FileFsLabelInformation = 2, + FileFsSizeInformation = 3, + FileFsDeviceInformation = 4, + FileFsAttributeInformation = 5, + FileFsControlInformation = 6, + FileFsFullSizeInformation = 7, + FileFsObjectIdInformation = 8, + FileFsMaximumInformation = 9 +}; typedef enum _FSINFOCLASS FS_INFORMATION_CLASS; enum _INTERFACE_TYPE { - InterfaceTypeUndefined = -1, - Internal = 0, - Isa = 1, - Eisa = 2, - MicroChannel = 3, - TurboChannel = 4, - PCIBus = 5, - VMEBus = 6, - NuBus = 7, - PCMCIABus = 8, - CBus = 9, - MPIBus = 10, - MPSABus = 11, - ProcessorInternal = 12, - InternalPowerBus = 13, - PNPISABus = 14, - PNPBus = 15, - MaximumInterfaceType = 16 -} ; + InterfaceTypeUndefined = -1, + Internal = 0, + Isa = 1, + Eisa = 2, + MicroChannel = 3, + TurboChannel = 4, + PCIBus = 5, + VMEBus = 6, + NuBus = 7, + PCMCIABus = 8, + CBus = 9, + MPIBus = 10, + MPSABus = 11, + ProcessorInternal = 12, + InternalPowerBus = 13, + PNPISABus = 14, + PNPBus = 15, + MaximumInterfaceType = 16 +}; typedef enum _INTERFACE_TYPE INTERFACE_TYPE; typedef enum _INTERFACE_TYPE *PINTERFACE_TYPE; struct _IO_ERROR_LOG_PACKET { - UCHAR MajorFunctionCode ; - UCHAR RetryCount ; - USHORT DumpDataSize ; - USHORT NumberOfStrings ; - USHORT StringOffset ; - USHORT EventCategory ; - NTSTATUS ErrorCode ; - ULONG UniqueErrorValue ; - NTSTATUS FinalStatus ; - ULONG SequenceNumber ; - ULONG IoControlCode ; - LARGE_INTEGER DeviceOffset ; - ULONG DumpData[1] ; + UCHAR MajorFunctionCode; + UCHAR RetryCount; + USHORT DumpDataSize; + USHORT NumberOfStrings; + USHORT StringOffset; + USHORT EventCategory; + NTSTATUS ErrorCode; + ULONG UniqueErrorValue; + NTSTATUS FinalStatus; + ULONG SequenceNumber; + ULONG IoControlCode; + LARGE_INTEGER DeviceOffset; + ULONG DumpData[1]; }; typedef struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET; typedef struct _IO_ERROR_LOG_PACKET *PIO_ERROR_LOG_PACKET; struct _KEY_VALUE_FULL_INFORMATION { - ULONG TitleIndex ; - ULONG Type ; - ULONG DataOffset ; - ULONG DataLength ; - ULONG NameLength ; - WCHAR Name[1] ; + ULONG TitleIndex; + ULONG Type; + ULONG DataOffset; + ULONG DataLength; + ULONG NameLength; + WCHAR Name[1]; }; typedef struct _KEY_VALUE_FULL_INFORMATION *PKEY_VALUE_FULL_INFORMATION; struct _CLIENT_ID { - HANDLE UniqueProcess ; - HANDLE UniqueThread ; + HANDLE UniqueProcess; + HANDLE UniqueThread; }; typedef struct _CLIENT_ID CLIENT_ID; typedef CLIENT_ID *PCLIENT_ID; enum _SYSTEM_POWER_STATE { - PowerSystemUnspecified = 0, - PowerSystemWorking = 1, - PowerSystemSleeping1 = 2, - PowerSystemSleeping2 = 3, - PowerSystemSleeping3 = 4, - PowerSystemHibernate = 5, - PowerSystemShutdown = 6, - PowerSystemMaximum = 7 -} ; + PowerSystemUnspecified = 0, + PowerSystemWorking = 1, + PowerSystemSleeping1 = 2, + PowerSystemSleeping2 = 3, + PowerSystemSleeping3 = 4, + PowerSystemHibernate = 5, + PowerSystemShutdown = 6, + PowerSystemMaximum = 7 +}; typedef enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE; enum __anonenum_POWER_ACTION_11 { - PowerActionNone = 0, - PowerActionReserved = 1, - PowerActionSleep = 2, - PowerActionHibernate = 3, - PowerActionShutdown = 4, - PowerActionShutdownReset = 5, - PowerActionShutdownOff = 6, - PowerActionWarmEject = 7 -} ; + PowerActionNone = 0, + PowerActionReserved = 1, + PowerActionSleep = 2, + PowerActionHibernate = 3, + PowerActionShutdown = 4, + PowerActionShutdownReset = 5, + PowerActionShutdownOff = 6, + PowerActionWarmEject = 7 +}; typedef enum __anonenum_POWER_ACTION_11 POWER_ACTION; enum _DEVICE_POWER_STATE { - PowerDeviceUnspecified = 0, - PowerDeviceD0 = 1, - PowerDeviceD1 = 2, - PowerDeviceD2 = 3, - PowerDeviceD3 = 4, - PowerDeviceMaximum = 5 -} ; + PowerDeviceUnspecified = 0, + PowerDeviceD0 = 1, + PowerDeviceD1 = 2, + PowerDeviceD2 = 3, + PowerDeviceD3 = 4, + PowerDeviceMaximum = 5 +}; typedef enum _DEVICE_POWER_STATE DEVICE_POWER_STATE; union _POWER_STATE { - SYSTEM_POWER_STATE SystemState ; - DEVICE_POWER_STATE DeviceState ; + SYSTEM_POWER_STATE SystemState; + DEVICE_POWER_STATE DeviceState; }; typedef union _POWER_STATE POWER_STATE; -enum _POWER_STATE_TYPE { - SystemPowerState = 0, - DevicePowerState = 1 -} ; +enum _POWER_STATE_TYPE { SystemPowerState = 0, DevicePowerState = 1 }; typedef enum _POWER_STATE_TYPE POWER_STATE_TYPE; typedef PVOID PASSIGNED_RESOURCE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Generic_16 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Port_17 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Interrupt_18 { - ULONG Level ; - ULONG Vector ; - ULONG Affinity ; + ULONG Level; + ULONG Vector; + ULONG Affinity; }; struct __anonstruct_Memory_19 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Dma_20 { - ULONG Channel ; - ULONG Port ; - ULONG Reserved1 ; + ULONG Channel; + ULONG Port; + ULONG Reserved1; }; struct __anonstruct_DevicePrivate_21 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_22 { - ULONG Start ; - ULONG Length ; - ULONG Reserved ; + ULONG Start; + ULONG Length; + ULONG Reserved; }; struct __anonstruct_DeviceSpecificData_23 { - ULONG DataSize ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG DataSize; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_15 { - struct __anonstruct_Generic_16 Generic ; - struct __anonstruct_Port_17 Port ; - struct __anonstruct_Interrupt_18 Interrupt ; - struct __anonstruct_Memory_19 Memory ; - struct __anonstruct_Dma_20 Dma ; - struct __anonstruct_DevicePrivate_21 DevicePrivate ; - struct __anonstruct_BusNumber_22 BusNumber ; - struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData ; + struct __anonstruct_Generic_16 Generic; + struct __anonstruct_Port_17 Port; + struct __anonstruct_Interrupt_18 Interrupt; + struct __anonstruct_Memory_19 Memory; + struct __anonstruct_Dma_20 Dma; + struct __anonstruct_DevicePrivate_21 DevicePrivate; + struct __anonstruct_BusNumber_22 BusNumber; + struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData; }; struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { - UCHAR Type ; - UCHAR ShareDisposition ; - USHORT Flags ; - union __anonunion_u_15 u ; + UCHAR Type; + UCHAR ShareDisposition; + USHORT Flags; + union __anonunion_u_15 u; }; typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR; #pragma pack(pop) struct _CM_PARTIAL_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; }; typedef struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST; struct _CM_FULL_RESOURCE_DESCRIPTOR { - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - CM_PARTIAL_RESOURCE_LIST PartialResourceList ; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; }; typedef struct _CM_FULL_RESOURCE_DESCRIPTOR CM_FULL_RESOURCE_DESCRIPTOR; struct _CM_RESOURCE_LIST { - ULONG Count ; - CM_FULL_RESOURCE_DESCRIPTOR List[1] ; + ULONG Count; + CM_FULL_RESOURCE_DESCRIPTOR List[1]; }; typedef struct _CM_RESOURCE_LIST *PCM_RESOURCE_LIST; -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct __anonstruct_Port_25 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Memory_26 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Interrupt_27 { - ULONG MinimumVector ; - ULONG MaximumVector ; + ULONG MinimumVector; + ULONG MaximumVector; }; struct __anonstruct_Dma_28 { - ULONG MinimumChannel ; - ULONG MaximumChannel ; + ULONG MinimumChannel; + ULONG MaximumChannel; }; struct __anonstruct_Generic_29 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_DevicePrivate_30 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_31 { - ULONG Length ; - ULONG MinBusNumber ; - ULONG MaxBusNumber ; - ULONG Reserved ; + ULONG Length; + ULONG MinBusNumber; + ULONG MaxBusNumber; + ULONG Reserved; }; struct __anonstruct_AssignedResource_32 { - PASSIGNED_RESOURCE AssignedResource ; + PASSIGNED_RESOURCE AssignedResource; }; struct __anonstruct_SubAllocateFrom_33 { - UCHAR Type ; - UCHAR Reserved[3] ; - PASSIGNED_RESOURCE AssignedResource ; - PHYSICAL_ADDRESS Transformation ; + UCHAR Type; + UCHAR Reserved[3]; + PASSIGNED_RESOURCE AssignedResource; + PHYSICAL_ADDRESS Transformation; }; struct __anonstruct_ConfigData_34 { - ULONG Priority ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG Priority; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_24 { - struct __anonstruct_Port_25 Port ; - struct __anonstruct_Memory_26 Memory ; - struct __anonstruct_Interrupt_27 Interrupt ; - struct __anonstruct_Dma_28 Dma ; - struct __anonstruct_Generic_29 Generic ; - struct __anonstruct_DevicePrivate_30 DevicePrivate ; - struct __anonstruct_BusNumber_31 BusNumber ; - struct __anonstruct_AssignedResource_32 AssignedResource ; - struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom ; - struct __anonstruct_ConfigData_34 ConfigData ; + struct __anonstruct_Port_25 Port; + struct __anonstruct_Memory_26 Memory; + struct __anonstruct_Interrupt_27 Interrupt; + struct __anonstruct_Dma_28 Dma; + struct __anonstruct_Generic_29 Generic; + struct __anonstruct_DevicePrivate_30 DevicePrivate; + struct __anonstruct_BusNumber_31 BusNumber; + struct __anonstruct_AssignedResource_32 AssignedResource; + struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom; + struct __anonstruct_ConfigData_34 ConfigData; }; struct _IO_RESOURCE_DESCRIPTOR { - UCHAR Option ; - UCHAR Type ; - UCHAR ShareDisposition ; - UCHAR Spare1 ; - USHORT Flags ; - USHORT Spare2 ; - union __anonunion_u_24 u ; + UCHAR Option; + UCHAR Type; + UCHAR ShareDisposition; + UCHAR Spare1; + USHORT Flags; + USHORT Spare2; + union __anonunion_u_24 u; }; typedef struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR; struct _IO_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - IO_RESOURCE_DESCRIPTOR Descriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + IO_RESOURCE_DESCRIPTOR Descriptors[1]; }; typedef struct _IO_RESOURCE_LIST IO_RESOURCE_LIST; struct _IO_RESOURCE_REQUIREMENTS_LIST { - ULONG ListSize ; - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - ULONG SlotNumber ; - ULONG Reserved[3] ; - ULONG AlternativeLists ; - IO_RESOURCE_LIST List[1] ; + ULONG ListSize; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + ULONG SlotNumber; + ULONG Reserved[3]; + ULONG AlternativeLists; + IO_RESOURCE_LIST List[1]; }; typedef struct _IO_RESOURCE_REQUIREMENTS_LIST *PIO_RESOURCE_REQUIREMENTS_LIST; enum _CONFIGURATION_TYPE { - ArcSystem = 0, - CentralProcessor = 1, - FloatingPointProcessor = 2, - PrimaryIcache = 3, - PrimaryDcache = 4, - SecondaryIcache = 5, - SecondaryDcache = 6, - SecondaryCache = 7, - EisaAdapter = 8, - TcAdapter = 9, - ScsiAdapter = 10, - DtiAdapter = 11, - MultiFunctionAdapter = 12, - DiskController = 13, - TapeController = 14, - CdromController = 15, - WormController = 16, - SerialController = 17, - NetworkController = 18, - DisplayController = 19, - ParallelController = 20, - PointerController = 21, - KeyboardController = 22, - AudioController = 23, - OtherController = 24, - DiskPeripheral = 25, - FloppyDiskPeripheral = 26, - TapePeripheral = 27, - ModemPeripheral = 28, - MonitorPeripheral = 29, - PrinterPeripheral = 30, - PointerPeripheral = 31, - KeyboardPeripheral = 32, - TerminalPeripheral = 33, - OtherPeripheral = 34, - LinePeripheral = 35, - NetworkPeripheral = 36, - SystemMemory = 37, - DockingInformation = 38, - RealModeIrqRoutingTable = 39, - MaximumType = 40 -} ; + ArcSystem = 0, + CentralProcessor = 1, + FloatingPointProcessor = 2, + PrimaryIcache = 3, + PrimaryDcache = 4, + SecondaryIcache = 5, + SecondaryDcache = 6, + SecondaryCache = 7, + EisaAdapter = 8, + TcAdapter = 9, + ScsiAdapter = 10, + DtiAdapter = 11, + MultiFunctionAdapter = 12, + DiskController = 13, + TapeController = 14, + CdromController = 15, + WormController = 16, + SerialController = 17, + NetworkController = 18, + DisplayController = 19, + ParallelController = 20, + PointerController = 21, + KeyboardController = 22, + AudioController = 23, + OtherController = 24, + DiskPeripheral = 25, + FloppyDiskPeripheral = 26, + TapePeripheral = 27, + ModemPeripheral = 28, + MonitorPeripheral = 29, + PrinterPeripheral = 30, + PointerPeripheral = 31, + KeyboardPeripheral = 32, + TerminalPeripheral = 33, + OtherPeripheral = 34, + LinePeripheral = 35, + NetworkPeripheral = 36, + SystemMemory = 37, + DockingInformation = 38, + RealModeIrqRoutingTable = 39, + MaximumType = 40 +}; typedef enum _CONFIGURATION_TYPE CONFIGURATION_TYPE; typedef enum _CONFIGURATION_TYPE *PCONFIGURATION_TYPE; enum _KWAIT_REASON { - Executive = 0, - FreePage = 1, - PageIn = 2, - PoolAllocation = 3, - DelayExecution = 4, - Suspended = 5, - UserRequest = 6, - WrExecutive = 7, - WrFreePage = 8, - WrPageIn = 9, - WrPoolAllocation = 10, - WrDelayExecution = 11, - WrSuspended = 12, - WrUserRequest = 13, - WrEventPair = 14, - WrQueue = 15, - WrLpcReceive = 16, - WrLpcReply = 17, - WrVirtualMemory = 18, - WrPageOut = 19, - WrRendezvous = 20, - Spare2 = 21, - Spare3 = 22, - Spare4 = 23, - Spare5 = 24, - Spare6 = 25, - WrKernel = 26, - MaximumWaitReason = 27 -} ; + Executive = 0, + FreePage = 1, + PageIn = 2, + PoolAllocation = 3, + DelayExecution = 4, + Suspended = 5, + UserRequest = 6, + WrExecutive = 7, + WrFreePage = 8, + WrPageIn = 9, + WrPoolAllocation = 10, + WrDelayExecution = 11, + WrSuspended = 12, + WrUserRequest = 13, + WrEventPair = 14, + WrQueue = 15, + WrLpcReceive = 16, + WrLpcReply = 17, + WrVirtualMemory = 18, + WrPageOut = 19, + WrRendezvous = 20, + Spare2 = 21, + Spare3 = 22, + Spare4 = 23, + Spare5 = 24, + Spare6 = 25, + WrKernel = 26, + MaximumWaitReason = 27 +}; typedef enum _KWAIT_REASON KWAIT_REASON; struct _DISPATCHER_HEADER { - UCHAR Type ; - UCHAR Absolute ; - UCHAR Size ; - UCHAR Inserted ; - LONG SignalState ; - LIST_ENTRY WaitListHead ; + UCHAR Type; + UCHAR Absolute; + UCHAR Size; + UCHAR Inserted; + LONG SignalState; + LIST_ENTRY WaitListHead; }; typedef struct _DISPATCHER_HEADER DISPATCHER_HEADER; struct _KDEVICE_QUEUE { - CSHORT Type ; - CSHORT Size ; - LIST_ENTRY DeviceListHead ; - KSPIN_LOCK Lock ; - BOOLEAN Busy ; + CSHORT Type; + CSHORT Size; + LIST_ENTRY DeviceListHead; + KSPIN_LOCK Lock; + BOOLEAN Busy; }; typedef struct _KDEVICE_QUEUE KDEVICE_QUEUE; struct _KDEVICE_QUEUE_ENTRY { - LIST_ENTRY DeviceListEntry ; - ULONG SortKey ; - BOOLEAN Inserted ; + LIST_ENTRY DeviceListEntry; + ULONG SortKey; + BOOLEAN Inserted; }; typedef struct _KDEVICE_QUEUE_ENTRY KDEVICE_QUEUE_ENTRY; struct _KEVENT { - DISPATCHER_HEADER Header ; + DISPATCHER_HEADER Header; }; typedef struct _KEVENT KEVENT; typedef struct _KEVENT *PKEVENT; typedef struct _KEVENT *PRKEVENT; struct _KSEMAPHORE { - DISPATCHER_HEADER Header ; - LONG Limit ; + DISPATCHER_HEADER Header; + LONG Limit; }; typedef struct _KSEMAPHORE *PKSEMAPHORE; typedef struct _KSEMAPHORE *PRKSEMAPHORE; enum _MEMORY_CACHING_TYPE { - MmNonCached = 0, - MmCached = 1, - MmWriteCombined = 2, - MmHardwareCoherentCached = 3, - MmNonCachedUnordered = 4, - MmUSWCCached = 5, - MmMaximumCacheType = 6 -} ; + MmNonCached = 0, + MmCached = 1, + MmWriteCombined = 2, + MmHardwareCoherentCached = 3, + MmNonCachedUnordered = 4, + MmUSWCCached = 5, + MmMaximumCacheType = 6 +}; typedef enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE; enum _POOL_TYPE { - NonPagedPool = 0, - PagedPool = 1, - NonPagedPoolMustSucceed = 2, - DontUseThisType = 3, - NonPagedPoolCacheAligned = 4, - PagedPoolCacheAligned = 5, - NonPagedPoolCacheAlignedMustS = 6, - MaxPoolType = 7, - NonPagedPoolSession = 32, - PagedPoolSession = 33, - NonPagedPoolMustSucceedSession = 34, - DontUseThisTypeSession = 35, - NonPagedPoolCacheAlignedSession = 36, - PagedPoolCacheAlignedSession = 37, - NonPagedPoolCacheAlignedMustSSession = 38 -} ; + NonPagedPool = 0, + PagedPool = 1, + NonPagedPoolMustSucceed = 2, + DontUseThisType = 3, + NonPagedPoolCacheAligned = 4, + PagedPoolCacheAligned = 5, + NonPagedPoolCacheAlignedMustS = 6, + MaxPoolType = 7, + NonPagedPoolSession = 32, + PagedPoolSession = 33, + NonPagedPoolMustSucceedSession = 34, + DontUseThisTypeSession = 35, + NonPagedPoolCacheAlignedSession = 36, + PagedPoolCacheAlignedSession = 37, + NonPagedPoolCacheAlignedMustSSession = 38 +}; typedef enum _POOL_TYPE POOL_TYPE; struct _FAST_MUTEX { - LONG Count ; - PKTHREAD Owner ; - ULONG Contention ; - KEVENT Event ; - ULONG OldIrql ; + LONG Count; + PKTHREAD Owner; + ULONG Contention; + KEVENT Event; + ULONG OldIrql; }; typedef struct _FAST_MUTEX *PFAST_MUTEX; typedef ULONG_PTR ERESOURCE_THREAD; union __anonunion____missing_field_name_38 { - LONG OwnerCount ; - ULONG TableSize ; + LONG OwnerCount; + ULONG TableSize; }; struct _OWNER_ENTRY { - ERESOURCE_THREAD OwnerThread ; - union __anonunion____missing_field_name_38 __annonCompField10 ; + ERESOURCE_THREAD OwnerThread; + union __anonunion____missing_field_name_38 __annonCompField10; }; typedef struct _OWNER_ENTRY OWNER_ENTRY; typedef struct _OWNER_ENTRY *POWNER_ENTRY; union __anonunion____missing_field_name_39 { - PVOID Address ; - ULONG_PTR CreatorBackTraceIndex ; + PVOID Address; + ULONG_PTR CreatorBackTraceIndex; }; struct _ERESOURCE { - LIST_ENTRY SystemResourcesList ; - POWNER_ENTRY OwnerTable ; - SHORT ActiveCount ; - USHORT Flag ; - PKSEMAPHORE SharedWaiters ; - PKEVENT ExclusiveWaiters ; - OWNER_ENTRY OwnerThreads[2] ; - ULONG ContentionCount ; - USHORT NumberOfSharedWaiters ; - USHORT NumberOfExclusiveWaiters ; - union __anonunion____missing_field_name_39 __annonCompField11 ; - KSPIN_LOCK SpinLock ; + LIST_ENTRY SystemResourcesList; + POWNER_ENTRY OwnerTable; + SHORT ActiveCount; + USHORT Flag; + PKSEMAPHORE SharedWaiters; + PKEVENT ExclusiveWaiters; + OWNER_ENTRY OwnerThreads[2]; + ULONG ContentionCount; + USHORT NumberOfSharedWaiters; + USHORT NumberOfExclusiveWaiters; + union __anonunion____missing_field_name_39 __annonCompField11; + KSPIN_LOCK SpinLock; }; enum _MM_PAGE_PRIORITY { - LowPagePriority = 0, - NormalPagePriority = 16, - HighPagePriority = 32 -} ; + LowPagePriority = 0, + NormalPagePriority = 16, + HighPagePriority = 32 +}; typedef enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY; struct _DRIVER_OBJECT; struct _DRIVER_OBJECT; struct _SECURITY_SUBJECT_CONTEXT { - PACCESS_TOKEN ClientToken ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - PACCESS_TOKEN PrimaryToken ; - PVOID ProcessAuditId ; + PACCESS_TOKEN ClientToken; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + PACCESS_TOKEN PrimaryToken; + PVOID ProcessAuditId; }; typedef struct _SECURITY_SUBJECT_CONTEXT SECURITY_SUBJECT_CONTEXT; struct _INITIAL_PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[3] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[3]; }; typedef struct _INITIAL_PRIVILEGE_SET INITIAL_PRIVILEGE_SET; union __anonunion_Privileges_40 { - INITIAL_PRIVILEGE_SET InitialPrivilegeSet ; - PRIVILEGE_SET PrivilegeSet ; + INITIAL_PRIVILEGE_SET InitialPrivilegeSet; + PRIVILEGE_SET PrivilegeSet; }; struct _ACCESS_STATE { - LUID OperationID ; - BOOLEAN SecurityEvaluated ; - BOOLEAN GenerateAudit ; - BOOLEAN GenerateOnClose ; - BOOLEAN PrivilegesAllocated ; - ULONG Flags ; - ACCESS_MASK RemainingDesiredAccess ; - ACCESS_MASK PreviouslyGrantedAccess ; - ACCESS_MASK OriginalDesiredAccess ; - SECURITY_SUBJECT_CONTEXT SubjectSecurityContext ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - PVOID AuxData ; - union __anonunion_Privileges_40 Privileges ; - BOOLEAN AuditPrivileges ; - UNICODE_STRING ObjectName ; - UNICODE_STRING ObjectTypeName ; + LUID OperationID; + BOOLEAN SecurityEvaluated; + BOOLEAN GenerateAudit; + BOOLEAN GenerateOnClose; + BOOLEAN PrivilegesAllocated; + ULONG Flags; + ACCESS_MASK RemainingDesiredAccess; + ACCESS_MASK PreviouslyGrantedAccess; + ACCESS_MASK OriginalDesiredAccess; + SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PVOID AuxData; + union __anonunion_Privileges_40 Privileges; + BOOLEAN AuditPrivileges; + UNICODE_STRING ObjectName; + UNICODE_STRING ObjectTypeName; }; typedef struct _ACCESS_STATE *PACCESS_STATE; struct _DEVICE_OBJECT; @@ -789,688 +786,723 @@ struct _IRP; struct _IRP; struct _SCSI_REQUEST_BLOCK; struct _SCSI_REQUEST_BLOCK; -typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ); +typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp); struct _COMPRESSED_DATA_INFO; struct _FAST_IO_DISPATCH { - ULONG SizeOfFastIoDispatch ; - BOOLEAN (*FastIoCheckIfPossible)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , - BOOLEAN CheckForReadOperation , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryBasicInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_BASIC_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryStandardInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_STANDARD_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoLock)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - BOOLEAN FailImmediately , BOOLEAN ExclusiveLock , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockSingle)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAll)(struct _FILE_OBJECT *FileObject , PEPROCESS ProcessId , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAllByKey)(struct _FILE_OBJECT *FileObject , PVOID ProcessId , - ULONG Key , PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoDeviceControl)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , ULONG IoControlCode , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice , struct _DEVICE_OBJECT *TargetDevice ) ; - BOOLEAN (*FastIoQueryNetworkOpenInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - struct _FILE_NETWORK_OPEN_INFORMATION *Buffer , - struct _IO_STATUS_BLOCK *IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForModWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER EndingOffset , - struct _ERESOURCE **ResourceToRelease , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadComplete)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*PrepareMdlWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteComplete)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoReadCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , PMDL *MdlChain , - PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWriteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , - PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadCompleteCompressed)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteCompleteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryOpen)(struct _IRP *Irp , PFILE_NETWORK_OPEN_INFORMATION NetworkInformation , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForModWrite)(struct _FILE_OBJECT *FileObject , struct _ERESOURCE *ResourceToRelease , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; + ULONG SizeOfFastIoDispatch; + BOOLEAN(*FastIoCheckIfPossible) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, BOOLEAN CheckForReadOperation, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryBasicInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_BASIC_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryStandardInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_STANDARD_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoLock) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + BOOLEAN FailImmediately, BOOLEAN ExclusiveLock, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockSingle) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAll) + (struct _FILE_OBJECT *FileObject, PEPROCESS ProcessId, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAllByKey) + (struct _FILE_OBJECT *FileObject, PVOID ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoDeviceControl) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, PVOID InputBuffer, + ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength, + ULONG IoControlCode, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice, + struct _DEVICE_OBJECT *TargetDevice); + BOOLEAN(*FastIoQueryNetworkOpenInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + struct _FILE_NETWORK_OPEN_INFORMATION *Buffer, + struct _IO_STATUS_BLOCK *IoStatus, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForModWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER EndingOffset, + struct _ERESOURCE **ResourceToRelease, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadComplete) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*PrepareMdlWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteComplete) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoReadCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWriteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryOpen) + (struct _IRP *Irp, PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForModWrite) + (struct _FILE_OBJECT *FileObject, struct _ERESOURCE *ResourceToRelease, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); }; typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH; enum _IO_ALLOCATION_ACTION { - KeepObject = 1, - DeallocateObject = 2, - DeallocateObjectKeepRegisters = 3 -} ; + KeepObject = 1, + DeallocateObject = 2, + DeallocateObjectKeepRegisters = 3 +}; typedef enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION; struct _IO_SECURITY_CONTEXT { - PSECURITY_QUALITY_OF_SERVICE SecurityQos ; - PACCESS_STATE AccessState ; - ACCESS_MASK DesiredAccess ; - ULONG FullCreateOptions ; + PSECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_STATE AccessState; + ACCESS_MASK DesiredAccess; + ULONG FullCreateOptions; }; typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT; struct _VPB { - CSHORT Type ; - CSHORT Size ; - USHORT Flags ; - USHORT VolumeLabelLength ; - struct _DEVICE_OBJECT *DeviceObject ; - struct _DEVICE_OBJECT *RealDevice ; - ULONG SerialNumber ; - ULONG ReferenceCount ; - WCHAR VolumeLabel[(32U * sizeof(WCHAR )) / sizeof(WCHAR )] ; + CSHORT Type; + CSHORT Size; + USHORT Flags; + USHORT VolumeLabelLength; + struct _DEVICE_OBJECT *DeviceObject; + struct _DEVICE_OBJECT *RealDevice; + ULONG SerialNumber; + ULONG ReferenceCount; + WCHAR VolumeLabel[(32U * sizeof(WCHAR)) / sizeof(WCHAR)]; }; typedef struct _VPB *PVPB; struct _WAIT_CONTEXT_BLOCK { - KDEVICE_QUEUE_ENTRY WaitQueueEntry ; - IO_ALLOCATION_ACTION (*DeviceRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp , - PVOID MapRegisterBase , PVOID Context ) ; - PVOID DeviceContext ; - ULONG NumberOfMapRegisters ; - PVOID DeviceObject ; - PVOID CurrentIrp ; - PKDPC BufferChainingDpc ; + KDEVICE_QUEUE_ENTRY WaitQueueEntry; + IO_ALLOCATION_ACTION(*DeviceRoutine) + (struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp, PVOID MapRegisterBase, + PVOID Context); + PVOID DeviceContext; + ULONG NumberOfMapRegisters; + PVOID DeviceObject; + PVOID CurrentIrp; + PKDPC BufferChainingDpc; }; typedef struct _WAIT_CONTEXT_BLOCK WAIT_CONTEXT_BLOCK; union __anonunion_Queue_43 { - LIST_ENTRY ListEntry ; - WAIT_CONTEXT_BLOCK Wcb ; + LIST_ENTRY ListEntry; + WAIT_CONTEXT_BLOCK Wcb; }; struct _DEVOBJ_EXTENSION; struct _DEVICE_OBJECT { - CSHORT Type ; - USHORT Size ; - LONG ReferenceCount ; - struct _DRIVER_OBJECT *DriverObject ; - struct _DEVICE_OBJECT *NextDevice ; - struct _DEVICE_OBJECT *AttachedDevice ; - struct _IRP *CurrentIrp ; - PIO_TIMER Timer ; - ULONG Flags ; - ULONG Characteristics ; - PVPB Vpb ; - PVOID DeviceExtension ; - ULONG DeviceType ; - CCHAR StackSize ; - union __anonunion_Queue_43 Queue ; - ULONG AlignmentRequirement ; - KDEVICE_QUEUE DeviceQueue ; - KDPC Dpc ; - ULONG ActiveThreadCount ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - KEVENT DeviceLock ; - USHORT SectorSize ; - USHORT Spare1 ; - struct _DEVOBJ_EXTENSION *DeviceObjectExtension ; - PVOID Reserved ; + CSHORT Type; + USHORT Size; + LONG ReferenceCount; + struct _DRIVER_OBJECT *DriverObject; + struct _DEVICE_OBJECT *NextDevice; + struct _DEVICE_OBJECT *AttachedDevice; + struct _IRP *CurrentIrp; + PIO_TIMER Timer; + ULONG Flags; + ULONG Characteristics; + PVPB Vpb; + PVOID DeviceExtension; + ULONG DeviceType; + CCHAR StackSize; + union __anonunion_Queue_43 Queue; + ULONG AlignmentRequirement; + KDEVICE_QUEUE DeviceQueue; + KDPC Dpc; + ULONG ActiveThreadCount; + PSECURITY_DESCRIPTOR SecurityDescriptor; + KEVENT DeviceLock; + USHORT SectorSize; + USHORT Spare1; + struct _DEVOBJ_EXTENSION *DeviceObjectExtension; + PVOID Reserved; }; typedef struct _DEVICE_OBJECT DEVICE_OBJECT; typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; struct _DEVOBJ_EXTENSION { - CSHORT Type ; - USHORT Size ; - PDEVICE_OBJECT DeviceObject ; + CSHORT Type; + USHORT Size; + PDEVICE_OBJECT DeviceObject; }; struct _DRIVER_EXTENSION { - struct _DRIVER_OBJECT *DriverObject ; - NTSTATUS (*AddDevice)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ; - ULONG Count ; - UNICODE_STRING ServiceKeyName ; + struct _DRIVER_OBJECT *DriverObject; + NTSTATUS(*AddDevice) + (struct _DRIVER_OBJECT *DriverObject, + struct _DEVICE_OBJECT *PhysicalDeviceObject); + ULONG Count; + UNICODE_STRING ServiceKeyName; }; typedef struct _DRIVER_EXTENSION *PDRIVER_EXTENSION; struct _DRIVER_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - ULONG Flags ; - PVOID DriverStart ; - ULONG DriverSize ; - PVOID DriverSection ; - PDRIVER_EXTENSION DriverExtension ; - UNICODE_STRING DriverName ; - PUNICODE_STRING HardwareDatabase ; - PFAST_IO_DISPATCH FastIoDispatch ; - NTSTATUS (*DriverInit)(struct _DRIVER_OBJECT *DriverObject , PUNICODE_STRING RegistryPath ) ; - void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject ) ; - PDRIVER_DISPATCH MajorFunction[28] ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + PVOID DriverStart; + ULONG DriverSize; + PVOID DriverSection; + PDRIVER_EXTENSION DriverExtension; + UNICODE_STRING DriverName; + PUNICODE_STRING HardwareDatabase; + PFAST_IO_DISPATCH FastIoDispatch; + NTSTATUS(*DriverInit) + (struct _DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath); + void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject); + PDRIVER_DISPATCH MajorFunction[28]; }; typedef struct _DRIVER_OBJECT DRIVER_OBJECT; typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; struct _SECTION_OBJECT_POINTERS { - PVOID DataSectionObject ; - PVOID SharedCacheMap ; - PVOID ImageSectionObject ; + PVOID DataSectionObject; + PVOID SharedCacheMap; + PVOID ImageSectionObject; }; typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS; typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS; struct _IO_COMPLETION_CONTEXT { - PVOID Port ; - PVOID Key ; + PVOID Port; + PVOID Key; }; typedef struct _IO_COMPLETION_CONTEXT *PIO_COMPLETION_CONTEXT; struct _FILE_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - PVPB Vpb ; - PVOID FsContext ; - PVOID FsContext2 ; - PSECTION_OBJECT_POINTERS SectionObjectPointer ; - PVOID PrivateCacheMap ; - NTSTATUS FinalStatus ; - struct _FILE_OBJECT *RelatedFileObject ; - BOOLEAN LockOperation ; - BOOLEAN DeletePending ; - BOOLEAN ReadAccess ; - BOOLEAN WriteAccess ; - BOOLEAN DeleteAccess ; - BOOLEAN SharedRead ; - BOOLEAN SharedWrite ; - BOOLEAN SharedDelete ; - ULONG Flags ; - UNICODE_STRING FileName ; - LARGE_INTEGER CurrentByteOffset ; - ULONG Waiters ; - ULONG Busy ; - PVOID LastLock ; - KEVENT Lock ; - KEVENT Event ; - PIO_COMPLETION_CONTEXT CompletionContext ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + PVPB Vpb; + PVOID FsContext; + PVOID FsContext2; + PSECTION_OBJECT_POINTERS SectionObjectPointer; + PVOID PrivateCacheMap; + NTSTATUS FinalStatus; + struct _FILE_OBJECT *RelatedFileObject; + BOOLEAN LockOperation; + BOOLEAN DeletePending; + BOOLEAN ReadAccess; + BOOLEAN WriteAccess; + BOOLEAN DeleteAccess; + BOOLEAN SharedRead; + BOOLEAN SharedWrite; + BOOLEAN SharedDelete; + ULONG Flags; + UNICODE_STRING FileName; + LARGE_INTEGER CurrentByteOffset; + ULONG Waiters; + ULONG Busy; + PVOID LastLock; + KEVENT Lock; + KEVENT Event; + PIO_COMPLETION_CONTEXT CompletionContext; }; typedef struct _FILE_OBJECT *PFILE_OBJECT; union __anonunion_AssociatedIrp_44 { - struct _IRP *MasterIrp ; - LONG IrpCount ; - PVOID SystemBuffer ; + struct _IRP *MasterIrp; + LONG IrpCount; + PVOID SystemBuffer; }; struct __anonstruct_AsynchronousParameters_46 { - void (*UserApcRoutine)(PVOID ApcContext , PIO_STATUS_BLOCK IoStatusBlock , - ULONG Reserved ) ; - PVOID UserApcContext ; + void (*UserApcRoutine)(PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, + ULONG Reserved); + PVOID UserApcContext; }; union __anonunion_Overlay_45 { - struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters ; - LARGE_INTEGER AllocationSize ; + struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters; + LARGE_INTEGER AllocationSize; }; struct __anonstruct____missing_field_name_50 { - PVOID DriverContext[4] ; + PVOID DriverContext[4]; }; union __anonunion____missing_field_name_49 { - KDEVICE_QUEUE_ENTRY DeviceQueueEntry ; - struct __anonstruct____missing_field_name_50 __annonCompField14 ; + KDEVICE_QUEUE_ENTRY DeviceQueueEntry; + struct __anonstruct____missing_field_name_50 __annonCompField14; }; struct _IO_STACK_LOCATION; union __anonunion____missing_field_name_52 { - struct _IO_STACK_LOCATION *CurrentStackLocation ; - ULONG PacketType ; + struct _IO_STACK_LOCATION *CurrentStackLocation; + ULONG PacketType; }; struct __anonstruct____missing_field_name_51 { - LIST_ENTRY ListEntry ; - union __anonunion____missing_field_name_52 __annonCompField16 ; + LIST_ENTRY ListEntry; + union __anonunion____missing_field_name_52 __annonCompField16; }; struct __anonstruct_Overlay_48 { - union __anonunion____missing_field_name_49 __annonCompField15 ; - PETHREAD Thread ; - PCHAR AuxiliaryBuffer ; - struct __anonstruct____missing_field_name_51 __annonCompField17 ; - PFILE_OBJECT OriginalFileObject ; + union __anonunion____missing_field_name_49 __annonCompField15; + PETHREAD Thread; + PCHAR AuxiliaryBuffer; + struct __anonstruct____missing_field_name_51 __annonCompField17; + PFILE_OBJECT OriginalFileObject; }; union __anonunion_Tail_47 { - struct __anonstruct_Overlay_48 Overlay ; - KAPC Apc ; - PVOID CompletionKey ; + struct __anonstruct_Overlay_48 Overlay; + KAPC Apc; + PVOID CompletionKey; }; struct _IRP { - CSHORT Type ; - USHORT Size ; - PMDL MdlAddress ; - ULONG Flags ; - union __anonunion_AssociatedIrp_44 AssociatedIrp ; - LIST_ENTRY ThreadListEntry ; - IO_STATUS_BLOCK IoStatus ; - KPROCESSOR_MODE RequestorMode ; - BOOLEAN PendingReturned ; - CHAR StackCount ; - CHAR CurrentLocation ; - BOOLEAN Cancel ; - KIRQL CancelIrql ; - CCHAR ApcEnvironment ; - UCHAR AllocationFlags ; - PIO_STATUS_BLOCK UserIosb ; - PKEVENT UserEvent ; - union __anonunion_Overlay_45 Overlay ; - void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - PVOID UserBuffer ; - union __anonunion_Tail_47 Tail ; + CSHORT Type; + USHORT Size; + PMDL MdlAddress; + ULONG Flags; + union __anonunion_AssociatedIrp_44 AssociatedIrp; + LIST_ENTRY ThreadListEntry; + IO_STATUS_BLOCK IoStatus; + KPROCESSOR_MODE RequestorMode; + BOOLEAN PendingReturned; + CHAR StackCount; + CHAR CurrentLocation; + BOOLEAN Cancel; + KIRQL CancelIrql; + CCHAR ApcEnvironment; + UCHAR AllocationFlags; + PIO_STATUS_BLOCK UserIosb; + PKEVENT UserEvent; + union __anonunion_Overlay_45 Overlay; + void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + PVOID UserBuffer; + union __anonunion_Tail_47 Tail; }; typedef struct _IRP IRP; typedef struct _IRP *PIRP; enum _DEVICE_RELATION_TYPE { - BusRelations = 0, - EjectionRelations = 1, - PowerRelations = 2, - RemovalRelations = 3, - TargetDeviceRelation = 4 -} ; + BusRelations = 0, + EjectionRelations = 1, + PowerRelations = 2, + RemovalRelations = 3, + TargetDeviceRelation = 4 +}; typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE; enum _DEVICE_USAGE_NOTIFICATION_TYPE { - DeviceUsageTypeUndefined = 0, - DeviceUsageTypePaging = 1, - DeviceUsageTypeHibernation = 2, - DeviceUsageTypeDumpFile = 3 -} ; + DeviceUsageTypeUndefined = 0, + DeviceUsageTypePaging = 1, + DeviceUsageTypeHibernation = 2, + DeviceUsageTypeDumpFile = 3 +}; typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE; struct _INTERFACE { - USHORT Size ; - USHORT Version ; - PVOID Context ; - void (*InterfaceReference)(PVOID Context ) ; - void (*InterfaceDereference)(PVOID Context ) ; + USHORT Size; + USHORT Version; + PVOID Context; + void (*InterfaceReference)(PVOID Context); + void (*InterfaceDereference)(PVOID Context); }; typedef struct _INTERFACE *PINTERFACE; struct _DEVICE_CAPABILITIES { - USHORT Size ; - USHORT Version ; - ULONG DeviceD1 : 1 ; - ULONG DeviceD2 : 1 ; - ULONG LockSupported : 1 ; - ULONG EjectSupported : 1 ; - ULONG Removable : 1 ; - ULONG DockDevice : 1 ; - ULONG UniqueID : 1 ; - ULONG SilentInstall : 1 ; - ULONG RawDeviceOK : 1 ; - ULONG SurpriseRemovalOK : 1 ; - ULONG WakeFromD0 : 1 ; - ULONG WakeFromD1 : 1 ; - ULONG WakeFromD2 : 1 ; - ULONG WakeFromD3 : 1 ; - ULONG HardwareDisabled : 1 ; - ULONG NonDynamic : 1 ; - ULONG WarmEjectSupported : 1 ; - ULONG Reserved : 15 ; - ULONG Address ; - ULONG UINumber ; - DEVICE_POWER_STATE DeviceState[7] ; - SYSTEM_POWER_STATE SystemWake ; - DEVICE_POWER_STATE DeviceWake ; - ULONG D1Latency ; - ULONG D2Latency ; - ULONG D3Latency ; + USHORT Size; + USHORT Version; + ULONG DeviceD1 : 1; + ULONG DeviceD2 : 1; + ULONG LockSupported : 1; + ULONG EjectSupported : 1; + ULONG Removable : 1; + ULONG DockDevice : 1; + ULONG UniqueID : 1; + ULONG SilentInstall : 1; + ULONG RawDeviceOK : 1; + ULONG SurpriseRemovalOK : 1; + ULONG WakeFromD0 : 1; + ULONG WakeFromD1 : 1; + ULONG WakeFromD2 : 1; + ULONG WakeFromD3 : 1; + ULONG HardwareDisabled : 1; + ULONG NonDynamic : 1; + ULONG WarmEjectSupported : 1; + ULONG Reserved : 15; + ULONG Address; + ULONG UINumber; + DEVICE_POWER_STATE DeviceState[7]; + SYSTEM_POWER_STATE SystemWake; + DEVICE_POWER_STATE DeviceWake; + ULONG D1Latency; + ULONG D2Latency; + ULONG D3Latency; }; typedef struct _DEVICE_CAPABILITIES *PDEVICE_CAPABILITIES; struct _POWER_SEQUENCE { - ULONG SequenceD1 ; - ULONG SequenceD2 ; - ULONG SequenceD3 ; + ULONG SequenceD1; + ULONG SequenceD2; + ULONG SequenceD3; }; typedef struct _POWER_SEQUENCE *PPOWER_SEQUENCE; enum __anonenum_BUS_QUERY_ID_TYPE_53 { - BusQueryDeviceID = 0, - BusQueryHardwareIDs = 1, - BusQueryCompatibleIDs = 2, - BusQueryInstanceID = 3, - BusQueryDeviceSerialNumber = 4 -} ; + BusQueryDeviceID = 0, + BusQueryHardwareIDs = 1, + BusQueryCompatibleIDs = 2, + BusQueryInstanceID = 3, + BusQueryDeviceSerialNumber = 4 +}; typedef enum __anonenum_BUS_QUERY_ID_TYPE_53 BUS_QUERY_ID_TYPE; enum __anonenum_DEVICE_TEXT_TYPE_54 { - DeviceTextDescription = 0, - DeviceTextLocationInformation = 1 -} ; + DeviceTextDescription = 0, + DeviceTextLocationInformation = 1 +}; typedef enum __anonenum_DEVICE_TEXT_TYPE_54 DEVICE_TEXT_TYPE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Create_56 { - PIO_SECURITY_CONTEXT SecurityContext ; - ULONG Options ; - USHORT FileAttributes ; - USHORT ShareAccess ; - ULONG EaLength ; + PIO_SECURITY_CONTEXT SecurityContext; + ULONG Options; + USHORT FileAttributes; + USHORT ShareAccess; + ULONG EaLength; }; struct __anonstruct_Read_57 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_Write_58 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_QueryFile_59 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; }; struct __anonstruct____missing_field_name_62 { - BOOLEAN ReplaceIfExists ; - BOOLEAN AdvanceOnly ; + BOOLEAN ReplaceIfExists; + BOOLEAN AdvanceOnly; }; union __anonunion____missing_field_name_61 { - struct __anonstruct____missing_field_name_62 __annonCompField18 ; - ULONG ClusterCount ; - HANDLE DeleteHandle ; + struct __anonstruct____missing_field_name_62 __annonCompField18; + ULONG ClusterCount; + HANDLE DeleteHandle; }; struct __anonstruct_SetFile_60 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; - PFILE_OBJECT FileObject ; - union __anonunion____missing_field_name_61 __annonCompField19 ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; + PFILE_OBJECT FileObject; + union __anonunion____missing_field_name_61 __annonCompField19; }; struct __anonstruct_QueryVolume_63 { - ULONG Length ; - FS_INFORMATION_CLASS FsInformationClass ; + ULONG Length; + FS_INFORMATION_CLASS FsInformationClass; }; struct __anonstruct_DeviceIoControl_64 { - ULONG OutputBufferLength ; - ULONG InputBufferLength ; - ULONG IoControlCode ; - PVOID Type3InputBuffer ; + ULONG OutputBufferLength; + ULONG InputBufferLength; + ULONG IoControlCode; + PVOID Type3InputBuffer; }; struct __anonstruct_QuerySecurity_65 { - SECURITY_INFORMATION SecurityInformation ; - ULONG Length ; + SECURITY_INFORMATION SecurityInformation; + ULONG Length; }; struct __anonstruct_SetSecurity_66 { - SECURITY_INFORMATION SecurityInformation ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; + SECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; }; struct __anonstruct_MountVolume_67 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_VerifyVolume_68 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_Scsi_69 { - struct _SCSI_REQUEST_BLOCK *Srb ; + struct _SCSI_REQUEST_BLOCK *Srb; }; struct __anonstruct_QueryDeviceRelations_70 { - DEVICE_RELATION_TYPE Type ; + DEVICE_RELATION_TYPE Type; }; struct __anonstruct_QueryInterface_71 { - GUID const *InterfaceType ; - USHORT Size ; - USHORT Version ; - PINTERFACE Interface ; - PVOID InterfaceSpecificData ; + GUID const *InterfaceType; + USHORT Size; + USHORT Version; + PINTERFACE Interface; + PVOID InterfaceSpecificData; }; struct __anonstruct_DeviceCapabilities_72 { - PDEVICE_CAPABILITIES Capabilities ; + PDEVICE_CAPABILITIES Capabilities; }; struct __anonstruct_FilterResourceRequirements_73 { - PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList ; + PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; }; struct __anonstruct_ReadWriteConfig_74 { - ULONG WhichSpace ; - PVOID Buffer ; - ULONG Offset ; - ULONG Length ; + ULONG WhichSpace; + PVOID Buffer; + ULONG Offset; + ULONG Length; }; struct __anonstruct_SetLock_75 { - BOOLEAN Lock ; + BOOLEAN Lock; }; struct __anonstruct_QueryId_76 { - BUS_QUERY_ID_TYPE IdType ; + BUS_QUERY_ID_TYPE IdType; }; struct __anonstruct_QueryDeviceText_77 { - DEVICE_TEXT_TYPE DeviceTextType ; - LCID LocaleId ; + DEVICE_TEXT_TYPE DeviceTextType; + LCID LocaleId; }; struct __anonstruct_UsageNotification_78 { - BOOLEAN InPath ; - BOOLEAN Reserved[3] ; - DEVICE_USAGE_NOTIFICATION_TYPE Type ; + BOOLEAN InPath; + BOOLEAN Reserved[3]; + DEVICE_USAGE_NOTIFICATION_TYPE Type; }; struct __anonstruct_WaitWake_79 { - SYSTEM_POWER_STATE PowerState ; + SYSTEM_POWER_STATE PowerState; }; struct __anonstruct_PowerSequence_80 { - PPOWER_SEQUENCE PowerSequence ; + PPOWER_SEQUENCE PowerSequence; }; struct __anonstruct_Power_81 { - ULONG SystemContext ; - POWER_STATE_TYPE Type ; - POWER_STATE State ; - POWER_ACTION ShutdownType ; + ULONG SystemContext; + POWER_STATE_TYPE Type; + POWER_STATE State; + POWER_ACTION ShutdownType; }; struct __anonstruct_StartDevice_82 { - PCM_RESOURCE_LIST AllocatedResources ; - PCM_RESOURCE_LIST AllocatedResourcesTranslated ; + PCM_RESOURCE_LIST AllocatedResources; + PCM_RESOURCE_LIST AllocatedResourcesTranslated; }; struct __anonstruct_WMI_83 { - ULONG_PTR ProviderId ; - PVOID DataPath ; - ULONG BufferSize ; - PVOID Buffer ; + ULONG_PTR ProviderId; + PVOID DataPath; + ULONG BufferSize; + PVOID Buffer; }; struct __anonstruct_Others_84 { - PVOID Argument1 ; - PVOID Argument2 ; - PVOID Argument3 ; - PVOID Argument4 ; + PVOID Argument1; + PVOID Argument2; + PVOID Argument3; + PVOID Argument4; }; union __anonunion_Parameters_55 { - struct __anonstruct_Create_56 Create ; - struct __anonstruct_Read_57 Read ; - struct __anonstruct_Write_58 Write ; - struct __anonstruct_QueryFile_59 QueryFile ; - struct __anonstruct_SetFile_60 SetFile ; - struct __anonstruct_QueryVolume_63 QueryVolume ; - struct __anonstruct_DeviceIoControl_64 DeviceIoControl ; - struct __anonstruct_QuerySecurity_65 QuerySecurity ; - struct __anonstruct_SetSecurity_66 SetSecurity ; - struct __anonstruct_MountVolume_67 MountVolume ; - struct __anonstruct_VerifyVolume_68 VerifyVolume ; - struct __anonstruct_Scsi_69 Scsi ; - struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations ; - struct __anonstruct_QueryInterface_71 QueryInterface ; - struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities ; - struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements ; - struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig ; - struct __anonstruct_SetLock_75 SetLock ; - struct __anonstruct_QueryId_76 QueryId ; - struct __anonstruct_QueryDeviceText_77 QueryDeviceText ; - struct __anonstruct_UsageNotification_78 UsageNotification ; - struct __anonstruct_WaitWake_79 WaitWake ; - struct __anonstruct_PowerSequence_80 PowerSequence ; - struct __anonstruct_Power_81 Power ; - struct __anonstruct_StartDevice_82 StartDevice ; - struct __anonstruct_WMI_83 WMI ; - struct __anonstruct_Others_84 Others ; + struct __anonstruct_Create_56 Create; + struct __anonstruct_Read_57 Read; + struct __anonstruct_Write_58 Write; + struct __anonstruct_QueryFile_59 QueryFile; + struct __anonstruct_SetFile_60 SetFile; + struct __anonstruct_QueryVolume_63 QueryVolume; + struct __anonstruct_DeviceIoControl_64 DeviceIoControl; + struct __anonstruct_QuerySecurity_65 QuerySecurity; + struct __anonstruct_SetSecurity_66 SetSecurity; + struct __anonstruct_MountVolume_67 MountVolume; + struct __anonstruct_VerifyVolume_68 VerifyVolume; + struct __anonstruct_Scsi_69 Scsi; + struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations; + struct __anonstruct_QueryInterface_71 QueryInterface; + struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities; + struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements; + struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig; + struct __anonstruct_SetLock_75 SetLock; + struct __anonstruct_QueryId_76 QueryId; + struct __anonstruct_QueryDeviceText_77 QueryDeviceText; + struct __anonstruct_UsageNotification_78 UsageNotification; + struct __anonstruct_WaitWake_79 WaitWake; + struct __anonstruct_PowerSequence_80 PowerSequence; + struct __anonstruct_Power_81 Power; + struct __anonstruct_StartDevice_82 StartDevice; + struct __anonstruct_WMI_83 WMI; + struct __anonstruct_Others_84 Others; }; struct _IO_STACK_LOCATION { - UCHAR MajorFunction ; - UCHAR MinorFunction ; - UCHAR Flags ; - UCHAR Control ; - union __anonunion_Parameters_55 Parameters ; - PDEVICE_OBJECT DeviceObject ; - PFILE_OBJECT FileObject ; - NTSTATUS (*CompletionRoutine)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - PVOID Context ; + UCHAR MajorFunction; + UCHAR MinorFunction; + UCHAR Flags; + UCHAR Control; + union __anonunion_Parameters_55 Parameters; + PDEVICE_OBJECT DeviceObject; + PFILE_OBJECT FileObject; + NTSTATUS(*CompletionRoutine) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + PVOID Context; }; typedef struct _IO_STACK_LOCATION IO_STACK_LOCATION; typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION; #pragma pack(pop) struct _CONFIGURATION_INFORMATION { - ULONG DiskCount ; - ULONG FloppyCount ; - ULONG CdRomCount ; - ULONG TapeCount ; - ULONG ScsiPortCount ; - ULONG SerialCount ; - ULONG ParallelCount ; - BOOLEAN AtDiskPrimaryAddressClaimed ; - BOOLEAN AtDiskSecondaryAddressClaimed ; - ULONG Version ; - ULONG MediumChangerCount ; + ULONG DiskCount; + ULONG FloppyCount; + ULONG CdRomCount; + ULONG TapeCount; + ULONG ScsiPortCount; + ULONG SerialCount; + ULONG ParallelCount; + BOOLEAN AtDiskPrimaryAddressClaimed; + BOOLEAN AtDiskSecondaryAddressClaimed; + ULONG Version; + ULONG MediumChangerCount; }; typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION; typedef struct _CONFIGURATION_INFORMATION *PCONFIGURATION_INFORMATION; struct _OBJECT_HANDLE_INFORMATION { - ULONG HandleAttributes ; - ACCESS_MASK GrantedAccess ; + ULONG HandleAttributes; + ACCESS_MASK GrantedAccess; }; typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION; struct _STORAGE_DEVICE_NUMBER { - ULONG DeviceType ; - ULONG DeviceNumber ; - ULONG PartitionNumber ; + ULONG DeviceType; + ULONG DeviceNumber; + ULONG PartitionNumber; }; typedef struct _STORAGE_DEVICE_NUMBER STORAGE_DEVICE_NUMBER; struct _DISK_PERFORMANCE { - LARGE_INTEGER BytesRead ; - LARGE_INTEGER BytesWritten ; - LARGE_INTEGER ReadTime ; - LARGE_INTEGER WriteTime ; - LARGE_INTEGER IdleTime ; - ULONG ReadCount ; - ULONG WriteCount ; - ULONG QueueDepth ; - ULONG SplitCount ; - LARGE_INTEGER QueryTime ; - ULONG StorageDeviceNumber ; - WCHAR StorageManagerName[8] ; + LARGE_INTEGER BytesRead; + LARGE_INTEGER BytesWritten; + LARGE_INTEGER ReadTime; + LARGE_INTEGER WriteTime; + LARGE_INTEGER IdleTime; + ULONG ReadCount; + ULONG WriteCount; + ULONG QueueDepth; + ULONG SplitCount; + LARGE_INTEGER QueryTime; + ULONG StorageDeviceNumber; + WCHAR StorageManagerName[8]; }; typedef struct _DISK_PERFORMANCE DISK_PERFORMANCE; typedef struct _DISK_PERFORMANCE *PDISK_PERFORMANCE; -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _VOLUME_NUMBER { - ULONG VolumeNumber ; - WCHAR VolumeManagerName[8] ; + ULONG VolumeNumber; + WCHAR VolumeManagerName[8]; }; typedef struct _VOLUME_NUMBER VOLUME_NUMBER; struct _MOUNTDEV_NAME { - USHORT NameLength ; - WCHAR Name[1] ; + USHORT NameLength; + WCHAR Name[1]; }; typedef struct _MOUNTDEV_NAME MOUNTDEV_NAME; typedef struct _MOUNTDEV_NAME *PMOUNTDEV_NAME; struct _WMI_DISK_PERFORMANCE { - LONGLONG BytesRead ; - LONGLONG BytesWritten ; - LONGLONG ReadTime ; - LONGLONG WriteTime ; - LONGLONG IdleTime ; - ULONG ReadCount ; - ULONG WriteCount ; - ULONG QueueDepth ; - ULONG SplitCount ; - LONGLONG QueryTime ; - ULONG StorageDeviceNumber ; - USHORT StorageManagerName[8] ; + LONGLONG BytesRead; + LONGLONG BytesWritten; + LONGLONG ReadTime; + LONGLONG WriteTime; + LONGLONG IdleTime; + ULONG ReadCount; + ULONG WriteCount; + ULONG QueueDepth; + ULONG SplitCount; + LONGLONG QueryTime; + ULONG StorageDeviceNumber; + USHORT StorageManagerName[8]; }; typedef struct _WMI_DISK_PERFORMANCE WMI_DISK_PERFORMANCE; typedef struct _WMI_DISK_PERFORMANCE *PWMI_DISK_PERFORMANCE; struct __anonstruct_WMIGUIDREGINFO_130 { - LPCGUID Guid ; - ULONG InstanceCount ; - ULONG Flags ; + LPCGUID Guid; + ULONG InstanceCount; + ULONG Flags; }; typedef struct __anonstruct_WMIGUIDREGINFO_130 WMIGUIDREGINFO; typedef struct __anonstruct_WMIGUIDREGINFO_130 *PWMIGUIDREGINFO; enum __anonenum_WMIENABLEDISABLECONTROL_131 { - WmiEventControl = 0, - WmiDataBlockControl = 1 -} ; + WmiEventControl = 0, + WmiDataBlockControl = 1 +}; typedef enum __anonenum_WMIENABLEDISABLECONTROL_131 WMIENABLEDISABLECONTROL; struct _WMILIB_CONTEXT { - ULONG GuidCount ; - PWMIGUIDREGINFO GuidList ; - NTSTATUS (*QueryWmiRegInfo)(PDEVICE_OBJECT DeviceObject , PULONG RegFlags , PUNICODE_STRING InstanceName , - PUNICODE_STRING *RegistryPath , PUNICODE_STRING MofResourceName , - PDEVICE_OBJECT *Pdo ) ; - NTSTATUS (*QueryWmiDataBlock)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray , - ULONG BufferAvail , PUCHAR Buffer ) ; - NTSTATUS (*SetWmiDataBlock)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG BufferSize , PUCHAR Buffer ) ; - NTSTATUS (*SetWmiDataItem)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG DataItemId , ULONG BufferSize , - PUCHAR Buffer ) ; - NTSTATUS (*ExecuteWmiMethod)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG MethodId , ULONG InBufferSize , - ULONG OutBufferSize , PUCHAR Buffer ) ; - NTSTATUS (*WmiFunctionControl)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - WMIENABLEDISABLECONTROL Function , BOOLEAN Enable ) ; + ULONG GuidCount; + PWMIGUIDREGINFO GuidList; + NTSTATUS(*QueryWmiRegInfo) + (PDEVICE_OBJECT DeviceObject, PULONG RegFlags, PUNICODE_STRING InstanceName, + PUNICODE_STRING *RegistryPath, PUNICODE_STRING MofResourceName, + PDEVICE_OBJECT *Pdo); + NTSTATUS(*QueryWmiDataBlock) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG InstanceCount, PULONG InstanceLengthArray, ULONG BufferAvail, + PUCHAR Buffer); + NTSTATUS(*SetWmiDataBlock) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG BufferSize, PUCHAR Buffer); + NTSTATUS(*SetWmiDataItem) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG DataItemId, ULONG BufferSize, PUCHAR Buffer); + NTSTATUS(*ExecuteWmiMethod) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG MethodId, ULONG InBufferSize, ULONG OutBufferSize, PUCHAR Buffer); + NTSTATUS(*WmiFunctionControl) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, + WMIENABLEDISABLECONTROL Function, BOOLEAN Enable); }; typedef struct _WMILIB_CONTEXT WMILIB_CONTEXT; typedef struct _WMILIB_CONTEXT *PWMILIB_CONTEXT; enum __anonenum_SYSCTL_IRP_DISPOSITION_132 { - IrpProcessed = 0, - IrpNotCompleted = 1, - IrpNotWmi = 2, - IrpForward = 3 -} ; + IrpProcessed = 0, + IrpNotCompleted = 1, + IrpNotWmi = 2, + IrpForward = 3 +}; typedef enum __anonenum_SYSCTL_IRP_DISPOSITION_132 SYSCTL_IRP_DISPOSITION; typedef enum __anonenum_SYSCTL_IRP_DISPOSITION_132 *PSYSCTL_IRP_DISPOSITION; struct _DEVICE_EXTENSION { - PDEVICE_OBJECT DeviceObject ; - PDEVICE_OBJECT TargetDeviceObject ; - PDEVICE_OBJECT PhysicalDeviceObject ; - ULONG DiskNumber ; - WCHAR StorageManagerName[8] ; - ULONG Processors ; - PDISK_PERFORMANCE DiskCounters ; - LARGE_INTEGER LastIdleClock ; - LONG QueueDepth ; - LONG CountersEnabled ; - KEVENT PagingPathCountEvent ; - ULONG PagingPathCount ; - UNICODE_STRING PhysicalDeviceName ; - WCHAR PhysicalDeviceNameBuffer[64] ; - WMILIB_CONTEXT WmilibContext ; + PDEVICE_OBJECT DeviceObject; + PDEVICE_OBJECT TargetDeviceObject; + PDEVICE_OBJECT PhysicalDeviceObject; + ULONG DiskNumber; + WCHAR StorageManagerName[8]; + ULONG Processors; + PDISK_PERFORMANCE DiskCounters; + LARGE_INTEGER LastIdleClock; + LONG QueueDepth; + LONG CountersEnabled; + KEVENT PagingPathCountEvent; + ULONG PagingPathCount; + UNICODE_STRING PhysicalDeviceName; + WCHAR PhysicalDeviceNameBuffer[64]; + WMILIB_CONTEXT WmilibContext; }; typedef struct _DEVICE_EXTENSION DEVICE_EXTENSION; typedef struct _DEVICE_EXTENSION *PDEVICE_EXTENSION; -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1478,1719 +1510,1715 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -extern void *memcpy(void * , void const * , size_t ) ; -extern void *memset(void * , int , size_t ) ; -PCCHAR KeNumberProcessors ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; +extern void *memcpy(void *, void const *, size_t); +extern void *memset(void *, int, size_t); +PCCHAR KeNumberProcessors; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -extern LONG InterlockedIncrement(PLONG Addend ) ; -extern LONG InterlockedDecrement(PLONG Addend ) ; -extern LONG InterlockedExchange(PLONG Target , - LONG Value ) ; -#pragma warning(disable:4035) - ULONG KeGetCurrentProcessorNumber(void) -{ +extern LONG InterlockedIncrement(PLONG Addend); +extern LONG InterlockedDecrement(PLONG Addend); +extern LONG InterlockedExchange(PLONG Target, LONG Value); +#pragma warning(disable : 4035) +ULONG KeGetCurrentProcessorNumber(void) { - { - return (0UL); -} + { return (0UL); } } #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; -extern void KeQuerySystemTime(PLARGE_INTEGER CurrentTime ) ; - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; - void ExFreePool(PVOID P ) ; - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; - void MmUnlockPages(PMDL MemoryDescriptorList ) ; - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; - void MmFreeContiguousMemory(PVOID BaseAddress ) ; - void MmResetDriverPaging(PVOID AddressWithinSection ) ; - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) -extern PVOID IoAllocateErrorLogEntry(PVOID IoObject , - UCHAR EntrySize ) ; - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; - void IoFreeIrp(PIRP Irp ) ; - void IoFreeMdl(PMDL Mdl ) ; - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; - void IoReleaseCancelSpinLock(KIRQL Irql ) ; - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; -extern void IoWriteErrorLogEntry(PVOID ElEntry ) ; -extern NTSTATUS IoWMIRegistrationControl(PDEVICE_OBJECT DeviceObject , - ULONG Action ) ; - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -extern LARGE_INTEGER KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFrequency ) ; -#pragma warning(disable:4200) -#pragma warning(default:4200) - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void PoStartNextPowerIrp(PIRP Irp ) ; - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; - void ObfDereferenceObject(PVOID Object ) ; - NTSTATUS ZwClose(HANDLE Handle ) ; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +extern void KeQuerySystemTime(PLARGE_INTEGER CurrentTime); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +void ExFreePool(PVOID P); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +void MmUnlockPages(PMDL MemoryDescriptorList); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmResetDriverPaging(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +extern PVOID IoAllocateErrorLogEntry(PVOID IoObject, UCHAR EntrySize); +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoFreeIrp(PIRP Irp); +void IoFreeMdl(PMDL Mdl); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +extern void IoWriteErrorLogEntry(PVOID ElEntry); +extern NTSTATUS IoWMIRegistrationControl(PDEVICE_OBJECT DeviceObject, + ULONG Action); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +extern LARGE_INTEGER +KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFrequency); +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +void ObfDereferenceObject(PVOID Object); +NTSTATUS ZwClose(HANDLE Handle); #pragma once - struct _GUID const DiskClassGuid = {1408590599L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const CdRomClassGuid = {1408590600L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const PartitionClassGuid = {1408590602L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const TapeClassGuid = {1408590603L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const WriteOnceDiskClassGuid = {1408590604L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const VolumeClassGuid = {1408590605L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const MediumChangerClassGuid = {1408590608L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const FloppyClassGuid = {1408590609L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const CdChangerClassGuid = {1408590610L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const StoragePortClassGuid = {718077536L, 49456, 4562, {176, 130, 0, 160, 201, 30, 251, 139}}; -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) +struct _GUID const DiskClassGuid = { + 1408590599L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const CdRomClassGuid = { + 1408590600L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const PartitionClassGuid = { + 1408590602L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const TapeClassGuid = { + 1408590603L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const WriteOnceDiskClassGuid = { + 1408590604L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const VolumeClassGuid = { + 1408590605L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const MediumChangerClassGuid = { + 1408590608L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const FloppyClassGuid = { + 1408590609L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const CdChangerClassGuid = { + 1408590610L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const StoragePortClassGuid = { + 718077536L, 49456, 4562, {176, 130, 0, 160, 201, 30, 251, 139}}; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma once #pragma once -extern int swprintf(wchar_t * , wchar_t const * , ...) ; +extern int swprintf(wchar_t *, wchar_t const *, ...); #pragma once #pragma once - struct _GUID const MOUNTDEV_MOUNTED_DEVICE_GUID = {1408590605, - 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; -#pragma warning(disable:4200) - struct _GUID const MSWmi_MofData_GUID = {93327905, 54630, 4561, {178, 240, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSWmi_ProviderInfo_GUID = {3351197136U, 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSWmi_PnPDeviceId_GUID = {3351197138U, 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSWmi_PnPInstanceNames_GUID = {3351197139U, - 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSSmBios_RawSMBiosTables_GUID = {2405959760U, - 42372, 4561, {191, 56, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSPower_DeviceEnable_GUID = {2189167215U, - 65200, 4560, {189, 38, 0, 170, 0, 183, 179, 42}}; - struct _GUID const MSPower_DeviceWakeEnable_GUID = {2840881794U, - 65200, 4560, {189, 38, 0, 170, 0, 183, 179, 42}}; - struct _GUID const MSNdis_NetworkAddress_GUID = {3049101495U, - 513, 4561, {165, 14, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSNdis_NetworkShortAddress_GUID = {3049101496U, - 513, 4561, {165, 14, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSNdis_NetworkLinkSpeed_GUID = {1627155287, - 3942, 4561, {150, 167, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EnumerateAdapter_GUID = {2552180095U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_NotifyAdapterRemoval_GUID = {2552180096U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_NotifyAdapterArrival_GUID = {2552180097U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_NdisEnumerateVc_GUID = {2552180098U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_NotifyVcRemoval_GUID = {2552180089U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_NotifyVcArrival_GUID = {405773836, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_HardwareStatus_GUID = {1589707604, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MediaSupported_GUID = {1589707605, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MediaInUse_GUID = {1589707606, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MaximumLookahead_GUID = {1589707607, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MaximumFrameSize_GUID = {1589707608, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_LinkSpeed_GUID = {1589707609, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TransmitBufferSpace_GUID = {1589707610, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_ReceiveBufferSpace_GUID = {1589707611, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TransmitBlockSize_GUID = {1589707612, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_ReceiveBlockSize_GUID = {1589707613, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_VendorID_GUID = {1589707614, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_VendorDescription_GUID = {1589707615, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CurrentPacketFilter_GUID = {1589707616, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CurrentLookahead_GUID = {1589707617, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_DriverVersion_GUID = {1589707618, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MaximumTotalSize_GUID = {1589707619, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MacOptions_GUID = {1589707621, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MediaConnectStatus_GUID = {1589707622, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MaximumSendPackets_GUID = {1589707623, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_VendorDriverVersion_GUID = {1148802809, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TransmitsOk_GUID = {1148802810, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_ReceivesOk_GUID = {1148802811, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TransmitsError_GUID = {1148802812, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_ReceiveError_GUID = {1148802813, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_ReceiveNoBuffer_GUID = {1148802814, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoHardwareStatus_GUID = {2031800722, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoMediaSupported_GUID = {2031800723, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoMediaInUse_GUID = {2031800724, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoLinkSpeed_GUID = {2031800725, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoVendorId_GUID = {2031800726, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoVendorDescription_GUID = {2031800727, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoDriverVersion_GUID = {2031800728, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoMacOptions_GUID = {2031800730, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoMediaConnectStatus_GUID = {2031800731, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoVendorDriverVersion_GUID = {2031800732, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoMinimumLinkSpeed_GUID = {2031800733, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoTransmitPdusOk_GUID = {169953285, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoReceivePdusOk_GUID = {169953286, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoTransmitPduErrors_GUID = {169953287, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoReceivePduErrors_GUID = {169953288, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoReceivePdusNoBuffer_GUID = {169953289, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmSupportedVcRates_GUID = {2031800734, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmSupportedServiceCategory_GUID = {2031800735, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmSupportedAalTypes_GUID = {2031800736, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmHardwareCurrentAddress_GUID = {2031800737, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxActiveVcs_GUID = {2031800738, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxActiveVciBits_GUID = {2031800739, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxActiveVpiBits_GUID = {2031800740, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxAal0PacketSize_GUID = {2031800741, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxAal1PacketSize_GUID = {2031800742, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxAal34PacketSize_GUID = {2031800743, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxAal5PacketSize_GUID = {2031800721, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmReceiveCellsOk_GUID = {169953290, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmTransmitCellsOk_GUID = {169953291, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmReceiveCellsDropped_GUID = {169953292, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetPermanentAddress_GUID = {1148802815, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetCurrentAddress_GUID = {1148802816, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetMulticastList_GUID = {1148802817, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetMaximumMulticastListSize_GUID = {1148802818, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetMacOptions_GUID = {1148802819, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetReceiveErrorAlignment_GUID = {1148802820, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetOneTransmitCollision_GUID = {1148802821, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetMoreTransmitCollisions_GUID = {1148802822, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingPermanentAddress_GUID = {1148802823, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingCurrentAddress_GUID = {1148802824, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingCurrentFunctional_GUID = {1148802825, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingCurrentGroup_GUID = {1148802826, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingLastOpenStatus_GUID = {1148802827, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingCurrentRingStatus_GUID = {2299148012U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingCurrentRingState_GUID = {2901491762U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingLineErrors_GUID = {2901491763U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingLostFrames_GUID = {2901491764U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLongPermanentAddress_GUID = {2901491765U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLongCurrentAddress_GUID = {2901491766U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLongMulticastList_GUID = {2901491767U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLongMaximumListSize_GUID = {2901491768U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiShortPermanentAddress_GUID = {2901491769U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiShortCurrentAddress_GUID = {2901491770U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiShortMulticastList_GUID = {2901491771U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiShortMaximumListSize_GUID = {2901491772U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiAttachmentType_GUID = {2901491773U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiUpstreamNodeLong_GUID = {2901491774U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiDownstreamNodeLong_GUID = {2901491775U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiFrameErrors_GUID = {2901491776U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiFramesLost_GUID = {2901491777U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiRingManagmentState_GUID = {2901491778U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLctFailures_GUID = {2901491779U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLemRejects_GUID = {2901491780U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLConnectionState_GUID = {2901491781U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusResetStart_GUID = {2552180086U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusResetEnd_GUID = {2552180087U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusMediaConnect_GUID = {2552180093U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusMediaDisconnect_GUID = {2552180094U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusMediaSpecificIndication_GUID = {2552180100U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusLinkSpeedChange_GUID = {2552180101U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusProtocolBind_GUID = {1410552604, - 45555, 4560, {215, 141, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusProtocolUnbind_GUID = {1849483756, - 45555, 4560, {215, 141, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSKeyboard_PortInformation_GUID = {1194457242, - 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSMouse_PortInformation_GUID = {1194457244, - 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSMouse_ClassInformation_GUID = {1194457243, - 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSKeyboard_ClassInformation_GUID = {1194457241, - 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSAcpi_ThermalZoneTemperature_GUID = {2713458880U, - 42952, 4561, {191, 60, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSDiskDriver_Geometry_GUID = {620789585, - 22466, 4561, {165, 40, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSDiskDriver_PerformanceData_GUID = {3185075666U, - 55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSDiskDriver_Performance_GUID = {3185075665U, - 55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSStorageDriver_FailurePredictStatus_GUID = {2028716290, - 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSStorageDriver_FailurePredictData_GUID = {2028716291, - 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSStorageDriver_FailurePredictEvent_GUID = {2028716292, - 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSStorageDriver_FailurePredictFunction_GUID = {2028716293, - 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSIde_PortDeviceInfo_GUID = {1408590607, - 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const MSSerial_PortName_GUID = {2699825576U, 45420, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; - struct _GUID const MSSerial_CommInfo_GUID = {3987827298U, 45420, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; - struct _GUID const MSSerial_HardwareConfiguration_GUID = {655072134, - 45421, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; - struct _GUID const MSSerial_PerformanceInformation_GUID = {1447123660, - 45421, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; - struct _GUID const MSSerial_CommProperties_GUID = {2181688362U, - 11627, 4562, {186, 73, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSParallel_AllocFreeCounts_GUID = {1270573546, - 26707, 4562, {142, 206, 0, 192, 79, 142, 244, 129}}; - struct _GUID const MSParallel_DeviceBytesTransferred_GUID = {2315186902U, - 25931, 4562, {158, 21, 0, 192, 79, 142, 244, 129}}; - struct _GUID const MSRedbook_DriverInformationGuid = {3104133351U, - 44554, 4561, {165, 113, 0, 192, 79, 163, 71, 48}}; - struct _GUID const MSRedbook_PerformanceGuid = {3104133352U, - 44554, 4561, {165, 113, 0, 192, 79, 163, 71, 48}}; - struct _GUID const RegisteredGuids_GUID = {3823105981U, 14613, 4562, {145, 3, 0, 192, 79, 185, 152, 162}}; - struct _GUID const DiskPerfGuid = {3185075665U, 55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}}; - struct _GUID const THERMAL_ZONE_GUID = {2713458880U, 42952, 4561, {191, 60, 0, 160, 201, 6, 41, 16}}; - struct _GUID const GlobalLoggerGuid = {3901786812U, 43652, 4562, {154, 147, 0, 128, 95, 133, 215, 198}}; - struct _GUID const GenericMessageGuid = {2369794079U, 43850, 4562, {154, 147, 0, 128, 95, 133, 215, 198}}; - struct _GUID const ProcessGuid = {1030727888, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; - struct _GUID const ThreadGuid = {1030727889, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; - struct _GUID const HardFaultGuid = {1030727890, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; - struct _GUID const PageFaultGuid = {1030727891, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; - struct _GUID const DiskIoGuid = {1030727892, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; - struct _GUID const FileIoGuid = {2429279289U, 19006, 4561, {132, 244, 0, 0, 248, 4, 100, 227}}; - struct _GUID const TcpIpGuid = {2586315456U, 51424, 4561, {132, 226, 0, 192, 79, 185, 152, 162}}; - struct _GUID const UdpIpGuid = {3208270021U, 43465, 18824, {160, 5, 45, 240, 183, 200, 15, 128}}; - struct _GUID const ImageLoadGuid = {749821213, 24513, 4562, {171, 225, 0, 160, 201, 17, 245, 24}}; - struct _GUID const RegistryGuid = {2924704302U, 51299, 4562, {134, 89, 0, 192, 79, 163, 33, 161}}; - struct _GUID const TraceErrorGuid = {964792796, 11687, 4563, {139, 152, 0, 128, 95, 133, 215, 198}}; +struct _GUID const MOUNTDEV_MOUNTED_DEVICE_GUID = { + 1408590605, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +#pragma warning(disable : 4200) +struct _GUID const MSWmi_MofData_GUID = { + 93327905, 54630, 4561, {178, 240, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSWmi_ProviderInfo_GUID = { + 3351197136U, 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSWmi_PnPDeviceId_GUID = { + 3351197138U, 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSWmi_PnPInstanceNames_GUID = { + 3351197139U, 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSSmBios_RawSMBiosTables_GUID = { + 2405959760U, 42372, 4561, {191, 56, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSPower_DeviceEnable_GUID = { + 2189167215U, 65200, 4560, {189, 38, 0, 170, 0, 183, 179, 42}}; +struct _GUID const MSPower_DeviceWakeEnable_GUID = { + 2840881794U, 65200, 4560, {189, 38, 0, 170, 0, 183, 179, 42}}; +struct _GUID const MSNdis_NetworkAddress_GUID = { + 3049101495U, 513, 4561, {165, 14, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSNdis_NetworkShortAddress_GUID = { + 3049101496U, 513, 4561, {165, 14, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSNdis_NetworkLinkSpeed_GUID = { + 1627155287, 3942, 4561, {150, 167, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EnumerateAdapter_GUID = { + 2552180095U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_NotifyAdapterRemoval_GUID = { + 2552180096U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_NotifyAdapterArrival_GUID = { + 2552180097U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_NdisEnumerateVc_GUID = { + 2552180098U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_NotifyVcRemoval_GUID = { + 2552180089U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_NotifyVcArrival_GUID = { + 405773836, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_HardwareStatus_GUID = { + 1589707604, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MediaSupported_GUID = { + 1589707605, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MediaInUse_GUID = { + 1589707606, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MaximumLookahead_GUID = { + 1589707607, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MaximumFrameSize_GUID = { + 1589707608, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_LinkSpeed_GUID = { + 1589707609, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TransmitBufferSpace_GUID = { + 1589707610, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_ReceiveBufferSpace_GUID = { + 1589707611, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TransmitBlockSize_GUID = { + 1589707612, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_ReceiveBlockSize_GUID = { + 1589707613, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_VendorID_GUID = { + 1589707614, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_VendorDescription_GUID = { + 1589707615, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CurrentPacketFilter_GUID = { + 1589707616, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CurrentLookahead_GUID = { + 1589707617, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_DriverVersion_GUID = { + 1589707618, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MaximumTotalSize_GUID = { + 1589707619, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MacOptions_GUID = { + 1589707621, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MediaConnectStatus_GUID = { + 1589707622, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MaximumSendPackets_GUID = { + 1589707623, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_VendorDriverVersion_GUID = { + 1148802809, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TransmitsOk_GUID = { + 1148802810, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_ReceivesOk_GUID = { + 1148802811, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TransmitsError_GUID = { + 1148802812, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_ReceiveError_GUID = { + 1148802813, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_ReceiveNoBuffer_GUID = { + 1148802814, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoHardwareStatus_GUID = { + 2031800722, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoMediaSupported_GUID = { + 2031800723, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoMediaInUse_GUID = { + 2031800724, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoLinkSpeed_GUID = { + 2031800725, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoVendorId_GUID = { + 2031800726, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoVendorDescription_GUID = { + 2031800727, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoDriverVersion_GUID = { + 2031800728, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoMacOptions_GUID = { + 2031800730, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoMediaConnectStatus_GUID = { + 2031800731, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoVendorDriverVersion_GUID = { + 2031800732, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoMinimumLinkSpeed_GUID = { + 2031800733, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoTransmitPdusOk_GUID = { + 169953285, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoReceivePdusOk_GUID = { + 169953286, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoTransmitPduErrors_GUID = { + 169953287, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoReceivePduErrors_GUID = { + 169953288, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoReceivePdusNoBuffer_GUID = { + 169953289, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmSupportedVcRates_GUID = { + 2031800734, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmSupportedServiceCategory_GUID = { + 2031800735, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmSupportedAalTypes_GUID = { + 2031800736, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmHardwareCurrentAddress_GUID = { + 2031800737, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxActiveVcs_GUID = { + 2031800738, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxActiveVciBits_GUID = { + 2031800739, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxActiveVpiBits_GUID = { + 2031800740, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxAal0PacketSize_GUID = { + 2031800741, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxAal1PacketSize_GUID = { + 2031800742, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxAal34PacketSize_GUID = { + 2031800743, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxAal5PacketSize_GUID = { + 2031800721, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmReceiveCellsOk_GUID = { + 169953290, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmTransmitCellsOk_GUID = { + 169953291, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmReceiveCellsDropped_GUID = { + 169953292, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetPermanentAddress_GUID = { + 1148802815, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetCurrentAddress_GUID = { + 1148802816, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetMulticastList_GUID = { + 1148802817, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetMaximumMulticastListSize_GUID = { + 1148802818, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetMacOptions_GUID = { + 1148802819, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetReceiveErrorAlignment_GUID = { + 1148802820, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetOneTransmitCollision_GUID = { + 1148802821, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetMoreTransmitCollisions_GUID = { + 1148802822, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingPermanentAddress_GUID = { + 1148802823, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingCurrentAddress_GUID = { + 1148802824, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingCurrentFunctional_GUID = { + 1148802825, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingCurrentGroup_GUID = { + 1148802826, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingLastOpenStatus_GUID = { + 1148802827, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingCurrentRingStatus_GUID = { + 2299148012U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingCurrentRingState_GUID = { + 2901491762U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingLineErrors_GUID = { + 2901491763U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingLostFrames_GUID = { + 2901491764U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLongPermanentAddress_GUID = { + 2901491765U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLongCurrentAddress_GUID = { + 2901491766U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLongMulticastList_GUID = { + 2901491767U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLongMaximumListSize_GUID = { + 2901491768U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiShortPermanentAddress_GUID = { + 2901491769U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiShortCurrentAddress_GUID = { + 2901491770U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiShortMulticastList_GUID = { + 2901491771U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiShortMaximumListSize_GUID = { + 2901491772U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiAttachmentType_GUID = { + 2901491773U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiUpstreamNodeLong_GUID = { + 2901491774U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiDownstreamNodeLong_GUID = { + 2901491775U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiFrameErrors_GUID = { + 2901491776U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiFramesLost_GUID = { + 2901491777U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiRingManagmentState_GUID = { + 2901491778U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLctFailures_GUID = { + 2901491779U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLemRejects_GUID = { + 2901491780U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLConnectionState_GUID = { + 2901491781U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusResetStart_GUID = { + 2552180086U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusResetEnd_GUID = { + 2552180087U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusMediaConnect_GUID = { + 2552180093U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusMediaDisconnect_GUID = { + 2552180094U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusMediaSpecificIndication_GUID = { + 2552180100U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusLinkSpeedChange_GUID = { + 2552180101U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusProtocolBind_GUID = { + 1410552604, 45555, 4560, {215, 141, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusProtocolUnbind_GUID = { + 1849483756, 45555, 4560, {215, 141, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSKeyboard_PortInformation_GUID = { + 1194457242, 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSMouse_PortInformation_GUID = { + 1194457244, 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSMouse_ClassInformation_GUID = { + 1194457243, 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSKeyboard_ClassInformation_GUID = { + 1194457241, 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSAcpi_ThermalZoneTemperature_GUID = { + 2713458880U, 42952, 4561, {191, 60, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSDiskDriver_Geometry_GUID = { + 620789585, 22466, 4561, {165, 40, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSDiskDriver_PerformanceData_GUID = { + 3185075666U, 55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSDiskDriver_Performance_GUID = { + 3185075665U, 55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSStorageDriver_FailurePredictStatus_GUID = { + 2028716290, 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSStorageDriver_FailurePredictData_GUID = { + 2028716291, 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSStorageDriver_FailurePredictEvent_GUID = { + 2028716292, 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSStorageDriver_FailurePredictFunction_GUID = { + 2028716293, 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSIde_PortDeviceInfo_GUID = { + 1408590607, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const MSSerial_PortName_GUID = { + 2699825576U, 45420, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; +struct _GUID const MSSerial_CommInfo_GUID = { + 3987827298U, 45420, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; +struct _GUID const MSSerial_HardwareConfiguration_GUID = { + 655072134, 45421, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; +struct _GUID const MSSerial_PerformanceInformation_GUID = { + 1447123660, 45421, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; +struct _GUID const MSSerial_CommProperties_GUID = { + 2181688362U, 11627, 4562, {186, 73, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSParallel_AllocFreeCounts_GUID = { + 1270573546, 26707, 4562, {142, 206, 0, 192, 79, 142, 244, 129}}; +struct _GUID const MSParallel_DeviceBytesTransferred_GUID = { + 2315186902U, 25931, 4562, {158, 21, 0, 192, 79, 142, 244, 129}}; +struct _GUID const MSRedbook_DriverInformationGuid = { + 3104133351U, 44554, 4561, {165, 113, 0, 192, 79, 163, 71, 48}}; +struct _GUID const MSRedbook_PerformanceGuid = { + 3104133352U, 44554, 4561, {165, 113, 0, 192, 79, 163, 71, 48}}; +struct _GUID const RegisteredGuids_GUID = { + 3823105981U, 14613, 4562, {145, 3, 0, 192, 79, 185, 152, 162}}; +struct _GUID const DiskPerfGuid = { + 3185075665U, 55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}}; +struct _GUID const THERMAL_ZONE_GUID = { + 2713458880U, 42952, 4561, {191, 60, 0, 160, 201, 6, 41, 16}}; +struct _GUID const GlobalLoggerGuid = { + 3901786812U, 43652, 4562, {154, 147, 0, 128, 95, 133, 215, 198}}; +struct _GUID const GenericMessageGuid = { + 2369794079U, 43850, 4562, {154, 147, 0, 128, 95, 133, 215, 198}}; +struct _GUID const ProcessGuid = { + 1030727888, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; +struct _GUID const ThreadGuid = { + 1030727889, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; +struct _GUID const HardFaultGuid = { + 1030727890, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; +struct _GUID const PageFaultGuid = { + 1030727891, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; +struct _GUID const DiskIoGuid = { + 1030727892, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; +struct _GUID const FileIoGuid = { + 2429279289U, 19006, 4561, {132, 244, 0, 0, 248, 4, 100, 227}}; +struct _GUID const TcpIpGuid = { + 2586315456U, 51424, 4561, {132, 226, 0, 192, 79, 185, 152, 162}}; +struct _GUID const UdpIpGuid = { + 3208270021U, 43465, 18824, {160, 5, 45, 240, 183, 200, 15, 128}}; +struct _GUID const ImageLoadGuid = { + 749821213, 24513, 4562, {171, 225, 0, 160, 201, 17, 245, 24}}; +struct _GUID const RegistryGuid = { + 2924704302U, 51299, 4562, {134, 89, 0, 192, 79, 163, 33, 161}}; +struct _GUID const TraceErrorGuid = { + 964792796, 11687, 4563, {139, 152, 0, 128, 95, 133, 215, 198}}; #pragma once -extern NTSTATUS WmiCompleteRequest(PDEVICE_OBJECT DeviceObject , PIRP Irp , NTSTATUS Status , - ULONG BufferUsed , CCHAR PriorityBoost ) ; -NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo , PDEVICE_OBJECT DeviceObject , - PIRP Irp , PSYSCTL_IRP_DISPOSITION IrpDisposition ) ; -void errorFn(void) -{ +extern NTSTATUS WmiCompleteRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp, + NTSTATUS Status, ULONG BufferUsed, + CCHAR PriorityBoost); +NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo, + PDEVICE_OBJECT DeviceObject, PIRP Irp, + PSYSCTL_IRP_DISPOSITION IrpDisposition); +void errorFn(void) { { - ERROR: assert(0); - goto ERROR; -} + ERROR: + assert(0); + goto ERROR; + } } -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -int myStatus ; -int routine ; -void _BLAST_init(void) -{ +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +int myStatus; +int routine; +void _BLAST_init(void) { { - UNLOADED = 0; - NP = 1; - DC = 2; - SKIP1 = 3; - SKIP2 = 4; - MPR1 = 5; - MPR3 = 6; - IPC = 7; - s = UNLOADED; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - return; -} + UNLOADED = 0; + NP = 1; + DC = 2; + SKIP1 = 3; + SKIP2 = 4; + MPR1 = 5; + MPR3 = 6; + IPC = 7; + s = UNLOADED; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + return; + } } -UNICODE_STRING DiskPerfRegistryPath ; -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) ; -NTSTATUS DiskPerfForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) ; -NTSTATUS DiskPerfDispatchPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfDispatchPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfCreate(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfIoCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -NTSTATUS DiskPerfDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfShutdownFlush(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void DiskPerfUnload(PDRIVER_OBJECT DriverObject ) ; -NTSTATUS DiskPerfWmi(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void DiskPerfLogError(PDEVICE_OBJECT DeviceObject , ULONG UniqueId , NTSTATUS ErrorCode , - NTSTATUS Status ) ; -NTSTATUS DiskPerfRegisterDevice(PDEVICE_OBJECT DeviceObject ) ; -NTSTATUS DiskPerfIrpCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -NTSTATUS DiskperfQueryWmiRegInfo(PDEVICE_OBJECT DeviceObject , ULONG *RegFlags , PUNICODE_STRING InstanceName , - PUNICODE_STRING *RegistryPath , PUNICODE_STRING MofResourceName , - PDEVICE_OBJECT *Pdo ) ; -NTSTATUS DiskperfQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray , - ULONG BufferAvail , PUCHAR Buffer ) ; -void DiskPerfSyncFilterWithTarget(PDEVICE_OBJECT FilterDevice , PDEVICE_OBJECT TargetDevice ) ; -NTSTATUS DiskperfWmiFunctionControl(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - WMIENABLEDISABLECONTROL Function , BOOLEAN Enable ) ; -void DiskPerfAddCounters(PDISK_PERFORMANCE TotalCounters , PDISK_PERFORMANCE NewCounters , - LARGE_INTEGER Frequency ) ; -#pragma alloc_text(INIT,DriverEntry) -#pragma alloc_text(PAGE,DiskPerfAddDevice) -#pragma alloc_text(PAGE,DiskPerfDispatchPnp) -#pragma alloc_text(PAGE,DiskPerfStartDevice) -#pragma alloc_text(PAGE,DiskPerfRemoveDevice) -#pragma alloc_text(PAGE,DiskPerfUnload) -#pragma alloc_text(PAGE,DiskPerfWmi) -#pragma alloc_text(PAGE,DiskperfQueryWmiRegInfo) -#pragma alloc_text(PAGE,DiskPerfRegisterDevice) -#pragma alloc_text(PAGE,DiskPerfSyncFilterWithTarget) -WMIGUIDREGINFO DiskperfGuidList[1] = { {& DiskPerfGuid, 1, 0}}; -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) -{ PDRIVER_DISPATCH *dispatch = __VERIFIER_nondet_pointer() ; - PVOID tmp ; +UNICODE_STRING DiskPerfRegistryPath; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath); +NTSTATUS DiskPerfForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfAddDevice(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject); +NTSTATUS DiskPerfDispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfDispatchPower(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfSendToNextDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfReadWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfIoCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context); +NTSTATUS DiskPerfDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfShutdownFlush(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void DiskPerfUnload(PDRIVER_OBJECT DriverObject); +NTSTATUS DiskPerfWmi(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void DiskPerfLogError(PDEVICE_OBJECT DeviceObject, ULONG UniqueId, + NTSTATUS ErrorCode, NTSTATUS Status); +NTSTATUS DiskPerfRegisterDevice(PDEVICE_OBJECT DeviceObject); +NTSTATUS DiskPerfIrpCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context); +NTSTATUS DiskperfQueryWmiRegInfo(PDEVICE_OBJECT DeviceObject, ULONG *RegFlags, + PUNICODE_STRING InstanceName, + PUNICODE_STRING *RegistryPath, + PUNICODE_STRING MofResourceName, + PDEVICE_OBJECT *Pdo); +NTSTATUS DiskperfQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject, PIRP Irp, + ULONG GuidIndex, ULONG InstanceIndex, + ULONG InstanceCount, + PULONG InstanceLengthArray, + ULONG BufferAvail, PUCHAR Buffer); +void DiskPerfSyncFilterWithTarget(PDEVICE_OBJECT FilterDevice, + PDEVICE_OBJECT TargetDevice); +NTSTATUS DiskperfWmiFunctionControl(PDEVICE_OBJECT DeviceObject, PIRP Irp, + ULONG GuidIndex, + WMIENABLEDISABLECONTROL Function, + BOOLEAN Enable); +void DiskPerfAddCounters(PDISK_PERFORMANCE TotalCounters, + PDISK_PERFORMANCE NewCounters, + LARGE_INTEGER Frequency); +#pragma alloc_text(INIT, DriverEntry) +#pragma alloc_text(PAGE, DiskPerfAddDevice) +#pragma alloc_text(PAGE, DiskPerfDispatchPnp) +#pragma alloc_text(PAGE, DiskPerfStartDevice) +#pragma alloc_text(PAGE, DiskPerfRemoveDevice) +#pragma alloc_text(PAGE, DiskPerfUnload) +#pragma alloc_text(PAGE, DiskPerfWmi) +#pragma alloc_text(PAGE, DiskperfQueryWmiRegInfo) +#pragma alloc_text(PAGE, DiskPerfRegisterDevice) +#pragma alloc_text(PAGE, DiskPerfSyncFilterWithTarget) +WMIGUIDREGINFO DiskperfGuidList[1] = {{&DiskPerfGuid, 1, 0}}; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, + PUNICODE_STRING RegistryPath) { + PDRIVER_DISPATCH *dispatch = __VERIFIER_nondet_pointer(); + PVOID tmp; { - { - DiskPerfRegistryPath.MaximumLength = (unsigned int )RegistryPath->Length + sizeof((unsigned short)0); - tmp = ExAllocatePoolWithTag(1, DiskPerfRegistryPath.MaximumLength, 1718767684UL); - DiskPerfRegistryPath.Buffer = tmp; - } - if ((unsigned int )DiskPerfRegistryPath.Buffer != (unsigned int )((void *)0)) { { -/* RtlCopyUnicodeString(& DiskPerfRegistryPath, RegistryPath); */ /* INLINED */ + DiskPerfRegistryPath.MaximumLength = + (unsigned int)RegistryPath->Length + sizeof((unsigned short)0); + tmp = ExAllocatePoolWithTag(1, DiskPerfRegistryPath.MaximumLength, + 1718767684UL); + DiskPerfRegistryPath.Buffer = tmp; + } + if ((unsigned int)DiskPerfRegistryPath.Buffer != + (unsigned int)((void *)0)) { + { + /* RtlCopyUnicodeString(& DiskPerfRegistryPath, RegistryPath); */ /* INLINED */ + } + } else { + DiskPerfRegistryPath.Length = 0; + DiskPerfRegistryPath.MaximumLength = 0; } - } else { - DiskPerfRegistryPath.Length = 0; - DiskPerfRegistryPath.MaximumLength = 0; + *dispatch = &DiskPerfSendToNextDriver; + DriverObject->MajorFunction[0] = &DiskPerfCreate; + DriverObject->MajorFunction[3] = &DiskPerfReadWrite; + DriverObject->MajorFunction[4] = &DiskPerfReadWrite; + DriverObject->MajorFunction[14] = &DiskPerfDeviceControl; + DriverObject->MajorFunction[23] = &DiskPerfWmi; + DriverObject->MajorFunction[16] = &DiskPerfShutdownFlush; + DriverObject->MajorFunction[9] = &DiskPerfShutdownFlush; + DriverObject->MajorFunction[27] = &DiskPerfDispatchPnp; + DriverObject->MajorFunction[22] = &DiskPerfDispatchPower; + (DriverObject->DriverExtension)->AddDevice = &DiskPerfAddDevice; + DriverObject->DriverUnload = &DiskPerfUnload; + return (0L); } - *dispatch = & DiskPerfSendToNextDriver; - DriverObject->MajorFunction[0] = & DiskPerfCreate; - DriverObject->MajorFunction[3] = & DiskPerfReadWrite; - DriverObject->MajorFunction[4] = & DiskPerfReadWrite; - DriverObject->MajorFunction[14] = & DiskPerfDeviceControl; - DriverObject->MajorFunction[23] = & DiskPerfWmi; - DriverObject->MajorFunction[16] = & DiskPerfShutdownFlush; - DriverObject->MajorFunction[9] = & DiskPerfShutdownFlush; - DriverObject->MajorFunction[27] = & DiskPerfDispatchPnp; - DriverObject->MajorFunction[22] = & DiskPerfDispatchPower; - (DriverObject->DriverExtension)->AddDevice = & DiskPerfAddDevice; - DriverObject->DriverUnload = & DiskPerfUnload; - return (0L); -} -} -void DiskPerfSyncFilterWithTarget(PDEVICE_OBJECT FilterDevice , PDEVICE_OBJECT TargetDevice ) -{ ULONG propFlags ; - - { - propFlags = 0; - FilterDevice->Flags |= propFlags; - propFlags = TargetDevice->Characteristics & 7UL; - FilterDevice->Characteristics |= propFlags; - return; -} } -NTSTATUS DiskPerfAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) -{ NTSTATUS status ; - PDEVICE_OBJECT filterDeviceObject ; - PDEVICE_EXTENSION deviceExtension ; - ULONG registrationFlag ; - PWMILIB_CONTEXT wmilibContext ; - PCHAR buffer ; - ULONG buffersize ; - PVOID tmp ; +void DiskPerfSyncFilterWithTarget(PDEVICE_OBJECT FilterDevice, + PDEVICE_OBJECT TargetDevice) { + ULONG propFlags; { - { - registrationFlag = 0; - status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION ), (void *)0, 7, 0, - 0, & filterDeviceObject); + propFlags = 0; + FilterDevice->Flags |= propFlags; + propFlags = TargetDevice->Characteristics & 7UL; + FilterDevice->Characteristics |= propFlags; + return; } - if (! (status >= 0L)) { - return (status); - } else { +} +NTSTATUS DiskPerfAddDevice(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject) { + NTSTATUS status; + PDEVICE_OBJECT filterDeviceObject; + PDEVICE_EXTENSION deviceExtension; + ULONG registrationFlag; + PWMILIB_CONTEXT wmilibContext; + PCHAR buffer; + ULONG buffersize; + PVOID tmp; - } { - filterDeviceObject->Flags |= 16UL; - deviceExtension = (struct _DEVICE_EXTENSION *)filterDeviceObject->DeviceExtension; - memset(deviceExtension, 0, sizeof(DEVICE_EXTENSION )); - deviceExtension->LastIdleClock = KeQueryPerformanceCounter((void *)0); - deviceExtension->Processors = (unsigned long )*KeNumberProcessors; - buffersize = (ULONG )((long )(& ((DISK_PERFORMANCE *)0)->QueryTime)) * deviceExtension->Processors; - tmp = ExAllocatePoolWithTag(0, buffersize, 1718767684UL); - buffer = (CHAR *)tmp; - } - if ((unsigned int )buffer != (unsigned int )((void *)0)) { { - memset(buffer, 0, buffersize); - deviceExtension->DiskCounters = (struct _DISK_PERFORMANCE *)buffer; + registrationFlag = 0; + status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION), (void *)0, + 7, 0, 0, &filterDeviceObject); + } + if (!(status >= 0L)) { + return (status); + } else { } - } else { { - DiskPerfLogError(filterDeviceObject, 513, 0L, -1073479678L); + filterDeviceObject->Flags |= 16UL; + deviceExtension = + (struct _DEVICE_EXTENSION *)filterDeviceObject->DeviceExtension; + memset(deviceExtension, 0, sizeof(DEVICE_EXTENSION)); + deviceExtension->LastIdleClock = KeQueryPerformanceCounter((void *)0); + deviceExtension->Processors = (unsigned long)*KeNumberProcessors; + buffersize = (ULONG)((long)(&((DISK_PERFORMANCE *)0)->QueryTime)) * + deviceExtension->Processors; + tmp = ExAllocatePoolWithTag(0, buffersize, 1718767684UL); + buffer = (CHAR *)tmp; + } + if ((unsigned int)buffer != (unsigned int)((void *)0)) { + { + memset(buffer, 0, buffersize); + deviceExtension->DiskCounters = (struct _DISK_PERFORMANCE *)buffer; + } + } else { + { DiskPerfLogError(filterDeviceObject, 513, 0L, -1073479678L); } } - } - { - deviceExtension->PhysicalDeviceObject = PhysicalDeviceObject; - deviceExtension->TargetDeviceObject = IoAttachDeviceToDeviceStack(filterDeviceObject, - PhysicalDeviceObject); - } - if ((unsigned int )deviceExtension->TargetDeviceObject == (unsigned int )((void *)0)) { { -/* IoDeleteDevice(filterDeviceObject); */ /* INLINED */ + deviceExtension->PhysicalDeviceObject = PhysicalDeviceObject; + deviceExtension->TargetDeviceObject = + IoAttachDeviceToDeviceStack(filterDeviceObject, PhysicalDeviceObject); } - return (-1073741810L); - } else { - - } - { - deviceExtension->DeviceObject = filterDeviceObject; - deviceExtension->PhysicalDeviceName.Buffer = deviceExtension->PhysicalDeviceNameBuffer; -/* KeInitializeEvent(& deviceExtension->PagingPathCountEvent, 0, 1); */ /* INLINED */ - wmilibContext = & deviceExtension->WmilibContext; - memset(wmilibContext, 0, sizeof(WMILIB_CONTEXT )); - wmilibContext->GuidCount = sizeof(DiskperfGuidList) / sizeof(WMIGUIDREGINFO ); - wmilibContext->GuidList = DiskperfGuidList; - wmilibContext->QueryWmiRegInfo = & DiskperfQueryWmiRegInfo; - wmilibContext->QueryWmiDataBlock = & DiskperfQueryWmiDataBlock; - wmilibContext->WmiFunctionControl = & DiskperfWmiFunctionControl; - filterDeviceObject->Flags |= 8192UL; - filterDeviceObject->Flags &= 4294967167UL; + if ((unsigned int)deviceExtension->TargetDeviceObject == + (unsigned int)((void *)0)) { + { /* IoDeleteDevice(filterDeviceObject); */ /* INLINED */ + } + return (-1073741810L); + } else { + } + { + deviceExtension->DeviceObject = filterDeviceObject; + deviceExtension->PhysicalDeviceName.Buffer = + deviceExtension->PhysicalDeviceNameBuffer; + /* KeInitializeEvent(& deviceExtension->PagingPathCountEvent, 0, 1); */ /* INLINED */ + wmilibContext = &deviceExtension->WmilibContext; + memset(wmilibContext, 0, sizeof(WMILIB_CONTEXT)); + wmilibContext->GuidCount = + sizeof(DiskperfGuidList) / sizeof(WMIGUIDREGINFO); + wmilibContext->GuidList = DiskperfGuidList; + wmilibContext->QueryWmiRegInfo = &DiskperfQueryWmiRegInfo; + wmilibContext->QueryWmiDataBlock = &DiskperfQueryWmiDataBlock; + wmilibContext->WmiFunctionControl = &DiskperfWmiFunctionControl; + filterDeviceObject->Flags |= 8192UL; + filterDeviceObject->Flags &= 4294967167UL; + } + return (0L); } - return (0L); } -} -NTSTATUS DiskPerfDispatchPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - NTSTATUS status ; - NTSTATUS tmp ; +NTSTATUS DiskPerfDispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + NTSTATUS status; + NTSTATUS tmp; { - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - if (irpSp->MinorFunction == 0) { - goto switch_0_0; - } else { - if (irpSp->MinorFunction == 2) { - goto switch_0_2; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + if (irpSp->MinorFunction == 0) { + goto switch_0_0; } else { - { - goto switch_0_default; - if (0) { - switch_0_0: /* CIL Label */ - { - status = DiskPerfStartDevice(DeviceObject, Irp); - } - goto switch_0_break; - switch_0_2: /* CIL Label */ - { - status = DiskPerfRemoveDevice(DeviceObject, Irp); - } - goto switch_0_break; - switch_0_default: /* CIL Label */ + if (irpSp->MinorFunction == 2) { + goto switch_0_2; + } else { { - tmp = DiskPerfSendToNextDriver(DeviceObject, Irp); + goto switch_0_default; + if (0) { + switch_0_0 : /* CIL Label */ + { + status = DiskPerfStartDevice(DeviceObject, Irp); + } + goto switch_0_break; + switch_0_2 : /* CIL Label */ + { + status = DiskPerfRemoveDevice(DeviceObject, Irp); + } + goto switch_0_break; + switch_0_default : /* CIL Label */ + { + tmp = DiskPerfSendToNextDriver(DeviceObject, Irp); + } + return (tmp); + } else { + switch_0_break: /* CIL Label */; + } } - return (tmp); - } else { - switch_0_break: /* CIL Label */ ; - } } } + return (status); } - return (status); } -} -NTSTATUS DiskPerfIrpCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) -{ PKEVENT Event ; +NTSTATUS DiskPerfIrpCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context) { + PKEVENT Event; { - { - Event = (struct _KEVENT *)Context; - KeSetEvent(Event, 0, 0); + { + Event = (struct _KEVENT *)Context; + KeSetEvent(Event, 0, 0); + } + return (-1073741802L); } - return (-1073741802L); } -} -NTSTATUS DiskPerfStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - NTSTATUS status ; +NTSTATUS DiskPerfStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + NTSTATUS status; { - { - deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp); - DiskPerfSyncFilterWithTarget(DeviceObject, deviceExtension->TargetDeviceObject); - DiskPerfRegisterDevice(DeviceObject); - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + { + deviceExtension = + (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp); + DiskPerfSyncFilterWithTarget(DeviceObject, + deviceExtension->TargetDeviceObject); + DiskPerfRegisterDevice(DeviceObject); + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); } - return (status); -} } -NTSTATUS DiskPerfRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ NTSTATUS status ; - PDEVICE_EXTENSION deviceExtension ; - PWMILIB_CONTEXT wmilibContext ; +NTSTATUS DiskPerfRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + NTSTATUS status; + PDEVICE_EXTENSION deviceExtension; + PWMILIB_CONTEXT wmilibContext; { - { - deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - IoWMIRegistrationControl(DeviceObject, 2); - wmilibContext = & deviceExtension->WmilibContext; - InterlockedExchange((LONG *)(& wmilibContext->GuidCount), 0L); - memset(wmilibContext, 0, sizeof(WMILIB_CONTEXT )); - status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp); -/* IoDetachDevice(deviceExtension->TargetDeviceObject); */ /* INLINED */ -/* IoDeleteDevice(DeviceObject); */ /* INLINED */ - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + { + deviceExtension = + (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + IoWMIRegistrationControl(DeviceObject, 2); + wmilibContext = &deviceExtension->WmilibContext; + InterlockedExchange((LONG *)(&wmilibContext->GuidCount), 0L); + memset(wmilibContext, 0, sizeof(WMILIB_CONTEXT)); + status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp); + /* IoDetachDevice(deviceExtension->TargetDeviceObject); */ /* INLINED */ + /* IoDeleteDevice(DeviceObject); */ /* INLINED */ + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); } - return (status); } -} -NTSTATUS DiskPerfSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - NTSTATUS tmp ; +NTSTATUS DiskPerfSendToNextDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + NTSTATUS tmp; { - if (s == NP) { - s = SKIP1; - } else { + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } { - errorFn(); + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + deviceExtension = + (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); } + return (tmp); } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); - } - return (tmp); -} } -NTSTATUS DiskPerfDispatchPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - NTSTATUS tmp ; +NTSTATUS DiskPerfDispatchPower(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + NTSTATUS tmp; { - { -/* PoStartNextPowerIrp(Irp); */ /* INLINED */ - } - if (s == NP) { - s = SKIP1; - } else { + { /* PoStartNextPowerIrp(Irp); */ /* INLINED */ + } + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } { - errorFn(); + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + deviceExtension = + (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + tmp = PoCallDriver(deviceExtension->TargetDeviceObject, Irp); } + return (tmp); } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - tmp = PoCallDriver(deviceExtension->TargetDeviceObject, Irp); - } - return (tmp); -} } -NTSTATUS DiskPerfForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - KEVENT event ; - NTSTATUS status ; - PIO_STACK_LOCATION irpSp ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___0 ; +NTSTATUS DiskPerfForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + KEVENT event; + NTSTATUS status; + PIO_STACK_LOCATION irpSp; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___0; { - { -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine)); - nextIrpSp->Control = 0; - } - if (s != NP) { { - errorFn(); + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + deviceExtension = + (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + memcpy(nextIrpSp, irpSp, + (long)(&((IO_STACK_LOCATION *)0)->CompletionRoutine)); + nextIrpSp->Control = 0; } - } else { - if (compRegistered != 0) { - { - errorFn(); - } + if (s != NP) { + { errorFn(); } } else { - compRegistered = 1; - compFptr = & DiskPerfIrpCompletion; - routine = 0; + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + compFptr = &DiskPerfIrpCompletion; + routine = 0; + } } - } - { - irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp___0->CompletionRoutine = & DiskPerfIrpCompletion; - irpSp___0->Context = & event; - irpSp___0->Control = 0; - irpSp___0->Control = 64; - irpSp___0->Control = (int )irpSp___0->Control | 128; - irpSp___0->Control = (int )irpSp___0->Control | 32; - status = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); - } - if (status == 259L) { { - KeWaitForSingleObject(& event, 0, 0, 0, (void *)0); - status = myStatus; + irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpSp___0->CompletionRoutine = &DiskPerfIrpCompletion; + irpSp___0->Context = &event; + irpSp___0->Control = 0; + irpSp___0->Control = 64; + irpSp___0->Control = (int)irpSp___0->Control | 128; + irpSp___0->Control = (int)irpSp___0->Control | 32; + status = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); } - } else { - + if (status == 259L) { + { + KeWaitForSingleObject(&event, 0, 0, 0, (void *)0); + status = myStatus; + } + } else { + } + return (status); } - return (status); } -} -NTSTATUS DiskPerfCreate(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ +NTSTATUS DiskPerfCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp) { { - { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - IofCompleteRequest(Irp, 0); + { + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + IofCompleteRequest(Irp, 0); + } + return (0L); } - return (0L); -} } -NTSTATUS DiskPerfReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - PIO_STACK_LOCATION currentIrpStack ; - PIO_STACK_LOCATION nextIrpStack ; - ULONG processor ; - ULONG tmp ; - PDISK_PERFORMANCE partitionCounters ; - LONG queueLen ; - PLARGE_INTEGER timeStamp ; - NTSTATUS tmp___0 ; - PIO_STACK_LOCATION irpSp ; - NTSTATUS tmp___1 ; +NTSTATUS DiskPerfReadWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + PIO_STACK_LOCATION currentIrpStack; + PIO_STACK_LOCATION nextIrpStack; + ULONG processor; + ULONG tmp; + PDISK_PERFORMANCE partitionCounters; + LONG queueLen; + PLARGE_INTEGER timeStamp; + NTSTATUS tmp___0; + PIO_STACK_LOCATION irpSp; + NTSTATUS tmp___1; { - { - deviceExtension = DeviceObject->DeviceExtension; - currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - tmp = 0UL; /* KeGetCurrentProcessorNumber(); */ /* INLINED */ - processor = tmp; - partitionCounters = (void *)0; - } - if ((unsigned int )deviceExtension->DiskCounters != (unsigned int )((void *)0)) { - partitionCounters = (struct _DISK_PERFORMANCE *)((CHAR *)deviceExtension->DiskCounters + processor * (ULONG )((long )(& ((DISK_PERFORMANCE *)0)->QueryTime))); - } else { - - } - if (deviceExtension->CountersEnabled <= 0L) { { - tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp); + deviceExtension = DeviceObject->DeviceExtension; + currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + nextIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + tmp = 0UL; /* KeGetCurrentProcessorNumber(); */ /* INLINED */ + processor = tmp; + partitionCounters = (void *)0; } - return (tmp___0); - } else { - if ((int )deviceExtension->PhysicalDeviceNameBuffer[0] == 0) { - { - tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp); - } + if ((unsigned int)deviceExtension->DiskCounters != + (unsigned int)((void *)0)) { + partitionCounters = + (struct _DISK_PERFORMANCE + *)((CHAR *)deviceExtension->DiskCounters + + processor * + (ULONG)((long)(&((DISK_PERFORMANCE *)0)->QueryTime))); + } else { + } + if (deviceExtension->CountersEnabled <= 0L) { + { tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp); } return (tmp___0); } else { - if ((unsigned int )partitionCounters == (unsigned int )((void *)0)) { - { - tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp); - } + if ((int)deviceExtension->PhysicalDeviceNameBuffer[0] == 0) { + { tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp); } return (tmp___0); } else { - + if ((unsigned int)partitionCounters == (unsigned int)((void *)0)) { + { tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp); } + return (tmp___0); + } else { + } } } - } - { - queueLen = InterlockedIncrement(& deviceExtension->QueueDepth); - *nextIrpStack = *currentIrpStack; - timeStamp = (LARGE_INTEGER *)(& currentIrpStack->Parameters.Read); - *timeStamp = KeQueryPerformanceCounter((void *)0); - } - if (queueLen == 1L) { - partitionCounters->IdleTime.QuadPart += timeStamp->QuadPart - deviceExtension->LastIdleClock.QuadPart; - deviceExtension->LastIdleClock.QuadPart = timeStamp->QuadPart; - } else { - - } - if (s != NP) { { - errorFn(); + queueLen = InterlockedIncrement(&deviceExtension->QueueDepth); + *nextIrpStack = *currentIrpStack; + timeStamp = (LARGE_INTEGER *)(¤tIrpStack->Parameters.Read); + *timeStamp = KeQueryPerformanceCounter((void *)0); } - } else { - if (compRegistered != 0) { - { - errorFn(); - } + if (queueLen == 1L) { + partitionCounters->IdleTime.QuadPart += + timeStamp->QuadPart - deviceExtension->LastIdleClock.QuadPart; + deviceExtension->LastIdleClock.QuadPart = timeStamp->QuadPart; } else { - compRegistered = 1; - compFptr = & DiskPerfIoCompletion; - routine = 1; } + if (s != NP) { + { errorFn(); } + } else { + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + compFptr = &DiskPerfIoCompletion; + routine = 1; + } + } + { + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpSp->CompletionRoutine = &DiskPerfIoCompletion; + irpSp->Context = DeviceObject; + irpSp->Control = 0; + irpSp->Control = 64; + irpSp->Control = (int)irpSp->Control | 128; + irpSp->Control = (int)irpSp->Control | 32; + tmp___1 = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); + } + return (tmp___1); } - { - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp->CompletionRoutine = & DiskPerfIoCompletion; - irpSp->Context = DeviceObject; - irpSp->Control = 0; - irpSp->Control = 64; - irpSp->Control = (int )irpSp->Control | 128; - irpSp->Control = (int )irpSp->Control | 32; - tmp___1 = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); - } - return (tmp___1); } -} -NTSTATUS DiskPerfIoCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) -{ PDEVICE_EXTENSION deviceExtension ; - PIO_STACK_LOCATION irpStack ; - PDISK_PERFORMANCE partitionCounters ; - LARGE_INTEGER timeStampComplete ; - PLARGE_INTEGER difference ; - LONG queueLen ; - ULONG tmp ; - - { - { - deviceExtension = DeviceObject->DeviceExtension; - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - tmp = 0UL; /* KeGetCurrentProcessorNumber(); */ /* INLINED */ - partitionCounters = (struct _DISK_PERFORMANCE *)((CHAR *)deviceExtension->DiskCounters + tmp * (unsigned long )((long )(& ((DISK_PERFORMANCE *)0)->QueryTime))); - } - if ((unsigned int )partitionCounters == (unsigned int )((void *)0)) { - return (0L); - } else { +NTSTATUS DiskPerfIoCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context) { + PDEVICE_EXTENSION deviceExtension; + PIO_STACK_LOCATION irpStack; + PDISK_PERFORMANCE partitionCounters; + LARGE_INTEGER timeStampComplete; + PLARGE_INTEGER difference; + LONG queueLen; + ULONG tmp; - } { - difference = (LARGE_INTEGER *)(& irpStack->Parameters.Read); - timeStampComplete = KeQueryPerformanceCounter((void *)0); - difference->QuadPart = timeStampComplete.QuadPart - difference->QuadPart; - queueLen = InterlockedDecrement(& deviceExtension->QueueDepth); - } - if (queueLen < 0L) { { - queueLen = InterlockedIncrement(& deviceExtension->QueueDepth); + deviceExtension = DeviceObject->DeviceExtension; + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + tmp = 0UL; /* KeGetCurrentProcessorNumber(); */ /* INLINED */ + partitionCounters = + (struct _DISK_PERFORMANCE *)((CHAR *)deviceExtension->DiskCounters + + tmp * (unsigned long)(( + long)(&((DISK_PERFORMANCE *)0) + ->QueryTime))); } - } else { - - } - if (queueLen == 0L) { - deviceExtension->LastIdleClock = timeStampComplete; - } else { - - } - if ((int )irpStack->MajorFunction == 3) { - partitionCounters->BytesRead.QuadPart += (LONGLONG )Irp->IoStatus.Information; - partitionCounters->ReadCount += 1UL; - partitionCounters->ReadTime.QuadPart += difference->QuadPart; - } else { - partitionCounters->BytesWritten.QuadPart += (LONGLONG )Irp->IoStatus.Information; - partitionCounters->WriteCount += 1UL; - partitionCounters->WriteTime.QuadPart += difference->QuadPart; - } - if (Irp->Flags & 8UL) { - partitionCounters->SplitCount += 1UL; - } else { - - } - if (Irp->PendingReturned) { - if (pended == 0) { - pended = 1; + if ((unsigned int)partitionCounters == (unsigned int)((void *)0)) { + return (0L); } else { - { - errorFn(); + } + { + difference = (LARGE_INTEGER *)(&irpStack->Parameters.Read); + timeStampComplete = KeQueryPerformanceCounter((void *)0); + difference->QuadPart = timeStampComplete.QuadPart - difference->QuadPart; + queueLen = InterlockedDecrement(&deviceExtension->QueueDepth); + } + if (queueLen < 0L) { + { queueLen = InterlockedIncrement(&deviceExtension->QueueDepth); } + } else { + } + if (queueLen == 0L) { + deviceExtension->LastIdleClock = timeStampComplete; + } else { + } + if ((int)irpStack->MajorFunction == 3) { + partitionCounters->BytesRead.QuadPart += + (LONGLONG)Irp->IoStatus.Information; + partitionCounters->ReadCount += 1UL; + partitionCounters->ReadTime.QuadPart += difference->QuadPart; + } else { + partitionCounters->BytesWritten.QuadPart += + (LONGLONG)Irp->IoStatus.Information; + partitionCounters->WriteCount += 1UL; + partitionCounters->WriteTime.QuadPart += difference->QuadPart; + } + if (Irp->Flags & 8UL) { + partitionCounters->SplitCount += 1UL; + } else { + } + if (Irp->PendingReturned) { + if (pended == 0) { + pended = 1; + } else { + { errorFn(); } } + (Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation) + ->Control = (int)(Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation) + ->Control | + 1; + } else { } - (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1; - } else { - + return (0L); } - return (0L); } -} -NTSTATUS DiskPerfDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - PIO_STACK_LOCATION currentIrpStack ; - NTSTATUS status ; - ULONG i ; - PDISK_PERFORMANCE totalCounters ; - PDISK_PERFORMANCE diskCounters ; - LARGE_INTEGER frequency ; - LARGE_INTEGER perfctr ; - LARGE_INTEGER difference ; - NTSTATUS tmp ; +NTSTATUS DiskPerfDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + PIO_STACK_LOCATION currentIrpStack; + NTSTATUS status; + ULONG i; + PDISK_PERFORMANCE totalCounters; + PDISK_PERFORMANCE diskCounters; + LARGE_INTEGER frequency; + LARGE_INTEGER perfctr; + LARGE_INTEGER difference; + NTSTATUS tmp; { - deviceExtension = DeviceObject->DeviceExtension; - currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )((7 << 16) | (8 << 2))) { - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(DISK_PERFORMANCE )) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - } else { - diskCounters = deviceExtension->DiskCounters; - if ((unsigned int )diskCounters == (unsigned int )((void *)0)) { + deviceExtension = DeviceObject->DeviceExtension; + currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (ULONG)((7 << 16) | (8 << 2))) { + if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < + (ULONG)sizeof(DISK_PERFORMANCE)) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + } else { + diskCounters = deviceExtension->DiskCounters; + if ((unsigned int)diskCounters == (unsigned int)((void *)0)) { + { + Irp->IoStatus.__annonCompField4.Status = -1073741823L; + myStatus = -1073741823L; + IofCompleteRequest(Irp, 0); + } + return (-1073741823L); + } else { + } { - Irp->IoStatus.__annonCompField4.Status = -1073741823L; - myStatus = -1073741823L; - IofCompleteRequest(Irp, 0); + totalCounters = + (struct _DISK_PERFORMANCE *)Irp->AssociatedIrp.SystemBuffer; + memset(totalCounters, 0, sizeof(DISK_PERFORMANCE)); + perfctr = KeQueryPerformanceCounter(&frequency); + KeQuerySystemTime(&totalCounters->QueryTime); + i = 0; } - return (-1073741823L); - } else { - - } - { - totalCounters = (struct _DISK_PERFORMANCE *)Irp->AssociatedIrp.SystemBuffer; - memset(totalCounters, 0, sizeof(DISK_PERFORMANCE )); - perfctr = KeQueryPerformanceCounter(& frequency); - KeQuerySystemTime(& totalCounters->QueryTime); - i = 0; - } - { - while (1) { - while_1_continue: /* CIL Label */ ; - if (i < deviceExtension->Processors) { + { + while (1) { + while_1_continue: /* CIL Label */; + if (i < deviceExtension->Processors) { + } else { + goto while_1_break; + } + { + DiskPerfAddCounters(totalCounters, diskCounters, frequency); + diskCounters = + (struct _DISK_PERFORMANCE *)((CHAR *)diskCounters + + (long)(&((DISK_PERFORMANCE *)0) + ->QueryTime)); + i += 1UL; + } + } + while_1_break: /* CIL Label */; + } + totalCounters->QueueDepth = deviceExtension->QueueDepth; + if (totalCounters->QueueDepth == 0UL) { + difference.QuadPart = + perfctr.QuadPart - deviceExtension->LastIdleClock.QuadPart; + if (difference.QuadPart > 0LL) { + totalCounters->IdleTime.QuadPart += + (10000000LL * difference.QuadPart) / frequency.QuadPart; + } else { + } } else { - goto while_1_break; } { - DiskPerfAddCounters(totalCounters, diskCounters, frequency); - diskCounters = (struct _DISK_PERFORMANCE *)((CHAR *)diskCounters + (long )(& ((DISK_PERFORMANCE *)0)->QueryTime)); - i += 1UL; + totalCounters->StorageDeviceNumber = deviceExtension->DiskNumber; + memcpy(&totalCounters->StorageManagerName[0], + &deviceExtension->StorageManagerName[0], 8U * sizeof(WCHAR)); + status = 0L; + Irp->IoStatus.Information = sizeof(DISK_PERFORMANCE); } } - while_1_break: /* CIL Label */ ; - } - totalCounters->QueueDepth = deviceExtension->QueueDepth; - if (totalCounters->QueueDepth == 0UL) { - difference.QuadPart = perfctr.QuadPart - deviceExtension->LastIdleClock.QuadPart; - if (difference.QuadPart > 0LL) { - totalCounters->IdleTime.QuadPart += (10000000LL * difference.QuadPart) / frequency.QuadPart; - } else { - - } - } else { - + { + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); } + return (status); + } else { { - totalCounters->StorageDeviceNumber = deviceExtension->DiskNumber; - memcpy(& totalCounters->StorageManagerName[0], & deviceExtension->StorageManagerName[0], - 8U * sizeof(WCHAR )); - status = 0L; - Irp->IoStatus.Information = sizeof(DISK_PERFORMANCE ); + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); } + return (tmp); + } + } +} +NTSTATUS DiskPerfWmi(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + NTSTATUS status; + PWMILIB_CONTEXT wmilibContext; + SYSCTL_IRP_DISPOSITION disposition; + PDEVICE_EXTENSION deviceExtension; + NTSTATUS tmp; + + { + deviceExtension = DeviceObject->DeviceExtension; + wmilibContext = &deviceExtension->WmilibContext; + if (wmilibContext->GuidCount == 0UL) { + { tmp = DiskPerfSendToNextDriver(DeviceObject, Irp); } + return (tmp); + } else { } { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + status = 0L; + /* WmiSystemControl(wmilibContext, DeviceObject, Irp, & disposition); */ /* INLINED */ + } + if (disposition == 0) { + goto switch_2_0; + } else { + if (disposition == 1) { + goto switch_2_1; + } else { + { + goto switch_2_default; + if (0) { + switch_2_0: /* CIL Label */; + goto switch_2_break; + switch_2_1 : /* CIL Label */ + { + IofCompleteRequest(Irp, 0); + } + goto switch_2_break; + switch_2_default : /* CIL Label */ + { + status = DiskPerfSendToNextDriver(DeviceObject, Irp); + } + goto switch_2_break; + } else { + switch_2_break: /* CIL Label */; + } + } + } } return (status); - } else { + } +} +NTSTATUS DiskPerfShutdownFlush(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + NTSTATUS tmp; + + { { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); + deviceExtension = DeviceObject->DeviceExtension; + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); } return (tmp); } } +void DiskPerfUnload(PDRIVER_OBJECT DriverObject) { + + { return; } } -NTSTATUS DiskPerfWmi(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - NTSTATUS status ; - PWMILIB_CONTEXT wmilibContext ; - SYSCTL_IRP_DISPOSITION disposition ; - PDEVICE_EXTENSION deviceExtension ; - NTSTATUS tmp ; +NTSTATUS DiskPerfRegisterDevice(PDEVICE_OBJECT DeviceObject) { + NTSTATUS status; + IO_STATUS_BLOCK ioStatus; + KEVENT event; + PDEVICE_EXTENSION deviceExtension; + PIRP irp; + STORAGE_DEVICE_NUMBER number; + ULONG registrationFlag; + ULONG outputSize; + PMOUNTDEV_NAME output; + VOLUME_NUMBER volumeNumber; + PVOID tmp; + PVOID tmp___0; { - deviceExtension = DeviceObject->DeviceExtension; - wmilibContext = & deviceExtension->WmilibContext; - if (wmilibContext->GuidCount == 0UL) { { - tmp = DiskPerfSendToNextDriver(DeviceObject, Irp); + registrationFlag = 0; + deviceExtension = DeviceObject->DeviceExtension; + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + irp = IoBuildDeviceIoControlRequest( + (45 << 16) | (1056 << 2), deviceExtension->TargetDeviceObject, + (void *)0, 0, &number, sizeof(number), 0, &event, &ioStatus); } - return (tmp); - } else { - - } - { - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - status = 0L; /* WmiSystemControl(wmilibContext, DeviceObject, Irp, & disposition); */ /* INLINED */ - } - if (disposition == 0) { - goto switch_2_0; - } else { - if (disposition == 1) { - goto switch_2_1; - } else { - { - goto switch_2_default; - if (0) { - switch_2_0: /* CIL Label */ ; - goto switch_2_break; - switch_2_1: /* CIL Label */ - { - IofCompleteRequest(Irp, 0); - } - goto switch_2_break; - switch_2_default: /* CIL Label */ - { - status = DiskPerfSendToNextDriver(DeviceObject, Irp); - } - goto switch_2_break; - } else { - switch_2_break: /* CIL Label */ ; - } - } - } - } - return (status); -} -} -NTSTATUS DiskPerfShutdownFlush(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - NTSTATUS tmp ; - - { - { - deviceExtension = DeviceObject->DeviceExtension; - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); - } - return (tmp); -} -} -void DiskPerfUnload(PDRIVER_OBJECT DriverObject ) -{ - - { - return; -} -} -NTSTATUS DiskPerfRegisterDevice(PDEVICE_OBJECT DeviceObject ) -{ NTSTATUS status ; - IO_STATUS_BLOCK ioStatus ; - KEVENT event ; - PDEVICE_EXTENSION deviceExtension ; - PIRP irp ; - STORAGE_DEVICE_NUMBER number ; - ULONG registrationFlag ; - ULONG outputSize ; - PMOUNTDEV_NAME output ; - VOLUME_NUMBER volumeNumber ; - PVOID tmp ; - PVOID tmp___0 ; - - { - { - registrationFlag = 0; - deviceExtension = DeviceObject->DeviceExtension; -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - irp = IoBuildDeviceIoControlRequest((45 << 16) | (1056 << 2), deviceExtension->TargetDeviceObject, - (void *)0, 0, & number, sizeof(number), 0, & event, - & ioStatus); - } - if (! irp) { - { - DiskPerfLogError(DeviceObject, 256, 0L, -1073479678L); - } - return (-1073741670L); - } else { - - } - { - status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); - } - if (status == 259L) { - { - KeWaitForSingleObject(& event, 0, 0, 0, (void *)0); - status = ioStatus.__annonCompField4.Status; - } - } else { - - } - if (status >= 0L) { - { - deviceExtension->DiskNumber = number.DeviceNumber; - swprintf(deviceExtension->PhysicalDeviceNameBuffer, "\\\000D\000e\000v\000i\000c\000e\000\\\000H\000a\000r\000d\000d\000i\000s\000k\000%\000d\000\\\000P\000a\000r\000t\000i\000t\000i\000o\000n\000%\000d\000", - number.DeviceNumber, number.PartitionNumber); -/* RtlInitUnicodeString(& deviceExtension->PhysicalDeviceName, & deviceExtension->PhysicalDeviceNameBuffer[0]); */ /* INLINED */ - memcpy(& deviceExtension->StorageManagerName[0], "P\000h\000y\000s\000D\000i\000s\000k\000", - 8U * sizeof(WCHAR )); - } - } else { - { - outputSize = sizeof(MOUNTDEV_NAME ); - tmp = ExAllocatePoolWithTag(1, outputSize, 1718767684UL); - output = tmp; - } - if (! output) { - { - DiskPerfLogError(DeviceObject, 257, 0L, -1073479678L); - } + if (!irp) { + { DiskPerfLogError(DeviceObject, 256, 0L, -1073479678L); } return (-1073741670L); } else { - - } - { -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - irp = IoBuildDeviceIoControlRequest((77UL << 16) | (unsigned long )(2 << 2), deviceExtension->TargetDeviceObject, - (void *)0, 0, output, outputSize, 0, & event, - & ioStatus); } - if (! irp) { + { status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); } + if (status == 259L) { { -/* ExFreePool(output); */ /* INLINED */ - DiskPerfLogError(DeviceObject, 258, 0L, -1073479678L); + KeWaitForSingleObject(&event, 0, 0, 0, (void *)0); + status = ioStatus.__annonCompField4.Status; } - return (-1073741670L); } else { - - } - { - status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); } - if (status == 259L) { + if (status >= 0L) { { - KeWaitForSingleObject(& event, 0, 0, 0, (void *)0); - status = ioStatus.__annonCompField4.Status; + deviceExtension->DiskNumber = number.DeviceNumber; + swprintf(deviceExtension->PhysicalDeviceNameBuffer, + "\\\000D\000e\000v\000i\000c\000e\000\\\000H\000a\000r\000d" + "\000d\000i\000s\000k\000%" + "\000d\000\\\000P\000a\000r\000t\000i\000t\000i\000o\000n\000%" + "\000d\000", + number.DeviceNumber, number.PartitionNumber); + /* RtlInitUnicodeString(& deviceExtension->PhysicalDeviceName, & deviceExtension->PhysicalDeviceNameBuffer[0]); */ /* INLINED */ + memcpy(&deviceExtension->StorageManagerName[0], + "P\000h\000y\000s\000D\000i\000s\000k\000", 8U * sizeof(WCHAR)); } } else { - - } - if (status == -2147483643L) { { - outputSize = sizeof(MOUNTDEV_NAME ) + (unsigned int )output->NameLength; -/* ExFreePool(output); */ /* INLINED */ - tmp___0 = ExAllocatePoolWithTag(1, outputSize, 1718767684UL); - output = tmp___0; + outputSize = sizeof(MOUNTDEV_NAME); + tmp = ExAllocatePoolWithTag(1, outputSize, 1718767684UL); + output = tmp; } - if (! output) { - { - DiskPerfLogError(DeviceObject, 258, 0L, -1073479678L); - } + if (!output) { + { DiskPerfLogError(DeviceObject, 257, 0L, -1073479678L); } return (-1073741670L); } else { - } { -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - irp = IoBuildDeviceIoControlRequest((77UL << 16) | (unsigned long )(2 << 2), - deviceExtension->TargetDeviceObject, (void *)0, - 0, output, outputSize, 0, & event, & ioStatus); + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + irp = IoBuildDeviceIoControlRequest( + (77UL << 16) | (unsigned long)(2 << 2), + deviceExtension->TargetDeviceObject, (void *)0, 0, output, + outputSize, 0, &event, &ioStatus); } - if (! irp) { + if (!irp) { { -/* ExFreePool(output); */ /* INLINED */ - DiskPerfLogError(DeviceObject, 259, 0L, -1073479678L); + /* ExFreePool(output); */ /* INLINED */ + DiskPerfLogError(DeviceObject, 258, 0L, -1073479678L); } return (-1073741670L); } else { - - } - { - status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); } + { status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); } if (status == 259L) { { - KeWaitForSingleObject(& event, 0, 0, 0, (void *)0); - status = ioStatus.__annonCompField4.Status; + KeWaitForSingleObject(&event, 0, 0, 0, (void *)0); + status = ioStatus.__annonCompField4.Status; } } else { - } - } else { - - } - if (! (status >= 0L)) { - { -/* ExFreePool(output); */ /* INLINED */ - DiskPerfLogError(DeviceObject, 260, 0L, -1073479677L); + if (status == -2147483643L) { + { + outputSize = sizeof(MOUNTDEV_NAME) + (unsigned int)output->NameLength; + /* ExFreePool(output); */ /* INLINED */ + tmp___0 = ExAllocatePoolWithTag(1, outputSize, 1718767684UL); + output = tmp___0; + } + if (!output) { + { DiskPerfLogError(DeviceObject, 258, 0L, -1073479678L); } + return (-1073741670L); + } else { + } + { + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + irp = IoBuildDeviceIoControlRequest( + (77UL << 16) | (unsigned long)(2 << 2), + deviceExtension->TargetDeviceObject, (void *)0, 0, output, + outputSize, 0, &event, &ioStatus); + } + if (!irp) { + { + /* ExFreePool(output); */ /* INLINED */ + DiskPerfLogError(DeviceObject, 259, 0L, -1073479678L); + } + return (-1073741670L); + } else { + } + { status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); } + if (status == 259L) { + { + KeWaitForSingleObject(&event, 0, 0, 0, (void *)0); + status = ioStatus.__annonCompField4.Status; + } + } else { + } + } else { } - return (status); - } else { - - } - { - deviceExtension->DiskNumber = -1; - deviceExtension->PhysicalDeviceName.Length = output->NameLength; - deviceExtension->PhysicalDeviceName.MaximumLength = (unsigned int )output->NameLength + sizeof(WCHAR ); - memcpy(deviceExtension->PhysicalDeviceName.Buffer, output->Name, output->NameLength); - *(deviceExtension->PhysicalDeviceName.Buffer + (unsigned int )deviceExtension->PhysicalDeviceName.Length / sizeof(WCHAR )) = 0; -/* ExFreePool(output); */ /* INLINED */ - outputSize = sizeof(VOLUME_NUMBER ); - memset(& volumeNumber, 0, sizeof(VOLUME_NUMBER )); -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - irp = IoBuildDeviceIoControlRequest((86UL << 16) | (unsigned long )(7 << 2), deviceExtension->TargetDeviceObject, - (void *)0, 0, & volumeNumber, sizeof(VOLUME_NUMBER ), - 0, & event, & ioStatus); - } - if (! irp) { - { - DiskPerfLogError(DeviceObject, 265, 0L, -1073479678L); + if (!(status >= 0L)) { + { + /* ExFreePool(output); */ /* INLINED */ + DiskPerfLogError(DeviceObject, 260, 0L, -1073479677L); + } + return (status); + } else { } - return (-1073741670L); - } else { - - } - { - status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); - } - if (status == 259L) { { - KeWaitForSingleObject(& event, 0, 0, 0, (void *)0); - status = ioStatus.__annonCompField4.Status; + deviceExtension->DiskNumber = -1; + deviceExtension->PhysicalDeviceName.Length = output->NameLength; + deviceExtension->PhysicalDeviceName.MaximumLength = + (unsigned int)output->NameLength + sizeof(WCHAR); + memcpy(deviceExtension->PhysicalDeviceName.Buffer, output->Name, + output->NameLength); + *(deviceExtension->PhysicalDeviceName.Buffer + + (unsigned int)deviceExtension->PhysicalDeviceName.Length / + sizeof(WCHAR)) = 0; + /* ExFreePool(output); */ /* INLINED */ + outputSize = sizeof(VOLUME_NUMBER); + memset(&volumeNumber, 0, sizeof(VOLUME_NUMBER)); + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + irp = IoBuildDeviceIoControlRequest( + (86UL << 16) | (unsigned long)(7 << 2), + deviceExtension->TargetDeviceObject, (void *)0, 0, &volumeNumber, + sizeof(VOLUME_NUMBER), 0, &event, &ioStatus); } - } else { - - } - if (! (status >= 0L)) { - goto _L; - } else { - if ((int )volumeNumber.VolumeManagerName[0] == 0) { - _L: /* CIL Label */ + if (!irp) { + { DiskPerfLogError(DeviceObject, 265, 0L, -1073479678L); } + return (-1073741670L); + } else { + } + { status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); } + if (status == 259L) { { - memcpy(& deviceExtension->StorageManagerName[0], "L\000o\000g\000i\000D\000i\000s\000k\000", - 8U * sizeof(WCHAR )); - } - if (status >= 0L) { - deviceExtension->DiskNumber = volumeNumber.VolumeNumber; - } else { - + KeWaitForSingleObject(&event, 0, 0, 0, (void *)0); + status = ioStatus.__annonCompField4.Status; } } else { + } + if (!(status >= 0L)) { + goto _L; + } else { + if ((int)volumeNumber.VolumeManagerName[0] == 0) { + _L : /* CIL Label */ { - memcpy(& deviceExtension->StorageManagerName[0], & volumeNumber.VolumeManagerName[0], - 8U * sizeof(WCHAR )); - deviceExtension->DiskNumber = volumeNumber.VolumeNumber; + memcpy(&deviceExtension->StorageManagerName[0], + "L\000o\000g\000i\000D\000i\000s\000k\000", + 8U * sizeof(WCHAR)); + } + if (status >= 0L) { + deviceExtension->DiskNumber = volumeNumber.VolumeNumber; + } else { + } + } else { + { + memcpy(&deviceExtension->StorageManagerName[0], + &volumeNumber.VolumeManagerName[0], 8U * sizeof(WCHAR)); + deviceExtension->DiskNumber = volumeNumber.VolumeNumber; + } } } } - } - { - status = IoWMIRegistrationControl(DeviceObject, 1UL | registrationFlag); - } - if (! (status >= 0L)) { - { - DiskPerfLogError(DeviceObject, 261, 0L, -1073479668L); + { status = IoWMIRegistrationControl(DeviceObject, 1UL | registrationFlag); } + if (!(status >= 0L)) { + { DiskPerfLogError(DeviceObject, 261, 0L, -1073479668L); } + } else { } - } else { - + return (status); } - return (status); } -} -void DiskPerfLogError(PDEVICE_OBJECT DeviceObject , ULONG UniqueId , NTSTATUS ErrorCode , - NTSTATUS Status ) -{ PIO_ERROR_LOG_PACKET errorLogEntry ; - PVOID tmp ; +void DiskPerfLogError(PDEVICE_OBJECT DeviceObject, ULONG UniqueId, + NTSTATUS ErrorCode, NTSTATUS Status) { + PIO_ERROR_LOG_PACKET errorLogEntry; + PVOID tmp; { - { - tmp = IoAllocateErrorLogEntry(DeviceObject, (unsigned char )(sizeof(IO_ERROR_LOG_PACKET ) + sizeof(DEVICE_OBJECT ))); - errorLogEntry = (struct _IO_ERROR_LOG_PACKET *)tmp; - } - if ((unsigned int )errorLogEntry != (unsigned int )((void *)0)) { { - errorLogEntry->ErrorCode = ErrorCode; - errorLogEntry->UniqueErrorValue = UniqueId; - errorLogEntry->FinalStatus = Status; - memcpy(& errorLogEntry->DumpData[0], & DeviceObject, sizeof(DEVICE_OBJECT )); - errorLogEntry->DumpDataSize = sizeof(DEVICE_OBJECT ); - IoWriteErrorLogEntry(errorLogEntry); + tmp = IoAllocateErrorLogEntry( + DeviceObject, + (unsigned char)(sizeof(IO_ERROR_LOG_PACKET) + sizeof(DEVICE_OBJECT))); + errorLogEntry = (struct _IO_ERROR_LOG_PACKET *)tmp; } - } else { - + if ((unsigned int)errorLogEntry != (unsigned int)((void *)0)) { + { + errorLogEntry->ErrorCode = ErrorCode; + errorLogEntry->UniqueErrorValue = UniqueId; + errorLogEntry->FinalStatus = Status; + memcpy(&errorLogEntry->DumpData[0], &DeviceObject, + sizeof(DEVICE_OBJECT)); + errorLogEntry->DumpDataSize = sizeof(DEVICE_OBJECT); + IoWriteErrorLogEntry(errorLogEntry); + } + } else { + } + return; } - return; -} } -NTSTATUS DiskperfQueryWmiRegInfo(PDEVICE_OBJECT DeviceObject , ULONG *RegFlags , PUNICODE_STRING InstanceName , - PUNICODE_STRING *RegistryPath , PUNICODE_STRING MofResourceName , - PDEVICE_OBJECT *Pdo ) -{ USHORT size ; - NTSTATUS status ; - PDEVICE_EXTENSION deviceExtension ; - PVOID tmp ; +NTSTATUS DiskperfQueryWmiRegInfo(PDEVICE_OBJECT DeviceObject, ULONG *RegFlags, + PUNICODE_STRING InstanceName, + PUNICODE_STRING *RegistryPath, + PUNICODE_STRING MofResourceName, + PDEVICE_OBJECT *Pdo) { + USHORT size; + NTSTATUS status; + PDEVICE_EXTENSION deviceExtension; + PVOID tmp; { - { - deviceExtension = DeviceObject->DeviceExtension; - size = (unsigned int )deviceExtension->PhysicalDeviceName.Length + sizeof((unsigned short)0); - tmp = ExAllocatePoolWithTag(1, size, 1718767684UL); - InstanceName->Buffer = tmp; - } - if ((unsigned int )InstanceName->Buffer != (unsigned int )((void *)0)) { - *RegistryPath = & DiskPerfRegistryPath; - *RegFlags = 33; - *Pdo = deviceExtension->PhysicalDeviceObject; - status = 0L; - } else { - status = -1073741670L; + { + deviceExtension = DeviceObject->DeviceExtension; + size = (unsigned int)deviceExtension->PhysicalDeviceName.Length + + sizeof((unsigned short)0); + tmp = ExAllocatePoolWithTag(1, size, 1718767684UL); + InstanceName->Buffer = tmp; + } + if ((unsigned int)InstanceName->Buffer != (unsigned int)((void *)0)) { + *RegistryPath = &DiskPerfRegistryPath; + *RegFlags = 33; + *Pdo = deviceExtension->PhysicalDeviceObject; + status = 0L; + } else { + status = -1073741670L; + } + return (status); } - return (status); } -} -NTSTATUS DiskperfQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray , - ULONG BufferAvail , PUCHAR Buffer ) -{ NTSTATUS status ; - PDEVICE_EXTENSION deviceExtension ; - ULONG sizeNeeded ; - PDISK_PERFORMANCE totalCounters ; - PDISK_PERFORMANCE diskCounters ; - PWMI_DISK_PERFORMANCE diskPerformance ; - ULONG deviceNameSize ; - PWCHAR diskNamePtr ; - ULONG i ; - LARGE_INTEGER perfctr ; - LARGE_INTEGER frequency ; - LARGE_INTEGER difference ; - PWCHAR tmp ; +NTSTATUS DiskperfQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject, PIRP Irp, + ULONG GuidIndex, ULONG InstanceIndex, + ULONG InstanceCount, + PULONG InstanceLengthArray, + ULONG BufferAvail, PUCHAR Buffer) { + NTSTATUS status; + PDEVICE_EXTENSION deviceExtension; + ULONG sizeNeeded; + PDISK_PERFORMANCE totalCounters; + PDISK_PERFORMANCE diskCounters; + PWMI_DISK_PERFORMANCE diskPerformance; + ULONG deviceNameSize; + PWCHAR diskNamePtr; + ULONG i; + LARGE_INTEGER perfctr; + LARGE_INTEGER frequency; + LARGE_INTEGER difference; + PWCHAR tmp; { - deviceExtension = DeviceObject->DeviceExtension; - if (GuidIndex == 0UL) { - deviceNameSize = (unsigned int )deviceExtension->PhysicalDeviceName.Length + sizeof(USHORT ); - sizeNeeded = (ULONG )((sizeof(WMI_DISK_PERFORMANCE ) + 1U) & 4294967294U) + deviceNameSize; - diskCounters = deviceExtension->DiskCounters; - if ((unsigned int )diskCounters == (unsigned int )((void *)0)) { - status = -1073741823L; - } else { - if (BufferAvail >= sizeNeeded) { - { - memset(Buffer, 0, sizeof(WMI_DISK_PERFORMANCE )); - diskPerformance = (struct _WMI_DISK_PERFORMANCE *)Buffer; - totalCounters = (struct _DISK_PERFORMANCE *)diskPerformance; - KeQuerySystemTime(& totalCounters->QueryTime); - perfctr = KeQueryPerformanceCounter(& frequency); - i = 0; - } - { - while (1) { - while_3_continue: /* CIL Label */ ; - if (i < deviceExtension->Processors) { - - } else { - goto while_3_break; + deviceExtension = DeviceObject->DeviceExtension; + if (GuidIndex == 0UL) { + deviceNameSize = + (unsigned int)deviceExtension->PhysicalDeviceName.Length + + sizeof(USHORT); + sizeNeeded = (ULONG)((sizeof(WMI_DISK_PERFORMANCE) + 1U) & 4294967294U) + + deviceNameSize; + diskCounters = deviceExtension->DiskCounters; + if ((unsigned int)diskCounters == (unsigned int)((void *)0)) { + status = -1073741823L; + } else { + if (BufferAvail >= sizeNeeded) { + { + memset(Buffer, 0, sizeof(WMI_DISK_PERFORMANCE)); + diskPerformance = (struct _WMI_DISK_PERFORMANCE *)Buffer; + totalCounters = (struct _DISK_PERFORMANCE *)diskPerformance; + KeQuerySystemTime(&totalCounters->QueryTime); + perfctr = KeQueryPerformanceCounter(&frequency); + i = 0; } { - DiskPerfAddCounters(totalCounters, diskCounters, frequency); - diskCounters = (struct _DISK_PERFORMANCE *)((CHAR *)diskCounters + (long )(& ((DISK_PERFORMANCE *)0)->QueryTime)); - i += 1UL; + while (1) { + while_3_continue: /* CIL Label */; + if (i < deviceExtension->Processors) { + + } else { + goto while_3_break; + } + { + DiskPerfAddCounters(totalCounters, diskCounters, frequency); + diskCounters = + (struct _DISK_PERFORMANCE *)((CHAR *)diskCounters + + (long)(&((DISK_PERFORMANCE *)0) + ->QueryTime)); + i += 1UL; + } + } + while_3_break: /* CIL Label */; } - } - while_3_break: /* CIL Label */ ; - } - totalCounters->QueueDepth = deviceExtension->QueueDepth; - if (totalCounters->QueueDepth == 0UL) { - difference.QuadPart = perfctr.QuadPart - deviceExtension->LastIdleClock.QuadPart; - if (frequency.QuadPart > 0LL) { - totalCounters->IdleTime.QuadPart += (10000000LL * difference.QuadPart) / frequency.QuadPart; + totalCounters->QueueDepth = deviceExtension->QueueDepth; + if (totalCounters->QueueDepth == 0UL) { + difference.QuadPart = + perfctr.QuadPart - deviceExtension->LastIdleClock.QuadPart; + if (frequency.QuadPart > 0LL) { + totalCounters->IdleTime.QuadPart += + (10000000LL * difference.QuadPart) / frequency.QuadPart; + } else { + } } else { - + } + { + totalCounters->StorageDeviceNumber = deviceExtension->DiskNumber; + memcpy(&totalCounters->StorageManagerName[0], + &deviceExtension->StorageManagerName[0], 8U * sizeof(WCHAR)); + diskNamePtr = (WCHAR *)(Buffer + ((sizeof(DISK_PERFORMANCE) + 1U) & + 4294967294U)); + tmp = diskNamePtr; + diskNamePtr += 1; + *tmp = deviceExtension->PhysicalDeviceName.Length; + memcpy(diskNamePtr, deviceExtension->PhysicalDeviceName.Buffer, + deviceExtension->PhysicalDeviceName.Length); + *InstanceLengthArray = sizeNeeded; + status = 0L; } } else { - - } - { - totalCounters->StorageDeviceNumber = deviceExtension->DiskNumber; - memcpy(& totalCounters->StorageManagerName[0], & deviceExtension->StorageManagerName[0], - 8U * sizeof(WCHAR )); - diskNamePtr = (WCHAR *)(Buffer + ((sizeof(DISK_PERFORMANCE ) + 1U) & 4294967294U)); - tmp = diskNamePtr; - diskNamePtr += 1; - *tmp = deviceExtension->PhysicalDeviceName.Length; - memcpy(diskNamePtr, deviceExtension->PhysicalDeviceName.Buffer, deviceExtension->PhysicalDeviceName.Length); - *InstanceLengthArray = sizeNeeded; - status = 0L; + status = -1073741789L; } - } else { - status = -1073741789L; } + } else { + status = -1073741163L; } - } else { - status = -1073741163L; - } - { - status = WmiCompleteRequest(DeviceObject, Irp, status, sizeNeeded, 0); + { status = WmiCompleteRequest(DeviceObject, Irp, status, sizeNeeded, 0); } + return (status); } - return (status); -} } -NTSTATUS DiskperfWmiFunctionControl(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - WMIENABLEDISABLECONTROL Function , BOOLEAN Enable ) -{ NTSTATUS status ; - PDEVICE_EXTENSION deviceExtension ; - LONG tmp ; - LONG tmp___0 ; +NTSTATUS DiskperfWmiFunctionControl(PDEVICE_OBJECT DeviceObject, PIRP Irp, + ULONG GuidIndex, + WMIENABLEDISABLECONTROL Function, + BOOLEAN Enable) { + NTSTATUS status; + PDEVICE_EXTENSION deviceExtension; + LONG tmp; + LONG tmp___0; { - deviceExtension = DeviceObject->DeviceExtension; - if (GuidIndex == 0UL) { - if ((int )Function == 1) { - if (Enable) { - { - tmp = InterlockedIncrement(& deviceExtension->CountersEnabled); - } - if (tmp == 1L) { - if ((unsigned int )deviceExtension->DiskCounters != (unsigned int )((void *)0)) { + deviceExtension = DeviceObject->DeviceExtension; + if (GuidIndex == 0UL) { + if ((int)Function == 1) { + if (Enable) { + { tmp = InterlockedIncrement(&deviceExtension->CountersEnabled); } + if (tmp == 1L) { + if ((unsigned int)deviceExtension->DiskCounters != + (unsigned int)((void *)0)) { + { + memset(deviceExtension->DiskCounters, 0, + (ULONG)((long)(&((DISK_PERFORMANCE *)0)->QueryTime)) * + deviceExtension->Processors); + } + } else { + } { - memset(deviceExtension->DiskCounters, 0, (ULONG )((long )(& ((DISK_PERFORMANCE *)0)->QueryTime)) * deviceExtension->Processors); + deviceExtension->LastIdleClock = + KeQueryPerformanceCounter((void *)0); + deviceExtension->QueueDepth = 0; } } else { - - } - { - deviceExtension->LastIdleClock = KeQueryPerformanceCounter((void *)0); - deviceExtension->QueueDepth = 0; } } else { - + { tmp___0 = InterlockedDecrement(&deviceExtension->CountersEnabled); } + if (tmp___0 <= 0L) { + deviceExtension->CountersEnabled = 0; + deviceExtension->QueueDepth = 0; + } else { + } } } else { - { - tmp___0 = InterlockedDecrement(& deviceExtension->CountersEnabled); - } - if (tmp___0 <= 0L) { - deviceExtension->CountersEnabled = 0; - deviceExtension->QueueDepth = 0; - } else { - - } } + status = 0L; } else { - + status = -1073741163L; } - status = 0L; - } else { - status = -1073741163L; - } - { - status = WmiCompleteRequest(DeviceObject, Irp, status, 0, 0); + { status = WmiCompleteRequest(DeviceObject, Irp, status, 0, 0); } + return (status); } - return (status); -} } -void DiskPerfAddCounters(PDISK_PERFORMANCE TotalCounters , PDISK_PERFORMANCE NewCounters , - LARGE_INTEGER Frequency ) -{ +void DiskPerfAddCounters(PDISK_PERFORMANCE TotalCounters, + PDISK_PERFORMANCE NewCounters, + LARGE_INTEGER Frequency) { { - TotalCounters->BytesRead.QuadPart += NewCounters->BytesRead.QuadPart; - TotalCounters->BytesWritten.QuadPart += NewCounters->BytesWritten.QuadPart; - TotalCounters->ReadCount += NewCounters->ReadCount; - TotalCounters->WriteCount += NewCounters->WriteCount; - TotalCounters->SplitCount += NewCounters->SplitCount; - if (Frequency.QuadPart > 0LL) { - TotalCounters->ReadTime.QuadPart += (NewCounters->ReadTime.QuadPart * 10000000LL) / Frequency.QuadPart; - TotalCounters->WriteTime.QuadPart += (NewCounters->WriteTime.QuadPart * 10000000LL) / Frequency.QuadPart; - TotalCounters->IdleTime.QuadPart += (NewCounters->IdleTime.QuadPart * 10000000LL) / Frequency.QuadPart; - } else { - TotalCounters->ReadTime.QuadPart += NewCounters->ReadTime.QuadPart; - TotalCounters->WriteTime.QuadPart += NewCounters->WriteTime.QuadPart; - TotalCounters->IdleTime.QuadPart += NewCounters->IdleTime.QuadPart; + TotalCounters->BytesRead.QuadPart += NewCounters->BytesRead.QuadPart; + TotalCounters->BytesWritten.QuadPart += NewCounters->BytesWritten.QuadPart; + TotalCounters->ReadCount += NewCounters->ReadCount; + TotalCounters->WriteCount += NewCounters->WriteCount; + TotalCounters->SplitCount += NewCounters->SplitCount; + if (Frequency.QuadPart > 0LL) { + TotalCounters->ReadTime.QuadPart += + (NewCounters->ReadTime.QuadPart * 10000000LL) / Frequency.QuadPart; + TotalCounters->WriteTime.QuadPart += + (NewCounters->WriteTime.QuadPart * 10000000LL) / Frequency.QuadPart; + TotalCounters->IdleTime.QuadPart += + (NewCounters->IdleTime.QuadPart * 10000000LL) / Frequency.QuadPart; + } else { + TotalCounters->ReadTime.QuadPart += NewCounters->ReadTime.QuadPart; + TotalCounters->WriteTime.QuadPart += NewCounters->WriteTime.QuadPart; + TotalCounters->IdleTime.QuadPart += NewCounters->IdleTime.QuadPart; + } + return; } - return; -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) -IRP *pirp ; -void stub_driver_init(void) -{ +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +IRP *pirp; +void stub_driver_init(void) { { - s = NP; - customIrp = 0; - setEventCalled = customIrp; - lowerDriverReturn = setEventCalled; - compRegistered = lowerDriverReturn; - compFptr = compRegistered; - pended = compFptr; - return; -} -} -int main(void) -{ DRIVER_OBJECT d ; - NTSTATUS status = __VERIFIER_nondet_long() ; - int we_should_unload = __VERIFIER_nondet_int() ; - IRP irp ; - int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - int irp_choice = __VERIFIER_nondet_int() ; - DEVICE_OBJECT devobj ; - KeNumberProcessors = __VERIFIER_nondet_pointer(); - - { - { - pirp = & irp; - _BLAST_init(); - } - if (status >= 0L) { s = NP; customIrp = 0; setEventCalled = customIrp; @@ -3198,142 +3226,152 @@ int main(void) compRegistered = lowerDriverReturn; compFptr = compRegistered; pended = compFptr; - pirp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (irp_choice == 0) { - pirp->IoStatus.__annonCompField4.Status = -1073741637L; - myStatus = -1073741637L; - } else { + return; + } +} +int main(void) { + DRIVER_OBJECT d; + NTSTATUS status = __VERIFIER_nondet_long(); + int we_should_unload = __VERIFIER_nondet_int(); + IRP irp; + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + int irp_choice = __VERIFIER_nondet_int(); + DEVICE_OBJECT devobj; + KeNumberProcessors = __VERIFIER_nondet_pointer(); - } + { { - stub_driver_init(); - } - if (! (status >= 0L)) { - return (-1); - } else { - + pirp = &irp; + _BLAST_init(); } - if (__BLAST_NONDET___0 == 0) { - goto switch_4_0; - } else { - if (__BLAST_NONDET___0 == 2) { - goto switch_4_2; + if (status >= 0L) { + s = NP; + customIrp = 0; + setEventCalled = customIrp; + lowerDriverReturn = setEventCalled; + compRegistered = lowerDriverReturn; + compFptr = compRegistered; + pended = compFptr; + pirp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (irp_choice == 0) { + pirp->IoStatus.__annonCompField4.Status = -1073741637L; + myStatus = -1073741637L; + } else { + } + { stub_driver_init(); } + if (!(status >= 0L)) { + return (-1); } else { - if (__BLAST_NONDET___0 == 3) { - goto switch_4_3; + } + if (__BLAST_NONDET___0 == 0) { + goto switch_4_0; + } else { + if (__BLAST_NONDET___0 == 2) { + goto switch_4_2; } else { - if (__BLAST_NONDET___0 == 4) { - goto switch_4_4; + if (__BLAST_NONDET___0 == 3) { + goto switch_4_3; } else { - if (__BLAST_NONDET___0 == 12) { - goto switch_4_12; + if (__BLAST_NONDET___0 == 4) { + goto switch_4_4; } else { - { - goto switch_4_default; - if (0) { - switch_4_0: /* CIL Label */ - { - status = DiskPerfCreate(& devobj, pirp); - } - goto switch_4_break; - switch_4_2: /* CIL Label */ - { - status = DiskPerfDeviceControl(& devobj, pirp); - } - goto switch_4_break; - switch_4_3: /* CIL Label */ - { - status = DiskPerfDispatchPnp(& devobj, pirp); - } - goto switch_4_break; - switch_4_4: /* CIL Label */ - { - status = DiskPerfDispatchPower(& devobj, pirp); - } - goto switch_4_break; - switch_4_12: /* CIL Label */ + if (__BLAST_NONDET___0 == 12) { + goto switch_4_12; + } else { { - status = DiskPerfShutdownFlush(& devobj, pirp); + goto switch_4_default; + if (0) { + switch_4_0 : /* CIL Label */ + { + status = DiskPerfCreate(&devobj, pirp); + } + goto switch_4_break; + switch_4_2 : /* CIL Label */ + { + status = DiskPerfDeviceControl(&devobj, pirp); + } + goto switch_4_break; + switch_4_3 : /* CIL Label */ + { + status = DiskPerfDispatchPnp(&devobj, pirp); + } + goto switch_4_break; + switch_4_4 : /* CIL Label */ + { + status = DiskPerfDispatchPower(&devobj, pirp); + } + goto switch_4_break; + switch_4_12 : /* CIL Label */ + { + status = DiskPerfShutdownFlush(&devobj, pirp); + } + goto switch_4_break; + switch_4_default: /* CIL Label */; + return (-1); + } else { + switch_4_break: /* CIL Label */; + } } - goto switch_4_break; - switch_4_default: /* CIL Label */ ; - return (-1); - } else { - switch_4_break: /* CIL Label */ ; - } } } } } } - } - if (we_should_unload) { - { -/* DiskPerfUnload(& d); */ /* INLINED */ + if (we_should_unload) { + { /* DiskPerfUnload(& d); */ /* INLINED */ + } + } else { } } else { - - } - } else { - - } - if (pended == 1) { - if (s == NP) { - s = NP; - } else { - goto _L___2; } - } else { - _L___2: /* CIL Label */ if (pended == 1) { - if (s == MPR3) { - s = MPR3; + if (s == NP) { + s = NP; } else { - goto _L___1; + goto _L___2; } } else { - _L___1: /* CIL Label */ - if (s == UNLOADED) { - + _L___2: /* CIL Label */ + if (pended == 1) { + if (s == MPR3) { + s = MPR3; + } else { + goto _L___1; + } } else { - if (status == -1L) { + _L___1: /* CIL Label */ + if (s == UNLOADED) { } else { - if (s != SKIP2) { - if (s != IPC) { - if (s != DC) { - { - errorFn(); - } - } else { - goto _L___0; - } - } else { - goto _L___0; - } + if (status == -1L) { + } else { - _L___0: /* CIL Label */ - if (pended == 1) { - if (status != 259L) { - { - errorFn(); + if (s != SKIP2) { + if (s != IPC) { + if (s != DC) { + { errorFn(); } + } else { + goto _L___0; } } else { - + goto _L___0; } } else { - if (s == DC) { - { - errorFn(); + _L___0: /* CIL Label */ + if (pended == 1) { + if (status != 259L) { + { errorFn(); } + } else { } } else { - if (status != (NTSTATUS )lowerDriverReturn) { - { - errorFn(); - } + if (s == DC) { + { errorFn(); } } else { - + if (status != (NTSTATUS)lowerDriverReturn) { + { errorFn(); } + } else { + } } } } @@ -3341,1122 +3379,979 @@ int main(void) } } } - } - return (status); -} -} -char _SLAM_alloc_dummy ; -char *malloc(int i ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - - { - if (__BLAST_NONDET___0) { - return ((char *)0); - } else { - return ((char *)1); + return (status); } } -} - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; -void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) -{ +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; -void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) -{ +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; -PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , SIZE_T NumberOfBytes , - ULONG Tag ) -{ PVOID x ; - char *tmp ; +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag) { + PVOID x; + char *tmp; { - { - tmp = malloc(NumberOfBytes); - x = tmp; + { + tmp = malloc(NumberOfBytes); + x = tmp; + } + return (x); } - return (x); -} } - void ExFreePool(PVOID P ) ; -void ExFreePool(PVOID P ) -{ +void ExFreePool(PVOID P); +void ExFreePool(PVOID P) { - { - return; -} + { return; } } - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); + { return ((void *)0); } } -} - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; -PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , BOOLEAN SecondaryBuffer , - BOOLEAN ChargeQuota , PIRP Irp ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - char *tmp ; +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET___0 == 0) { - goto switch_5_0; - } else { - { - goto switch_5_default; - if (0) { - switch_5_0: /* CIL Label */ + if (__BLAST_NONDET___0 == 0) { + goto switch_5_0; + } else { { - tmp = malloc(sizeof(MDL )); + goto switch_5_default; + if (0) { + switch_5_0 : /* CIL Label */ + { + tmp = malloc(sizeof(MDL)); + } + return ((void *)tmp); + switch_5_default: /* CIL Label */; + return ((void *)0); + } else { + switch_5_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_5_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_5_break: /* CIL Label */ ; - } } } } -} - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; -PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , PDEVICE_OBJECT TargetDevice ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_6_0; - } else { - { - goto switch_6_default; - if (0) { - switch_6_0: /* CIL Label */ ; - return (TargetDevice); - switch_6_default: /* CIL Label */ ; - return ((void *)0); + if (__BLAST_NONDET___0 == 0) { + goto switch_6_0; } else { - switch_6_break: /* CIL Label */ ; - } + { + goto switch_6_default; + if (0) { + switch_6_0: /* CIL Label */; + return (TargetDevice); + switch_6_default: /* CIL Label */; + return ((void *)0); + } else { + switch_6_break: /* CIL Label */; + } + } } } } -} - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , PDEVICE_OBJECT DeviceObject , - PVOID Buffer , ULONG Length , PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - char *tmp ; +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + char *tmp; { - customIrp = 1; - if (__BLAST_NONDET___0 == 0) { - goto switch_7_0; - } else { - { - goto switch_7_default; - if (0) { - switch_7_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET___0 == 0) { + goto switch_7_0; + } else { { - tmp = malloc(sizeof(IRP )); + goto switch_7_default; + if (0) { + switch_7_0 : /* CIL Label */ + { + tmp = malloc(sizeof(IRP)); + } + return ((void *)tmp); + switch_7_default: /* CIL Label */; + return ((void *)0); + } else { + switch_7_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_7_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_7_break: /* CIL Label */ ; - } } } } -} - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , BOOLEAN InternalDeviceIoControl , - PKEVENT Event , PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - char *tmp ; +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + char *tmp; { - customIrp = 1; - if (__BLAST_NONDET___0 == 0) { - goto switch_8_0; - } else { - { - goto switch_8_default; - if (0) { - switch_8_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET___0 == 0) { + goto switch_8_0; + } else { { - tmp = malloc(sizeof(IRP )); + goto switch_8_default; + if (0) { + switch_8_0 : /* CIL Label */ + { + tmp = malloc(sizeof(IRP)); + } + return ((void *)tmp); + switch_8_default: /* CIL Label */; + return ((void *)0); + } else { + switch_8_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_8_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_8_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; -NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - char *tmp ; +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET___0 == 0) { - goto switch_9_0; - } else { - { - goto switch_9_default; - if (0) { - switch_9_0: /* CIL Label */ + if (__BLAST_NONDET___0 == 0) { + goto switch_9_0; + } else { { - tmp = malloc(sizeof(DEVICE_OBJECT )); - *DeviceObject = (void *)tmp; + goto switch_9_default; + if (0) { + switch_9_0 : /* CIL Label */ + { + tmp = malloc(sizeof(DEVICE_OBJECT)); + *DeviceObject = (void *)tmp; + } + return (0L); + switch_9_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_9_break: /* CIL Label */; + } } - return (0L); - switch_9_default: /* CIL Label */ ; - return (-1073741823L); - } else { - switch_9_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; -NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , PUNICODE_STRING DeviceName ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_10_0; - } else { - { - goto switch_10_default; - if (0) { - switch_10_0: /* CIL Label */ ; - return (0L); - switch_10_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_10_0; } else { - switch_10_break: /* CIL Label */ ; - } + { + goto switch_10_default; + if (0) { + switch_10_0: /* CIL Label */; + return (0L); + switch_10_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_10_break: /* CIL Label */; + } + } } } } -} - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; -void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) -{ +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject) { - { - return; -} + { return; } } - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_11_0; - } else { - { - goto switch_11_default; - if (0) { - switch_11_0: /* CIL Label */ ; - return (0L); - switch_11_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_11_0; } else { - switch_11_break: /* CIL Label */ ; - } + { + goto switch_11_default; + if (0) { + switch_11_0: /* CIL Label */; + return (0L); + switch_11_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_11_break: /* CIL Label */; + } + } } } } -} - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; -void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) -{ +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice) { - { - return; -} + { return; } } - void IoFreeIrp(PIRP Irp ) ; -void IoFreeIrp(PIRP Irp ) -{ +void IoFreeIrp(PIRP Irp); +void IoFreeIrp(PIRP Irp) { - { - return; -} + { return; } } - void IoFreeMdl(PMDL Mdl ) ; -void IoFreeMdl(PMDL Mdl ) -{ +void IoFreeMdl(PMDL Mdl); +void IoFreeMdl(PMDL Mdl) { - { - return; -} + { return; } } - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; -PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) -{ char *tmp ; +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) { + char *tmp; { - { - tmp = malloc(sizeof(CONFIGURATION_INFORMATION )); + { tmp = malloc(sizeof(CONFIGURATION_INFORMATION)); } + return ((void *)tmp); } - return ((void *)tmp); -} } - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; -NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , PULONG BusNumber , PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_12_0; - } else { - { - goto switch_12_default; - if (0) { - switch_12_0: /* CIL Label */ ; - return (0L); - switch_12_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_12_0; } else { - switch_12_break: /* CIL Label */ ; - } + { + goto switch_12_default; + if (0) { + switch_12_0: /* CIL Label */; + return (0L); + switch_12_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_12_break: /* CIL Label */; + } + } } } } -} - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_13_0; - } else { - { - goto switch_13_default; - if (0) { - switch_13_0: /* CIL Label */ ; - return (0L); - switch_13_default: /* CIL Label */ ; - return (-1073741808L); + if (__BLAST_NONDET___0 == 0) { + goto switch_13_0; } else { - switch_13_break: /* CIL Label */ ; - } + { + goto switch_13_default; + if (0) { + switch_13_0: /* CIL Label */; + return (0L); + switch_13_default: /* CIL Label */; + return (-1073741808L); + } else { + switch_13_break: /* CIL Label */; + } + } } } } -} - void IoReleaseCancelSpinLock(KIRQL Irql ) ; -void IoReleaseCancelSpinLock(KIRQL Irql ) -{ +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoReleaseCancelSpinLock(KIRQL Irql) { - { - return; -} + { return; } } - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , BOOLEAN Enable ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_14_0; - } else { - { - goto switch_14_default; - if (0) { - switch_14_0: /* CIL Label */ ; - return (0L); - switch_14_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_14_0; } else { - switch_14_break: /* CIL Label */ ; - } + { + goto switch_14_default; + if (0) { + switch_14_0: /* CIL Label */; + return (0L); + switch_14_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_14_break: /* CIL Label */; + } + } } } } -} - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; -void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) -{ +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject) { - { - return; + { return; } } -} -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { - if (s == NP) { - s = MPR1; - } else { - { - errorFn(); + if (s == NP) { + s = MPR1; + } else { + { errorFn(); } } + return; } - return; } -} - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - NTSTATUS returnVal2 ; - int compRetStatus ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; - NTSTATUS tmp___0 ; +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + NTSTATUS returnVal2; + int compRetStatus; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; + NTSTATUS tmp___0; { - if (compRegistered) { - if (routine == 0) { - { - tmp = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - } else { - { - tmp___0 = DiskPerfIoCompletion(DeviceObject, Irp, lcontext); - compRetStatus = tmp___0; + if (compRegistered) { + if (routine == 0) { + { + tmp = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext); + compRetStatus = tmp; + } + } else { + { + tmp___0 = DiskPerfIoCompletion(DeviceObject, Irp, lcontext); + compRetStatus = tmp___0; + } } - } - if ((long )compRetStatus == -1073741802L) { - { - stubMoreProcessingRequired(); + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET___0 == 0) { - goto switch_15_0; - } else { - if (__BLAST_NONDET___0 == 1) { - goto switch_15_1; + if (__BLAST_NONDET___0 == 0) { + goto switch_15_0; } else { - { - goto switch_15_default; - if (0) { - switch_15_0: /* CIL Label */ - returnVal2 = 0L; - goto switch_15_break; - switch_15_1: /* CIL Label */ - returnVal2 = -1073741823L; - goto switch_15_break; - switch_15_default: /* CIL Label */ - returnVal2 = 259L; - goto switch_15_break; + if (__BLAST_NONDET___0 == 1) { + goto switch_15_1; } else { - switch_15_break: /* CIL Label */ ; - } + { + goto switch_15_default; + if (0) { + switch_15_0: /* CIL Label */ + returnVal2 = 0L; + goto switch_15_break; + switch_15_1: /* CIL Label */ + returnVal2 = -1073741823L; + goto switch_15_break; + switch_15_default: /* CIL Label */ + returnVal2 = 259L; + goto switch_15_break; + } else { + switch_15_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal2; - } else { - if (s == MPR1) { - if (returnVal2 == 259L) { - s = MPR3; - lowerDriverReturn = returnVal2; - } else { - s = NP; - lowerDriverReturn = returnVal2; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal2; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal2; + if (s == MPR1) { + if (returnVal2 == 259L) { + s = MPR3; + lowerDriverReturn = returnVal2; + } else { + s = NP; + lowerDriverReturn = returnVal2; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal2; + } else { + { errorFn(); } } } } + return (returnVal2); } - return (returnVal2); } -} - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; -void IofCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) -{ +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost) { { - if (s == NP) { - s = DC; - } else { - { - errorFn(); + if (s == NP) { + s = DC; + } else { + { errorFn(); } } + return; } - return; } -} - KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ; -KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) -{ +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock); +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock) { - { - return ((unsigned char)0); + { return ((unsigned char)0); } } -} - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; -NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , BOOLEAN Alertable , PLARGE_INTEGER Interval ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_16_0; - } else { - { - goto switch_16_default; - if (0) { - switch_16_0: /* CIL Label */ ; - return (0L); - switch_16_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_16_0; } else { - switch_16_break: /* CIL Label */ ; - } + { + goto switch_16_default; + if (0) { + switch_16_0: /* CIL Label */; + return (0L); + switch_16_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_16_break: /* CIL Label */; + } + } } } } -} - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; -void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , BOOLEAN State ) -{ +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State) { - { - return; -} + { return; } } - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; -void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , LONG Count , LONG Limit ) -{ +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit) { - { - return; -} + { return; } } - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; -void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) -{ +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock) { - { - return; -} + { return; } } - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; -LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , LONG Adjustment , - BOOLEAN Wait ) -{ LONG r = __VERIFIER_nondet_long() ; +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait) { + LONG r = __VERIFIER_nondet_long(); - { - return (r); -} + { return (r); } } - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; -void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , KIRQL NewIrql ) -{ +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql) { - { - return; -} + { return; } } - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; -LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , BOOLEAN Wait ) -{ LONG l = __VERIFIER_nondet_long() ; +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait) { + LONG l = __VERIFIER_nondet_long(); { - setEventCalled = 1; - return (l); -} + setEventCalled = 1; + return (l); + } } - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; -NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , PLARGE_INTEGER Timeout ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (s == MPR3) { - if (setEventCalled == 1) { - s = NP; - setEventCalled = 0; - } else { - goto _L; - } - } else { - _L: /* CIL Label */ - if (customIrp == 1) { - s = NP; - customIrp = 0; + if (s == MPR3) { + if (setEventCalled == 1) { + s = NP; + setEventCalled = 0; + } else { + goto _L; + } } else { - if (s == MPR3) { - { - errorFn(); - } + _L: /* CIL Label */ + if (customIrp == 1) { + s = NP; + customIrp = 0; } else { - + if (s == MPR3) { + { errorFn(); } + } else { + } } } - } - if (__BLAST_NONDET___0 == 0) { - goto switch_17_0; - } else { - { - goto switch_17_default; - if (0) { - switch_17_0: /* CIL Label */ ; - return (0L); - switch_17_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_17_0; } else { - switch_17_break: /* CIL Label */ ; - } + { + goto switch_17_default; + if (0) { + switch_17_0: /* CIL Label */; + return (0L); + switch_17_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_17_break: /* CIL Label */; + } + } } } } -} - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; -PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , PHYSICAL_ADDRESS HighestAcceptableAddress ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - char *tmp ; +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET___0 == 0) { - goto switch_18_0; - } else { - if (__BLAST_NONDET___0 == 1) { - goto switch_18_1; + if (__BLAST_NONDET___0 == 0) { + goto switch_18_0; } else { - if (0) { - switch_18_0: /* CIL Label */ + if (__BLAST_NONDET___0 == 1) { + goto switch_18_1; + } else { + if (0) { + switch_18_0 : /* CIL Label */ { - tmp = malloc(NumberOfBytes); + tmp = malloc(NumberOfBytes); + } + return (tmp); + switch_18_1: /* CIL Label */; + return ((void *)0); + } else { + switch_18_break: /* CIL Label */; } - return (tmp); - switch_18_1: /* CIL Label */ ; - return ((void *)0); - } else { - switch_18_break: /* CIL Label */ ; } } + return ((void *)0); } - return ((void *)0); -} } - void MmFreeContiguousMemory(PVOID BaseAddress ) ; -void MmFreeContiguousMemory(PVOID BaseAddress ) -{ +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmFreeContiguousMemory(PVOID BaseAddress) { - { - return; -} + { return; } } - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; -PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , PVOID BaseAddress , - ULONG BugCheckOnFailure , MM_PAGE_PRIORITY Priority ) -{ +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority) { - { - return ((void *)0); -} + { return ((void *)0); } } - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; -PVOID MmPageEntireDriver(PVOID AddressWithinSection ) -{ +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection) { - { - return ((void *)0); -} + { return ((void *)0); } } - void MmResetDriverPaging(PVOID AddressWithinSection ) ; -void MmResetDriverPaging(PVOID AddressWithinSection ) -{ +void MmResetDriverPaging(PVOID AddressWithinSection); +void MmResetDriverPaging(PVOID AddressWithinSection) { - { - return; -} + { return; } } - void MmUnlockPages(PMDL MemoryDescriptorList ) ; -void MmUnlockPages(PMDL MemoryDescriptorList ) -{ +void MmUnlockPages(PMDL MemoryDescriptorList); +void MmUnlockPages(PMDL MemoryDescriptorList) { - { - return; -} + { return; } } - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; -NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , ACCESS_MASK DesiredAccess , POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , PVOID *Object , POBJECT_HANDLE_INFORMATION HandleInformation ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_19_0; - } else { - { - goto switch_19_default; - if (0) { - switch_19_0: /* CIL Label */ ; - return (0L); - switch_19_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_19_0; } else { - switch_19_break: /* CIL Label */ ; - } + { + goto switch_19_default; + if (0) { + switch_19_0: /* CIL Label */; + return (0L); + switch_19_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_19_break: /* CIL Label */; + } + } } } } -} - void ObfDereferenceObject(PVOID Object ) ; -void ObfDereferenceObject(PVOID Object ) -{ +void ObfDereferenceObject(PVOID Object); +void ObfDereferenceObject(PVOID Object) { - { - return; + { return; } } -} - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - int compRetStatus ; - NTSTATUS returnVal ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; - NTSTATUS tmp___0 ; +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + int compRetStatus; + NTSTATUS returnVal; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; + NTSTATUS tmp___0; { - if (compRegistered) { - if (routine == 0) { - { - tmp = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - } else { - if (routine == 1) { + if (compRegistered) { + if (routine == 0) { { - tmp___0 = DiskPerfIoCompletion(DeviceObject, Irp, lcontext); - compRetStatus = tmp___0; + tmp = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext); + compRetStatus = tmp; } } else { - + if (routine == 1) { + { + tmp___0 = DiskPerfIoCompletion(DeviceObject, Irp, lcontext); + compRetStatus = tmp___0; + } + } else { + } } - } - if ((long )compRetStatus == -1073741802L) { - { - stubMoreProcessingRequired(); + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET___0 == 0) { - goto switch_20_0; - } else { - if (__BLAST_NONDET___0 == 1) { - goto switch_20_1; + if (__BLAST_NONDET___0 == 0) { + goto switch_20_0; } else { - { - goto switch_20_default; - if (0) { - switch_20_0: /* CIL Label */ - returnVal = 0L; - goto switch_20_break; - switch_20_1: /* CIL Label */ - returnVal = -1073741823L; - goto switch_20_break; - switch_20_default: /* CIL Label */ - returnVal = 259L; - goto switch_20_break; + if (__BLAST_NONDET___0 == 1) { + goto switch_20_1; } else { - switch_20_break: /* CIL Label */ ; - } + { + goto switch_20_default; + if (0) { + switch_20_0: /* CIL Label */ + returnVal = 0L; + goto switch_20_break; + switch_20_1: /* CIL Label */ + returnVal = -1073741823L; + goto switch_20_break; + switch_20_default: /* CIL Label */ + returnVal = 259L; + goto switch_20_break; + } else { + switch_20_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal; - } else { - if (s == MPR1) { - if (returnVal == 259L) { - s = MPR3; - lowerDriverReturn = returnVal; - } else { - s = NP; - lowerDriverReturn = returnVal; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal; + if (s == MPR1) { + if (returnVal == 259L) { + s = MPR3; + lowerDriverReturn = returnVal; + } else { + s = NP; + lowerDriverReturn = returnVal; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal; + } else { + { errorFn(); } } } } + return (returnVal); } - return (returnVal); -} } - void PoStartNextPowerIrp(PIRP Irp ) ; -void PoStartNextPowerIrp(PIRP Irp ) -{ +void PoStartNextPowerIrp(PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp) { - { - return; -} + { return; } } - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; -NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , ULONG DesiredAccess , POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , PCLIENT_ID ClientId , void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_21_0; - } else { - { - goto switch_21_default; - if (0) { - switch_21_0: /* CIL Label */ ; - return (0L); - switch_21_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_21_0; } else { - switch_21_break: /* CIL Label */ ; - } + { + goto switch_21_default; + if (0) { + switch_21_0: /* CIL Label */; + return (0L); + switch_21_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_21_break: /* CIL Label */; + } + } } } } -} - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_22_0; - } else { - { - goto switch_22_default; - if (0) { - switch_22_0: /* CIL Label */ ; - return (0L); - switch_22_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_22_0; } else { - switch_22_break: /* CIL Label */ ; - } + { + goto switch_22_default; + if (0) { + switch_22_0: /* CIL Label */; + return (0L); + switch_22_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_22_break: /* CIL Label */; + } + } } } } -} - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; -NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_23_0; - } else { - { - goto switch_23_default; - if (0) { - switch_23_0: /* CIL Label */ ; - return (0L); - switch_23_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_23_0; } else { - switch_23_break: /* CIL Label */ ; - } + { + goto switch_23_default; + if (0) { + switch_23_0: /* CIL Label */; + return (0L); + switch_23_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_23_break: /* CIL Label */; + } + } } } } -} - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; -SIZE_T RtlCompareMemory(void const *Source1 , void const *Source2 , - SIZE_T Length ) -{ SIZE_T r = __VERIFIER_nondet_long() ; +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length) { + SIZE_T r = __VERIFIER_nondet_long(); - { - return (r); + { return (r); } } -} - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; -void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) -{ +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString) { - { - return; + { return; } } -} - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; -NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , PCWSTR ValueName ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_24_0; - } else { - { - goto switch_24_default; - if (0) { - switch_24_0: /* CIL Label */ ; - return (0L); - switch_24_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_24_0; } else { - switch_24_break: /* CIL Label */ ; - } + { + goto switch_24_default; + if (0) { + switch_24_0: /* CIL Label */; + return (0L); + switch_24_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_24_break: /* CIL Label */; + } + } } } } -} - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; -void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) -{ +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString) { - { - return; -} + { return; } } - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; -void RtlInitString(PSTRING DestinationString , PCSZ SourceString ) -{ +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString) { - { - return; -} + { return; } } - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; -void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) -{ +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString) { - { - return; -} + { return; } } - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; -NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , PVOID Environment ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_25_0; - } else { - { - goto switch_25_default; - if (0) { - switch_25_0: /* CIL Label */ ; - return (0L); - switch_25_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_25_0; } else { - switch_25_break: /* CIL Label */ ; - } + { + goto switch_25_default; + if (0) { + switch_25_0: /* CIL Label */; + return (0L); + switch_25_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_25_break: /* CIL Label */; + } + } } } } -} - NTSTATUS ZwClose(HANDLE Handle ) ; -NTSTATUS ZwClose(HANDLE Handle ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS ZwClose(HANDLE Handle); +NTSTATUS ZwClose(HANDLE Handle) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_26_0; - } else { - { - goto switch_26_default; - if (0) { - switch_26_0: /* CIL Label */ ; - return (0L); - switch_26_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_26_0; } else { - switch_26_break: /* CIL Label */ ; - } + { + goto switch_26_default; + if (0) { + switch_26_0: /* CIL Label */; + return (0L); + switch_26_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_26_break: /* CIL Label */; + } + } } } } -} -NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo , PDEVICE_OBJECT DeviceObject , - PIRP Irp , PSYSCTL_IRP_DISPOSITION IrpDisposition ) -{ +NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo, + PDEVICE_OBJECT DeviceObject, PIRP Irp, + PSYSCTL_IRP_DISPOSITION IrpDisposition) { - { - return (0L); -} + { return (0L); } } diff --git a/test/ntdrivers/diskperf_true.i.cil.c b/test/ntdrivers/diskperf_true.i.cil.c index 3c5879efa..379e33d82 100644 --- a/test/ntdrivers/diskperf_true.i.cil.c +++ b/test/ntdrivers/diskperf_true.i.cil.c @@ -9,7 +9,7 @@ extern void *__VERIFIER_nondet_pointer(void); /* Generated by CIL v. 1.3.6 */ /* print_CIL_Input is true */ -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) typedef unsigned short wchar_t; typedef unsigned long ULONG_PTR; @@ -22,7 +22,7 @@ typedef long LONG; typedef wchar_t WCHAR; typedef WCHAR *PWCHAR; typedef WCHAR *PWSTR; -typedef WCHAR const *PCWSTR; +typedef WCHAR const *PCWSTR; typedef CHAR *PCHAR; typedef LONG *PLONG; typedef unsigned char UCHAR; @@ -39,72 +39,69 @@ typedef ULONG LCID; typedef LONG NTSTATUS; typedef long long LONGLONG; struct __anonstruct____missing_field_name_1 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; struct __anonstruct_u_2 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; union _LARGE_INTEGER { - struct __anonstruct____missing_field_name_1 __annonCompField1 ; - struct __anonstruct_u_2 u ; - LONGLONG QuadPart ; + struct __anonstruct____missing_field_name_1 __annonCompField1; + struct __anonstruct_u_2 u; + LONGLONG QuadPart; }; typedef union _LARGE_INTEGER LARGE_INTEGER; typedef LARGE_INTEGER *PLARGE_INTEGER; struct _LUID { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; typedef struct _LUID LUID; typedef LARGE_INTEGER PHYSICAL_ADDRESS; -enum _EVENT_TYPE { - NotificationEvent = 0, - SynchronizationEvent = 1 -} ; +enum _EVENT_TYPE { NotificationEvent = 0, SynchronizationEvent = 1 }; typedef enum _EVENT_TYPE EVENT_TYPE; -typedef char const *PCSZ; +typedef char const *PCSZ; struct _STRING { - USHORT Length ; - USHORT MaximumLength ; - PCHAR Buffer ; + USHORT Length; + USHORT MaximumLength; + PCHAR Buffer; }; typedef struct _STRING STRING; typedef STRING *PSTRING; typedef PSTRING PANSI_STRING; struct _UNICODE_STRING { - USHORT Length ; - USHORT MaximumLength ; - PWSTR Buffer ; + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; }; typedef struct _UNICODE_STRING UNICODE_STRING; typedef UNICODE_STRING *PUNICODE_STRING; typedef UCHAR BOOLEAN; struct _LIST_ENTRY { - struct _LIST_ENTRY *Flink ; - struct _LIST_ENTRY *Blink ; + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; }; typedef struct _LIST_ENTRY LIST_ENTRY; typedef struct _LIST_ENTRY *PLIST_ENTRY; struct _OBJECT_ATTRIBUTES { - ULONG Length ; - HANDLE RootDirectory ; - PUNICODE_STRING ObjectName ; - ULONG Attributes ; - PVOID SecurityDescriptor ; - PVOID SecurityQualityOfService ; + ULONG Length; + HANDLE RootDirectory; + PUNICODE_STRING ObjectName; + ULONG Attributes; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; }; typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES; typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; struct _GUID { - unsigned long Data1 ; - unsigned short Data2 ; - unsigned short Data3 ; - unsigned char Data4[8] ; + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; }; typedef struct _GUID GUID; -typedef GUID const *LPCGUID; +typedef GUID const *LPCGUID; typedef unsigned int size_t; typedef UCHAR KIRQL; struct _KTHREAD; @@ -120,82 +117,85 @@ typedef struct _OBJECT_TYPE *POBJECT_TYPE; typedef CCHAR KPROCESSOR_MODE; struct _KAPC; struct _KAPC; -typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ); +typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); struct _KAPC { - CSHORT Type ; - CSHORT Size ; - ULONG Spare0 ; - struct _KTHREAD *Thread ; - LIST_ENTRY ApcListEntry ; - void (*KernelRoutine)(struct _KAPC *Apc , PKNORMAL_ROUTINE *NormalRoutine , PVOID *NormalContext , - PVOID *SystemArgument1 , PVOID *SystemArgument2 ) ; - void (*RundownRoutine)(struct _KAPC *Apc ) ; - void (*NormalRoutine)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ) ; - PVOID NormalContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - CCHAR ApcStateIndex ; - KPROCESSOR_MODE ApcMode ; - BOOLEAN Inserted ; + CSHORT Type; + CSHORT Size; + ULONG Spare0; + struct _KTHREAD *Thread; + LIST_ENTRY ApcListEntry; + void (*KernelRoutine)(struct _KAPC *Apc, PKNORMAL_ROUTINE *NormalRoutine, + PVOID *NormalContext, PVOID *SystemArgument1, + PVOID *SystemArgument2); + void (*RundownRoutine)(struct _KAPC *Apc); + void (*NormalRoutine)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); + PVOID NormalContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + CCHAR ApcStateIndex; + KPROCESSOR_MODE ApcMode; + BOOLEAN Inserted; }; typedef struct _KAPC KAPC; struct _KDPC; struct _KDPC; struct _KDPC { - CSHORT Type ; - UCHAR Number ; - UCHAR Importance ; - LIST_ENTRY DpcListEntry ; - void (*DeferredRoutine)(struct _KDPC *Dpc , PVOID DeferredContext , PVOID SystemArgument1 , - PVOID SystemArgument2 ) ; - PVOID DeferredContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - PULONG_PTR Lock ; + CSHORT Type; + UCHAR Number; + UCHAR Importance; + LIST_ENTRY DpcListEntry; + void (*DeferredRoutine)(struct _KDPC *Dpc, PVOID DeferredContext, + PVOID SystemArgument1, PVOID SystemArgument2); + PVOID DeferredContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + PULONG_PTR Lock; }; typedef struct _KDPC KDPC; typedef struct _KDPC *PKDPC; struct _MDL { - struct _MDL *Next ; - CSHORT Size ; - CSHORT MdlFlags ; - struct _EPROCESS *Process ; - PVOID MappedSystemVa ; - PVOID StartVa ; - ULONG ByteCount ; - ULONG ByteOffset ; + struct _MDL *Next; + CSHORT Size; + CSHORT MdlFlags; + struct _EPROCESS *Process; + PVOID MappedSystemVa; + PVOID StartVa; + ULONG ByteCount; + ULONG ByteOffset; }; typedef struct _MDL MDL; typedef struct _MDL *PMDL; typedef PVOID PACCESS_TOKEN; typedef PVOID PSECURITY_DESCRIPTOR; typedef ULONG ACCESS_MASK; -#pragma pack(push,4) +#pragma pack(push, 4) struct _LUID_AND_ATTRIBUTES { - LUID Luid ; - ULONG Attributes ; + LUID Luid; + ULONG Attributes; }; typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES; #pragma pack(pop) struct _PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[1] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[1]; }; typedef struct _PRIVILEGE_SET PRIVILEGE_SET; enum _SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous = 0, - SecurityIdentification = 1, - SecurityImpersonation = 2, - SecurityDelegation = 3 -} ; + SecurityAnonymous = 0, + SecurityIdentification = 1, + SecurityImpersonation = 2, + SecurityDelegation = 3 +}; typedef enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL; typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE; struct _SECURITY_QUALITY_OF_SERVICE { - ULONG Length ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode ; - BOOLEAN EffectiveOnly ; + ULONG Length; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; + BOOLEAN EffectiveOnly; }; typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE; typedef ULONG SECURITY_INFORMATION; @@ -203,581 +203,578 @@ typedef LONG KPRIORITY; typedef ULONG_PTR KSPIN_LOCK; typedef KSPIN_LOCK *PKSPIN_LOCK; struct _RTL_QUERY_REGISTRY_TABLE { - NTSTATUS (*QueryRoutine)(PWSTR ValueName , ULONG ValueType , - PVOID ValueData , ULONG ValueLength , - PVOID Context , PVOID EntryContext ) ; - ULONG Flags ; - PWSTR Name ; - PVOID EntryContext ; - ULONG DefaultType ; - PVOID DefaultData ; - ULONG DefaultLength ; + NTSTATUS(*QueryRoutine) + (PWSTR ValueName, ULONG ValueType, PVOID ValueData, ULONG ValueLength, + PVOID Context, PVOID EntryContext); + ULONG Flags; + PWSTR Name; + PVOID EntryContext; + ULONG DefaultType; + PVOID DefaultData; + ULONG DefaultLength; }; typedef struct _RTL_QUERY_REGISTRY_TABLE *PRTL_QUERY_REGISTRY_TABLE; union __anonunion____missing_field_name_6 { - NTSTATUS Status ; - PVOID Pointer ; + NTSTATUS Status; + PVOID Pointer; }; struct _IO_STATUS_BLOCK { - union __anonunion____missing_field_name_6 __annonCompField4 ; - ULONG_PTR Information ; + union __anonunion____missing_field_name_6 __annonCompField4; + ULONG_PTR Information; }; typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK; typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK; enum _FILE_INFORMATION_CLASS { - FileDirectoryInformation = 1, - FileFullDirectoryInformation = 2, - FileBothDirectoryInformation = 3, - FileBasicInformation = 4, - FileStandardInformation = 5, - FileInternalInformation = 6, - FileEaInformation = 7, - FileAccessInformation = 8, - FileNameInformation = 9, - FileRenameInformation = 10, - FileLinkInformation = 11, - FileNamesInformation = 12, - FileDispositionInformation = 13, - FilePositionInformation = 14, - FileFullEaInformation = 15, - FileModeInformation = 16, - FileAlignmentInformation = 17, - FileAllInformation = 18, - FileAllocationInformation = 19, - FileEndOfFileInformation = 20, - FileAlternateNameInformation = 21, - FileStreamInformation = 22, - FilePipeInformation = 23, - FilePipeLocalInformation = 24, - FilePipeRemoteInformation = 25, - FileMailslotQueryInformation = 26, - FileMailslotSetInformation = 27, - FileCompressionInformation = 28, - FileObjectIdInformation = 29, - FileCompletionInformation = 30, - FileMoveClusterInformation = 31, - FileQuotaInformation = 32, - FileReparsePointInformation = 33, - FileNetworkOpenInformation = 34, - FileAttributeTagInformation = 35, - FileTrackingInformation = 36, - FileMaximumInformation = 37 -} ; + FileDirectoryInformation = 1, + FileFullDirectoryInformation = 2, + FileBothDirectoryInformation = 3, + FileBasicInformation = 4, + FileStandardInformation = 5, + FileInternalInformation = 6, + FileEaInformation = 7, + FileAccessInformation = 8, + FileNameInformation = 9, + FileRenameInformation = 10, + FileLinkInformation = 11, + FileNamesInformation = 12, + FileDispositionInformation = 13, + FilePositionInformation = 14, + FileFullEaInformation = 15, + FileModeInformation = 16, + FileAlignmentInformation = 17, + FileAllInformation = 18, + FileAllocationInformation = 19, + FileEndOfFileInformation = 20, + FileAlternateNameInformation = 21, + FileStreamInformation = 22, + FilePipeInformation = 23, + FilePipeLocalInformation = 24, + FilePipeRemoteInformation = 25, + FileMailslotQueryInformation = 26, + FileMailslotSetInformation = 27, + FileCompressionInformation = 28, + FileObjectIdInformation = 29, + FileCompletionInformation = 30, + FileMoveClusterInformation = 31, + FileQuotaInformation = 32, + FileReparsePointInformation = 33, + FileNetworkOpenInformation = 34, + FileAttributeTagInformation = 35, + FileTrackingInformation = 36, + FileMaximumInformation = 37 +}; typedef enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS; struct _FILE_BASIC_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + ULONG FileAttributes; }; typedef struct _FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION; struct _FILE_STANDARD_INFORMATION { - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG NumberOfLinks ; - BOOLEAN DeletePending ; - BOOLEAN Directory ; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG NumberOfLinks; + BOOLEAN DeletePending; + BOOLEAN Directory; }; typedef struct _FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION; struct _FILE_NETWORK_OPEN_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG FileAttributes; }; typedef struct _FILE_NETWORK_OPEN_INFORMATION *PFILE_NETWORK_OPEN_INFORMATION; enum _FSINFOCLASS { - FileFsVolumeInformation = 1, - FileFsLabelInformation = 2, - FileFsSizeInformation = 3, - FileFsDeviceInformation = 4, - FileFsAttributeInformation = 5, - FileFsControlInformation = 6, - FileFsFullSizeInformation = 7, - FileFsObjectIdInformation = 8, - FileFsMaximumInformation = 9 -} ; + FileFsVolumeInformation = 1, + FileFsLabelInformation = 2, + FileFsSizeInformation = 3, + FileFsDeviceInformation = 4, + FileFsAttributeInformation = 5, + FileFsControlInformation = 6, + FileFsFullSizeInformation = 7, + FileFsObjectIdInformation = 8, + FileFsMaximumInformation = 9 +}; typedef enum _FSINFOCLASS FS_INFORMATION_CLASS; enum _INTERFACE_TYPE { - InterfaceTypeUndefined = -1, - Internal = 0, - Isa = 1, - Eisa = 2, - MicroChannel = 3, - TurboChannel = 4, - PCIBus = 5, - VMEBus = 6, - NuBus = 7, - PCMCIABus = 8, - CBus = 9, - MPIBus = 10, - MPSABus = 11, - ProcessorInternal = 12, - InternalPowerBus = 13, - PNPISABus = 14, - PNPBus = 15, - MaximumInterfaceType = 16 -} ; + InterfaceTypeUndefined = -1, + Internal = 0, + Isa = 1, + Eisa = 2, + MicroChannel = 3, + TurboChannel = 4, + PCIBus = 5, + VMEBus = 6, + NuBus = 7, + PCMCIABus = 8, + CBus = 9, + MPIBus = 10, + MPSABus = 11, + ProcessorInternal = 12, + InternalPowerBus = 13, + PNPISABus = 14, + PNPBus = 15, + MaximumInterfaceType = 16 +}; typedef enum _INTERFACE_TYPE INTERFACE_TYPE; typedef enum _INTERFACE_TYPE *PINTERFACE_TYPE; struct _IO_ERROR_LOG_PACKET { - UCHAR MajorFunctionCode ; - UCHAR RetryCount ; - USHORT DumpDataSize ; - USHORT NumberOfStrings ; - USHORT StringOffset ; - USHORT EventCategory ; - NTSTATUS ErrorCode ; - ULONG UniqueErrorValue ; - NTSTATUS FinalStatus ; - ULONG SequenceNumber ; - ULONG IoControlCode ; - LARGE_INTEGER DeviceOffset ; - ULONG DumpData[1] ; + UCHAR MajorFunctionCode; + UCHAR RetryCount; + USHORT DumpDataSize; + USHORT NumberOfStrings; + USHORT StringOffset; + USHORT EventCategory; + NTSTATUS ErrorCode; + ULONG UniqueErrorValue; + NTSTATUS FinalStatus; + ULONG SequenceNumber; + ULONG IoControlCode; + LARGE_INTEGER DeviceOffset; + ULONG DumpData[1]; }; typedef struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET; typedef struct _IO_ERROR_LOG_PACKET *PIO_ERROR_LOG_PACKET; struct _KEY_VALUE_FULL_INFORMATION { - ULONG TitleIndex ; - ULONG Type ; - ULONG DataOffset ; - ULONG DataLength ; - ULONG NameLength ; - WCHAR Name[1] ; + ULONG TitleIndex; + ULONG Type; + ULONG DataOffset; + ULONG DataLength; + ULONG NameLength; + WCHAR Name[1]; }; typedef struct _KEY_VALUE_FULL_INFORMATION *PKEY_VALUE_FULL_INFORMATION; struct _CLIENT_ID { - HANDLE UniqueProcess ; - HANDLE UniqueThread ; + HANDLE UniqueProcess; + HANDLE UniqueThread; }; typedef struct _CLIENT_ID CLIENT_ID; typedef CLIENT_ID *PCLIENT_ID; enum _SYSTEM_POWER_STATE { - PowerSystemUnspecified = 0, - PowerSystemWorking = 1, - PowerSystemSleeping1 = 2, - PowerSystemSleeping2 = 3, - PowerSystemSleeping3 = 4, - PowerSystemHibernate = 5, - PowerSystemShutdown = 6, - PowerSystemMaximum = 7 -} ; + PowerSystemUnspecified = 0, + PowerSystemWorking = 1, + PowerSystemSleeping1 = 2, + PowerSystemSleeping2 = 3, + PowerSystemSleeping3 = 4, + PowerSystemHibernate = 5, + PowerSystemShutdown = 6, + PowerSystemMaximum = 7 +}; typedef enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE; enum __anonenum_POWER_ACTION_11 { - PowerActionNone = 0, - PowerActionReserved = 1, - PowerActionSleep = 2, - PowerActionHibernate = 3, - PowerActionShutdown = 4, - PowerActionShutdownReset = 5, - PowerActionShutdownOff = 6, - PowerActionWarmEject = 7 -} ; + PowerActionNone = 0, + PowerActionReserved = 1, + PowerActionSleep = 2, + PowerActionHibernate = 3, + PowerActionShutdown = 4, + PowerActionShutdownReset = 5, + PowerActionShutdownOff = 6, + PowerActionWarmEject = 7 +}; typedef enum __anonenum_POWER_ACTION_11 POWER_ACTION; enum _DEVICE_POWER_STATE { - PowerDeviceUnspecified = 0, - PowerDeviceD0 = 1, - PowerDeviceD1 = 2, - PowerDeviceD2 = 3, - PowerDeviceD3 = 4, - PowerDeviceMaximum = 5 -} ; + PowerDeviceUnspecified = 0, + PowerDeviceD0 = 1, + PowerDeviceD1 = 2, + PowerDeviceD2 = 3, + PowerDeviceD3 = 4, + PowerDeviceMaximum = 5 +}; typedef enum _DEVICE_POWER_STATE DEVICE_POWER_STATE; union _POWER_STATE { - SYSTEM_POWER_STATE SystemState ; - DEVICE_POWER_STATE DeviceState ; + SYSTEM_POWER_STATE SystemState; + DEVICE_POWER_STATE DeviceState; }; typedef union _POWER_STATE POWER_STATE; -enum _POWER_STATE_TYPE { - SystemPowerState = 0, - DevicePowerState = 1 -} ; +enum _POWER_STATE_TYPE { SystemPowerState = 0, DevicePowerState = 1 }; typedef enum _POWER_STATE_TYPE POWER_STATE_TYPE; typedef PVOID PASSIGNED_RESOURCE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Generic_16 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Port_17 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Interrupt_18 { - ULONG Level ; - ULONG Vector ; - ULONG Affinity ; + ULONG Level; + ULONG Vector; + ULONG Affinity; }; struct __anonstruct_Memory_19 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Dma_20 { - ULONG Channel ; - ULONG Port ; - ULONG Reserved1 ; + ULONG Channel; + ULONG Port; + ULONG Reserved1; }; struct __anonstruct_DevicePrivate_21 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_22 { - ULONG Start ; - ULONG Length ; - ULONG Reserved ; + ULONG Start; + ULONG Length; + ULONG Reserved; }; struct __anonstruct_DeviceSpecificData_23 { - ULONG DataSize ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG DataSize; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_15 { - struct __anonstruct_Generic_16 Generic ; - struct __anonstruct_Port_17 Port ; - struct __anonstruct_Interrupt_18 Interrupt ; - struct __anonstruct_Memory_19 Memory ; - struct __anonstruct_Dma_20 Dma ; - struct __anonstruct_DevicePrivate_21 DevicePrivate ; - struct __anonstruct_BusNumber_22 BusNumber ; - struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData ; + struct __anonstruct_Generic_16 Generic; + struct __anonstruct_Port_17 Port; + struct __anonstruct_Interrupt_18 Interrupt; + struct __anonstruct_Memory_19 Memory; + struct __anonstruct_Dma_20 Dma; + struct __anonstruct_DevicePrivate_21 DevicePrivate; + struct __anonstruct_BusNumber_22 BusNumber; + struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData; }; struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { - UCHAR Type ; - UCHAR ShareDisposition ; - USHORT Flags ; - union __anonunion_u_15 u ; + UCHAR Type; + UCHAR ShareDisposition; + USHORT Flags; + union __anonunion_u_15 u; }; typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR; #pragma pack(pop) struct _CM_PARTIAL_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; }; typedef struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST; struct _CM_FULL_RESOURCE_DESCRIPTOR { - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - CM_PARTIAL_RESOURCE_LIST PartialResourceList ; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; }; typedef struct _CM_FULL_RESOURCE_DESCRIPTOR CM_FULL_RESOURCE_DESCRIPTOR; struct _CM_RESOURCE_LIST { - ULONG Count ; - CM_FULL_RESOURCE_DESCRIPTOR List[1] ; + ULONG Count; + CM_FULL_RESOURCE_DESCRIPTOR List[1]; }; typedef struct _CM_RESOURCE_LIST *PCM_RESOURCE_LIST; -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct __anonstruct_Port_25 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Memory_26 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Interrupt_27 { - ULONG MinimumVector ; - ULONG MaximumVector ; + ULONG MinimumVector; + ULONG MaximumVector; }; struct __anonstruct_Dma_28 { - ULONG MinimumChannel ; - ULONG MaximumChannel ; + ULONG MinimumChannel; + ULONG MaximumChannel; }; struct __anonstruct_Generic_29 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_DevicePrivate_30 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_31 { - ULONG Length ; - ULONG MinBusNumber ; - ULONG MaxBusNumber ; - ULONG Reserved ; + ULONG Length; + ULONG MinBusNumber; + ULONG MaxBusNumber; + ULONG Reserved; }; struct __anonstruct_AssignedResource_32 { - PASSIGNED_RESOURCE AssignedResource ; + PASSIGNED_RESOURCE AssignedResource; }; struct __anonstruct_SubAllocateFrom_33 { - UCHAR Type ; - UCHAR Reserved[3] ; - PASSIGNED_RESOURCE AssignedResource ; - PHYSICAL_ADDRESS Transformation ; + UCHAR Type; + UCHAR Reserved[3]; + PASSIGNED_RESOURCE AssignedResource; + PHYSICAL_ADDRESS Transformation; }; struct __anonstruct_ConfigData_34 { - ULONG Priority ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG Priority; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_24 { - struct __anonstruct_Port_25 Port ; - struct __anonstruct_Memory_26 Memory ; - struct __anonstruct_Interrupt_27 Interrupt ; - struct __anonstruct_Dma_28 Dma ; - struct __anonstruct_Generic_29 Generic ; - struct __anonstruct_DevicePrivate_30 DevicePrivate ; - struct __anonstruct_BusNumber_31 BusNumber ; - struct __anonstruct_AssignedResource_32 AssignedResource ; - struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom ; - struct __anonstruct_ConfigData_34 ConfigData ; + struct __anonstruct_Port_25 Port; + struct __anonstruct_Memory_26 Memory; + struct __anonstruct_Interrupt_27 Interrupt; + struct __anonstruct_Dma_28 Dma; + struct __anonstruct_Generic_29 Generic; + struct __anonstruct_DevicePrivate_30 DevicePrivate; + struct __anonstruct_BusNumber_31 BusNumber; + struct __anonstruct_AssignedResource_32 AssignedResource; + struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom; + struct __anonstruct_ConfigData_34 ConfigData; }; struct _IO_RESOURCE_DESCRIPTOR { - UCHAR Option ; - UCHAR Type ; - UCHAR ShareDisposition ; - UCHAR Spare1 ; - USHORT Flags ; - USHORT Spare2 ; - union __anonunion_u_24 u ; + UCHAR Option; + UCHAR Type; + UCHAR ShareDisposition; + UCHAR Spare1; + USHORT Flags; + USHORT Spare2; + union __anonunion_u_24 u; }; typedef struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR; struct _IO_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - IO_RESOURCE_DESCRIPTOR Descriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + IO_RESOURCE_DESCRIPTOR Descriptors[1]; }; typedef struct _IO_RESOURCE_LIST IO_RESOURCE_LIST; struct _IO_RESOURCE_REQUIREMENTS_LIST { - ULONG ListSize ; - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - ULONG SlotNumber ; - ULONG Reserved[3] ; - ULONG AlternativeLists ; - IO_RESOURCE_LIST List[1] ; + ULONG ListSize; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + ULONG SlotNumber; + ULONG Reserved[3]; + ULONG AlternativeLists; + IO_RESOURCE_LIST List[1]; }; typedef struct _IO_RESOURCE_REQUIREMENTS_LIST *PIO_RESOURCE_REQUIREMENTS_LIST; enum _CONFIGURATION_TYPE { - ArcSystem = 0, - CentralProcessor = 1, - FloatingPointProcessor = 2, - PrimaryIcache = 3, - PrimaryDcache = 4, - SecondaryIcache = 5, - SecondaryDcache = 6, - SecondaryCache = 7, - EisaAdapter = 8, - TcAdapter = 9, - ScsiAdapter = 10, - DtiAdapter = 11, - MultiFunctionAdapter = 12, - DiskController = 13, - TapeController = 14, - CdromController = 15, - WormController = 16, - SerialController = 17, - NetworkController = 18, - DisplayController = 19, - ParallelController = 20, - PointerController = 21, - KeyboardController = 22, - AudioController = 23, - OtherController = 24, - DiskPeripheral = 25, - FloppyDiskPeripheral = 26, - TapePeripheral = 27, - ModemPeripheral = 28, - MonitorPeripheral = 29, - PrinterPeripheral = 30, - PointerPeripheral = 31, - KeyboardPeripheral = 32, - TerminalPeripheral = 33, - OtherPeripheral = 34, - LinePeripheral = 35, - NetworkPeripheral = 36, - SystemMemory = 37, - DockingInformation = 38, - RealModeIrqRoutingTable = 39, - MaximumType = 40 -} ; + ArcSystem = 0, + CentralProcessor = 1, + FloatingPointProcessor = 2, + PrimaryIcache = 3, + PrimaryDcache = 4, + SecondaryIcache = 5, + SecondaryDcache = 6, + SecondaryCache = 7, + EisaAdapter = 8, + TcAdapter = 9, + ScsiAdapter = 10, + DtiAdapter = 11, + MultiFunctionAdapter = 12, + DiskController = 13, + TapeController = 14, + CdromController = 15, + WormController = 16, + SerialController = 17, + NetworkController = 18, + DisplayController = 19, + ParallelController = 20, + PointerController = 21, + KeyboardController = 22, + AudioController = 23, + OtherController = 24, + DiskPeripheral = 25, + FloppyDiskPeripheral = 26, + TapePeripheral = 27, + ModemPeripheral = 28, + MonitorPeripheral = 29, + PrinterPeripheral = 30, + PointerPeripheral = 31, + KeyboardPeripheral = 32, + TerminalPeripheral = 33, + OtherPeripheral = 34, + LinePeripheral = 35, + NetworkPeripheral = 36, + SystemMemory = 37, + DockingInformation = 38, + RealModeIrqRoutingTable = 39, + MaximumType = 40 +}; typedef enum _CONFIGURATION_TYPE CONFIGURATION_TYPE; typedef enum _CONFIGURATION_TYPE *PCONFIGURATION_TYPE; enum _KWAIT_REASON { - Executive = 0, - FreePage = 1, - PageIn = 2, - PoolAllocation = 3, - DelayExecution = 4, - Suspended = 5, - UserRequest = 6, - WrExecutive = 7, - WrFreePage = 8, - WrPageIn = 9, - WrPoolAllocation = 10, - WrDelayExecution = 11, - WrSuspended = 12, - WrUserRequest = 13, - WrEventPair = 14, - WrQueue = 15, - WrLpcReceive = 16, - WrLpcReply = 17, - WrVirtualMemory = 18, - WrPageOut = 19, - WrRendezvous = 20, - Spare2 = 21, - Spare3 = 22, - Spare4 = 23, - Spare5 = 24, - Spare6 = 25, - WrKernel = 26, - MaximumWaitReason = 27 -} ; + Executive = 0, + FreePage = 1, + PageIn = 2, + PoolAllocation = 3, + DelayExecution = 4, + Suspended = 5, + UserRequest = 6, + WrExecutive = 7, + WrFreePage = 8, + WrPageIn = 9, + WrPoolAllocation = 10, + WrDelayExecution = 11, + WrSuspended = 12, + WrUserRequest = 13, + WrEventPair = 14, + WrQueue = 15, + WrLpcReceive = 16, + WrLpcReply = 17, + WrVirtualMemory = 18, + WrPageOut = 19, + WrRendezvous = 20, + Spare2 = 21, + Spare3 = 22, + Spare4 = 23, + Spare5 = 24, + Spare6 = 25, + WrKernel = 26, + MaximumWaitReason = 27 +}; typedef enum _KWAIT_REASON KWAIT_REASON; struct _DISPATCHER_HEADER { - UCHAR Type ; - UCHAR Absolute ; - UCHAR Size ; - UCHAR Inserted ; - LONG SignalState ; - LIST_ENTRY WaitListHead ; + UCHAR Type; + UCHAR Absolute; + UCHAR Size; + UCHAR Inserted; + LONG SignalState; + LIST_ENTRY WaitListHead; }; typedef struct _DISPATCHER_HEADER DISPATCHER_HEADER; struct _KDEVICE_QUEUE { - CSHORT Type ; - CSHORT Size ; - LIST_ENTRY DeviceListHead ; - KSPIN_LOCK Lock ; - BOOLEAN Busy ; + CSHORT Type; + CSHORT Size; + LIST_ENTRY DeviceListHead; + KSPIN_LOCK Lock; + BOOLEAN Busy; }; typedef struct _KDEVICE_QUEUE KDEVICE_QUEUE; struct _KDEVICE_QUEUE_ENTRY { - LIST_ENTRY DeviceListEntry ; - ULONG SortKey ; - BOOLEAN Inserted ; + LIST_ENTRY DeviceListEntry; + ULONG SortKey; + BOOLEAN Inserted; }; typedef struct _KDEVICE_QUEUE_ENTRY KDEVICE_QUEUE_ENTRY; struct _KEVENT { - DISPATCHER_HEADER Header ; + DISPATCHER_HEADER Header; }; typedef struct _KEVENT KEVENT; typedef struct _KEVENT *PKEVENT; typedef struct _KEVENT *PRKEVENT; struct _KSEMAPHORE { - DISPATCHER_HEADER Header ; - LONG Limit ; + DISPATCHER_HEADER Header; + LONG Limit; }; typedef struct _KSEMAPHORE *PKSEMAPHORE; typedef struct _KSEMAPHORE *PRKSEMAPHORE; enum _MEMORY_CACHING_TYPE { - MmNonCached = 0, - MmCached = 1, - MmWriteCombined = 2, - MmHardwareCoherentCached = 3, - MmNonCachedUnordered = 4, - MmUSWCCached = 5, - MmMaximumCacheType = 6 -} ; + MmNonCached = 0, + MmCached = 1, + MmWriteCombined = 2, + MmHardwareCoherentCached = 3, + MmNonCachedUnordered = 4, + MmUSWCCached = 5, + MmMaximumCacheType = 6 +}; typedef enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE; enum _POOL_TYPE { - NonPagedPool = 0, - PagedPool = 1, - NonPagedPoolMustSucceed = 2, - DontUseThisType = 3, - NonPagedPoolCacheAligned = 4, - PagedPoolCacheAligned = 5, - NonPagedPoolCacheAlignedMustS = 6, - MaxPoolType = 7, - NonPagedPoolSession = 32, - PagedPoolSession = 33, - NonPagedPoolMustSucceedSession = 34, - DontUseThisTypeSession = 35, - NonPagedPoolCacheAlignedSession = 36, - PagedPoolCacheAlignedSession = 37, - NonPagedPoolCacheAlignedMustSSession = 38 -} ; + NonPagedPool = 0, + PagedPool = 1, + NonPagedPoolMustSucceed = 2, + DontUseThisType = 3, + NonPagedPoolCacheAligned = 4, + PagedPoolCacheAligned = 5, + NonPagedPoolCacheAlignedMustS = 6, + MaxPoolType = 7, + NonPagedPoolSession = 32, + PagedPoolSession = 33, + NonPagedPoolMustSucceedSession = 34, + DontUseThisTypeSession = 35, + NonPagedPoolCacheAlignedSession = 36, + PagedPoolCacheAlignedSession = 37, + NonPagedPoolCacheAlignedMustSSession = 38 +}; typedef enum _POOL_TYPE POOL_TYPE; struct _FAST_MUTEX { - LONG Count ; - PKTHREAD Owner ; - ULONG Contention ; - KEVENT Event ; - ULONG OldIrql ; + LONG Count; + PKTHREAD Owner; + ULONG Contention; + KEVENT Event; + ULONG OldIrql; }; typedef struct _FAST_MUTEX *PFAST_MUTEX; typedef ULONG_PTR ERESOURCE_THREAD; union __anonunion____missing_field_name_38 { - LONG OwnerCount ; - ULONG TableSize ; + LONG OwnerCount; + ULONG TableSize; }; struct _OWNER_ENTRY { - ERESOURCE_THREAD OwnerThread ; - union __anonunion____missing_field_name_38 __annonCompField10 ; + ERESOURCE_THREAD OwnerThread; + union __anonunion____missing_field_name_38 __annonCompField10; }; typedef struct _OWNER_ENTRY OWNER_ENTRY; typedef struct _OWNER_ENTRY *POWNER_ENTRY; union __anonunion____missing_field_name_39 { - PVOID Address ; - ULONG_PTR CreatorBackTraceIndex ; + PVOID Address; + ULONG_PTR CreatorBackTraceIndex; }; struct _ERESOURCE { - LIST_ENTRY SystemResourcesList ; - POWNER_ENTRY OwnerTable ; - SHORT ActiveCount ; - USHORT Flag ; - PKSEMAPHORE SharedWaiters ; - PKEVENT ExclusiveWaiters ; - OWNER_ENTRY OwnerThreads[2] ; - ULONG ContentionCount ; - USHORT NumberOfSharedWaiters ; - USHORT NumberOfExclusiveWaiters ; - union __anonunion____missing_field_name_39 __annonCompField11 ; - KSPIN_LOCK SpinLock ; + LIST_ENTRY SystemResourcesList; + POWNER_ENTRY OwnerTable; + SHORT ActiveCount; + USHORT Flag; + PKSEMAPHORE SharedWaiters; + PKEVENT ExclusiveWaiters; + OWNER_ENTRY OwnerThreads[2]; + ULONG ContentionCount; + USHORT NumberOfSharedWaiters; + USHORT NumberOfExclusiveWaiters; + union __anonunion____missing_field_name_39 __annonCompField11; + KSPIN_LOCK SpinLock; }; enum _MM_PAGE_PRIORITY { - LowPagePriority = 0, - NormalPagePriority = 16, - HighPagePriority = 32 -} ; + LowPagePriority = 0, + NormalPagePriority = 16, + HighPagePriority = 32 +}; typedef enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY; struct _DRIVER_OBJECT; struct _DRIVER_OBJECT; struct _SECURITY_SUBJECT_CONTEXT { - PACCESS_TOKEN ClientToken ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - PACCESS_TOKEN PrimaryToken ; - PVOID ProcessAuditId ; + PACCESS_TOKEN ClientToken; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + PACCESS_TOKEN PrimaryToken; + PVOID ProcessAuditId; }; typedef struct _SECURITY_SUBJECT_CONTEXT SECURITY_SUBJECT_CONTEXT; struct _INITIAL_PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[3] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[3]; }; typedef struct _INITIAL_PRIVILEGE_SET INITIAL_PRIVILEGE_SET; union __anonunion_Privileges_40 { - INITIAL_PRIVILEGE_SET InitialPrivilegeSet ; - PRIVILEGE_SET PrivilegeSet ; + INITIAL_PRIVILEGE_SET InitialPrivilegeSet; + PRIVILEGE_SET PrivilegeSet; }; struct _ACCESS_STATE { - LUID OperationID ; - BOOLEAN SecurityEvaluated ; - BOOLEAN GenerateAudit ; - BOOLEAN GenerateOnClose ; - BOOLEAN PrivilegesAllocated ; - ULONG Flags ; - ACCESS_MASK RemainingDesiredAccess ; - ACCESS_MASK PreviouslyGrantedAccess ; - ACCESS_MASK OriginalDesiredAccess ; - SECURITY_SUBJECT_CONTEXT SubjectSecurityContext ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - PVOID AuxData ; - union __anonunion_Privileges_40 Privileges ; - BOOLEAN AuditPrivileges ; - UNICODE_STRING ObjectName ; - UNICODE_STRING ObjectTypeName ; + LUID OperationID; + BOOLEAN SecurityEvaluated; + BOOLEAN GenerateAudit; + BOOLEAN GenerateOnClose; + BOOLEAN PrivilegesAllocated; + ULONG Flags; + ACCESS_MASK RemainingDesiredAccess; + ACCESS_MASK PreviouslyGrantedAccess; + ACCESS_MASK OriginalDesiredAccess; + SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PVOID AuxData; + union __anonunion_Privileges_40 Privileges; + BOOLEAN AuditPrivileges; + UNICODE_STRING ObjectName; + UNICODE_STRING ObjectTypeName; }; typedef struct _ACCESS_STATE *PACCESS_STATE; struct _DEVICE_OBJECT; @@ -789,688 +786,723 @@ struct _IRP; struct _IRP; struct _SCSI_REQUEST_BLOCK; struct _SCSI_REQUEST_BLOCK; -typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ); +typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp); struct _COMPRESSED_DATA_INFO; struct _FAST_IO_DISPATCH { - ULONG SizeOfFastIoDispatch ; - BOOLEAN (*FastIoCheckIfPossible)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , - BOOLEAN CheckForReadOperation , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryBasicInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_BASIC_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryStandardInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_STANDARD_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoLock)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - BOOLEAN FailImmediately , BOOLEAN ExclusiveLock , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockSingle)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAll)(struct _FILE_OBJECT *FileObject , PEPROCESS ProcessId , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAllByKey)(struct _FILE_OBJECT *FileObject , PVOID ProcessId , - ULONG Key , PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoDeviceControl)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , ULONG IoControlCode , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice , struct _DEVICE_OBJECT *TargetDevice ) ; - BOOLEAN (*FastIoQueryNetworkOpenInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - struct _FILE_NETWORK_OPEN_INFORMATION *Buffer , - struct _IO_STATUS_BLOCK *IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForModWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER EndingOffset , - struct _ERESOURCE **ResourceToRelease , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadComplete)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*PrepareMdlWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteComplete)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoReadCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , PMDL *MdlChain , - PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWriteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , - PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadCompleteCompressed)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteCompleteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryOpen)(struct _IRP *Irp , PFILE_NETWORK_OPEN_INFORMATION NetworkInformation , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForModWrite)(struct _FILE_OBJECT *FileObject , struct _ERESOURCE *ResourceToRelease , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; + ULONG SizeOfFastIoDispatch; + BOOLEAN(*FastIoCheckIfPossible) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, BOOLEAN CheckForReadOperation, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryBasicInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_BASIC_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryStandardInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_STANDARD_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoLock) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + BOOLEAN FailImmediately, BOOLEAN ExclusiveLock, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockSingle) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAll) + (struct _FILE_OBJECT *FileObject, PEPROCESS ProcessId, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAllByKey) + (struct _FILE_OBJECT *FileObject, PVOID ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoDeviceControl) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, PVOID InputBuffer, + ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength, + ULONG IoControlCode, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice, + struct _DEVICE_OBJECT *TargetDevice); + BOOLEAN(*FastIoQueryNetworkOpenInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + struct _FILE_NETWORK_OPEN_INFORMATION *Buffer, + struct _IO_STATUS_BLOCK *IoStatus, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForModWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER EndingOffset, + struct _ERESOURCE **ResourceToRelease, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadComplete) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*PrepareMdlWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteComplete) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoReadCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWriteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryOpen) + (struct _IRP *Irp, PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForModWrite) + (struct _FILE_OBJECT *FileObject, struct _ERESOURCE *ResourceToRelease, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); }; typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH; enum _IO_ALLOCATION_ACTION { - KeepObject = 1, - DeallocateObject = 2, - DeallocateObjectKeepRegisters = 3 -} ; + KeepObject = 1, + DeallocateObject = 2, + DeallocateObjectKeepRegisters = 3 +}; typedef enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION; struct _IO_SECURITY_CONTEXT { - PSECURITY_QUALITY_OF_SERVICE SecurityQos ; - PACCESS_STATE AccessState ; - ACCESS_MASK DesiredAccess ; - ULONG FullCreateOptions ; + PSECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_STATE AccessState; + ACCESS_MASK DesiredAccess; + ULONG FullCreateOptions; }; typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT; struct _VPB { - CSHORT Type ; - CSHORT Size ; - USHORT Flags ; - USHORT VolumeLabelLength ; - struct _DEVICE_OBJECT *DeviceObject ; - struct _DEVICE_OBJECT *RealDevice ; - ULONG SerialNumber ; - ULONG ReferenceCount ; - WCHAR VolumeLabel[(32U * sizeof(WCHAR )) / sizeof(WCHAR )] ; + CSHORT Type; + CSHORT Size; + USHORT Flags; + USHORT VolumeLabelLength; + struct _DEVICE_OBJECT *DeviceObject; + struct _DEVICE_OBJECT *RealDevice; + ULONG SerialNumber; + ULONG ReferenceCount; + WCHAR VolumeLabel[(32U * sizeof(WCHAR)) / sizeof(WCHAR)]; }; typedef struct _VPB *PVPB; struct _WAIT_CONTEXT_BLOCK { - KDEVICE_QUEUE_ENTRY WaitQueueEntry ; - IO_ALLOCATION_ACTION (*DeviceRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp , - PVOID MapRegisterBase , PVOID Context ) ; - PVOID DeviceContext ; - ULONG NumberOfMapRegisters ; - PVOID DeviceObject ; - PVOID CurrentIrp ; - PKDPC BufferChainingDpc ; + KDEVICE_QUEUE_ENTRY WaitQueueEntry; + IO_ALLOCATION_ACTION(*DeviceRoutine) + (struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp, PVOID MapRegisterBase, + PVOID Context); + PVOID DeviceContext; + ULONG NumberOfMapRegisters; + PVOID DeviceObject; + PVOID CurrentIrp; + PKDPC BufferChainingDpc; }; typedef struct _WAIT_CONTEXT_BLOCK WAIT_CONTEXT_BLOCK; union __anonunion_Queue_43 { - LIST_ENTRY ListEntry ; - WAIT_CONTEXT_BLOCK Wcb ; + LIST_ENTRY ListEntry; + WAIT_CONTEXT_BLOCK Wcb; }; struct _DEVOBJ_EXTENSION; struct _DEVICE_OBJECT { - CSHORT Type ; - USHORT Size ; - LONG ReferenceCount ; - struct _DRIVER_OBJECT *DriverObject ; - struct _DEVICE_OBJECT *NextDevice ; - struct _DEVICE_OBJECT *AttachedDevice ; - struct _IRP *CurrentIrp ; - PIO_TIMER Timer ; - ULONG Flags ; - ULONG Characteristics ; - PVPB Vpb ; - PVOID DeviceExtension ; - ULONG DeviceType ; - CCHAR StackSize ; - union __anonunion_Queue_43 Queue ; - ULONG AlignmentRequirement ; - KDEVICE_QUEUE DeviceQueue ; - KDPC Dpc ; - ULONG ActiveThreadCount ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - KEVENT DeviceLock ; - USHORT SectorSize ; - USHORT Spare1 ; - struct _DEVOBJ_EXTENSION *DeviceObjectExtension ; - PVOID Reserved ; + CSHORT Type; + USHORT Size; + LONG ReferenceCount; + struct _DRIVER_OBJECT *DriverObject; + struct _DEVICE_OBJECT *NextDevice; + struct _DEVICE_OBJECT *AttachedDevice; + struct _IRP *CurrentIrp; + PIO_TIMER Timer; + ULONG Flags; + ULONG Characteristics; + PVPB Vpb; + PVOID DeviceExtension; + ULONG DeviceType; + CCHAR StackSize; + union __anonunion_Queue_43 Queue; + ULONG AlignmentRequirement; + KDEVICE_QUEUE DeviceQueue; + KDPC Dpc; + ULONG ActiveThreadCount; + PSECURITY_DESCRIPTOR SecurityDescriptor; + KEVENT DeviceLock; + USHORT SectorSize; + USHORT Spare1; + struct _DEVOBJ_EXTENSION *DeviceObjectExtension; + PVOID Reserved; }; typedef struct _DEVICE_OBJECT DEVICE_OBJECT; typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; struct _DEVOBJ_EXTENSION { - CSHORT Type ; - USHORT Size ; - PDEVICE_OBJECT DeviceObject ; + CSHORT Type; + USHORT Size; + PDEVICE_OBJECT DeviceObject; }; struct _DRIVER_EXTENSION { - struct _DRIVER_OBJECT *DriverObject ; - NTSTATUS (*AddDevice)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ; - ULONG Count ; - UNICODE_STRING ServiceKeyName ; + struct _DRIVER_OBJECT *DriverObject; + NTSTATUS(*AddDevice) + (struct _DRIVER_OBJECT *DriverObject, + struct _DEVICE_OBJECT *PhysicalDeviceObject); + ULONG Count; + UNICODE_STRING ServiceKeyName; }; typedef struct _DRIVER_EXTENSION *PDRIVER_EXTENSION; struct _DRIVER_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - ULONG Flags ; - PVOID DriverStart ; - ULONG DriverSize ; - PVOID DriverSection ; - PDRIVER_EXTENSION DriverExtension ; - UNICODE_STRING DriverName ; - PUNICODE_STRING HardwareDatabase ; - PFAST_IO_DISPATCH FastIoDispatch ; - NTSTATUS (*DriverInit)(struct _DRIVER_OBJECT *DriverObject , PUNICODE_STRING RegistryPath ) ; - void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject ) ; - PDRIVER_DISPATCH MajorFunction[28] ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + PVOID DriverStart; + ULONG DriverSize; + PVOID DriverSection; + PDRIVER_EXTENSION DriverExtension; + UNICODE_STRING DriverName; + PUNICODE_STRING HardwareDatabase; + PFAST_IO_DISPATCH FastIoDispatch; + NTSTATUS(*DriverInit) + (struct _DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath); + void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject); + PDRIVER_DISPATCH MajorFunction[28]; }; typedef struct _DRIVER_OBJECT DRIVER_OBJECT; typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; struct _SECTION_OBJECT_POINTERS { - PVOID DataSectionObject ; - PVOID SharedCacheMap ; - PVOID ImageSectionObject ; + PVOID DataSectionObject; + PVOID SharedCacheMap; + PVOID ImageSectionObject; }; typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS; typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS; struct _IO_COMPLETION_CONTEXT { - PVOID Port ; - PVOID Key ; + PVOID Port; + PVOID Key; }; typedef struct _IO_COMPLETION_CONTEXT *PIO_COMPLETION_CONTEXT; struct _FILE_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - PVPB Vpb ; - PVOID FsContext ; - PVOID FsContext2 ; - PSECTION_OBJECT_POINTERS SectionObjectPointer ; - PVOID PrivateCacheMap ; - NTSTATUS FinalStatus ; - struct _FILE_OBJECT *RelatedFileObject ; - BOOLEAN LockOperation ; - BOOLEAN DeletePending ; - BOOLEAN ReadAccess ; - BOOLEAN WriteAccess ; - BOOLEAN DeleteAccess ; - BOOLEAN SharedRead ; - BOOLEAN SharedWrite ; - BOOLEAN SharedDelete ; - ULONG Flags ; - UNICODE_STRING FileName ; - LARGE_INTEGER CurrentByteOffset ; - ULONG Waiters ; - ULONG Busy ; - PVOID LastLock ; - KEVENT Lock ; - KEVENT Event ; - PIO_COMPLETION_CONTEXT CompletionContext ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + PVPB Vpb; + PVOID FsContext; + PVOID FsContext2; + PSECTION_OBJECT_POINTERS SectionObjectPointer; + PVOID PrivateCacheMap; + NTSTATUS FinalStatus; + struct _FILE_OBJECT *RelatedFileObject; + BOOLEAN LockOperation; + BOOLEAN DeletePending; + BOOLEAN ReadAccess; + BOOLEAN WriteAccess; + BOOLEAN DeleteAccess; + BOOLEAN SharedRead; + BOOLEAN SharedWrite; + BOOLEAN SharedDelete; + ULONG Flags; + UNICODE_STRING FileName; + LARGE_INTEGER CurrentByteOffset; + ULONG Waiters; + ULONG Busy; + PVOID LastLock; + KEVENT Lock; + KEVENT Event; + PIO_COMPLETION_CONTEXT CompletionContext; }; typedef struct _FILE_OBJECT *PFILE_OBJECT; union __anonunion_AssociatedIrp_44 { - struct _IRP *MasterIrp ; - LONG IrpCount ; - PVOID SystemBuffer ; + struct _IRP *MasterIrp; + LONG IrpCount; + PVOID SystemBuffer; }; struct __anonstruct_AsynchronousParameters_46 { - void (*UserApcRoutine)(PVOID ApcContext , PIO_STATUS_BLOCK IoStatusBlock , - ULONG Reserved ) ; - PVOID UserApcContext ; + void (*UserApcRoutine)(PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, + ULONG Reserved); + PVOID UserApcContext; }; union __anonunion_Overlay_45 { - struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters ; - LARGE_INTEGER AllocationSize ; + struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters; + LARGE_INTEGER AllocationSize; }; struct __anonstruct____missing_field_name_50 { - PVOID DriverContext[4] ; + PVOID DriverContext[4]; }; union __anonunion____missing_field_name_49 { - KDEVICE_QUEUE_ENTRY DeviceQueueEntry ; - struct __anonstruct____missing_field_name_50 __annonCompField14 ; + KDEVICE_QUEUE_ENTRY DeviceQueueEntry; + struct __anonstruct____missing_field_name_50 __annonCompField14; }; struct _IO_STACK_LOCATION; union __anonunion____missing_field_name_52 { - struct _IO_STACK_LOCATION *CurrentStackLocation ; - ULONG PacketType ; + struct _IO_STACK_LOCATION *CurrentStackLocation; + ULONG PacketType; }; struct __anonstruct____missing_field_name_51 { - LIST_ENTRY ListEntry ; - union __anonunion____missing_field_name_52 __annonCompField16 ; + LIST_ENTRY ListEntry; + union __anonunion____missing_field_name_52 __annonCompField16; }; struct __anonstruct_Overlay_48 { - union __anonunion____missing_field_name_49 __annonCompField15 ; - PETHREAD Thread ; - PCHAR AuxiliaryBuffer ; - struct __anonstruct____missing_field_name_51 __annonCompField17 ; - PFILE_OBJECT OriginalFileObject ; + union __anonunion____missing_field_name_49 __annonCompField15; + PETHREAD Thread; + PCHAR AuxiliaryBuffer; + struct __anonstruct____missing_field_name_51 __annonCompField17; + PFILE_OBJECT OriginalFileObject; }; union __anonunion_Tail_47 { - struct __anonstruct_Overlay_48 Overlay ; - KAPC Apc ; - PVOID CompletionKey ; + struct __anonstruct_Overlay_48 Overlay; + KAPC Apc; + PVOID CompletionKey; }; struct _IRP { - CSHORT Type ; - USHORT Size ; - PMDL MdlAddress ; - ULONG Flags ; - union __anonunion_AssociatedIrp_44 AssociatedIrp ; - LIST_ENTRY ThreadListEntry ; - IO_STATUS_BLOCK IoStatus ; - KPROCESSOR_MODE RequestorMode ; - BOOLEAN PendingReturned ; - CHAR StackCount ; - CHAR CurrentLocation ; - BOOLEAN Cancel ; - KIRQL CancelIrql ; - CCHAR ApcEnvironment ; - UCHAR AllocationFlags ; - PIO_STATUS_BLOCK UserIosb ; - PKEVENT UserEvent ; - union __anonunion_Overlay_45 Overlay ; - void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - PVOID UserBuffer ; - union __anonunion_Tail_47 Tail ; + CSHORT Type; + USHORT Size; + PMDL MdlAddress; + ULONG Flags; + union __anonunion_AssociatedIrp_44 AssociatedIrp; + LIST_ENTRY ThreadListEntry; + IO_STATUS_BLOCK IoStatus; + KPROCESSOR_MODE RequestorMode; + BOOLEAN PendingReturned; + CHAR StackCount; + CHAR CurrentLocation; + BOOLEAN Cancel; + KIRQL CancelIrql; + CCHAR ApcEnvironment; + UCHAR AllocationFlags; + PIO_STATUS_BLOCK UserIosb; + PKEVENT UserEvent; + union __anonunion_Overlay_45 Overlay; + void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + PVOID UserBuffer; + union __anonunion_Tail_47 Tail; }; typedef struct _IRP IRP; typedef struct _IRP *PIRP; enum _DEVICE_RELATION_TYPE { - BusRelations = 0, - EjectionRelations = 1, - PowerRelations = 2, - RemovalRelations = 3, - TargetDeviceRelation = 4 -} ; + BusRelations = 0, + EjectionRelations = 1, + PowerRelations = 2, + RemovalRelations = 3, + TargetDeviceRelation = 4 +}; typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE; enum _DEVICE_USAGE_NOTIFICATION_TYPE { - DeviceUsageTypeUndefined = 0, - DeviceUsageTypePaging = 1, - DeviceUsageTypeHibernation = 2, - DeviceUsageTypeDumpFile = 3 -} ; + DeviceUsageTypeUndefined = 0, + DeviceUsageTypePaging = 1, + DeviceUsageTypeHibernation = 2, + DeviceUsageTypeDumpFile = 3 +}; typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE; struct _INTERFACE { - USHORT Size ; - USHORT Version ; - PVOID Context ; - void (*InterfaceReference)(PVOID Context ) ; - void (*InterfaceDereference)(PVOID Context ) ; + USHORT Size; + USHORT Version; + PVOID Context; + void (*InterfaceReference)(PVOID Context); + void (*InterfaceDereference)(PVOID Context); }; typedef struct _INTERFACE *PINTERFACE; struct _DEVICE_CAPABILITIES { - USHORT Size ; - USHORT Version ; - ULONG DeviceD1 : 1 ; - ULONG DeviceD2 : 1 ; - ULONG LockSupported : 1 ; - ULONG EjectSupported : 1 ; - ULONG Removable : 1 ; - ULONG DockDevice : 1 ; - ULONG UniqueID : 1 ; - ULONG SilentInstall : 1 ; - ULONG RawDeviceOK : 1 ; - ULONG SurpriseRemovalOK : 1 ; - ULONG WakeFromD0 : 1 ; - ULONG WakeFromD1 : 1 ; - ULONG WakeFromD2 : 1 ; - ULONG WakeFromD3 : 1 ; - ULONG HardwareDisabled : 1 ; - ULONG NonDynamic : 1 ; - ULONG WarmEjectSupported : 1 ; - ULONG Reserved : 15 ; - ULONG Address ; - ULONG UINumber ; - DEVICE_POWER_STATE DeviceState[7] ; - SYSTEM_POWER_STATE SystemWake ; - DEVICE_POWER_STATE DeviceWake ; - ULONG D1Latency ; - ULONG D2Latency ; - ULONG D3Latency ; + USHORT Size; + USHORT Version; + ULONG DeviceD1 : 1; + ULONG DeviceD2 : 1; + ULONG LockSupported : 1; + ULONG EjectSupported : 1; + ULONG Removable : 1; + ULONG DockDevice : 1; + ULONG UniqueID : 1; + ULONG SilentInstall : 1; + ULONG RawDeviceOK : 1; + ULONG SurpriseRemovalOK : 1; + ULONG WakeFromD0 : 1; + ULONG WakeFromD1 : 1; + ULONG WakeFromD2 : 1; + ULONG WakeFromD3 : 1; + ULONG HardwareDisabled : 1; + ULONG NonDynamic : 1; + ULONG WarmEjectSupported : 1; + ULONG Reserved : 15; + ULONG Address; + ULONG UINumber; + DEVICE_POWER_STATE DeviceState[7]; + SYSTEM_POWER_STATE SystemWake; + DEVICE_POWER_STATE DeviceWake; + ULONG D1Latency; + ULONG D2Latency; + ULONG D3Latency; }; typedef struct _DEVICE_CAPABILITIES *PDEVICE_CAPABILITIES; struct _POWER_SEQUENCE { - ULONG SequenceD1 ; - ULONG SequenceD2 ; - ULONG SequenceD3 ; + ULONG SequenceD1; + ULONG SequenceD2; + ULONG SequenceD3; }; typedef struct _POWER_SEQUENCE *PPOWER_SEQUENCE; enum __anonenum_BUS_QUERY_ID_TYPE_53 { - BusQueryDeviceID = 0, - BusQueryHardwareIDs = 1, - BusQueryCompatibleIDs = 2, - BusQueryInstanceID = 3, - BusQueryDeviceSerialNumber = 4 -} ; + BusQueryDeviceID = 0, + BusQueryHardwareIDs = 1, + BusQueryCompatibleIDs = 2, + BusQueryInstanceID = 3, + BusQueryDeviceSerialNumber = 4 +}; typedef enum __anonenum_BUS_QUERY_ID_TYPE_53 BUS_QUERY_ID_TYPE; enum __anonenum_DEVICE_TEXT_TYPE_54 { - DeviceTextDescription = 0, - DeviceTextLocationInformation = 1 -} ; + DeviceTextDescription = 0, + DeviceTextLocationInformation = 1 +}; typedef enum __anonenum_DEVICE_TEXT_TYPE_54 DEVICE_TEXT_TYPE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Create_56 { - PIO_SECURITY_CONTEXT SecurityContext ; - ULONG Options ; - USHORT FileAttributes ; - USHORT ShareAccess ; - ULONG EaLength ; + PIO_SECURITY_CONTEXT SecurityContext; + ULONG Options; + USHORT FileAttributes; + USHORT ShareAccess; + ULONG EaLength; }; struct __anonstruct_Read_57 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_Write_58 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_QueryFile_59 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; }; struct __anonstruct____missing_field_name_62 { - BOOLEAN ReplaceIfExists ; - BOOLEAN AdvanceOnly ; + BOOLEAN ReplaceIfExists; + BOOLEAN AdvanceOnly; }; union __anonunion____missing_field_name_61 { - struct __anonstruct____missing_field_name_62 __annonCompField18 ; - ULONG ClusterCount ; - HANDLE DeleteHandle ; + struct __anonstruct____missing_field_name_62 __annonCompField18; + ULONG ClusterCount; + HANDLE DeleteHandle; }; struct __anonstruct_SetFile_60 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; - PFILE_OBJECT FileObject ; - union __anonunion____missing_field_name_61 __annonCompField19 ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; + PFILE_OBJECT FileObject; + union __anonunion____missing_field_name_61 __annonCompField19; }; struct __anonstruct_QueryVolume_63 { - ULONG Length ; - FS_INFORMATION_CLASS FsInformationClass ; + ULONG Length; + FS_INFORMATION_CLASS FsInformationClass; }; struct __anonstruct_DeviceIoControl_64 { - ULONG OutputBufferLength ; - ULONG InputBufferLength ; - ULONG IoControlCode ; - PVOID Type3InputBuffer ; + ULONG OutputBufferLength; + ULONG InputBufferLength; + ULONG IoControlCode; + PVOID Type3InputBuffer; }; struct __anonstruct_QuerySecurity_65 { - SECURITY_INFORMATION SecurityInformation ; - ULONG Length ; + SECURITY_INFORMATION SecurityInformation; + ULONG Length; }; struct __anonstruct_SetSecurity_66 { - SECURITY_INFORMATION SecurityInformation ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; + SECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; }; struct __anonstruct_MountVolume_67 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_VerifyVolume_68 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_Scsi_69 { - struct _SCSI_REQUEST_BLOCK *Srb ; + struct _SCSI_REQUEST_BLOCK *Srb; }; struct __anonstruct_QueryDeviceRelations_70 { - DEVICE_RELATION_TYPE Type ; + DEVICE_RELATION_TYPE Type; }; struct __anonstruct_QueryInterface_71 { - GUID const *InterfaceType ; - USHORT Size ; - USHORT Version ; - PINTERFACE Interface ; - PVOID InterfaceSpecificData ; + GUID const *InterfaceType; + USHORT Size; + USHORT Version; + PINTERFACE Interface; + PVOID InterfaceSpecificData; }; struct __anonstruct_DeviceCapabilities_72 { - PDEVICE_CAPABILITIES Capabilities ; + PDEVICE_CAPABILITIES Capabilities; }; struct __anonstruct_FilterResourceRequirements_73 { - PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList ; + PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; }; struct __anonstruct_ReadWriteConfig_74 { - ULONG WhichSpace ; - PVOID Buffer ; - ULONG Offset ; - ULONG Length ; + ULONG WhichSpace; + PVOID Buffer; + ULONG Offset; + ULONG Length; }; struct __anonstruct_SetLock_75 { - BOOLEAN Lock ; + BOOLEAN Lock; }; struct __anonstruct_QueryId_76 { - BUS_QUERY_ID_TYPE IdType ; + BUS_QUERY_ID_TYPE IdType; }; struct __anonstruct_QueryDeviceText_77 { - DEVICE_TEXT_TYPE DeviceTextType ; - LCID LocaleId ; + DEVICE_TEXT_TYPE DeviceTextType; + LCID LocaleId; }; struct __anonstruct_UsageNotification_78 { - BOOLEAN InPath ; - BOOLEAN Reserved[3] ; - DEVICE_USAGE_NOTIFICATION_TYPE Type ; + BOOLEAN InPath; + BOOLEAN Reserved[3]; + DEVICE_USAGE_NOTIFICATION_TYPE Type; }; struct __anonstruct_WaitWake_79 { - SYSTEM_POWER_STATE PowerState ; + SYSTEM_POWER_STATE PowerState; }; struct __anonstruct_PowerSequence_80 { - PPOWER_SEQUENCE PowerSequence ; + PPOWER_SEQUENCE PowerSequence; }; struct __anonstruct_Power_81 { - ULONG SystemContext ; - POWER_STATE_TYPE Type ; - POWER_STATE State ; - POWER_ACTION ShutdownType ; + ULONG SystemContext; + POWER_STATE_TYPE Type; + POWER_STATE State; + POWER_ACTION ShutdownType; }; struct __anonstruct_StartDevice_82 { - PCM_RESOURCE_LIST AllocatedResources ; - PCM_RESOURCE_LIST AllocatedResourcesTranslated ; + PCM_RESOURCE_LIST AllocatedResources; + PCM_RESOURCE_LIST AllocatedResourcesTranslated; }; struct __anonstruct_WMI_83 { - ULONG_PTR ProviderId ; - PVOID DataPath ; - ULONG BufferSize ; - PVOID Buffer ; + ULONG_PTR ProviderId; + PVOID DataPath; + ULONG BufferSize; + PVOID Buffer; }; struct __anonstruct_Others_84 { - PVOID Argument1 ; - PVOID Argument2 ; - PVOID Argument3 ; - PVOID Argument4 ; + PVOID Argument1; + PVOID Argument2; + PVOID Argument3; + PVOID Argument4; }; union __anonunion_Parameters_55 { - struct __anonstruct_Create_56 Create ; - struct __anonstruct_Read_57 Read ; - struct __anonstruct_Write_58 Write ; - struct __anonstruct_QueryFile_59 QueryFile ; - struct __anonstruct_SetFile_60 SetFile ; - struct __anonstruct_QueryVolume_63 QueryVolume ; - struct __anonstruct_DeviceIoControl_64 DeviceIoControl ; - struct __anonstruct_QuerySecurity_65 QuerySecurity ; - struct __anonstruct_SetSecurity_66 SetSecurity ; - struct __anonstruct_MountVolume_67 MountVolume ; - struct __anonstruct_VerifyVolume_68 VerifyVolume ; - struct __anonstruct_Scsi_69 Scsi ; - struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations ; - struct __anonstruct_QueryInterface_71 QueryInterface ; - struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities ; - struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements ; - struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig ; - struct __anonstruct_SetLock_75 SetLock ; - struct __anonstruct_QueryId_76 QueryId ; - struct __anonstruct_QueryDeviceText_77 QueryDeviceText ; - struct __anonstruct_UsageNotification_78 UsageNotification ; - struct __anonstruct_WaitWake_79 WaitWake ; - struct __anonstruct_PowerSequence_80 PowerSequence ; - struct __anonstruct_Power_81 Power ; - struct __anonstruct_StartDevice_82 StartDevice ; - struct __anonstruct_WMI_83 WMI ; - struct __anonstruct_Others_84 Others ; + struct __anonstruct_Create_56 Create; + struct __anonstruct_Read_57 Read; + struct __anonstruct_Write_58 Write; + struct __anonstruct_QueryFile_59 QueryFile; + struct __anonstruct_SetFile_60 SetFile; + struct __anonstruct_QueryVolume_63 QueryVolume; + struct __anonstruct_DeviceIoControl_64 DeviceIoControl; + struct __anonstruct_QuerySecurity_65 QuerySecurity; + struct __anonstruct_SetSecurity_66 SetSecurity; + struct __anonstruct_MountVolume_67 MountVolume; + struct __anonstruct_VerifyVolume_68 VerifyVolume; + struct __anonstruct_Scsi_69 Scsi; + struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations; + struct __anonstruct_QueryInterface_71 QueryInterface; + struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities; + struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements; + struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig; + struct __anonstruct_SetLock_75 SetLock; + struct __anonstruct_QueryId_76 QueryId; + struct __anonstruct_QueryDeviceText_77 QueryDeviceText; + struct __anonstruct_UsageNotification_78 UsageNotification; + struct __anonstruct_WaitWake_79 WaitWake; + struct __anonstruct_PowerSequence_80 PowerSequence; + struct __anonstruct_Power_81 Power; + struct __anonstruct_StartDevice_82 StartDevice; + struct __anonstruct_WMI_83 WMI; + struct __anonstruct_Others_84 Others; }; struct _IO_STACK_LOCATION { - UCHAR MajorFunction ; - UCHAR MinorFunction ; - UCHAR Flags ; - UCHAR Control ; - union __anonunion_Parameters_55 Parameters ; - PDEVICE_OBJECT DeviceObject ; - PFILE_OBJECT FileObject ; - NTSTATUS (*CompletionRoutine)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - PVOID Context ; + UCHAR MajorFunction; + UCHAR MinorFunction; + UCHAR Flags; + UCHAR Control; + union __anonunion_Parameters_55 Parameters; + PDEVICE_OBJECT DeviceObject; + PFILE_OBJECT FileObject; + NTSTATUS(*CompletionRoutine) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + PVOID Context; }; typedef struct _IO_STACK_LOCATION IO_STACK_LOCATION; typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION; #pragma pack(pop) struct _CONFIGURATION_INFORMATION { - ULONG DiskCount ; - ULONG FloppyCount ; - ULONG CdRomCount ; - ULONG TapeCount ; - ULONG ScsiPortCount ; - ULONG SerialCount ; - ULONG ParallelCount ; - BOOLEAN AtDiskPrimaryAddressClaimed ; - BOOLEAN AtDiskSecondaryAddressClaimed ; - ULONG Version ; - ULONG MediumChangerCount ; + ULONG DiskCount; + ULONG FloppyCount; + ULONG CdRomCount; + ULONG TapeCount; + ULONG ScsiPortCount; + ULONG SerialCount; + ULONG ParallelCount; + BOOLEAN AtDiskPrimaryAddressClaimed; + BOOLEAN AtDiskSecondaryAddressClaimed; + ULONG Version; + ULONG MediumChangerCount; }; typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION; typedef struct _CONFIGURATION_INFORMATION *PCONFIGURATION_INFORMATION; struct _OBJECT_HANDLE_INFORMATION { - ULONG HandleAttributes ; - ACCESS_MASK GrantedAccess ; + ULONG HandleAttributes; + ACCESS_MASK GrantedAccess; }; typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION; struct _STORAGE_DEVICE_NUMBER { - ULONG DeviceType ; - ULONG DeviceNumber ; - ULONG PartitionNumber ; + ULONG DeviceType; + ULONG DeviceNumber; + ULONG PartitionNumber; }; typedef struct _STORAGE_DEVICE_NUMBER STORAGE_DEVICE_NUMBER; struct _DISK_PERFORMANCE { - LARGE_INTEGER BytesRead ; - LARGE_INTEGER BytesWritten ; - LARGE_INTEGER ReadTime ; - LARGE_INTEGER WriteTime ; - LARGE_INTEGER IdleTime ; - ULONG ReadCount ; - ULONG WriteCount ; - ULONG QueueDepth ; - ULONG SplitCount ; - LARGE_INTEGER QueryTime ; - ULONG StorageDeviceNumber ; - WCHAR StorageManagerName[8] ; + LARGE_INTEGER BytesRead; + LARGE_INTEGER BytesWritten; + LARGE_INTEGER ReadTime; + LARGE_INTEGER WriteTime; + LARGE_INTEGER IdleTime; + ULONG ReadCount; + ULONG WriteCount; + ULONG QueueDepth; + ULONG SplitCount; + LARGE_INTEGER QueryTime; + ULONG StorageDeviceNumber; + WCHAR StorageManagerName[8]; }; typedef struct _DISK_PERFORMANCE DISK_PERFORMANCE; typedef struct _DISK_PERFORMANCE *PDISK_PERFORMANCE; -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _VOLUME_NUMBER { - ULONG VolumeNumber ; - WCHAR VolumeManagerName[8] ; + ULONG VolumeNumber; + WCHAR VolumeManagerName[8]; }; typedef struct _VOLUME_NUMBER VOLUME_NUMBER; struct _MOUNTDEV_NAME { - USHORT NameLength ; - WCHAR Name[1] ; + USHORT NameLength; + WCHAR Name[1]; }; typedef struct _MOUNTDEV_NAME MOUNTDEV_NAME; typedef struct _MOUNTDEV_NAME *PMOUNTDEV_NAME; struct _WMI_DISK_PERFORMANCE { - LONGLONG BytesRead ; - LONGLONG BytesWritten ; - LONGLONG ReadTime ; - LONGLONG WriteTime ; - LONGLONG IdleTime ; - ULONG ReadCount ; - ULONG WriteCount ; - ULONG QueueDepth ; - ULONG SplitCount ; - LONGLONG QueryTime ; - ULONG StorageDeviceNumber ; - USHORT StorageManagerName[8] ; + LONGLONG BytesRead; + LONGLONG BytesWritten; + LONGLONG ReadTime; + LONGLONG WriteTime; + LONGLONG IdleTime; + ULONG ReadCount; + ULONG WriteCount; + ULONG QueueDepth; + ULONG SplitCount; + LONGLONG QueryTime; + ULONG StorageDeviceNumber; + USHORT StorageManagerName[8]; }; typedef struct _WMI_DISK_PERFORMANCE WMI_DISK_PERFORMANCE; typedef struct _WMI_DISK_PERFORMANCE *PWMI_DISK_PERFORMANCE; struct __anonstruct_WMIGUIDREGINFO_130 { - LPCGUID Guid ; - ULONG InstanceCount ; - ULONG Flags ; + LPCGUID Guid; + ULONG InstanceCount; + ULONG Flags; }; typedef struct __anonstruct_WMIGUIDREGINFO_130 WMIGUIDREGINFO; typedef struct __anonstruct_WMIGUIDREGINFO_130 *PWMIGUIDREGINFO; enum __anonenum_WMIENABLEDISABLECONTROL_131 { - WmiEventControl = 0, - WmiDataBlockControl = 1 -} ; + WmiEventControl = 0, + WmiDataBlockControl = 1 +}; typedef enum __anonenum_WMIENABLEDISABLECONTROL_131 WMIENABLEDISABLECONTROL; struct _WMILIB_CONTEXT { - ULONG GuidCount ; - PWMIGUIDREGINFO GuidList ; - NTSTATUS (*QueryWmiRegInfo)(PDEVICE_OBJECT DeviceObject , PULONG RegFlags , PUNICODE_STRING InstanceName , - PUNICODE_STRING *RegistryPath , PUNICODE_STRING MofResourceName , - PDEVICE_OBJECT *Pdo ) ; - NTSTATUS (*QueryWmiDataBlock)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray , - ULONG BufferAvail , PUCHAR Buffer ) ; - NTSTATUS (*SetWmiDataBlock)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG BufferSize , PUCHAR Buffer ) ; - NTSTATUS (*SetWmiDataItem)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG DataItemId , ULONG BufferSize , - PUCHAR Buffer ) ; - NTSTATUS (*ExecuteWmiMethod)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG MethodId , ULONG InBufferSize , - ULONG OutBufferSize , PUCHAR Buffer ) ; - NTSTATUS (*WmiFunctionControl)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - WMIENABLEDISABLECONTROL Function , BOOLEAN Enable ) ; + ULONG GuidCount; + PWMIGUIDREGINFO GuidList; + NTSTATUS(*QueryWmiRegInfo) + (PDEVICE_OBJECT DeviceObject, PULONG RegFlags, PUNICODE_STRING InstanceName, + PUNICODE_STRING *RegistryPath, PUNICODE_STRING MofResourceName, + PDEVICE_OBJECT *Pdo); + NTSTATUS(*QueryWmiDataBlock) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG InstanceCount, PULONG InstanceLengthArray, ULONG BufferAvail, + PUCHAR Buffer); + NTSTATUS(*SetWmiDataBlock) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG BufferSize, PUCHAR Buffer); + NTSTATUS(*SetWmiDataItem) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG DataItemId, ULONG BufferSize, PUCHAR Buffer); + NTSTATUS(*ExecuteWmiMethod) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG MethodId, ULONG InBufferSize, ULONG OutBufferSize, PUCHAR Buffer); + NTSTATUS(*WmiFunctionControl) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, + WMIENABLEDISABLECONTROL Function, BOOLEAN Enable); }; typedef struct _WMILIB_CONTEXT WMILIB_CONTEXT; typedef struct _WMILIB_CONTEXT *PWMILIB_CONTEXT; enum __anonenum_SYSCTL_IRP_DISPOSITION_132 { - IrpProcessed = 0, - IrpNotCompleted = 1, - IrpNotWmi = 2, - IrpForward = 3 -} ; + IrpProcessed = 0, + IrpNotCompleted = 1, + IrpNotWmi = 2, + IrpForward = 3 +}; typedef enum __anonenum_SYSCTL_IRP_DISPOSITION_132 SYSCTL_IRP_DISPOSITION; typedef enum __anonenum_SYSCTL_IRP_DISPOSITION_132 *PSYSCTL_IRP_DISPOSITION; struct _DEVICE_EXTENSION { - PDEVICE_OBJECT DeviceObject ; - PDEVICE_OBJECT TargetDeviceObject ; - PDEVICE_OBJECT PhysicalDeviceObject ; - ULONG DiskNumber ; - WCHAR StorageManagerName[8] ; - ULONG Processors ; - PDISK_PERFORMANCE DiskCounters ; - LARGE_INTEGER LastIdleClock ; - LONG QueueDepth ; - LONG CountersEnabled ; - KEVENT PagingPathCountEvent ; - ULONG PagingPathCount ; - UNICODE_STRING PhysicalDeviceName ; - WCHAR PhysicalDeviceNameBuffer[64] ; - WMILIB_CONTEXT WmilibContext ; + PDEVICE_OBJECT DeviceObject; + PDEVICE_OBJECT TargetDeviceObject; + PDEVICE_OBJECT PhysicalDeviceObject; + ULONG DiskNumber; + WCHAR StorageManagerName[8]; + ULONG Processors; + PDISK_PERFORMANCE DiskCounters; + LARGE_INTEGER LastIdleClock; + LONG QueueDepth; + LONG CountersEnabled; + KEVENT PagingPathCountEvent; + ULONG PagingPathCount; + UNICODE_STRING PhysicalDeviceName; + WCHAR PhysicalDeviceNameBuffer[64]; + WMILIB_CONTEXT WmilibContext; }; typedef struct _DEVICE_EXTENSION DEVICE_EXTENSION; typedef struct _DEVICE_EXTENSION *PDEVICE_EXTENSION; -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1478,1719 +1510,1715 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -extern void *memcpy(void * , void const * , size_t ) ; -extern void *memset(void * , int , size_t ) ; -PCCHAR KeNumberProcessors ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; +extern void *memcpy(void *, void const *, size_t); +extern void *memset(void *, int, size_t); +PCCHAR KeNumberProcessors; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -extern LONG InterlockedIncrement(PLONG Addend ) ; -extern LONG InterlockedDecrement(PLONG Addend ) ; -extern LONG InterlockedExchange(PLONG Target , - LONG Value ) ; -#pragma warning(disable:4035) - ULONG KeGetCurrentProcessorNumber(void) -{ +extern LONG InterlockedIncrement(PLONG Addend); +extern LONG InterlockedDecrement(PLONG Addend); +extern LONG InterlockedExchange(PLONG Target, LONG Value); +#pragma warning(disable : 4035) +ULONG KeGetCurrentProcessorNumber(void) { - { - return (0UL); -} + { return (0UL); } } #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; -extern void KeQuerySystemTime(PLARGE_INTEGER CurrentTime ) ; - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; - void ExFreePool(PVOID P ) ; - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; - void MmUnlockPages(PMDL MemoryDescriptorList ) ; - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; - void MmFreeContiguousMemory(PVOID BaseAddress ) ; - void MmResetDriverPaging(PVOID AddressWithinSection ) ; - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) -extern PVOID IoAllocateErrorLogEntry(PVOID IoObject , - UCHAR EntrySize ) ; - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; - void IoFreeIrp(PIRP Irp ) ; - void IoFreeMdl(PMDL Mdl ) ; - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; - void IoReleaseCancelSpinLock(KIRQL Irql ) ; - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; -extern void IoWriteErrorLogEntry(PVOID ElEntry ) ; -extern NTSTATUS IoWMIRegistrationControl(PDEVICE_OBJECT DeviceObject , - ULONG Action ) ; - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -extern LARGE_INTEGER KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFrequency ) ; -#pragma warning(disable:4200) -#pragma warning(default:4200) - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void PoStartNextPowerIrp(PIRP Irp ) ; - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; - void ObfDereferenceObject(PVOID Object ) ; - NTSTATUS ZwClose(HANDLE Handle ) ; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +extern void KeQuerySystemTime(PLARGE_INTEGER CurrentTime); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +void ExFreePool(PVOID P); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +void MmUnlockPages(PMDL MemoryDescriptorList); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmResetDriverPaging(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +extern PVOID IoAllocateErrorLogEntry(PVOID IoObject, UCHAR EntrySize); +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoFreeIrp(PIRP Irp); +void IoFreeMdl(PMDL Mdl); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +extern void IoWriteErrorLogEntry(PVOID ElEntry); +extern NTSTATUS IoWMIRegistrationControl(PDEVICE_OBJECT DeviceObject, + ULONG Action); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +extern LARGE_INTEGER +KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFrequency); +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +void ObfDereferenceObject(PVOID Object); +NTSTATUS ZwClose(HANDLE Handle); #pragma once - struct _GUID const DiskClassGuid = {1408590599L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const CdRomClassGuid = {1408590600L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const PartitionClassGuid = {1408590602L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const TapeClassGuid = {1408590603L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const WriteOnceDiskClassGuid = {1408590604L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const VolumeClassGuid = {1408590605L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const MediumChangerClassGuid = {1408590608L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const FloppyClassGuid = {1408590609L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const CdChangerClassGuid = {1408590610L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const StoragePortClassGuid = {718077536L, 49456, 4562, {176, 130, 0, 160, 201, 30, 251, 139}}; -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) +struct _GUID const DiskClassGuid = { + 1408590599L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const CdRomClassGuid = { + 1408590600L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const PartitionClassGuid = { + 1408590602L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const TapeClassGuid = { + 1408590603L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const WriteOnceDiskClassGuid = { + 1408590604L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const VolumeClassGuid = { + 1408590605L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const MediumChangerClassGuid = { + 1408590608L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const FloppyClassGuid = { + 1408590609L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const CdChangerClassGuid = { + 1408590610L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const StoragePortClassGuid = { + 718077536L, 49456, 4562, {176, 130, 0, 160, 201, 30, 251, 139}}; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma once #pragma once -extern int swprintf(wchar_t * , wchar_t const * , ...) ; +extern int swprintf(wchar_t *, wchar_t const *, ...); #pragma once #pragma once - struct _GUID const MOUNTDEV_MOUNTED_DEVICE_GUID = {1408590605, - 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; -#pragma warning(disable:4200) - struct _GUID const MSWmi_MofData_GUID = {93327905, 54630, 4561, {178, 240, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSWmi_ProviderInfo_GUID = {3351197136U, 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSWmi_PnPDeviceId_GUID = {3351197138U, 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSWmi_PnPInstanceNames_GUID = {3351197139U, - 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSSmBios_RawSMBiosTables_GUID = {2405959760U, - 42372, 4561, {191, 56, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSPower_DeviceEnable_GUID = {2189167215U, - 65200, 4560, {189, 38, 0, 170, 0, 183, 179, 42}}; - struct _GUID const MSPower_DeviceWakeEnable_GUID = {2840881794U, - 65200, 4560, {189, 38, 0, 170, 0, 183, 179, 42}}; - struct _GUID const MSNdis_NetworkAddress_GUID = {3049101495U, - 513, 4561, {165, 14, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSNdis_NetworkShortAddress_GUID = {3049101496U, - 513, 4561, {165, 14, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSNdis_NetworkLinkSpeed_GUID = {1627155287, - 3942, 4561, {150, 167, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EnumerateAdapter_GUID = {2552180095U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_NotifyAdapterRemoval_GUID = {2552180096U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_NotifyAdapterArrival_GUID = {2552180097U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_NdisEnumerateVc_GUID = {2552180098U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_NotifyVcRemoval_GUID = {2552180089U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_NotifyVcArrival_GUID = {405773836, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_HardwareStatus_GUID = {1589707604, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MediaSupported_GUID = {1589707605, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MediaInUse_GUID = {1589707606, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MaximumLookahead_GUID = {1589707607, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MaximumFrameSize_GUID = {1589707608, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_LinkSpeed_GUID = {1589707609, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TransmitBufferSpace_GUID = {1589707610, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_ReceiveBufferSpace_GUID = {1589707611, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TransmitBlockSize_GUID = {1589707612, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_ReceiveBlockSize_GUID = {1589707613, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_VendorID_GUID = {1589707614, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_VendorDescription_GUID = {1589707615, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CurrentPacketFilter_GUID = {1589707616, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CurrentLookahead_GUID = {1589707617, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_DriverVersion_GUID = {1589707618, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MaximumTotalSize_GUID = {1589707619, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MacOptions_GUID = {1589707621, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MediaConnectStatus_GUID = {1589707622, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_MaximumSendPackets_GUID = {1589707623, - 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_VendorDriverVersion_GUID = {1148802809, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TransmitsOk_GUID = {1148802810, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_ReceivesOk_GUID = {1148802811, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TransmitsError_GUID = {1148802812, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_ReceiveError_GUID = {1148802813, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_ReceiveNoBuffer_GUID = {1148802814, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoHardwareStatus_GUID = {2031800722, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoMediaSupported_GUID = {2031800723, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoMediaInUse_GUID = {2031800724, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoLinkSpeed_GUID = {2031800725, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoVendorId_GUID = {2031800726, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoVendorDescription_GUID = {2031800727, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoDriverVersion_GUID = {2031800728, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoMacOptions_GUID = {2031800730, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoMediaConnectStatus_GUID = {2031800731, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoVendorDriverVersion_GUID = {2031800732, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoMinimumLinkSpeed_GUID = {2031800733, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoTransmitPdusOk_GUID = {169953285, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoReceivePdusOk_GUID = {169953286, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoTransmitPduErrors_GUID = {169953287, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoReceivePduErrors_GUID = {169953288, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_CoReceivePdusNoBuffer_GUID = {169953289, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmSupportedVcRates_GUID = {2031800734, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmSupportedServiceCategory_GUID = {2031800735, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmSupportedAalTypes_GUID = {2031800736, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmHardwareCurrentAddress_GUID = {2031800737, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxActiveVcs_GUID = {2031800738, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxActiveVciBits_GUID = {2031800739, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxActiveVpiBits_GUID = {2031800740, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxAal0PacketSize_GUID = {2031800741, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxAal1PacketSize_GUID = {2031800742, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxAal34PacketSize_GUID = {2031800743, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmMaxAal5PacketSize_GUID = {2031800721, - 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmReceiveCellsOk_GUID = {169953290, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmTransmitCellsOk_GUID = {169953291, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_AtmReceiveCellsDropped_GUID = {169953292, - 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetPermanentAddress_GUID = {1148802815, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetCurrentAddress_GUID = {1148802816, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetMulticastList_GUID = {1148802817, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetMaximumMulticastListSize_GUID = {1148802818, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetMacOptions_GUID = {1148802819, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetReceiveErrorAlignment_GUID = {1148802820, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetOneTransmitCollision_GUID = {1148802821, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_EthernetMoreTransmitCollisions_GUID = {1148802822, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingPermanentAddress_GUID = {1148802823, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingCurrentAddress_GUID = {1148802824, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingCurrentFunctional_GUID = {1148802825, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingCurrentGroup_GUID = {1148802826, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingLastOpenStatus_GUID = {1148802827, - 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingCurrentRingStatus_GUID = {2299148012U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingCurrentRingState_GUID = {2901491762U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingLineErrors_GUID = {2901491763U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_TokenRingLostFrames_GUID = {2901491764U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLongPermanentAddress_GUID = {2901491765U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLongCurrentAddress_GUID = {2901491766U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLongMulticastList_GUID = {2901491767U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLongMaximumListSize_GUID = {2901491768U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiShortPermanentAddress_GUID = {2901491769U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiShortCurrentAddress_GUID = {2901491770U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiShortMulticastList_GUID = {2901491771U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiShortMaximumListSize_GUID = {2901491772U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiAttachmentType_GUID = {2901491773U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiUpstreamNodeLong_GUID = {2901491774U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiDownstreamNodeLong_GUID = {2901491775U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiFrameErrors_GUID = {2901491776U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiFramesLost_GUID = {2901491777U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiRingManagmentState_GUID = {2901491778U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLctFailures_GUID = {2901491779U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLemRejects_GUID = {2901491780U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_FddiLConnectionState_GUID = {2901491781U, - 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusResetStart_GUID = {2552180086U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusResetEnd_GUID = {2552180087U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusMediaConnect_GUID = {2552180093U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusMediaDisconnect_GUID = {2552180094U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusMediaSpecificIndication_GUID = {2552180100U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusLinkSpeedChange_GUID = {2552180101U, - 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusProtocolBind_GUID = {1410552604, - 45555, 4560, {215, 141, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSNdis_StatusProtocolUnbind_GUID = {1849483756, - 45555, 4560, {215, 141, 0, 192, 79, 195, 53, 140}}; - struct _GUID const MSKeyboard_PortInformation_GUID = {1194457242, - 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSMouse_PortInformation_GUID = {1194457244, - 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSMouse_ClassInformation_GUID = {1194457243, - 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSKeyboard_ClassInformation_GUID = {1194457241, - 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSAcpi_ThermalZoneTemperature_GUID = {2713458880U, - 42952, 4561, {191, 60, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSDiskDriver_Geometry_GUID = {620789585, - 22466, 4561, {165, 40, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSDiskDriver_PerformanceData_GUID = {3185075666U, - 55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSDiskDriver_Performance_GUID = {3185075665U, - 55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSStorageDriver_FailurePredictStatus_GUID = {2028716290, - 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSStorageDriver_FailurePredictData_GUID = {2028716291, - 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSStorageDriver_FailurePredictEvent_GUID = {2028716292, - 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSStorageDriver_FailurePredictFunction_GUID = {2028716293, - 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSIde_PortDeviceInfo_GUID = {1408590607, - 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; - struct _GUID const MSSerial_PortName_GUID = {2699825576U, 45420, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; - struct _GUID const MSSerial_CommInfo_GUID = {3987827298U, 45420, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; - struct _GUID const MSSerial_HardwareConfiguration_GUID = {655072134, - 45421, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; - struct _GUID const MSSerial_PerformanceInformation_GUID = {1447123660, - 45421, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; - struct _GUID const MSSerial_CommProperties_GUID = {2181688362U, - 11627, 4562, {186, 73, 0, 160, 201, 6, 41, 16}}; - struct _GUID const MSParallel_AllocFreeCounts_GUID = {1270573546, - 26707, 4562, {142, 206, 0, 192, 79, 142, 244, 129}}; - struct _GUID const MSParallel_DeviceBytesTransferred_GUID = {2315186902U, - 25931, 4562, {158, 21, 0, 192, 79, 142, 244, 129}}; - struct _GUID const MSRedbook_DriverInformationGuid = {3104133351U, - 44554, 4561, {165, 113, 0, 192, 79, 163, 71, 48}}; - struct _GUID const MSRedbook_PerformanceGuid = {3104133352U, - 44554, 4561, {165, 113, 0, 192, 79, 163, 71, 48}}; - struct _GUID const RegisteredGuids_GUID = {3823105981U, 14613, 4562, {145, 3, 0, 192, 79, 185, 152, 162}}; - struct _GUID const DiskPerfGuid = {3185075665U, 55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}}; - struct _GUID const THERMAL_ZONE_GUID = {2713458880U, 42952, 4561, {191, 60, 0, 160, 201, 6, 41, 16}}; - struct _GUID const GlobalLoggerGuid = {3901786812U, 43652, 4562, {154, 147, 0, 128, 95, 133, 215, 198}}; - struct _GUID const GenericMessageGuid = {2369794079U, 43850, 4562, {154, 147, 0, 128, 95, 133, 215, 198}}; - struct _GUID const ProcessGuid = {1030727888, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; - struct _GUID const ThreadGuid = {1030727889, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; - struct _GUID const HardFaultGuid = {1030727890, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; - struct _GUID const PageFaultGuid = {1030727891, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; - struct _GUID const DiskIoGuid = {1030727892, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; - struct _GUID const FileIoGuid = {2429279289U, 19006, 4561, {132, 244, 0, 0, 248, 4, 100, 227}}; - struct _GUID const TcpIpGuid = {2586315456U, 51424, 4561, {132, 226, 0, 192, 79, 185, 152, 162}}; - struct _GUID const UdpIpGuid = {3208270021U, 43465, 18824, {160, 5, 45, 240, 183, 200, 15, 128}}; - struct _GUID const ImageLoadGuid = {749821213, 24513, 4562, {171, 225, 0, 160, 201, 17, 245, 24}}; - struct _GUID const RegistryGuid = {2924704302U, 51299, 4562, {134, 89, 0, 192, 79, 163, 33, 161}}; - struct _GUID const TraceErrorGuid = {964792796, 11687, 4563, {139, 152, 0, 128, 95, 133, 215, 198}}; +struct _GUID const MOUNTDEV_MOUNTED_DEVICE_GUID = { + 1408590605, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +#pragma warning(disable : 4200) +struct _GUID const MSWmi_MofData_GUID = { + 93327905, 54630, 4561, {178, 240, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSWmi_ProviderInfo_GUID = { + 3351197136U, 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSWmi_PnPDeviceId_GUID = { + 3351197138U, 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSWmi_PnPInstanceNames_GUID = { + 3351197139U, 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSSmBios_RawSMBiosTables_GUID = { + 2405959760U, 42372, 4561, {191, 56, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSPower_DeviceEnable_GUID = { + 2189167215U, 65200, 4560, {189, 38, 0, 170, 0, 183, 179, 42}}; +struct _GUID const MSPower_DeviceWakeEnable_GUID = { + 2840881794U, 65200, 4560, {189, 38, 0, 170, 0, 183, 179, 42}}; +struct _GUID const MSNdis_NetworkAddress_GUID = { + 3049101495U, 513, 4561, {165, 14, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSNdis_NetworkShortAddress_GUID = { + 3049101496U, 513, 4561, {165, 14, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSNdis_NetworkLinkSpeed_GUID = { + 1627155287, 3942, 4561, {150, 167, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EnumerateAdapter_GUID = { + 2552180095U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_NotifyAdapterRemoval_GUID = { + 2552180096U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_NotifyAdapterArrival_GUID = { + 2552180097U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_NdisEnumerateVc_GUID = { + 2552180098U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_NotifyVcRemoval_GUID = { + 2552180089U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_NotifyVcArrival_GUID = { + 405773836, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_HardwareStatus_GUID = { + 1589707604, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MediaSupported_GUID = { + 1589707605, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MediaInUse_GUID = { + 1589707606, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MaximumLookahead_GUID = { + 1589707607, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MaximumFrameSize_GUID = { + 1589707608, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_LinkSpeed_GUID = { + 1589707609, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TransmitBufferSpace_GUID = { + 1589707610, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_ReceiveBufferSpace_GUID = { + 1589707611, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TransmitBlockSize_GUID = { + 1589707612, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_ReceiveBlockSize_GUID = { + 1589707613, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_VendorID_GUID = { + 1589707614, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_VendorDescription_GUID = { + 1589707615, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CurrentPacketFilter_GUID = { + 1589707616, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CurrentLookahead_GUID = { + 1589707617, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_DriverVersion_GUID = { + 1589707618, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MaximumTotalSize_GUID = { + 1589707619, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MacOptions_GUID = { + 1589707621, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MediaConnectStatus_GUID = { + 1589707622, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_MaximumSendPackets_GUID = { + 1589707623, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_VendorDriverVersion_GUID = { + 1148802809, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TransmitsOk_GUID = { + 1148802810, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_ReceivesOk_GUID = { + 1148802811, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TransmitsError_GUID = { + 1148802812, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_ReceiveError_GUID = { + 1148802813, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_ReceiveNoBuffer_GUID = { + 1148802814, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoHardwareStatus_GUID = { + 2031800722, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoMediaSupported_GUID = { + 2031800723, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoMediaInUse_GUID = { + 2031800724, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoLinkSpeed_GUID = { + 2031800725, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoVendorId_GUID = { + 2031800726, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoVendorDescription_GUID = { + 2031800727, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoDriverVersion_GUID = { + 2031800728, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoMacOptions_GUID = { + 2031800730, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoMediaConnectStatus_GUID = { + 2031800731, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoVendorDriverVersion_GUID = { + 2031800732, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoMinimumLinkSpeed_GUID = { + 2031800733, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoTransmitPdusOk_GUID = { + 169953285, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoReceivePdusOk_GUID = { + 169953286, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoTransmitPduErrors_GUID = { + 169953287, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoReceivePduErrors_GUID = { + 169953288, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_CoReceivePdusNoBuffer_GUID = { + 169953289, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmSupportedVcRates_GUID = { + 2031800734, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmSupportedServiceCategory_GUID = { + 2031800735, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmSupportedAalTypes_GUID = { + 2031800736, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmHardwareCurrentAddress_GUID = { + 2031800737, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxActiveVcs_GUID = { + 2031800738, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxActiveVciBits_GUID = { + 2031800739, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxActiveVpiBits_GUID = { + 2031800740, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxAal0PacketSize_GUID = { + 2031800741, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxAal1PacketSize_GUID = { + 2031800742, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxAal34PacketSize_GUID = { + 2031800743, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmMaxAal5PacketSize_GUID = { + 2031800721, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmReceiveCellsOk_GUID = { + 169953290, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmTransmitCellsOk_GUID = { + 169953291, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_AtmReceiveCellsDropped_GUID = { + 169953292, 58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetPermanentAddress_GUID = { + 1148802815, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetCurrentAddress_GUID = { + 1148802816, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetMulticastList_GUID = { + 1148802817, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetMaximumMulticastListSize_GUID = { + 1148802818, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetMacOptions_GUID = { + 1148802819, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetReceiveErrorAlignment_GUID = { + 1148802820, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetOneTransmitCollision_GUID = { + 1148802821, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_EthernetMoreTransmitCollisions_GUID = { + 1148802822, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingPermanentAddress_GUID = { + 1148802823, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingCurrentAddress_GUID = { + 1148802824, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingCurrentFunctional_GUID = { + 1148802825, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingCurrentGroup_GUID = { + 1148802826, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingLastOpenStatus_GUID = { + 1148802827, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingCurrentRingStatus_GUID = { + 2299148012U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingCurrentRingState_GUID = { + 2901491762U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingLineErrors_GUID = { + 2901491763U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_TokenRingLostFrames_GUID = { + 2901491764U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLongPermanentAddress_GUID = { + 2901491765U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLongCurrentAddress_GUID = { + 2901491766U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLongMulticastList_GUID = { + 2901491767U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLongMaximumListSize_GUID = { + 2901491768U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiShortPermanentAddress_GUID = { + 2901491769U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiShortCurrentAddress_GUID = { + 2901491770U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiShortMulticastList_GUID = { + 2901491771U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiShortMaximumListSize_GUID = { + 2901491772U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiAttachmentType_GUID = { + 2901491773U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiUpstreamNodeLong_GUID = { + 2901491774U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiDownstreamNodeLong_GUID = { + 2901491775U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiFrameErrors_GUID = { + 2901491776U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiFramesLost_GUID = { + 2901491777U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiRingManagmentState_GUID = { + 2901491778U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLctFailures_GUID = { + 2901491779U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLemRejects_GUID = { + 2901491780U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_FddiLConnectionState_GUID = { + 2901491781U, 42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusResetStart_GUID = { + 2552180086U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusResetEnd_GUID = { + 2552180087U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusMediaConnect_GUID = { + 2552180093U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusMediaDisconnect_GUID = { + 2552180094U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusMediaSpecificIndication_GUID = { + 2552180100U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusLinkSpeedChange_GUID = { + 2552180101U, 45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusProtocolBind_GUID = { + 1410552604, 45555, 4560, {215, 141, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSNdis_StatusProtocolUnbind_GUID = { + 1849483756, 45555, 4560, {215, 141, 0, 192, 79, 195, 53, 140}}; +struct _GUID const MSKeyboard_PortInformation_GUID = { + 1194457242, 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSMouse_PortInformation_GUID = { + 1194457244, 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSMouse_ClassInformation_GUID = { + 1194457243, 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSKeyboard_ClassInformation_GUID = { + 1194457241, 29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSAcpi_ThermalZoneTemperature_GUID = { + 2713458880U, 42952, 4561, {191, 60, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSDiskDriver_Geometry_GUID = { + 620789585, 22466, 4561, {165, 40, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSDiskDriver_PerformanceData_GUID = { + 3185075666U, 55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSDiskDriver_Performance_GUID = { + 3185075665U, 55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSStorageDriver_FailurePredictStatus_GUID = { + 2028716290, 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSStorageDriver_FailurePredictData_GUID = { + 2028716291, 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSStorageDriver_FailurePredictEvent_GUID = { + 2028716292, 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSStorageDriver_FailurePredictFunction_GUID = { + 2028716293, 19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSIde_PortDeviceInfo_GUID = { + 1408590607, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const MSSerial_PortName_GUID = { + 2699825576U, 45420, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; +struct _GUID const MSSerial_CommInfo_GUID = { + 3987827298U, 45420, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; +struct _GUID const MSSerial_HardwareConfiguration_GUID = { + 655072134, 45421, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; +struct _GUID const MSSerial_PerformanceInformation_GUID = { + 1447123660, 45421, 4561, {189, 152, 0, 160, 201, 6, 190, 45}}; +struct _GUID const MSSerial_CommProperties_GUID = { + 2181688362U, 11627, 4562, {186, 73, 0, 160, 201, 6, 41, 16}}; +struct _GUID const MSParallel_AllocFreeCounts_GUID = { + 1270573546, 26707, 4562, {142, 206, 0, 192, 79, 142, 244, 129}}; +struct _GUID const MSParallel_DeviceBytesTransferred_GUID = { + 2315186902U, 25931, 4562, {158, 21, 0, 192, 79, 142, 244, 129}}; +struct _GUID const MSRedbook_DriverInformationGuid = { + 3104133351U, 44554, 4561, {165, 113, 0, 192, 79, 163, 71, 48}}; +struct _GUID const MSRedbook_PerformanceGuid = { + 3104133352U, 44554, 4561, {165, 113, 0, 192, 79, 163, 71, 48}}; +struct _GUID const RegisteredGuids_GUID = { + 3823105981U, 14613, 4562, {145, 3, 0, 192, 79, 185, 152, 162}}; +struct _GUID const DiskPerfGuid = { + 3185075665U, 55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}}; +struct _GUID const THERMAL_ZONE_GUID = { + 2713458880U, 42952, 4561, {191, 60, 0, 160, 201, 6, 41, 16}}; +struct _GUID const GlobalLoggerGuid = { + 3901786812U, 43652, 4562, {154, 147, 0, 128, 95, 133, 215, 198}}; +struct _GUID const GenericMessageGuid = { + 2369794079U, 43850, 4562, {154, 147, 0, 128, 95, 133, 215, 198}}; +struct _GUID const ProcessGuid = { + 1030727888, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; +struct _GUID const ThreadGuid = { + 1030727889, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; +struct _GUID const HardFaultGuid = { + 1030727890, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; +struct _GUID const PageFaultGuid = { + 1030727891, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; +struct _GUID const DiskIoGuid = { + 1030727892, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}}; +struct _GUID const FileIoGuid = { + 2429279289U, 19006, 4561, {132, 244, 0, 0, 248, 4, 100, 227}}; +struct _GUID const TcpIpGuid = { + 2586315456U, 51424, 4561, {132, 226, 0, 192, 79, 185, 152, 162}}; +struct _GUID const UdpIpGuid = { + 3208270021U, 43465, 18824, {160, 5, 45, 240, 183, 200, 15, 128}}; +struct _GUID const ImageLoadGuid = { + 749821213, 24513, 4562, {171, 225, 0, 160, 201, 17, 245, 24}}; +struct _GUID const RegistryGuid = { + 2924704302U, 51299, 4562, {134, 89, 0, 192, 79, 163, 33, 161}}; +struct _GUID const TraceErrorGuid = { + 964792796, 11687, 4563, {139, 152, 0, 128, 95, 133, 215, 198}}; #pragma once -extern NTSTATUS WmiCompleteRequest(PDEVICE_OBJECT DeviceObject , PIRP Irp , NTSTATUS Status , - ULONG BufferUsed , CCHAR PriorityBoost ) ; -NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo , PDEVICE_OBJECT DeviceObject , - PIRP Irp , PSYSCTL_IRP_DISPOSITION IrpDisposition ) ; -void errorFn(void) -{ +extern NTSTATUS WmiCompleteRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp, + NTSTATUS Status, ULONG BufferUsed, + CCHAR PriorityBoost); +NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo, + PDEVICE_OBJECT DeviceObject, PIRP Irp, + PSYSCTL_IRP_DISPOSITION IrpDisposition); +void errorFn(void) { { - ERROR: assert(0); - goto ERROR; -} + ERROR: + assert(0); + goto ERROR; + } } -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -int myStatus ; -int routine ; -void _BLAST_init(void) -{ +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +int myStatus; +int routine; +void _BLAST_init(void) { { - UNLOADED = 0; - NP = 1; - DC = 2; - SKIP1 = 3; - SKIP2 = 4; - MPR1 = 5; - MPR3 = 6; - IPC = 7; - s = UNLOADED; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - return; -} + UNLOADED = 0; + NP = 1; + DC = 2; + SKIP1 = 3; + SKIP2 = 4; + MPR1 = 5; + MPR3 = 6; + IPC = 7; + s = UNLOADED; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + return; + } } -UNICODE_STRING DiskPerfRegistryPath ; -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) ; -NTSTATUS DiskPerfForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) ; -NTSTATUS DiskPerfDispatchPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfDispatchPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfCreate(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfIoCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -NTSTATUS DiskPerfDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS DiskPerfShutdownFlush(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void DiskPerfUnload(PDRIVER_OBJECT DriverObject ) ; -NTSTATUS DiskPerfWmi(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void DiskPerfLogError(PDEVICE_OBJECT DeviceObject , ULONG UniqueId , NTSTATUS ErrorCode , - NTSTATUS Status ) ; -NTSTATUS DiskPerfRegisterDevice(PDEVICE_OBJECT DeviceObject ) ; -NTSTATUS DiskPerfIrpCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -NTSTATUS DiskperfQueryWmiRegInfo(PDEVICE_OBJECT DeviceObject , ULONG *RegFlags , PUNICODE_STRING InstanceName , - PUNICODE_STRING *RegistryPath , PUNICODE_STRING MofResourceName , - PDEVICE_OBJECT *Pdo ) ; -NTSTATUS DiskperfQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray , - ULONG BufferAvail , PUCHAR Buffer ) ; -void DiskPerfSyncFilterWithTarget(PDEVICE_OBJECT FilterDevice , PDEVICE_OBJECT TargetDevice ) ; -NTSTATUS DiskperfWmiFunctionControl(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - WMIENABLEDISABLECONTROL Function , BOOLEAN Enable ) ; -void DiskPerfAddCounters(PDISK_PERFORMANCE TotalCounters , PDISK_PERFORMANCE NewCounters , - LARGE_INTEGER Frequency ) ; -#pragma alloc_text(INIT,DriverEntry) -#pragma alloc_text(PAGE,DiskPerfAddDevice) -#pragma alloc_text(PAGE,DiskPerfDispatchPnp) -#pragma alloc_text(PAGE,DiskPerfStartDevice) -#pragma alloc_text(PAGE,DiskPerfRemoveDevice) -#pragma alloc_text(PAGE,DiskPerfUnload) -#pragma alloc_text(PAGE,DiskPerfWmi) -#pragma alloc_text(PAGE,DiskperfQueryWmiRegInfo) -#pragma alloc_text(PAGE,DiskPerfRegisterDevice) -#pragma alloc_text(PAGE,DiskPerfSyncFilterWithTarget) -WMIGUIDREGINFO DiskperfGuidList[1] = { {& DiskPerfGuid, 1, 0}}; -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) -{ PDRIVER_DISPATCH *dispatch = __VERIFIER_nondet_pointer() ; - PVOID tmp ; +UNICODE_STRING DiskPerfRegistryPath; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath); +NTSTATUS DiskPerfForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfAddDevice(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject); +NTSTATUS DiskPerfDispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfDispatchPower(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfSendToNextDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfReadWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfIoCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context); +NTSTATUS DiskPerfDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS DiskPerfShutdownFlush(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void DiskPerfUnload(PDRIVER_OBJECT DriverObject); +NTSTATUS DiskPerfWmi(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void DiskPerfLogError(PDEVICE_OBJECT DeviceObject, ULONG UniqueId, + NTSTATUS ErrorCode, NTSTATUS Status); +NTSTATUS DiskPerfRegisterDevice(PDEVICE_OBJECT DeviceObject); +NTSTATUS DiskPerfIrpCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context); +NTSTATUS DiskperfQueryWmiRegInfo(PDEVICE_OBJECT DeviceObject, ULONG *RegFlags, + PUNICODE_STRING InstanceName, + PUNICODE_STRING *RegistryPath, + PUNICODE_STRING MofResourceName, + PDEVICE_OBJECT *Pdo); +NTSTATUS DiskperfQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject, PIRP Irp, + ULONG GuidIndex, ULONG InstanceIndex, + ULONG InstanceCount, + PULONG InstanceLengthArray, + ULONG BufferAvail, PUCHAR Buffer); +void DiskPerfSyncFilterWithTarget(PDEVICE_OBJECT FilterDevice, + PDEVICE_OBJECT TargetDevice); +NTSTATUS DiskperfWmiFunctionControl(PDEVICE_OBJECT DeviceObject, PIRP Irp, + ULONG GuidIndex, + WMIENABLEDISABLECONTROL Function, + BOOLEAN Enable); +void DiskPerfAddCounters(PDISK_PERFORMANCE TotalCounters, + PDISK_PERFORMANCE NewCounters, + LARGE_INTEGER Frequency); +#pragma alloc_text(INIT, DriverEntry) +#pragma alloc_text(PAGE, DiskPerfAddDevice) +#pragma alloc_text(PAGE, DiskPerfDispatchPnp) +#pragma alloc_text(PAGE, DiskPerfStartDevice) +#pragma alloc_text(PAGE, DiskPerfRemoveDevice) +#pragma alloc_text(PAGE, DiskPerfUnload) +#pragma alloc_text(PAGE, DiskPerfWmi) +#pragma alloc_text(PAGE, DiskperfQueryWmiRegInfo) +#pragma alloc_text(PAGE, DiskPerfRegisterDevice) +#pragma alloc_text(PAGE, DiskPerfSyncFilterWithTarget) +WMIGUIDREGINFO DiskperfGuidList[1] = {{&DiskPerfGuid, 1, 0}}; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, + PUNICODE_STRING RegistryPath) { + PDRIVER_DISPATCH *dispatch = __VERIFIER_nondet_pointer(); + PVOID tmp; { - { - DiskPerfRegistryPath.MaximumLength = (unsigned int )RegistryPath->Length + sizeof((unsigned short)0); - tmp = ExAllocatePoolWithTag(1, DiskPerfRegistryPath.MaximumLength, 1718767684UL); - DiskPerfRegistryPath.Buffer = tmp; - } - if ((unsigned int )DiskPerfRegistryPath.Buffer != (unsigned int )((void *)0)) { { -/* RtlCopyUnicodeString(& DiskPerfRegistryPath, RegistryPath); */ /* INLINED */ + DiskPerfRegistryPath.MaximumLength = + (unsigned int)RegistryPath->Length + sizeof((unsigned short)0); + tmp = ExAllocatePoolWithTag(1, DiskPerfRegistryPath.MaximumLength, + 1718767684UL); + DiskPerfRegistryPath.Buffer = tmp; + } + if ((unsigned int)DiskPerfRegistryPath.Buffer != + (unsigned int)((void *)0)) { + { + /* RtlCopyUnicodeString(& DiskPerfRegistryPath, RegistryPath); */ /* INLINED */ + } + } else { + DiskPerfRegistryPath.Length = 0; + DiskPerfRegistryPath.MaximumLength = 0; } - } else { - DiskPerfRegistryPath.Length = 0; - DiskPerfRegistryPath.MaximumLength = 0; + *dispatch = &DiskPerfSendToNextDriver; + DriverObject->MajorFunction[0] = &DiskPerfCreate; + DriverObject->MajorFunction[3] = &DiskPerfReadWrite; + DriverObject->MajorFunction[4] = &DiskPerfReadWrite; + DriverObject->MajorFunction[14] = &DiskPerfDeviceControl; + DriverObject->MajorFunction[23] = &DiskPerfWmi; + DriverObject->MajorFunction[16] = &DiskPerfShutdownFlush; + DriverObject->MajorFunction[9] = &DiskPerfShutdownFlush; + DriverObject->MajorFunction[27] = &DiskPerfDispatchPnp; + DriverObject->MajorFunction[22] = &DiskPerfDispatchPower; + (DriverObject->DriverExtension)->AddDevice = &DiskPerfAddDevice; + DriverObject->DriverUnload = &DiskPerfUnload; + return (0L); } - *dispatch = & DiskPerfSendToNextDriver; - DriverObject->MajorFunction[0] = & DiskPerfCreate; - DriverObject->MajorFunction[3] = & DiskPerfReadWrite; - DriverObject->MajorFunction[4] = & DiskPerfReadWrite; - DriverObject->MajorFunction[14] = & DiskPerfDeviceControl; - DriverObject->MajorFunction[23] = & DiskPerfWmi; - DriverObject->MajorFunction[16] = & DiskPerfShutdownFlush; - DriverObject->MajorFunction[9] = & DiskPerfShutdownFlush; - DriverObject->MajorFunction[27] = & DiskPerfDispatchPnp; - DriverObject->MajorFunction[22] = & DiskPerfDispatchPower; - (DriverObject->DriverExtension)->AddDevice = & DiskPerfAddDevice; - DriverObject->DriverUnload = & DiskPerfUnload; - return (0L); -} -} -void DiskPerfSyncFilterWithTarget(PDEVICE_OBJECT FilterDevice , PDEVICE_OBJECT TargetDevice ) -{ ULONG propFlags ; - - { - propFlags = 0; - FilterDevice->Flags |= propFlags; - propFlags = TargetDevice->Characteristics & 7UL; - FilterDevice->Characteristics |= propFlags; - return; -} } -NTSTATUS DiskPerfAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) -{ NTSTATUS status ; - PDEVICE_OBJECT filterDeviceObject ; - PDEVICE_EXTENSION deviceExtension ; - ULONG registrationFlag ; - PWMILIB_CONTEXT wmilibContext ; - PCHAR buffer ; - ULONG buffersize ; - PVOID tmp ; +void DiskPerfSyncFilterWithTarget(PDEVICE_OBJECT FilterDevice, + PDEVICE_OBJECT TargetDevice) { + ULONG propFlags; { - { - registrationFlag = 0; - status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION ), (void *)0, 7, 0, - 0, & filterDeviceObject); + propFlags = 0; + FilterDevice->Flags |= propFlags; + propFlags = TargetDevice->Characteristics & 7UL; + FilterDevice->Characteristics |= propFlags; + return; } - if (! (status >= 0L)) { - return (status); - } else { +} +NTSTATUS DiskPerfAddDevice(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject) { + NTSTATUS status; + PDEVICE_OBJECT filterDeviceObject; + PDEVICE_EXTENSION deviceExtension; + ULONG registrationFlag; + PWMILIB_CONTEXT wmilibContext; + PCHAR buffer; + ULONG buffersize; + PVOID tmp; - } { - filterDeviceObject->Flags |= 16UL; - deviceExtension = (struct _DEVICE_EXTENSION *)filterDeviceObject->DeviceExtension; - memset(deviceExtension, 0, sizeof(DEVICE_EXTENSION )); - deviceExtension->LastIdleClock = KeQueryPerformanceCounter((void *)0); - deviceExtension->Processors = (unsigned long )*KeNumberProcessors; - buffersize = (ULONG )((long )(& ((DISK_PERFORMANCE *)0)->QueryTime)) * deviceExtension->Processors; - tmp = ExAllocatePoolWithTag(0, buffersize, 1718767684UL); - buffer = (CHAR *)tmp; - } - if ((unsigned int )buffer != (unsigned int )((void *)0)) { { - memset(buffer, 0, buffersize); - deviceExtension->DiskCounters = (struct _DISK_PERFORMANCE *)buffer; + registrationFlag = 0; + status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION), (void *)0, + 7, 0, 0, &filterDeviceObject); + } + if (!(status >= 0L)) { + return (status); + } else { } - } else { { - DiskPerfLogError(filterDeviceObject, 513, 0L, -1073479678L); + filterDeviceObject->Flags |= 16UL; + deviceExtension = + (struct _DEVICE_EXTENSION *)filterDeviceObject->DeviceExtension; + memset(deviceExtension, 0, sizeof(DEVICE_EXTENSION)); + deviceExtension->LastIdleClock = KeQueryPerformanceCounter((void *)0); + deviceExtension->Processors = (unsigned long)*KeNumberProcessors; + buffersize = (ULONG)((long)(&((DISK_PERFORMANCE *)0)->QueryTime)) * + deviceExtension->Processors; + tmp = ExAllocatePoolWithTag(0, buffersize, 1718767684UL); + buffer = (CHAR *)tmp; + } + if ((unsigned int)buffer != (unsigned int)((void *)0)) { + { + memset(buffer, 0, buffersize); + deviceExtension->DiskCounters = (struct _DISK_PERFORMANCE *)buffer; + } + } else { + { DiskPerfLogError(filterDeviceObject, 513, 0L, -1073479678L); } } - } - { - deviceExtension->PhysicalDeviceObject = PhysicalDeviceObject; - deviceExtension->TargetDeviceObject = IoAttachDeviceToDeviceStack(filterDeviceObject, - PhysicalDeviceObject); - } - if ((unsigned int )deviceExtension->TargetDeviceObject == (unsigned int )((void *)0)) { { -/* IoDeleteDevice(filterDeviceObject); */ /* INLINED */ + deviceExtension->PhysicalDeviceObject = PhysicalDeviceObject; + deviceExtension->TargetDeviceObject = + IoAttachDeviceToDeviceStack(filterDeviceObject, PhysicalDeviceObject); } - return (-1073741810L); - } else { - - } - { - deviceExtension->DeviceObject = filterDeviceObject; - deviceExtension->PhysicalDeviceName.Buffer = deviceExtension->PhysicalDeviceNameBuffer; -/* KeInitializeEvent(& deviceExtension->PagingPathCountEvent, 0, 1); */ /* INLINED */ - wmilibContext = & deviceExtension->WmilibContext; - memset(wmilibContext, 0, sizeof(WMILIB_CONTEXT )); - wmilibContext->GuidCount = sizeof(DiskperfGuidList) / sizeof(WMIGUIDREGINFO ); - wmilibContext->GuidList = DiskperfGuidList; - wmilibContext->QueryWmiRegInfo = & DiskperfQueryWmiRegInfo; - wmilibContext->QueryWmiDataBlock = & DiskperfQueryWmiDataBlock; - wmilibContext->WmiFunctionControl = & DiskperfWmiFunctionControl; - filterDeviceObject->Flags |= 8192UL; - filterDeviceObject->Flags &= 4294967167UL; + if ((unsigned int)deviceExtension->TargetDeviceObject == + (unsigned int)((void *)0)) { + { /* IoDeleteDevice(filterDeviceObject); */ /* INLINED */ + } + return (-1073741810L); + } else { + } + { + deviceExtension->DeviceObject = filterDeviceObject; + deviceExtension->PhysicalDeviceName.Buffer = + deviceExtension->PhysicalDeviceNameBuffer; + /* KeInitializeEvent(& deviceExtension->PagingPathCountEvent, 0, 1); */ /* INLINED */ + wmilibContext = &deviceExtension->WmilibContext; + memset(wmilibContext, 0, sizeof(WMILIB_CONTEXT)); + wmilibContext->GuidCount = + sizeof(DiskperfGuidList) / sizeof(WMIGUIDREGINFO); + wmilibContext->GuidList = DiskperfGuidList; + wmilibContext->QueryWmiRegInfo = &DiskperfQueryWmiRegInfo; + wmilibContext->QueryWmiDataBlock = &DiskperfQueryWmiDataBlock; + wmilibContext->WmiFunctionControl = &DiskperfWmiFunctionControl; + filterDeviceObject->Flags |= 8192UL; + filterDeviceObject->Flags &= 4294967167UL; + } + return (0L); } - return (0L); } -} -NTSTATUS DiskPerfDispatchPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - NTSTATUS status ; - NTSTATUS tmp ; +NTSTATUS DiskPerfDispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + NTSTATUS status; + NTSTATUS tmp; { - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - if (irpSp->MinorFunction == 0) { - goto switch_0_0; - } else { - if (irpSp->MinorFunction == 2) { - goto switch_0_2; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + if (irpSp->MinorFunction == 0) { + goto switch_0_0; } else { - { - goto switch_0_default; - if (0) { - switch_0_0: /* CIL Label */ - { - status = DiskPerfStartDevice(DeviceObject, Irp); - } - goto switch_0_break; - switch_0_2: /* CIL Label */ - { - status = DiskPerfRemoveDevice(DeviceObject, Irp); - } - goto switch_0_break; - switch_0_default: /* CIL Label */ + if (irpSp->MinorFunction == 2) { + goto switch_0_2; + } else { { - tmp = DiskPerfSendToNextDriver(DeviceObject, Irp); + goto switch_0_default; + if (0) { + switch_0_0 : /* CIL Label */ + { + status = DiskPerfStartDevice(DeviceObject, Irp); + } + goto switch_0_break; + switch_0_2 : /* CIL Label */ + { + status = DiskPerfRemoveDevice(DeviceObject, Irp); + } + goto switch_0_break; + switch_0_default : /* CIL Label */ + { + tmp = DiskPerfSendToNextDriver(DeviceObject, Irp); + } + return (tmp); + } else { + switch_0_break: /* CIL Label */; + } } - return (tmp); - } else { - switch_0_break: /* CIL Label */ ; - } } } + return (status); } - return (status); } -} -NTSTATUS DiskPerfIrpCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) -{ PKEVENT Event ; +NTSTATUS DiskPerfIrpCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context) { + PKEVENT Event; { - { - Event = (struct _KEVENT *)Context; - KeSetEvent(Event, 0, 0); + { + Event = (struct _KEVENT *)Context; + KeSetEvent(Event, 0, 0); + } + return (-1073741802L); } - return (-1073741802L); } -} -NTSTATUS DiskPerfStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - NTSTATUS status ; +NTSTATUS DiskPerfStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + NTSTATUS status; { - { - deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp); - DiskPerfSyncFilterWithTarget(DeviceObject, deviceExtension->TargetDeviceObject); - DiskPerfRegisterDevice(DeviceObject); - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + { + deviceExtension = + (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp); + DiskPerfSyncFilterWithTarget(DeviceObject, + deviceExtension->TargetDeviceObject); + DiskPerfRegisterDevice(DeviceObject); + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); } - return (status); -} } -NTSTATUS DiskPerfRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ NTSTATUS status ; - PDEVICE_EXTENSION deviceExtension ; - PWMILIB_CONTEXT wmilibContext ; +NTSTATUS DiskPerfRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + NTSTATUS status; + PDEVICE_EXTENSION deviceExtension; + PWMILIB_CONTEXT wmilibContext; { - { - deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - IoWMIRegistrationControl(DeviceObject, 2); - wmilibContext = & deviceExtension->WmilibContext; - InterlockedExchange((LONG *)(& wmilibContext->GuidCount), 0L); - memset(wmilibContext, 0, sizeof(WMILIB_CONTEXT )); - status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp); -/* IoDetachDevice(deviceExtension->TargetDeviceObject); */ /* INLINED */ -/* IoDeleteDevice(DeviceObject); */ /* INLINED */ - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + { + deviceExtension = + (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + IoWMIRegistrationControl(DeviceObject, 2); + wmilibContext = &deviceExtension->WmilibContext; + InterlockedExchange((LONG *)(&wmilibContext->GuidCount), 0L); + memset(wmilibContext, 0, sizeof(WMILIB_CONTEXT)); + status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp); + /* IoDetachDevice(deviceExtension->TargetDeviceObject); */ /* INLINED */ + /* IoDeleteDevice(DeviceObject); */ /* INLINED */ + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); } - return (status); } -} -NTSTATUS DiskPerfSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - NTSTATUS tmp ; +NTSTATUS DiskPerfSendToNextDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + NTSTATUS tmp; { - if (s == NP) { - s = SKIP1; - } else { + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } { - errorFn(); + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + deviceExtension = + (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); } + return (tmp); } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); - } - return (tmp); -} } -NTSTATUS DiskPerfDispatchPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - NTSTATUS tmp ; +NTSTATUS DiskPerfDispatchPower(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + NTSTATUS tmp; { - { -/* PoStartNextPowerIrp(Irp); */ /* INLINED */ - } - if (s == NP) { - s = SKIP1; - } else { + { /* PoStartNextPowerIrp(Irp); */ /* INLINED */ + } + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } { - errorFn(); + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + deviceExtension = + (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + tmp = PoCallDriver(deviceExtension->TargetDeviceObject, Irp); } + return (tmp); } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - tmp = PoCallDriver(deviceExtension->TargetDeviceObject, Irp); - } - return (tmp); -} } -NTSTATUS DiskPerfForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - KEVENT event ; - NTSTATUS status ; - PIO_STACK_LOCATION irpSp ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___0 ; +NTSTATUS DiskPerfForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + KEVENT event; + NTSTATUS status; + PIO_STACK_LOCATION irpSp; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___0; { - { -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine)); - nextIrpSp->Control = 0; - } - if (s != NP) { { - errorFn(); + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + deviceExtension = + (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + memcpy(nextIrpSp, irpSp, + (long)(&((IO_STACK_LOCATION *)0)->CompletionRoutine)); + nextIrpSp->Control = 0; } - } else { - if (compRegistered != 0) { - { - errorFn(); - } + if (s != NP) { + { errorFn(); } } else { - compRegistered = 1; - compFptr = & DiskPerfIrpCompletion; - routine = 0; + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + compFptr = &DiskPerfIrpCompletion; + routine = 0; + } } - } - { - irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp___0->CompletionRoutine = & DiskPerfIrpCompletion; - irpSp___0->Context = & event; - irpSp___0->Control = 0; - irpSp___0->Control = 64; - irpSp___0->Control = (int )irpSp___0->Control | 128; - irpSp___0->Control = (int )irpSp___0->Control | 32; - status = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); - } - if (status == 259L) { { - KeWaitForSingleObject(& event, 0, 0, 0, (void *)0); - status = myStatus; + irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpSp___0->CompletionRoutine = &DiskPerfIrpCompletion; + irpSp___0->Context = &event; + irpSp___0->Control = 0; + irpSp___0->Control = 64; + irpSp___0->Control = (int)irpSp___0->Control | 128; + irpSp___0->Control = (int)irpSp___0->Control | 32; + status = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); } - } else { - + if (status == 259L) { + { + KeWaitForSingleObject(&event, 0, 0, 0, (void *)0); + status = myStatus; + } + } else { + } + return (status); } - return (status); } -} -NTSTATUS DiskPerfCreate(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ +NTSTATUS DiskPerfCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp) { { - { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - IofCompleteRequest(Irp, 0); + { + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + IofCompleteRequest(Irp, 0); + } + return (0L); } - return (0L); -} } -NTSTATUS DiskPerfReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - PIO_STACK_LOCATION currentIrpStack ; - PIO_STACK_LOCATION nextIrpStack ; - ULONG processor ; - ULONG tmp ; - PDISK_PERFORMANCE partitionCounters ; - LONG queueLen ; - PLARGE_INTEGER timeStamp ; - NTSTATUS tmp___0 ; - PIO_STACK_LOCATION irpSp ; - NTSTATUS tmp___1 ; +NTSTATUS DiskPerfReadWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + PIO_STACK_LOCATION currentIrpStack; + PIO_STACK_LOCATION nextIrpStack; + ULONG processor; + ULONG tmp; + PDISK_PERFORMANCE partitionCounters; + LONG queueLen; + PLARGE_INTEGER timeStamp; + NTSTATUS tmp___0; + PIO_STACK_LOCATION irpSp; + NTSTATUS tmp___1; { - { - deviceExtension = DeviceObject->DeviceExtension; - currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - tmp = 0UL; /* KeGetCurrentProcessorNumber(); */ /* INLINED */ - processor = tmp; - partitionCounters = (void *)0; - } - if ((unsigned int )deviceExtension->DiskCounters != (unsigned int )((void *)0)) { - partitionCounters = (struct _DISK_PERFORMANCE *)((CHAR *)deviceExtension->DiskCounters + processor * (ULONG )((long )(& ((DISK_PERFORMANCE *)0)->QueryTime))); - } else { - - } - if (deviceExtension->CountersEnabled <= 0L) { { - tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp); + deviceExtension = DeviceObject->DeviceExtension; + currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + nextIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + tmp = 0UL; /* KeGetCurrentProcessorNumber(); */ /* INLINED */ + processor = tmp; + partitionCounters = (void *)0; } - return (tmp___0); - } else { - if ((int )deviceExtension->PhysicalDeviceNameBuffer[0] == 0) { - { - tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp); - } + if ((unsigned int)deviceExtension->DiskCounters != + (unsigned int)((void *)0)) { + partitionCounters = + (struct _DISK_PERFORMANCE + *)((CHAR *)deviceExtension->DiskCounters + + processor * + (ULONG)((long)(&((DISK_PERFORMANCE *)0)->QueryTime))); + } else { + } + if (deviceExtension->CountersEnabled <= 0L) { + { tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp); } return (tmp___0); } else { - if ((unsigned int )partitionCounters == (unsigned int )((void *)0)) { - { - tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp); - } + if ((int)deviceExtension->PhysicalDeviceNameBuffer[0] == 0) { + { tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp); } return (tmp___0); } else { - + if ((unsigned int)partitionCounters == (unsigned int)((void *)0)) { + { tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp); } + return (tmp___0); + } else { + } } } - } - { - queueLen = InterlockedIncrement(& deviceExtension->QueueDepth); - *nextIrpStack = *currentIrpStack; - timeStamp = (LARGE_INTEGER *)(& currentIrpStack->Parameters.Read); - *timeStamp = KeQueryPerformanceCounter((void *)0); - } - if (queueLen == 1L) { - partitionCounters->IdleTime.QuadPart += timeStamp->QuadPart - deviceExtension->LastIdleClock.QuadPart; - deviceExtension->LastIdleClock.QuadPart = timeStamp->QuadPart; - } else { - - } - if (s != NP) { { - errorFn(); + queueLen = InterlockedIncrement(&deviceExtension->QueueDepth); + *nextIrpStack = *currentIrpStack; + timeStamp = (LARGE_INTEGER *)(¤tIrpStack->Parameters.Read); + *timeStamp = KeQueryPerformanceCounter((void *)0); } - } else { - if (compRegistered != 0) { - { - errorFn(); - } + if (queueLen == 1L) { + partitionCounters->IdleTime.QuadPart += + timeStamp->QuadPart - deviceExtension->LastIdleClock.QuadPart; + deviceExtension->LastIdleClock.QuadPart = timeStamp->QuadPart; } else { - compRegistered = 1; - compFptr = & DiskPerfIoCompletion; - routine = 1; } + if (s != NP) { + { errorFn(); } + } else { + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + compFptr = &DiskPerfIoCompletion; + routine = 1; + } + } + { + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpSp->CompletionRoutine = &DiskPerfIoCompletion; + irpSp->Context = DeviceObject; + irpSp->Control = 0; + irpSp->Control = 64; + irpSp->Control = (int)irpSp->Control | 128; + irpSp->Control = (int)irpSp->Control | 32; + tmp___1 = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); + } + return (tmp___1); } - { - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp->CompletionRoutine = & DiskPerfIoCompletion; - irpSp->Context = DeviceObject; - irpSp->Control = 0; - irpSp->Control = 64; - irpSp->Control = (int )irpSp->Control | 128; - irpSp->Control = (int )irpSp->Control | 32; - tmp___1 = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); - } - return (tmp___1); } -} -NTSTATUS DiskPerfIoCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) -{ PDEVICE_EXTENSION deviceExtension ; - PIO_STACK_LOCATION irpStack ; - PDISK_PERFORMANCE partitionCounters ; - LARGE_INTEGER timeStampComplete ; - PLARGE_INTEGER difference ; - LONG queueLen ; - ULONG tmp ; - - { - { - deviceExtension = DeviceObject->DeviceExtension; - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - tmp = 0UL; /* KeGetCurrentProcessorNumber(); */ /* INLINED */ - partitionCounters = (struct _DISK_PERFORMANCE *)((CHAR *)deviceExtension->DiskCounters + tmp * (unsigned long )((long )(& ((DISK_PERFORMANCE *)0)->QueryTime))); - } - if ((unsigned int )partitionCounters == (unsigned int )((void *)0)) { - return (0L); - } else { +NTSTATUS DiskPerfIoCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context) { + PDEVICE_EXTENSION deviceExtension; + PIO_STACK_LOCATION irpStack; + PDISK_PERFORMANCE partitionCounters; + LARGE_INTEGER timeStampComplete; + PLARGE_INTEGER difference; + LONG queueLen; + ULONG tmp; - } { - difference = (LARGE_INTEGER *)(& irpStack->Parameters.Read); - timeStampComplete = KeQueryPerformanceCounter((void *)0); - difference->QuadPart = timeStampComplete.QuadPart - difference->QuadPart; - queueLen = InterlockedDecrement(& deviceExtension->QueueDepth); - } - if (queueLen < 0L) { { - queueLen = InterlockedIncrement(& deviceExtension->QueueDepth); + deviceExtension = DeviceObject->DeviceExtension; + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + tmp = 0UL; /* KeGetCurrentProcessorNumber(); */ /* INLINED */ + partitionCounters = + (struct _DISK_PERFORMANCE *)((CHAR *)deviceExtension->DiskCounters + + tmp * (unsigned long)(( + long)(&((DISK_PERFORMANCE *)0) + ->QueryTime))); } - } else { - - } - if (queueLen == 0L) { - deviceExtension->LastIdleClock = timeStampComplete; - } else { - - } - if ((int )irpStack->MajorFunction == 3) { - partitionCounters->BytesRead.QuadPart += (LONGLONG )Irp->IoStatus.Information; - partitionCounters->ReadCount += 1UL; - partitionCounters->ReadTime.QuadPart += difference->QuadPart; - } else { - partitionCounters->BytesWritten.QuadPart += (LONGLONG )Irp->IoStatus.Information; - partitionCounters->WriteCount += 1UL; - partitionCounters->WriteTime.QuadPart += difference->QuadPart; - } - if (Irp->Flags & 8UL) { - partitionCounters->SplitCount += 1UL; - } else { - - } - if (Irp->PendingReturned) { - if (pended == 0) { - pended = 1; + if ((unsigned int)partitionCounters == (unsigned int)((void *)0)) { + return (0L); } else { - { - errorFn(); + } + { + difference = (LARGE_INTEGER *)(&irpStack->Parameters.Read); + timeStampComplete = KeQueryPerformanceCounter((void *)0); + difference->QuadPart = timeStampComplete.QuadPart - difference->QuadPart; + queueLen = InterlockedDecrement(&deviceExtension->QueueDepth); + } + if (queueLen < 0L) { + { queueLen = InterlockedIncrement(&deviceExtension->QueueDepth); } + } else { + } + if (queueLen == 0L) { + deviceExtension->LastIdleClock = timeStampComplete; + } else { + } + if ((int)irpStack->MajorFunction == 3) { + partitionCounters->BytesRead.QuadPart += + (LONGLONG)Irp->IoStatus.Information; + partitionCounters->ReadCount += 1UL; + partitionCounters->ReadTime.QuadPart += difference->QuadPart; + } else { + partitionCounters->BytesWritten.QuadPart += + (LONGLONG)Irp->IoStatus.Information; + partitionCounters->WriteCount += 1UL; + partitionCounters->WriteTime.QuadPart += difference->QuadPart; + } + if (Irp->Flags & 8UL) { + partitionCounters->SplitCount += 1UL; + } else { + } + if (Irp->PendingReturned) { + if (pended == 0) { + pended = 1; + } else { + { errorFn(); } } + (Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation) + ->Control = (int)(Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation) + ->Control | + 1; + } else { } - (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1; - } else { - + return (0L); } - return (0L); } -} -NTSTATUS DiskPerfDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - PIO_STACK_LOCATION currentIrpStack ; - NTSTATUS status ; - ULONG i ; - PDISK_PERFORMANCE totalCounters ; - PDISK_PERFORMANCE diskCounters ; - LARGE_INTEGER frequency ; - LARGE_INTEGER perfctr ; - LARGE_INTEGER difference ; - NTSTATUS tmp ; +NTSTATUS DiskPerfDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + PIO_STACK_LOCATION currentIrpStack; + NTSTATUS status; + ULONG i; + PDISK_PERFORMANCE totalCounters; + PDISK_PERFORMANCE diskCounters; + LARGE_INTEGER frequency; + LARGE_INTEGER perfctr; + LARGE_INTEGER difference; + NTSTATUS tmp; { - deviceExtension = DeviceObject->DeviceExtension; - currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )((7 << 16) | (8 << 2))) { - if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(DISK_PERFORMANCE )) { - status = -1073741789L; - Irp->IoStatus.Information = 0; - } else { - diskCounters = deviceExtension->DiskCounters; - if ((unsigned int )diskCounters == (unsigned int )((void *)0)) { + deviceExtension = DeviceObject->DeviceExtension; + currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == + (ULONG)((7 << 16) | (8 << 2))) { + if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < + (ULONG)sizeof(DISK_PERFORMANCE)) { + status = -1073741789L; + Irp->IoStatus.Information = 0; + } else { + diskCounters = deviceExtension->DiskCounters; + if ((unsigned int)diskCounters == (unsigned int)((void *)0)) { + { + Irp->IoStatus.__annonCompField4.Status = -1073741823L; + myStatus = -1073741823L; + IofCompleteRequest(Irp, 0); + } + return (-1073741823L); + } else { + } { - Irp->IoStatus.__annonCompField4.Status = -1073741823L; - myStatus = -1073741823L; - IofCompleteRequest(Irp, 0); + totalCounters = + (struct _DISK_PERFORMANCE *)Irp->AssociatedIrp.SystemBuffer; + memset(totalCounters, 0, sizeof(DISK_PERFORMANCE)); + perfctr = KeQueryPerformanceCounter(&frequency); + KeQuerySystemTime(&totalCounters->QueryTime); + i = 0; } - return (-1073741823L); - } else { - - } - { - totalCounters = (struct _DISK_PERFORMANCE *)Irp->AssociatedIrp.SystemBuffer; - memset(totalCounters, 0, sizeof(DISK_PERFORMANCE )); - perfctr = KeQueryPerformanceCounter(& frequency); - KeQuerySystemTime(& totalCounters->QueryTime); - i = 0; - } - { - while (1) { - while_1_continue: /* CIL Label */ ; - if (i < deviceExtension->Processors) { + { + while (1) { + while_1_continue: /* CIL Label */; + if (i < deviceExtension->Processors) { + } else { + goto while_1_break; + } + { + DiskPerfAddCounters(totalCounters, diskCounters, frequency); + diskCounters = + (struct _DISK_PERFORMANCE *)((CHAR *)diskCounters + + (long)(&((DISK_PERFORMANCE *)0) + ->QueryTime)); + i += 1UL; + } + } + while_1_break: /* CIL Label */; + } + totalCounters->QueueDepth = deviceExtension->QueueDepth; + if (totalCounters->QueueDepth == 0UL) { + difference.QuadPart = + perfctr.QuadPart - deviceExtension->LastIdleClock.QuadPart; + if (difference.QuadPart > 0LL) { + totalCounters->IdleTime.QuadPart += + (10000000LL * difference.QuadPart) / frequency.QuadPart; + } else { + } } else { - goto while_1_break; } { - DiskPerfAddCounters(totalCounters, diskCounters, frequency); - diskCounters = (struct _DISK_PERFORMANCE *)((CHAR *)diskCounters + (long )(& ((DISK_PERFORMANCE *)0)->QueryTime)); - i += 1UL; + totalCounters->StorageDeviceNumber = deviceExtension->DiskNumber; + memcpy(&totalCounters->StorageManagerName[0], + &deviceExtension->StorageManagerName[0], 8U * sizeof(WCHAR)); + status = 0L; + Irp->IoStatus.Information = sizeof(DISK_PERFORMANCE); } } - while_1_break: /* CIL Label */ ; - } - totalCounters->QueueDepth = deviceExtension->QueueDepth; - if (totalCounters->QueueDepth == 0UL) { - difference.QuadPart = perfctr.QuadPart - deviceExtension->LastIdleClock.QuadPart; - if (difference.QuadPart > 0LL) { - totalCounters->IdleTime.QuadPart += (10000000LL * difference.QuadPart) / frequency.QuadPart; - } else { - - } - } else { - + { + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); } + return (status); + } else { { - totalCounters->StorageDeviceNumber = deviceExtension->DiskNumber; - memcpy(& totalCounters->StorageManagerName[0], & deviceExtension->StorageManagerName[0], - 8U * sizeof(WCHAR )); - status = 0L; - Irp->IoStatus.Information = sizeof(DISK_PERFORMANCE ); + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); } + return (tmp); + } + } +} +NTSTATUS DiskPerfWmi(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + NTSTATUS status; + PWMILIB_CONTEXT wmilibContext; + SYSCTL_IRP_DISPOSITION disposition; + PDEVICE_EXTENSION deviceExtension; + NTSTATUS tmp; + + { + deviceExtension = DeviceObject->DeviceExtension; + wmilibContext = &deviceExtension->WmilibContext; + if (wmilibContext->GuidCount == 0UL) { + { tmp = DiskPerfSendToNextDriver(DeviceObject, Irp); } + return (tmp); + } else { } { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + status = 0L; + /* WmiSystemControl(wmilibContext, DeviceObject, Irp, & disposition); */ /* INLINED */ + } + if (disposition == 0) { + goto switch_2_0; + } else { + if (disposition == 1) { + goto switch_2_1; + } else { + { + goto switch_2_default; + if (0) { + switch_2_0: /* CIL Label */; + goto switch_2_break; + switch_2_1 : /* CIL Label */ + { + IofCompleteRequest(Irp, 0); + } + goto switch_2_break; + switch_2_default : /* CIL Label */ + { + status = DiskPerfSendToNextDriver(DeviceObject, Irp); + } + goto switch_2_break; + } else { + switch_2_break: /* CIL Label */; + } + } + } } return (status); - } else { + } +} +NTSTATUS DiskPerfShutdownFlush(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION deviceExtension; + NTSTATUS tmp; + + { { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); + deviceExtension = DeviceObject->DeviceExtension; + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); } return (tmp); } } +void DiskPerfUnload(PDRIVER_OBJECT DriverObject) { + + { return; } } -NTSTATUS DiskPerfWmi(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - NTSTATUS status ; - PWMILIB_CONTEXT wmilibContext ; - SYSCTL_IRP_DISPOSITION disposition ; - PDEVICE_EXTENSION deviceExtension ; - NTSTATUS tmp ; +NTSTATUS DiskPerfRegisterDevice(PDEVICE_OBJECT DeviceObject) { + NTSTATUS status; + IO_STATUS_BLOCK ioStatus; + KEVENT event; + PDEVICE_EXTENSION deviceExtension; + PIRP irp; + STORAGE_DEVICE_NUMBER number; + ULONG registrationFlag; + ULONG outputSize; + PMOUNTDEV_NAME output; + VOLUME_NUMBER volumeNumber; + PVOID tmp; + PVOID tmp___0; { - deviceExtension = DeviceObject->DeviceExtension; - wmilibContext = & deviceExtension->WmilibContext; - if (wmilibContext->GuidCount == 0UL) { { - tmp = DiskPerfSendToNextDriver(DeviceObject, Irp); + registrationFlag = 0; + deviceExtension = DeviceObject->DeviceExtension; + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + irp = IoBuildDeviceIoControlRequest( + (45 << 16) | (1056 << 2), deviceExtension->TargetDeviceObject, + (void *)0, 0, &number, sizeof(number), 0, &event, &ioStatus); } - return (tmp); - } else { - - } - { - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - status = 0L; /* WmiSystemControl(wmilibContext, DeviceObject, Irp, & disposition); */ /* INLINED */ - } - if (disposition == 0) { - goto switch_2_0; - } else { - if (disposition == 1) { - goto switch_2_1; - } else { - { - goto switch_2_default; - if (0) { - switch_2_0: /* CIL Label */ ; - goto switch_2_break; - switch_2_1: /* CIL Label */ - { - IofCompleteRequest(Irp, 0); - } - goto switch_2_break; - switch_2_default: /* CIL Label */ - { - status = DiskPerfSendToNextDriver(DeviceObject, Irp); - } - goto switch_2_break; - } else { - switch_2_break: /* CIL Label */ ; - } - } - } - } - return (status); -} -} -NTSTATUS DiskPerfShutdownFlush(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION deviceExtension ; - NTSTATUS tmp ; - - { - { - deviceExtension = DeviceObject->DeviceExtension; - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp); - } - return (tmp); -} -} -void DiskPerfUnload(PDRIVER_OBJECT DriverObject ) -{ - - { - return; -} -} -NTSTATUS DiskPerfRegisterDevice(PDEVICE_OBJECT DeviceObject ) -{ NTSTATUS status ; - IO_STATUS_BLOCK ioStatus ; - KEVENT event ; - PDEVICE_EXTENSION deviceExtension ; - PIRP irp ; - STORAGE_DEVICE_NUMBER number ; - ULONG registrationFlag ; - ULONG outputSize ; - PMOUNTDEV_NAME output ; - VOLUME_NUMBER volumeNumber ; - PVOID tmp ; - PVOID tmp___0 ; - - { - { - registrationFlag = 0; - deviceExtension = DeviceObject->DeviceExtension; -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - irp = IoBuildDeviceIoControlRequest((45 << 16) | (1056 << 2), deviceExtension->TargetDeviceObject, - (void *)0, 0, & number, sizeof(number), 0, & event, - & ioStatus); - } - if (! irp) { - { - DiskPerfLogError(DeviceObject, 256, 0L, -1073479678L); - } - return (-1073741670L); - } else { - - } - { - status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); - } - if (status == 259L) { - { - KeWaitForSingleObject(& event, 0, 0, 0, (void *)0); - status = ioStatus.__annonCompField4.Status; - } - } else { - - } - if (status >= 0L) { - { - deviceExtension->DiskNumber = number.DeviceNumber; - swprintf(deviceExtension->PhysicalDeviceNameBuffer, "\\\000D\000e\000v\000i\000c\000e\000\\\000H\000a\000r\000d\000d\000i\000s\000k\000%\000d\000\\\000P\000a\000r\000t\000i\000t\000i\000o\000n\000%\000d\000", - number.DeviceNumber, number.PartitionNumber); -/* RtlInitUnicodeString(& deviceExtension->PhysicalDeviceName, & deviceExtension->PhysicalDeviceNameBuffer[0]); */ /* INLINED */ - memcpy(& deviceExtension->StorageManagerName[0], "P\000h\000y\000s\000D\000i\000s\000k\000", - 8U * sizeof(WCHAR )); - } - } else { - { - outputSize = sizeof(MOUNTDEV_NAME ); - tmp = ExAllocatePoolWithTag(1, outputSize, 1718767684UL); - output = tmp; - } - if (! output) { - { - DiskPerfLogError(DeviceObject, 257, 0L, -1073479678L); - } + if (!irp) { + { DiskPerfLogError(DeviceObject, 256, 0L, -1073479678L); } return (-1073741670L); } else { - - } - { -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - irp = IoBuildDeviceIoControlRequest((77UL << 16) | (unsigned long )(2 << 2), deviceExtension->TargetDeviceObject, - (void *)0, 0, output, outputSize, 0, & event, - & ioStatus); } - if (! irp) { + { status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); } + if (status == 259L) { { -/* ExFreePool(output); */ /* INLINED */ - DiskPerfLogError(DeviceObject, 258, 0L, -1073479678L); + KeWaitForSingleObject(&event, 0, 0, 0, (void *)0); + status = ioStatus.__annonCompField4.Status; } - return (-1073741670L); } else { - - } - { - status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); } - if (status == 259L) { + if (status >= 0L) { { - KeWaitForSingleObject(& event, 0, 0, 0, (void *)0); - status = ioStatus.__annonCompField4.Status; + deviceExtension->DiskNumber = number.DeviceNumber; + swprintf(deviceExtension->PhysicalDeviceNameBuffer, + "\\\000D\000e\000v\000i\000c\000e\000\\\000H\000a\000r\000d" + "\000d\000i\000s\000k\000%" + "\000d\000\\\000P\000a\000r\000t\000i\000t\000i\000o\000n\000%" + "\000d\000", + number.DeviceNumber, number.PartitionNumber); + /* RtlInitUnicodeString(& deviceExtension->PhysicalDeviceName, & deviceExtension->PhysicalDeviceNameBuffer[0]); */ /* INLINED */ + memcpy(&deviceExtension->StorageManagerName[0], + "P\000h\000y\000s\000D\000i\000s\000k\000", 8U * sizeof(WCHAR)); } } else { - - } - if (status == -2147483643L) { { - outputSize = sizeof(MOUNTDEV_NAME ) + (unsigned int )output->NameLength; -/* ExFreePool(output); */ /* INLINED */ - tmp___0 = ExAllocatePoolWithTag(1, outputSize, 1718767684UL); - output = tmp___0; + outputSize = sizeof(MOUNTDEV_NAME); + tmp = ExAllocatePoolWithTag(1, outputSize, 1718767684UL); + output = tmp; } - if (! output) { - { - DiskPerfLogError(DeviceObject, 258, 0L, -1073479678L); - } + if (!output) { + { DiskPerfLogError(DeviceObject, 257, 0L, -1073479678L); } return (-1073741670L); } else { - } { -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - irp = IoBuildDeviceIoControlRequest((77UL << 16) | (unsigned long )(2 << 2), - deviceExtension->TargetDeviceObject, (void *)0, - 0, output, outputSize, 0, & event, & ioStatus); + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + irp = IoBuildDeviceIoControlRequest( + (77UL << 16) | (unsigned long)(2 << 2), + deviceExtension->TargetDeviceObject, (void *)0, 0, output, + outputSize, 0, &event, &ioStatus); } - if (! irp) { + if (!irp) { { -/* ExFreePool(output); */ /* INLINED */ - DiskPerfLogError(DeviceObject, 259, 0L, -1073479678L); + /* ExFreePool(output); */ /* INLINED */ + DiskPerfLogError(DeviceObject, 258, 0L, -1073479678L); } return (-1073741670L); } else { - - } - { - status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); } + { status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); } if (status == 259L) { { - KeWaitForSingleObject(& event, 0, 0, 0, (void *)0); - status = ioStatus.__annonCompField4.Status; + KeWaitForSingleObject(&event, 0, 0, 0, (void *)0); + status = ioStatus.__annonCompField4.Status; } } else { - } - } else { - - } - if (! (status >= 0L)) { - { -/* ExFreePool(output); */ /* INLINED */ - DiskPerfLogError(DeviceObject, 260, 0L, -1073479677L); + if (status == -2147483643L) { + { + outputSize = sizeof(MOUNTDEV_NAME) + (unsigned int)output->NameLength; + /* ExFreePool(output); */ /* INLINED */ + tmp___0 = ExAllocatePoolWithTag(1, outputSize, 1718767684UL); + output = tmp___0; + } + if (!output) { + { DiskPerfLogError(DeviceObject, 258, 0L, -1073479678L); } + return (-1073741670L); + } else { + } + { + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + irp = IoBuildDeviceIoControlRequest( + (77UL << 16) | (unsigned long)(2 << 2), + deviceExtension->TargetDeviceObject, (void *)0, 0, output, + outputSize, 0, &event, &ioStatus); + } + if (!irp) { + { + /* ExFreePool(output); */ /* INLINED */ + DiskPerfLogError(DeviceObject, 259, 0L, -1073479678L); + } + return (-1073741670L); + } else { + } + { status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); } + if (status == 259L) { + { + KeWaitForSingleObject(&event, 0, 0, 0, (void *)0); + status = ioStatus.__annonCompField4.Status; + } + } else { + } + } else { } - return (status); - } else { - - } - { - deviceExtension->DiskNumber = -1; - deviceExtension->PhysicalDeviceName.Length = output->NameLength; - deviceExtension->PhysicalDeviceName.MaximumLength = (unsigned int )output->NameLength + sizeof(WCHAR ); - memcpy(deviceExtension->PhysicalDeviceName.Buffer, output->Name, output->NameLength); - *(deviceExtension->PhysicalDeviceName.Buffer + (unsigned int )deviceExtension->PhysicalDeviceName.Length / sizeof(WCHAR )) = 0; -/* ExFreePool(output); */ /* INLINED */ - outputSize = sizeof(VOLUME_NUMBER ); - memset(& volumeNumber, 0, sizeof(VOLUME_NUMBER )); -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - irp = IoBuildDeviceIoControlRequest((86UL << 16) | (unsigned long )(7 << 2), deviceExtension->TargetDeviceObject, - (void *)0, 0, & volumeNumber, sizeof(VOLUME_NUMBER ), - 0, & event, & ioStatus); - } - if (! irp) { - { - DiskPerfLogError(DeviceObject, 265, 0L, -1073479678L); + if (!(status >= 0L)) { + { + /* ExFreePool(output); */ /* INLINED */ + DiskPerfLogError(DeviceObject, 260, 0L, -1073479677L); + } + return (status); + } else { } - return (-1073741670L); - } else { - - } - { - status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); - } - if (status == 259L) { { - KeWaitForSingleObject(& event, 0, 0, 0, (void *)0); - status = ioStatus.__annonCompField4.Status; + deviceExtension->DiskNumber = -1; + deviceExtension->PhysicalDeviceName.Length = output->NameLength; + deviceExtension->PhysicalDeviceName.MaximumLength = + (unsigned int)output->NameLength + sizeof(WCHAR); + memcpy(deviceExtension->PhysicalDeviceName.Buffer, output->Name, + output->NameLength); + *(deviceExtension->PhysicalDeviceName.Buffer + + (unsigned int)deviceExtension->PhysicalDeviceName.Length / + sizeof(WCHAR)) = 0; + /* ExFreePool(output); */ /* INLINED */ + outputSize = sizeof(VOLUME_NUMBER); + memset(&volumeNumber, 0, sizeof(VOLUME_NUMBER)); + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + irp = IoBuildDeviceIoControlRequest( + (86UL << 16) | (unsigned long)(7 << 2), + deviceExtension->TargetDeviceObject, (void *)0, 0, &volumeNumber, + sizeof(VOLUME_NUMBER), 0, &event, &ioStatus); } - } else { - - } - if (! (status >= 0L)) { - goto _L; - } else { - if ((int )volumeNumber.VolumeManagerName[0] == 0) { - _L: /* CIL Label */ + if (!irp) { + { DiskPerfLogError(DeviceObject, 265, 0L, -1073479678L); } + return (-1073741670L); + } else { + } + { status = IofCallDriver(deviceExtension->TargetDeviceObject, irp); } + if (status == 259L) { { - memcpy(& deviceExtension->StorageManagerName[0], "L\000o\000g\000i\000D\000i\000s\000k\000", - 8U * sizeof(WCHAR )); - } - if (status >= 0L) { - deviceExtension->DiskNumber = volumeNumber.VolumeNumber; - } else { - + KeWaitForSingleObject(&event, 0, 0, 0, (void *)0); + status = ioStatus.__annonCompField4.Status; } } else { + } + if (!(status >= 0L)) { + goto _L; + } else { + if ((int)volumeNumber.VolumeManagerName[0] == 0) { + _L : /* CIL Label */ { - memcpy(& deviceExtension->StorageManagerName[0], & volumeNumber.VolumeManagerName[0], - 8U * sizeof(WCHAR )); - deviceExtension->DiskNumber = volumeNumber.VolumeNumber; + memcpy(&deviceExtension->StorageManagerName[0], + "L\000o\000g\000i\000D\000i\000s\000k\000", + 8U * sizeof(WCHAR)); + } + if (status >= 0L) { + deviceExtension->DiskNumber = volumeNumber.VolumeNumber; + } else { + } + } else { + { + memcpy(&deviceExtension->StorageManagerName[0], + &volumeNumber.VolumeManagerName[0], 8U * sizeof(WCHAR)); + deviceExtension->DiskNumber = volumeNumber.VolumeNumber; + } } } } - } - { - status = IoWMIRegistrationControl(DeviceObject, 1UL | registrationFlag); - } - if (! (status >= 0L)) { - { - DiskPerfLogError(DeviceObject, 261, 0L, -1073479668L); + { status = IoWMIRegistrationControl(DeviceObject, 1UL | registrationFlag); } + if (!(status >= 0L)) { + { DiskPerfLogError(DeviceObject, 261, 0L, -1073479668L); } + } else { } - } else { - + return (status); } - return (status); } -} -void DiskPerfLogError(PDEVICE_OBJECT DeviceObject , ULONG UniqueId , NTSTATUS ErrorCode , - NTSTATUS Status ) -{ PIO_ERROR_LOG_PACKET errorLogEntry ; - PVOID tmp ; +void DiskPerfLogError(PDEVICE_OBJECT DeviceObject, ULONG UniqueId, + NTSTATUS ErrorCode, NTSTATUS Status) { + PIO_ERROR_LOG_PACKET errorLogEntry; + PVOID tmp; { - { - tmp = IoAllocateErrorLogEntry(DeviceObject, (unsigned char )(sizeof(IO_ERROR_LOG_PACKET ) + sizeof(DEVICE_OBJECT ))); - errorLogEntry = (struct _IO_ERROR_LOG_PACKET *)tmp; - } - if ((unsigned int )errorLogEntry != (unsigned int )((void *)0)) { { - errorLogEntry->ErrorCode = ErrorCode; - errorLogEntry->UniqueErrorValue = UniqueId; - errorLogEntry->FinalStatus = Status; - memcpy(& errorLogEntry->DumpData[0], & DeviceObject, sizeof(DEVICE_OBJECT )); - errorLogEntry->DumpDataSize = sizeof(DEVICE_OBJECT ); - IoWriteErrorLogEntry(errorLogEntry); + tmp = IoAllocateErrorLogEntry( + DeviceObject, + (unsigned char)(sizeof(IO_ERROR_LOG_PACKET) + sizeof(DEVICE_OBJECT))); + errorLogEntry = (struct _IO_ERROR_LOG_PACKET *)tmp; } - } else { - + if ((unsigned int)errorLogEntry != (unsigned int)((void *)0)) { + { + errorLogEntry->ErrorCode = ErrorCode; + errorLogEntry->UniqueErrorValue = UniqueId; + errorLogEntry->FinalStatus = Status; + memcpy(&errorLogEntry->DumpData[0], &DeviceObject, + sizeof(DEVICE_OBJECT)); + errorLogEntry->DumpDataSize = sizeof(DEVICE_OBJECT); + IoWriteErrorLogEntry(errorLogEntry); + } + } else { + } + return; } - return; -} } -NTSTATUS DiskperfQueryWmiRegInfo(PDEVICE_OBJECT DeviceObject , ULONG *RegFlags , PUNICODE_STRING InstanceName , - PUNICODE_STRING *RegistryPath , PUNICODE_STRING MofResourceName , - PDEVICE_OBJECT *Pdo ) -{ USHORT size ; - NTSTATUS status ; - PDEVICE_EXTENSION deviceExtension ; - PVOID tmp ; +NTSTATUS DiskperfQueryWmiRegInfo(PDEVICE_OBJECT DeviceObject, ULONG *RegFlags, + PUNICODE_STRING InstanceName, + PUNICODE_STRING *RegistryPath, + PUNICODE_STRING MofResourceName, + PDEVICE_OBJECT *Pdo) { + USHORT size; + NTSTATUS status; + PDEVICE_EXTENSION deviceExtension; + PVOID tmp; { - { - deviceExtension = DeviceObject->DeviceExtension; - size = (unsigned int )deviceExtension->PhysicalDeviceName.Length + sizeof((unsigned short)0); - tmp = ExAllocatePoolWithTag(1, size, 1718767684UL); - InstanceName->Buffer = tmp; - } - if ((unsigned int )InstanceName->Buffer != (unsigned int )((void *)0)) { - *RegistryPath = & DiskPerfRegistryPath; - *RegFlags = 33; - *Pdo = deviceExtension->PhysicalDeviceObject; - status = 0L; - } else { - status = -1073741670L; + { + deviceExtension = DeviceObject->DeviceExtension; + size = (unsigned int)deviceExtension->PhysicalDeviceName.Length + + sizeof((unsigned short)0); + tmp = ExAllocatePoolWithTag(1, size, 1718767684UL); + InstanceName->Buffer = tmp; + } + if ((unsigned int)InstanceName->Buffer != (unsigned int)((void *)0)) { + *RegistryPath = &DiskPerfRegistryPath; + *RegFlags = 33; + *Pdo = deviceExtension->PhysicalDeviceObject; + status = 0L; + } else { + status = -1073741670L; + } + return (status); } - return (status); } -} -NTSTATUS DiskperfQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray , - ULONG BufferAvail , PUCHAR Buffer ) -{ NTSTATUS status ; - PDEVICE_EXTENSION deviceExtension ; - ULONG sizeNeeded ; - PDISK_PERFORMANCE totalCounters ; - PDISK_PERFORMANCE diskCounters ; - PWMI_DISK_PERFORMANCE diskPerformance ; - ULONG deviceNameSize ; - PWCHAR diskNamePtr ; - ULONG i ; - LARGE_INTEGER perfctr ; - LARGE_INTEGER frequency ; - LARGE_INTEGER difference ; - PWCHAR tmp ; +NTSTATUS DiskperfQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject, PIRP Irp, + ULONG GuidIndex, ULONG InstanceIndex, + ULONG InstanceCount, + PULONG InstanceLengthArray, + ULONG BufferAvail, PUCHAR Buffer) { + NTSTATUS status; + PDEVICE_EXTENSION deviceExtension; + ULONG sizeNeeded; + PDISK_PERFORMANCE totalCounters; + PDISK_PERFORMANCE diskCounters; + PWMI_DISK_PERFORMANCE diskPerformance; + ULONG deviceNameSize; + PWCHAR diskNamePtr; + ULONG i; + LARGE_INTEGER perfctr; + LARGE_INTEGER frequency; + LARGE_INTEGER difference; + PWCHAR tmp; { - deviceExtension = DeviceObject->DeviceExtension; - if (GuidIndex == 0UL) { - deviceNameSize = (unsigned int )deviceExtension->PhysicalDeviceName.Length + sizeof(USHORT ); - sizeNeeded = (ULONG )((sizeof(WMI_DISK_PERFORMANCE ) + 1U) & 4294967294U) + deviceNameSize; - diskCounters = deviceExtension->DiskCounters; - if ((unsigned int )diskCounters == (unsigned int )((void *)0)) { - status = -1073741823L; - } else { - if (BufferAvail >= sizeNeeded) { - { - memset(Buffer, 0, sizeof(WMI_DISK_PERFORMANCE )); - diskPerformance = (struct _WMI_DISK_PERFORMANCE *)Buffer; - totalCounters = (struct _DISK_PERFORMANCE *)diskPerformance; - KeQuerySystemTime(& totalCounters->QueryTime); - perfctr = KeQueryPerformanceCounter(& frequency); - i = 0; - } - { - while (1) { - while_3_continue: /* CIL Label */ ; - if (i < deviceExtension->Processors) { - - } else { - goto while_3_break; + deviceExtension = DeviceObject->DeviceExtension; + if (GuidIndex == 0UL) { + deviceNameSize = + (unsigned int)deviceExtension->PhysicalDeviceName.Length + + sizeof(USHORT); + sizeNeeded = (ULONG)((sizeof(WMI_DISK_PERFORMANCE) + 1U) & 4294967294U) + + deviceNameSize; + diskCounters = deviceExtension->DiskCounters; + if ((unsigned int)diskCounters == (unsigned int)((void *)0)) { + status = -1073741823L; + } else { + if (BufferAvail >= sizeNeeded) { + { + memset(Buffer, 0, sizeof(WMI_DISK_PERFORMANCE)); + diskPerformance = (struct _WMI_DISK_PERFORMANCE *)Buffer; + totalCounters = (struct _DISK_PERFORMANCE *)diskPerformance; + KeQuerySystemTime(&totalCounters->QueryTime); + perfctr = KeQueryPerformanceCounter(&frequency); + i = 0; } { - DiskPerfAddCounters(totalCounters, diskCounters, frequency); - diskCounters = (struct _DISK_PERFORMANCE *)((CHAR *)diskCounters + (long )(& ((DISK_PERFORMANCE *)0)->QueryTime)); - i += 1UL; + while (1) { + while_3_continue: /* CIL Label */; + if (i < deviceExtension->Processors) { + + } else { + goto while_3_break; + } + { + DiskPerfAddCounters(totalCounters, diskCounters, frequency); + diskCounters = + (struct _DISK_PERFORMANCE *)((CHAR *)diskCounters + + (long)(&((DISK_PERFORMANCE *)0) + ->QueryTime)); + i += 1UL; + } + } + while_3_break: /* CIL Label */; } - } - while_3_break: /* CIL Label */ ; - } - totalCounters->QueueDepth = deviceExtension->QueueDepth; - if (totalCounters->QueueDepth == 0UL) { - difference.QuadPart = perfctr.QuadPart - deviceExtension->LastIdleClock.QuadPart; - if (frequency.QuadPart > 0LL) { - totalCounters->IdleTime.QuadPart += (10000000LL * difference.QuadPart) / frequency.QuadPart; + totalCounters->QueueDepth = deviceExtension->QueueDepth; + if (totalCounters->QueueDepth == 0UL) { + difference.QuadPart = + perfctr.QuadPart - deviceExtension->LastIdleClock.QuadPart; + if (frequency.QuadPart > 0LL) { + totalCounters->IdleTime.QuadPart += + (10000000LL * difference.QuadPart) / frequency.QuadPart; + } else { + } } else { - + } + { + totalCounters->StorageDeviceNumber = deviceExtension->DiskNumber; + memcpy(&totalCounters->StorageManagerName[0], + &deviceExtension->StorageManagerName[0], 8U * sizeof(WCHAR)); + diskNamePtr = (WCHAR *)(Buffer + ((sizeof(DISK_PERFORMANCE) + 1U) & + 4294967294U)); + tmp = diskNamePtr; + diskNamePtr += 1; + *tmp = deviceExtension->PhysicalDeviceName.Length; + memcpy(diskNamePtr, deviceExtension->PhysicalDeviceName.Buffer, + deviceExtension->PhysicalDeviceName.Length); + *InstanceLengthArray = sizeNeeded; + status = 0L; } } else { - - } - { - totalCounters->StorageDeviceNumber = deviceExtension->DiskNumber; - memcpy(& totalCounters->StorageManagerName[0], & deviceExtension->StorageManagerName[0], - 8U * sizeof(WCHAR )); - diskNamePtr = (WCHAR *)(Buffer + ((sizeof(DISK_PERFORMANCE ) + 1U) & 4294967294U)); - tmp = diskNamePtr; - diskNamePtr += 1; - *tmp = deviceExtension->PhysicalDeviceName.Length; - memcpy(diskNamePtr, deviceExtension->PhysicalDeviceName.Buffer, deviceExtension->PhysicalDeviceName.Length); - *InstanceLengthArray = sizeNeeded; - status = 0L; + status = -1073741789L; } - } else { - status = -1073741789L; } + } else { + status = -1073741163L; } - } else { - status = -1073741163L; - } - { - status = WmiCompleteRequest(DeviceObject, Irp, status, sizeNeeded, 0); + { status = WmiCompleteRequest(DeviceObject, Irp, status, sizeNeeded, 0); } + return (status); } - return (status); -} } -NTSTATUS DiskperfWmiFunctionControl(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - WMIENABLEDISABLECONTROL Function , BOOLEAN Enable ) -{ NTSTATUS status ; - PDEVICE_EXTENSION deviceExtension ; - LONG tmp ; - LONG tmp___0 ; +NTSTATUS DiskperfWmiFunctionControl(PDEVICE_OBJECT DeviceObject, PIRP Irp, + ULONG GuidIndex, + WMIENABLEDISABLECONTROL Function, + BOOLEAN Enable) { + NTSTATUS status; + PDEVICE_EXTENSION deviceExtension; + LONG tmp; + LONG tmp___0; { - deviceExtension = DeviceObject->DeviceExtension; - if (GuidIndex == 0UL) { - if ((int )Function == 1) { - if (Enable) { - { - tmp = InterlockedIncrement(& deviceExtension->CountersEnabled); - } - if (tmp == 1L) { - if ((unsigned int )deviceExtension->DiskCounters != (unsigned int )((void *)0)) { + deviceExtension = DeviceObject->DeviceExtension; + if (GuidIndex == 0UL) { + if ((int)Function == 1) { + if (Enable) { + { tmp = InterlockedIncrement(&deviceExtension->CountersEnabled); } + if (tmp == 1L) { + if ((unsigned int)deviceExtension->DiskCounters != + (unsigned int)((void *)0)) { + { + memset(deviceExtension->DiskCounters, 0, + (ULONG)((long)(&((DISK_PERFORMANCE *)0)->QueryTime)) * + deviceExtension->Processors); + } + } else { + } { - memset(deviceExtension->DiskCounters, 0, (ULONG )((long )(& ((DISK_PERFORMANCE *)0)->QueryTime)) * deviceExtension->Processors); + deviceExtension->LastIdleClock = + KeQueryPerformanceCounter((void *)0); + deviceExtension->QueueDepth = 0; } } else { - - } - { - deviceExtension->LastIdleClock = KeQueryPerformanceCounter((void *)0); - deviceExtension->QueueDepth = 0; } } else { - + { tmp___0 = InterlockedDecrement(&deviceExtension->CountersEnabled); } + if (tmp___0 <= 0L) { + deviceExtension->CountersEnabled = 0; + deviceExtension->QueueDepth = 0; + } else { + } } } else { - { - tmp___0 = InterlockedDecrement(& deviceExtension->CountersEnabled); - } - if (tmp___0 <= 0L) { - deviceExtension->CountersEnabled = 0; - deviceExtension->QueueDepth = 0; - } else { - - } } + status = 0L; } else { - + status = -1073741163L; } - status = 0L; - } else { - status = -1073741163L; - } - { - status = WmiCompleteRequest(DeviceObject, Irp, status, 0, 0); + { status = WmiCompleteRequest(DeviceObject, Irp, status, 0, 0); } + return (status); } - return (status); -} } -void DiskPerfAddCounters(PDISK_PERFORMANCE TotalCounters , PDISK_PERFORMANCE NewCounters , - LARGE_INTEGER Frequency ) -{ +void DiskPerfAddCounters(PDISK_PERFORMANCE TotalCounters, + PDISK_PERFORMANCE NewCounters, + LARGE_INTEGER Frequency) { { - TotalCounters->BytesRead.QuadPart += NewCounters->BytesRead.QuadPart; - TotalCounters->BytesWritten.QuadPart += NewCounters->BytesWritten.QuadPart; - TotalCounters->ReadCount += NewCounters->ReadCount; - TotalCounters->WriteCount += NewCounters->WriteCount; - TotalCounters->SplitCount += NewCounters->SplitCount; - if (Frequency.QuadPart > 0LL) { - TotalCounters->ReadTime.QuadPart += (NewCounters->ReadTime.QuadPart * 10000000LL) / Frequency.QuadPart; - TotalCounters->WriteTime.QuadPart += (NewCounters->WriteTime.QuadPart * 10000000LL) / Frequency.QuadPart; - TotalCounters->IdleTime.QuadPart += (NewCounters->IdleTime.QuadPart * 10000000LL) / Frequency.QuadPart; - } else { - TotalCounters->ReadTime.QuadPart += NewCounters->ReadTime.QuadPart; - TotalCounters->WriteTime.QuadPart += NewCounters->WriteTime.QuadPart; - TotalCounters->IdleTime.QuadPart += NewCounters->IdleTime.QuadPart; + TotalCounters->BytesRead.QuadPart += NewCounters->BytesRead.QuadPart; + TotalCounters->BytesWritten.QuadPart += NewCounters->BytesWritten.QuadPart; + TotalCounters->ReadCount += NewCounters->ReadCount; + TotalCounters->WriteCount += NewCounters->WriteCount; + TotalCounters->SplitCount += NewCounters->SplitCount; + if (Frequency.QuadPart > 0LL) { + TotalCounters->ReadTime.QuadPart += + (NewCounters->ReadTime.QuadPart * 10000000LL) / Frequency.QuadPart; + TotalCounters->WriteTime.QuadPart += + (NewCounters->WriteTime.QuadPart * 10000000LL) / Frequency.QuadPart; + TotalCounters->IdleTime.QuadPart += + (NewCounters->IdleTime.QuadPart * 10000000LL) / Frequency.QuadPart; + } else { + TotalCounters->ReadTime.QuadPart += NewCounters->ReadTime.QuadPart; + TotalCounters->WriteTime.QuadPart += NewCounters->WriteTime.QuadPart; + TotalCounters->IdleTime.QuadPart += NewCounters->IdleTime.QuadPart; + } + return; } - return; -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) -IRP *pirp ; -void stub_driver_init(void) -{ +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +IRP *pirp; +void stub_driver_init(void) { { - s = NP; - customIrp = 0; - setEventCalled = customIrp; - lowerDriverReturn = setEventCalled; - compRegistered = lowerDriverReturn; - compFptr = compRegistered; - pended = compFptr; - return; -} -} -int main(void) -{ DRIVER_OBJECT d ; - NTSTATUS status = __VERIFIER_nondet_long() ; - int we_should_unload = __VERIFIER_nondet_int() ; - IRP irp ; - int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - int irp_choice = __VERIFIER_nondet_int() ; - DEVICE_OBJECT devobj ; - KeNumberProcessors = __VERIFIER_nondet_pointer(); - - { - { - pirp = & irp; - _BLAST_init(); - } - if (status >= 0L) { s = NP; customIrp = 0; setEventCalled = customIrp; @@ -3198,146 +3226,155 @@ int main(void) compRegistered = lowerDriverReturn; compFptr = compRegistered; pended = compFptr; - pirp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (irp_choice == 0) { - pirp->IoStatus.__annonCompField4.Status = -1073741637L; - myStatus = -1073741637L; - } else { + return; + } +} +int main(void) { + DRIVER_OBJECT d; + NTSTATUS status = __VERIFIER_nondet_long(); + int we_should_unload = __VERIFIER_nondet_int(); + IRP irp; + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + int irp_choice = __VERIFIER_nondet_int(); + DEVICE_OBJECT devobj; + KeNumberProcessors = __VERIFIER_nondet_pointer(); - } + { { - stub_driver_init(); - } - if (! (status >= 0L)) { - return (-1); - } else { - + pirp = &irp; + _BLAST_init(); } - if (__BLAST_NONDET___0 == 0) { - goto switch_4_0; - } else { - if (__BLAST_NONDET___0 == 2) { - goto switch_4_2; + if (status >= 0L) { + s = NP; + customIrp = 0; + setEventCalled = customIrp; + lowerDriverReturn = setEventCalled; + compRegistered = lowerDriverReturn; + compFptr = compRegistered; + pended = compFptr; + pirp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (irp_choice == 0) { + pirp->IoStatus.__annonCompField4.Status = -1073741637L; + myStatus = -1073741637L; + } else { + } + { stub_driver_init(); } + if (!(status >= 0L)) { + return (-1); } else { - if (__BLAST_NONDET___0 == 3) { - goto switch_4_3; + } + if (__BLAST_NONDET___0 == 0) { + goto switch_4_0; + } else { + if (__BLAST_NONDET___0 == 2) { + goto switch_4_2; } else { - if (__BLAST_NONDET___0 == 4) { - goto switch_4_4; + if (__BLAST_NONDET___0 == 3) { + goto switch_4_3; } else { - if (__BLAST_NONDET___0 == 12) { - goto switch_4_12; + if (__BLAST_NONDET___0 == 4) { + goto switch_4_4; } else { - { - goto switch_4_default; - if (0) { - switch_4_0: /* CIL Label */ - { - status = DiskPerfCreate(& devobj, pirp); - } - goto switch_4_break; - switch_4_2: /* CIL Label */ - { - status = DiskPerfDeviceControl(& devobj, pirp); - } - goto switch_4_break; - switch_4_3: /* CIL Label */ - { - status = DiskPerfDispatchPnp(& devobj, pirp); - } - goto switch_4_break; - switch_4_4: /* CIL Label */ - { - status = DiskPerfDispatchPower(& devobj, pirp); - } - goto switch_4_break; - switch_4_12: /* CIL Label */ + if (__BLAST_NONDET___0 == 12) { + goto switch_4_12; + } else { { - status = DiskPerfShutdownFlush(& devobj, pirp); + goto switch_4_default; + if (0) { + switch_4_0 : /* CIL Label */ + { + status = DiskPerfCreate(&devobj, pirp); + } + goto switch_4_break; + switch_4_2 : /* CIL Label */ + { + status = DiskPerfDeviceControl(&devobj, pirp); + } + goto switch_4_break; + switch_4_3 : /* CIL Label */ + { + status = DiskPerfDispatchPnp(&devobj, pirp); + } + goto switch_4_break; + switch_4_4 : /* CIL Label */ + { + status = DiskPerfDispatchPower(&devobj, pirp); + } + goto switch_4_break; + switch_4_12 : /* CIL Label */ + { + status = DiskPerfShutdownFlush(&devobj, pirp); + } + goto switch_4_break; + switch_4_default: /* CIL Label */; + return (-1); + } else { + switch_4_break: /* CIL Label */; + } } - goto switch_4_break; - switch_4_default: /* CIL Label */ ; - return (-1); - } else { - switch_4_break: /* CIL Label */ ; - } } } } } } - } - if (we_should_unload) { - { -/* DiskPerfUnload(& d); */ /* INLINED */ + if (we_should_unload) { + { /* DiskPerfUnload(& d); */ /* INLINED */ + } + } else { } } else { - - } - } else { - - } - if (pended == 1) { - if (s == NP) { - s = NP; - } else { - goto _L___2; } - } else { - _L___2: /* CIL Label */ if (pended == 1) { - if (s == MPR3) { - s = MPR3; + if (s == NP) { + s = NP; } else { - goto _L___1; + goto _L___2; } } else { - _L___1: /* CIL Label */ - if (s == UNLOADED) { - + _L___2: /* CIL Label */ + if (pended == 1) { + if (s == MPR3) { + s = MPR3; + } else { + goto _L___1; + } } else { - if (status == -1L) { + _L___1: /* CIL Label */ + if (s == UNLOADED) { } else { - if (s != SKIP2) { - if (s != IPC) { - if (s != DC) { - { - errorFn(); - } - } else { - goto _L___0; - } - } else { - goto _L___0; - } + if (status == -1L) { + } else { - _L___0: /* CIL Label */ - if (pended == 1) { - if (status != 259L) { - { - errorFn(); + if (s != SKIP2) { + if (s != IPC) { + if (s != DC) { + { errorFn(); } + } else { + goto _L___0; } } else { - + goto _L___0; } } else { - if (s == DC) { - if (status == 259L) { - { - errorFn(); - } + _L___0: /* CIL Label */ + if (pended == 1) { + if (status != 259L) { + { errorFn(); } } else { - } } else { - if (status != (NTSTATUS )lowerDriverReturn) { - { - errorFn(); + if (s == DC) { + if (status == 259L) { + { errorFn(); } + } else { } } else { - + if (status != (NTSTATUS)lowerDriverReturn) { + { errorFn(); } + } else { + } } } } @@ -3345,1122 +3382,979 @@ int main(void) } } } - } - return (status); -} -} -char _SLAM_alloc_dummy ; -char *malloc(int i ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - - { - if (__BLAST_NONDET___0) { - return ((char *)0); - } else { - return ((char *)1); + return (status); } } -} - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; -void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) -{ +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; -void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) -{ +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; -PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , SIZE_T NumberOfBytes , - ULONG Tag ) -{ PVOID x ; - char *tmp ; +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag) { + PVOID x; + char *tmp; { - { - tmp = malloc(NumberOfBytes); - x = tmp; + { + tmp = malloc(NumberOfBytes); + x = tmp; + } + return (x); } - return (x); -} } - void ExFreePool(PVOID P ) ; -void ExFreePool(PVOID P ) -{ +void ExFreePool(PVOID P); +void ExFreePool(PVOID P) { - { - return; -} + { return; } } - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); + { return ((void *)0); } } -} - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; -PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , BOOLEAN SecondaryBuffer , - BOOLEAN ChargeQuota , PIRP Irp ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - char *tmp ; +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET___0 == 0) { - goto switch_5_0; - } else { - { - goto switch_5_default; - if (0) { - switch_5_0: /* CIL Label */ + if (__BLAST_NONDET___0 == 0) { + goto switch_5_0; + } else { { - tmp = malloc(sizeof(MDL )); + goto switch_5_default; + if (0) { + switch_5_0 : /* CIL Label */ + { + tmp = malloc(sizeof(MDL)); + } + return ((void *)tmp); + switch_5_default: /* CIL Label */; + return ((void *)0); + } else { + switch_5_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_5_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_5_break: /* CIL Label */ ; - } } } } -} - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; -PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , PDEVICE_OBJECT TargetDevice ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_6_0; - } else { - { - goto switch_6_default; - if (0) { - switch_6_0: /* CIL Label */ ; - return (TargetDevice); - switch_6_default: /* CIL Label */ ; - return ((void *)0); + if (__BLAST_NONDET___0 == 0) { + goto switch_6_0; } else { - switch_6_break: /* CIL Label */ ; - } + { + goto switch_6_default; + if (0) { + switch_6_0: /* CIL Label */; + return (TargetDevice); + switch_6_default: /* CIL Label */; + return ((void *)0); + } else { + switch_6_break: /* CIL Label */; + } + } } } } -} - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , PDEVICE_OBJECT DeviceObject , - PVOID Buffer , ULONG Length , PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - char *tmp ; +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + char *tmp; { - customIrp = 1; - if (__BLAST_NONDET___0 == 0) { - goto switch_7_0; - } else { - { - goto switch_7_default; - if (0) { - switch_7_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET___0 == 0) { + goto switch_7_0; + } else { { - tmp = malloc(sizeof(IRP )); + goto switch_7_default; + if (0) { + switch_7_0 : /* CIL Label */ + { + tmp = malloc(sizeof(IRP)); + } + return ((void *)tmp); + switch_7_default: /* CIL Label */; + return ((void *)0); + } else { + switch_7_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_7_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_7_break: /* CIL Label */ ; - } } } } -} - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , BOOLEAN InternalDeviceIoControl , - PKEVENT Event , PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - char *tmp ; +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + char *tmp; { - customIrp = 1; - if (__BLAST_NONDET___0 == 0) { - goto switch_8_0; - } else { - { - goto switch_8_default; - if (0) { - switch_8_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET___0 == 0) { + goto switch_8_0; + } else { { - tmp = malloc(sizeof(IRP )); + goto switch_8_default; + if (0) { + switch_8_0 : /* CIL Label */ + { + tmp = malloc(sizeof(IRP)); + } + return ((void *)tmp); + switch_8_default: /* CIL Label */; + return ((void *)0); + } else { + switch_8_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_8_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_8_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; -NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - char *tmp ; +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET___0 == 0) { - goto switch_9_0; - } else { - { - goto switch_9_default; - if (0) { - switch_9_0: /* CIL Label */ + if (__BLAST_NONDET___0 == 0) { + goto switch_9_0; + } else { { - tmp = malloc(sizeof(DEVICE_OBJECT )); - *DeviceObject = (void *)tmp; + goto switch_9_default; + if (0) { + switch_9_0 : /* CIL Label */ + { + tmp = malloc(sizeof(DEVICE_OBJECT)); + *DeviceObject = (void *)tmp; + } + return (0L); + switch_9_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_9_break: /* CIL Label */; + } } - return (0L); - switch_9_default: /* CIL Label */ ; - return (-1073741823L); - } else { - switch_9_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; -NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , PUNICODE_STRING DeviceName ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_10_0; - } else { - { - goto switch_10_default; - if (0) { - switch_10_0: /* CIL Label */ ; - return (0L); - switch_10_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_10_0; } else { - switch_10_break: /* CIL Label */ ; - } + { + goto switch_10_default; + if (0) { + switch_10_0: /* CIL Label */; + return (0L); + switch_10_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_10_break: /* CIL Label */; + } + } } } } -} - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; -void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) -{ +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject) { - { - return; -} + { return; } } - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_11_0; - } else { - { - goto switch_11_default; - if (0) { - switch_11_0: /* CIL Label */ ; - return (0L); - switch_11_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_11_0; } else { - switch_11_break: /* CIL Label */ ; - } + { + goto switch_11_default; + if (0) { + switch_11_0: /* CIL Label */; + return (0L); + switch_11_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_11_break: /* CIL Label */; + } + } } } } -} - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; -void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) -{ +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice) { - { - return; -} + { return; } } - void IoFreeIrp(PIRP Irp ) ; -void IoFreeIrp(PIRP Irp ) -{ +void IoFreeIrp(PIRP Irp); +void IoFreeIrp(PIRP Irp) { - { - return; -} + { return; } } - void IoFreeMdl(PMDL Mdl ) ; -void IoFreeMdl(PMDL Mdl ) -{ +void IoFreeMdl(PMDL Mdl); +void IoFreeMdl(PMDL Mdl) { - { - return; -} + { return; } } - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; -PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) -{ char *tmp ; +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) { + char *tmp; { - { - tmp = malloc(sizeof(CONFIGURATION_INFORMATION )); + { tmp = malloc(sizeof(CONFIGURATION_INFORMATION)); } + return ((void *)tmp); } - return ((void *)tmp); -} } - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; -NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , PULONG BusNumber , PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_12_0; - } else { - { - goto switch_12_default; - if (0) { - switch_12_0: /* CIL Label */ ; - return (0L); - switch_12_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_12_0; } else { - switch_12_break: /* CIL Label */ ; - } + { + goto switch_12_default; + if (0) { + switch_12_0: /* CIL Label */; + return (0L); + switch_12_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_12_break: /* CIL Label */; + } + } } } } -} - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_13_0; - } else { - { - goto switch_13_default; - if (0) { - switch_13_0: /* CIL Label */ ; - return (0L); - switch_13_default: /* CIL Label */ ; - return (-1073741808L); + if (__BLAST_NONDET___0 == 0) { + goto switch_13_0; } else { - switch_13_break: /* CIL Label */ ; - } + { + goto switch_13_default; + if (0) { + switch_13_0: /* CIL Label */; + return (0L); + switch_13_default: /* CIL Label */; + return (-1073741808L); + } else { + switch_13_break: /* CIL Label */; + } + } } } } -} - void IoReleaseCancelSpinLock(KIRQL Irql ) ; -void IoReleaseCancelSpinLock(KIRQL Irql ) -{ +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoReleaseCancelSpinLock(KIRQL Irql) { - { - return; -} + { return; } } - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , BOOLEAN Enable ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_14_0; - } else { - { - goto switch_14_default; - if (0) { - switch_14_0: /* CIL Label */ ; - return (0L); - switch_14_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_14_0; } else { - switch_14_break: /* CIL Label */ ; - } + { + goto switch_14_default; + if (0) { + switch_14_0: /* CIL Label */; + return (0L); + switch_14_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_14_break: /* CIL Label */; + } + } } } } -} - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; -void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) -{ +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject) { - { - return; + { return; } } -} -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { - if (s == NP) { - s = MPR1; - } else { - { - errorFn(); + if (s == NP) { + s = MPR1; + } else { + { errorFn(); } } + return; } - return; } -} - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - NTSTATUS returnVal2 ; - int compRetStatus ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; - NTSTATUS tmp___0 ; +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + NTSTATUS returnVal2; + int compRetStatus; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; + NTSTATUS tmp___0; { - if (compRegistered) { - if (routine == 0) { - { - tmp = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - } else { - { - tmp___0 = DiskPerfIoCompletion(DeviceObject, Irp, lcontext); - compRetStatus = tmp___0; + if (compRegistered) { + if (routine == 0) { + { + tmp = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext); + compRetStatus = tmp; + } + } else { + { + tmp___0 = DiskPerfIoCompletion(DeviceObject, Irp, lcontext); + compRetStatus = tmp___0; + } } - } - if ((long )compRetStatus == -1073741802L) { - { - stubMoreProcessingRequired(); + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET___0 == 0) { - goto switch_15_0; - } else { - if (__BLAST_NONDET___0 == 1) { - goto switch_15_1; + if (__BLAST_NONDET___0 == 0) { + goto switch_15_0; } else { - { - goto switch_15_default; - if (0) { - switch_15_0: /* CIL Label */ - returnVal2 = 0L; - goto switch_15_break; - switch_15_1: /* CIL Label */ - returnVal2 = -1073741823L; - goto switch_15_break; - switch_15_default: /* CIL Label */ - returnVal2 = 259L; - goto switch_15_break; + if (__BLAST_NONDET___0 == 1) { + goto switch_15_1; } else { - switch_15_break: /* CIL Label */ ; - } + { + goto switch_15_default; + if (0) { + switch_15_0: /* CIL Label */ + returnVal2 = 0L; + goto switch_15_break; + switch_15_1: /* CIL Label */ + returnVal2 = -1073741823L; + goto switch_15_break; + switch_15_default: /* CIL Label */ + returnVal2 = 259L; + goto switch_15_break; + } else { + switch_15_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal2; - } else { - if (s == MPR1) { - if (returnVal2 == 259L) { - s = MPR3; - lowerDriverReturn = returnVal2; - } else { - s = NP; - lowerDriverReturn = returnVal2; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal2; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal2; + if (s == MPR1) { + if (returnVal2 == 259L) { + s = MPR3; + lowerDriverReturn = returnVal2; + } else { + s = NP; + lowerDriverReturn = returnVal2; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal2; + } else { + { errorFn(); } } } } + return (returnVal2); } - return (returnVal2); } -} - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; -void IofCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) -{ +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost) { { - if (s == NP) { - s = DC; - } else { - { - errorFn(); + if (s == NP) { + s = DC; + } else { + { errorFn(); } } + return; } - return; } -} - KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ; -KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) -{ +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock); +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock) { - { - return ((unsigned char)0); + { return ((unsigned char)0); } } -} - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; -NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , BOOLEAN Alertable , PLARGE_INTEGER Interval ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_16_0; - } else { - { - goto switch_16_default; - if (0) { - switch_16_0: /* CIL Label */ ; - return (0L); - switch_16_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_16_0; } else { - switch_16_break: /* CIL Label */ ; - } + { + goto switch_16_default; + if (0) { + switch_16_0: /* CIL Label */; + return (0L); + switch_16_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_16_break: /* CIL Label */; + } + } } } } -} - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; -void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , BOOLEAN State ) -{ +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State) { - { - return; -} + { return; } } - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; -void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , LONG Count , LONG Limit ) -{ +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit) { - { - return; -} + { return; } } - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; -void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) -{ +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock) { - { - return; -} + { return; } } - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; -LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , LONG Adjustment , - BOOLEAN Wait ) -{ LONG r = __VERIFIER_nondet_long() ; +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait) { + LONG r = __VERIFIER_nondet_long(); - { - return (r); -} + { return (r); } } - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; -void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , KIRQL NewIrql ) -{ +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql) { - { - return; -} + { return; } } - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; -LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , BOOLEAN Wait ) -{ LONG l = __VERIFIER_nondet_long() ; +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait) { + LONG l = __VERIFIER_nondet_long(); { - setEventCalled = 1; - return (l); -} + setEventCalled = 1; + return (l); + } } - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; -NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , PLARGE_INTEGER Timeout ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (s == MPR3) { - if (setEventCalled == 1) { - s = NP; - setEventCalled = 0; - } else { - goto _L; - } - } else { - _L: /* CIL Label */ - if (customIrp == 1) { - s = NP; - customIrp = 0; + if (s == MPR3) { + if (setEventCalled == 1) { + s = NP; + setEventCalled = 0; + } else { + goto _L; + } } else { - if (s == MPR3) { - { - errorFn(); - } + _L: /* CIL Label */ + if (customIrp == 1) { + s = NP; + customIrp = 0; } else { - + if (s == MPR3) { + { errorFn(); } + } else { + } } } - } - if (__BLAST_NONDET___0 == 0) { - goto switch_17_0; - } else { - { - goto switch_17_default; - if (0) { - switch_17_0: /* CIL Label */ ; - return (0L); - switch_17_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_17_0; } else { - switch_17_break: /* CIL Label */ ; - } + { + goto switch_17_default; + if (0) { + switch_17_0: /* CIL Label */; + return (0L); + switch_17_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_17_break: /* CIL Label */; + } + } } } } -} - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; -PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , PHYSICAL_ADDRESS HighestAcceptableAddress ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - char *tmp ; +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET___0 == 0) { - goto switch_18_0; - } else { - if (__BLAST_NONDET___0 == 1) { - goto switch_18_1; + if (__BLAST_NONDET___0 == 0) { + goto switch_18_0; } else { - if (0) { - switch_18_0: /* CIL Label */ + if (__BLAST_NONDET___0 == 1) { + goto switch_18_1; + } else { + if (0) { + switch_18_0 : /* CIL Label */ { - tmp = malloc(NumberOfBytes); + tmp = malloc(NumberOfBytes); + } + return (tmp); + switch_18_1: /* CIL Label */; + return ((void *)0); + } else { + switch_18_break: /* CIL Label */; } - return (tmp); - switch_18_1: /* CIL Label */ ; - return ((void *)0); - } else { - switch_18_break: /* CIL Label */ ; } } + return ((void *)0); } - return ((void *)0); -} } - void MmFreeContiguousMemory(PVOID BaseAddress ) ; -void MmFreeContiguousMemory(PVOID BaseAddress ) -{ +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmFreeContiguousMemory(PVOID BaseAddress) { - { - return; -} + { return; } } - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; -PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , PVOID BaseAddress , - ULONG BugCheckOnFailure , MM_PAGE_PRIORITY Priority ) -{ +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority) { - { - return ((void *)0); -} + { return ((void *)0); } } - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; -PVOID MmPageEntireDriver(PVOID AddressWithinSection ) -{ +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection) { - { - return ((void *)0); -} + { return ((void *)0); } } - void MmResetDriverPaging(PVOID AddressWithinSection ) ; -void MmResetDriverPaging(PVOID AddressWithinSection ) -{ +void MmResetDriverPaging(PVOID AddressWithinSection); +void MmResetDriverPaging(PVOID AddressWithinSection) { - { - return; -} + { return; } } - void MmUnlockPages(PMDL MemoryDescriptorList ) ; -void MmUnlockPages(PMDL MemoryDescriptorList ) -{ +void MmUnlockPages(PMDL MemoryDescriptorList); +void MmUnlockPages(PMDL MemoryDescriptorList) { - { - return; -} + { return; } } - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; -NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , ACCESS_MASK DesiredAccess , POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , PVOID *Object , POBJECT_HANDLE_INFORMATION HandleInformation ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_19_0; - } else { - { - goto switch_19_default; - if (0) { - switch_19_0: /* CIL Label */ ; - return (0L); - switch_19_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_19_0; } else { - switch_19_break: /* CIL Label */ ; - } + { + goto switch_19_default; + if (0) { + switch_19_0: /* CIL Label */; + return (0L); + switch_19_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_19_break: /* CIL Label */; + } + } } } } -} - void ObfDereferenceObject(PVOID Object ) ; -void ObfDereferenceObject(PVOID Object ) -{ +void ObfDereferenceObject(PVOID Object); +void ObfDereferenceObject(PVOID Object) { - { - return; + { return; } } -} - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; - int compRetStatus ; - NTSTATUS returnVal ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; - NTSTATUS tmp___0 ; +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); + int compRetStatus; + NTSTATUS returnVal; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; + NTSTATUS tmp___0; { - if (compRegistered) { - if (routine == 0) { - { - tmp = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - } else { - if (routine == 1) { + if (compRegistered) { + if (routine == 0) { { - tmp___0 = DiskPerfIoCompletion(DeviceObject, Irp, lcontext); - compRetStatus = tmp___0; + tmp = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext); + compRetStatus = tmp; } } else { - + if (routine == 1) { + { + tmp___0 = DiskPerfIoCompletion(DeviceObject, Irp, lcontext); + compRetStatus = tmp___0; + } + } else { + } } - } - if ((long )compRetStatus == -1073741802L) { - { - stubMoreProcessingRequired(); + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET___0 == 0) { - goto switch_20_0; - } else { - if (__BLAST_NONDET___0 == 1) { - goto switch_20_1; + if (__BLAST_NONDET___0 == 0) { + goto switch_20_0; } else { - { - goto switch_20_default; - if (0) { - switch_20_0: /* CIL Label */ - returnVal = 0L; - goto switch_20_break; - switch_20_1: /* CIL Label */ - returnVal = -1073741823L; - goto switch_20_break; - switch_20_default: /* CIL Label */ - returnVal = 259L; - goto switch_20_break; + if (__BLAST_NONDET___0 == 1) { + goto switch_20_1; } else { - switch_20_break: /* CIL Label */ ; - } + { + goto switch_20_default; + if (0) { + switch_20_0: /* CIL Label */ + returnVal = 0L; + goto switch_20_break; + switch_20_1: /* CIL Label */ + returnVal = -1073741823L; + goto switch_20_break; + switch_20_default: /* CIL Label */ + returnVal = 259L; + goto switch_20_break; + } else { + switch_20_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal; - } else { - if (s == MPR1) { - if (returnVal == 259L) { - s = MPR3; - lowerDriverReturn = returnVal; - } else { - s = NP; - lowerDriverReturn = returnVal; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal; + if (s == MPR1) { + if (returnVal == 259L) { + s = MPR3; + lowerDriverReturn = returnVal; + } else { + s = NP; + lowerDriverReturn = returnVal; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal; + } else { + { errorFn(); } } } } + return (returnVal); } - return (returnVal); -} } - void PoStartNextPowerIrp(PIRP Irp ) ; -void PoStartNextPowerIrp(PIRP Irp ) -{ +void PoStartNextPowerIrp(PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp) { - { - return; -} + { return; } } - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; -NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , ULONG DesiredAccess , POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , PCLIENT_ID ClientId , void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_21_0; - } else { - { - goto switch_21_default; - if (0) { - switch_21_0: /* CIL Label */ ; - return (0L); - switch_21_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_21_0; } else { - switch_21_break: /* CIL Label */ ; - } + { + goto switch_21_default; + if (0) { + switch_21_0: /* CIL Label */; + return (0L); + switch_21_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_21_break: /* CIL Label */; + } + } } } } -} - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_22_0; - } else { - { - goto switch_22_default; - if (0) { - switch_22_0: /* CIL Label */ ; - return (0L); - switch_22_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_22_0; } else { - switch_22_break: /* CIL Label */ ; - } + { + goto switch_22_default; + if (0) { + switch_22_0: /* CIL Label */; + return (0L); + switch_22_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_22_break: /* CIL Label */; + } + } } } } -} - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; -NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_23_0; - } else { - { - goto switch_23_default; - if (0) { - switch_23_0: /* CIL Label */ ; - return (0L); - switch_23_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_23_0; } else { - switch_23_break: /* CIL Label */ ; - } + { + goto switch_23_default; + if (0) { + switch_23_0: /* CIL Label */; + return (0L); + switch_23_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_23_break: /* CIL Label */; + } + } } } } -} - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; -SIZE_T RtlCompareMemory(void const *Source1 , void const *Source2 , - SIZE_T Length ) -{ SIZE_T r = __VERIFIER_nondet_long() ; +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length) { + SIZE_T r = __VERIFIER_nondet_long(); - { - return (r); + { return (r); } } -} - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; -void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) -{ +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString) { - { - return; + { return; } } -} - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; -NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , PCWSTR ValueName ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_24_0; - } else { - { - goto switch_24_default; - if (0) { - switch_24_0: /* CIL Label */ ; - return (0L); - switch_24_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_24_0; } else { - switch_24_break: /* CIL Label */ ; - } + { + goto switch_24_default; + if (0) { + switch_24_0: /* CIL Label */; + return (0L); + switch_24_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_24_break: /* CIL Label */; + } + } } } } -} - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; -void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) -{ +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString) { - { - return; -} + { return; } } - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; -void RtlInitString(PSTRING DestinationString , PCSZ SourceString ) -{ +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString) { - { - return; -} + { return; } } - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; -void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) -{ +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString) { - { - return; -} + { return; } } - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; -NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , PVOID Environment ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_25_0; - } else { - { - goto switch_25_default; - if (0) { - switch_25_0: /* CIL Label */ ; - return (0L); - switch_25_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_25_0; } else { - switch_25_break: /* CIL Label */ ; - } + { + goto switch_25_default; + if (0) { + switch_25_0: /* CIL Label */; + return (0L); + switch_25_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_25_break: /* CIL Label */; + } + } } } } -} - NTSTATUS ZwClose(HANDLE Handle ) ; -NTSTATUS ZwClose(HANDLE Handle ) -{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ; +NTSTATUS ZwClose(HANDLE Handle); +NTSTATUS ZwClose(HANDLE Handle) { + int __BLAST_NONDET___0 = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET___0 == 0) { - goto switch_26_0; - } else { - { - goto switch_26_default; - if (0) { - switch_26_0: /* CIL Label */ ; - return (0L); - switch_26_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET___0 == 0) { + goto switch_26_0; } else { - switch_26_break: /* CIL Label */ ; - } + { + goto switch_26_default; + if (0) { + switch_26_0: /* CIL Label */; + return (0L); + switch_26_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_26_break: /* CIL Label */; + } + } } } } -} -NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo , PDEVICE_OBJECT DeviceObject , - PIRP Irp , PSYSCTL_IRP_DISPOSITION IrpDisposition ) -{ +NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo, + PDEVICE_OBJECT DeviceObject, PIRP Irp, + PSYSCTL_IRP_DISPOSITION IrpDisposition) { - { - return (0L); -} + { return (0L); } } diff --git a/test/ntdrivers/floppy2_true.i.cil.c b/test/ntdrivers/floppy2_true.i.cil.c index 6b6525654..678c45494 100644 --- a/test/ntdrivers/floppy2_true.i.cil.c +++ b/test/ntdrivers/floppy2_true.i.cil.c @@ -10,7 +10,7 @@ extern void *__VERIFIER_nondet_pointer(void); /* print_CIL_Input is true */ #line 33 "C:/NTDDK/inc/stdio.h" -#pragma pack(push,8) +#pragma pack(push, 8) #line 63 "C:/NTDDK/inc/stdio.h" typedef unsigned int size_t; #line 70 "C:/NTDDK/inc/stdio.h" @@ -18,7 +18,7 @@ typedef unsigned short wchar_t; #line 432 #pragma pack(pop) #line 33 "C:/Program Files/Microsoft Visual Studio/VC98/include/excpt.h" -#pragma pack(push,8) +#pragma pack(push, 8) #line 156 #pragma pack(pop) #line 88 "C:/NTDDK/inc/basetsd.h" @@ -40,7 +40,7 @@ typedef wchar_t WCHAR; #line 286 "C:/NTDDK/inc/ntdef.h" typedef WCHAR *PWSTR; #line 288 "C:/NTDDK/inc/ntdef.h" -typedef WCHAR const *PCWSTR; +typedef WCHAR const *PCWSTR; #line 293 "C:/NTDDK/inc/ntdef.h" typedef CHAR *PCHAR; #line 350 "C:/NTDDK/inc/ntdef.h" @@ -73,19 +73,19 @@ typedef long long LONGLONG; typedef unsigned long long ULONGLONG; #line 649 "C:/NTDDK/inc/ntdef.h" struct __anonstruct____missing_field_name_1 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; #line 649 "C:/NTDDK/inc/ntdef.h" struct __anonstruct_u_2 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; #line 649 "C:/NTDDK/inc/ntdef.h" union _LARGE_INTEGER { - struct __anonstruct____missing_field_name_1 __annonCompField1 ; - struct __anonstruct_u_2 u ; - LONGLONG QuadPart ; + struct __anonstruct____missing_field_name_1 __annonCompField1; + struct __anonstruct_u_2 u; + LONGLONG QuadPart; }; #line 649 "C:/NTDDK/inc/ntdef.h" typedef union _LARGE_INTEGER LARGE_INTEGER; @@ -93,45 +93,42 @@ typedef union _LARGE_INTEGER LARGE_INTEGER; typedef LARGE_INTEGER *PLARGE_INTEGER; #line 668 "C:/NTDDK/inc/ntdef.h" struct __anonstruct____missing_field_name_3 { - ULONG LowPart ; - ULONG HighPart ; + ULONG LowPart; + ULONG HighPart; }; #line 668 "C:/NTDDK/inc/ntdef.h" struct __anonstruct_u_4 { - ULONG LowPart ; - ULONG HighPart ; + ULONG LowPart; + ULONG HighPart; }; #line 668 "C:/NTDDK/inc/ntdef.h" union _ULARGE_INTEGER { - struct __anonstruct____missing_field_name_3 __annonCompField2 ; - struct __anonstruct_u_4 u ; - ULONGLONG QuadPart ; + struct __anonstruct____missing_field_name_3 __annonCompField2; + struct __anonstruct_u_4 u; + ULONGLONG QuadPart; }; #line 668 "C:/NTDDK/inc/ntdef.h" typedef union _ULARGE_INTEGER ULARGE_INTEGER; #line 690 "C:/NTDDK/inc/ntdef.h" struct _LUID { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; #line 690 "C:/NTDDK/inc/ntdef.h" typedef struct _LUID LUID; #line 707 "C:/NTDDK/inc/ntdef.h" typedef LARGE_INTEGER PHYSICAL_ADDRESS; #line 956 -enum _EVENT_TYPE { - NotificationEvent = 0, - SynchronizationEvent = 1 -} ; +enum _EVENT_TYPE { NotificationEvent = 0, SynchronizationEvent = 1 }; #line 956 "C:/NTDDK/inc/ntdef.h" typedef enum _EVENT_TYPE EVENT_TYPE; #line 984 "C:/NTDDK/inc/ntdef.h" -typedef char const *PCSZ; +typedef char const *PCSZ; #line 991 "C:/NTDDK/inc/ntdef.h" struct _STRING { - USHORT Length ; - USHORT MaximumLength ; - PCHAR Buffer ; + USHORT Length; + USHORT MaximumLength; + PCHAR Buffer; }; #line 991 "C:/NTDDK/inc/ntdef.h" typedef struct _STRING STRING; @@ -141,9 +138,9 @@ typedef STRING *PSTRING; typedef PSTRING PANSI_STRING; #line 1027 "C:/NTDDK/inc/ntdef.h" struct _UNICODE_STRING { - USHORT Length ; - USHORT MaximumLength ; - PWSTR Buffer ; + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; }; #line 1027 "C:/NTDDK/inc/ntdef.h" typedef struct _UNICODE_STRING UNICODE_STRING; @@ -153,8 +150,8 @@ typedef UNICODE_STRING *PUNICODE_STRING; typedef UCHAR BOOLEAN; #line 1057 "C:/NTDDK/inc/ntdef.h" struct _LIST_ENTRY { - struct _LIST_ENTRY *Flink ; - struct _LIST_ENTRY *Blink ; + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; }; #line 1057 "C:/NTDDK/inc/ntdef.h" typedef struct _LIST_ENTRY LIST_ENTRY; @@ -162,7 +159,7 @@ typedef struct _LIST_ENTRY LIST_ENTRY; typedef struct _LIST_ENTRY *PLIST_ENTRY; #line 1067 "C:/NTDDK/inc/ntdef.h" struct _SINGLE_LIST_ENTRY { - struct _SINGLE_LIST_ENTRY *Next ; + struct _SINGLE_LIST_ENTRY *Next; }; #line 1067 "C:/NTDDK/inc/ntdef.h" typedef struct _SINGLE_LIST_ENTRY SINGLE_LIST_ENTRY; @@ -170,8 +167,8 @@ typedef struct _SINGLE_LIST_ENTRY SINGLE_LIST_ENTRY; typedef struct _SINGLE_LIST_ENTRY *PSINGLE_LIST_ENTRY; #line 1078 "C:/NTDDK/inc/ntdef.h" struct LIST_ENTRY32 { - ULONG Flink ; - ULONG Blink ; + ULONG Flink; + ULONG Blink; }; #line 1078 "C:/NTDDK/inc/ntdef.h" typedef struct LIST_ENTRY32 LIST_ENTRY32; @@ -179,8 +176,8 @@ typedef struct LIST_ENTRY32 LIST_ENTRY32; typedef LIST_ENTRY32 *PLIST_ENTRY32; #line 1084 "C:/NTDDK/inc/ntdef.h" struct LIST_ENTRY64 { - ULONGLONG Flink ; - ULONGLONG Blink ; + ULONGLONG Flink; + ULONGLONG Blink; }; #line 1084 "C:/NTDDK/inc/ntdef.h" typedef struct LIST_ENTRY64 LIST_ENTRY64; @@ -188,12 +185,12 @@ typedef struct LIST_ENTRY64 LIST_ENTRY64; typedef LIST_ENTRY64 *PLIST_ENTRY64; #line 1173 "C:/NTDDK/inc/ntdef.h" struct _OBJECT_ATTRIBUTES { - ULONG Length ; - HANDLE RootDirectory ; - PUNICODE_STRING ObjectName ; - ULONG Attributes ; - PVOID SecurityDescriptor ; - PVOID SecurityQualityOfService ; + ULONG Length; + HANDLE RootDirectory; + PUNICODE_STRING ObjectName; + ULONG Attributes; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; }; #line 1173 "C:/NTDDK/inc/ntdef.h" typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES; @@ -201,10 +198,10 @@ typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES; typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; #line 17 "C:/NTDDK/inc/guiddef.h" struct _GUID { - unsigned long Data1 ; - unsigned short Data2 ; - unsigned short Data3 ; - unsigned char Data4[8] ; + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; }; #line 17 "C:/NTDDK/inc/guiddef.h" typedef struct _GUID GUID; @@ -212,10 +209,10 @@ typedef struct _GUID GUID; typedef UCHAR KIRQL; #line 1316 enum _NT_PRODUCT_TYPE { - NtProductWinNt = 1, - NtProductLanManNt = 2, - NtProductServer = 3 -} ; + NtProductWinNt = 1, + NtProductLanManNt = 2, + NtProductServer = 3 +}; #line 1316 "C:/NTDDK/inc/ntdef.h" typedef enum _NT_PRODUCT_TYPE NT_PRODUCT_TYPE; #line 75 "C:/NTDDK/inc/ddk/ntddk.h" @@ -250,14 +247,14 @@ struct _OBJECT_TYPE; typedef struct _OBJECT_TYPE *POBJECT_TYPE; #line 143 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct____missing_field_name_5 { - SINGLE_LIST_ENTRY Next ; - USHORT Depth ; - USHORT Sequence ; + SINGLE_LIST_ENTRY Next; + USHORT Depth; + USHORT Sequence; }; #line 143 "C:/NTDDK/inc/ddk/ntddk.h" union _SLIST_HEADER { - ULONGLONG Alignment ; - struct __anonstruct____missing_field_name_5 __annonCompField3 ; + ULONGLONG Alignment; + struct __anonstruct____missing_field_name_5 __annonCompField3; }; #line 143 "C:/NTDDK/inc/ddk/ntddk.h" typedef union _SLIST_HEADER SLIST_HEADER; @@ -272,24 +269,27 @@ struct _KAPC; #line 222 struct _KAPC; #line 224 "C:/NTDDK/inc/ddk/ntddk.h" -typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ); +typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); #line 265 "C:/NTDDK/inc/ddk/ntddk.h" struct _KAPC { - CSHORT Type ; - CSHORT Size ; - ULONG Spare0 ; - struct _KTHREAD *Thread ; - LIST_ENTRY ApcListEntry ; - void (*KernelRoutine)(struct _KAPC *Apc , PKNORMAL_ROUTINE *NormalRoutine , PVOID *NormalContext , - PVOID *SystemArgument1 , PVOID *SystemArgument2 ) ; - void (*RundownRoutine)(struct _KAPC *Apc ) ; - void (*NormalRoutine)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ) ; - PVOID NormalContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - CCHAR ApcStateIndex ; - KPROCESSOR_MODE ApcMode ; - BOOLEAN Inserted ; + CSHORT Type; + CSHORT Size; + ULONG Spare0; + struct _KTHREAD *Thread; + LIST_ENTRY ApcListEntry; + void (*KernelRoutine)(struct _KAPC *Apc, PKNORMAL_ROUTINE *NormalRoutine, + PVOID *NormalContext, PVOID *SystemArgument1, + PVOID *SystemArgument2); + void (*RundownRoutine)(struct _KAPC *Apc); + void (*NormalRoutine)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); + PVOID NormalContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + CCHAR ApcStateIndex; + KPROCESSOR_MODE ApcMode; + BOOLEAN Inserted; }; #line 265 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _KAPC KAPC; @@ -301,16 +301,16 @@ struct _KDPC; struct _KDPC; #line 361 "C:/NTDDK/inc/ddk/ntddk.h" struct _KDPC { - CSHORT Type ; - UCHAR Number ; - UCHAR Importance ; - LIST_ENTRY DpcListEntry ; - void (*DeferredRoutine)(struct _KDPC *Dpc , PVOID DeferredContext , PVOID SystemArgument1 , - PVOID SystemArgument2 ) ; - PVOID DeferredContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - PULONG_PTR Lock ; + CSHORT Type; + UCHAR Number; + UCHAR Importance; + LIST_ENTRY DpcListEntry; + void (*DeferredRoutine)(struct _KDPC *Dpc, PVOID DeferredContext, + PVOID SystemArgument1, PVOID SystemArgument2); + PVOID DeferredContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + PULONG_PTR Lock; }; #line 361 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _KDPC KDPC; @@ -318,14 +318,14 @@ typedef struct _KDPC KDPC; typedef struct _KDPC *PKDPC; #line 443 "C:/NTDDK/inc/ddk/ntddk.h" struct _MDL { - struct _MDL *Next ; - CSHORT Size ; - CSHORT MdlFlags ; - struct _EPROCESS *Process ; - PVOID MappedSystemVa ; - PVOID StartVa ; - ULONG ByteCount ; - ULONG ByteOffset ; + struct _MDL *Next; + CSHORT Size; + CSHORT MdlFlags; + struct _EPROCESS *Process; + PVOID MappedSystemVa; + PVOID StartVa; + ULONG ByteCount; + ULONG ByteOffset; }; #line 443 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _MDL MDL; @@ -338,11 +338,11 @@ typedef PVOID PSECURITY_DESCRIPTOR; #line 546 "C:/NTDDK/inc/ddk/ntddk.h" typedef ULONG ACCESS_MASK; #line 27 "C:/NTDDK/inc/pshpack4.h" -#pragma pack(push,4) +#pragma pack(push, 4) #line 618 "C:/NTDDK/inc/ddk/ntddk.h" struct _LUID_AND_ATTRIBUTES { - LUID Luid ; - ULONG Attributes ; + LUID Luid; + ULONG Attributes; }; #line 618 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES; @@ -350,29 +350,29 @@ typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES; #pragma pack(pop) #line 681 "C:/NTDDK/inc/ddk/ntddk.h" struct _PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[1] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[1]; }; #line 681 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _PRIVILEGE_SET PRIVILEGE_SET; #line 735 enum _SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous = 0, - SecurityIdentification = 1, - SecurityImpersonation = 2, - SecurityDelegation = 3 -} ; + SecurityAnonymous = 0, + SecurityIdentification = 1, + SecurityImpersonation = 2, + SecurityDelegation = 3 +}; #line 735 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL; #line 753 "C:/NTDDK/inc/ddk/ntddk.h" typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE; #line 762 "C:/NTDDK/inc/ddk/ntddk.h" struct _SECURITY_QUALITY_OF_SERVICE { - ULONG Length ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode ; - BOOLEAN EffectiveOnly ; + ULONG Length; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; + BOOLEAN EffectiveOnly; }; #line 762 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE; @@ -386,15 +386,15 @@ typedef ULONG_PTR KSPIN_LOCK; typedef KSPIN_LOCK *PKSPIN_LOCK; #line 1088 "C:/NTDDK/inc/ddk/ntddk.h" struct _RTL_QUERY_REGISTRY_TABLE { - NTSTATUS ( __attribute__((__stdcall__)) (*QueryRoutine))(PWSTR ValueName , ULONG ValueType , - PVOID ValueData , ULONG ValueLength , - PVOID Context , PVOID EntryContext ) ; - ULONG Flags ; - PWSTR Name ; - PVOID EntryContext ; - ULONG DefaultType ; - PVOID DefaultData ; - ULONG DefaultLength ; + NTSTATUS(__attribute__((__stdcall__)) (*QueryRoutine)) + (PWSTR ValueName, ULONG ValueType, PVOID ValueData, ULONG ValueLength, + PVOID Context, PVOID EntryContext); + ULONG Flags; + PWSTR Name; + PVOID EntryContext; + ULONG DefaultType; + PVOID DefaultData; + ULONG DefaultLength; }; #line 1088 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _RTL_QUERY_REGISTRY_TABLE RTL_QUERY_REGISTRY_TABLE; @@ -402,13 +402,13 @@ typedef struct _RTL_QUERY_REGISTRY_TABLE RTL_QUERY_REGISTRY_TABLE; typedef struct _RTL_QUERY_REGISTRY_TABLE *PRTL_QUERY_REGISTRY_TABLE; #line 3648 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion____missing_field_name_6 { - NTSTATUS Status ; - PVOID Pointer ; + NTSTATUS Status; + PVOID Pointer; }; #line 3648 "C:/NTDDK/inc/ddk/ntddk.h" struct _IO_STATUS_BLOCK { - union __anonunion____missing_field_name_6 __annonCompField4 ; - ULONG_PTR Information ; + union __anonunion____missing_field_name_6 __annonCompField4; + ULONG_PTR Information; }; #line 3648 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK; @@ -416,132 +416,132 @@ typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK; typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK; #line 3685 enum _FILE_INFORMATION_CLASS { - FileDirectoryInformation = 1, - FileFullDirectoryInformation = 2, - FileBothDirectoryInformation = 3, - FileBasicInformation = 4, - FileStandardInformation = 5, - FileInternalInformation = 6, - FileEaInformation = 7, - FileAccessInformation = 8, - FileNameInformation = 9, - FileRenameInformation = 10, - FileLinkInformation = 11, - FileNamesInformation = 12, - FileDispositionInformation = 13, - FilePositionInformation = 14, - FileFullEaInformation = 15, - FileModeInformation = 16, - FileAlignmentInformation = 17, - FileAllInformation = 18, - FileAllocationInformation = 19, - FileEndOfFileInformation = 20, - FileAlternateNameInformation = 21, - FileStreamInformation = 22, - FilePipeInformation = 23, - FilePipeLocalInformation = 24, - FilePipeRemoteInformation = 25, - FileMailslotQueryInformation = 26, - FileMailslotSetInformation = 27, - FileCompressionInformation = 28, - FileObjectIdInformation = 29, - FileCompletionInformation = 30, - FileMoveClusterInformation = 31, - FileQuotaInformation = 32, - FileReparsePointInformation = 33, - FileNetworkOpenInformation = 34, - FileAttributeTagInformation = 35, - FileTrackingInformation = 36, - FileMaximumInformation = 37 -} ; + FileDirectoryInformation = 1, + FileFullDirectoryInformation = 2, + FileBothDirectoryInformation = 3, + FileBasicInformation = 4, + FileStandardInformation = 5, + FileInternalInformation = 6, + FileEaInformation = 7, + FileAccessInformation = 8, + FileNameInformation = 9, + FileRenameInformation = 10, + FileLinkInformation = 11, + FileNamesInformation = 12, + FileDispositionInformation = 13, + FilePositionInformation = 14, + FileFullEaInformation = 15, + FileModeInformation = 16, + FileAlignmentInformation = 17, + FileAllInformation = 18, + FileAllocationInformation = 19, + FileEndOfFileInformation = 20, + FileAlternateNameInformation = 21, + FileStreamInformation = 22, + FilePipeInformation = 23, + FilePipeLocalInformation = 24, + FilePipeRemoteInformation = 25, + FileMailslotQueryInformation = 26, + FileMailslotSetInformation = 27, + FileCompressionInformation = 28, + FileObjectIdInformation = 29, + FileCompletionInformation = 30, + FileMoveClusterInformation = 31, + FileQuotaInformation = 32, + FileReparsePointInformation = 33, + FileNetworkOpenInformation = 34, + FileAttributeTagInformation = 35, + FileTrackingInformation = 36, + FileMaximumInformation = 37 +}; #line 3685 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS; #line 3731 "C:/NTDDK/inc/ddk/ntddk.h" struct _FILE_BASIC_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + ULONG FileAttributes; }; #line 3731 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION; #line 3739 "C:/NTDDK/inc/ddk/ntddk.h" struct _FILE_STANDARD_INFORMATION { - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG NumberOfLinks ; - BOOLEAN DeletePending ; - BOOLEAN Directory ; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG NumberOfLinks; + BOOLEAN DeletePending; + BOOLEAN Directory; }; #line 3739 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION; #line 3760 "C:/NTDDK/inc/ddk/ntddk.h" struct _FILE_NETWORK_OPEN_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG FileAttributes; }; #line 3760 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _FILE_NETWORK_OPEN_INFORMATION *PFILE_NETWORK_OPEN_INFORMATION; #line 3798 enum _FSINFOCLASS { - FileFsVolumeInformation = 1, - FileFsLabelInformation = 2, - FileFsSizeInformation = 3, - FileFsDeviceInformation = 4, - FileFsAttributeInformation = 5, - FileFsControlInformation = 6, - FileFsFullSizeInformation = 7, - FileFsObjectIdInformation = 8, - FileFsMaximumInformation = 9 -} ; + FileFsVolumeInformation = 1, + FileFsLabelInformation = 2, + FileFsSizeInformation = 3, + FileFsDeviceInformation = 4, + FileFsAttributeInformation = 5, + FileFsControlInformation = 6, + FileFsFullSizeInformation = 7, + FileFsObjectIdInformation = 8, + FileFsMaximumInformation = 9 +}; #line 3798 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _FSINFOCLASS FS_INFORMATION_CLASS; #line 3829 enum _INTERFACE_TYPE { - InterfaceTypeUndefined = -1, - Internal = 0, - Isa = 1, - Eisa = 2, - MicroChannel = 3, - TurboChannel = 4, - PCIBus = 5, - VMEBus = 6, - NuBus = 7, - PCMCIABus = 8, - CBus = 9, - MPIBus = 10, - MPSABus = 11, - ProcessorInternal = 12, - InternalPowerBus = 13, - PNPISABus = 14, - PNPBus = 15, - MaximumInterfaceType = 16 -} ; + InterfaceTypeUndefined = -1, + Internal = 0, + Isa = 1, + Eisa = 2, + MicroChannel = 3, + TurboChannel = 4, + PCIBus = 5, + VMEBus = 6, + NuBus = 7, + PCMCIABus = 8, + CBus = 9, + MPIBus = 10, + MPSABus = 11, + ProcessorInternal = 12, + InternalPowerBus = 13, + PNPISABus = 14, + PNPBus = 15, + MaximumInterfaceType = 16 +}; #line 3829 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _INTERFACE_TYPE INTERFACE_TYPE; #line 3829 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _INTERFACE_TYPE *PINTERFACE_TYPE; #line 4141 "C:/NTDDK/inc/ddk/ntddk.h" struct _KEY_VALUE_FULL_INFORMATION { - ULONG TitleIndex ; - ULONG Type ; - ULONG DataOffset ; - ULONG DataLength ; - ULONG NameLength ; - WCHAR Name[1] ; + ULONG TitleIndex; + ULONG Type; + ULONG DataOffset; + ULONG DataLength; + ULONG NameLength; + WCHAR Name[1]; }; #line 4141 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _KEY_VALUE_FULL_INFORMATION *PKEY_VALUE_FULL_INFORMATION; #line 4294 "C:/NTDDK/inc/ddk/ntddk.h" struct _CLIENT_ID { - HANDLE UniqueProcess ; - HANDLE UniqueThread ; + HANDLE UniqueProcess; + HANDLE UniqueThread; }; #line 4294 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _CLIENT_ID CLIENT_ID; @@ -549,164 +549,161 @@ typedef struct _CLIENT_ID CLIENT_ID; typedef CLIENT_ID *PCLIENT_ID; #line 4587 enum _SYSTEM_POWER_STATE { - PowerSystemUnspecified = 0, - PowerSystemWorking = 1, - PowerSystemSleeping1 = 2, - PowerSystemSleeping2 = 3, - PowerSystemSleeping3 = 4, - PowerSystemHibernate = 5, - PowerSystemShutdown = 6, - PowerSystemMaximum = 7 -} ; + PowerSystemUnspecified = 0, + PowerSystemWorking = 1, + PowerSystemSleeping1 = 2, + PowerSystemSleeping2 = 3, + PowerSystemSleeping3 = 4, + PowerSystemHibernate = 5, + PowerSystemShutdown = 6, + PowerSystemMaximum = 7 +}; #line 4587 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE; #line 4598 enum __anonenum_POWER_ACTION_11 { - PowerActionNone = 0, - PowerActionReserved = 1, - PowerActionSleep = 2, - PowerActionHibernate = 3, - PowerActionShutdown = 4, - PowerActionShutdownReset = 5, - PowerActionShutdownOff = 6, - PowerActionWarmEject = 7 -} ; + PowerActionNone = 0, + PowerActionReserved = 1, + PowerActionSleep = 2, + PowerActionHibernate = 3, + PowerActionShutdown = 4, + PowerActionShutdownReset = 5, + PowerActionShutdownOff = 6, + PowerActionWarmEject = 7 +}; #line 4598 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum __anonenum_POWER_ACTION_11 POWER_ACTION; #line 4609 enum _DEVICE_POWER_STATE { - PowerDeviceUnspecified = 0, - PowerDeviceD0 = 1, - PowerDeviceD1 = 2, - PowerDeviceD2 = 3, - PowerDeviceD3 = 4, - PowerDeviceMaximum = 5 -} ; + PowerDeviceUnspecified = 0, + PowerDeviceD0 = 1, + PowerDeviceD1 = 2, + PowerDeviceD2 = 3, + PowerDeviceD3 = 4, + PowerDeviceMaximum = 5 +}; #line 4609 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _DEVICE_POWER_STATE DEVICE_POWER_STATE; #line 4618 "C:/NTDDK/inc/ddk/ntddk.h" union _POWER_STATE { - SYSTEM_POWER_STATE SystemState ; - DEVICE_POWER_STATE DeviceState ; + SYSTEM_POWER_STATE SystemState; + DEVICE_POWER_STATE DeviceState; }; #line 4618 "C:/NTDDK/inc/ddk/ntddk.h" typedef union _POWER_STATE POWER_STATE; #line 4623 -enum _POWER_STATE_TYPE { - SystemPowerState = 0, - DevicePowerState = 1 -} ; +enum _POWER_STATE_TYPE { SystemPowerState = 0, DevicePowerState = 1 }; #line 4623 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _POWER_STATE_TYPE POWER_STATE_TYPE; #line 6994 "C:/NTDDK/inc/ddk/ntddk.h" struct _KSYSTEM_TIME { - ULONG LowPart ; - LONG High1Time ; - LONG High2Time ; + ULONG LowPart; + LONG High1Time; + LONG High2Time; }; #line 6994 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _KSYSTEM_TIME KSYSTEM_TIME; #line 7850 enum _ALTERNATIVE_ARCHITECTURE_TYPE { - StandardDesign = 0, - NEC98x86 = 1, - EndAlternatives = 2 -} ; + StandardDesign = 0, + NEC98x86 = 1, + EndAlternatives = 2 +}; #line 7850 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE ALTERNATIVE_ARCHITECTURE_TYPE; #line 7899 "C:/NTDDK/inc/ddk/ntddk.h" struct _KUSER_SHARED_DATA { - ULONG volatile TickCountLow ; - ULONG TickCountMultiplier ; - KSYSTEM_TIME volatile InterruptTime ; - KSYSTEM_TIME volatile SystemTime ; - KSYSTEM_TIME volatile TimeZoneBias ; - USHORT ImageNumberLow ; - USHORT ImageNumberHigh ; - WCHAR NtSystemRoot[260] ; - ULONG MaxStackTraceDepth ; - ULONG CryptoExponent ; - ULONG TimeZoneId ; - ULONG Reserved2[8] ; - NT_PRODUCT_TYPE NtProductType ; - BOOLEAN ProductTypeIsValid ; - ULONG NtMajorVersion ; - ULONG NtMinorVersion ; - BOOLEAN ProcessorFeatures[64] ; - ULONG Reserved1 ; - ULONG Reserved3 ; - ULONG volatile TimeSlip ; - ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture ; - LARGE_INTEGER SystemExpirationDate ; - ULONG SuiteMask ; - BOOLEAN KdDebuggerEnabled ; + ULONG volatile TickCountLow; + ULONG TickCountMultiplier; + KSYSTEM_TIME volatile InterruptTime; + KSYSTEM_TIME volatile SystemTime; + KSYSTEM_TIME volatile TimeZoneBias; + USHORT ImageNumberLow; + USHORT ImageNumberHigh; + WCHAR NtSystemRoot[260]; + ULONG MaxStackTraceDepth; + ULONG CryptoExponent; + ULONG TimeZoneId; + ULONG Reserved2[8]; + NT_PRODUCT_TYPE NtProductType; + BOOLEAN ProductTypeIsValid; + ULONG NtMajorVersion; + ULONG NtMinorVersion; + BOOLEAN ProcessorFeatures[64]; + ULONG Reserved1; + ULONG Reserved3; + ULONG volatile TimeSlip; + ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture; + LARGE_INTEGER SystemExpirationDate; + ULONG SuiteMask; + BOOLEAN KdDebuggerEnabled; }; #line 7899 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _KUSER_SHARED_DATA KUSER_SHARED_DATA; #line 8211 "C:/NTDDK/inc/ddk/ntddk.h" typedef PVOID PASSIGNED_RESOURCE; #line 27 "C:/NTDDK/inc/pshpack4.h" -#pragma pack(push,4) +#pragma pack(push, 4) #line 8309 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Generic_16 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; #line 8309 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Port_17 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; #line 8309 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Interrupt_18 { - ULONG Level ; - ULONG Vector ; - ULONG Affinity ; + ULONG Level; + ULONG Vector; + ULONG Affinity; }; #line 8309 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Memory_19 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; #line 8309 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Dma_20 { - ULONG Channel ; - ULONG Port ; - ULONG Reserved1 ; + ULONG Channel; + ULONG Port; + ULONG Reserved1; }; #line 8309 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_DevicePrivate_21 { - ULONG Data[3] ; + ULONG Data[3]; }; #line 8309 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_BusNumber_22 { - ULONG Start ; - ULONG Length ; - ULONG Reserved ; + ULONG Start; + ULONG Length; + ULONG Reserved; }; #line 8309 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_DeviceSpecificData_23 { - ULONG DataSize ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG DataSize; + ULONG Reserved1; + ULONG Reserved2; }; #line 8309 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion_u_15 { - struct __anonstruct_Generic_16 Generic ; - struct __anonstruct_Port_17 Port ; - struct __anonstruct_Interrupt_18 Interrupt ; - struct __anonstruct_Memory_19 Memory ; - struct __anonstruct_Dma_20 Dma ; - struct __anonstruct_DevicePrivate_21 DevicePrivate ; - struct __anonstruct_BusNumber_22 BusNumber ; - struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData ; + struct __anonstruct_Generic_16 Generic; + struct __anonstruct_Port_17 Port; + struct __anonstruct_Interrupt_18 Interrupt; + struct __anonstruct_Memory_19 Memory; + struct __anonstruct_Dma_20 Dma; + struct __anonstruct_DevicePrivate_21 DevicePrivate; + struct __anonstruct_BusNumber_22 BusNumber; + struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData; }; #line 8309 "C:/NTDDK/inc/ddk/ntddk.h" struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { - UCHAR Type ; - UCHAR ShareDisposition ; - USHORT Flags ; - union __anonunion_u_15 u ; + UCHAR Type; + UCHAR ShareDisposition; + USHORT Flags; + union __anonunion_u_15 u; }; #line 8309 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR; @@ -716,18 +713,18 @@ typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR *PCM_PARTIAL_RESOURCE_DESCRIPTOR; #pragma pack(pop) #line 8419 "C:/NTDDK/inc/ddk/ntddk.h" struct _CM_PARTIAL_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; }; #line 8419 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST; #line 8443 "C:/NTDDK/inc/ddk/ntddk.h" struct _CM_FULL_RESOURCE_DESCRIPTOR { - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - CM_PARTIAL_RESOURCE_LIST PartialResourceList ; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; }; #line 8443 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _CM_FULL_RESOURCE_DESCRIPTOR CM_FULL_RESOURCE_DESCRIPTOR; @@ -735,256 +732,256 @@ typedef struct _CM_FULL_RESOURCE_DESCRIPTOR CM_FULL_RESOURCE_DESCRIPTOR; typedef struct _CM_FULL_RESOURCE_DESCRIPTOR *PCM_FULL_RESOURCE_DESCRIPTOR; #line 8454 "C:/NTDDK/inc/ddk/ntddk.h" struct _CM_RESOURCE_LIST { - ULONG Count ; - CM_FULL_RESOURCE_DESCRIPTOR List[1] ; + ULONG Count; + CM_FULL_RESOURCE_DESCRIPTOR List[1]; }; #line 8454 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _CM_RESOURCE_LIST *PCM_RESOURCE_LIST; #line 27 "C:/NTDDK/inc/pshpack1.h" -#pragma pack(push,1) +#pragma pack(push, 1) #line 30 "C:/NTDDK/inc/poppack.h" #pragma pack(pop) #line 8844 "C:/NTDDK/inc/ddk/ntddk.h" struct _CM_FLOPPY_DEVICE_DATA { - USHORT Version ; - USHORT Revision ; - CHAR Size[8] ; - ULONG MaxDensity ; - ULONG MountDensity ; - UCHAR StepRateHeadUnloadTime ; - UCHAR HeadLoadTime ; - UCHAR MotorOffTime ; - UCHAR SectorLengthCode ; - UCHAR SectorPerTrack ; - UCHAR ReadWriteGapLength ; - UCHAR DataTransferLength ; - UCHAR FormatGapLength ; - UCHAR FormatFillCharacter ; - UCHAR HeadSettleTime ; - UCHAR MotorSettleTime ; - UCHAR MaximumTrackValue ; - UCHAR DataTransferRate ; + USHORT Version; + USHORT Revision; + CHAR Size[8]; + ULONG MaxDensity; + ULONG MountDensity; + UCHAR StepRateHeadUnloadTime; + UCHAR HeadLoadTime; + UCHAR MotorOffTime; + UCHAR SectorLengthCode; + UCHAR SectorPerTrack; + UCHAR ReadWriteGapLength; + UCHAR DataTransferLength; + UCHAR FormatGapLength; + UCHAR FormatFillCharacter; + UCHAR HeadSettleTime; + UCHAR MotorSettleTime; + UCHAR MaximumTrackValue; + UCHAR DataTransferRate; }; #line 8844 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _CM_FLOPPY_DEVICE_DATA *PCM_FLOPPY_DEVICE_DATA; #line 8944 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Port_25 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; #line 8944 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Memory_26 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; #line 8944 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Interrupt_27 { - ULONG MinimumVector ; - ULONG MaximumVector ; + ULONG MinimumVector; + ULONG MaximumVector; }; #line 8944 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Dma_28 { - ULONG MinimumChannel ; - ULONG MaximumChannel ; + ULONG MinimumChannel; + ULONG MaximumChannel; }; #line 8944 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Generic_29 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; #line 8944 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_DevicePrivate_30 { - ULONG Data[3] ; + ULONG Data[3]; }; #line 8944 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_BusNumber_31 { - ULONG Length ; - ULONG MinBusNumber ; - ULONG MaxBusNumber ; - ULONG Reserved ; + ULONG Length; + ULONG MinBusNumber; + ULONG MaxBusNumber; + ULONG Reserved; }; #line 8944 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_AssignedResource_32 { - PASSIGNED_RESOURCE AssignedResource ; + PASSIGNED_RESOURCE AssignedResource; }; #line 8944 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_SubAllocateFrom_33 { - UCHAR Type ; - UCHAR Reserved[3] ; - PASSIGNED_RESOURCE AssignedResource ; - PHYSICAL_ADDRESS Transformation ; + UCHAR Type; + UCHAR Reserved[3]; + PASSIGNED_RESOURCE AssignedResource; + PHYSICAL_ADDRESS Transformation; }; #line 8944 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_ConfigData_34 { - ULONG Priority ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG Priority; + ULONG Reserved1; + ULONG Reserved2; }; #line 8944 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion_u_24 { - struct __anonstruct_Port_25 Port ; - struct __anonstruct_Memory_26 Memory ; - struct __anonstruct_Interrupt_27 Interrupt ; - struct __anonstruct_Dma_28 Dma ; - struct __anonstruct_Generic_29 Generic ; - struct __anonstruct_DevicePrivate_30 DevicePrivate ; - struct __anonstruct_BusNumber_31 BusNumber ; - struct __anonstruct_AssignedResource_32 AssignedResource ; - struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom ; - struct __anonstruct_ConfigData_34 ConfigData ; + struct __anonstruct_Port_25 Port; + struct __anonstruct_Memory_26 Memory; + struct __anonstruct_Interrupt_27 Interrupt; + struct __anonstruct_Dma_28 Dma; + struct __anonstruct_Generic_29 Generic; + struct __anonstruct_DevicePrivate_30 DevicePrivate; + struct __anonstruct_BusNumber_31 BusNumber; + struct __anonstruct_AssignedResource_32 AssignedResource; + struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom; + struct __anonstruct_ConfigData_34 ConfigData; }; #line 8944 "C:/NTDDK/inc/ddk/ntddk.h" struct _IO_RESOURCE_DESCRIPTOR { - UCHAR Option ; - UCHAR Type ; - UCHAR ShareDisposition ; - UCHAR Spare1 ; - USHORT Flags ; - USHORT Spare2 ; - union __anonunion_u_24 u ; + UCHAR Option; + UCHAR Type; + UCHAR ShareDisposition; + UCHAR Spare1; + USHORT Flags; + USHORT Spare2; + union __anonunion_u_24 u; }; #line 8944 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR; #line 9027 "C:/NTDDK/inc/ddk/ntddk.h" struct _IO_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - IO_RESOURCE_DESCRIPTOR Descriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + IO_RESOURCE_DESCRIPTOR Descriptors[1]; }; #line 9027 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _IO_RESOURCE_LIST IO_RESOURCE_LIST; #line 9036 "C:/NTDDK/inc/ddk/ntddk.h" struct _IO_RESOURCE_REQUIREMENTS_LIST { - ULONG ListSize ; - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - ULONG SlotNumber ; - ULONG Reserved[3] ; - ULONG AlternativeLists ; - IO_RESOURCE_LIST List[1] ; + ULONG ListSize; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + ULONG SlotNumber; + ULONG Reserved[3]; + ULONG AlternativeLists; + IO_RESOURCE_LIST List[1]; }; #line 9036 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _IO_RESOURCE_REQUIREMENTS_LIST *PIO_RESOURCE_REQUIREMENTS_LIST; #line 9111 enum _CONFIGURATION_TYPE { - ArcSystem = 0, - CentralProcessor = 1, - FloatingPointProcessor = 2, - PrimaryIcache = 3, - PrimaryDcache = 4, - SecondaryIcache = 5, - SecondaryDcache = 6, - SecondaryCache = 7, - EisaAdapter = 8, - TcAdapter = 9, - ScsiAdapter = 10, - DtiAdapter = 11, - MultiFunctionAdapter = 12, - DiskController = 13, - TapeController = 14, - CdromController = 15, - WormController = 16, - SerialController = 17, - NetworkController = 18, - DisplayController = 19, - ParallelController = 20, - PointerController = 21, - KeyboardController = 22, - AudioController = 23, - OtherController = 24, - DiskPeripheral = 25, - FloppyDiskPeripheral = 26, - TapePeripheral = 27, - ModemPeripheral = 28, - MonitorPeripheral = 29, - PrinterPeripheral = 30, - PointerPeripheral = 31, - KeyboardPeripheral = 32, - TerminalPeripheral = 33, - OtherPeripheral = 34, - LinePeripheral = 35, - NetworkPeripheral = 36, - SystemMemory = 37, - DockingInformation = 38, - RealModeIrqRoutingTable = 39, - MaximumType = 40 -} ; + ArcSystem = 0, + CentralProcessor = 1, + FloatingPointProcessor = 2, + PrimaryIcache = 3, + PrimaryDcache = 4, + SecondaryIcache = 5, + SecondaryDcache = 6, + SecondaryCache = 7, + EisaAdapter = 8, + TcAdapter = 9, + ScsiAdapter = 10, + DtiAdapter = 11, + MultiFunctionAdapter = 12, + DiskController = 13, + TapeController = 14, + CdromController = 15, + WormController = 16, + SerialController = 17, + NetworkController = 18, + DisplayController = 19, + ParallelController = 20, + PointerController = 21, + KeyboardController = 22, + AudioController = 23, + OtherController = 24, + DiskPeripheral = 25, + FloppyDiskPeripheral = 26, + TapePeripheral = 27, + ModemPeripheral = 28, + MonitorPeripheral = 29, + PrinterPeripheral = 30, + PointerPeripheral = 31, + KeyboardPeripheral = 32, + TerminalPeripheral = 33, + OtherPeripheral = 34, + LinePeripheral = 35, + NetworkPeripheral = 36, + SystemMemory = 37, + DockingInformation = 38, + RealModeIrqRoutingTable = 39, + MaximumType = 40 +}; #line 9111 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _CONFIGURATION_TYPE CONFIGURATION_TYPE; #line 9111 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _CONFIGURATION_TYPE *PCONFIGURATION_TYPE; #line 9170 enum _KWAIT_REASON { - Executive = 0, - FreePage = 1, - PageIn = 2, - PoolAllocation = 3, - DelayExecution = 4, - Suspended = 5, - UserRequest = 6, - WrExecutive = 7, - WrFreePage = 8, - WrPageIn = 9, - WrPoolAllocation = 10, - WrDelayExecution = 11, - WrSuspended = 12, - WrUserRequest = 13, - WrEventPair = 14, - WrQueue = 15, - WrLpcReceive = 16, - WrLpcReply = 17, - WrVirtualMemory = 18, - WrPageOut = 19, - WrRendezvous = 20, - Spare2 = 21, - Spare3 = 22, - Spare4 = 23, - Spare5 = 24, - Spare6 = 25, - WrKernel = 26, - MaximumWaitReason = 27 -} ; + Executive = 0, + FreePage = 1, + PageIn = 2, + PoolAllocation = 3, + DelayExecution = 4, + Suspended = 5, + UserRequest = 6, + WrExecutive = 7, + WrFreePage = 8, + WrPageIn = 9, + WrPoolAllocation = 10, + WrDelayExecution = 11, + WrSuspended = 12, + WrUserRequest = 13, + WrEventPair = 14, + WrQueue = 15, + WrLpcReceive = 16, + WrLpcReply = 17, + WrVirtualMemory = 18, + WrPageOut = 19, + WrRendezvous = 20, + Spare2 = 21, + Spare3 = 22, + Spare4 = 23, + Spare5 = 24, + Spare6 = 25, + WrKernel = 26, + MaximumWaitReason = 27 +}; #line 9170 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _KWAIT_REASON KWAIT_REASON; #line 9207 "C:/NTDDK/inc/ddk/ntddk.h" struct _DISPATCHER_HEADER { - UCHAR Type ; - UCHAR Absolute ; - UCHAR Size ; - UCHAR Inserted ; - LONG SignalState ; - LIST_ENTRY WaitListHead ; + UCHAR Type; + UCHAR Absolute; + UCHAR Size; + UCHAR Inserted; + LONG SignalState; + LIST_ENTRY WaitListHead; }; #line 9207 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _DISPATCHER_HEADER DISPATCHER_HEADER; #line 9244 "C:/NTDDK/inc/ddk/ntddk.h" struct _KDEVICE_QUEUE { - CSHORT Type ; - CSHORT Size ; - LIST_ENTRY DeviceListHead ; - KSPIN_LOCK Lock ; - BOOLEAN Busy ; + CSHORT Type; + CSHORT Size; + LIST_ENTRY DeviceListHead; + KSPIN_LOCK Lock; + BOOLEAN Busy; }; #line 9244 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _KDEVICE_QUEUE KDEVICE_QUEUE; #line 9252 "C:/NTDDK/inc/ddk/ntddk.h" struct _KDEVICE_QUEUE_ENTRY { - LIST_ENTRY DeviceListEntry ; - ULONG SortKey ; - BOOLEAN Inserted ; + LIST_ENTRY DeviceListEntry; + ULONG SortKey; + BOOLEAN Inserted; }; #line 9252 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _KDEVICE_QUEUE_ENTRY KDEVICE_QUEUE_ENTRY; #line 9263 "C:/NTDDK/inc/ddk/ntddk.h" struct _KEVENT { - DISPATCHER_HEADER Header ; + DISPATCHER_HEADER Header; }; #line 9263 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _KEVENT KEVENT; @@ -994,8 +991,8 @@ typedef struct _KEVENT *PKEVENT; typedef struct _KEVENT *PRKEVENT; #line 9294 "C:/NTDDK/inc/ddk/ntddk.h" struct _KSEMAPHORE { - DISPATCHER_HEADER Header ; - LONG Limit ; + DISPATCHER_HEADER Header; + LONG Limit; }; #line 9294 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _KSEMAPHORE KSEMAPHORE; @@ -1005,43 +1002,43 @@ typedef struct _KSEMAPHORE *PKSEMAPHORE; typedef struct _KSEMAPHORE *PRKSEMAPHORE; #line 10057 enum _MEMORY_CACHING_TYPE { - MmNonCached = 0, - MmCached = 1, - MmWriteCombined = 2, - MmHardwareCoherentCached = 3, - MmNonCachedUnordered = 4, - MmUSWCCached = 5, - MmMaximumCacheType = 6 -} ; + MmNonCached = 0, + MmCached = 1, + MmWriteCombined = 2, + MmHardwareCoherentCached = 3, + MmNonCachedUnordered = 4, + MmUSWCCached = 5, + MmMaximumCacheType = 6 +}; #line 10057 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE; #line 10115 enum _POOL_TYPE { - NonPagedPool = 0, - PagedPool = 1, - NonPagedPoolMustSucceed = 2, - DontUseThisType = 3, - NonPagedPoolCacheAligned = 4, - PagedPoolCacheAligned = 5, - NonPagedPoolCacheAlignedMustS = 6, - MaxPoolType = 7, - NonPagedPoolSession = 32, - PagedPoolSession = 33, - NonPagedPoolMustSucceedSession = 34, - DontUseThisTypeSession = 35, - NonPagedPoolCacheAlignedSession = 36, - PagedPoolCacheAlignedSession = 37, - NonPagedPoolCacheAlignedMustSSession = 38 -} ; + NonPagedPool = 0, + PagedPool = 1, + NonPagedPoolMustSucceed = 2, + DontUseThisType = 3, + NonPagedPoolCacheAligned = 4, + PagedPoolCacheAligned = 5, + NonPagedPoolCacheAlignedMustS = 6, + MaxPoolType = 7, + NonPagedPoolSession = 32, + PagedPoolSession = 33, + NonPagedPoolMustSucceedSession = 34, + DontUseThisTypeSession = 35, + NonPagedPoolCacheAlignedSession = 36, + PagedPoolCacheAlignedSession = 37, + NonPagedPoolCacheAlignedMustSSession = 38 +}; #line 10115 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _POOL_TYPE POOL_TYPE; #line 10247 "C:/NTDDK/inc/ddk/ntddk.h" struct _FAST_MUTEX { - LONG Count ; - PKTHREAD Owner ; - ULONG Contention ; - KEVENT Event ; - ULONG OldIrql ; + LONG Count; + PKTHREAD Owner; + ULONG Contention; + KEVENT Event; + ULONG OldIrql; }; #line 10247 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _FAST_MUTEX FAST_MUTEX; @@ -1049,44 +1046,44 @@ typedef struct _FAST_MUTEX FAST_MUTEX; typedef struct _FAST_MUTEX *PFAST_MUTEX; #line 10588 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion____missing_field_name_35 { - ULONG AllocateMisses ; - ULONG AllocateHits ; + ULONG AllocateMisses; + ULONG AllocateHits; }; #line 10588 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion____missing_field_name_36 { - ULONG FreeMisses ; - ULONG FreeHits ; + ULONG FreeMisses; + ULONG FreeHits; }; #line 10588 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion____missing_field_name_37 { - ULONG LastAllocateMisses ; - ULONG LastAllocateHits ; + ULONG LastAllocateMisses; + ULONG LastAllocateHits; }; #line 10588 "C:/NTDDK/inc/ddk/ntddk.h" struct _GENERAL_LOOKASIDE { - SLIST_HEADER ListHead ; - USHORT Depth ; - USHORT MaximumDepth ; - ULONG TotalAllocates ; - union __anonunion____missing_field_name_35 __annonCompField7 ; - ULONG TotalFrees ; - union __anonunion____missing_field_name_36 __annonCompField8 ; - POOL_TYPE Type ; - ULONG Tag ; - ULONG Size ; - PVOID (*Allocate)(POOL_TYPE PoolType , SIZE_T NumberOfBytes , ULONG Tag ) ; - void (*Free)(PVOID Buffer ) ; - LIST_ENTRY ListEntry ; - ULONG LastTotalAllocates ; - union __anonunion____missing_field_name_37 __annonCompField9 ; - ULONG Future[2] ; + SLIST_HEADER ListHead; + USHORT Depth; + USHORT MaximumDepth; + ULONG TotalAllocates; + union __anonunion____missing_field_name_35 __annonCompField7; + ULONG TotalFrees; + union __anonunion____missing_field_name_36 __annonCompField8; + POOL_TYPE Type; + ULONG Tag; + ULONG Size; + PVOID (*Allocate)(POOL_TYPE PoolType, SIZE_T NumberOfBytes, ULONG Tag); + void (*Free)(PVOID Buffer); + LIST_ENTRY ListEntry; + ULONG LastTotalAllocates; + union __anonunion____missing_field_name_37 __annonCompField9; + ULONG Future[2]; }; #line 10588 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _GENERAL_LOOKASIDE GENERAL_LOOKASIDE; #line 10619 "C:/NTDDK/inc/ddk/ntddk.h" struct _NPAGED_LOOKASIDE_LIST { - GENERAL_LOOKASIDE L ; - KSPIN_LOCK Lock ; + GENERAL_LOOKASIDE L; + KSPIN_LOCK Lock; }; #line 10619 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _NPAGED_LOOKASIDE_LIST *PNPAGED_LOOKASIDE_LIST; @@ -1094,13 +1091,13 @@ typedef struct _NPAGED_LOOKASIDE_LIST *PNPAGED_LOOKASIDE_LIST; typedef ULONG_PTR ERESOURCE_THREAD; #line 11159 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion____missing_field_name_38 { - LONG OwnerCount ; - ULONG TableSize ; + LONG OwnerCount; + ULONG TableSize; }; #line 11159 "C:/NTDDK/inc/ddk/ntddk.h" struct _OWNER_ENTRY { - ERESOURCE_THREAD OwnerThread ; - union __anonunion____missing_field_name_38 __annonCompField10 ; + ERESOURCE_THREAD OwnerThread; + union __anonunion____missing_field_name_38 __annonCompField10; }; #line 11159 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _OWNER_ENTRY OWNER_ENTRY; @@ -1108,38 +1105,38 @@ typedef struct _OWNER_ENTRY OWNER_ENTRY; typedef struct _OWNER_ENTRY *POWNER_ENTRY; #line 11168 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion____missing_field_name_39 { - PVOID Address ; - ULONG_PTR CreatorBackTraceIndex ; + PVOID Address; + ULONG_PTR CreatorBackTraceIndex; }; #line 11168 "C:/NTDDK/inc/ddk/ntddk.h" struct _ERESOURCE { - LIST_ENTRY SystemResourcesList ; - POWNER_ENTRY OwnerTable ; - SHORT ActiveCount ; - USHORT Flag ; - PKSEMAPHORE SharedWaiters ; - PKEVENT ExclusiveWaiters ; - OWNER_ENTRY OwnerThreads[2] ; - ULONG ContentionCount ; - USHORT NumberOfSharedWaiters ; - USHORT NumberOfExclusiveWaiters ; - union __anonunion____missing_field_name_39 __annonCompField11 ; - KSPIN_LOCK SpinLock ; + LIST_ENTRY SystemResourcesList; + POWNER_ENTRY OwnerTable; + SHORT ActiveCount; + USHORT Flag; + PKSEMAPHORE SharedWaiters; + PKEVENT ExclusiveWaiters; + OWNER_ENTRY OwnerThreads[2]; + ULONG ContentionCount; + USHORT NumberOfSharedWaiters; + USHORT NumberOfExclusiveWaiters; + union __anonunion____missing_field_name_39 __annonCompField11; + KSPIN_LOCK SpinLock; }; #line 11884 enum _LOCK_OPERATION { - IoReadAccess = 0, - IoWriteAccess = 1, - IoModifyAccess = 2 -} ; + IoReadAccess = 0, + IoWriteAccess = 1, + IoModifyAccess = 2 +}; #line 11884 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _LOCK_OPERATION LOCK_OPERATION; #line 11970 enum _MM_PAGE_PRIORITY { - LowPagePriority = 0, - NormalPagePriority = 16, - HighPagePriority = 32 -} ; + LowPagePriority = 0, + NormalPagePriority = 16, + HighPagePriority = 32 +}; #line 11970 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY; #line 12399 @@ -1150,44 +1147,44 @@ struct _DRIVER_OBJECT; struct _DRIVER_OBJECT; #line 12426 "C:/NTDDK/inc/ddk/ntddk.h" struct _SECURITY_SUBJECT_CONTEXT { - PACCESS_TOKEN ClientToken ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - PACCESS_TOKEN PrimaryToken ; - PVOID ProcessAuditId ; + PACCESS_TOKEN ClientToken; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + PACCESS_TOKEN PrimaryToken; + PVOID ProcessAuditId; }; #line 12426 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _SECURITY_SUBJECT_CONTEXT SECURITY_SUBJECT_CONTEXT; #line 12448 "C:/NTDDK/inc/ddk/ntddk.h" struct _INITIAL_PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[3] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[3]; }; #line 12448 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _INITIAL_PRIVILEGE_SET INITIAL_PRIVILEGE_SET; #line 12462 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion_Privileges_40 { - INITIAL_PRIVILEGE_SET InitialPrivilegeSet ; - PRIVILEGE_SET PrivilegeSet ; + INITIAL_PRIVILEGE_SET InitialPrivilegeSet; + PRIVILEGE_SET PrivilegeSet; }; #line 12462 "C:/NTDDK/inc/ddk/ntddk.h" struct _ACCESS_STATE { - LUID OperationID ; - BOOLEAN SecurityEvaluated ; - BOOLEAN GenerateAudit ; - BOOLEAN GenerateOnClose ; - BOOLEAN PrivilegesAllocated ; - ULONG Flags ; - ACCESS_MASK RemainingDesiredAccess ; - ACCESS_MASK PreviouslyGrantedAccess ; - ACCESS_MASK OriginalDesiredAccess ; - SECURITY_SUBJECT_CONTEXT SubjectSecurityContext ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - PVOID AuxData ; - union __anonunion_Privileges_40 Privileges ; - BOOLEAN AuditPrivileges ; - UNICODE_STRING ObjectName ; - UNICODE_STRING ObjectTypeName ; + LUID OperationID; + BOOLEAN SecurityEvaluated; + BOOLEAN GenerateAudit; + BOOLEAN GenerateOnClose; + BOOLEAN PrivilegesAllocated; + ULONG Flags; + ACCESS_MASK RemainingDesiredAccess; + ACCESS_MASK PreviouslyGrantedAccess; + ACCESS_MASK OriginalDesiredAccess; + SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PVOID AuxData; + union __anonunion_Privileges_40 Privileges; + BOOLEAN AuditPrivileges; + UNICODE_STRING ObjectName; + UNICODE_STRING ObjectTypeName; }; #line 12462 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _ACCESS_STATE *PACCESS_STATE; @@ -1218,131 +1215,158 @@ struct _SCSI_REQUEST_BLOCK; #line 12913 struct _SCSI_REQUEST_BLOCK; #line 12979 "C:/NTDDK/inc/ddk/ntddk.h" -typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ); +typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp); #line 13289 struct _COMPRESSED_DATA_INFO; #line 13289 struct _COMPRESSED_DATA_INFO; #line 13350 "C:/NTDDK/inc/ddk/ntddk.h" struct _FAST_IO_DISPATCH { - ULONG SizeOfFastIoDispatch ; - BOOLEAN (*FastIoCheckIfPossible)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , - BOOLEAN CheckForReadOperation , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryBasicInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_BASIC_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryStandardInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_STANDARD_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoLock)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - BOOLEAN FailImmediately , BOOLEAN ExclusiveLock , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockSingle)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAll)(struct _FILE_OBJECT *FileObject , PEPROCESS ProcessId , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAllByKey)(struct _FILE_OBJECT *FileObject , PVOID ProcessId , - ULONG Key , PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoDeviceControl)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , ULONG IoControlCode , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice , struct _DEVICE_OBJECT *TargetDevice ) ; - BOOLEAN (*FastIoQueryNetworkOpenInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - struct _FILE_NETWORK_OPEN_INFORMATION *Buffer , - struct _IO_STATUS_BLOCK *IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForModWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER EndingOffset , - struct _ERESOURCE **ResourceToRelease , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadComplete)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*PrepareMdlWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteComplete)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoReadCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , PMDL *MdlChain , - PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWriteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , - PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadCompleteCompressed)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteCompleteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryOpen)(struct _IRP *Irp , PFILE_NETWORK_OPEN_INFORMATION NetworkInformation , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForModWrite)(struct _FILE_OBJECT *FileObject , struct _ERESOURCE *ResourceToRelease , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; + ULONG SizeOfFastIoDispatch; + BOOLEAN(*FastIoCheckIfPossible) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, BOOLEAN CheckForReadOperation, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryBasicInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_BASIC_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryStandardInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_STANDARD_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoLock) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + BOOLEAN FailImmediately, BOOLEAN ExclusiveLock, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockSingle) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAll) + (struct _FILE_OBJECT *FileObject, PEPROCESS ProcessId, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAllByKey) + (struct _FILE_OBJECT *FileObject, PVOID ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoDeviceControl) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, PVOID InputBuffer, + ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength, + ULONG IoControlCode, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice, + struct _DEVICE_OBJECT *TargetDevice); + BOOLEAN(*FastIoQueryNetworkOpenInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + struct _FILE_NETWORK_OPEN_INFORMATION *Buffer, + struct _IO_STATUS_BLOCK *IoStatus, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForModWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER EndingOffset, + struct _ERESOURCE **ResourceToRelease, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadComplete) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*PrepareMdlWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteComplete) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoReadCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWriteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryOpen) + (struct _IRP *Irp, PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForModWrite) + (struct _FILE_OBJECT *FileObject, struct _ERESOURCE *ResourceToRelease, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); }; #line 13350 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH; #line 13386 enum _IO_ALLOCATION_ACTION { - KeepObject = 1, - DeallocateObject = 2, - DeallocateObjectKeepRegisters = 3 -} ; + KeepObject = 1, + DeallocateObject = 2, + DeallocateObjectKeepRegisters = 3 +}; #line 13386 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION; #line 13410 "C:/NTDDK/inc/ddk/ntddk.h" struct _IO_SECURITY_CONTEXT { - PSECURITY_QUALITY_OF_SERVICE SecurityQos ; - PACCESS_STATE AccessState ; - ACCESS_MASK DesiredAccess ; - ULONG FullCreateOptions ; + PSECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_STATE AccessState; + ACCESS_MASK DesiredAccess; + ULONG FullCreateOptions; }; #line 13410 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT; #line 13434 "C:/NTDDK/inc/ddk/ntddk.h" struct _VPB { - CSHORT Type ; - CSHORT Size ; - USHORT Flags ; - USHORT VolumeLabelLength ; - struct _DEVICE_OBJECT *DeviceObject ; - struct _DEVICE_OBJECT *RealDevice ; - ULONG SerialNumber ; - ULONG ReferenceCount ; - WCHAR VolumeLabel[(32U * sizeof(WCHAR )) / sizeof(WCHAR )] ; + CSHORT Type; + CSHORT Size; + USHORT Flags; + USHORT VolumeLabelLength; + struct _DEVICE_OBJECT *DeviceObject; + struct _DEVICE_OBJECT *RealDevice; + ULONG SerialNumber; + ULONG ReferenceCount; + WCHAR VolumeLabel[(32U * sizeof(WCHAR)) / sizeof(WCHAR)]; }; #line 13434 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _VPB *PVPB; #line 13491 "C:/NTDDK/inc/ddk/ntddk.h" struct _WAIT_CONTEXT_BLOCK { - KDEVICE_QUEUE_ENTRY WaitQueueEntry ; - IO_ALLOCATION_ACTION (*DeviceRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp , - PVOID MapRegisterBase , PVOID Context ) ; - PVOID DeviceContext ; - ULONG NumberOfMapRegisters ; - PVOID DeviceObject ; - PVOID CurrentIrp ; - PKDPC BufferChainingDpc ; + KDEVICE_QUEUE_ENTRY WaitQueueEntry; + IO_ALLOCATION_ACTION(*DeviceRoutine) + (struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp, PVOID MapRegisterBase, + PVOID Context); + PVOID DeviceContext; + ULONG NumberOfMapRegisters; + PVOID DeviceObject; + PVOID CurrentIrp; + PKDPC BufferChainingDpc; }; #line 13491 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _WAIT_CONTEXT_BLOCK WAIT_CONTEXT_BLOCK; #line 13537 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion_Queue_43 { - LIST_ENTRY ListEntry ; - WAIT_CONTEXT_BLOCK Wcb ; + LIST_ENTRY ListEntry; + WAIT_CONTEXT_BLOCK Wcb; }; #line 13537 struct _DEVOBJ_EXTENSION; @@ -1350,31 +1374,31 @@ struct _DEVOBJ_EXTENSION; struct _DEVOBJ_EXTENSION; #line 13537 "C:/NTDDK/inc/ddk/ntddk.h" struct _DEVICE_OBJECT { - CSHORT Type ; - USHORT Size ; - LONG ReferenceCount ; - struct _DRIVER_OBJECT *DriverObject ; - struct _DEVICE_OBJECT *NextDevice ; - struct _DEVICE_OBJECT *AttachedDevice ; - struct _IRP *CurrentIrp ; - PIO_TIMER Timer ; - ULONG Flags ; - ULONG Characteristics ; - PVPB Vpb ; - PVOID DeviceExtension ; - ULONG DeviceType ; - CCHAR StackSize ; - union __anonunion_Queue_43 Queue ; - ULONG AlignmentRequirement ; - KDEVICE_QUEUE DeviceQueue ; - KDPC Dpc ; - ULONG ActiveThreadCount ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - KEVENT DeviceLock ; - USHORT SectorSize ; - USHORT Spare1 ; - struct _DEVOBJ_EXTENSION *DeviceObjectExtension ; - PVOID Reserved ; + CSHORT Type; + USHORT Size; + LONG ReferenceCount; + struct _DRIVER_OBJECT *DriverObject; + struct _DEVICE_OBJECT *NextDevice; + struct _DEVICE_OBJECT *AttachedDevice; + struct _IRP *CurrentIrp; + PIO_TIMER Timer; + ULONG Flags; + ULONG Characteristics; + PVPB Vpb; + PVOID DeviceExtension; + ULONG DeviceType; + CCHAR StackSize; + union __anonunion_Queue_43 Queue; + ULONG AlignmentRequirement; + KDEVICE_QUEUE DeviceQueue; + KDPC Dpc; + ULONG ActiveThreadCount; + PSECURITY_DESCRIPTOR SecurityDescriptor; + KEVENT DeviceLock; + USHORT SectorSize; + USHORT Spare1; + struct _DEVOBJ_EXTENSION *DeviceObjectExtension; + PVOID Reserved; }; #line 13537 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _DEVICE_OBJECT DEVICE_OBJECT; @@ -1382,36 +1406,39 @@ typedef struct _DEVICE_OBJECT DEVICE_OBJECT; typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; #line 13580 "C:/NTDDK/inc/ddk/ntddk.h" struct _DEVOBJ_EXTENSION { - CSHORT Type ; - USHORT Size ; - PDEVICE_OBJECT DeviceObject ; + CSHORT Type; + USHORT Size; + PDEVICE_OBJECT DeviceObject; }; #line 13608 "C:/NTDDK/inc/ddk/ntddk.h" struct _DRIVER_EXTENSION { - struct _DRIVER_OBJECT *DriverObject ; - NTSTATUS (*AddDevice)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ; - ULONG Count ; - UNICODE_STRING ServiceKeyName ; + struct _DRIVER_OBJECT *DriverObject; + NTSTATUS(*AddDevice) + (struct _DRIVER_OBJECT *DriverObject, + struct _DEVICE_OBJECT *PhysicalDeviceObject); + ULONG Count; + UNICODE_STRING ServiceKeyName; }; #line 13608 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _DRIVER_EXTENSION *PDRIVER_EXTENSION; #line 13645 "C:/NTDDK/inc/ddk/ntddk.h" struct _DRIVER_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - ULONG Flags ; - PVOID DriverStart ; - ULONG DriverSize ; - PVOID DriverSection ; - PDRIVER_EXTENSION DriverExtension ; - UNICODE_STRING DriverName ; - PUNICODE_STRING HardwareDatabase ; - PFAST_IO_DISPATCH FastIoDispatch ; - NTSTATUS (*DriverInit)(struct _DRIVER_OBJECT *DriverObject , PUNICODE_STRING RegistryPath ) ; - void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject ) ; - PDRIVER_DISPATCH MajorFunction[28] ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + PVOID DriverStart; + ULONG DriverSize; + PVOID DriverSection; + PDRIVER_EXTENSION DriverExtension; + UNICODE_STRING DriverName; + PUNICODE_STRING HardwareDatabase; + PFAST_IO_DISPATCH FastIoDispatch; + NTSTATUS(*DriverInit) + (struct _DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath); + void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject); + PDRIVER_DISPATCH MajorFunction[28]; }; #line 13645 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _DRIVER_OBJECT DRIVER_OBJECT; @@ -1419,9 +1446,9 @@ typedef struct _DRIVER_OBJECT DRIVER_OBJECT; typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; #line 13715 "C:/NTDDK/inc/ddk/ntddk.h" struct _SECTION_OBJECT_POINTERS { - PVOID DataSectionObject ; - PVOID SharedCacheMap ; - PVOID ImageSectionObject ; + PVOID DataSectionObject; + PVOID SharedCacheMap; + PVOID ImageSectionObject; }; #line 13715 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS; @@ -1429,68 +1456,68 @@ typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS; typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS; #line 13726 "C:/NTDDK/inc/ddk/ntddk.h" struct _IO_COMPLETION_CONTEXT { - PVOID Port ; - PVOID Key ; + PVOID Port; + PVOID Key; }; #line 13726 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _IO_COMPLETION_CONTEXT *PIO_COMPLETION_CONTEXT; #line 13759 "C:/NTDDK/inc/ddk/ntddk.h" struct _FILE_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - PVPB Vpb ; - PVOID FsContext ; - PVOID FsContext2 ; - PSECTION_OBJECT_POINTERS SectionObjectPointer ; - PVOID PrivateCacheMap ; - NTSTATUS FinalStatus ; - struct _FILE_OBJECT *RelatedFileObject ; - BOOLEAN LockOperation ; - BOOLEAN DeletePending ; - BOOLEAN ReadAccess ; - BOOLEAN WriteAccess ; - BOOLEAN DeleteAccess ; - BOOLEAN SharedRead ; - BOOLEAN SharedWrite ; - BOOLEAN SharedDelete ; - ULONG Flags ; - UNICODE_STRING FileName ; - LARGE_INTEGER CurrentByteOffset ; - ULONG Waiters ; - ULONG Busy ; - PVOID LastLock ; - KEVENT Lock ; - KEVENT Event ; - PIO_COMPLETION_CONTEXT CompletionContext ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + PVPB Vpb; + PVOID FsContext; + PVOID FsContext2; + PSECTION_OBJECT_POINTERS SectionObjectPointer; + PVOID PrivateCacheMap; + NTSTATUS FinalStatus; + struct _FILE_OBJECT *RelatedFileObject; + BOOLEAN LockOperation; + BOOLEAN DeletePending; + BOOLEAN ReadAccess; + BOOLEAN WriteAccess; + BOOLEAN DeleteAccess; + BOOLEAN SharedRead; + BOOLEAN SharedWrite; + BOOLEAN SharedDelete; + ULONG Flags; + UNICODE_STRING FileName; + LARGE_INTEGER CurrentByteOffset; + ULONG Waiters; + ULONG Busy; + PVOID LastLock; + KEVENT Lock; + KEVENT Event; + PIO_COMPLETION_CONTEXT CompletionContext; }; #line 13788 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _FILE_OBJECT *PFILE_OBJECT; #line 13828 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion_AssociatedIrp_44 { - struct _IRP *MasterIrp ; - LONG IrpCount ; - PVOID SystemBuffer ; + struct _IRP *MasterIrp; + LONG IrpCount; + PVOID SystemBuffer; }; #line 13828 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_AsynchronousParameters_46 { - void ( __attribute__((__stdcall__)) (*UserApcRoutine))(PVOID ApcContext , PIO_STATUS_BLOCK IoStatusBlock , - ULONG Reserved ) ; - PVOID UserApcContext ; + void(__attribute__((__stdcall__)) (*UserApcRoutine))( + PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG Reserved); + PVOID UserApcContext; }; #line 13828 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion_Overlay_45 { - struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters ; - LARGE_INTEGER AllocationSize ; + struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters; + LARGE_INTEGER AllocationSize; }; #line 13828 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct____missing_field_name_50 { - PVOID DriverContext[4] ; + PVOID DriverContext[4]; }; #line 13828 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion____missing_field_name_49 { - KDEVICE_QUEUE_ENTRY DeviceQueueEntry ; - struct __anonstruct____missing_field_name_50 __annonCompField14 ; + KDEVICE_QUEUE_ENTRY DeviceQueueEntry; + struct __anonstruct____missing_field_name_50 __annonCompField14; }; #line 13828 struct _IO_STACK_LOCATION; @@ -1498,51 +1525,51 @@ struct _IO_STACK_LOCATION; struct _IO_STACK_LOCATION; #line 13828 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion____missing_field_name_52 { - struct _IO_STACK_LOCATION *CurrentStackLocation ; - ULONG PacketType ; + struct _IO_STACK_LOCATION *CurrentStackLocation; + ULONG PacketType; }; #line 13828 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct____missing_field_name_51 { - LIST_ENTRY ListEntry ; - union __anonunion____missing_field_name_52 __annonCompField16 ; + LIST_ENTRY ListEntry; + union __anonunion____missing_field_name_52 __annonCompField16; }; #line 13828 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Overlay_48 { - union __anonunion____missing_field_name_49 __annonCompField15 ; - PETHREAD Thread ; - PCHAR AuxiliaryBuffer ; - struct __anonstruct____missing_field_name_51 __annonCompField17 ; - PFILE_OBJECT OriginalFileObject ; + union __anonunion____missing_field_name_49 __annonCompField15; + PETHREAD Thread; + PCHAR AuxiliaryBuffer; + struct __anonstruct____missing_field_name_51 __annonCompField17; + PFILE_OBJECT OriginalFileObject; }; #line 13828 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion_Tail_47 { - struct __anonstruct_Overlay_48 Overlay ; - KAPC Apc ; - PVOID CompletionKey ; + struct __anonstruct_Overlay_48 Overlay; + KAPC Apc; + PVOID CompletionKey; }; #line 13828 "C:/NTDDK/inc/ddk/ntddk.h" struct _IRP { - CSHORT Type ; - USHORT Size ; - PMDL MdlAddress ; - ULONG Flags ; - union __anonunion_AssociatedIrp_44 AssociatedIrp ; - LIST_ENTRY ThreadListEntry ; - IO_STATUS_BLOCK IoStatus ; - KPROCESSOR_MODE RequestorMode ; - BOOLEAN PendingReturned ; - CHAR StackCount ; - CHAR CurrentLocation ; - BOOLEAN Cancel ; - KIRQL CancelIrql ; - CCHAR ApcEnvironment ; - UCHAR AllocationFlags ; - PIO_STATUS_BLOCK UserIosb ; - PKEVENT UserEvent ; - union __anonunion_Overlay_45 Overlay ; - void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - PVOID UserBuffer ; - union __anonunion_Tail_47 Tail ; + CSHORT Type; + USHORT Size; + PMDL MdlAddress; + ULONG Flags; + union __anonunion_AssociatedIrp_44 AssociatedIrp; + LIST_ENTRY ThreadListEntry; + IO_STATUS_BLOCK IoStatus; + KPROCESSOR_MODE RequestorMode; + BOOLEAN PendingReturned; + CHAR StackCount; + CHAR CurrentLocation; + BOOLEAN Cancel; + KIRQL CancelIrql; + CCHAR ApcEnvironment; + UCHAR AllocationFlags; + PIO_STATUS_BLOCK UserIosb; + PKEVENT UserEvent; + union __anonunion_Overlay_45 Overlay; + void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + PVOID UserBuffer; + union __anonunion_Tail_47 Tail; }; #line 13828 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _IRP IRP; @@ -1550,293 +1577,294 @@ typedef struct _IRP IRP; typedef struct _IRP *PIRP; #line 14163 enum _DEVICE_RELATION_TYPE { - BusRelations = 0, - EjectionRelations = 1, - PowerRelations = 2, - RemovalRelations = 3, - TargetDeviceRelation = 4 -} ; + BusRelations = 0, + EjectionRelations = 1, + PowerRelations = 2, + RemovalRelations = 3, + TargetDeviceRelation = 4 +}; #line 14163 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE; #line 14176 enum _DEVICE_USAGE_NOTIFICATION_TYPE { - DeviceUsageTypeUndefined = 0, - DeviceUsageTypePaging = 1, - DeviceUsageTypeHibernation = 2, - DeviceUsageTypeDumpFile = 3 -} ; + DeviceUsageTypeUndefined = 0, + DeviceUsageTypePaging = 1, + DeviceUsageTypeHibernation = 2, + DeviceUsageTypeDumpFile = 3 +}; #line 14176 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE; #line 14185 "C:/NTDDK/inc/ddk/ntddk.h" struct _INTERFACE { - USHORT Size ; - USHORT Version ; - PVOID Context ; - void (*InterfaceReference)(PVOID Context ) ; - void (*InterfaceDereference)(PVOID Context ) ; + USHORT Size; + USHORT Version; + PVOID Context; + void (*InterfaceReference)(PVOID Context); + void (*InterfaceDereference)(PVOID Context); }; #line 14185 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _INTERFACE *PINTERFACE; #line 14196 "C:/NTDDK/inc/ddk/ntddk.h" struct _DEVICE_CAPABILITIES { - USHORT Size ; - USHORT Version ; - ULONG DeviceD1 : 1 ; - ULONG DeviceD2 : 1 ; - ULONG LockSupported : 1 ; - ULONG EjectSupported : 1 ; - ULONG Removable : 1 ; - ULONG DockDevice : 1 ; - ULONG UniqueID : 1 ; - ULONG SilentInstall : 1 ; - ULONG RawDeviceOK : 1 ; - ULONG SurpriseRemovalOK : 1 ; - ULONG WakeFromD0 : 1 ; - ULONG WakeFromD1 : 1 ; - ULONG WakeFromD2 : 1 ; - ULONG WakeFromD3 : 1 ; - ULONG HardwareDisabled : 1 ; - ULONG NonDynamic : 1 ; - ULONG WarmEjectSupported : 1 ; - ULONG Reserved : 15 ; - ULONG Address ; - ULONG UINumber ; - DEVICE_POWER_STATE DeviceState[7] ; - SYSTEM_POWER_STATE SystemWake ; - DEVICE_POWER_STATE DeviceWake ; - ULONG D1Latency ; - ULONG D2Latency ; - ULONG D3Latency ; + USHORT Size; + USHORT Version; + ULONG DeviceD1 : 1; + ULONG DeviceD2 : 1; + ULONG LockSupported : 1; + ULONG EjectSupported : 1; + ULONG Removable : 1; + ULONG DockDevice : 1; + ULONG UniqueID : 1; + ULONG SilentInstall : 1; + ULONG RawDeviceOK : 1; + ULONG SurpriseRemovalOK : 1; + ULONG WakeFromD0 : 1; + ULONG WakeFromD1 : 1; + ULONG WakeFromD2 : 1; + ULONG WakeFromD3 : 1; + ULONG HardwareDisabled : 1; + ULONG NonDynamic : 1; + ULONG WarmEjectSupported : 1; + ULONG Reserved : 15; + ULONG Address; + ULONG UINumber; + DEVICE_POWER_STATE DeviceState[7]; + SYSTEM_POWER_STATE SystemWake; + DEVICE_POWER_STATE DeviceWake; + ULONG D1Latency; + ULONG D2Latency; + ULONG D3Latency; }; #line 14196 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _DEVICE_CAPABILITIES *PDEVICE_CAPABILITIES; #line 14229 "C:/NTDDK/inc/ddk/ntddk.h" struct _POWER_SEQUENCE { - ULONG SequenceD1 ; - ULONG SequenceD2 ; - ULONG SequenceD3 ; + ULONG SequenceD1; + ULONG SequenceD2; + ULONG SequenceD3; }; #line 14229 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _POWER_SEQUENCE *PPOWER_SEQUENCE; #line 14235 enum __anonenum_BUS_QUERY_ID_TYPE_53 { - BusQueryDeviceID = 0, - BusQueryHardwareIDs = 1, - BusQueryCompatibleIDs = 2, - BusQueryInstanceID = 3, - BusQueryDeviceSerialNumber = 4 -} ; + BusQueryDeviceID = 0, + BusQueryHardwareIDs = 1, + BusQueryCompatibleIDs = 2, + BusQueryInstanceID = 3, + BusQueryDeviceSerialNumber = 4 +}; #line 14235 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum __anonenum_BUS_QUERY_ID_TYPE_53 BUS_QUERY_ID_TYPE; #line 14252 enum __anonenum_DEVICE_TEXT_TYPE_54 { - DeviceTextDescription = 0, - DeviceTextLocationInformation = 1 -} ; + DeviceTextDescription = 0, + DeviceTextLocationInformation = 1 +}; #line 14252 "C:/NTDDK/inc/ddk/ntddk.h" typedef enum __anonenum_DEVICE_TEXT_TYPE_54 DEVICE_TEXT_TYPE; #line 27 "C:/NTDDK/inc/pshpack4.h" -#pragma pack(push,4) +#pragma pack(push, 4) #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Create_56 { - PIO_SECURITY_CONTEXT SecurityContext ; - ULONG Options ; - USHORT FileAttributes ; - USHORT ShareAccess ; - ULONG EaLength ; + PIO_SECURITY_CONTEXT SecurityContext; + ULONG Options; + USHORT FileAttributes; + USHORT ShareAccess; + ULONG EaLength; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Read_57 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Write_58 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_QueryFile_59 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct____missing_field_name_62 { - BOOLEAN ReplaceIfExists ; - BOOLEAN AdvanceOnly ; + BOOLEAN ReplaceIfExists; + BOOLEAN AdvanceOnly; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion____missing_field_name_61 { - struct __anonstruct____missing_field_name_62 __annonCompField18 ; - ULONG ClusterCount ; - HANDLE DeleteHandle ; + struct __anonstruct____missing_field_name_62 __annonCompField18; + ULONG ClusterCount; + HANDLE DeleteHandle; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_SetFile_60 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; - PFILE_OBJECT FileObject ; - union __anonunion____missing_field_name_61 __annonCompField19 ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; + PFILE_OBJECT FileObject; + union __anonunion____missing_field_name_61 __annonCompField19; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_QueryVolume_63 { - ULONG Length ; - FS_INFORMATION_CLASS FsInformationClass ; + ULONG Length; + FS_INFORMATION_CLASS FsInformationClass; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_DeviceIoControl_64 { - ULONG OutputBufferLength ; - ULONG InputBufferLength ; - ULONG IoControlCode ; - PVOID Type3InputBuffer ; + ULONG OutputBufferLength; + ULONG InputBufferLength; + ULONG IoControlCode; + PVOID Type3InputBuffer; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_QuerySecurity_65 { - SECURITY_INFORMATION SecurityInformation ; - ULONG Length ; + SECURITY_INFORMATION SecurityInformation; + ULONG Length; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_SetSecurity_66 { - SECURITY_INFORMATION SecurityInformation ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; + SECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_MountVolume_67 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_VerifyVolume_68 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Scsi_69 { - struct _SCSI_REQUEST_BLOCK *Srb ; + struct _SCSI_REQUEST_BLOCK *Srb; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_QueryDeviceRelations_70 { - DEVICE_RELATION_TYPE Type ; + DEVICE_RELATION_TYPE Type; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_QueryInterface_71 { - GUID const *InterfaceType ; - USHORT Size ; - USHORT Version ; - PINTERFACE Interface ; - PVOID InterfaceSpecificData ; + GUID const *InterfaceType; + USHORT Size; + USHORT Version; + PINTERFACE Interface; + PVOID InterfaceSpecificData; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_DeviceCapabilities_72 { - PDEVICE_CAPABILITIES Capabilities ; + PDEVICE_CAPABILITIES Capabilities; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_FilterResourceRequirements_73 { - PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList ; + PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_ReadWriteConfig_74 { - ULONG WhichSpace ; - PVOID Buffer ; - ULONG Offset ; - ULONG Length ; + ULONG WhichSpace; + PVOID Buffer; + ULONG Offset; + ULONG Length; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_SetLock_75 { - BOOLEAN Lock ; + BOOLEAN Lock; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_QueryId_76 { - BUS_QUERY_ID_TYPE IdType ; + BUS_QUERY_ID_TYPE IdType; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_QueryDeviceText_77 { - DEVICE_TEXT_TYPE DeviceTextType ; - LCID LocaleId ; + DEVICE_TEXT_TYPE DeviceTextType; + LCID LocaleId; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_UsageNotification_78 { - BOOLEAN InPath ; - BOOLEAN Reserved[3] ; - DEVICE_USAGE_NOTIFICATION_TYPE Type ; + BOOLEAN InPath; + BOOLEAN Reserved[3]; + DEVICE_USAGE_NOTIFICATION_TYPE Type; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_WaitWake_79 { - SYSTEM_POWER_STATE PowerState ; + SYSTEM_POWER_STATE PowerState; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_PowerSequence_80 { - PPOWER_SEQUENCE PowerSequence ; + PPOWER_SEQUENCE PowerSequence; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Power_81 { - ULONG SystemContext ; - POWER_STATE_TYPE Type ; - POWER_STATE State ; - POWER_ACTION ShutdownType ; + ULONG SystemContext; + POWER_STATE_TYPE Type; + POWER_STATE State; + POWER_ACTION ShutdownType; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_StartDevice_82 { - PCM_RESOURCE_LIST AllocatedResources ; - PCM_RESOURCE_LIST AllocatedResourcesTranslated ; + PCM_RESOURCE_LIST AllocatedResources; + PCM_RESOURCE_LIST AllocatedResourcesTranslated; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_WMI_83 { - ULONG_PTR ProviderId ; - PVOID DataPath ; - ULONG BufferSize ; - PVOID Buffer ; + ULONG_PTR ProviderId; + PVOID DataPath; + ULONG BufferSize; + PVOID Buffer; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct __anonstruct_Others_84 { - PVOID Argument1 ; - PVOID Argument2 ; - PVOID Argument3 ; - PVOID Argument4 ; + PVOID Argument1; + PVOID Argument2; + PVOID Argument3; + PVOID Argument4; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" union __anonunion_Parameters_55 { - struct __anonstruct_Create_56 Create ; - struct __anonstruct_Read_57 Read ; - struct __anonstruct_Write_58 Write ; - struct __anonstruct_QueryFile_59 QueryFile ; - struct __anonstruct_SetFile_60 SetFile ; - struct __anonstruct_QueryVolume_63 QueryVolume ; - struct __anonstruct_DeviceIoControl_64 DeviceIoControl ; - struct __anonstruct_QuerySecurity_65 QuerySecurity ; - struct __anonstruct_SetSecurity_66 SetSecurity ; - struct __anonstruct_MountVolume_67 MountVolume ; - struct __anonstruct_VerifyVolume_68 VerifyVolume ; - struct __anonstruct_Scsi_69 Scsi ; - struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations ; - struct __anonstruct_QueryInterface_71 QueryInterface ; - struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities ; - struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements ; - struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig ; - struct __anonstruct_SetLock_75 SetLock ; - struct __anonstruct_QueryId_76 QueryId ; - struct __anonstruct_QueryDeviceText_77 QueryDeviceText ; - struct __anonstruct_UsageNotification_78 UsageNotification ; - struct __anonstruct_WaitWake_79 WaitWake ; - struct __anonstruct_PowerSequence_80 PowerSequence ; - struct __anonstruct_Power_81 Power ; - struct __anonstruct_StartDevice_82 StartDevice ; - struct __anonstruct_WMI_83 WMI ; - struct __anonstruct_Others_84 Others ; + struct __anonstruct_Create_56 Create; + struct __anonstruct_Read_57 Read; + struct __anonstruct_Write_58 Write; + struct __anonstruct_QueryFile_59 QueryFile; + struct __anonstruct_SetFile_60 SetFile; + struct __anonstruct_QueryVolume_63 QueryVolume; + struct __anonstruct_DeviceIoControl_64 DeviceIoControl; + struct __anonstruct_QuerySecurity_65 QuerySecurity; + struct __anonstruct_SetSecurity_66 SetSecurity; + struct __anonstruct_MountVolume_67 MountVolume; + struct __anonstruct_VerifyVolume_68 VerifyVolume; + struct __anonstruct_Scsi_69 Scsi; + struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations; + struct __anonstruct_QueryInterface_71 QueryInterface; + struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities; + struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements; + struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig; + struct __anonstruct_SetLock_75 SetLock; + struct __anonstruct_QueryId_76 QueryId; + struct __anonstruct_QueryDeviceText_77 QueryDeviceText; + struct __anonstruct_UsageNotification_78 UsageNotification; + struct __anonstruct_WaitWake_79 WaitWake; + struct __anonstruct_PowerSequence_80 PowerSequence; + struct __anonstruct_Power_81 Power; + struct __anonstruct_StartDevice_82 StartDevice; + struct __anonstruct_WMI_83 WMI; + struct __anonstruct_Others_84 Others; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" struct _IO_STACK_LOCATION { - UCHAR MajorFunction ; - UCHAR MinorFunction ; - UCHAR Flags ; - UCHAR Control ; - union __anonunion_Parameters_55 Parameters ; - PDEVICE_OBJECT DeviceObject ; - PFILE_OBJECT FileObject ; - NTSTATUS (*CompletionRoutine)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - PVOID Context ; + UCHAR MajorFunction; + UCHAR MinorFunction; + UCHAR Flags; + UCHAR Control; + union __anonunion_Parameters_55 Parameters; + PDEVICE_OBJECT DeviceObject; + PFILE_OBJECT FileObject; + NTSTATUS(*CompletionRoutine) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + PVOID Context; }; #line 14271 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _IO_STACK_LOCATION IO_STACK_LOCATION; @@ -1846,17 +1874,17 @@ typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION; #pragma pack(pop) #line 14635 "C:/NTDDK/inc/ddk/ntddk.h" struct _CONFIGURATION_INFORMATION { - ULONG DiskCount ; - ULONG FloppyCount ; - ULONG CdRomCount ; - ULONG TapeCount ; - ULONG ScsiPortCount ; - ULONG SerialCount ; - ULONG ParallelCount ; - BOOLEAN AtDiskPrimaryAddressClaimed ; - BOOLEAN AtDiskSecondaryAddressClaimed ; - ULONG Version ; - ULONG MediumChangerCount ; + ULONG DiskCount; + ULONG FloppyCount; + ULONG CdRomCount; + ULONG TapeCount; + ULONG ScsiPortCount; + ULONG SerialCount; + ULONG ParallelCount; + BOOLEAN AtDiskPrimaryAddressClaimed; + BOOLEAN AtDiskSecondaryAddressClaimed; + ULONG Version; + ULONG MediumChangerCount; }; #line 14635 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION; @@ -1864,46 +1892,46 @@ typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION; typedef struct _CONFIGURATION_INFORMATION *PCONFIGURATION_INFORMATION; #line 18321 "C:/NTDDK/inc/ddk/ntddk.h" struct _OBJECT_HANDLE_INFORMATION { - ULONG HandleAttributes ; - ACCESS_MASK GrantedAccess ; + ULONG HandleAttributes; + ACCESS_MASK GrantedAccess; }; #line 18321 "C:/NTDDK/inc/ddk/ntddk.h" typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION; #line 248 "C:/NTDDK/inc/ntdddisk.h" enum _MEDIA_TYPE { - Unknown = 0, - F5_1Pt2_512 = 1, - F3_1Pt44_512 = 2, - F3_2Pt88_512 = 3, - F3_20Pt8_512 = 4, - F3_720_512 = 5, - F5_360_512 = 6, - F5_320_512 = 7, - F5_320_1024 = 8, - F5_180_512 = 9, - F5_160_512 = 10, - RemovableMedia = 11, - FixedMedia = 12, - F3_120M_512 = 13, - F3_640_512 = 14, - F5_640_512 = 15, - F5_720_512 = 16, - F3_1Pt2_512 = 17, - F3_1Pt23_1024 = 18, - F5_1Pt23_1024 = 19, - F3_128Mb_512 = 20, - F3_230Mb_512 = 21, - F8_256_128 = 22 -} ; + Unknown = 0, + F5_1Pt2_512 = 1, + F3_1Pt44_512 = 2, + F3_2Pt88_512 = 3, + F3_20Pt8_512 = 4, + F3_720_512 = 5, + F5_360_512 = 6, + F5_320_512 = 7, + F5_320_1024 = 8, + F5_180_512 = 9, + F5_160_512 = 10, + RemovableMedia = 11, + FixedMedia = 12, + F3_120M_512 = 13, + F3_640_512 = 14, + F5_640_512 = 15, + F5_720_512 = 16, + F3_1Pt2_512 = 17, + F3_1Pt23_1024 = 18, + F5_1Pt23_1024 = 19, + F3_128Mb_512 = 20, + F3_230Mb_512 = 21, + F8_256_128 = 22 +}; #line 248 "C:/NTDDK/inc/ntdddisk.h" typedef enum _MEDIA_TYPE MEDIA_TYPE; #line 279 "C:/NTDDK/inc/ntdddisk.h" struct _FORMAT_PARAMETERS { - MEDIA_TYPE MediaType ; - ULONG StartCylinderNumber ; - ULONG EndCylinderNumber ; - ULONG StartHeadNumber ; - ULONG EndHeadNumber ; + MEDIA_TYPE MediaType; + ULONG StartCylinderNumber; + ULONG EndCylinderNumber; + ULONG StartHeadNumber; + ULONG EndHeadNumber; }; #line 279 "C:/NTDDK/inc/ntdddisk.h" typedef struct _FORMAT_PARAMETERS FORMAT_PARAMETERS; @@ -1915,14 +1943,14 @@ typedef USHORT BAD_TRACK_NUMBER; typedef USHORT *PBAD_TRACK_NUMBER; #line 302 "C:/NTDDK/inc/ntdddisk.h" struct _FORMAT_EX_PARAMETERS { - MEDIA_TYPE MediaType ; - ULONG StartCylinderNumber ; - ULONG EndCylinderNumber ; - ULONG StartHeadNumber ; - ULONG EndHeadNumber ; - USHORT FormatGapLength ; - USHORT SectorsPerTrack ; - USHORT SectorNumber[1] ; + MEDIA_TYPE MediaType; + ULONG StartCylinderNumber; + ULONG EndCylinderNumber; + ULONG StartHeadNumber; + ULONG EndHeadNumber; + USHORT FormatGapLength; + USHORT SectorsPerTrack; + USHORT SectorNumber[1]; }; #line 302 "C:/NTDDK/inc/ntdddisk.h" typedef struct _FORMAT_EX_PARAMETERS FORMAT_EX_PARAMETERS; @@ -1930,90 +1958,90 @@ typedef struct _FORMAT_EX_PARAMETERS FORMAT_EX_PARAMETERS; typedef struct _FORMAT_EX_PARAMETERS *PFORMAT_EX_PARAMETERS; #line 319 "C:/NTDDK/inc/ntdddisk.h" struct _DISK_GEOMETRY { - LARGE_INTEGER Cylinders ; - MEDIA_TYPE MediaType ; - ULONG TracksPerCylinder ; - ULONG SectorsPerTrack ; - ULONG BytesPerSector ; + LARGE_INTEGER Cylinders; + MEDIA_TYPE MediaType; + ULONG TracksPerCylinder; + ULONG SectorsPerTrack; + ULONG BytesPerSector; }; #line 319 "C:/NTDDK/inc/ntdddisk.h" typedef struct _DISK_GEOMETRY DISK_GEOMETRY; #line 319 "C:/NTDDK/inc/ntdddisk.h" typedef struct _DISK_GEOMETRY *PDISK_GEOMETRY; #line 27 "C:/NTDDK/inc/pshpack1.h" -#pragma pack(push,1) +#pragma pack(push, 1) #line 30 "C:/NTDDK/inc/poppack.h" #pragma pack(pop) #line 27 "C:/NTDDK/inc/pshpack1.h" -#pragma pack(push,1) +#pragma pack(push, 1) #line 30 "C:/NTDDK/inc/poppack.h" #pragma pack(pop) #line 27 "C:/NTDDK/inc/pshpack1.h" -#pragma pack(push,1) +#pragma pack(push, 1) #line 30 "C:/NTDDK/inc/poppack.h" #pragma pack(pop) #line 27 "C:/NTDDK/inc/pshpack1.h" -#pragma pack(push,1) +#pragma pack(push, 1) #line 30 "C:/NTDDK/inc/poppack.h" #pragma pack(pop) #line 27 "C:/NTDDK/inc/pshpack1.h" -#pragma pack(push,1) +#pragma pack(push, 1) #line 30 "C:/NTDDK/inc/poppack.h" #pragma pack(pop) #line 164 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" struct _TRANSFER_BUFFER { - PHYSICAL_ADDRESS Logical ; - PVOID Virtual ; + PHYSICAL_ADDRESS Logical; + PVOID Virtual; }; #line 164 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" typedef struct _TRANSFER_BUFFER TRANSFER_BUFFER; #line 180 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" struct _ACPI_FDI_DATA { - ULONG DriveNumber ; - ULONG DeviceType ; - ULONG MaxCylinderNumber ; - ULONG MaxSectorNumber ; - ULONG MaxHeadNumber ; - ULONG StepRateHeadUnloadTime ; - ULONG HeadLoadTime ; - ULONG MotorOffTime ; - ULONG SectorLengthCode ; - ULONG SectorPerTrack ; - ULONG ReadWriteGapLength ; - ULONG DataTransferLength ; - ULONG FormatGapLength ; - ULONG FormatFillCharacter ; - ULONG HeadSettleTime ; - ULONG MotorSettleTime ; + ULONG DriveNumber; + ULONG DeviceType; + ULONG MaxCylinderNumber; + ULONG MaxSectorNumber; + ULONG MaxHeadNumber; + ULONG StepRateHeadUnloadTime; + ULONG HeadLoadTime; + ULONG MotorOffTime; + ULONG SectorLengthCode; + ULONG SectorPerTrack; + ULONG ReadWriteGapLength; + ULONG DataTransferLength; + ULONG FormatGapLength; + ULONG FormatFillCharacter; + ULONG HeadSettleTime; + ULONG MotorSettleTime; }; #line 180 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" typedef struct _ACPI_FDI_DATA ACPI_FDI_DATA; #line 201 enum _ACPI_FDI_DEVICE_TYPE { - CmosProblem = 0, - Form525Capacity360 = 1, - Form525Capacity1200 = 2, - Form35Capacity720 = 3, - Form35Capacity1440 = 4, - Form35Capacity2880 = 5 -} ; + CmosProblem = 0, + Form525Capacity360 = 1, + Form525Capacity1200 = 2, + Form35Capacity720 = 3, + Form35Capacity1440 = 4, + Form35Capacity2880 = 5 +}; #line 212 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" struct _FDC_INFO { - UCHAR FloppyControllerType ; - UCHAR SpeedsAvailable ; - ULONG AdapterBufferSize ; - INTERFACE_TYPE BusType ; - ULONG BusNumber ; - ULONG ControllerNumber ; - ULONG PeripheralNumber ; - ULONG UnitNumber ; - ULONG MaxTransferSize ; - BOOLEAN AcpiBios ; - BOOLEAN AcpiFdiSupported ; - ACPI_FDI_DATA AcpiFdiData ; - ULONG BufferCount ; - ULONG BufferSize ; - TRANSFER_BUFFER BufferAddress[] ; + UCHAR FloppyControllerType; + UCHAR SpeedsAvailable; + ULONG AdapterBufferSize; + INTERFACE_TYPE BusType; + ULONG BusNumber; + ULONG ControllerNumber; + ULONG PeripheralNumber; + ULONG UnitNumber; + ULONG MaxTransferSize; + BOOLEAN AcpiBios; + BOOLEAN AcpiFdiSupported; + ACPI_FDI_DATA AcpiFdiData; + ULONG BufferCount; + ULONG BufferSize; + TRANSFER_BUFFER BufferAddress[]; }; #line 212 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" typedef struct _FDC_INFO FDC_INFO; @@ -2021,44 +2049,44 @@ typedef struct _FDC_INFO FDC_INFO; typedef struct _FDC_INFO *PFDC_INFO; #line 240 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" struct _FDC_ENABLE_PARMS { - UCHAR DriveOnValue ; - USHORT TimeToWait ; - BOOLEAN MotorStarted ; + UCHAR DriveOnValue; + USHORT TimeToWait; + BOOLEAN MotorStarted; }; #line 240 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" typedef struct _FDC_ENABLE_PARMS FDC_ENABLE_PARMS; #line 252 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" struct _FDC_DISK_CHANGE_PARMS { - UCHAR DriveStatus ; - UCHAR DriveOnValue ; + UCHAR DriveStatus; + UCHAR DriveOnValue; }; #line 252 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" typedef struct _FDC_DISK_CHANGE_PARMS FDC_DISK_CHANGE_PARMS; #line 261 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" struct _ISSUE_FDC_COMMAND_PARMS { - PUCHAR FifoInBuffer ; - PUCHAR FifoOutBuffer ; - PVOID IoHandle ; - ULONG IoOffset ; - ULONG TransferBytes ; - ULONG TimeOut ; + PUCHAR FifoInBuffer; + PUCHAR FifoOutBuffer; + PVOID IoHandle; + ULONG IoOffset; + ULONG TransferBytes; + ULONG TimeOut; }; #line 261 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" typedef struct _ISSUE_FDC_COMMAND_PARMS ISSUE_FDC_COMMAND_PARMS; #line 291 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" struct _SET_HD_BIT_PARMS { - BOOLEAN DriveType144MB ; - BOOLEAN Media144MB ; - BOOLEAN More120MB ; - UCHAR DeviceUnit ; - BOOLEAN ChangedHdBit ; + BOOLEAN DriveType144MB; + BOOLEAN Media144MB; + BOOLEAN More120MB; + UCHAR DeviceUnit; + BOOLEAN ChangedHdBit; }; #line 291 "C:/NTDDK/src/storage/fdc/inc/ntddfdc.h" typedef struct _SET_HD_BIT_PARMS SET_HD_BIT_PARMS; #line 202 "C:/NTDDK/inc/mountmgr.h" struct _MOUNTDEV_NAME { - USHORT NameLength ; - WCHAR Name[1] ; + USHORT NameLength; + WCHAR Name[1]; }; #line 202 "C:/NTDDK/inc/mountmgr.h" typedef struct _MOUNTDEV_NAME MOUNTDEV_NAME; @@ -2066,8 +2094,8 @@ typedef struct _MOUNTDEV_NAME MOUNTDEV_NAME; typedef struct _MOUNTDEV_NAME *PMOUNTDEV_NAME; #line 38 "C:/NTDDK/inc/ddk/mountdev.h" struct _MOUNTDEV_UNIQUE_ID { - USHORT UniqueIdLength ; - UCHAR UniqueId[1] ; + USHORT UniqueIdLength; + UCHAR UniqueId[1]; }; #line 38 "C:/NTDDK/inc/ddk/mountdev.h" typedef struct _MOUNTDEV_UNIQUE_ID MOUNTDEV_UNIQUE_ID; @@ -2075,9 +2103,9 @@ typedef struct _MOUNTDEV_UNIQUE_ID MOUNTDEV_UNIQUE_ID; typedef struct _MOUNTDEV_UNIQUE_ID *PMOUNTDEV_UNIQUE_ID; #line 66 "C:/NTDDK/inc/ddk/mountdev.h" struct _MOUNTDEV_SUGGESTED_LINK_NAME { - BOOLEAN UseOnlyIfThereAreNoOtherLinks ; - USHORT NameLength ; - WCHAR Name[1] ; + BOOLEAN UseOnlyIfThereAreNoOtherLinks; + USHORT NameLength; + WCHAR Name[1]; }; #line 66 "C:/NTDDK/inc/ddk/mountdev.h" typedef struct _MOUNTDEV_SUGGESTED_LINK_NAME MOUNTDEV_SUGGESTED_LINK_NAME; @@ -2085,71 +2113,71 @@ typedef struct _MOUNTDEV_SUGGESTED_LINK_NAME MOUNTDEV_SUGGESTED_LINK_NAME; typedef struct _MOUNTDEV_SUGGESTED_LINK_NAME *PMOUNTDEV_SUGGESTED_LINK_NAME; #line 105 "./flo_data.h" struct _BOOT_SECTOR_INFO { - UCHAR JumpByte[1] ; - UCHAR Ignore1[2] ; - UCHAR OemData[8] ; - UCHAR BytesPerSector[2] ; - UCHAR Ignore2[6] ; - UCHAR NumberOfSectors[2] ; - UCHAR MediaByte[1] ; - UCHAR Ignore3[2] ; - UCHAR SectorsPerTrack[2] ; - UCHAR NumberOfHeads[2] ; + UCHAR JumpByte[1]; + UCHAR Ignore1[2]; + UCHAR OemData[8]; + UCHAR BytesPerSector[2]; + UCHAR Ignore2[6]; + UCHAR NumberOfSectors[2]; + UCHAR MediaByte[1]; + UCHAR Ignore3[2]; + UCHAR SectorsPerTrack[2]; + UCHAR NumberOfHeads[2]; }; #line 105 "./flo_data.h" typedef struct _BOOT_SECTOR_INFO *PBOOT_SECTOR_INFO; #line 194 enum _DRIVE_MEDIA_TYPE { - Drive360Media160 = 0, - Drive360Media180 = 1, - Drive360Media320 = 2, - Drive360Media32X = 3, - Drive360Media360 = 4, - Drive720Media720 = 5, - Drive120Media160 = 6, - Drive120Media180 = 7, - Drive120Media320 = 8, - Drive120Media32X = 9, - Drive120Media360 = 10, - Drive120Media120 = 11, - Drive144Media720 = 12, - Drive144Media144 = 13, - Drive288Media720 = 14, - Drive288Media144 = 15, - Drive288Media288 = 16 -} ; + Drive360Media160 = 0, + Drive360Media180 = 1, + Drive360Media320 = 2, + Drive360Media32X = 3, + Drive360Media360 = 4, + Drive720Media720 = 5, + Drive120Media160 = 6, + Drive120Media180 = 7, + Drive120Media320 = 8, + Drive120Media32X = 9, + Drive120Media360 = 10, + Drive120Media120 = 11, + Drive144Media720 = 12, + Drive144Media144 = 13, + Drive288Media720 = 14, + Drive288Media144 = 15, + Drive288Media288 = 16 +}; #line 194 "./flo_data.h" typedef enum _DRIVE_MEDIA_TYPE DRIVE_MEDIA_TYPE; #line 217 enum _DRIVE_MEDIA_TYPE_NEC98 { - Drive360Media160Nec98 = 0, - Drive360Media180Nec98 = 1, - Drive360Media320Nec98 = 2, - Drive360Media32XNec98 = 3, - Drive360Media360Nec98 = 4, - Drive120Media160Nec98 = 5, - Drive120Media180Nec98 = 6, - Drive120Media320Nec98 = 7, - Drive120Media32XNec98 = 8, - Drive120Media360Nec98 = 9, - Drive120Media640Nec98 = 10, - Drive120Media720Nec98 = 11, - Drive120Media120Nec98 = 12, - Drive120Media123Nec98 = 13, - Drive144Media640Nec98 = 14, - Drive144Media720Nec98 = 15, - Drive144Media120Nec98 = 16, - Drive144Media123Nec98 = 17, - Drive144Media144Nec98 = 18, - Drive12EMedia120Nec98 = 19, - Drive12EMedia123Nec98 = 20 -} ; + Drive360Media160Nec98 = 0, + Drive360Media180Nec98 = 1, + Drive360Media320Nec98 = 2, + Drive360Media32XNec98 = 3, + Drive360Media360Nec98 = 4, + Drive120Media160Nec98 = 5, + Drive120Media180Nec98 = 6, + Drive120Media320Nec98 = 7, + Drive120Media32XNec98 = 8, + Drive120Media360Nec98 = 9, + Drive120Media640Nec98 = 10, + Drive120Media720Nec98 = 11, + Drive120Media120Nec98 = 12, + Drive120Media123Nec98 = 13, + Drive144Media640Nec98 = 14, + Drive144Media720Nec98 = 15, + Drive144Media120Nec98 = 16, + Drive144Media123Nec98 = 17, + Drive144Media144Nec98 = 18, + Drive12EMedia120Nec98 = 19, + Drive12EMedia123Nec98 = 20 +}; #line 217 "./flo_data.h" typedef enum _DRIVE_MEDIA_TYPE_NEC98 DRIVE_MEDIA_TYPE_NEC98; #line 260 "./flo_data.h" struct _DRIVE_MEDIA_LIMITS { - DRIVE_MEDIA_TYPE HighestDriveMediaType ; - DRIVE_MEDIA_TYPE LowestDriveMediaType ; + DRIVE_MEDIA_TYPE HighestDriveMediaType; + DRIVE_MEDIA_TYPE LowestDriveMediaType; }; #line 260 "./flo_data.h" typedef struct _DRIVE_MEDIA_LIMITS DRIVE_MEDIA_LIMITS; @@ -2157,33 +2185,33 @@ typedef struct _DRIVE_MEDIA_LIMITS DRIVE_MEDIA_LIMITS; typedef struct _DRIVE_MEDIA_LIMITS *PDRIVE_MEDIA_LIMITS; #line 277 "./flo_data.h" struct _DRIVE_MEDIA_LIMITS_NEC98 { - DRIVE_MEDIA_TYPE_NEC98 HighestDriveMediaType ; - DRIVE_MEDIA_TYPE_NEC98 LowestDriveMediaType ; + DRIVE_MEDIA_TYPE_NEC98 HighestDriveMediaType; + DRIVE_MEDIA_TYPE_NEC98 LowestDriveMediaType; }; #line 277 "./flo_data.h" typedef struct _DRIVE_MEDIA_LIMITS_NEC98 DRIVE_MEDIA_LIMITS_NEC98; #line 298 "./flo_data.h" struct _DRIVE_MEDIA_CONSTANTS { - MEDIA_TYPE MediaType ; - UCHAR StepRateHeadUnloadTime ; - UCHAR HeadLoadTime ; - UCHAR MotorOffTime ; - UCHAR SectorLengthCode ; - USHORT BytesPerSector ; - UCHAR SectorsPerTrack ; - UCHAR ReadWriteGapLength ; - UCHAR FormatGapLength ; - UCHAR FormatFillCharacter ; - UCHAR HeadSettleTime ; - USHORT MotorSettleTimeRead ; - USHORT MotorSettleTimeWrite ; - UCHAR MaximumTrack ; - UCHAR CylinderShift ; - UCHAR DataTransferRate ; - UCHAR NumberOfHeads ; - UCHAR DataLength ; - UCHAR MediaByte ; - UCHAR SkewDelta ; + MEDIA_TYPE MediaType; + UCHAR StepRateHeadUnloadTime; + UCHAR HeadLoadTime; + UCHAR MotorOffTime; + UCHAR SectorLengthCode; + USHORT BytesPerSector; + UCHAR SectorsPerTrack; + UCHAR ReadWriteGapLength; + UCHAR FormatGapLength; + UCHAR FormatFillCharacter; + UCHAR HeadSettleTime; + USHORT MotorSettleTimeRead; + USHORT MotorSettleTimeWrite; + UCHAR MaximumTrack; + UCHAR CylinderShift; + UCHAR DataTransferRate; + UCHAR NumberOfHeads; + UCHAR DataLength; + UCHAR MediaByte; + UCHAR SkewDelta; }; #line 298 "./flo_data.h" typedef struct _DRIVE_MEDIA_CONSTANTS DRIVE_MEDIA_CONSTANTS; @@ -2191,51 +2219,51 @@ typedef struct _DRIVE_MEDIA_CONSTANTS DRIVE_MEDIA_CONSTANTS; typedef struct _DRIVE_MEDIA_CONSTANTS *PDRIVE_MEDIA_CONSTANTS; #line 528 "./flo_data.h" struct _DISKETTE_EXTENSION { - KSPIN_LOCK FlCancelSpinLock ; - PDEVICE_OBJECT UnderlyingPDO ; - PDEVICE_OBJECT TargetObject ; - BOOLEAN IsStarted ; - BOOLEAN IsRemoved ; - BOOLEAN HoldNewRequests ; - LIST_ENTRY NewRequestQueue ; - KSPIN_LOCK NewRequestQueueSpinLock ; - PDEVICE_OBJECT DeviceObject ; - KSEMAPHORE RequestSemaphore ; - KSPIN_LOCK ListSpinLock ; - FAST_MUTEX ThreadReferenceMutex ; - LONG ThreadReferenceCount ; - PKTHREAD FloppyThread ; - LIST_ENTRY ListEntry ; - BOOLEAN HardwareFailed ; - UCHAR HardwareFailCount ; - ULONG MaxTransferSize ; - UCHAR FifoBuffer[10] ; - PUCHAR IoBuffer ; - PMDL IoBufferMdl ; - ULONG IoBufferSize ; - PDRIVER_OBJECT DriverObject ; - DRIVE_MEDIA_TYPE LastDriveMediaType ; - BOOLEAN FloppyControllerAllocated ; - BOOLEAN ACPI_BIOS ; - UCHAR DriveType ; - ULONG BytesPerSector ; - ULONG ByteCapacity ; - MEDIA_TYPE MediaType ; - DRIVE_MEDIA_TYPE DriveMediaType ; - UCHAR DeviceUnit ; - UCHAR DriveOnValue ; - BOOLEAN IsReadOnly ; - DRIVE_MEDIA_CONSTANTS BiosDriveMediaConstants ; - DRIVE_MEDIA_CONSTANTS DriveMediaConstants ; - UCHAR PerpendicularMode ; - BOOLEAN ControllerConfigurable ; - UNICODE_STRING DeviceName ; - UNICODE_STRING InterfaceString ; - UNICODE_STRING ArcName ; - BOOLEAN ReleaseFdcWithMotorRunning ; - BOOLEAN PoweringDown ; - FAST_MUTEX PowerDownMutex ; - FAST_MUTEX HoldNewReqMutex ; + KSPIN_LOCK FlCancelSpinLock; + PDEVICE_OBJECT UnderlyingPDO; + PDEVICE_OBJECT TargetObject; + BOOLEAN IsStarted; + BOOLEAN IsRemoved; + BOOLEAN HoldNewRequests; + LIST_ENTRY NewRequestQueue; + KSPIN_LOCK NewRequestQueueSpinLock; + PDEVICE_OBJECT DeviceObject; + KSEMAPHORE RequestSemaphore; + KSPIN_LOCK ListSpinLock; + FAST_MUTEX ThreadReferenceMutex; + LONG ThreadReferenceCount; + PKTHREAD FloppyThread; + LIST_ENTRY ListEntry; + BOOLEAN HardwareFailed; + UCHAR HardwareFailCount; + ULONG MaxTransferSize; + UCHAR FifoBuffer[10]; + PUCHAR IoBuffer; + PMDL IoBufferMdl; + ULONG IoBufferSize; + PDRIVER_OBJECT DriverObject; + DRIVE_MEDIA_TYPE LastDriveMediaType; + BOOLEAN FloppyControllerAllocated; + BOOLEAN ACPI_BIOS; + UCHAR DriveType; + ULONG BytesPerSector; + ULONG ByteCapacity; + MEDIA_TYPE MediaType; + DRIVE_MEDIA_TYPE DriveMediaType; + UCHAR DeviceUnit; + UCHAR DriveOnValue; + BOOLEAN IsReadOnly; + DRIVE_MEDIA_CONSTANTS BiosDriveMediaConstants; + DRIVE_MEDIA_CONSTANTS DriveMediaConstants; + UCHAR PerpendicularMode; + BOOLEAN ControllerConfigurable; + UNICODE_STRING DeviceName; + UNICODE_STRING InterfaceString; + UNICODE_STRING ArcName; + BOOLEAN ReleaseFdcWithMotorRunning; + BOOLEAN PoweringDown; + FAST_MUTEX PowerDownMutex; + FAST_MUTEX HoldNewReqMutex; }; #line 528 "./flo_data.h" typedef struct _DISKETTE_EXTENSION DISKETTE_EXTENSION; @@ -2243,14 +2271,14 @@ typedef struct _DISKETTE_EXTENSION DISKETTE_EXTENSION; typedef DISKETTE_EXTENSION *PDISKETTE_EXTENSION; #line 591 "./flo_data.h" struct _SENSE_DEVISE_STATUS_PTOS { - UCHAR ST3_PTOS ; + UCHAR ST3_PTOS; }; #line 591 "./flo_data.h" typedef struct _SENSE_DEVISE_STATUS_PTOS SENSE_DEVISE_STATUS_PTOS; #line 591 "./flo_data.h" typedef struct _SENSE_DEVISE_STATUS_PTOS *PSENSE_DEVISE_STATUS_PTOS; #line 33 "C:/Program Files/Microsoft Visual Studio/VC98/include/excpt.h" -#pragma pack(push,8) +#pragma pack(push, 8) #line 156 #pragma pack(pop) #line 222 "C:/NTDDK/inc/ddk/ntddk.h" @@ -2258,15 +2286,15 @@ struct _KAPC; #line 292 struct _KDPC; #line 27 "C:/NTDDK/inc/pshpack4.h" -#pragma pack(push,4) +#pragma pack(push, 4) #line 30 "C:/NTDDK/inc/poppack.h" #pragma pack(pop) #line 27 "C:/NTDDK/inc/pshpack4.h" -#pragma pack(push,4) +#pragma pack(push, 4) #line 30 "C:/NTDDK/inc/poppack.h" #pragma pack(pop) #line 27 "C:/NTDDK/inc/pshpack1.h" -#pragma pack(push,1) +#pragma pack(push, 1) #line 30 "C:/NTDDK/inc/poppack.h" #pragma pack(pop) #line 12399 "C:/NTDDK/inc/ddk/ntddk.h" @@ -2282,418 +2310,423 @@ struct _IRP; #line 12913 struct _SCSI_REQUEST_BLOCK; #line 27 "C:/NTDDK/inc/pshpack4.h" -#pragma pack(push,4) +#pragma pack(push, 4) #line 30 "C:/NTDDK/inc/poppack.h" #pragma pack(pop) #line 307 "C:/NTDDK/inc/stdio.h" -extern int ( __attribute__((__cdecl__)) sprintf)(char * , char const * , ...) ; +extern int(__attribute__((__cdecl__)) sprintf)(char *, char const *, ...); #line 351 -extern int ( __attribute__((__cdecl__)) swprintf)(wchar_t * , wchar_t const * , ...) ; +extern int(__attribute__((__cdecl__)) swprintf)(wchar_t *, wchar_t const *, + ...); #line 832 "C:/NTDDK/inc/ntdef.h" #pragma warning(push) #line 834 -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #line 835 "C:/NTDDK/inc/ntdef.h" -__inline ULONGLONG ( __attribute__((__stdcall__)) Int64ShllMod32___0)(ULONGLONG Value , - ULONG ShiftCount ) -{ +__inline ULONGLONG(__attribute__((__stdcall__)) + Int64ShllMod32___0)(ULONGLONG Value, ULONG ShiftCount) { { #line 850 - return (0ULL); -} + return (0ULL); + } } #line 845 "C:/NTDDK/inc/ntdef.h" -__inline LONGLONG ( __attribute__((__stdcall__)) Int64ShraMod32___0)(LONGLONG Value , - ULONG ShiftCount ) -{ +__inline LONGLONG(__attribute__((__stdcall__)) + Int64ShraMod32___0)(LONGLONG Value, ULONG ShiftCount) { { #line 860 - return (0LL); -} + return (0LL); + } } #line 855 "C:/NTDDK/inc/ntdef.h" -__inline ULONGLONG ( __attribute__((__stdcall__)) Int64ShrlMod32___0)(ULONGLONG Value , - ULONG ShiftCount ) -{ +__inline ULONGLONG(__attribute__((__stdcall__)) + Int64ShrlMod32___0)(ULONGLONG Value, ULONG ShiftCount) { { #line 870 - return (0ULL); -} + return (0ULL); + } } #line 873 #pragma warning(pop) #line 1094 "C:/NTDDK/inc/ntdef.h" -__inline void ListEntry32To64(PLIST_ENTRY32 l32 , PLIST_ENTRY64 l64 ) -{ ULONG __cil_tmp3 ; - long __cil_tmp4 ; - long long __cil_tmp5 ; - unsigned int __cil_tmp6 ; - unsigned int __cil_tmp7 ; - unsigned int __cil_tmp8 ; - unsigned int __cil_tmp9 ; - ULONG __cil_tmp10 ; - long __cil_tmp11 ; - long long __cil_tmp12 ; - ULONG *mem_13 ; - ULONGLONG *mem_14 ; - ULONG *mem_15 ; - ULONGLONG *mem_16 ; +__inline void ListEntry32To64(PLIST_ENTRY32 l32, PLIST_ENTRY64 l64) { + ULONG __cil_tmp3; + long __cil_tmp4; + long long __cil_tmp5; + unsigned int __cil_tmp6; + unsigned int __cil_tmp7; + unsigned int __cil_tmp8; + unsigned int __cil_tmp9; + ULONG __cil_tmp10; + long __cil_tmp11; + long long __cil_tmp12; + ULONG *mem_13; + ULONGLONG *mem_14; + ULONG *mem_15; + ULONGLONG *mem_16; { #line 1101 - mem_13 = (ULONG *)l32; + mem_13 = (ULONG *)l32; #line 1101 - __cil_tmp3 = *mem_13; + __cil_tmp3 = *mem_13; #line 1101 - __cil_tmp4 = (long )__cil_tmp3; + __cil_tmp4 = (long)__cil_tmp3; #line 1101 - __cil_tmp5 = (long long )__cil_tmp4; + __cil_tmp5 = (long long)__cil_tmp4; #line 1101 - mem_14 = (ULONGLONG *)l64; + mem_14 = (ULONGLONG *)l64; #line 1101 - *mem_14 = (unsigned long long )__cil_tmp5; + *mem_14 = (unsigned long long)__cil_tmp5; #line 1102 - __cil_tmp6 = (unsigned int )l64; + __cil_tmp6 = (unsigned int)l64; #line 1102 - __cil_tmp7 = __cil_tmp6 + 8; + __cil_tmp7 = __cil_tmp6 + 8; #line 1102 - __cil_tmp8 = (unsigned int )l32; + __cil_tmp8 = (unsigned int)l32; #line 1102 - __cil_tmp9 = __cil_tmp8 + 4; + __cil_tmp9 = __cil_tmp8 + 4; #line 1102 - mem_15 = (ULONG *)__cil_tmp9; + mem_15 = (ULONG *)__cil_tmp9; #line 1102 - __cil_tmp10 = *mem_15; + __cil_tmp10 = *mem_15; #line 1102 - __cil_tmp11 = (long )__cil_tmp10; + __cil_tmp11 = (long)__cil_tmp10; #line 1102 - __cil_tmp12 = (long long )__cil_tmp11; + __cil_tmp12 = (long long)__cil_tmp11; #line 1102 - mem_16 = (ULONGLONG *)__cil_tmp7; + mem_16 = (ULONGLONG *)__cil_tmp7; #line 1102 - *mem_16 = (unsigned long long )__cil_tmp12; + *mem_16 = (unsigned long long)__cil_tmp12; #line 1105 - return; -} + return; + } } #line 1105 "C:/NTDDK/inc/ntdef.h" -__inline void ListEntry64To32(PLIST_ENTRY64 l64 , PLIST_ENTRY32 l32 ) -{ ULONGLONG __cil_tmp3 ; - unsigned int __cil_tmp4 ; - unsigned int __cil_tmp5 ; - unsigned int __cil_tmp6 ; - unsigned int __cil_tmp7 ; - ULONGLONG __cil_tmp8 ; - ULONGLONG *mem_9 ; - ULONG *mem_10 ; - ULONGLONG *mem_11 ; - ULONG *mem_12 ; +__inline void ListEntry64To32(PLIST_ENTRY64 l64, PLIST_ENTRY32 l32) { + ULONGLONG __cil_tmp3; + unsigned int __cil_tmp4; + unsigned int __cil_tmp5; + unsigned int __cil_tmp6; + unsigned int __cil_tmp7; + ULONGLONG __cil_tmp8; + ULONGLONG *mem_9; + ULONG *mem_10; + ULONGLONG *mem_11; + ULONG *mem_12; { #line 1112 - mem_9 = (ULONGLONG *)l64; + mem_9 = (ULONGLONG *)l64; #line 1112 - __cil_tmp3 = *mem_9; + __cil_tmp3 = *mem_9; #line 1112 - mem_10 = (ULONG *)l32; + mem_10 = (ULONG *)l32; #line 1112 - *mem_10 = (unsigned long )__cil_tmp3; + *mem_10 = (unsigned long)__cil_tmp3; #line 1113 - __cil_tmp4 = (unsigned int )l32; + __cil_tmp4 = (unsigned int)l32; #line 1113 - __cil_tmp5 = __cil_tmp4 + 4; + __cil_tmp5 = __cil_tmp4 + 4; #line 1113 - __cil_tmp6 = (unsigned int )l64; + __cil_tmp6 = (unsigned int)l64; #line 1113 - __cil_tmp7 = __cil_tmp6 + 8; + __cil_tmp7 = __cil_tmp6 + 8; #line 1113 - mem_11 = (ULONGLONG *)__cil_tmp7; + mem_11 = (ULONGLONG *)__cil_tmp7; #line 1113 - __cil_tmp8 = *mem_11; + __cil_tmp8 = *mem_11; #line 1113 - mem_12 = (ULONG *)__cil_tmp5; + mem_12 = (ULONG *)__cil_tmp5; #line 1113 - *mem_12 = (unsigned long )__cil_tmp8; + *mem_12 = (unsigned long)__cil_tmp8; #line 1116 - return; -} + return; + } } #line 93 "C:/NTDDK/inc/string.h" -extern void *( __attribute__((__cdecl__)) memcpy)(void * , void const * , size_t ) ; +extern void *(__attribute__((__cdecl__)) memcpy)(void *, void const *, size_t); #line 95 -extern void *( __attribute__((__cdecl__)) memset)(void * , int , size_t ) ; +extern void *(__attribute__((__cdecl__)) memset)(void *, int, size_t); #line 110 -extern void *( __attribute__((__cdecl__)) memmove)(void * , void const * , size_t ) ; +extern void *(__attribute__((__cdecl__)) memmove)(void *, void const *, size_t); #line 101 "C:/NTDDK/inc/ddk/ntddk.h" -extern PKTHREAD ( __attribute__((__stdcall__)) KeGetCurrentThread)() ; +extern PKTHREAD(__attribute__((__stdcall__)) KeGetCurrentThread)(); #line 25 "C:/NTDDK/inc/pshpack4.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 28 "C:/NTDDK/inc/poppack.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 1136 "C:/NTDDK/inc/ddk/ntddk.h" -NTSTATUS ( __attribute__((__stdcall__)) RtlQueryRegistryValues)(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; +NTSTATUS(__attribute__((__stdcall__)) RtlQueryRegistryValues) +(ULONG RelativeTo, PCWSTR Path, PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); #line 1159 -NTSTATUS ( __attribute__((__stdcall__)) RtlDeleteRegistryValue)(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; +NTSTATUS(__attribute__((__stdcall__)) RtlDeleteRegistryValue) +(ULONG RelativeTo, PCWSTR Path, PCWSTR ValueName); #line 1264 -void ( __attribute__((__stdcall__)) RtlInitString)(PSTRING DestinationString , - PCSZ SourceString ) ; +void(__attribute__((__stdcall__)) RtlInitString)(PSTRING DestinationString, + PCSZ SourceString); #line 1280 -void ( __attribute__((__stdcall__)) RtlInitUnicodeString)(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; +void(__attribute__((__stdcall__)) + RtlInitUnicodeString)(PUNICODE_STRING DestinationString, + PCWSTR SourceString); #line 1335 -NTSTATUS ( __attribute__((__stdcall__)) RtlAnsiStringToUnicodeString)(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; +NTSTATUS(__attribute__((__stdcall__)) RtlAnsiStringToUnicodeString) +(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); #line 1394 -void ( __attribute__((__stdcall__)) RtlCopyUnicodeString)(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; +void(__attribute__((__stdcall__)) + RtlCopyUnicodeString)(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); #line 1429 -void ( __attribute__((__stdcall__)) RtlFreeUnicodeString)(PUNICODE_STRING UnicodeString ) ; +void(__attribute__((__stdcall__)) + RtlFreeUnicodeString)(PUNICODE_STRING UnicodeString); #line 1516 -SIZE_T ( __attribute__((__stdcall__)) RtlCompareMemory)(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; +SIZE_T(__attribute__((__stdcall__)) RtlCompareMemory) +(void const *Source1, void const *Source2, SIZE_T Length); #line 1718 "C:/NTDDK/inc/ddk/ntddk.h" -__inline LARGE_INTEGER ( __attribute__((__stdcall__)) RtlLargeIntegerAdd)(LARGE_INTEGER Addend1 , - LARGE_INTEGER Addend2 ) -{ LARGE_INTEGER Sum ; +__inline LARGE_INTEGER(__attribute__((__stdcall__)) + RtlLargeIntegerAdd)(LARGE_INTEGER Addend1, + LARGE_INTEGER Addend2) { + LARGE_INTEGER Sum; { #line 1728 - Sum.QuadPart = Addend1.QuadPart + Addend2.QuadPart; + Sum.QuadPart = Addend1.QuadPart + Addend2.QuadPart; #line 1729 - return (Sum); -} + return (Sum); + } } #line 1736 "C:/NTDDK/inc/ddk/ntddk.h" -__inline LARGE_INTEGER ( __attribute__((__stdcall__)) RtlEnlargedIntegerMultiply)(LONG Multiplicand , - LONG Multiplier ) -{ LARGE_INTEGER Product ; - unsigned long long __cil_tmp4 ; - long long __cil_tmp5 ; - unsigned long long __cil_tmp6 ; - unsigned long long __cil_tmp7 ; +__inline LARGE_INTEGER(__attribute__((__stdcall__)) + RtlEnlargedIntegerMultiply)(LONG Multiplicand, + LONG Multiplier) { + LARGE_INTEGER Product; + unsigned long long __cil_tmp4; + long long __cil_tmp5; + unsigned long long __cil_tmp6; + unsigned long long __cil_tmp7; { #line 1746 - __cil_tmp4 = (unsigned long long )Multiplier; + __cil_tmp4 = (unsigned long long)Multiplier; #line 1746 - __cil_tmp5 = (long long )Multiplicand; + __cil_tmp5 = (long long)Multiplicand; #line 1746 - __cil_tmp6 = (unsigned long long )__cil_tmp5; + __cil_tmp6 = (unsigned long long)__cil_tmp5; #line 1746 - __cil_tmp7 = __cil_tmp6 * __cil_tmp4; + __cil_tmp7 = __cil_tmp6 * __cil_tmp4; #line 1746 - Product.QuadPart = (long long )__cil_tmp7; + Product.QuadPart = (long long)__cil_tmp7; #line 1747 - return (Product); -} + return (Product); + } } #line 1754 "C:/NTDDK/inc/ddk/ntddk.h" -__inline LARGE_INTEGER ( __attribute__((__stdcall__)) RtlEnlargedUnsignedMultiply)(ULONG Multiplicand , - ULONG Multiplier ) -{ LARGE_INTEGER Product ; - unsigned long long __cil_tmp4 ; - unsigned long long __cil_tmp5 ; - unsigned long long __cil_tmp6 ; +__inline LARGE_INTEGER(__attribute__((__stdcall__)) + RtlEnlargedUnsignedMultiply)(ULONG Multiplicand, + ULONG Multiplier) { + LARGE_INTEGER Product; + unsigned long long __cil_tmp4; + unsigned long long __cil_tmp5; + unsigned long long __cil_tmp6; { #line 1764 - __cil_tmp4 = (unsigned long long )Multiplier; + __cil_tmp4 = (unsigned long long)Multiplier; #line 1764 - __cil_tmp5 = (unsigned long long )Multiplicand; + __cil_tmp5 = (unsigned long long)Multiplicand; #line 1764 - __cil_tmp6 = __cil_tmp5 * __cil_tmp4; + __cil_tmp6 = __cil_tmp5 * __cil_tmp4; #line 1764 - Product.QuadPart = (long long )__cil_tmp6; + Product.QuadPart = (long long)__cil_tmp6; #line 1765 - return (Product); -} + return (Product); + } } #line 1772 "C:/NTDDK/inc/ddk/ntddk.h" -__inline ULONG ( __attribute__((__stdcall__)) RtlEnlargedUnsignedDivide)(ULARGE_INTEGER Dividend , - ULONG Divisor , - PULONG Remainder ) -{ ULONG Quotient ; - unsigned long long __cil_tmp5 ; - ULONGLONG __cil_tmp6 ; - void *__cil_tmp7 ; - CHAR *__cil_tmp8 ; - unsigned int __cil_tmp9 ; - CHAR *__cil_tmp10 ; - unsigned int __cil_tmp11 ; - unsigned long long __cil_tmp12 ; - unsigned long long __cil_tmp13 ; +__inline ULONG(__attribute__((__stdcall__)) + RtlEnlargedUnsignedDivide)(ULARGE_INTEGER Dividend, + ULONG Divisor, PULONG Remainder) { + ULONG Quotient; + unsigned long long __cil_tmp5; + ULONGLONG __cil_tmp6; + void *__cil_tmp7; + CHAR *__cil_tmp8; + unsigned int __cil_tmp9; + CHAR *__cil_tmp10; + unsigned int __cil_tmp11; + unsigned long long __cil_tmp12; + unsigned long long __cil_tmp13; { #line 1783 - __cil_tmp5 = (unsigned long long )Divisor; + __cil_tmp5 = (unsigned long long)Divisor; #line 1783 - __cil_tmp6 = Dividend.QuadPart / __cil_tmp5; + __cil_tmp6 = Dividend.QuadPart / __cil_tmp5; #line 1783 - Quotient = (unsigned long )__cil_tmp6; - { + Quotient = (unsigned long)__cil_tmp6; + { #line 1784 - __cil_tmp7 = (void *)0; + __cil_tmp7 = (void *)0; #line 1784 - __cil_tmp8 = (CHAR *)__cil_tmp7; + __cil_tmp8 = (CHAR *)__cil_tmp7; #line 1784 - __cil_tmp9 = (unsigned int )__cil_tmp8; + __cil_tmp9 = (unsigned int)__cil_tmp8; #line 1784 - __cil_tmp10 = (CHAR *)Remainder; + __cil_tmp10 = (CHAR *)Remainder; #line 1784 - __cil_tmp11 = (unsigned int )__cil_tmp10; + __cil_tmp11 = (unsigned int)__cil_tmp10; #line 1784 - if (__cil_tmp11 != __cil_tmp9) { + if (__cil_tmp11 != __cil_tmp9) { #line 1786 - __cil_tmp12 = (unsigned long long )Divisor; + __cil_tmp12 = (unsigned long long)Divisor; #line 1786 - __cil_tmp13 = Dividend.QuadPart % __cil_tmp12; + __cil_tmp13 = Dividend.QuadPart % __cil_tmp12; #line 1786 - *Remainder = (unsigned long )__cil_tmp13; - } else { - - } - } + *Remainder = (unsigned long)__cil_tmp13; + } else { + } + } #line 1789 - return (Quotient); -} + return (Quotient); + } } #line 1796 "C:/NTDDK/inc/ddk/ntddk.h" -__inline LARGE_INTEGER ( __attribute__((__stdcall__)) RtlLargeIntegerNegate)(LARGE_INTEGER Subtrahend ) -{ LARGE_INTEGER Difference ; +__inline LARGE_INTEGER(__attribute__((__stdcall__)) + RtlLargeIntegerNegate)(LARGE_INTEGER Subtrahend) { + LARGE_INTEGER Difference; { #line 1805 - Difference.QuadPart = - Subtrahend.QuadPart; + Difference.QuadPart = -Subtrahend.QuadPart; #line 1806 - return (Difference); -} + return (Difference); + } } #line 1813 "C:/NTDDK/inc/ddk/ntddk.h" -__inline LARGE_INTEGER ( __attribute__((__stdcall__)) RtlLargeIntegerSubtract)(LARGE_INTEGER Minuend , - LARGE_INTEGER Subtrahend ) -{ LARGE_INTEGER Difference ; +__inline LARGE_INTEGER(__attribute__((__stdcall__)) + RtlLargeIntegerSubtract)(LARGE_INTEGER Minuend, + LARGE_INTEGER Subtrahend) { + LARGE_INTEGER Difference; { #line 1823 - Difference.QuadPart = Minuend.QuadPart - Subtrahend.QuadPart; + Difference.QuadPart = Minuend.QuadPart - Subtrahend.QuadPart; #line 1824 - return (Difference); -} + return (Difference); + } } #line 1953 #pragma warning(push) #line 1955 -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #line 1960 "C:/NTDDK/inc/ddk/ntddk.h" -__inline LARGE_INTEGER ( __attribute__((__stdcall__)) RtlConvertLongToLargeInteger)(LONG SignedInteger ) -{ LARGE_INTEGER stub ; +__inline LARGE_INTEGER(__attribute__((__stdcall__)) + RtlConvertLongToLargeInteger)(LONG SignedInteger) { + LARGE_INTEGER stub; { #line 1971 - return (stub); -} + return (stub); + } } #line 1973 "C:/NTDDK/inc/ddk/ntddk.h" -__inline LARGE_INTEGER ( __attribute__((__stdcall__)) RtlConvertUlongToLargeInteger)(ULONG UnsignedInteger ) -{ LARGE_INTEGER stub ; +__inline LARGE_INTEGER(__attribute__((__stdcall__)) + RtlConvertUlongToLargeInteger)(ULONG UnsignedInteger) { + LARGE_INTEGER stub; { #line 1984 - return (stub); -} + return (stub); + } } #line 1986 "C:/NTDDK/inc/ddk/ntddk.h" -__inline LARGE_INTEGER ( __attribute__((__stdcall__)) RtlLargeIntegerShiftLeft)(LARGE_INTEGER LargeInteger , - CCHAR ShiftCount ) -{ LARGE_INTEGER stub ; +__inline LARGE_INTEGER(__attribute__((__stdcall__)) + RtlLargeIntegerShiftLeft)(LARGE_INTEGER LargeInteger, + CCHAR ShiftCount) { + LARGE_INTEGER stub; { #line 2013 - return (stub); -} + return (stub); + } } #line 2015 "C:/NTDDK/inc/ddk/ntddk.h" -__inline LARGE_INTEGER ( __attribute__((__stdcall__)) RtlLargeIntegerShiftRight)(LARGE_INTEGER LargeInteger , - CCHAR ShiftCount ) -{ LARGE_INTEGER stub ; +__inline LARGE_INTEGER(__attribute__((__stdcall__)) + RtlLargeIntegerShiftRight)(LARGE_INTEGER LargeInteger, + CCHAR ShiftCount) { + LARGE_INTEGER stub; { #line 2024 - return (stub); -} + return (stub); + } } #line 2026 "C:/NTDDK/inc/ddk/ntddk.h" -__inline LARGE_INTEGER ( __attribute__((__stdcall__)) RtlLargeIntegerArithmeticShift)(LARGE_INTEGER LargeInteger , - CCHAR ShiftCount ) -{ LARGE_INTEGER stub ; +__inline LARGE_INTEGER(__attribute__((__stdcall__)) + RtlLargeIntegerArithmeticShift)( + LARGE_INTEGER LargeInteger, CCHAR ShiftCount) { + LARGE_INTEGER stub; { #line 2035 - return (stub); -} + return (stub); + } } #line 2038 #pragma warning(pop) #line 2796 "C:/NTDDK/inc/ddk/ntddk.h" -__inline LUID ( __attribute__((__stdcall__)) RtlConvertLongToLuid)(LONG Long ) -{ LUID TempLuid ; - LARGE_INTEGER TempLi ; +__inline LUID(__attribute__((__stdcall__)) RtlConvertLongToLuid)(LONG Long) { + LUID TempLuid; + LARGE_INTEGER TempLi; { - { + { #line 2805 - TempLi = RtlConvertLongToLargeInteger(Long); + TempLi = RtlConvertLongToLargeInteger(Long); #line 2806 - TempLuid.LowPart = TempLi.__annonCompField1.LowPart; + TempLuid.LowPart = TempLi.__annonCompField1.LowPart; #line 2807 - TempLuid.HighPart = TempLi.__annonCompField1.HighPart; - } + TempLuid.HighPart = TempLi.__annonCompField1.HighPart; + } #line 2808 - return (TempLuid); -} + return (TempLuid); + } } #line 2811 "C:/NTDDK/inc/ddk/ntddk.h" -__inline LUID ( __attribute__((__stdcall__)) RtlConvertUlongToLuid)(ULONG Ulong ) -{ LUID TempLuid ; +__inline LUID(__attribute__((__stdcall__)) RtlConvertUlongToLuid)(ULONG Ulong) { + LUID TempLuid; { #line 2819 - TempLuid.LowPart = Ulong; + TempLuid.LowPart = Ulong; #line 2820 - TempLuid.HighPart = 0L; + TempLuid.HighPart = 0L; #line 2821 - return (TempLuid); -} + return (TempLuid); + } } #line 5211 -extern LONG ( __attribute__((__fastcall__)) InterlockedExchange)(PLONG Target , - LONG Value ) ; +extern LONG(__attribute__((__fastcall__)) InterlockedExchange)(PLONG Target, + LONG Value); #line 5253 -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #line 5271 "C:/NTDDK/inc/ddk/ntddk.h" -__inline ULONG KeGetCurrentProcessorNumber(void) -{ +__inline ULONG KeGetCurrentProcessorNumber(void) { { #line 5274 - return (0UL); -} + return (0UL); + } } #line 7015 #pragma warning(push) #line 7017 -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #line 7020 #pragma function(_enable) #line 7021 @@ -2701,6495 +2734,6667 @@ __inline ULONG KeGetCurrentProcessorNumber(void) #line 7025 #pragma warning(pop) #line 25 "C:/NTDDK/inc/pshpack4.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 28 "C:/NTDDK/inc/poppack.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 25 "C:/NTDDK/inc/pshpack1.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 28 "C:/NTDDK/inc/poppack.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 9415 "C:/NTDDK/inc/ddk/ntddk.h" -void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); #line 9451 -LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); #line 9483 -void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); #line 9497 -LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); #line 9506 -NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); #line 9527 -extern KPRIORITY KeSetPriorityThread(PKTHREAD Thread , - KPRIORITY Priority ) ; +extern KPRIORITY KeSetPriorityThread(PKTHREAD Thread, KPRIORITY Priority); #line 9681 -NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); #line 9711 -void ( __attribute__((__stdcall__)) KeInitializeSpinLock)(PKSPIN_LOCK SpinLock ) ; +void(__attribute__((__stdcall__)) KeInitializeSpinLock)(PKSPIN_LOCK SpinLock); #line 9737 -extern KIRQL ( __attribute__((__fastcall__)) KfAcquireSpinLock)(PKSPIN_LOCK SpinLock ) ; +extern KIRQL(__attribute__((__fastcall__)) + KfAcquireSpinLock)(PKSPIN_LOCK SpinLock); #line 9744 -void ( __attribute__((__fastcall__)) KfReleaseSpinLock)(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; +void(__attribute__((__fastcall__)) KfReleaseSpinLock)(PKSPIN_LOCK SpinLock, + KIRQL NewIrql); #line 10159 -PVOID ( __attribute__((__stdcall__)) ExAllocatePoolWithTag)(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; +PVOID(__attribute__((__stdcall__)) ExAllocatePoolWithTag) +(POOL_TYPE PoolType, SIZE_T NumberOfBytes, ULONG Tag); #line 10236 -void ( __attribute__((__stdcall__)) ExFreePool)(PVOID P ) ; +void(__attribute__((__stdcall__)) ExFreePool)(PVOID P); #line 10315 -void ( __attribute__((__fastcall__)) ExAcquireFastMutex)(PFAST_MUTEX FastMutex ) ; +void(__attribute__((__fastcall__)) ExAcquireFastMutex)(PFAST_MUTEX FastMutex); #line 10322 -void ( __attribute__((__fastcall__)) ExReleaseFastMutex)(PFAST_MUTEX FastMutex ) ; +void(__attribute__((__fastcall__)) ExReleaseFastMutex)(PFAST_MUTEX FastMutex); #line 10406 -PLIST_ENTRY ( __attribute__((__fastcall__)) ExfInterlockedInsertHeadList)(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; +PLIST_ENTRY(__attribute__((__fastcall__)) ExfInterlockedInsertHeadList) +(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry, PKSPIN_LOCK Lock); #line 10415 -PLIST_ENTRY ( __attribute__((__fastcall__)) ExfInterlockedInsertTailList)(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; +PLIST_ENTRY(__attribute__((__fastcall__)) ExfInterlockedInsertTailList) +(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry, PKSPIN_LOCK Lock); #line 10424 -PLIST_ENTRY ( __attribute__((__fastcall__)) ExfInterlockedRemoveHeadList)(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; +PLIST_ENTRY(__attribute__((__fastcall__)) ExfInterlockedRemoveHeadList) +(PLIST_ENTRY ListHead, PKSPIN_LOCK Lock); #line 10547 -extern PSINGLE_LIST_ENTRY ( __attribute__((__fastcall__)) ExInterlockedPopEntrySList)(PSLIST_HEADER ListHead , - PKSPIN_LOCK Lock ) ; +extern PSINGLE_LIST_ENTRY(__attribute__((__fastcall__)) + ExInterlockedPopEntrySList)(PSLIST_HEADER ListHead, + PKSPIN_LOCK Lock); #line 10555 -extern PSINGLE_LIST_ENTRY ( __attribute__((__fastcall__)) ExInterlockedPushEntrySList)(PSLIST_HEADER ListHead , - PSINGLE_LIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; +extern PSINGLE_LIST_ENTRY(__attribute__((__fastcall__)) + ExInterlockedPushEntrySList)( + PSLIST_HEADER ListHead, PSINGLE_LIST_ENTRY ListEntry, PKSPIN_LOCK Lock); #line 10643 "C:/NTDDK/inc/ddk/ntddk.h" -__inline PVOID ExAllocateFromNPagedLookasideList(PNPAGED_LOOKASIDE_LIST Lookaside ) -{ PVOID Entry ; - PSINGLE_LIST_ENTRY tmp ; - unsigned int __cil_tmp4 ; - unsigned int __cil_tmp5 ; - unsigned int __cil_tmp6 ; - unsigned int __cil_tmp7 ; - unsigned int __cil_tmp8 ; - unsigned int __cil_tmp9 ; - ULONG __cil_tmp10 ; - SLIST_HEADER *__cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - KSPIN_LOCK *__cil_tmp14 ; - void *__cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - ULONG __cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - PVOID (*__cil_tmp28)(POOL_TYPE PoolType , SIZE_T NumberOfBytes , ULONG Tag ) ; - unsigned int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - POOL_TYPE __cil_tmp32 ; - unsigned int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - ULONG __cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - unsigned int __cil_tmp39 ; - ULONG __cil_tmp40 ; - ULONG *mem_41 ; - ULONG *mem_42 ; - ULONG *mem_43 ; - ULONG *mem_44 ; - PVOID (**mem_45)(POOL_TYPE PoolType , SIZE_T NumberOfBytes , ULONG Tag ) ; - POOL_TYPE *mem_46 ; - ULONG *mem_47 ; - ULONG *mem_48 ; +__inline PVOID +ExAllocateFromNPagedLookasideList(PNPAGED_LOOKASIDE_LIST Lookaside) { + PVOID Entry; + PSINGLE_LIST_ENTRY tmp; + unsigned int __cil_tmp4; + unsigned int __cil_tmp5; + unsigned int __cil_tmp6; + unsigned int __cil_tmp7; + unsigned int __cil_tmp8; + unsigned int __cil_tmp9; + ULONG __cil_tmp10; + SLIST_HEADER *__cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + KSPIN_LOCK *__cil_tmp14; + void *__cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + ULONG __cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + PVOID (*__cil_tmp28)(POOL_TYPE PoolType, SIZE_T NumberOfBytes, ULONG Tag); + unsigned int __cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + POOL_TYPE __cil_tmp32; + unsigned int __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + ULONG __cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + unsigned int __cil_tmp39; + ULONG __cil_tmp40; + ULONG *mem_41; + ULONG *mem_42; + ULONG *mem_43; + ULONG *mem_44; + PVOID (**mem_45)(POOL_TYPE PoolType, SIZE_T NumberOfBytes, ULONG Tag); + POOL_TYPE *mem_46; + ULONG *mem_47; + ULONG *mem_48; { - { + { #line 10672 - __cil_tmp4 = 0 + 12; + __cil_tmp4 = 0 + 12; #line 10672 - __cil_tmp5 = (unsigned int )Lookaside; + __cil_tmp5 = (unsigned int)Lookaside; #line 10672 - __cil_tmp6 = __cil_tmp5 + __cil_tmp4; + __cil_tmp6 = __cil_tmp5 + __cil_tmp4; #line 10672 - __cil_tmp7 = 0 + 12; + __cil_tmp7 = 0 + 12; #line 10672 - __cil_tmp8 = (unsigned int )Lookaside; + __cil_tmp8 = (unsigned int)Lookaside; #line 10672 - __cil_tmp9 = __cil_tmp8 + __cil_tmp7; + __cil_tmp9 = __cil_tmp8 + __cil_tmp7; #line 10672 - mem_41 = (ULONG *)__cil_tmp9; + mem_41 = (ULONG *)__cil_tmp9; #line 10672 - __cil_tmp10 = *mem_41; + __cil_tmp10 = *mem_41; #line 10672 - mem_42 = (ULONG *)__cil_tmp6; + mem_42 = (ULONG *)__cil_tmp6; #line 10672 - *mem_42 = __cil_tmp10 + 1UL; + *mem_42 = __cil_tmp10 + 1UL; #line 10673 - __cil_tmp11 = (SLIST_HEADER *)Lookaside; + __cil_tmp11 = (SLIST_HEADER *)Lookaside; #line 10673 - __cil_tmp12 = (unsigned int )Lookaside; + __cil_tmp12 = (unsigned int)Lookaside; #line 10673 - __cil_tmp13 = __cil_tmp12 + 100; + __cil_tmp13 = __cil_tmp12 + 100; #line 10673 - __cil_tmp14 = (KSPIN_LOCK *)__cil_tmp13; + __cil_tmp14 = (KSPIN_LOCK *)__cil_tmp13; #line 10673 - tmp = ExInterlockedPopEntrySList(__cil_tmp11, __cil_tmp14); + tmp = ExInterlockedPopEntrySList(__cil_tmp11, __cil_tmp14); #line 10673 - Entry = (void *)tmp; - } - { + Entry = (void *)tmp; + } + { #line 10674 - __cil_tmp15 = (void *)0; + __cil_tmp15 = (void *)0; #line 10674 - __cil_tmp16 = (unsigned int )__cil_tmp15; + __cil_tmp16 = (unsigned int)__cil_tmp15; #line 10674 - __cil_tmp17 = (unsigned int )Entry; + __cil_tmp17 = (unsigned int)Entry; #line 10674 - if (__cil_tmp17 == __cil_tmp16) { - { + if (__cil_tmp17 == __cil_tmp16) { + { #line 10675 - __cil_tmp18 = 0 + 16; + __cil_tmp18 = 0 + 16; #line 10675 - __cil_tmp19 = (unsigned int )Lookaside; + __cil_tmp19 = (unsigned int)Lookaside; #line 10675 - __cil_tmp20 = __cil_tmp19 + __cil_tmp18; + __cil_tmp20 = __cil_tmp19 + __cil_tmp18; #line 10675 - __cil_tmp21 = 0 + 16; + __cil_tmp21 = 0 + 16; #line 10675 - __cil_tmp22 = (unsigned int )Lookaside; + __cil_tmp22 = (unsigned int)Lookaside; #line 10675 - __cil_tmp23 = __cil_tmp22 + __cil_tmp21; + __cil_tmp23 = __cil_tmp22 + __cil_tmp21; #line 10675 - mem_43 = (ULONG *)__cil_tmp23; + mem_43 = (ULONG *)__cil_tmp23; #line 10675 - __cil_tmp24 = *mem_43; + __cil_tmp24 = *mem_43; #line 10675 - mem_44 = (ULONG *)__cil_tmp20; + mem_44 = (ULONG *)__cil_tmp20; #line 10675 - *mem_44 = __cil_tmp24 + 1UL; + *mem_44 = __cil_tmp24 + 1UL; #line 10676 - __cil_tmp25 = 0 + 68; + __cil_tmp25 = 0 + 68; #line 10676 - __cil_tmp26 = (unsigned int )Lookaside; + __cil_tmp26 = (unsigned int)Lookaside; #line 10676 - __cil_tmp27 = __cil_tmp26 + __cil_tmp25; + __cil_tmp27 = __cil_tmp26 + __cil_tmp25; #line 10676 - mem_45 = (PVOID (**)(POOL_TYPE PoolType , SIZE_T NumberOfBytes , ULONG Tag ))__cil_tmp27; + mem_45 = (PVOID(**)(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag))__cil_tmp27; #line 10676 - __cil_tmp28 = *mem_45; + __cil_tmp28 = *mem_45; #line 10676 - __cil_tmp29 = 0 + 28; + __cil_tmp29 = 0 + 28; #line 10676 - __cil_tmp30 = (unsigned int )Lookaside; + __cil_tmp30 = (unsigned int)Lookaside; #line 10676 - __cil_tmp31 = __cil_tmp30 + __cil_tmp29; + __cil_tmp31 = __cil_tmp30 + __cil_tmp29; #line 10676 - mem_46 = (POOL_TYPE *)__cil_tmp31; + mem_46 = (POOL_TYPE *)__cil_tmp31; #line 10676 - __cil_tmp32 = *mem_46; + __cil_tmp32 = *mem_46; #line 10676 - __cil_tmp33 = 0 + 64; + __cil_tmp33 = 0 + 64; #line 10676 - __cil_tmp34 = (unsigned int )Lookaside; + __cil_tmp34 = (unsigned int)Lookaside; #line 10676 - __cil_tmp35 = __cil_tmp34 + __cil_tmp33; + __cil_tmp35 = __cil_tmp34 + __cil_tmp33; #line 10676 - mem_47 = (ULONG *)__cil_tmp35; + mem_47 = (ULONG *)__cil_tmp35; #line 10676 - __cil_tmp36 = *mem_47; + __cil_tmp36 = *mem_47; #line 10676 - __cil_tmp37 = 0 + 60; + __cil_tmp37 = 0 + 60; #line 10676 - __cil_tmp38 = (unsigned int )Lookaside; + __cil_tmp38 = (unsigned int)Lookaside; #line 10676 - __cil_tmp39 = __cil_tmp38 + __cil_tmp37; + __cil_tmp39 = __cil_tmp38 + __cil_tmp37; #line 10676 - mem_48 = (ULONG *)__cil_tmp39; + mem_48 = (ULONG *)__cil_tmp39; #line 10676 - __cil_tmp40 = *mem_48; + __cil_tmp40 = *mem_48; #line 10676 - Entry = (*__cil_tmp28)(__cil_tmp32, __cil_tmp36, __cil_tmp40); + Entry = (*__cil_tmp28)(__cil_tmp32, __cil_tmp36, __cil_tmp40); + } + } else { + } } - } else { - - } - } #line 10681 - return (Entry); -} + return (Entry); + } } #line 10684 "C:/NTDDK/inc/ddk/ntddk.h" -__inline void ExFreeToNPagedLookasideList(PNPAGED_LOOKASIDE_LIST Lookaside , PVOID Entry ) -{ unsigned int __cil_tmp3 ; - unsigned int __cil_tmp4 ; - unsigned int __cil_tmp5 ; - unsigned int __cil_tmp6 ; - unsigned int __cil_tmp7 ; - unsigned int __cil_tmp8 ; - ULONG __cil_tmp9 ; - unsigned int __cil_tmp10 ; - unsigned int __cil_tmp11 ; - unsigned int __cil_tmp12 ; - USHORT __cil_tmp13 ; - int __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - USHORT __cil_tmp20 ; - int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - ULONG __cil_tmp28 ; - unsigned int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - void (*__cil_tmp32)(PVOID Buffer ) ; - SLIST_HEADER *__cil_tmp33 ; - struct _SINGLE_LIST_ENTRY *__cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - KSPIN_LOCK *__cil_tmp37 ; - ULONG *mem_38 ; - ULONG *mem_39 ; - USHORT *mem_40 ; - USHORT *mem_41 ; - ULONG *mem_42 ; - ULONG *mem_43 ; - void (**mem_44)(PVOID Buffer ) ; +__inline void ExFreeToNPagedLookasideList(PNPAGED_LOOKASIDE_LIST Lookaside, + PVOID Entry) { + unsigned int __cil_tmp3; + unsigned int __cil_tmp4; + unsigned int __cil_tmp5; + unsigned int __cil_tmp6; + unsigned int __cil_tmp7; + unsigned int __cil_tmp8; + ULONG __cil_tmp9; + unsigned int __cil_tmp10; + unsigned int __cil_tmp11; + unsigned int __cil_tmp12; + USHORT __cil_tmp13; + int __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + USHORT __cil_tmp20; + int __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + ULONG __cil_tmp28; + unsigned int __cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + void (*__cil_tmp32)(PVOID Buffer); + SLIST_HEADER *__cil_tmp33; + struct _SINGLE_LIST_ENTRY *__cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + KSPIN_LOCK *__cil_tmp37; + ULONG *mem_38; + ULONG *mem_39; + USHORT *mem_40; + USHORT *mem_41; + ULONG *mem_42; + ULONG *mem_43; + void (**mem_44)(PVOID Buffer); { #line 10713 - __cil_tmp3 = 0 + 20; + __cil_tmp3 = 0 + 20; #line 10713 - __cil_tmp4 = (unsigned int )Lookaside; + __cil_tmp4 = (unsigned int)Lookaside; #line 10713 - __cil_tmp5 = __cil_tmp4 + __cil_tmp3; + __cil_tmp5 = __cil_tmp4 + __cil_tmp3; #line 10713 - __cil_tmp6 = 0 + 20; + __cil_tmp6 = 0 + 20; #line 10713 - __cil_tmp7 = (unsigned int )Lookaside; + __cil_tmp7 = (unsigned int)Lookaside; #line 10713 - __cil_tmp8 = __cil_tmp7 + __cil_tmp6; + __cil_tmp8 = __cil_tmp7 + __cil_tmp6; #line 10713 - mem_38 = (ULONG *)__cil_tmp8; + mem_38 = (ULONG *)__cil_tmp8; #line 10713 - __cil_tmp9 = *mem_38; + __cil_tmp9 = *mem_38; #line 10713 - mem_39 = (ULONG *)__cil_tmp5; + mem_39 = (ULONG *)__cil_tmp5; #line 10713 - *mem_39 = __cil_tmp9 + 1UL; - { + *mem_39 = __cil_tmp9 + 1UL; + { #line 10714 - __cil_tmp10 = 0 + 8; + __cil_tmp10 = 0 + 8; #line 10714 - __cil_tmp11 = (unsigned int )Lookaside; + __cil_tmp11 = (unsigned int)Lookaside; #line 10714 - __cil_tmp12 = __cil_tmp11 + __cil_tmp10; + __cil_tmp12 = __cil_tmp11 + __cil_tmp10; #line 10714 - mem_40 = (USHORT *)__cil_tmp12; + mem_40 = (USHORT *)__cil_tmp12; #line 10714 - __cil_tmp13 = *mem_40; + __cil_tmp13 = *mem_40; #line 10714 - __cil_tmp14 = (int )__cil_tmp13; + __cil_tmp14 = (int)__cil_tmp13; #line 10714 - __cil_tmp15 = 0 + 4; + __cil_tmp15 = 0 + 4; #line 10714 - __cil_tmp16 = 0 + __cil_tmp15; + __cil_tmp16 = 0 + __cil_tmp15; #line 10714 - __cil_tmp17 = 0 + __cil_tmp16; + __cil_tmp17 = 0 + __cil_tmp16; #line 10714 - __cil_tmp18 = (unsigned int )Lookaside; + __cil_tmp18 = (unsigned int)Lookaside; #line 10714 - __cil_tmp19 = __cil_tmp18 + __cil_tmp17; + __cil_tmp19 = __cil_tmp18 + __cil_tmp17; #line 10714 - mem_41 = (USHORT *)__cil_tmp19; + mem_41 = (USHORT *)__cil_tmp19; #line 10714 - __cil_tmp20 = *mem_41; + __cil_tmp20 = *mem_41; #line 10714 - __cil_tmp21 = (int )__cil_tmp20; + __cil_tmp21 = (int)__cil_tmp20; #line 10714 - if (__cil_tmp21 >= __cil_tmp14) { - { + if (__cil_tmp21 >= __cil_tmp14) { + { #line 10715 - __cil_tmp22 = 0 + 24; + __cil_tmp22 = 0 + 24; #line 10715 - __cil_tmp23 = (unsigned int )Lookaside; + __cil_tmp23 = (unsigned int)Lookaside; #line 10715 - __cil_tmp24 = __cil_tmp23 + __cil_tmp22; + __cil_tmp24 = __cil_tmp23 + __cil_tmp22; #line 10715 - __cil_tmp25 = 0 + 24; + __cil_tmp25 = 0 + 24; #line 10715 - __cil_tmp26 = (unsigned int )Lookaside; + __cil_tmp26 = (unsigned int)Lookaside; #line 10715 - __cil_tmp27 = __cil_tmp26 + __cil_tmp25; + __cil_tmp27 = __cil_tmp26 + __cil_tmp25; #line 10715 - mem_42 = (ULONG *)__cil_tmp27; + mem_42 = (ULONG *)__cil_tmp27; #line 10715 - __cil_tmp28 = *mem_42; + __cil_tmp28 = *mem_42; #line 10715 - mem_43 = (ULONG *)__cil_tmp24; + mem_43 = (ULONG *)__cil_tmp24; #line 10715 - *mem_43 = __cil_tmp28 + 1UL; + *mem_43 = __cil_tmp28 + 1UL; #line 10716 - __cil_tmp29 = 0 + 72; + __cil_tmp29 = 0 + 72; #line 10716 - __cil_tmp30 = (unsigned int )Lookaside; + __cil_tmp30 = (unsigned int)Lookaside; #line 10716 - __cil_tmp31 = __cil_tmp30 + __cil_tmp29; + __cil_tmp31 = __cil_tmp30 + __cil_tmp29; #line 10716 - mem_44 = (void (**)(PVOID Buffer ))__cil_tmp31; + mem_44 = (void (**)(PVOID Buffer))__cil_tmp31; #line 10716 - __cil_tmp32 = *mem_44; + __cil_tmp32 = *mem_44; #line 10716 - (*__cil_tmp32)(Entry); - } - } else { - { + (*__cil_tmp32)(Entry); + } + } else { + { #line 10719 - __cil_tmp33 = (SLIST_HEADER *)Lookaside; + __cil_tmp33 = (SLIST_HEADER *)Lookaside; #line 10719 - __cil_tmp34 = (struct _SINGLE_LIST_ENTRY *)Entry; + __cil_tmp34 = (struct _SINGLE_LIST_ENTRY *)Entry; #line 10719 - __cil_tmp35 = (unsigned int )Lookaside; + __cil_tmp35 = (unsigned int)Lookaside; #line 10719 - __cil_tmp36 = __cil_tmp35 + 100; + __cil_tmp36 = __cil_tmp35 + 100; #line 10719 - __cil_tmp37 = (KSPIN_LOCK *)__cil_tmp36; + __cil_tmp37 = (KSPIN_LOCK *)__cil_tmp36; #line 10719 - ExInterlockedPushEntrySList(__cil_tmp33, __cil_tmp34, __cil_tmp37); + ExInterlockedPushEntrySList(__cil_tmp33, __cil_tmp34, __cil_tmp37); + } + } } - } - } #line 10726 - return; -} + return; + } } #line 11906 -extern void MmProbeAndLockPages(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - LOCK_OPERATION Operation ) ; +extern void MmProbeAndLockPages(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + LOCK_OPERATION Operation); #line 11915 -void MmUnlockPages(PMDL MemoryDescriptorList ) ; +void MmUnlockPages(PMDL MemoryDescriptorList); #line 11979 -PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); #line 12084 -PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); #line 12101 -void MmFreeContiguousMemory(PVOID BaseAddress ) ; +void MmFreeContiguousMemory(PVOID BaseAddress); #line 12172 -void MmResetDriverPaging(PVOID AddressWithinSection ) ; +void MmResetDriverPaging(PVOID AddressWithinSection); #line 12179 -PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; +PVOID MmPageEntireDriver(PVOID AddressWithinSection); #line 12552 -NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); #line 12564 -NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); #line 25 "C:/NTDDK/inc/pshpack4.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 28 "C:/NTDDK/inc/poppack.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 14734 "C:/NTDDK/inc/ddk/ntddk.h" -PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); #line 14807 -PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); #line 14814 -PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); #line 14825 -PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); #line 14875 -NTSTATUS ( __attribute__((__fastcall__)) IofCallDriver)(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; +NTSTATUS(__attribute__((__fastcall__)) IofCallDriver) +(PDEVICE_OBJECT DeviceObject, PIRP Irp); #line 14903 -void ( __attribute__((__fastcall__)) IofCompleteRequest)(PIRP Irp , - CCHAR PriorityBoost ) ; +void(__attribute__((__fastcall__)) IofCompleteRequest)(PIRP Irp, + CCHAR PriorityBoost); #line 14942 -NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); #line 14993 -NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); #line 15057 -void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); #line 15063 -NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); #line 15069 -void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); #line 15092 -void IoFreeIrp(PIRP Irp ) ; +void IoFreeIrp(PIRP Irp); #line 15098 -void IoFreeMdl(PMDL Mdl ) ; +void IoFreeMdl(PMDL Mdl); #line 15110 -PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); #line 15234 -extern void IoGetStackLimits(PULONG_PTR LowLimit , - PULONG_PTR HighLimit ) ; +extern void IoGetStackLimits(PULONG_PTR LowLimit, PULONG_PTR HighLimit); #line 15246 "C:/NTDDK/inc/ddk/ntddk.h" -__inline ULONG_PTR IoGetRemainingStackSize(void) -{ ULONG_PTR Top ; - ULONG_PTR Bottom ; - ULONG_PTR *__cil_tmp3 ; - ULONG_PTR __cil_tmp4 ; - unsigned long __cil_tmp5 ; +__inline ULONG_PTR IoGetRemainingStackSize(void) { + ULONG_PTR Top; + ULONG_PTR Bottom; + ULONG_PTR *__cil_tmp3; + ULONG_PTR __cil_tmp4; + unsigned long __cil_tmp5; { - { + { #line 15255 - IoGetStackLimits(& Bottom, & Top); - } - { + IoGetStackLimits(&Bottom, &Top); + } + { #line 15256 - __cil_tmp3 = & Bottom; + __cil_tmp3 = &Bottom; #line 15256 - __cil_tmp4 = *__cil_tmp3; + __cil_tmp4 = *__cil_tmp3; #line 15256 - __cil_tmp5 = (unsigned long )(& Top); + __cil_tmp5 = (unsigned long)(&Top); #line 15256 - return (__cil_tmp5 - __cil_tmp4); + return (__cil_tmp5 - __cil_tmp4); + } } } -} #line 15426 -NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); #line 15492 -void IoReleaseCancelSpinLock(KIRQL Irql ) ; +void IoReleaseCancelSpinLock(KIRQL Irql); #line 15641 -void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); #line 16436 -NTSTATUS ( __attribute__((__stdcall__)) IoRegisterDeviceInterface)(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; +NTSTATUS(__attribute__((__stdcall__)) IoRegisterDeviceInterface) +(PDEVICE_OBJECT PhysicalDeviceObject, GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, PUNICODE_STRING SymbolicLinkName); #line 16456 -NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); #line 17779 -#pragma warning(disable:4200) +#pragma warning(disable : 4200) #line 17785 -#pragma warning(default:4200) +#pragma warning(default : 4200) #line 18271 -NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); #line 18278 -void PoStartNextPowerIrp(PIRP Irp ) ; +void PoStartNextPowerIrp(PIRP Irp); #line 18326 -NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); #line 18359 -void ( __attribute__((__fastcall__)) ObfDereferenceObject)(PVOID Object ) ; +void(__attribute__((__fastcall__)) ObfDereferenceObject)(PVOID Object); #line 19155 -NTSTATUS ( __attribute__((__stdcall__)) ZwClose)(HANDLE Handle ) ; +NTSTATUS(__attribute__((__stdcall__)) ZwClose)(HANDLE Handle); #line 25 "C:/NTDDK/inc/pshpack1.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 28 "C:/NTDDK/inc/poppack.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 25 "C:/NTDDK/inc/pshpack1.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 28 "C:/NTDDK/inc/poppack.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 25 "C:/NTDDK/inc/pshpack1.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 28 "C:/NTDDK/inc/poppack.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 25 "C:/NTDDK/inc/pshpack1.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 28 "C:/NTDDK/inc/poppack.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 25 "C:/NTDDK/inc/pshpack1.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 28 "C:/NTDDK/inc/poppack.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 212 "C:/NTDDK/inc/mountmgr.h" - __attribute__((__selectany__)) struct _GUID const MOUNTDEV_MOUNTED_DEVICE_GUID = {1408590605UL, - (unsigned short)46783, (unsigned short)4560, {(unsigned char)148, (unsigned char)242, - (unsigned char)0, (unsigned char)160, - (unsigned char)201, (unsigned char)30, - (unsigned char)251, (unsigned char)139}}; +__attribute__(( + __selectany__)) struct _GUID const MOUNTDEV_MOUNTED_DEVICE_GUID = { + 1408590605UL, + (unsigned short)46783, + (unsigned short)4560, + {(unsigned char)148, (unsigned char)242, (unsigned char)0, + (unsigned char)160, (unsigned char)201, (unsigned char)30, + (unsigned char)251, (unsigned char)139}}; #line 265 "./flo_data.h" -DRIVE_MEDIA_LIMITS _DriveMediaLimits[5] = { {(DRIVE_MEDIA_TYPE )4, (DRIVE_MEDIA_TYPE )0}, - {(DRIVE_MEDIA_TYPE )11, (DRIVE_MEDIA_TYPE )6}, - {(DRIVE_MEDIA_TYPE )5, (DRIVE_MEDIA_TYPE )5}, - {(DRIVE_MEDIA_TYPE )13, (DRIVE_MEDIA_TYPE )12}, - {(DRIVE_MEDIA_TYPE )16, (DRIVE_MEDIA_TYPE )14}}; +DRIVE_MEDIA_LIMITS _DriveMediaLimits[5] = { + {(DRIVE_MEDIA_TYPE)4, (DRIVE_MEDIA_TYPE)0}, + {(DRIVE_MEDIA_TYPE)11, (DRIVE_MEDIA_TYPE)6}, + {(DRIVE_MEDIA_TYPE)5, (DRIVE_MEDIA_TYPE)5}, + {(DRIVE_MEDIA_TYPE)13, (DRIVE_MEDIA_TYPE)12}, + {(DRIVE_MEDIA_TYPE)16, (DRIVE_MEDIA_TYPE)14}}; #line 282 "./flo_data.h" -DRIVE_MEDIA_LIMITS_NEC98 _DriveMediaLimits_NEC98[6] = { {(DRIVE_MEDIA_TYPE_NEC98 )4, (DRIVE_MEDIA_TYPE_NEC98 )0}, - {(DRIVE_MEDIA_TYPE_NEC98 )13, (DRIVE_MEDIA_TYPE_NEC98 )5}, - {(DRIVE_MEDIA_TYPE_NEC98 )11, (DRIVE_MEDIA_TYPE_NEC98 )5}, - {(DRIVE_MEDIA_TYPE_NEC98 )18, (DRIVE_MEDIA_TYPE_NEC98 )14}, - {(DRIVE_MEDIA_TYPE_NEC98 )18, (DRIVE_MEDIA_TYPE_NEC98 )14}, - {(DRIVE_MEDIA_TYPE_NEC98 )20, (DRIVE_MEDIA_TYPE_NEC98 )19}}; +DRIVE_MEDIA_LIMITS_NEC98 _DriveMediaLimits_NEC98[6] = { + {(DRIVE_MEDIA_TYPE_NEC98)4, (DRIVE_MEDIA_TYPE_NEC98)0}, + {(DRIVE_MEDIA_TYPE_NEC98)13, (DRIVE_MEDIA_TYPE_NEC98)5}, + {(DRIVE_MEDIA_TYPE_NEC98)11, (DRIVE_MEDIA_TYPE_NEC98)5}, + {(DRIVE_MEDIA_TYPE_NEC98)18, (DRIVE_MEDIA_TYPE_NEC98)14}, + {(DRIVE_MEDIA_TYPE_NEC98)18, (DRIVE_MEDIA_TYPE_NEC98)14}, + {(DRIVE_MEDIA_TYPE_NEC98)20, (DRIVE_MEDIA_TYPE_NEC98)19}}; #line 292 "./flo_data.h" -PDRIVE_MEDIA_LIMITS DriveMediaLimits ; +PDRIVE_MEDIA_LIMITS DriveMediaLimits; #line 334 "./flo_data.h" -DRIVE_MEDIA_CONSTANTS _DriveMediaConstants[17] = +DRIVE_MEDIA_CONSTANTS _DriveMediaConstants[17] = #line 334 - { {(MEDIA_TYPE )10, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)8, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)0, (unsigned char)2, (unsigned char)1, (unsigned char)255, - (unsigned char)254, (unsigned char)0}, - {(MEDIA_TYPE )9, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)9, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)0, (unsigned char)2, (unsigned char)1, (unsigned char)255, - (unsigned char)252, (unsigned char)0}, - {(MEDIA_TYPE )7, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)8, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)0, (unsigned char)2, (unsigned char)2, (unsigned char)255, - (unsigned char)255, (unsigned char)0}, - {(MEDIA_TYPE )8, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)3, - (unsigned short)1024, (unsigned char)4, (unsigned char)128, (unsigned char)240, - (unsigned char)246, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)0, (unsigned char)2, (unsigned char)2, (unsigned char)255, - (unsigned char)255, (unsigned char)0}, - {(MEDIA_TYPE )6, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)9, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)250, (unsigned short)1000, - (unsigned char)39, (unsigned char)0, (unsigned char)2, (unsigned char)2, (unsigned char)255, - (unsigned char)253, (unsigned char)0}, - {(MEDIA_TYPE )5, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)9, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)500, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)2, (unsigned char)2, (unsigned char)255, - (unsigned char)249, (unsigned char)2}, - {(MEDIA_TYPE )10, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)8, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)255, - (unsigned char)254, (unsigned char)0}, - {(MEDIA_TYPE )9, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)9, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)255, - (unsigned char)252, (unsigned char)0}, - {(MEDIA_TYPE )7, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)8, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)1, (unsigned char)1, (unsigned char)2, (unsigned char)255, - (unsigned char)255, (unsigned char)0}, - {(MEDIA_TYPE )8, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)3, - (unsigned short)1024, (unsigned char)4, (unsigned char)128, (unsigned char)240, - (unsigned char)246, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)1, (unsigned char)1, (unsigned char)2, (unsigned char)255, - (unsigned char)255, (unsigned char)0}, - {(MEDIA_TYPE )6, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)9, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)625, (unsigned short)1000, - (unsigned char)39, (unsigned char)1, (unsigned char)1, (unsigned char)2, (unsigned char)255, - (unsigned char)253, (unsigned char)0}, - {(MEDIA_TYPE )1, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)15, (unsigned char)27, (unsigned char)84, - (unsigned char)246, (unsigned char)15, (unsigned short)625, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)249, (unsigned char)0}, - {(MEDIA_TYPE )5, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)9, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)500, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)2, (unsigned char)2, (unsigned char)255, - (unsigned char)249, (unsigned char)2}, - {(MEDIA_TYPE )2, (unsigned char)175, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)18, (unsigned char)27, (unsigned char)101, - (unsigned char)246, (unsigned char)15, (unsigned short)500, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)240, (unsigned char)3}, - {(MEDIA_TYPE )5, (unsigned char)225, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)9, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)500, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)2, (unsigned char)2, (unsigned char)255, - (unsigned char)249, (unsigned char)2}, - {(MEDIA_TYPE )2, (unsigned char)209, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)18, (unsigned char)27, (unsigned char)101, - (unsigned char)246, (unsigned char)15, (unsigned short)500, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)240, (unsigned char)3}, - {(MEDIA_TYPE )3, (unsigned char)161, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)36, (unsigned char)56, (unsigned char)83, - (unsigned char)246, (unsigned char)15, (unsigned short)500, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)3, (unsigned char)2, (unsigned char)255, - (unsigned char)240, (unsigned char)6}}; + {{(MEDIA_TYPE)10, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)8, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)0, + (unsigned char)2, (unsigned char)1, (unsigned char)255, + (unsigned char)254, (unsigned char)0}, + {(MEDIA_TYPE)9, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)9, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)0, + (unsigned char)2, (unsigned char)1, (unsigned char)255, + (unsigned char)252, (unsigned char)0}, + {(MEDIA_TYPE)7, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)8, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)0, + (unsigned char)2, (unsigned char)2, (unsigned char)255, + (unsigned char)255, (unsigned char)0}, + {(MEDIA_TYPE)8, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)3, (unsigned short)1024, + (unsigned char)4, (unsigned char)128, (unsigned char)240, + (unsigned char)246, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)0, + (unsigned char)2, (unsigned char)2, (unsigned char)255, + (unsigned char)255, (unsigned char)0}, + {(MEDIA_TYPE)6, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)9, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)250, + (unsigned short)1000, (unsigned char)39, (unsigned char)0, + (unsigned char)2, (unsigned char)2, (unsigned char)255, + (unsigned char)253, (unsigned char)0}, + {(MEDIA_TYPE)5, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)9, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)500, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)2, (unsigned char)2, (unsigned char)255, + (unsigned char)249, (unsigned char)2}, + {(MEDIA_TYPE)10, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)8, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)1, + (unsigned char)1, (unsigned char)1, (unsigned char)255, + (unsigned char)254, (unsigned char)0}, + {(MEDIA_TYPE)9, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)9, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)1, + (unsigned char)1, (unsigned char)1, (unsigned char)255, + (unsigned char)252, (unsigned char)0}, + {(MEDIA_TYPE)7, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)8, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)1, + (unsigned char)1, (unsigned char)2, (unsigned char)255, + (unsigned char)255, (unsigned char)0}, + {(MEDIA_TYPE)8, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)3, (unsigned short)1024, + (unsigned char)4, (unsigned char)128, (unsigned char)240, + (unsigned char)246, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)1, + (unsigned char)1, (unsigned char)2, (unsigned char)255, + (unsigned char)255, (unsigned char)0}, + {(MEDIA_TYPE)6, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)9, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)625, + (unsigned short)1000, (unsigned char)39, (unsigned char)1, + (unsigned char)1, (unsigned char)2, (unsigned char)255, + (unsigned char)253, (unsigned char)0}, + {(MEDIA_TYPE)1, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)15, (unsigned char)27, (unsigned char)84, + (unsigned char)246, (unsigned char)15, (unsigned short)625, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)249, (unsigned char)0}, + {(MEDIA_TYPE)5, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)9, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)500, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)2, (unsigned char)2, (unsigned char)255, + (unsigned char)249, (unsigned char)2}, + {(MEDIA_TYPE)2, (unsigned char)175, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)18, (unsigned char)27, (unsigned char)101, + (unsigned char)246, (unsigned char)15, (unsigned short)500, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)240, (unsigned char)3}, + {(MEDIA_TYPE)5, (unsigned char)225, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)9, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)500, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)2, (unsigned char)2, (unsigned char)255, + (unsigned char)249, (unsigned char)2}, + {(MEDIA_TYPE)2, (unsigned char)209, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)18, (unsigned char)27, (unsigned char)101, + (unsigned char)246, (unsigned char)15, (unsigned short)500, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)240, (unsigned char)3}, + {(MEDIA_TYPE)3, (unsigned char)161, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)36, (unsigned char)56, (unsigned char)83, + (unsigned char)246, (unsigned char)15, (unsigned short)500, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)3, (unsigned char)2, (unsigned char)255, + (unsigned char)240, (unsigned char)6}}; #line 358 "./flo_data.h" -DRIVE_MEDIA_CONSTANTS _DriveMediaConstants_NEC98[21] = +DRIVE_MEDIA_CONSTANTS _DriveMediaConstants_NEC98[21] = #line 358 - { {(MEDIA_TYPE )10, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)8, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)0, (unsigned char)2, (unsigned char)1, (unsigned char)255, - (unsigned char)254, (unsigned char)0}, - {(MEDIA_TYPE )9, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)9, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)0, (unsigned char)2, (unsigned char)1, (unsigned char)255, - (unsigned char)252, (unsigned char)0}, - {(MEDIA_TYPE )7, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)8, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)0, (unsigned char)2, (unsigned char)2, (unsigned char)255, - (unsigned char)255, (unsigned char)0}, - {(MEDIA_TYPE )8, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)3, - (unsigned short)1024, (unsigned char)4, (unsigned char)128, (unsigned char)240, - (unsigned char)246, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)0, (unsigned char)2, (unsigned char)2, (unsigned char)255, - (unsigned char)255, (unsigned char)0}, - {(MEDIA_TYPE )6, (unsigned char)223, (unsigned char)2, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)9, (unsigned char)42, (unsigned char)80, - (unsigned char)246, (unsigned char)15, (unsigned short)250, (unsigned short)1000, - (unsigned char)39, (unsigned char)0, (unsigned char)2, (unsigned char)2, (unsigned char)255, - (unsigned char)253, (unsigned char)0}, - {(MEDIA_TYPE )10, (unsigned char)223, (unsigned char)22, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)8, (unsigned char)42, (unsigned char)80, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)1, (unsigned char)2, (unsigned char)1, (unsigned char)255, - (unsigned char)254, (unsigned char)0}, - {(MEDIA_TYPE )9, (unsigned char)223, (unsigned char)22, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)9, (unsigned char)42, (unsigned char)80, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)1, (unsigned char)2, (unsigned char)1, (unsigned char)255, - (unsigned char)252, (unsigned char)0}, - {(MEDIA_TYPE )7, (unsigned char)223, (unsigned char)22, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)8, (unsigned char)42, (unsigned char)80, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)1, (unsigned char)2, (unsigned char)2, (unsigned char)255, - (unsigned char)255, (unsigned char)0}, - {(MEDIA_TYPE )8, (unsigned char)223, (unsigned char)22, (unsigned char)37, (unsigned char)3, - (unsigned short)1024, (unsigned char)4, (unsigned char)128, (unsigned char)240, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)1, (unsigned char)2, (unsigned char)2, (unsigned char)255, - (unsigned char)255, (unsigned char)0}, - {(MEDIA_TYPE )6, (unsigned char)223, (unsigned char)22, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)9, (unsigned char)42, (unsigned char)80, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)39, (unsigned char)1, (unsigned char)2, (unsigned char)2, (unsigned char)255, - (unsigned char)253, (unsigned char)0}, - {(MEDIA_TYPE )15, (unsigned char)223, (unsigned char)22, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)8, (unsigned char)42, (unsigned char)80, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)251, (unsigned char)0}, - {(MEDIA_TYPE )16, (unsigned char)223, (unsigned char)22, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)9, (unsigned char)42, (unsigned char)80, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)249, (unsigned char)2}, - {(MEDIA_TYPE )1, (unsigned char)207, (unsigned char)36, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)15, (unsigned char)27, (unsigned char)84, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)249, (unsigned char)0}, - {(MEDIA_TYPE )19, (unsigned char)207, (unsigned char)36, (unsigned char)37, (unsigned char)3, - (unsigned short)1024, (unsigned char)8, (unsigned char)53, (unsigned char)116, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)76, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)254, (unsigned char)0}, - {(MEDIA_TYPE )14, (unsigned char)223, (unsigned char)22, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)8, (unsigned char)42, (unsigned char)80, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)251, (unsigned char)0}, - {(MEDIA_TYPE )5, (unsigned char)223, (unsigned char)22, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)9, (unsigned char)42, (unsigned char)80, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)249, (unsigned char)2}, - {(MEDIA_TYPE )17, (unsigned char)207, (unsigned char)36, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)15, (unsigned char)27, (unsigned char)84, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)249, (unsigned char)0}, - {(MEDIA_TYPE )18, (unsigned char)207, (unsigned char)36, (unsigned char)37, (unsigned char)3, - (unsigned short)1024, (unsigned char)8, (unsigned char)53, (unsigned char)116, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)76, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)254, (unsigned char)0}, - {(MEDIA_TYPE )2, (unsigned char)223, (unsigned char)36, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)18, (unsigned char)27, (unsigned char)108, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)240, (unsigned char)3}, - {(MEDIA_TYPE )1, (unsigned char)191, (unsigned char)50, (unsigned char)37, (unsigned char)2, - (unsigned short)512, (unsigned char)15, (unsigned char)27, (unsigned char)84, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)79, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)249, (unsigned char)0}, - {(MEDIA_TYPE )19, (unsigned char)191, (unsigned char)50, (unsigned char)37, (unsigned char)3, - (unsigned short)1024, (unsigned char)8, (unsigned char)53, (unsigned char)116, - (unsigned char)229, (unsigned char)15, (unsigned short)1000, (unsigned short)1000, - (unsigned char)76, (unsigned char)0, (unsigned char)0, (unsigned char)2, (unsigned char)255, - (unsigned char)254, (unsigned char)0}}; + {{(MEDIA_TYPE)10, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)8, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)0, + (unsigned char)2, (unsigned char)1, (unsigned char)255, + (unsigned char)254, (unsigned char)0}, + {(MEDIA_TYPE)9, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)9, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)0, + (unsigned char)2, (unsigned char)1, (unsigned char)255, + (unsigned char)252, (unsigned char)0}, + {(MEDIA_TYPE)7, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)8, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)0, + (unsigned char)2, (unsigned char)2, (unsigned char)255, + (unsigned char)255, (unsigned char)0}, + {(MEDIA_TYPE)8, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)3, (unsigned short)1024, + (unsigned char)4, (unsigned char)128, (unsigned char)240, + (unsigned char)246, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)0, + (unsigned char)2, (unsigned char)2, (unsigned char)255, + (unsigned char)255, (unsigned char)0}, + {(MEDIA_TYPE)6, (unsigned char)223, (unsigned char)2, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)9, (unsigned char)42, (unsigned char)80, + (unsigned char)246, (unsigned char)15, (unsigned short)250, + (unsigned short)1000, (unsigned char)39, (unsigned char)0, + (unsigned char)2, (unsigned char)2, (unsigned char)255, + (unsigned char)253, (unsigned char)0}, + {(MEDIA_TYPE)10, (unsigned char)223, (unsigned char)22, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)8, (unsigned char)42, (unsigned char)80, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)1, + (unsigned char)2, (unsigned char)1, (unsigned char)255, + (unsigned char)254, (unsigned char)0}, + {(MEDIA_TYPE)9, (unsigned char)223, (unsigned char)22, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)9, (unsigned char)42, (unsigned char)80, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)1, + (unsigned char)2, (unsigned char)1, (unsigned char)255, + (unsigned char)252, (unsigned char)0}, + {(MEDIA_TYPE)7, (unsigned char)223, (unsigned char)22, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)8, (unsigned char)42, (unsigned char)80, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)1, + (unsigned char)2, (unsigned char)2, (unsigned char)255, + (unsigned char)255, (unsigned char)0}, + {(MEDIA_TYPE)8, (unsigned char)223, (unsigned char)22, + (unsigned char)37, (unsigned char)3, (unsigned short)1024, + (unsigned char)4, (unsigned char)128, (unsigned char)240, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)1, + (unsigned char)2, (unsigned char)2, (unsigned char)255, + (unsigned char)255, (unsigned char)0}, + {(MEDIA_TYPE)6, (unsigned char)223, (unsigned char)22, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)9, (unsigned char)42, (unsigned char)80, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)39, (unsigned char)1, + (unsigned char)2, (unsigned char)2, (unsigned char)255, + (unsigned char)253, (unsigned char)0}, + {(MEDIA_TYPE)15, (unsigned char)223, (unsigned char)22, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)8, (unsigned char)42, (unsigned char)80, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)251, (unsigned char)0}, + {(MEDIA_TYPE)16, (unsigned char)223, (unsigned char)22, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)9, (unsigned char)42, (unsigned char)80, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)249, (unsigned char)2}, + {(MEDIA_TYPE)1, (unsigned char)207, (unsigned char)36, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)15, (unsigned char)27, (unsigned char)84, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)249, (unsigned char)0}, + {(MEDIA_TYPE)19, (unsigned char)207, (unsigned char)36, + (unsigned char)37, (unsigned char)3, (unsigned short)1024, + (unsigned char)8, (unsigned char)53, (unsigned char)116, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)76, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)254, (unsigned char)0}, + {(MEDIA_TYPE)14, (unsigned char)223, (unsigned char)22, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)8, (unsigned char)42, (unsigned char)80, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)251, (unsigned char)0}, + {(MEDIA_TYPE)5, (unsigned char)223, (unsigned char)22, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)9, (unsigned char)42, (unsigned char)80, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)249, (unsigned char)2}, + {(MEDIA_TYPE)17, (unsigned char)207, (unsigned char)36, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)15, (unsigned char)27, (unsigned char)84, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)249, (unsigned char)0}, + {(MEDIA_TYPE)18, (unsigned char)207, (unsigned char)36, + (unsigned char)37, (unsigned char)3, (unsigned short)1024, + (unsigned char)8, (unsigned char)53, (unsigned char)116, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)76, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)254, (unsigned char)0}, + {(MEDIA_TYPE)2, (unsigned char)223, (unsigned char)36, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)18, (unsigned char)27, (unsigned char)108, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)240, (unsigned char)3}, + {(MEDIA_TYPE)1, (unsigned char)191, (unsigned char)50, + (unsigned char)37, (unsigned char)2, (unsigned short)512, + (unsigned char)15, (unsigned char)27, (unsigned char)84, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)79, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)249, (unsigned char)0}, + {(MEDIA_TYPE)19, (unsigned char)191, (unsigned char)50, + (unsigned char)37, (unsigned char)3, (unsigned short)1024, + (unsigned char)8, (unsigned char)53, (unsigned char)116, + (unsigned char)229, (unsigned char)15, (unsigned short)1000, + (unsigned short)1000, (unsigned char)76, (unsigned char)0, + (unsigned char)0, (unsigned char)2, (unsigned char)255, + (unsigned char)254, (unsigned char)0}}; #line 399 "./flo_data.h" -PDRIVE_MEDIA_CONSTANTS DriveMediaConstants ; +PDRIVE_MEDIA_CONSTANTS DriveMediaConstants; #line 595 "./flo_data.h" -SENSE_DEVISE_STATUS_PTOS Result_Status3_PTOS[4] ; +SENSE_DEVISE_STATUS_PTOS Result_Status3_PTOS[4]; #line 603 -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) ; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath); #line 609 -void FloppyUnload(PDRIVER_OBJECT DriverObject ) ; +void FloppyUnload(PDRIVER_OBJECT DriverObject); #line 614 -NTSTATUS FlConfigCallBack(PVOID Context , PUNICODE_STRING PathName , INTERFACE_TYPE BusType , - ULONG BusNumber , PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ; +NTSTATUS FlConfigCallBack(PVOID Context, PUNICODE_STRING PathName, + INTERFACE_TYPE BusType, ULONG BusNumber, + PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, + ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, + ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation); #line 629 -NTSTATUS FlInitializeControllerHardware(PDISKETTE_EXTENSION DisketteExtension ) ; +NTSTATUS FlInitializeControllerHardware(PDISKETTE_EXTENSION DisketteExtension); #line 634 -NTSTATUS FloppyCreateClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; +NTSTATUS FloppyCreateClose(PDEVICE_OBJECT DeviceObject, PIRP Irp); #line 640 -NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; +NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); #line 646 -NTSTATUS FloppyReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; +NTSTATUS FloppyReadWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp); #line 652 -NTSTATUS FlRecalibrateDrive(PDISKETTE_EXTENSION DisketteExtension ) ; +NTSTATUS FlRecalibrateDrive(PDISKETTE_EXTENSION DisketteExtension); #line 657 -NTSTATUS FlDatarateSpecifyConfigure(PDISKETTE_EXTENSION DisketteExtension ) ; +NTSTATUS FlDatarateSpecifyConfigure(PDISKETTE_EXTENSION DisketteExtension); #line 662 -NTSTATUS FlStartDrive(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp , BOOLEAN WriteOperation , - BOOLEAN SetUpMedia , BOOLEAN IgnoreChange ) ; +NTSTATUS FlStartDrive(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp, + BOOLEAN WriteOperation, BOOLEAN SetUpMedia, + BOOLEAN IgnoreChange); #line 671 -void FlFinishOperation(PIRP Irp , PDISKETTE_EXTENSION DisketteExtension ) ; +void FlFinishOperation(PIRP Irp, PDISKETTE_EXTENSION DisketteExtension); #line 677 -NTSTATUS FlDetermineMediaType(PDISKETTE_EXTENSION DisketteExtension ) ; +NTSTATUS FlDetermineMediaType(PDISKETTE_EXTENSION DisketteExtension); #line 682 -void FloppyThread(PVOID Context ) ; +void FloppyThread(PVOID Context); #line 687 -NTSTATUS FlReadWrite(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp , BOOLEAN DriveStarted ) ; +NTSTATUS FlReadWrite(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp, + BOOLEAN DriveStarted); #line 694 -NTSTATUS FlFormat(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp ) ; +NTSTATUS FlFormat(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp); #line 700 -NTSTATUS FlIssueCommand(PDISKETTE_EXTENSION DisketteExtension , PUCHAR FifoInBuffer , - PUCHAR FifoOutBuffer , PMDL IoMdl , ULONG IoOffset , ULONG TransferBytes ) ; +NTSTATUS FlIssueCommand(PDISKETTE_EXTENSION DisketteExtension, + PUCHAR FifoInBuffer, PUCHAR FifoOutBuffer, PMDL IoMdl, + ULONG IoOffset, ULONG TransferBytes); #line 710 -BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension , PFORMAT_PARAMETERS FormatParameters ) ; +BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension, + PFORMAT_PARAMETERS FormatParameters); #line 724 -NTSTATUS FlQueueIrpToThread(PIRP Irp , PDISKETTE_EXTENSION DisketteExtension ) ; +NTSTATUS FlQueueIrpToThread(PIRP Irp, PDISKETTE_EXTENSION DisketteExtension); #line 730 -NTSTATUS FlInterpretError(UCHAR StatusRegister1 , UCHAR StatusRegister2 ) ; +NTSTATUS FlInterpretError(UCHAR StatusRegister1, UCHAR StatusRegister2); #line 736 -void FlAllocateIoBuffer(PDISKETTE_EXTENSION DisketteExtension , ULONG BufferSize ) ; +void FlAllocateIoBuffer(PDISKETTE_EXTENSION DisketteExtension, + ULONG BufferSize); #line 742 -void FlFreeIoBuffer(PDISKETTE_EXTENSION DisketteExtension ) ; +void FlFreeIoBuffer(PDISKETTE_EXTENSION DisketteExtension); #line 747 -void FlConsolidateMediaTypeWithBootSector(PDISKETTE_EXTENSION DisketteExtension , - PBOOT_SECTOR_INFO BootSector ) ; +void FlConsolidateMediaTypeWithBootSector(PDISKETTE_EXTENSION DisketteExtension, + PBOOT_SECTOR_INFO BootSector); #line 753 -void FlCheckBootSector(PDISKETTE_EXTENSION DisketteExtension ) ; +void FlCheckBootSector(PDISKETTE_EXTENSION DisketteExtension); #line 758 -NTSTATUS FlReadWriteTrack(PDISKETTE_EXTENSION DisketteExtension , PMDL IoMdl , ULONG IoOffset , - BOOLEAN WriteOperation , UCHAR Cylinder , UCHAR Head , UCHAR Sector , - UCHAR NumberOfSectors , BOOLEAN NeedSeek ) ; +NTSTATUS FlReadWriteTrack(PDISKETTE_EXTENSION DisketteExtension, PMDL IoMdl, + ULONG IoOffset, BOOLEAN WriteOperation, + UCHAR Cylinder, UCHAR Head, UCHAR Sector, + UCHAR NumberOfSectors, BOOLEAN NeedSeek); #line 771 -NTSTATUS FlFdcDeviceIo(PDEVICE_OBJECT DeviceObject , ULONG Ioctl , PVOID Data ) ; +NTSTATUS FlFdcDeviceIo(PDEVICE_OBJECT DeviceObject, ULONG Ioctl, PVOID Data); #line 778 -NTSTATUS FloppyAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) ; +NTSTATUS FloppyAddDevice(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject); #line 784 -NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; +NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp); #line 790 -NTSTATUS FloppyPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; +NTSTATUS FloppyPower(PDEVICE_OBJECT DeviceObject, PIRP Irp); #line 796 -NTSTATUS FloppyPnpComplete(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; +NTSTATUS FloppyPnpComplete(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context); #line 803 -NTSTATUS FloppyQueueRequest(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp ) ; +NTSTATUS FloppyQueueRequest(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp); #line 809 -NTSTATUS FloppyStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; +NTSTATUS FloppyStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); #line 815 -void FloppyProcessQueuedRequests(PDISKETTE_EXTENSION DisketteExtension ) ; +void FloppyProcessQueuedRequests(PDISKETTE_EXTENSION DisketteExtension); #line 820 -void FloppyCancelQueuedRequest(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; +void FloppyCancelQueuedRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp); #line 826 -NTSTATUS FlAcpiConfigureFloppy(PDISKETTE_EXTENSION DisketteExtension , PFDC_INFO FdcInfo ) ; +NTSTATUS FlAcpiConfigureFloppy(PDISKETTE_EXTENSION DisketteExtension, + PFDC_INFO FdcInfo); #line 832 -NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension ) ; +NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension); #line 47 "floppy.c" -#pragma alloc_text(INIT,DriverEntry) +#pragma alloc_text(INIT, DriverEntry) #line 49 -#pragma alloc_text(PAGE,FloppyAddDevice) +#pragma alloc_text(PAGE, FloppyAddDevice) #line 50 -#pragma alloc_text(PAGE,FloppyPnp) +#pragma alloc_text(PAGE, FloppyPnp) #line 51 -#pragma alloc_text(PAGE,FloppyPower) +#pragma alloc_text(PAGE, FloppyPower) #line 52 -#pragma alloc_text(PAGE,FlConfigCallBack) +#pragma alloc_text(PAGE, FlConfigCallBack) #line 53 -#pragma alloc_text(PAGE,FlInitializeControllerHardware) +#pragma alloc_text(PAGE, FlInitializeControllerHardware) #line 54 -#pragma alloc_text(PAGE,FlInterpretError) +#pragma alloc_text(PAGE, FlInterpretError) #line 55 -#pragma alloc_text(PAGE,FlDatarateSpecifyConfigure) +#pragma alloc_text(PAGE, FlDatarateSpecifyConfigure) #line 56 -#pragma alloc_text(PAGE,FlRecalibrateDrive) +#pragma alloc_text(PAGE, FlRecalibrateDrive) #line 57 -#pragma alloc_text(PAGE,FlDetermineMediaType) +#pragma alloc_text(PAGE, FlDetermineMediaType) #line 58 -#pragma alloc_text(PAGE,FlCheckBootSector) +#pragma alloc_text(PAGE, FlCheckBootSector) #line 59 -#pragma alloc_text(PAGE,FlConsolidateMediaTypeWithBootSector) +#pragma alloc_text(PAGE, FlConsolidateMediaTypeWithBootSector) #line 60 -#pragma alloc_text(PAGE,FlIssueCommand) +#pragma alloc_text(PAGE, FlIssueCommand) #line 61 -#pragma alloc_text(PAGE,FlReadWriteTrack) +#pragma alloc_text(PAGE, FlReadWriteTrack) #line 62 -#pragma alloc_text(PAGE,FlReadWrite) +#pragma alloc_text(PAGE, FlReadWrite) #line 63 -#pragma alloc_text(PAGE,FlFormat) +#pragma alloc_text(PAGE, FlFormat) #line 64 -#pragma alloc_text(PAGE,FlFinishOperation) +#pragma alloc_text(PAGE, FlFinishOperation) #line 65 -#pragma alloc_text(PAGE,FlStartDrive) +#pragma alloc_text(PAGE, FlStartDrive) #line 66 -#pragma alloc_text(PAGE,FloppyThread) +#pragma alloc_text(PAGE, FloppyThread) #line 67 -#pragma alloc_text(PAGE,FlAllocateIoBuffer) +#pragma alloc_text(PAGE, FlAllocateIoBuffer) #line 68 -#pragma alloc_text(PAGE,FlFreeIoBuffer) +#pragma alloc_text(PAGE, FlFreeIoBuffer) #line 69 -#pragma alloc_text(PAGE,FloppyCreateClose) +#pragma alloc_text(PAGE, FloppyCreateClose) #line 70 -#pragma alloc_text(PAGE,FloppyDeviceControl) +#pragma alloc_text(PAGE, FloppyDeviceControl) #line 71 -#pragma alloc_text(PAGE,FloppyReadWrite) +#pragma alloc_text(PAGE, FloppyReadWrite) #line 72 -#pragma alloc_text(PAGE,FlCheckFormatParameters) +#pragma alloc_text(PAGE, FlCheckFormatParameters) #line 73 -#pragma alloc_text(PAGE,FlFdcDeviceIo) +#pragma alloc_text(PAGE, FlFdcDeviceIo) #line 74 -#pragma alloc_text(PAGE,FlHdbit) +#pragma alloc_text(PAGE, FlHdbit) #line 101 "floppy.c" -NTSTATUS myStatus ; +NTSTATUS myStatus; #line 103 "floppy.c" -int s ; +int s; #line 105 "floppy.c" -int pended ; +int pended; #line 106 "floppy.c" -NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; +NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); #line 107 "floppy.c" -int compRegistered ; +int compRegistered; #line 108 "floppy.c" -int lowerDriverReturn ; +int lowerDriverReturn; #line 109 "floppy.c" -int setEventCalled ; +int setEventCalled; #line 110 "floppy.c" -int customIrp ; +int customIrp; #line 135 "floppy.c" -ULONG PagingReferenceCount = 0UL; +ULONG PagingReferenceCount = 0UL; #line 136 "floppy.c" -PFAST_MUTEX PagingMutex = (struct _FAST_MUTEX *)((void *)0); +PFAST_MUTEX PagingMutex = (struct _FAST_MUTEX *)((void *)0); #line 139 "floppy.c" -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) -{ NTSTATUS ntStatus ; - PVOID tmp ; - unsigned int __cil_tmp5 ; - unsigned int __cil_tmp6 ; - unsigned int __cil_tmp7 ; - unsigned int __cil_tmp8 ; - unsigned int __cil_tmp9 ; - unsigned int __cil_tmp10 ; - unsigned int __cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - unsigned int __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - unsigned int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - unsigned int __cil_tmp32 ; - unsigned int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - PDRIVER_EXTENSION __cil_tmp37 ; - unsigned int __cil_tmp38 ; - unsigned int __cil_tmp39 ; - enum _POOL_TYPE __cil_tmp40 ; - unsigned long __cil_tmp41 ; - void *__cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - unsigned int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - KEVENT *__cil_tmp49 ; - enum _EVENT_TYPE __cil_tmp50 ; - void *__cil_tmp51 ; - KUSER_SHARED_DATA *__cil_tmp52 ; - unsigned int __cil_tmp53 ; - unsigned int __cil_tmp54 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp55 ; - int __cil_tmp56 ; - unsigned int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - DRIVE_MEDIA_LIMITS_NEC98 *__cil_tmp59 ; - unsigned int __cil_tmp60 ; - unsigned int __cil_tmp61 ; - KUSER_SHARED_DATA *__cil_tmp62 ; - unsigned int __cil_tmp63 ; - unsigned int __cil_tmp64 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp65 ; - int __cil_tmp66 ; - unsigned int __cil_tmp67 ; - unsigned int __cil_tmp68 ; - unsigned int __cil_tmp69 ; - unsigned int __cil_tmp70 ; - PDRIVER_DISPATCH *mem_71 ; - PDRIVER_DISPATCH *mem_72 ; - PDRIVER_DISPATCH *mem_73 ; - PDRIVER_DISPATCH *mem_74 ; - PDRIVER_DISPATCH *mem_75 ; - PDRIVER_DISPATCH *mem_76 ; - PDRIVER_DISPATCH *mem_77 ; - void (**mem_78)(struct _DRIVER_OBJECT *DriverObject ) ; - PDRIVER_EXTENSION *mem_79 ; - NTSTATUS (**mem_80)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ; - LONG *mem_81 ; - ULONG *mem_82 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_83 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_84 ; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, + PUNICODE_STRING RegistryPath) { + NTSTATUS ntStatus; + PVOID tmp; + unsigned int __cil_tmp5; + unsigned int __cil_tmp6; + unsigned int __cil_tmp7; + unsigned int __cil_tmp8; + unsigned int __cil_tmp9; + unsigned int __cil_tmp10; + unsigned int __cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + unsigned int __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + unsigned int __cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + unsigned int __cil_tmp32; + unsigned int __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + PDRIVER_EXTENSION __cil_tmp37; + unsigned int __cil_tmp38; + unsigned int __cil_tmp39; + enum _POOL_TYPE __cil_tmp40; + unsigned long __cil_tmp41; + void *__cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + unsigned int __cil_tmp47; + unsigned int __cil_tmp48; + KEVENT *__cil_tmp49; + enum _EVENT_TYPE __cil_tmp50; + void *__cil_tmp51; + KUSER_SHARED_DATA *__cil_tmp52; + unsigned int __cil_tmp53; + unsigned int __cil_tmp54; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp55; + int __cil_tmp56; + unsigned int __cil_tmp57; + unsigned int __cil_tmp58; + DRIVE_MEDIA_LIMITS_NEC98 *__cil_tmp59; + unsigned int __cil_tmp60; + unsigned int __cil_tmp61; + KUSER_SHARED_DATA *__cil_tmp62; + unsigned int __cil_tmp63; + unsigned int __cil_tmp64; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp65; + int __cil_tmp66; + unsigned int __cil_tmp67; + unsigned int __cil_tmp68; + unsigned int __cil_tmp69; + unsigned int __cil_tmp70; + PDRIVER_DISPATCH *mem_71; + PDRIVER_DISPATCH *mem_72; + PDRIVER_DISPATCH *mem_73; + PDRIVER_DISPATCH *mem_74; + PDRIVER_DISPATCH *mem_75; + PDRIVER_DISPATCH *mem_76; + PDRIVER_DISPATCH *mem_77; + void (**mem_78)(struct _DRIVER_OBJECT * DriverObject); + PDRIVER_EXTENSION *mem_79; + NTSTATUS(**mem_80) + (struct _DRIVER_OBJECT * DriverObject, + struct _DEVICE_OBJECT * PhysicalDeviceObject); + LONG *mem_81; + ULONG *mem_82; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_83; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_84; { #line 170 - ntStatus = 0L; - { + ntStatus = 0L; + { #line 242 - while (1) { - while_0_continue: /* CIL Label */ ; - goto while_0_break; - } - while_0_break: /* CIL Label */ ; - } - { + while (1) { + while_0_continue: /* CIL Label */; + goto while_0_break; + } + while_0_break: /* CIL Label */; + } + { #line 247 - __cil_tmp5 = 0 * 4U; + __cil_tmp5 = 0 * 4U; #line 247 - __cil_tmp6 = 56 + __cil_tmp5; + __cil_tmp6 = 56 + __cil_tmp5; #line 247 - __cil_tmp7 = (unsigned int )DriverObject; + __cil_tmp7 = (unsigned int)DriverObject; #line 247 - __cil_tmp8 = __cil_tmp7 + __cil_tmp6; + __cil_tmp8 = __cil_tmp7 + __cil_tmp6; #line 247 - mem_71 = (PDRIVER_DISPATCH *)__cil_tmp8; + mem_71 = (PDRIVER_DISPATCH *)__cil_tmp8; #line 247 - *mem_71 = & FloppyCreateClose; + *mem_71 = &FloppyCreateClose; #line 248 - __cil_tmp9 = 2 * 4U; + __cil_tmp9 = 2 * 4U; #line 248 - __cil_tmp10 = 56 + __cil_tmp9; + __cil_tmp10 = 56 + __cil_tmp9; #line 248 - __cil_tmp11 = (unsigned int )DriverObject; + __cil_tmp11 = (unsigned int)DriverObject; #line 248 - __cil_tmp12 = __cil_tmp11 + __cil_tmp10; + __cil_tmp12 = __cil_tmp11 + __cil_tmp10; #line 248 - mem_72 = (PDRIVER_DISPATCH *)__cil_tmp12; + mem_72 = (PDRIVER_DISPATCH *)__cil_tmp12; #line 248 - *mem_72 = & FloppyCreateClose; + *mem_72 = &FloppyCreateClose; #line 249 - __cil_tmp13 = 3 * 4U; + __cil_tmp13 = 3 * 4U; #line 249 - __cil_tmp14 = 56 + __cil_tmp13; + __cil_tmp14 = 56 + __cil_tmp13; #line 249 - __cil_tmp15 = (unsigned int )DriverObject; + __cil_tmp15 = (unsigned int)DriverObject; #line 249 - __cil_tmp16 = __cil_tmp15 + __cil_tmp14; + __cil_tmp16 = __cil_tmp15 + __cil_tmp14; #line 249 - mem_73 = (PDRIVER_DISPATCH *)__cil_tmp16; + mem_73 = (PDRIVER_DISPATCH *)__cil_tmp16; #line 249 - *mem_73 = & FloppyReadWrite; + *mem_73 = &FloppyReadWrite; #line 250 - __cil_tmp17 = 4 * 4U; + __cil_tmp17 = 4 * 4U; #line 250 - __cil_tmp18 = 56 + __cil_tmp17; + __cil_tmp18 = 56 + __cil_tmp17; #line 250 - __cil_tmp19 = (unsigned int )DriverObject; + __cil_tmp19 = (unsigned int)DriverObject; #line 250 - __cil_tmp20 = __cil_tmp19 + __cil_tmp18; + __cil_tmp20 = __cil_tmp19 + __cil_tmp18; #line 250 - mem_74 = (PDRIVER_DISPATCH *)__cil_tmp20; + mem_74 = (PDRIVER_DISPATCH *)__cil_tmp20; #line 250 - *mem_74 = & FloppyReadWrite; + *mem_74 = &FloppyReadWrite; #line 251 - __cil_tmp21 = 14 * 4U; + __cil_tmp21 = 14 * 4U; #line 251 - __cil_tmp22 = 56 + __cil_tmp21; + __cil_tmp22 = 56 + __cil_tmp21; #line 251 - __cil_tmp23 = (unsigned int )DriverObject; + __cil_tmp23 = (unsigned int)DriverObject; #line 251 - __cil_tmp24 = __cil_tmp23 + __cil_tmp22; + __cil_tmp24 = __cil_tmp23 + __cil_tmp22; #line 251 - mem_75 = (PDRIVER_DISPATCH *)__cil_tmp24; + mem_75 = (PDRIVER_DISPATCH *)__cil_tmp24; #line 251 - *mem_75 = & FloppyDeviceControl; + *mem_75 = &FloppyDeviceControl; #line 252 - __cil_tmp25 = 27 * 4U; + __cil_tmp25 = 27 * 4U; #line 252 - __cil_tmp26 = 56 + __cil_tmp25; + __cil_tmp26 = 56 + __cil_tmp25; #line 252 - __cil_tmp27 = (unsigned int )DriverObject; + __cil_tmp27 = (unsigned int)DriverObject; #line 252 - __cil_tmp28 = __cil_tmp27 + __cil_tmp26; + __cil_tmp28 = __cil_tmp27 + __cil_tmp26; #line 252 - mem_76 = (PDRIVER_DISPATCH *)__cil_tmp28; + mem_76 = (PDRIVER_DISPATCH *)__cil_tmp28; #line 252 - *mem_76 = & FloppyPnp; + *mem_76 = &FloppyPnp; #line 253 - __cil_tmp29 = 22 * 4U; + __cil_tmp29 = 22 * 4U; #line 253 - __cil_tmp30 = 56 + __cil_tmp29; + __cil_tmp30 = 56 + __cil_tmp29; #line 253 - __cil_tmp31 = (unsigned int )DriverObject; + __cil_tmp31 = (unsigned int)DriverObject; #line 253 - __cil_tmp32 = __cil_tmp31 + __cil_tmp30; + __cil_tmp32 = __cil_tmp31 + __cil_tmp30; #line 253 - mem_77 = (PDRIVER_DISPATCH *)__cil_tmp32; + mem_77 = (PDRIVER_DISPATCH *)__cil_tmp32; #line 253 - *mem_77 = & FloppyPower; + *mem_77 = &FloppyPower; #line 255 - __cil_tmp33 = (unsigned int )DriverObject; + __cil_tmp33 = (unsigned int)DriverObject; #line 255 - __cil_tmp34 = __cil_tmp33 + 52; + __cil_tmp34 = __cil_tmp33 + 52; #line 255 - mem_78 = (void (**)(struct _DRIVER_OBJECT *DriverObject ))__cil_tmp34; + mem_78 = (void (**)(struct _DRIVER_OBJECT * DriverObject)) __cil_tmp34; #line 255 - *mem_78 = & FloppyUnload; + *mem_78 = &FloppyUnload; #line 257 - __cil_tmp35 = (unsigned int )DriverObject; + __cil_tmp35 = (unsigned int)DriverObject; #line 257 - __cil_tmp36 = __cil_tmp35 + 24; + __cil_tmp36 = __cil_tmp35 + 24; #line 257 - mem_79 = (PDRIVER_EXTENSION *)__cil_tmp36; + mem_79 = (PDRIVER_EXTENSION *)__cil_tmp36; #line 257 - __cil_tmp37 = *mem_79; + __cil_tmp37 = *mem_79; #line 257 - __cil_tmp38 = (unsigned int )__cil_tmp37; + __cil_tmp38 = (unsigned int)__cil_tmp37; #line 257 - __cil_tmp39 = __cil_tmp38 + 4; + __cil_tmp39 = __cil_tmp38 + 4; #line 257 - mem_80 = (NTSTATUS (**)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ))__cil_tmp39; + mem_80 = (NTSTATUS(**)(struct _DRIVER_OBJECT * DriverObject, + struct _DEVICE_OBJECT * PhysicalDeviceObject)) + __cil_tmp39; #line 257 - *mem_80 = & FloppyAddDevice; + *mem_80 = &FloppyAddDevice; #line 262 - __cil_tmp40 = (enum _POOL_TYPE )0; + __cil_tmp40 = (enum _POOL_TYPE)0; #line 262 - __cil_tmp41 = (unsigned long )32U; + __cil_tmp41 = (unsigned long)32U; #line 262 - tmp = ExAllocatePoolWithTag(__cil_tmp40, __cil_tmp41, 1886350406UL); + tmp = ExAllocatePoolWithTag(__cil_tmp40, __cil_tmp41, 1886350406UL); #line 262 - PagingMutex = (struct _FAST_MUTEX *)tmp; - } - { + PagingMutex = (struct _FAST_MUTEX *)tmp; + } + { #line 264 - __cil_tmp42 = (void *)0; + __cil_tmp42 = (void *)0; #line 264 - __cil_tmp43 = (unsigned int )__cil_tmp42; + __cil_tmp43 = (unsigned int)__cil_tmp42; #line 264 - __cil_tmp44 = (unsigned int )PagingMutex; + __cil_tmp44 = (unsigned int)PagingMutex; #line 264 - if (__cil_tmp44 == __cil_tmp43) { + if (__cil_tmp44 == __cil_tmp43) { #line 266 - return (-1073741670L); - } else { - - } - } - { + return (-1073741670L); + } else { + } + } + { #line 269 - mem_81 = (LONG *)PagingMutex; + mem_81 = (LONG *)PagingMutex; #line 269 - *mem_81 = 1L; + *mem_81 = 1L; #line 269 - __cil_tmp45 = (unsigned int )PagingMutex; + __cil_tmp45 = (unsigned int)PagingMutex; #line 269 - __cil_tmp46 = __cil_tmp45 + 8; + __cil_tmp46 = __cil_tmp45 + 8; #line 269 - mem_82 = (ULONG *)__cil_tmp46; + mem_82 = (ULONG *)__cil_tmp46; #line 269 - *mem_82 = 0UL; + *mem_82 = 0UL; #line 269 - __cil_tmp47 = (unsigned int )PagingMutex; + __cil_tmp47 = (unsigned int)PagingMutex; #line 269 - __cil_tmp48 = __cil_tmp47 + 12; + __cil_tmp48 = __cil_tmp47 + 12; #line 269 - __cil_tmp49 = (KEVENT *)__cil_tmp48; + __cil_tmp49 = (KEVENT *)__cil_tmp48; #line 269 - __cil_tmp50 = (enum _EVENT_TYPE )1; + __cil_tmp50 = (enum _EVENT_TYPE)1; #line 269 - KeInitializeEvent(__cil_tmp49, __cil_tmp50, (unsigned char)0); + KeInitializeEvent(__cil_tmp49, __cil_tmp50, (unsigned char)0); #line 274 - __cil_tmp51 = (void *)(& DriverEntry); + __cil_tmp51 = (void *)(&DriverEntry); #line 274 - MmPageEntireDriver(__cil_tmp51); - } - { + MmPageEntireDriver(__cil_tmp51); + } + { #line 276 - __cil_tmp52 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp52 = (KUSER_SHARED_DATA * const)4292804608U; #line 276 - __cil_tmp53 = (unsigned int )__cil_tmp52; + __cil_tmp53 = (unsigned int)__cil_tmp52; #line 276 - __cil_tmp54 = __cil_tmp53 + 732; + __cil_tmp54 = __cil_tmp53 + 732; #line 276 - mem_83 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp54; + mem_83 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp54; #line 276 - __cil_tmp55 = *mem_83; + __cil_tmp55 = *mem_83; #line 276 - __cil_tmp56 = (int )__cil_tmp55; + __cil_tmp56 = (int)__cil_tmp55; #line 276 - if (__cil_tmp56 == 1) { + if (__cil_tmp56 == 1) { #line 276 - __cil_tmp57 = 0 * 64U; + __cil_tmp57 = 0 * 64U; #line 276 - __cil_tmp58 = (unsigned int )(_DriveMediaLimits_NEC98) + __cil_tmp57; + __cil_tmp58 = (unsigned int)(_DriveMediaLimits_NEC98) + __cil_tmp57; #line 276 - __cil_tmp59 = (DRIVE_MEDIA_LIMITS_NEC98 *)__cil_tmp58; + __cil_tmp59 = (DRIVE_MEDIA_LIMITS_NEC98 *)__cil_tmp58; #line 276 - DriveMediaLimits = (struct _DRIVE_MEDIA_LIMITS *)__cil_tmp59; - } else { + DriveMediaLimits = (struct _DRIVE_MEDIA_LIMITS *)__cil_tmp59; + } else { #line 276 - __cil_tmp60 = 0 * 64U; + __cil_tmp60 = 0 * 64U; #line 276 - __cil_tmp61 = (unsigned int )(_DriveMediaLimits) + __cil_tmp60; + __cil_tmp61 = (unsigned int)(_DriveMediaLimits) + __cil_tmp60; #line 276 - DriveMediaLimits = (DRIVE_MEDIA_LIMITS *)__cil_tmp61; - } - } - { + DriveMediaLimits = (DRIVE_MEDIA_LIMITS *)__cil_tmp61; + } + } + { #line 279 - __cil_tmp62 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp62 = (KUSER_SHARED_DATA * const)4292804608U; #line 279 - __cil_tmp63 = (unsigned int )__cil_tmp62; + __cil_tmp63 = (unsigned int)__cil_tmp62; #line 279 - __cil_tmp64 = __cil_tmp63 + 732; + __cil_tmp64 = __cil_tmp63 + 732; #line 279 - mem_84 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp64; + mem_84 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp64; #line 279 - __cil_tmp65 = *mem_84; + __cil_tmp65 = *mem_84; #line 279 - __cil_tmp66 = (int )__cil_tmp65; + __cil_tmp66 = (int)__cil_tmp65; #line 279 - if (__cil_tmp66 == 1) { + if (__cil_tmp66 == 1) { #line 279 - __cil_tmp67 = 0 * 56U; + __cil_tmp67 = 0 * 56U; #line 279 - __cil_tmp68 = (unsigned int )(_DriveMediaConstants_NEC98) + __cil_tmp67; + __cil_tmp68 = (unsigned int)(_DriveMediaConstants_NEC98) + __cil_tmp67; #line 279 - DriveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp68; - } else { + DriveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp68; + } else { #line 279 - __cil_tmp69 = 0 * 56U; + __cil_tmp69 = 0 * 56U; #line 279 - __cil_tmp70 = (unsigned int )(_DriveMediaConstants) + __cil_tmp69; + __cil_tmp70 = (unsigned int)(_DriveMediaConstants) + __cil_tmp69; #line 279 - DriveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp70; - } - } + DriveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp70; + } + } #line 282 - return (ntStatus); -} + return (ntStatus); + } } #line 285 "floppy.c" -void FloppyUnload(PDRIVER_OBJECT DriverObject ) -{ void *__cil_tmp2 ; +void FloppyUnload(PDRIVER_OBJECT DriverObject) { + void *__cil_tmp2; { - { + { #line 308 - while (1) { - while_1_continue: /* CIL Label */ ; - goto while_1_break; - } - while_1_break: /* CIL Label */ ; - } - { + while (1) { + while_1_continue: /* CIL Label */; + goto while_1_break; + } + while_1_break: /* CIL Label */; + } + { #line 318 - __cil_tmp2 = (void *)PagingMutex; + __cil_tmp2 = (void *)PagingMutex; #line 318 - ExFreePool(__cil_tmp2); - } + ExFreePool(__cil_tmp2); + } #line 322 - return; -} + return; + } } #line 323 "floppy.c" -NTSTATUS FloppyAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) -{ NTSTATUS ntStatus ; - PDEVICE_OBJECT deviceObject ; - PDISKETTE_EXTENSION disketteExtension ; - FDC_INFO fdcInfo ; - UCHAR arcNameBuffer[256] ; - STRING arcNameString ; - WCHAR deviceNameBuffer[20] ; - UNICODE_STRING deviceName ; - USHORT i ; - USHORT tmp ; - PVOID tmp___0 ; - PCONFIGURATION_INFORMATION tmp___1 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - int __cil_tmp17 ; - int __cil_tmp18 ; - int __cil_tmp19 ; - int __cil_tmp20 ; - unsigned long __cil_tmp21 ; - void *__cil_tmp22 ; - int __cil_tmp23 ; - int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - WCHAR *__cil_tmp27 ; - wchar_t const *__cil_tmp28 ; - unsigned int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - WCHAR *__cil_tmp31 ; - WCHAR const *__cil_tmp32 ; - unsigned long __cil_tmp33 ; - int __cil_tmp34 ; - PDEVICE_OBJECT *__cil_tmp35 ; - PDEVICE_OBJECT __cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - PVOID __cil_tmp39 ; - enum _POOL_TYPE __cil_tmp40 ; - UNICODE_STRING *__cil_tmp41 ; - USHORT __cil_tmp42 ; - unsigned long __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - void *__cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - unsigned int __cil_tmp51 ; - PWSTR __cil_tmp52 ; - unsigned int __cil_tmp53 ; - PDEVICE_OBJECT *__cil_tmp54 ; - PDEVICE_OBJECT __cil_tmp55 ; - unsigned int __cil_tmp56 ; - unsigned int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - unsigned int __cil_tmp59 ; - unsigned int __cil_tmp60 ; - UNICODE_STRING *__cil_tmp61 ; - unsigned int __cil_tmp62 ; - unsigned int __cil_tmp63 ; - UNICODE_STRING *__cil_tmp64 ; - unsigned int __cil_tmp65 ; - unsigned int __cil_tmp66 ; - unsigned int __cil_tmp67 ; - unsigned int __cil_tmp68 ; - ULONG __cil_tmp69 ; - unsigned int __cil_tmp70 ; - unsigned int __cil_tmp71 ; - UCHAR *__cil_tmp72 ; - char *__cil_tmp73 ; - unsigned int __cil_tmp74 ; - ULONG __cil_tmp75 ; - unsigned int __cil_tmp76 ; - ULONG __cil_tmp77 ; - unsigned int __cil_tmp78 ; - ULONG __cil_tmp79 ; - unsigned int __cil_tmp80 ; - unsigned int __cil_tmp81 ; - UCHAR *__cil_tmp82 ; - char const *__cil_tmp83 ; - unsigned int __cil_tmp84 ; - unsigned int __cil_tmp85 ; - UNICODE_STRING *__cil_tmp86 ; - unsigned int __cil_tmp87 ; - unsigned int __cil_tmp88 ; - UNICODE_STRING *__cil_tmp89 ; - PDEVICE_OBJECT *__cil_tmp90 ; - PDEVICE_OBJECT __cil_tmp91 ; - unsigned int __cil_tmp92 ; - unsigned int __cil_tmp93 ; - PDEVICE_OBJECT *__cil_tmp94 ; - PDEVICE_OBJECT __cil_tmp95 ; - unsigned int __cil_tmp96 ; - unsigned int __cil_tmp97 ; - ULONG __cil_tmp98 ; - PDEVICE_OBJECT *__cil_tmp99 ; - PDEVICE_OBJECT __cil_tmp100 ; - unsigned int __cil_tmp101 ; - unsigned int __cil_tmp102 ; - ULONG __cil_tmp103 ; - PDEVICE_OBJECT *__cil_tmp104 ; - PDEVICE_OBJECT __cil_tmp105 ; - unsigned int __cil_tmp106 ; - unsigned int __cil_tmp107 ; - PDEVICE_OBJECT *__cil_tmp108 ; - PDEVICE_OBJECT __cil_tmp109 ; - unsigned int __cil_tmp110 ; - unsigned int __cil_tmp111 ; - PDEVICE_OBJECT *__cil_tmp112 ; - PDEVICE_OBJECT __cil_tmp113 ; - unsigned int __cil_tmp114 ; - unsigned int __cil_tmp115 ; - ULONG __cil_tmp116 ; - unsigned int __cil_tmp117 ; - unsigned int __cil_tmp118 ; - unsigned int __cil_tmp119 ; - unsigned int __cil_tmp120 ; - unsigned int __cil_tmp121 ; - unsigned int __cil_tmp122 ; - PDEVICE_OBJECT *__cil_tmp123 ; - PDEVICE_OBJECT __cil_tmp124 ; - unsigned int __cil_tmp125 ; - unsigned int __cil_tmp126 ; - KSEMAPHORE *__cil_tmp127 ; - unsigned int __cil_tmp128 ; - unsigned int __cil_tmp129 ; - unsigned int __cil_tmp130 ; - unsigned int __cil_tmp131 ; - unsigned int __cil_tmp132 ; - unsigned int __cil_tmp133 ; - unsigned int __cil_tmp134 ; - unsigned int __cil_tmp135 ; - KEVENT *__cil_tmp136 ; - enum _EVENT_TYPE __cil_tmp137 ; - unsigned int __cil_tmp138 ; - unsigned int __cil_tmp139 ; - KSPIN_LOCK *__cil_tmp140 ; - unsigned int __cil_tmp141 ; - unsigned int __cil_tmp142 ; - unsigned int __cil_tmp143 ; - unsigned int __cil_tmp144 ; - unsigned int __cil_tmp145 ; - unsigned int __cil_tmp146 ; - unsigned int __cil_tmp147 ; - unsigned int __cil_tmp148 ; - KEVENT *__cil_tmp149 ; - enum _EVENT_TYPE __cil_tmp150 ; - unsigned int __cil_tmp151 ; - unsigned int __cil_tmp152 ; - unsigned int __cil_tmp153 ; - unsigned int __cil_tmp154 ; - unsigned int __cil_tmp155 ; - unsigned int __cil_tmp156 ; - unsigned int __cil_tmp157 ; - unsigned int __cil_tmp158 ; - KEVENT *__cil_tmp159 ; - enum _EVENT_TYPE __cil_tmp160 ; - unsigned int __cil_tmp161 ; - unsigned int __cil_tmp162 ; - unsigned int __cil_tmp163 ; - unsigned int __cil_tmp164 ; - unsigned int __cil_tmp165 ; - unsigned int __cil_tmp166 ; - unsigned int __cil_tmp167 ; - unsigned int __cil_tmp168 ; - unsigned int __cil_tmp169 ; - unsigned int __cil_tmp170 ; - unsigned int __cil_tmp171 ; - unsigned int __cil_tmp172 ; - unsigned int __cil_tmp173 ; - unsigned int __cil_tmp174 ; - unsigned int __cil_tmp175 ; - unsigned int __cil_tmp176 ; - unsigned int __cil_tmp177 ; - unsigned int __cil_tmp178 ; - unsigned int __cil_tmp179 ; - unsigned int __cil_tmp180 ; - unsigned int __cil_tmp181 ; - unsigned int __cil_tmp182 ; - unsigned int __cil_tmp183 ; - unsigned int __cil_tmp184 ; - unsigned int __cil_tmp185 ; - unsigned int __cil_tmp186 ; - unsigned int __cil_tmp187 ; - unsigned int __cil_tmp188 ; - unsigned int __cil_tmp189 ; - unsigned int __cil_tmp190 ; - KSPIN_LOCK *__cil_tmp191 ; - KSPIN_LOCK *__cil_tmp192 ; - unsigned int __cil_tmp193 ; - unsigned int __cil_tmp194 ; - unsigned int __cil_tmp195 ; - unsigned int __cil_tmp196 ; - unsigned int __cil_tmp197 ; - unsigned int __cil_tmp198 ; - PDEVICE_OBJECT *__cil_tmp199 ; - unsigned int __cil_tmp200 ; - unsigned int __cil_tmp201 ; - unsigned int __cil_tmp202 ; - unsigned int __cil_tmp203 ; - KUSER_SHARED_DATA *__cil_tmp204 ; - unsigned int __cil_tmp205 ; - unsigned int __cil_tmp206 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp207 ; - int __cil_tmp208 ; - unsigned int __cil_tmp209 ; - unsigned int __cil_tmp210 ; - unsigned int __cil_tmp211 ; - unsigned int __cil_tmp212 ; - ULONG *mem_213 ; - ULONG *mem_214 ; - PVOID *mem_215 ; - USHORT *mem_216 ; - PWSTR *mem_217 ; - PWSTR *mem_218 ; - USHORT *mem_219 ; - USHORT *mem_220 ; - USHORT *mem_221 ; - ULONG *mem_222 ; - ULONG *mem_223 ; - ULONG *mem_224 ; - ULONG *mem_225 ; - ULONG *mem_226 ; - ULONG *mem_227 ; - ULONG *mem_228 ; - ULONG *mem_229 ; - ULONG *mem_230 ; - ULONG *mem_231 ; - ULONG *mem_232 ; - PDRIVER_OBJECT *mem_233 ; - PDEVICE_OBJECT *mem_234 ; - PDEVICE_OBJECT *mem_235 ; - LONG *mem_236 ; - ULONG *mem_237 ; - LONG *mem_238 ; - ULONG *mem_239 ; - LONG *mem_240 ; - ULONG *mem_241 ; - struct _LIST_ENTRY **mem_242 ; - struct _LIST_ENTRY **mem_243 ; - struct _LIST_ENTRY **mem_244 ; - LONG *mem_245 ; - BOOLEAN *mem_246 ; - BOOLEAN *mem_247 ; - BOOLEAN *mem_248 ; - struct _LIST_ENTRY **mem_249 ; - struct _LIST_ENTRY **mem_250 ; - struct _LIST_ENTRY **mem_251 ; - BOOLEAN *mem_252 ; - BOOLEAN *mem_253 ; - PDEVICE_OBJECT *mem_254 ; - BOOLEAN *mem_255 ; - MEDIA_TYPE *mem_256 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_257 ; - BOOLEAN *mem_258 ; - BOOLEAN *mem_259 ; +NTSTATUS FloppyAddDevice(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject) { + NTSTATUS ntStatus; + PDEVICE_OBJECT deviceObject; + PDISKETTE_EXTENSION disketteExtension; + FDC_INFO fdcInfo; + UCHAR arcNameBuffer[256]; + STRING arcNameString; + WCHAR deviceNameBuffer[20]; + UNICODE_STRING deviceName; + USHORT i; + USHORT tmp; + PVOID tmp___0; + PCONFIGURATION_INFORMATION tmp___1; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + int __cil_tmp17; + int __cil_tmp18; + int __cil_tmp19; + int __cil_tmp20; + unsigned long __cil_tmp21; + void *__cil_tmp22; + int __cil_tmp23; + int __cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + WCHAR *__cil_tmp27; + wchar_t const *__cil_tmp28; + unsigned int __cil_tmp29; + unsigned int __cil_tmp30; + WCHAR *__cil_tmp31; + WCHAR const *__cil_tmp32; + unsigned long __cil_tmp33; + int __cil_tmp34; + PDEVICE_OBJECT *__cil_tmp35; + PDEVICE_OBJECT __cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + PVOID __cil_tmp39; + enum _POOL_TYPE __cil_tmp40; + UNICODE_STRING *__cil_tmp41; + USHORT __cil_tmp42; + unsigned long __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + void *__cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + unsigned int __cil_tmp51; + PWSTR __cil_tmp52; + unsigned int __cil_tmp53; + PDEVICE_OBJECT *__cil_tmp54; + PDEVICE_OBJECT __cil_tmp55; + unsigned int __cil_tmp56; + unsigned int __cil_tmp57; + unsigned int __cil_tmp58; + unsigned int __cil_tmp59; + unsigned int __cil_tmp60; + UNICODE_STRING *__cil_tmp61; + unsigned int __cil_tmp62; + unsigned int __cil_tmp63; + UNICODE_STRING *__cil_tmp64; + unsigned int __cil_tmp65; + unsigned int __cil_tmp66; + unsigned int __cil_tmp67; + unsigned int __cil_tmp68; + ULONG __cil_tmp69; + unsigned int __cil_tmp70; + unsigned int __cil_tmp71; + UCHAR *__cil_tmp72; + char *__cil_tmp73; + unsigned int __cil_tmp74; + ULONG __cil_tmp75; + unsigned int __cil_tmp76; + ULONG __cil_tmp77; + unsigned int __cil_tmp78; + ULONG __cil_tmp79; + unsigned int __cil_tmp80; + unsigned int __cil_tmp81; + UCHAR *__cil_tmp82; + char const *__cil_tmp83; + unsigned int __cil_tmp84; + unsigned int __cil_tmp85; + UNICODE_STRING *__cil_tmp86; + unsigned int __cil_tmp87; + unsigned int __cil_tmp88; + UNICODE_STRING *__cil_tmp89; + PDEVICE_OBJECT *__cil_tmp90; + PDEVICE_OBJECT __cil_tmp91; + unsigned int __cil_tmp92; + unsigned int __cil_tmp93; + PDEVICE_OBJECT *__cil_tmp94; + PDEVICE_OBJECT __cil_tmp95; + unsigned int __cil_tmp96; + unsigned int __cil_tmp97; + ULONG __cil_tmp98; + PDEVICE_OBJECT *__cil_tmp99; + PDEVICE_OBJECT __cil_tmp100; + unsigned int __cil_tmp101; + unsigned int __cil_tmp102; + ULONG __cil_tmp103; + PDEVICE_OBJECT *__cil_tmp104; + PDEVICE_OBJECT __cil_tmp105; + unsigned int __cil_tmp106; + unsigned int __cil_tmp107; + PDEVICE_OBJECT *__cil_tmp108; + PDEVICE_OBJECT __cil_tmp109; + unsigned int __cil_tmp110; + unsigned int __cil_tmp111; + PDEVICE_OBJECT *__cil_tmp112; + PDEVICE_OBJECT __cil_tmp113; + unsigned int __cil_tmp114; + unsigned int __cil_tmp115; + ULONG __cil_tmp116; + unsigned int __cil_tmp117; + unsigned int __cil_tmp118; + unsigned int __cil_tmp119; + unsigned int __cil_tmp120; + unsigned int __cil_tmp121; + unsigned int __cil_tmp122; + PDEVICE_OBJECT *__cil_tmp123; + PDEVICE_OBJECT __cil_tmp124; + unsigned int __cil_tmp125; + unsigned int __cil_tmp126; + KSEMAPHORE *__cil_tmp127; + unsigned int __cil_tmp128; + unsigned int __cil_tmp129; + unsigned int __cil_tmp130; + unsigned int __cil_tmp131; + unsigned int __cil_tmp132; + unsigned int __cil_tmp133; + unsigned int __cil_tmp134; + unsigned int __cil_tmp135; + KEVENT *__cil_tmp136; + enum _EVENT_TYPE __cil_tmp137; + unsigned int __cil_tmp138; + unsigned int __cil_tmp139; + KSPIN_LOCK *__cil_tmp140; + unsigned int __cil_tmp141; + unsigned int __cil_tmp142; + unsigned int __cil_tmp143; + unsigned int __cil_tmp144; + unsigned int __cil_tmp145; + unsigned int __cil_tmp146; + unsigned int __cil_tmp147; + unsigned int __cil_tmp148; + KEVENT *__cil_tmp149; + enum _EVENT_TYPE __cil_tmp150; + unsigned int __cil_tmp151; + unsigned int __cil_tmp152; + unsigned int __cil_tmp153; + unsigned int __cil_tmp154; + unsigned int __cil_tmp155; + unsigned int __cil_tmp156; + unsigned int __cil_tmp157; + unsigned int __cil_tmp158; + KEVENT *__cil_tmp159; + enum _EVENT_TYPE __cil_tmp160; + unsigned int __cil_tmp161; + unsigned int __cil_tmp162; + unsigned int __cil_tmp163; + unsigned int __cil_tmp164; + unsigned int __cil_tmp165; + unsigned int __cil_tmp166; + unsigned int __cil_tmp167; + unsigned int __cil_tmp168; + unsigned int __cil_tmp169; + unsigned int __cil_tmp170; + unsigned int __cil_tmp171; + unsigned int __cil_tmp172; + unsigned int __cil_tmp173; + unsigned int __cil_tmp174; + unsigned int __cil_tmp175; + unsigned int __cil_tmp176; + unsigned int __cil_tmp177; + unsigned int __cil_tmp178; + unsigned int __cil_tmp179; + unsigned int __cil_tmp180; + unsigned int __cil_tmp181; + unsigned int __cil_tmp182; + unsigned int __cil_tmp183; + unsigned int __cil_tmp184; + unsigned int __cil_tmp185; + unsigned int __cil_tmp186; + unsigned int __cil_tmp187; + unsigned int __cil_tmp188; + unsigned int __cil_tmp189; + unsigned int __cil_tmp190; + KSPIN_LOCK *__cil_tmp191; + KSPIN_LOCK *__cil_tmp192; + unsigned int __cil_tmp193; + unsigned int __cil_tmp194; + unsigned int __cil_tmp195; + unsigned int __cil_tmp196; + unsigned int __cil_tmp197; + unsigned int __cil_tmp198; + PDEVICE_OBJECT *__cil_tmp199; + unsigned int __cil_tmp200; + unsigned int __cil_tmp201; + unsigned int __cil_tmp202; + unsigned int __cil_tmp203; + KUSER_SHARED_DATA *__cil_tmp204; + unsigned int __cil_tmp205; + unsigned int __cil_tmp206; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp207; + int __cil_tmp208; + unsigned int __cil_tmp209; + unsigned int __cil_tmp210; + unsigned int __cil_tmp211; + unsigned int __cil_tmp212; + ULONG *mem_213; + ULONG *mem_214; + PVOID *mem_215; + USHORT *mem_216; + PWSTR *mem_217; + PWSTR *mem_218; + USHORT *mem_219; + USHORT *mem_220; + USHORT *mem_221; + ULONG *mem_222; + ULONG *mem_223; + ULONG *mem_224; + ULONG *mem_225; + ULONG *mem_226; + ULONG *mem_227; + ULONG *mem_228; + ULONG *mem_229; + ULONG *mem_230; + ULONG *mem_231; + ULONG *mem_232; + PDRIVER_OBJECT *mem_233; + PDEVICE_OBJECT *mem_234; + PDEVICE_OBJECT *mem_235; + LONG *mem_236; + ULONG *mem_237; + LONG *mem_238; + ULONG *mem_239; + LONG *mem_240; + ULONG *mem_241; + struct _LIST_ENTRY **mem_242; + struct _LIST_ENTRY **mem_243; + struct _LIST_ENTRY **mem_244; + LONG *mem_245; + BOOLEAN *mem_246; + BOOLEAN *mem_247; + BOOLEAN *mem_248; + struct _LIST_ENTRY **mem_249; + struct _LIST_ENTRY **mem_250; + struct _LIST_ENTRY **mem_251; + BOOLEAN *mem_252; + BOOLEAN *mem_253; + PDEVICE_OBJECT *mem_254; + BOOLEAN *mem_255; + MEDIA_TYPE *mem_256; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_257; + BOOLEAN *mem_258; + BOOLEAN *mem_259; { #line 363 - ntStatus = 0L; - { + ntStatus = 0L; + { #line 365 - while (1) { - while_2_continue: /* CIL Label */ ; - goto while_2_break; - } - while_2_break: /* CIL Label */ ; - } - { + while (1) { + while_2_continue: /* CIL Label */; + goto while_2_break; + } + while_2_break: /* CIL Label */; + } + { #line 370 - __cil_tmp15 = (unsigned int )(& fdcInfo) + 128; + __cil_tmp15 = (unsigned int)(&fdcInfo) + 128; #line 370 - mem_213 = (ULONG *)__cil_tmp15; + mem_213 = (ULONG *)__cil_tmp15; #line 370 - *mem_213 = 0UL; + *mem_213 = 0UL; #line 371 - __cil_tmp16 = (unsigned int )(& fdcInfo) + 132; + __cil_tmp16 = (unsigned int)(&fdcInfo) + 132; #line 371 - mem_214 = (ULONG *)__cil_tmp16; + mem_214 = (ULONG *)__cil_tmp16; #line 371 - *mem_214 = 0UL; + *mem_214 = 0UL; #line 373 - __cil_tmp17 = 770 << 2; + __cil_tmp17 = 770 << 2; #line 373 - __cil_tmp18 = 7 << 16; + __cil_tmp18 = 7 << 16; #line 373 - __cil_tmp19 = __cil_tmp18 | __cil_tmp17; + __cil_tmp19 = __cil_tmp18 | __cil_tmp17; #line 373 - __cil_tmp20 = __cil_tmp19 | 3; + __cil_tmp20 = __cil_tmp19 | 3; #line 373 - __cil_tmp21 = (unsigned long )__cil_tmp20; + __cil_tmp21 = (unsigned long)__cil_tmp20; #line 373 - __cil_tmp22 = (void *)(& fdcInfo); + __cil_tmp22 = (void *)(&fdcInfo); #line 373 - ntStatus = FlFdcDeviceIo(PhysicalDeviceObject, __cil_tmp21, __cil_tmp22); - } + ntStatus = FlFdcDeviceIo(PhysicalDeviceObject, __cil_tmp21, __cil_tmp22); + } #line 377 - if (ntStatus >= 0L) { + if (ntStatus >= 0L) { #line 379 - i = (unsigned short)0; - { -#line 385 - while (1) { - while_3_continue: /* CIL Label */ ; + i = (unsigned short)0; { +#line 385 + while (1) { + while_3_continue: /* CIL Label */; + { #line 387 - tmp = i; + tmp = i; #line 387 - __cil_tmp23 = (int )i; + __cil_tmp23 = (int)i; #line 387 - __cil_tmp24 = __cil_tmp23 + 1; + __cil_tmp24 = __cil_tmp23 + 1; #line 387 - i = (unsigned short )__cil_tmp24; + i = (unsigned short)__cil_tmp24; #line 387 - __cil_tmp25 = 0 * 2U; + __cil_tmp25 = 0 * 2U; #line 387 - __cil_tmp26 = (unsigned int )(deviceNameBuffer) + __cil_tmp25; + __cil_tmp26 = (unsigned int)(deviceNameBuffer) + __cil_tmp25; #line 387 - __cil_tmp27 = (WCHAR *)__cil_tmp26; + __cil_tmp27 = (WCHAR *)__cil_tmp26; #line 387 - __cil_tmp28 = (wchar_t const *)"\\\000D\000e\000v\000i\000c\000e\000\\\000F\000l\000o\000p\000p\000y\000%\000d\000"; + __cil_tmp28 = + (wchar_t const *)"\\\000D\000e\000v\000i\000c\000e\000\\\000F" + "\000l\000o\000p\000p\000y\000%\000d\000"; #line 387 - swprintf(__cil_tmp27, __cil_tmp28, tmp); + swprintf(__cil_tmp27, __cil_tmp28, tmp); #line 388 - __cil_tmp29 = 0 * 2U; + __cil_tmp29 = 0 * 2U; #line 388 - __cil_tmp30 = (unsigned int )(deviceNameBuffer) + __cil_tmp29; + __cil_tmp30 = (unsigned int)(deviceNameBuffer) + __cil_tmp29; #line 388 - __cil_tmp31 = (WCHAR *)__cil_tmp30; + __cil_tmp31 = (WCHAR *)__cil_tmp30; #line 388 - __cil_tmp32 = (WCHAR const *)__cil_tmp31; + __cil_tmp32 = (WCHAR const *)__cil_tmp31; #line 388 - RtlInitUnicodeString(& deviceName, __cil_tmp32); + RtlInitUnicodeString(&deviceName, __cil_tmp32); #line 389 - __cil_tmp33 = (unsigned long )460U; + __cil_tmp33 = (unsigned long)460U; #line 389 - ntStatus = IoCreateDevice(DriverObject, __cil_tmp33, & deviceName, 7UL, 261UL, - (unsigned char)0, & deviceObject); - } - { + ntStatus = + IoCreateDevice(DriverObject, __cil_tmp33, &deviceName, 7UL, + 261UL, (unsigned char)0, &deviceObject); + } + { #line 385 - __cil_tmp34 = ntStatus == -1073741771L; + __cil_tmp34 = ntStatus == -1073741771L; #line 385 - if (! __cil_tmp34) { - goto while_3_break; - } else { - - } + if (!__cil_tmp34) { + goto while_3_break; + } else { + } + } + } + while_3_break: /* CIL Label */; } - } - while_3_break: /* CIL Label */ ; - } #line 401 - if (ntStatus >= 0L) { + if (ntStatus >= 0L) { #line 403 - __cil_tmp35 = & deviceObject; + __cil_tmp35 = &deviceObject; #line 403 - __cil_tmp36 = *__cil_tmp35; + __cil_tmp36 = *__cil_tmp35; #line 403 - __cil_tmp37 = (unsigned int )__cil_tmp36; + __cil_tmp37 = (unsigned int)__cil_tmp36; #line 403 - __cil_tmp38 = __cil_tmp37 + 40; + __cil_tmp38 = __cil_tmp37 + 40; #line 403 - mem_215 = (PVOID *)__cil_tmp38; + mem_215 = (PVOID *)__cil_tmp38; #line 403 - __cil_tmp39 = *mem_215; + __cil_tmp39 = *mem_215; #line 403 - disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp39; - { + disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp39; + { #line 409 - while (1) { - while_4_continue: /* CIL Label */ ; - goto while_4_break; - } - while_4_break: /* CIL Label */ ; - } - { + while (1) { + while_4_continue: /* CIL Label */; + goto while_4_break; + } + while_4_break: /* CIL Label */; + } + { #line 411 - __cil_tmp40 = (enum _POOL_TYPE )1; + __cil_tmp40 = (enum _POOL_TYPE)1; #line 411 - __cil_tmp41 = & deviceName; + __cil_tmp41 = &deviceName; #line 411 - mem_216 = (USHORT *)__cil_tmp41; + mem_216 = (USHORT *)__cil_tmp41; #line 411 - __cil_tmp42 = *mem_216; + __cil_tmp42 = *mem_216; #line 411 - __cil_tmp43 = (unsigned long )__cil_tmp42; + __cil_tmp43 = (unsigned long)__cil_tmp42; #line 411 - tmp___0 = ExAllocatePoolWithTag(__cil_tmp40, __cil_tmp43, 1886350406UL); + tmp___0 = + ExAllocatePoolWithTag(__cil_tmp40, __cil_tmp43, 1886350406UL); #line 411 - __cil_tmp44 = 368 + 4; + __cil_tmp44 = 368 + 4; #line 411 - __cil_tmp45 = (unsigned int )disketteExtension; + __cil_tmp45 = (unsigned int)disketteExtension; #line 411 - __cil_tmp46 = __cil_tmp45 + __cil_tmp44; + __cil_tmp46 = __cil_tmp45 + __cil_tmp44; #line 411 - mem_217 = (PWSTR *)__cil_tmp46; + mem_217 = (PWSTR *)__cil_tmp46; #line 411 - *mem_217 = (WCHAR *)tmp___0; - } - { + *mem_217 = (WCHAR *)tmp___0; + } + { #line 412 - __cil_tmp47 = (void *)0; + __cil_tmp47 = (void *)0; #line 412 - __cil_tmp48 = (unsigned int )__cil_tmp47; + __cil_tmp48 = (unsigned int)__cil_tmp47; #line 412 - __cil_tmp49 = 368 + 4; + __cil_tmp49 = 368 + 4; #line 412 - __cil_tmp50 = (unsigned int )disketteExtension; + __cil_tmp50 = (unsigned int)disketteExtension; #line 412 - __cil_tmp51 = __cil_tmp50 + __cil_tmp49; + __cil_tmp51 = __cil_tmp50 + __cil_tmp49; #line 412 - mem_218 = (PWSTR *)__cil_tmp51; + mem_218 = (PWSTR *)__cil_tmp51; #line 412 - __cil_tmp52 = *mem_218; + __cil_tmp52 = *mem_218; #line 412 - __cil_tmp53 = (unsigned int )__cil_tmp52; + __cil_tmp53 = (unsigned int)__cil_tmp52; #line 412 - if (__cil_tmp53 == __cil_tmp48) { - { + if (__cil_tmp53 == __cil_tmp48) { + { #line 414 - __cil_tmp54 = & deviceObject; + __cil_tmp54 = &deviceObject; #line 414 - __cil_tmp55 = *__cil_tmp54; + __cil_tmp55 = *__cil_tmp54; #line 414 - IoDeleteDevice(__cil_tmp55); - } + IoDeleteDevice(__cil_tmp55); + } #line 415 - return (-1073741670L); - } else { - - } - } - { + return (-1073741670L); + } else { + } + } + { #line 417 - __cil_tmp56 = (unsigned int )disketteExtension; + __cil_tmp56 = (unsigned int)disketteExtension; #line 417 - __cil_tmp57 = __cil_tmp56 + 368; + __cil_tmp57 = __cil_tmp56 + 368; #line 417 - mem_219 = (USHORT *)__cil_tmp57; + mem_219 = (USHORT *)__cil_tmp57; #line 417 - *mem_219 = (unsigned short)0; + *mem_219 = (unsigned short)0; #line 418 - __cil_tmp58 = 368 + 2; + __cil_tmp58 = 368 + 2; #line 418 - __cil_tmp59 = (unsigned int )disketteExtension; + __cil_tmp59 = (unsigned int)disketteExtension; #line 418 - __cil_tmp60 = __cil_tmp59 + __cil_tmp58; + __cil_tmp60 = __cil_tmp59 + __cil_tmp58; #line 418 - __cil_tmp61 = & deviceName; + __cil_tmp61 = &deviceName; #line 418 - mem_220 = (USHORT *)__cil_tmp60; + mem_220 = (USHORT *)__cil_tmp60; #line 418 - mem_221 = (USHORT *)__cil_tmp61; + mem_221 = (USHORT *)__cil_tmp61; #line 418 - *mem_220 = *mem_221; + *mem_220 = *mem_221; #line 419 - __cil_tmp62 = (unsigned int )disketteExtension; + __cil_tmp62 = (unsigned int)disketteExtension; #line 419 - __cil_tmp63 = __cil_tmp62 + 368; + __cil_tmp63 = __cil_tmp62 + 368; #line 419 - __cil_tmp64 = (UNICODE_STRING *)__cil_tmp63; + __cil_tmp64 = (UNICODE_STRING *)__cil_tmp63; #line 419 - RtlCopyUnicodeString(__cil_tmp64, & deviceName); + RtlCopyUnicodeString(__cil_tmp64, &deviceName); #line 421 - tmp___1 = IoGetConfigurationInformation(); + tmp___1 = IoGetConfigurationInformation(); #line 421 - __cil_tmp65 = (unsigned int )tmp___1; + __cil_tmp65 = (unsigned int)tmp___1; #line 421 - __cil_tmp66 = __cil_tmp65 + 4; + __cil_tmp66 = __cil_tmp65 + 4; #line 421 - __cil_tmp67 = (unsigned int )tmp___1; + __cil_tmp67 = (unsigned int)tmp___1; #line 421 - __cil_tmp68 = __cil_tmp67 + 4; + __cil_tmp68 = __cil_tmp67 + 4; #line 421 - mem_222 = (ULONG *)__cil_tmp68; + mem_222 = (ULONG *)__cil_tmp68; #line 421 - __cil_tmp69 = *mem_222; + __cil_tmp69 = *mem_222; #line 421 - mem_223 = (ULONG *)__cil_tmp66; + mem_223 = (ULONG *)__cil_tmp66; #line 421 - *mem_223 = __cil_tmp69 + 1UL; + *mem_223 = __cil_tmp69 + 1UL; #line 429 - __cil_tmp70 = 0 * 1U; + __cil_tmp70 = 0 * 1U; #line 429 - __cil_tmp71 = (unsigned int )(arcNameBuffer) + __cil_tmp70; + __cil_tmp71 = (unsigned int)(arcNameBuffer) + __cil_tmp70; #line 429 - __cil_tmp72 = (UCHAR *)__cil_tmp71; + __cil_tmp72 = (UCHAR *)__cil_tmp71; #line 429 - __cil_tmp73 = (char *)__cil_tmp72; + __cil_tmp73 = (char *)__cil_tmp72; #line 429 - __cil_tmp74 = (unsigned int )(& fdcInfo) + 40; + __cil_tmp74 = (unsigned int)(&fdcInfo) + 40; #line 429 - mem_224 = (ULONG *)__cil_tmp74; + mem_224 = (ULONG *)__cil_tmp74; #line 429 - __cil_tmp75 = *mem_224; + __cil_tmp75 = *mem_224; #line 429 - __cil_tmp76 = (unsigned int )(& fdcInfo) + 44; + __cil_tmp76 = (unsigned int)(&fdcInfo) + 44; #line 429 - mem_225 = (ULONG *)__cil_tmp76; + mem_225 = (ULONG *)__cil_tmp76; #line 429 - __cil_tmp77 = *mem_225; + __cil_tmp77 = *mem_225; #line 429 - __cil_tmp78 = (unsigned int )(& fdcInfo) + 48; + __cil_tmp78 = (unsigned int)(&fdcInfo) + 48; #line 429 - mem_226 = (ULONG *)__cil_tmp78; + mem_226 = (ULONG *)__cil_tmp78; #line 429 - __cil_tmp79 = *mem_226; + __cil_tmp79 = *mem_226; #line 429 - sprintf(__cil_tmp73, "%s(%d)disk(%d)fdisk(%d)", "\\ArcName\\multi", __cil_tmp75, - __cil_tmp77, __cil_tmp79); + sprintf(__cil_tmp73, "%s(%d)disk(%d)fdisk(%d)", "\\ArcName\\multi", + __cil_tmp75, __cil_tmp77, __cil_tmp79); #line 436 - __cil_tmp80 = 0 * 1U; + __cil_tmp80 = 0 * 1U; #line 436 - __cil_tmp81 = (unsigned int )(arcNameBuffer) + __cil_tmp80; + __cil_tmp81 = (unsigned int)(arcNameBuffer) + __cil_tmp80; #line 436 - __cil_tmp82 = (UCHAR *)__cil_tmp81; + __cil_tmp82 = (UCHAR *)__cil_tmp81; #line 436 - __cil_tmp83 = (char const *)__cil_tmp82; + __cil_tmp83 = (char const *)__cil_tmp82; #line 436 - RtlInitString(& arcNameString, __cil_tmp83); + RtlInitString(&arcNameString, __cil_tmp83); #line 438 - __cil_tmp84 = (unsigned int )disketteExtension; + __cil_tmp84 = (unsigned int)disketteExtension; #line 438 - __cil_tmp85 = __cil_tmp84 + 384; + __cil_tmp85 = __cil_tmp84 + 384; #line 438 - __cil_tmp86 = (UNICODE_STRING *)__cil_tmp85; + __cil_tmp86 = (UNICODE_STRING *)__cil_tmp85; #line 438 - ntStatus = RtlAnsiStringToUnicodeString(__cil_tmp86, & arcNameString, (unsigned char)1); - } + ntStatus = RtlAnsiStringToUnicodeString(__cil_tmp86, &arcNameString, + (unsigned char)1); + } #line 442 - if (ntStatus >= 0L) { - { + if (ntStatus >= 0L) { + { #line 444 - __cil_tmp87 = (unsigned int )disketteExtension; + __cil_tmp87 = (unsigned int)disketteExtension; #line 444 - __cil_tmp88 = __cil_tmp87 + 384; + __cil_tmp88 = __cil_tmp87 + 384; #line 444 - __cil_tmp89 = (UNICODE_STRING *)__cil_tmp88; + __cil_tmp89 = (UNICODE_STRING *)__cil_tmp88; #line 444 - IoCreateSymbolicLink(__cil_tmp89, & deviceName); + IoCreateSymbolicLink(__cil_tmp89, &deviceName); + } + } else { } - } else { - - } #line 447 - __cil_tmp90 = & deviceObject; + __cil_tmp90 = &deviceObject; #line 447 - __cil_tmp91 = *__cil_tmp90; + __cil_tmp91 = *__cil_tmp90; #line 447 - __cil_tmp92 = (unsigned int )__cil_tmp91; + __cil_tmp92 = (unsigned int)__cil_tmp91; #line 447 - __cil_tmp93 = __cil_tmp92 + 28; + __cil_tmp93 = __cil_tmp92 + 28; #line 447 - __cil_tmp94 = & deviceObject; + __cil_tmp94 = &deviceObject; #line 447 - __cil_tmp95 = *__cil_tmp94; + __cil_tmp95 = *__cil_tmp94; #line 447 - __cil_tmp96 = (unsigned int )__cil_tmp95; + __cil_tmp96 = (unsigned int)__cil_tmp95; #line 447 - __cil_tmp97 = __cil_tmp96 + 28; + __cil_tmp97 = __cil_tmp96 + 28; #line 447 - mem_227 = (ULONG *)__cil_tmp97; + mem_227 = (ULONG *)__cil_tmp97; #line 447 - __cil_tmp98 = *mem_227; + __cil_tmp98 = *mem_227; #line 447 - mem_228 = (ULONG *)__cil_tmp93; + mem_228 = (ULONG *)__cil_tmp93; #line 447 - *mem_228 = __cil_tmp98 | 8208UL; - { + *mem_228 = __cil_tmp98 | 8208UL; + { #line 449 - __cil_tmp99 = & deviceObject; + __cil_tmp99 = &deviceObject; #line 449 - __cil_tmp100 = *__cil_tmp99; + __cil_tmp100 = *__cil_tmp99; #line 449 - __cil_tmp101 = (unsigned int )__cil_tmp100; + __cil_tmp101 = (unsigned int)__cil_tmp100; #line 449 - __cil_tmp102 = __cil_tmp101 + 92; + __cil_tmp102 = __cil_tmp101 + 92; #line 449 - mem_229 = (ULONG *)__cil_tmp102; + mem_229 = (ULONG *)__cil_tmp102; #line 449 - __cil_tmp103 = *mem_229; + __cil_tmp103 = *mem_229; #line 449 - if (__cil_tmp103 < 1UL) { + if (__cil_tmp103 < 1UL) { #line 451 - __cil_tmp104 = & deviceObject; + __cil_tmp104 = &deviceObject; #line 451 - __cil_tmp105 = *__cil_tmp104; + __cil_tmp105 = *__cil_tmp104; #line 451 - __cil_tmp106 = (unsigned int )__cil_tmp105; + __cil_tmp106 = (unsigned int)__cil_tmp105; #line 451 - __cil_tmp107 = __cil_tmp106 + 92; + __cil_tmp107 = __cil_tmp106 + 92; #line 451 - mem_230 = (ULONG *)__cil_tmp107; + mem_230 = (ULONG *)__cil_tmp107; #line 451 - *mem_230 = 1UL; - } else { - - } - } + *mem_230 = 1UL; + } else { + } + } #line 454 - __cil_tmp108 = & deviceObject; + __cil_tmp108 = &deviceObject; #line 454 - __cil_tmp109 = *__cil_tmp108; + __cil_tmp109 = *__cil_tmp108; #line 454 - __cil_tmp110 = (unsigned int )__cil_tmp109; + __cil_tmp110 = (unsigned int)__cil_tmp109; #line 454 - __cil_tmp111 = __cil_tmp110 + 28; + __cil_tmp111 = __cil_tmp110 + 28; #line 454 - __cil_tmp112 = & deviceObject; + __cil_tmp112 = &deviceObject; #line 454 - __cil_tmp113 = *__cil_tmp112; + __cil_tmp113 = *__cil_tmp112; #line 454 - __cil_tmp114 = (unsigned int )__cil_tmp113; + __cil_tmp114 = (unsigned int)__cil_tmp113; #line 454 - __cil_tmp115 = __cil_tmp114 + 28; + __cil_tmp115 = __cil_tmp114 + 28; #line 454 - mem_231 = (ULONG *)__cil_tmp115; + mem_231 = (ULONG *)__cil_tmp115; #line 454 - __cil_tmp116 = *mem_231; + __cil_tmp116 = *mem_231; #line 454 - mem_232 = (ULONG *)__cil_tmp111; + mem_232 = (ULONG *)__cil_tmp111; #line 454 - *mem_232 = __cil_tmp116 & 4294967167UL; + *mem_232 = __cil_tmp116 & 4294967167UL; #line 456 - __cil_tmp117 = (unsigned int )disketteExtension; + __cil_tmp117 = (unsigned int)disketteExtension; #line 456 - __cil_tmp118 = __cil_tmp117 + 136; + __cil_tmp118 = __cil_tmp117 + 136; #line 456 - mem_233 = (PDRIVER_OBJECT *)__cil_tmp118; + mem_233 = (PDRIVER_OBJECT *)__cil_tmp118; #line 456 - *mem_233 = DriverObject; + *mem_233 = DriverObject; #line 459 - __cil_tmp119 = (unsigned int )disketteExtension; + __cil_tmp119 = (unsigned int)disketteExtension; #line 459 - __cil_tmp120 = __cil_tmp119 + 4; + __cil_tmp120 = __cil_tmp119 + 4; #line 459 - mem_234 = (PDEVICE_OBJECT *)__cil_tmp120; + mem_234 = (PDEVICE_OBJECT *)__cil_tmp120; #line 459 - *mem_234 = PhysicalDeviceObject; - { + *mem_234 = PhysicalDeviceObject; + { #line 464 - while (1) { - while_5_continue: /* CIL Label */ ; - goto while_5_break; - } - while_5_break: /* CIL Label */ ; - } - { + while (1) { + while_5_continue: /* CIL Label */; + goto while_5_break; + } + while_5_break: /* CIL Label */; + } + { #line 466 - __cil_tmp121 = (unsigned int )disketteExtension; + __cil_tmp121 = (unsigned int)disketteExtension; #line 466 - __cil_tmp122 = __cil_tmp121 + 8; + __cil_tmp122 = __cil_tmp121 + 8; #line 466 - __cil_tmp123 = & deviceObject; + __cil_tmp123 = &deviceObject; #line 466 - __cil_tmp124 = *__cil_tmp123; + __cil_tmp124 = *__cil_tmp123; #line 466 - mem_235 = (PDEVICE_OBJECT *)__cil_tmp122; + mem_235 = (PDEVICE_OBJECT *)__cil_tmp122; #line 466 - *mem_235 = IoAttachDeviceToDeviceStack(__cil_tmp124, PhysicalDeviceObject); - } - { + *mem_235 = + IoAttachDeviceToDeviceStack(__cil_tmp124, PhysicalDeviceObject); + } + { #line 472 - while (1) { - while_6_continue: /* CIL Label */ ; - goto while_6_break; - } - while_6_break: /* CIL Label */ ; - } - { + while (1) { + while_6_continue: /* CIL Label */; + goto while_6_break; + } + while_6_break: /* CIL Label */; + } + { #line 474 - __cil_tmp125 = (unsigned int )disketteExtension; + __cil_tmp125 = (unsigned int)disketteExtension; #line 474 - __cil_tmp126 = __cil_tmp125 + 32; + __cil_tmp126 = __cil_tmp125 + 32; #line 474 - __cil_tmp127 = (KSEMAPHORE *)__cil_tmp126; + __cil_tmp127 = (KSEMAPHORE *)__cil_tmp126; #line 474 - KeInitializeSemaphore(__cil_tmp127, 0L, 2147483647L); + KeInitializeSemaphore(__cil_tmp127, 0L, 2147483647L); #line 478 - __cil_tmp128 = (unsigned int )disketteExtension; + __cil_tmp128 = (unsigned int)disketteExtension; #line 478 - __cil_tmp129 = __cil_tmp128 + 396; + __cil_tmp129 = __cil_tmp128 + 396; #line 478 - mem_236 = (LONG *)__cil_tmp129; + mem_236 = (LONG *)__cil_tmp129; #line 478 - *mem_236 = 1L; + *mem_236 = 1L; #line 478 - __cil_tmp130 = 396 + 8; + __cil_tmp130 = 396 + 8; #line 478 - __cil_tmp131 = (unsigned int )disketteExtension; + __cil_tmp131 = (unsigned int)disketteExtension; #line 478 - __cil_tmp132 = __cil_tmp131 + __cil_tmp130; + __cil_tmp132 = __cil_tmp131 + __cil_tmp130; #line 478 - mem_237 = (ULONG *)__cil_tmp132; + mem_237 = (ULONG *)__cil_tmp132; #line 478 - *mem_237 = 0UL; + *mem_237 = 0UL; #line 478 - __cil_tmp133 = 396 + 12; + __cil_tmp133 = 396 + 12; #line 478 - __cil_tmp134 = (unsigned int )disketteExtension; + __cil_tmp134 = (unsigned int)disketteExtension; #line 478 - __cil_tmp135 = __cil_tmp134 + __cil_tmp133; + __cil_tmp135 = __cil_tmp134 + __cil_tmp133; #line 478 - __cil_tmp136 = (KEVENT *)__cil_tmp135; + __cil_tmp136 = (KEVENT *)__cil_tmp135; #line 478 - __cil_tmp137 = (enum _EVENT_TYPE )1; + __cil_tmp137 = (enum _EVENT_TYPE)1; #line 478 - KeInitializeEvent(__cil_tmp136, __cil_tmp137, (unsigned char)0); + KeInitializeEvent(__cil_tmp136, __cil_tmp137, (unsigned char)0); #line 480 - __cil_tmp138 = (unsigned int )disketteExtension; + __cil_tmp138 = (unsigned int)disketteExtension; #line 480 - __cil_tmp139 = __cil_tmp138 + 52; + __cil_tmp139 = __cil_tmp138 + 52; #line 480 - __cil_tmp140 = (KSPIN_LOCK *)__cil_tmp139; + __cil_tmp140 = (KSPIN_LOCK *)__cil_tmp139; #line 480 - KeInitializeSpinLock(__cil_tmp140); + KeInitializeSpinLock(__cil_tmp140); #line 482 - __cil_tmp141 = (unsigned int )disketteExtension; + __cil_tmp141 = (unsigned int)disketteExtension; #line 482 - __cil_tmp142 = __cil_tmp141 + 56; + __cil_tmp142 = __cil_tmp141 + 56; #line 482 - mem_238 = (LONG *)__cil_tmp142; + mem_238 = (LONG *)__cil_tmp142; #line 482 - *mem_238 = 1L; + *mem_238 = 1L; #line 482 - __cil_tmp143 = 56 + 8; + __cil_tmp143 = 56 + 8; #line 482 - __cil_tmp144 = (unsigned int )disketteExtension; + __cil_tmp144 = (unsigned int)disketteExtension; #line 482 - __cil_tmp145 = __cil_tmp144 + __cil_tmp143; + __cil_tmp145 = __cil_tmp144 + __cil_tmp143; #line 482 - mem_239 = (ULONG *)__cil_tmp145; + mem_239 = (ULONG *)__cil_tmp145; #line 482 - *mem_239 = 0UL; + *mem_239 = 0UL; #line 482 - __cil_tmp146 = 56 + 12; + __cil_tmp146 = 56 + 12; #line 482 - __cil_tmp147 = (unsigned int )disketteExtension; + __cil_tmp147 = (unsigned int)disketteExtension; #line 482 - __cil_tmp148 = __cil_tmp147 + __cil_tmp146; + __cil_tmp148 = __cil_tmp147 + __cil_tmp146; #line 482 - __cil_tmp149 = (KEVENT *)__cil_tmp148; + __cil_tmp149 = (KEVENT *)__cil_tmp148; #line 482 - __cil_tmp150 = (enum _EVENT_TYPE )1; + __cil_tmp150 = (enum _EVENT_TYPE)1; #line 482 - KeInitializeEvent(__cil_tmp149, __cil_tmp150, (unsigned char)0); + KeInitializeEvent(__cil_tmp149, __cil_tmp150, (unsigned char)0); #line 484 - __cil_tmp151 = (unsigned int )disketteExtension; + __cil_tmp151 = (unsigned int)disketteExtension; #line 484 - __cil_tmp152 = __cil_tmp151 + 428; + __cil_tmp152 = __cil_tmp151 + 428; #line 484 - mem_240 = (LONG *)__cil_tmp152; + mem_240 = (LONG *)__cil_tmp152; #line 484 - *mem_240 = 1L; + *mem_240 = 1L; #line 484 - __cil_tmp153 = 428 + 8; + __cil_tmp153 = 428 + 8; #line 484 - __cil_tmp154 = (unsigned int )disketteExtension; + __cil_tmp154 = (unsigned int)disketteExtension; #line 484 - __cil_tmp155 = __cil_tmp154 + __cil_tmp153; + __cil_tmp155 = __cil_tmp154 + __cil_tmp153; #line 484 - mem_241 = (ULONG *)__cil_tmp155; + mem_241 = (ULONG *)__cil_tmp155; #line 484 - *mem_241 = 0UL; + *mem_241 = 0UL; #line 484 - __cil_tmp156 = 428 + 12; + __cil_tmp156 = 428 + 12; #line 484 - __cil_tmp157 = (unsigned int )disketteExtension; + __cil_tmp157 = (unsigned int)disketteExtension; #line 484 - __cil_tmp158 = __cil_tmp157 + __cil_tmp156; + __cil_tmp158 = __cil_tmp157 + __cil_tmp156; #line 484 - __cil_tmp159 = (KEVENT *)__cil_tmp158; + __cil_tmp159 = (KEVENT *)__cil_tmp158; #line 484 - __cil_tmp160 = (enum _EVENT_TYPE )1; + __cil_tmp160 = (enum _EVENT_TYPE)1; #line 484 - KeInitializeEvent(__cil_tmp159, __cil_tmp160, (unsigned char)0); + KeInitializeEvent(__cil_tmp159, __cil_tmp160, (unsigned char)0); #line 486 - __cil_tmp161 = 96 + 4; + __cil_tmp161 = 96 + 4; #line 486 - __cil_tmp162 = (unsigned int )disketteExtension; + __cil_tmp162 = (unsigned int)disketteExtension; #line 486 - __cil_tmp163 = __cil_tmp162 + __cil_tmp161; + __cil_tmp163 = __cil_tmp162 + __cil_tmp161; #line 486 - __cil_tmp164 = (unsigned int )disketteExtension; + __cil_tmp164 = (unsigned int)disketteExtension; #line 486 - __cil_tmp165 = __cil_tmp164 + 96; + __cil_tmp165 = __cil_tmp164 + 96; #line 486 - mem_242 = (struct _LIST_ENTRY **)__cil_tmp163; + mem_242 = (struct _LIST_ENTRY **)__cil_tmp163; #line 486 - *mem_242 = (LIST_ENTRY *)__cil_tmp165; + *mem_242 = (LIST_ENTRY *)__cil_tmp165; #line 486 - __cil_tmp166 = (unsigned int )disketteExtension; + __cil_tmp166 = (unsigned int)disketteExtension; #line 486 - __cil_tmp167 = __cil_tmp166 + 96; + __cil_tmp167 = __cil_tmp166 + 96; #line 486 - __cil_tmp168 = 96 + 4; + __cil_tmp168 = 96 + 4; #line 486 - __cil_tmp169 = (unsigned int )disketteExtension; + __cil_tmp169 = (unsigned int)disketteExtension; #line 486 - __cil_tmp170 = __cil_tmp169 + __cil_tmp168; + __cil_tmp170 = __cil_tmp169 + __cil_tmp168; #line 486 - mem_243 = (struct _LIST_ENTRY **)__cil_tmp167; + mem_243 = (struct _LIST_ENTRY **)__cil_tmp167; #line 486 - mem_244 = (struct _LIST_ENTRY **)__cil_tmp170; + mem_244 = (struct _LIST_ENTRY **)__cil_tmp170; #line 486 - *mem_243 = *mem_244; + *mem_243 = *mem_244; #line 488 - __cil_tmp171 = (unsigned int )disketteExtension; + __cil_tmp171 = (unsigned int)disketteExtension; #line 488 - __cil_tmp172 = __cil_tmp171 + 88; + __cil_tmp172 = __cil_tmp171 + 88; #line 488 - mem_245 = (LONG *)__cil_tmp172; + mem_245 = (LONG *)__cil_tmp172; #line 488 - *mem_245 = -1L; + *mem_245 = -1L; #line 490 - __cil_tmp173 = (unsigned int )disketteExtension; + __cil_tmp173 = (unsigned int)disketteExtension; #line 490 - __cil_tmp174 = __cil_tmp173 + 12; + __cil_tmp174 = __cil_tmp173 + 12; #line 490 - mem_246 = (BOOLEAN *)__cil_tmp174; + mem_246 = (BOOLEAN *)__cil_tmp174; #line 490 - *mem_246 = (unsigned char)0; + *mem_246 = (unsigned char)0; #line 491 - __cil_tmp175 = (unsigned int )disketteExtension; + __cil_tmp175 = (unsigned int)disketteExtension; #line 491 - __cil_tmp176 = __cil_tmp175 + 13; + __cil_tmp176 = __cil_tmp175 + 13; #line 491 - mem_247 = (BOOLEAN *)__cil_tmp176; + mem_247 = (BOOLEAN *)__cil_tmp176; #line 491 - *mem_247 = (unsigned char)0; + *mem_247 = (unsigned char)0; #line 492 - __cil_tmp177 = (unsigned int )disketteExtension; + __cil_tmp177 = (unsigned int)disketteExtension; #line 492 - __cil_tmp178 = __cil_tmp177 + 14; + __cil_tmp178 = __cil_tmp177 + 14; #line 492 - mem_248 = (BOOLEAN *)__cil_tmp178; + mem_248 = (BOOLEAN *)__cil_tmp178; #line 492 - *mem_248 = (unsigned char)0; + *mem_248 = (unsigned char)0; #line 493 - __cil_tmp179 = 16 + 4; + __cil_tmp179 = 16 + 4; #line 493 - __cil_tmp180 = (unsigned int )disketteExtension; + __cil_tmp180 = (unsigned int)disketteExtension; #line 493 - __cil_tmp181 = __cil_tmp180 + __cil_tmp179; + __cil_tmp181 = __cil_tmp180 + __cil_tmp179; #line 493 - __cil_tmp182 = (unsigned int )disketteExtension; + __cil_tmp182 = (unsigned int)disketteExtension; #line 493 - __cil_tmp183 = __cil_tmp182 + 16; + __cil_tmp183 = __cil_tmp182 + 16; #line 493 - mem_249 = (struct _LIST_ENTRY **)__cil_tmp181; + mem_249 = (struct _LIST_ENTRY **)__cil_tmp181; #line 493 - *mem_249 = (LIST_ENTRY *)__cil_tmp183; + *mem_249 = (LIST_ENTRY *)__cil_tmp183; #line 493 - __cil_tmp184 = (unsigned int )disketteExtension; + __cil_tmp184 = (unsigned int)disketteExtension; #line 493 - __cil_tmp185 = __cil_tmp184 + 16; + __cil_tmp185 = __cil_tmp184 + 16; #line 493 - __cil_tmp186 = 16 + 4; + __cil_tmp186 = 16 + 4; #line 493 - __cil_tmp187 = (unsigned int )disketteExtension; + __cil_tmp187 = (unsigned int)disketteExtension; #line 493 - __cil_tmp188 = __cil_tmp187 + __cil_tmp186; + __cil_tmp188 = __cil_tmp187 + __cil_tmp186; #line 493 - mem_250 = (struct _LIST_ENTRY **)__cil_tmp185; + mem_250 = (struct _LIST_ENTRY **)__cil_tmp185; #line 493 - mem_251 = (struct _LIST_ENTRY **)__cil_tmp188; + mem_251 = (struct _LIST_ENTRY **)__cil_tmp188; #line 493 - *mem_250 = *mem_251; + *mem_250 = *mem_251; #line 494 - __cil_tmp189 = (unsigned int )disketteExtension; + __cil_tmp189 = (unsigned int)disketteExtension; #line 494 - __cil_tmp190 = __cil_tmp189 + 24; + __cil_tmp190 = __cil_tmp189 + 24; #line 494 - __cil_tmp191 = (KSPIN_LOCK *)__cil_tmp190; + __cil_tmp191 = (KSPIN_LOCK *)__cil_tmp190; #line 494 - KeInitializeSpinLock(__cil_tmp191); + KeInitializeSpinLock(__cil_tmp191); #line 495 - __cil_tmp192 = (KSPIN_LOCK *)disketteExtension; + __cil_tmp192 = (KSPIN_LOCK *)disketteExtension; #line 495 - KeInitializeSpinLock(__cil_tmp192); + KeInitializeSpinLock(__cil_tmp192); #line 497 - __cil_tmp193 = (unsigned int )disketteExtension; + __cil_tmp193 = (unsigned int)disketteExtension; #line 497 - __cil_tmp194 = __cil_tmp193 + 172; + __cil_tmp194 = __cil_tmp193 + 172; #line 497 - mem_252 = (BOOLEAN *)__cil_tmp194; + mem_252 = (BOOLEAN *)__cil_tmp194; #line 497 - *mem_252 = (unsigned char)0; + *mem_252 = (unsigned char)0; #line 498 - __cil_tmp195 = (unsigned int )disketteExtension; + __cil_tmp195 = (unsigned int)disketteExtension; #line 498 - __cil_tmp196 = __cil_tmp195 + 392; + __cil_tmp196 = __cil_tmp195 + 392; #line 498 - mem_253 = (BOOLEAN *)__cil_tmp196; + mem_253 = (BOOLEAN *)__cil_tmp196; #line 498 - *mem_253 = (unsigned char)0; + *mem_253 = (unsigned char)0; #line 499 - __cil_tmp197 = (unsigned int )disketteExtension; + __cil_tmp197 = (unsigned int)disketteExtension; #line 499 - __cil_tmp198 = __cil_tmp197 + 28; + __cil_tmp198 = __cil_tmp197 + 28; #line 499 - __cil_tmp199 = & deviceObject; + __cil_tmp199 = &deviceObject; #line 499 - mem_254 = (PDEVICE_OBJECT *)__cil_tmp198; + mem_254 = (PDEVICE_OBJECT *)__cil_tmp198; #line 499 - *mem_254 = *__cil_tmp199; + *mem_254 = *__cil_tmp199; #line 501 - __cil_tmp200 = (unsigned int )disketteExtension; + __cil_tmp200 = (unsigned int)disketteExtension; #line 501 - __cil_tmp201 = __cil_tmp200 + 250; + __cil_tmp201 = __cil_tmp200 + 250; #line 501 - mem_255 = (BOOLEAN *)__cil_tmp201; + mem_255 = (BOOLEAN *)__cil_tmp201; #line 501 - *mem_255 = (unsigned char)0; + *mem_255 = (unsigned char)0; #line 503 - __cil_tmp202 = (unsigned int )disketteExtension; + __cil_tmp202 = (unsigned int)disketteExtension; #line 503 - __cil_tmp203 = __cil_tmp202 + 184; + __cil_tmp203 = __cil_tmp202 + 184; #line 503 - mem_256 = (MEDIA_TYPE *)__cil_tmp203; + mem_256 = (MEDIA_TYPE *)__cil_tmp203; #line 503 - *mem_256 = (enum _MEDIA_TYPE )-1; - } - { + *mem_256 = (enum _MEDIA_TYPE) - 1; + } + { #line 505 - __cil_tmp204 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp204 = (KUSER_SHARED_DATA * const)4292804608U; #line 505 - __cil_tmp205 = (unsigned int )__cil_tmp204; + __cil_tmp205 = (unsigned int)__cil_tmp204; #line 505 - __cil_tmp206 = __cil_tmp205 + 732; + __cil_tmp206 = __cil_tmp205 + 732; #line 505 - mem_257 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp206; + mem_257 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp206; #line 505 - __cil_tmp207 = *mem_257; + __cil_tmp207 = *mem_257; #line 505 - __cil_tmp208 = (int )__cil_tmp207; + __cil_tmp208 = (int)__cil_tmp207; #line 505 - if (__cil_tmp208 == 1) { + if (__cil_tmp208 == 1) { #line 505 - __cil_tmp209 = (unsigned int )disketteExtension; + __cil_tmp209 = (unsigned int)disketteExtension; #line 505 - __cil_tmp210 = __cil_tmp209 + 365; + __cil_tmp210 = __cil_tmp209 + 365; #line 505 - mem_258 = (BOOLEAN *)__cil_tmp210; + mem_258 = (BOOLEAN *)__cil_tmp210; #line 505 - *mem_258 = (unsigned char)0; - } else { + *mem_258 = (unsigned char)0; + } else { #line 505 - __cil_tmp211 = (unsigned int )disketteExtension; + __cil_tmp211 = (unsigned int)disketteExtension; #line 505 - __cil_tmp212 = __cil_tmp211 + 365; + __cil_tmp212 = __cil_tmp211 + 365; #line 505 - mem_259 = (BOOLEAN *)__cil_tmp212; + mem_259 = (BOOLEAN *)__cil_tmp212; #line 505 - *mem_259 = (unsigned char)1; - } + *mem_259 = (unsigned char)1; + } + } + } else { } } else { - } - } else { - - } #line 509 - return (ntStatus); -} + return (ntStatus); + } } #line 512 "floppy.c" -NTSTATUS FlConfigCallBack(PVOID Context , PUNICODE_STRING PathName , INTERFACE_TYPE BusType , - ULONG BusNumber , PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) -{ PDISKETTE_EXTENSION disketteExtension ; - ULONG i ; - PCM_FULL_RESOURCE_DESCRIPTOR peripheralData ; - PCM_PARTIAL_RESOURCE_DESCRIPTOR partial ; - PCM_FLOPPY_DEVICE_DATA fDeviceData ; - UCHAR driveType ; - PDRIVE_MEDIA_CONSTANTS biosDriveMediaConstants ; - PKEY_VALUE_FULL_INFORMATION *__cil_tmp19 ; - PKEY_VALUE_FULL_INFORMATION __cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - ULONG __cil_tmp23 ; - PKEY_VALUE_FULL_INFORMATION *__cil_tmp24 ; - PKEY_VALUE_FULL_INFORMATION __cil_tmp25 ; - UCHAR *__cil_tmp26 ; - UCHAR *__cil_tmp27 ; - PKEY_VALUE_FULL_INFORMATION *__cil_tmp28 ; - PKEY_VALUE_FULL_INFORMATION __cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - ULONG __cil_tmp32 ; - PKEY_VALUE_FULL_INFORMATION *__cil_tmp33 ; - PKEY_VALUE_FULL_INFORMATION __cil_tmp34 ; - UCHAR *__cil_tmp35 ; - UCHAR *__cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - unsigned int __cil_tmp39 ; - ULONG __cil_tmp40 ; - unsigned int __cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - UCHAR __cil_tmp46 ; - int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - PCM_PARTIAL_RESOURCE_DESCRIPTOR __cil_tmp50 ; - unsigned int __cil_tmp51 ; - unsigned int __cil_tmp52 ; - ULONG __cil_tmp53 ; - KUSER_SHARED_DATA *__cil_tmp54 ; - unsigned int __cil_tmp55 ; - unsigned int __cil_tmp56 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp57 ; - int __cil_tmp58 ; - unsigned int __cil_tmp59 ; - unsigned int __cil_tmp60 ; - int __cil_tmp61 ; - PDRIVE_MEDIA_LIMITS __cil_tmp62 ; - DRIVE_MEDIA_TYPE __cil_tmp63 ; - unsigned int __cil_tmp64 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp65 ; - USHORT __cil_tmp66 ; - int __cil_tmp67 ; - unsigned int __cil_tmp68 ; - unsigned int __cil_tmp69 ; - unsigned int __cil_tmp70 ; - unsigned int __cil_tmp71 ; - unsigned int __cil_tmp72 ; - unsigned int __cil_tmp73 ; - unsigned int __cil_tmp74 ; - unsigned int __cil_tmp75 ; - unsigned int __cil_tmp76 ; - unsigned int __cil_tmp77 ; - unsigned int __cil_tmp78 ; - unsigned int __cil_tmp79 ; - unsigned int __cil_tmp80 ; - unsigned int __cil_tmp81 ; - unsigned int __cil_tmp82 ; - unsigned int __cil_tmp83 ; - unsigned int __cil_tmp84 ; - unsigned int __cil_tmp85 ; - UCHAR __cil_tmp86 ; - int __cil_tmp87 ; - unsigned int __cil_tmp88 ; - unsigned int __cil_tmp89 ; - ULONG __cil_tmp90 ; - unsigned int __cil_tmp91 ; - unsigned int __cil_tmp92 ; - unsigned int __cil_tmp93 ; - unsigned int __cil_tmp94 ; - unsigned int __cil_tmp95 ; - unsigned int __cil_tmp96 ; - unsigned int __cil_tmp97 ; - unsigned int __cil_tmp98 ; - unsigned int __cil_tmp99 ; - unsigned int __cil_tmp100 ; - unsigned int __cil_tmp101 ; - unsigned int __cil_tmp102 ; - unsigned int __cil_tmp103 ; - unsigned int __cil_tmp104 ; - unsigned int __cil_tmp105 ; - unsigned int __cil_tmp106 ; - unsigned int __cil_tmp107 ; - unsigned int __cil_tmp108 ; - unsigned int __cil_tmp109 ; - unsigned int __cil_tmp110 ; - unsigned int __cil_tmp111 ; - unsigned int __cil_tmp112 ; - unsigned int __cil_tmp113 ; - unsigned int __cil_tmp114 ; - UCHAR __cil_tmp115 ; - int __cil_tmp116 ; - int __cil_tmp117 ; - int __cil_tmp118 ; - unsigned int __cil_tmp119 ; - unsigned int __cil_tmp120 ; - unsigned int __cil_tmp121 ; - unsigned int __cil_tmp122 ; - UCHAR __cil_tmp123 ; - int __cil_tmp124 ; - int __cil_tmp125 ; - int __cil_tmp126 ; - unsigned int __cil_tmp127 ; - unsigned int __cil_tmp128 ; - UCHAR __cil_tmp129 ; - int __cil_tmp130 ; - unsigned int __cil_tmp131 ; - unsigned int __cil_tmp132 ; - unsigned int __cil_tmp133 ; - unsigned int __cil_tmp134 ; - unsigned int __cil_tmp135 ; - unsigned int __cil_tmp136 ; - unsigned int __cil_tmp137 ; - unsigned int __cil_tmp138 ; - ULONG *mem_139 ; - ULONG *mem_140 ; - ULONG *mem_141 ; - UCHAR *mem_142 ; - ULONG *mem_143 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_144 ; - UCHAR *mem_145 ; - DRIVE_MEDIA_TYPE *mem_146 ; - USHORT *mem_147 ; - UCHAR *mem_148 ; - UCHAR *mem_149 ; - UCHAR *mem_150 ; - UCHAR *mem_151 ; - UCHAR *mem_152 ; - UCHAR *mem_153 ; - UCHAR *mem_154 ; - UCHAR *mem_155 ; - UCHAR *mem_156 ; - ULONG *mem_157 ; - UCHAR *mem_158 ; - UCHAR *mem_159 ; - UCHAR *mem_160 ; - UCHAR *mem_161 ; - UCHAR *mem_162 ; - UCHAR *mem_163 ; - UCHAR *mem_164 ; - UCHAR *mem_165 ; - UCHAR *mem_166 ; - UCHAR *mem_167 ; - UCHAR *mem_168 ; - USHORT *mem_169 ; - UCHAR *mem_170 ; - USHORT *mem_171 ; - UCHAR *mem_172 ; - UCHAR *mem_173 ; - UCHAR *mem_174 ; - UCHAR *mem_175 ; - UCHAR *mem_176 ; +NTSTATUS FlConfigCallBack(PVOID Context, PUNICODE_STRING PathName, + INTERFACE_TYPE BusType, ULONG BusNumber, + PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, + ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, + ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation) { + PDISKETTE_EXTENSION disketteExtension; + ULONG i; + PCM_FULL_RESOURCE_DESCRIPTOR peripheralData; + PCM_PARTIAL_RESOURCE_DESCRIPTOR partial; + PCM_FLOPPY_DEVICE_DATA fDeviceData; + UCHAR driveType; + PDRIVE_MEDIA_CONSTANTS biosDriveMediaConstants; + PKEY_VALUE_FULL_INFORMATION *__cil_tmp19; + PKEY_VALUE_FULL_INFORMATION __cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + ULONG __cil_tmp23; + PKEY_VALUE_FULL_INFORMATION *__cil_tmp24; + PKEY_VALUE_FULL_INFORMATION __cil_tmp25; + UCHAR *__cil_tmp26; + UCHAR *__cil_tmp27; + PKEY_VALUE_FULL_INFORMATION *__cil_tmp28; + PKEY_VALUE_FULL_INFORMATION __cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + ULONG __cil_tmp32; + PKEY_VALUE_FULL_INFORMATION *__cil_tmp33; + PKEY_VALUE_FULL_INFORMATION __cil_tmp34; + UCHAR *__cil_tmp35; + UCHAR *__cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + unsigned int __cil_tmp39; + ULONG __cil_tmp40; + unsigned int __cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + UCHAR __cil_tmp46; + int __cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + PCM_PARTIAL_RESOURCE_DESCRIPTOR __cil_tmp50; + unsigned int __cil_tmp51; + unsigned int __cil_tmp52; + ULONG __cil_tmp53; + KUSER_SHARED_DATA *__cil_tmp54; + unsigned int __cil_tmp55; + unsigned int __cil_tmp56; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp57; + int __cil_tmp58; + unsigned int __cil_tmp59; + unsigned int __cil_tmp60; + int __cil_tmp61; + PDRIVE_MEDIA_LIMITS __cil_tmp62; + DRIVE_MEDIA_TYPE __cil_tmp63; + unsigned int __cil_tmp64; + PDRIVE_MEDIA_CONSTANTS __cil_tmp65; + USHORT __cil_tmp66; + int __cil_tmp67; + unsigned int __cil_tmp68; + unsigned int __cil_tmp69; + unsigned int __cil_tmp70; + unsigned int __cil_tmp71; + unsigned int __cil_tmp72; + unsigned int __cil_tmp73; + unsigned int __cil_tmp74; + unsigned int __cil_tmp75; + unsigned int __cil_tmp76; + unsigned int __cil_tmp77; + unsigned int __cil_tmp78; + unsigned int __cil_tmp79; + unsigned int __cil_tmp80; + unsigned int __cil_tmp81; + unsigned int __cil_tmp82; + unsigned int __cil_tmp83; + unsigned int __cil_tmp84; + unsigned int __cil_tmp85; + UCHAR __cil_tmp86; + int __cil_tmp87; + unsigned int __cil_tmp88; + unsigned int __cil_tmp89; + ULONG __cil_tmp90; + unsigned int __cil_tmp91; + unsigned int __cil_tmp92; + unsigned int __cil_tmp93; + unsigned int __cil_tmp94; + unsigned int __cil_tmp95; + unsigned int __cil_tmp96; + unsigned int __cil_tmp97; + unsigned int __cil_tmp98; + unsigned int __cil_tmp99; + unsigned int __cil_tmp100; + unsigned int __cil_tmp101; + unsigned int __cil_tmp102; + unsigned int __cil_tmp103; + unsigned int __cil_tmp104; + unsigned int __cil_tmp105; + unsigned int __cil_tmp106; + unsigned int __cil_tmp107; + unsigned int __cil_tmp108; + unsigned int __cil_tmp109; + unsigned int __cil_tmp110; + unsigned int __cil_tmp111; + unsigned int __cil_tmp112; + unsigned int __cil_tmp113; + unsigned int __cil_tmp114; + UCHAR __cil_tmp115; + int __cil_tmp116; + int __cil_tmp117; + int __cil_tmp118; + unsigned int __cil_tmp119; + unsigned int __cil_tmp120; + unsigned int __cil_tmp121; + unsigned int __cil_tmp122; + UCHAR __cil_tmp123; + int __cil_tmp124; + int __cil_tmp125; + int __cil_tmp126; + unsigned int __cil_tmp127; + unsigned int __cil_tmp128; + UCHAR __cil_tmp129; + int __cil_tmp130; + unsigned int __cil_tmp131; + unsigned int __cil_tmp132; + unsigned int __cil_tmp133; + unsigned int __cil_tmp134; + unsigned int __cil_tmp135; + unsigned int __cil_tmp136; + unsigned int __cil_tmp137; + unsigned int __cil_tmp138; + ULONG *mem_139; + ULONG *mem_140; + ULONG *mem_141; + UCHAR *mem_142; + ULONG *mem_143; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_144; + UCHAR *mem_145; + DRIVE_MEDIA_TYPE *mem_146; + USHORT *mem_147; + UCHAR *mem_148; + UCHAR *mem_149; + UCHAR *mem_150; + UCHAR *mem_151; + UCHAR *mem_152; + UCHAR *mem_153; + UCHAR *mem_154; + UCHAR *mem_155; + UCHAR *mem_156; + ULONG *mem_157; + UCHAR *mem_158; + UCHAR *mem_159; + UCHAR *mem_160; + UCHAR *mem_161; + UCHAR *mem_162; + UCHAR *mem_163; + UCHAR *mem_164; + UCHAR *mem_165; + UCHAR *mem_166; + UCHAR *mem_167; + UCHAR *mem_168; + USHORT *mem_169; + UCHAR *mem_170; + USHORT *mem_171; + UCHAR *mem_172; + UCHAR *mem_173; + UCHAR *mem_174; + UCHAR *mem_175; + UCHAR *mem_176; { #line 577 - disketteExtension = (DISKETTE_EXTENSION *)Context; - { + disketteExtension = (DISKETTE_EXTENSION *)Context; + { #line 596 - __cil_tmp19 = PeripheralInformation + 1; + __cil_tmp19 = PeripheralInformation + 1; #line 596 - __cil_tmp20 = *__cil_tmp19; + __cil_tmp20 = *__cil_tmp19; #line 596 - __cil_tmp21 = (unsigned int )__cil_tmp20; + __cil_tmp21 = (unsigned int)__cil_tmp20; #line 596 - __cil_tmp22 = __cil_tmp21 + 12; + __cil_tmp22 = __cil_tmp21 + 12; #line 596 - mem_139 = (ULONG *)__cil_tmp22; + mem_139 = (ULONG *)__cil_tmp22; #line 596 - __cil_tmp23 = *mem_139; + __cil_tmp23 = *mem_139; #line 596 - __cil_tmp24 = PeripheralInformation + 1; + __cil_tmp24 = PeripheralInformation + 1; #line 596 - __cil_tmp25 = *__cil_tmp24; + __cil_tmp25 = *__cil_tmp24; #line 596 - __cil_tmp26 = (UCHAR *)__cil_tmp25; + __cil_tmp26 = (UCHAR *)__cil_tmp25; #line 596 - __cil_tmp27 = __cil_tmp26 + __cil_tmp23; + __cil_tmp27 = __cil_tmp26 + __cil_tmp23; #line 596 - if (! __cil_tmp27) { + if (!__cil_tmp27) { #line 600 - return (-1073741811L); - } else { - - } - } + return (-1073741811L); + } else { + } + } #line 604 - __cil_tmp28 = PeripheralInformation + 1; + __cil_tmp28 = PeripheralInformation + 1; #line 604 - __cil_tmp29 = *__cil_tmp28; + __cil_tmp29 = *__cil_tmp28; #line 604 - __cil_tmp30 = (unsigned int )__cil_tmp29; + __cil_tmp30 = (unsigned int)__cil_tmp29; #line 604 - __cil_tmp31 = __cil_tmp30 + 8; + __cil_tmp31 = __cil_tmp30 + 8; #line 604 - mem_140 = (ULONG *)__cil_tmp31; + mem_140 = (ULONG *)__cil_tmp31; #line 604 - __cil_tmp32 = *mem_140; + __cil_tmp32 = *mem_140; #line 604 - __cil_tmp33 = PeripheralInformation + 1; + __cil_tmp33 = PeripheralInformation + 1; #line 604 - __cil_tmp34 = *__cil_tmp33; + __cil_tmp34 = *__cil_tmp33; #line 604 - __cil_tmp35 = (UCHAR *)__cil_tmp34; + __cil_tmp35 = (UCHAR *)__cil_tmp34; #line 604 - __cil_tmp36 = __cil_tmp35 + __cil_tmp32; + __cil_tmp36 = __cil_tmp35 + __cil_tmp32; #line 604 - peripheralData = (struct _CM_FULL_RESOURCE_DESCRIPTOR *)__cil_tmp36; -#line 619 - i = 0UL; - { + peripheralData = (struct _CM_FULL_RESOURCE_DESCRIPTOR *)__cil_tmp36; #line 619 - while (1) { - while_7_continue: /* CIL Label */ ; + i = 0UL; { #line 619 - __cil_tmp37 = 36 + 4; + while (1) { + while_7_continue: /* CIL Label */; + { +#line 619 + __cil_tmp37 = 36 + 4; #line 619 - __cil_tmp38 = (unsigned int )peripheralData; + __cil_tmp38 = (unsigned int)peripheralData; #line 619 - __cil_tmp39 = __cil_tmp38 + __cil_tmp37; + __cil_tmp39 = __cil_tmp38 + __cil_tmp37; #line 619 - mem_141 = (ULONG *)__cil_tmp39; + mem_141 = (ULONG *)__cil_tmp39; #line 619 - __cil_tmp40 = *mem_141; + __cil_tmp40 = *mem_141; #line 619 - if (i < __cil_tmp40) { + if (i < __cil_tmp40) { - } else { - goto while_7_break; - } - } + } else { + goto while_7_break; + } + } #line 621 - __cil_tmp41 = i * 16U; + __cil_tmp41 = i * 16U; #line 621 - __cil_tmp42 = 8 + __cil_tmp41; + __cil_tmp42 = 8 + __cil_tmp41; #line 621 - __cil_tmp43 = 36 + __cil_tmp42; + __cil_tmp43 = 36 + __cil_tmp42; #line 621 - __cil_tmp44 = (unsigned int )peripheralData; + __cil_tmp44 = (unsigned int)peripheralData; #line 621 - __cil_tmp45 = __cil_tmp44 + __cil_tmp43; + __cil_tmp45 = __cil_tmp44 + __cil_tmp43; #line 621 - partial = (CM_PARTIAL_RESOURCE_DESCRIPTOR *)__cil_tmp45; - { + partial = (CM_PARTIAL_RESOURCE_DESCRIPTOR *)__cil_tmp45; + { #line 624 - mem_142 = (UCHAR *)partial; + mem_142 = (UCHAR *)partial; #line 624 - __cil_tmp46 = *mem_142; + __cil_tmp46 = *mem_142; #line 624 - __cil_tmp47 = (int )__cil_tmp46; + __cil_tmp47 = (int)__cil_tmp46; #line 624 - if (__cil_tmp47 == 5) { + if (__cil_tmp47 == 5) { #line 633 - __cil_tmp48 = (unsigned int )disketteExtension; + __cil_tmp48 = (unsigned int)disketteExtension; #line 633 - __cil_tmp49 = __cil_tmp48 + 252; + __cil_tmp49 = __cil_tmp48 + 252; #line 633 - biosDriveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp49; + biosDriveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp49; #line 637 - __cil_tmp50 = partial + 1; + __cil_tmp50 = partial + 1; #line 637 - fDeviceData = (struct _CM_FLOPPY_DEVICE_DATA *)__cil_tmp50; - { + fDeviceData = (struct _CM_FLOPPY_DEVICE_DATA *)__cil_tmp50; + { #line 643 - __cil_tmp51 = (unsigned int )fDeviceData; + __cil_tmp51 = (unsigned int)fDeviceData; #line 643 - __cil_tmp52 = __cil_tmp51 + 12; + __cil_tmp52 = __cil_tmp51 + 12; #line 643 - mem_143 = (ULONG *)__cil_tmp52; + mem_143 = (ULONG *)__cil_tmp52; #line 643 - __cil_tmp53 = *mem_143; + __cil_tmp53 = *mem_143; #line 644 - if ((int )__cil_tmp53 == 360) { - goto switch_8_360; - } else { + if ((int)__cil_tmp53 == 360) { + goto switch_8_360; + } else { #line 646 - if ((int )__cil_tmp53 == 1200) { - goto switch_8_1200; - } else { + if ((int)__cil_tmp53 == 1200) { + goto switch_8_1200; + } else { #line 647 - if ((int )__cil_tmp53 == 1185) { - goto switch_8_1185; - } else { + if ((int)__cil_tmp53 == 1185) { + goto switch_8_1185; + } else { #line 648 - if ((int )__cil_tmp53 == 1423) { - goto switch_8_1423; - } else { + if ((int)__cil_tmp53 == 1423) { + goto switch_8_1423; + } else { #line 649 - if ((int )__cil_tmp53 == 1440) { - goto switch_8_1440; - } else { + if ((int)__cil_tmp53 == 1440) { + goto switch_8_1440; + } else { #line 650 - if ((int )__cil_tmp53 == 2880) { - goto switch_8_2880; - } else { + if ((int)__cil_tmp53 == 2880) { + goto switch_8_2880; + } else { #line 651 - if ((int )__cil_tmp53 == 1201) { - goto switch_8_1201; - } else { - { - goto switch_8_default; + if ((int)__cil_tmp53 == 1201) { + goto switch_8_1201; + } else { + { + goto switch_8_default; #line 643 - if (0) { - switch_8_360: /* CIL Label */ + if (0) { + switch_8_360: /* CIL Label */ #line 645 - driveType = (unsigned char)0; - goto switch_8_break; - switch_8_1200: /* CIL Label */ + driveType = (unsigned char)0; + goto switch_8_break; + switch_8_1200: /* CIL Label */ #line 646 - driveType = (unsigned char)1; - goto switch_8_break; - switch_8_1185: /* CIL Label */ + driveType = (unsigned char)1; + goto switch_8_break; + switch_8_1185: /* CIL Label */ #line 647 - driveType = (unsigned char)1; - goto switch_8_break; - switch_8_1423: /* CIL Label */ + driveType = (unsigned char)1; + goto switch_8_break; + switch_8_1423: /* CIL Label */ #line 648 - driveType = (unsigned char)3; - goto switch_8_break; - switch_8_1440: /* CIL Label */ + driveType = (unsigned char)3; + goto switch_8_break; + switch_8_1440: /* CIL Label */ #line 649 - driveType = (unsigned char)3; - goto switch_8_break; - switch_8_2880: /* CIL Label */ + driveType = (unsigned char)3; + goto switch_8_break; + switch_8_2880: /* CIL Label */ #line 650 - driveType = (unsigned char)4; - goto switch_8_break; - switch_8_1201: /* CIL Label */ ; - { + driveType = (unsigned char)4; + goto switch_8_break; + switch_8_1201: /* CIL Label */; + { #line 651 - __cil_tmp54 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp54 = + (KUSER_SHARED_DATA * const)4292804608U; #line 651 - __cil_tmp55 = (unsigned int )__cil_tmp54; + __cil_tmp55 = (unsigned int)__cil_tmp54; #line 651 - __cil_tmp56 = __cil_tmp55 + 732; + __cil_tmp56 = __cil_tmp55 + 732; #line 651 - mem_144 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp56; + mem_144 = (ALTERNATIVE_ARCHITECTURE_TYPE *) + __cil_tmp56; #line 651 - __cil_tmp57 = *mem_144; + __cil_tmp57 = *mem_144; #line 651 - __cil_tmp58 = (int )__cil_tmp57; + __cil_tmp58 = (int)__cil_tmp57; #line 651 - if (__cil_tmp58 == 1) { + if (__cil_tmp58 == 1) { #line 652 - driveType = (unsigned char)5; - goto switch_8_break; - } else { - - } - } - switch_8_default: /* CIL Label */ ; - { + driveType = (unsigned char)5; + goto switch_8_break; + } else { + } + } + switch_8_default: /* CIL Label */; + { #line 662 - while (1) { - while_9_continue: /* CIL Label */ ; - goto while_9_break; - } - while_9_break: /* CIL Label */ ; - } + while (1) { + while_9_continue: /* CIL Label */; + goto while_9_break; + } + while_9_break: /* CIL Label */; + } #line 664 - driveType = (unsigned char)1; - { + driveType = (unsigned char)1; + { #line 671 - while (1) { - while_10_continue: /* CIL Label */ ; - goto while_10_break; - } - while_10_break: /* CIL Label */ ; + while (1) { + while_10_continue: /* CIL Label */; + goto while_10_break; + } + while_10_break: /* CIL Label */; + } + goto switch_8_break; + } else { + switch_8_break: /* CIL Label */; + } + } + } + } } - goto switch_8_break; - } else { - switch_8_break: /* CIL Label */ ; - } } } } } } - } - } - } - } #line 677 - __cil_tmp59 = (unsigned int )disketteExtension; + __cil_tmp59 = (unsigned int)disketteExtension; #line 677 - __cil_tmp60 = __cil_tmp59 + 174; + __cil_tmp60 = __cil_tmp59 + 174; #line 677 - mem_145 = (UCHAR *)__cil_tmp60; + mem_145 = (UCHAR *)__cil_tmp60; #line 677 - *mem_145 = driveType; + *mem_145 = driveType; #line 684 - __cil_tmp61 = (int )driveType; + __cil_tmp61 = (int)driveType; #line 684 - __cil_tmp62 = DriveMediaLimits + __cil_tmp61; + __cil_tmp62 = DriveMediaLimits + __cil_tmp61; #line 684 - mem_146 = (DRIVE_MEDIA_TYPE *)__cil_tmp62; + mem_146 = (DRIVE_MEDIA_TYPE *)__cil_tmp62; #line 684 - __cil_tmp63 = *mem_146; + __cil_tmp63 = *mem_146; #line 684 - __cil_tmp64 = (unsigned int )__cil_tmp63; + __cil_tmp64 = (unsigned int)__cil_tmp63; #line 684 - __cil_tmp65 = DriveMediaConstants + __cil_tmp64; + __cil_tmp65 = DriveMediaConstants + __cil_tmp64; #line 684 - *biosDriveMediaConstants = *__cil_tmp65; - { + *biosDriveMediaConstants = *__cil_tmp65; + { #line 693 - mem_147 = (USHORT *)fDeviceData; + mem_147 = (USHORT *)fDeviceData; #line 693 - __cil_tmp66 = *mem_147; + __cil_tmp66 = *mem_147; #line 693 - __cil_tmp67 = (int )__cil_tmp66; + __cil_tmp67 = (int)__cil_tmp66; #line 693 - if (__cil_tmp67 >= 2) { + if (__cil_tmp67 >= 2) { #line 698 - __cil_tmp68 = (unsigned int )biosDriveMediaConstants; + __cil_tmp68 = (unsigned int)biosDriveMediaConstants; #line 698 - __cil_tmp69 = __cil_tmp68 + 32; + __cil_tmp69 = __cil_tmp68 + 32; #line 698 - __cil_tmp70 = (unsigned int )fDeviceData; + __cil_tmp70 = (unsigned int)fDeviceData; #line 698 - __cil_tmp71 = __cil_tmp70 + 20; + __cil_tmp71 = __cil_tmp70 + 20; #line 698 - mem_148 = (UCHAR *)__cil_tmp69; + mem_148 = (UCHAR *)__cil_tmp69; #line 698 - mem_149 = (UCHAR *)__cil_tmp71; + mem_149 = (UCHAR *)__cil_tmp71; #line 698 - *mem_148 = *mem_149; + *mem_148 = *mem_149; #line 701 - __cil_tmp72 = (unsigned int )biosDriveMediaConstants; + __cil_tmp72 = (unsigned int)biosDriveMediaConstants; #line 701 - __cil_tmp73 = __cil_tmp72 + 33; + __cil_tmp73 = __cil_tmp72 + 33; #line 701 - __cil_tmp74 = (unsigned int )fDeviceData; + __cil_tmp74 = (unsigned int)fDeviceData; #line 701 - __cil_tmp75 = __cil_tmp74 + 21; + __cil_tmp75 = __cil_tmp74 + 21; #line 701 - mem_150 = (UCHAR *)__cil_tmp73; + mem_150 = (UCHAR *)__cil_tmp73; #line 701 - mem_151 = (UCHAR *)__cil_tmp75; + mem_151 = (UCHAR *)__cil_tmp75; #line 701 - *mem_150 = *mem_151; + *mem_150 = *mem_151; #line 704 - __cil_tmp76 = (unsigned int )biosDriveMediaConstants; + __cil_tmp76 = (unsigned int)biosDriveMediaConstants; #line 704 - __cil_tmp77 = __cil_tmp76 + 34; + __cil_tmp77 = __cil_tmp76 + 34; #line 704 - __cil_tmp78 = (unsigned int )fDeviceData; + __cil_tmp78 = (unsigned int)fDeviceData; #line 704 - __cil_tmp79 = __cil_tmp78 + 22; + __cil_tmp79 = __cil_tmp78 + 22; #line 704 - mem_152 = (UCHAR *)__cil_tmp77; + mem_152 = (UCHAR *)__cil_tmp77; #line 704 - mem_153 = (UCHAR *)__cil_tmp79; + mem_153 = (UCHAR *)__cil_tmp79; #line 704 - *mem_152 = *mem_153; + *mem_152 = *mem_153; #line 707 - __cil_tmp80 = (unsigned int )biosDriveMediaConstants; + __cil_tmp80 = (unsigned int)biosDriveMediaConstants; #line 707 - __cil_tmp81 = __cil_tmp80 + 35; + __cil_tmp81 = __cil_tmp80 + 35; #line 707 - __cil_tmp82 = (unsigned int )fDeviceData; + __cil_tmp82 = (unsigned int)fDeviceData; #line 707 - __cil_tmp83 = __cil_tmp82 + 23; + __cil_tmp83 = __cil_tmp82 + 23; #line 707 - mem_154 = (UCHAR *)__cil_tmp81; + mem_154 = (UCHAR *)__cil_tmp81; #line 707 - mem_155 = (UCHAR *)__cil_tmp83; + mem_155 = (UCHAR *)__cil_tmp83; #line 707 - *mem_154 = *mem_155; - { + *mem_154 = *mem_155; + { #line 712 - __cil_tmp84 = (unsigned int )fDeviceData; + __cil_tmp84 = (unsigned int)fDeviceData; #line 712 - __cil_tmp85 = __cil_tmp84 + 24; + __cil_tmp85 = __cil_tmp84 + 24; #line 712 - mem_156 = (UCHAR *)__cil_tmp85; + mem_156 = (UCHAR *)__cil_tmp85; #line 712 - __cil_tmp86 = *mem_156; + __cil_tmp86 = *mem_156; #line 712 - __cil_tmp87 = (int )__cil_tmp86; + __cil_tmp87 = (int)__cil_tmp86; #line 712 - if (__cil_tmp87 == 0) { + if (__cil_tmp87 == 0) { #line 716 - return (0L); - } else { - - } - } - { + return (0L); + } else { + } + } + { #line 719 - __cil_tmp88 = (unsigned int )fDeviceData; + __cil_tmp88 = (unsigned int)fDeviceData; #line 719 - __cil_tmp89 = __cil_tmp88 + 12; + __cil_tmp89 = __cil_tmp88 + 12; #line 719 - mem_157 = (ULONG *)__cil_tmp89; + mem_157 = (ULONG *)__cil_tmp89; #line 719 - __cil_tmp90 = *mem_157; + __cil_tmp90 = *mem_157; #line 719 - if (__cil_tmp90 == 0UL) { + if (__cil_tmp90 == 0UL) { #line 727 - return (0L); - } else { - - } - } + return (0L); + } else { + } + } #line 730 - __cil_tmp91 = (unsigned int )biosDriveMediaConstants; + __cil_tmp91 = (unsigned int)biosDriveMediaConstants; #line 730 - __cil_tmp92 = __cil_tmp91 + 38; + __cil_tmp92 = __cil_tmp91 + 38; #line 730 - __cil_tmp93 = (unsigned int )fDeviceData; + __cil_tmp93 = (unsigned int)fDeviceData; #line 730 - __cil_tmp94 = __cil_tmp93 + 24; + __cil_tmp94 = __cil_tmp93 + 24; #line 730 - mem_158 = (UCHAR *)__cil_tmp92; + mem_158 = (UCHAR *)__cil_tmp92; #line 730 - mem_159 = (UCHAR *)__cil_tmp94; + mem_159 = (UCHAR *)__cil_tmp94; #line 730 - *mem_158 = *mem_159; + *mem_158 = *mem_159; #line 733 - __cil_tmp95 = (unsigned int )biosDriveMediaConstants; + __cil_tmp95 = (unsigned int)biosDriveMediaConstants; #line 733 - __cil_tmp96 = __cil_tmp95 + 39; + __cil_tmp96 = __cil_tmp95 + 39; #line 733 - __cil_tmp97 = (unsigned int )fDeviceData; + __cil_tmp97 = (unsigned int)fDeviceData; #line 733 - __cil_tmp98 = __cil_tmp97 + 25; + __cil_tmp98 = __cil_tmp97 + 25; #line 733 - mem_160 = (UCHAR *)__cil_tmp96; + mem_160 = (UCHAR *)__cil_tmp96; #line 733 - mem_161 = (UCHAR *)__cil_tmp98; + mem_161 = (UCHAR *)__cil_tmp98; #line 733 - *mem_160 = *mem_161; + *mem_160 = *mem_161; #line 736 - __cil_tmp99 = (unsigned int )biosDriveMediaConstants; + __cil_tmp99 = (unsigned int)biosDriveMediaConstants; #line 736 - __cil_tmp100 = __cil_tmp99 + 40; + __cil_tmp100 = __cil_tmp99 + 40; #line 736 - __cil_tmp101 = (unsigned int )fDeviceData; + __cil_tmp101 = (unsigned int)fDeviceData; #line 736 - __cil_tmp102 = __cil_tmp101 + 27; + __cil_tmp102 = __cil_tmp101 + 27; #line 736 - mem_162 = (UCHAR *)__cil_tmp100; + mem_162 = (UCHAR *)__cil_tmp100; #line 736 - mem_163 = (UCHAR *)__cil_tmp102; + mem_163 = (UCHAR *)__cil_tmp102; #line 736 - *mem_162 = *mem_163; + *mem_162 = *mem_163; #line 739 - __cil_tmp103 = (unsigned int )biosDriveMediaConstants; + __cil_tmp103 = (unsigned int)biosDriveMediaConstants; #line 739 - __cil_tmp104 = __cil_tmp103 + 41; + __cil_tmp104 = __cil_tmp103 + 41; #line 739 - __cil_tmp105 = (unsigned int )fDeviceData; + __cil_tmp105 = (unsigned int)fDeviceData; #line 739 - __cil_tmp106 = __cil_tmp105 + 28; + __cil_tmp106 = __cil_tmp105 + 28; #line 739 - mem_164 = (UCHAR *)__cil_tmp104; + mem_164 = (UCHAR *)__cil_tmp104; #line 739 - mem_165 = (UCHAR *)__cil_tmp106; + mem_165 = (UCHAR *)__cil_tmp106; #line 739 - *mem_164 = *mem_165; + *mem_164 = *mem_165; #line 742 - __cil_tmp107 = (unsigned int )biosDriveMediaConstants; + __cil_tmp107 = (unsigned int)biosDriveMediaConstants; #line 742 - __cil_tmp108 = __cil_tmp107 + 42; + __cil_tmp108 = __cil_tmp107 + 42; #line 742 - __cil_tmp109 = (unsigned int )fDeviceData; + __cil_tmp109 = (unsigned int)fDeviceData; #line 742 - __cil_tmp110 = __cil_tmp109 + 29; + __cil_tmp110 = __cil_tmp109 + 29; #line 742 - mem_166 = (UCHAR *)__cil_tmp108; + mem_166 = (UCHAR *)__cil_tmp108; #line 742 - mem_167 = (UCHAR *)__cil_tmp110; + mem_167 = (UCHAR *)__cil_tmp110; #line 742 - *mem_166 = *mem_167; + *mem_166 = *mem_167; #line 745 - __cil_tmp111 = (unsigned int )biosDriveMediaConstants; + __cil_tmp111 = (unsigned int)biosDriveMediaConstants; #line 745 - __cil_tmp112 = __cil_tmp111 + 44; + __cil_tmp112 = __cil_tmp111 + 44; #line 745 - __cil_tmp113 = (unsigned int )fDeviceData; + __cil_tmp113 = (unsigned int)fDeviceData; #line 745 - __cil_tmp114 = __cil_tmp113 + 30; + __cil_tmp114 = __cil_tmp113 + 30; #line 745 - mem_168 = (UCHAR *)__cil_tmp114; + mem_168 = (UCHAR *)__cil_tmp114; #line 745 - __cil_tmp115 = *mem_168; + __cil_tmp115 = *mem_168; #line 745 - __cil_tmp116 = (int )__cil_tmp115; + __cil_tmp116 = (int)__cil_tmp115; #line 745 - __cil_tmp117 = __cil_tmp116 * 1000; + __cil_tmp117 = __cil_tmp116 * 1000; #line 745 - __cil_tmp118 = __cil_tmp117 / 8; + __cil_tmp118 = __cil_tmp117 / 8; #line 745 - mem_169 = (USHORT *)__cil_tmp112; + mem_169 = (USHORT *)__cil_tmp112; #line 745 - *mem_169 = (unsigned short )__cil_tmp118; + *mem_169 = (unsigned short)__cil_tmp118; #line 748 - __cil_tmp119 = (unsigned int )biosDriveMediaConstants; + __cil_tmp119 = (unsigned int)biosDriveMediaConstants; #line 748 - __cil_tmp120 = __cil_tmp119 + 46; + __cil_tmp120 = __cil_tmp119 + 46; #line 748 - __cil_tmp121 = (unsigned int )fDeviceData; + __cil_tmp121 = (unsigned int)fDeviceData; #line 748 - __cil_tmp122 = __cil_tmp121 + 30; + __cil_tmp122 = __cil_tmp121 + 30; #line 748 - mem_170 = (UCHAR *)__cil_tmp122; + mem_170 = (UCHAR *)__cil_tmp122; #line 748 - __cil_tmp123 = *mem_170; + __cil_tmp123 = *mem_170; #line 748 - __cil_tmp124 = (int )__cil_tmp123; + __cil_tmp124 = (int)__cil_tmp123; #line 748 - __cil_tmp125 = __cil_tmp124 * 1000; + __cil_tmp125 = __cil_tmp124 * 1000; #line 748 - __cil_tmp126 = __cil_tmp125 / 8; + __cil_tmp126 = __cil_tmp125 / 8; #line 748 - mem_171 = (USHORT *)__cil_tmp120; + mem_171 = (USHORT *)__cil_tmp120; #line 748 - *mem_171 = (unsigned short )__cil_tmp126; - { + *mem_171 = (unsigned short)__cil_tmp126; + { #line 751 - __cil_tmp127 = (unsigned int )fDeviceData; + __cil_tmp127 = (unsigned int)fDeviceData; #line 751 - __cil_tmp128 = __cil_tmp127 + 31; + __cil_tmp128 = __cil_tmp127 + 31; #line 751 - mem_172 = (UCHAR *)__cil_tmp128; + mem_172 = (UCHAR *)__cil_tmp128; #line 751 - __cil_tmp129 = *mem_172; + __cil_tmp129 = *mem_172; #line 751 - __cil_tmp130 = (int )__cil_tmp129; + __cil_tmp130 = (int)__cil_tmp129; #line 751 - if (__cil_tmp130 == 0) { + if (__cil_tmp130 == 0) { #line 755 - return (0L); - } else { - - } - } + return (0L); + } else { + } + } #line 758 - __cil_tmp131 = (unsigned int )biosDriveMediaConstants; + __cil_tmp131 = (unsigned int)biosDriveMediaConstants; #line 758 - __cil_tmp132 = __cil_tmp131 + 48; + __cil_tmp132 = __cil_tmp131 + 48; #line 758 - __cil_tmp133 = (unsigned int )fDeviceData; + __cil_tmp133 = (unsigned int)fDeviceData; #line 758 - __cil_tmp134 = __cil_tmp133 + 31; + __cil_tmp134 = __cil_tmp133 + 31; #line 758 - mem_173 = (UCHAR *)__cil_tmp132; + mem_173 = (UCHAR *)__cil_tmp132; #line 758 - mem_174 = (UCHAR *)__cil_tmp134; + mem_174 = (UCHAR *)__cil_tmp134; #line 758 - *mem_173 = *mem_174; + *mem_173 = *mem_174; #line 761 - __cil_tmp135 = (unsigned int )biosDriveMediaConstants; + __cil_tmp135 = (unsigned int)biosDriveMediaConstants; #line 761 - __cil_tmp136 = __cil_tmp135 + 52; + __cil_tmp136 = __cil_tmp135 + 52; #line 761 - __cil_tmp137 = (unsigned int )fDeviceData; + __cil_tmp137 = (unsigned int)fDeviceData; #line 761 - __cil_tmp138 = __cil_tmp137 + 26; + __cil_tmp138 = __cil_tmp137 + 26; #line 761 - mem_175 = (UCHAR *)__cil_tmp136; + mem_175 = (UCHAR *)__cil_tmp136; #line 761 - mem_176 = (UCHAR *)__cil_tmp138; + mem_176 = (UCHAR *)__cil_tmp138; #line 761 - *mem_175 = *mem_176; - } else { - - } + *mem_175 = *mem_176; + } else { + } + } + } else { + } + } +#line 619 + i = i + 1UL; } - } else { - + while_7_break: /* CIL Label */; } - } -#line 619 - i = i + 1UL; - } - while_7_break: /* CIL Label */ ; - } #line 767 - return (0L); -} + return (0L); + } } #line 770 "floppy.c" -NTSTATUS FlAcpiConfigureFloppy(PDISKETTE_EXTENSION DisketteExtension , PFDC_INFO FdcInfo ) -{ UCHAR driveType ; - PDRIVE_MEDIA_CONSTANTS biosDriveMediaConstants ; - unsigned int __cil_tmp5 ; - unsigned int __cil_tmp6 ; - unsigned int __cil_tmp7 ; - unsigned int __cil_tmp8 ; - BOOLEAN __cil_tmp9 ; - unsigned int __cil_tmp10 ; - unsigned int __cil_tmp11 ; - unsigned int __cil_tmp12 ; - ULONG __cil_tmp13 ; - enum _ACPI_FDI_DEVICE_TYPE __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - int __cil_tmp17 ; - PDRIVE_MEDIA_LIMITS __cil_tmp18 ; - DRIVE_MEDIA_TYPE __cil_tmp19 ; - unsigned int __cil_tmp20 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - ULONG __cil_tmp27 ; - unsigned int __cil_tmp28 ; - unsigned int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - unsigned int __cil_tmp32 ; - ULONG __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - ULONG __cil_tmp39 ; - unsigned int __cil_tmp40 ; - unsigned int __cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - ULONG __cil_tmp45 ; - unsigned int __cil_tmp46 ; - unsigned int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - ULONG __cil_tmp51 ; - unsigned int __cil_tmp52 ; - unsigned int __cil_tmp53 ; - unsigned int __cil_tmp54 ; - unsigned int __cil_tmp55 ; - unsigned int __cil_tmp56 ; - ULONG __cil_tmp57 ; - unsigned int __cil_tmp58 ; - unsigned int __cil_tmp59 ; - unsigned int __cil_tmp60 ; - unsigned int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - ULONG __cil_tmp63 ; - unsigned int __cil_tmp64 ; - unsigned int __cil_tmp65 ; - unsigned int __cil_tmp66 ; - unsigned int __cil_tmp67 ; - unsigned int __cil_tmp68 ; - ULONG __cil_tmp69 ; - unsigned int __cil_tmp70 ; - unsigned int __cil_tmp71 ; - unsigned int __cil_tmp72 ; - unsigned int __cil_tmp73 ; - unsigned int __cil_tmp74 ; - ULONG __cil_tmp75 ; - unsigned int __cil_tmp76 ; - unsigned int __cil_tmp77 ; - unsigned int __cil_tmp78 ; - unsigned int __cil_tmp79 ; - unsigned int __cil_tmp80 ; - ULONG __cil_tmp81 ; - unsigned char __cil_tmp82 ; - int __cil_tmp83 ; - int __cil_tmp84 ; - int __cil_tmp85 ; - unsigned int __cil_tmp86 ; - unsigned int __cil_tmp87 ; - unsigned int __cil_tmp88 ; - unsigned int __cil_tmp89 ; - unsigned int __cil_tmp90 ; - ULONG __cil_tmp91 ; - unsigned short __cil_tmp92 ; - int __cil_tmp93 ; - int __cil_tmp94 ; - int __cil_tmp95 ; - unsigned int __cil_tmp96 ; - unsigned int __cil_tmp97 ; - unsigned int __cil_tmp98 ; - unsigned int __cil_tmp99 ; - unsigned int __cil_tmp100 ; - ULONG __cil_tmp101 ; - unsigned int __cil_tmp102 ; - unsigned int __cil_tmp103 ; - unsigned int __cil_tmp104 ; - unsigned int __cil_tmp105 ; - unsigned int __cil_tmp106 ; - ULONG __cil_tmp107 ; - BOOLEAN *mem_108 ; - ULONG *mem_109 ; - UCHAR *mem_110 ; - DRIVE_MEDIA_TYPE *mem_111 ; - ULONG *mem_112 ; - UCHAR *mem_113 ; - ULONG *mem_114 ; - UCHAR *mem_115 ; - ULONG *mem_116 ; - UCHAR *mem_117 ; - ULONG *mem_118 ; - UCHAR *mem_119 ; - ULONG *mem_120 ; - UCHAR *mem_121 ; - ULONG *mem_122 ; - UCHAR *mem_123 ; - ULONG *mem_124 ; - UCHAR *mem_125 ; - ULONG *mem_126 ; - UCHAR *mem_127 ; - ULONG *mem_128 ; - UCHAR *mem_129 ; - ULONG *mem_130 ; - USHORT *mem_131 ; - ULONG *mem_132 ; - USHORT *mem_133 ; - ULONG *mem_134 ; - UCHAR *mem_135 ; - ULONG *mem_136 ; - UCHAR *mem_137 ; +NTSTATUS FlAcpiConfigureFloppy(PDISKETTE_EXTENSION DisketteExtension, + PFDC_INFO FdcInfo) { + UCHAR driveType; + PDRIVE_MEDIA_CONSTANTS biosDriveMediaConstants; + unsigned int __cil_tmp5; + unsigned int __cil_tmp6; + unsigned int __cil_tmp7; + unsigned int __cil_tmp8; + BOOLEAN __cil_tmp9; + unsigned int __cil_tmp10; + unsigned int __cil_tmp11; + unsigned int __cil_tmp12; + ULONG __cil_tmp13; + enum _ACPI_FDI_DEVICE_TYPE __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + int __cil_tmp17; + PDRIVE_MEDIA_LIMITS __cil_tmp18; + DRIVE_MEDIA_TYPE __cil_tmp19; + unsigned int __cil_tmp20; + PDRIVE_MEDIA_CONSTANTS __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + ULONG __cil_tmp27; + unsigned int __cil_tmp28; + unsigned int __cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + unsigned int __cil_tmp32; + ULONG __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + ULONG __cil_tmp39; + unsigned int __cil_tmp40; + unsigned int __cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + ULONG __cil_tmp45; + unsigned int __cil_tmp46; + unsigned int __cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + ULONG __cil_tmp51; + unsigned int __cil_tmp52; + unsigned int __cil_tmp53; + unsigned int __cil_tmp54; + unsigned int __cil_tmp55; + unsigned int __cil_tmp56; + ULONG __cil_tmp57; + unsigned int __cil_tmp58; + unsigned int __cil_tmp59; + unsigned int __cil_tmp60; + unsigned int __cil_tmp61; + unsigned int __cil_tmp62; + ULONG __cil_tmp63; + unsigned int __cil_tmp64; + unsigned int __cil_tmp65; + unsigned int __cil_tmp66; + unsigned int __cil_tmp67; + unsigned int __cil_tmp68; + ULONG __cil_tmp69; + unsigned int __cil_tmp70; + unsigned int __cil_tmp71; + unsigned int __cil_tmp72; + unsigned int __cil_tmp73; + unsigned int __cil_tmp74; + ULONG __cil_tmp75; + unsigned int __cil_tmp76; + unsigned int __cil_tmp77; + unsigned int __cil_tmp78; + unsigned int __cil_tmp79; + unsigned int __cil_tmp80; + ULONG __cil_tmp81; + unsigned char __cil_tmp82; + int __cil_tmp83; + int __cil_tmp84; + int __cil_tmp85; + unsigned int __cil_tmp86; + unsigned int __cil_tmp87; + unsigned int __cil_tmp88; + unsigned int __cil_tmp89; + unsigned int __cil_tmp90; + ULONG __cil_tmp91; + unsigned short __cil_tmp92; + int __cil_tmp93; + int __cil_tmp94; + int __cil_tmp95; + unsigned int __cil_tmp96; + unsigned int __cil_tmp97; + unsigned int __cil_tmp98; + unsigned int __cil_tmp99; + unsigned int __cil_tmp100; + ULONG __cil_tmp101; + unsigned int __cil_tmp102; + unsigned int __cil_tmp103; + unsigned int __cil_tmp104; + unsigned int __cil_tmp105; + unsigned int __cil_tmp106; + ULONG __cil_tmp107; + BOOLEAN *mem_108; + ULONG *mem_109; + UCHAR *mem_110; + DRIVE_MEDIA_TYPE *mem_111; + ULONG *mem_112; + UCHAR *mem_113; + ULONG *mem_114; + UCHAR *mem_115; + ULONG *mem_116; + UCHAR *mem_117; + ULONG *mem_118; + UCHAR *mem_119; + ULONG *mem_120; + UCHAR *mem_121; + ULONG *mem_122; + UCHAR *mem_123; + ULONG *mem_124; + UCHAR *mem_125; + ULONG *mem_126; + UCHAR *mem_127; + ULONG *mem_128; + UCHAR *mem_129; + ULONG *mem_130; + USHORT *mem_131; + ULONG *mem_132; + USHORT *mem_133; + ULONG *mem_134; + UCHAR *mem_135; + ULONG *mem_136; + UCHAR *mem_137; { #line 789 - __cil_tmp5 = (unsigned int )DisketteExtension; + __cil_tmp5 = (unsigned int)DisketteExtension; #line 789 - __cil_tmp6 = __cil_tmp5 + 252; + __cil_tmp6 = __cil_tmp5 + 252; #line 789 - biosDriveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp6; - { + biosDriveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp6; + { #line 792 - __cil_tmp7 = (unsigned int )FdcInfo; + __cil_tmp7 = (unsigned int)FdcInfo; #line 792 - __cil_tmp8 = __cil_tmp7 + 61; + __cil_tmp8 = __cil_tmp7 + 61; #line 792 - mem_108 = (BOOLEAN *)__cil_tmp8; + mem_108 = (BOOLEAN *)__cil_tmp8; #line 792 - __cil_tmp9 = *mem_108; + __cil_tmp9 = *mem_108; #line 792 - if (! __cil_tmp9) { + if (!__cil_tmp9) { #line 794 - return (-1073741823L); - } else { - - } - } - { + return (-1073741823L); + } else { + } + } + { #line 802 - __cil_tmp10 = 64 + 4; + __cil_tmp10 = 64 + 4; #line 802 - __cil_tmp11 = (unsigned int )FdcInfo; + __cil_tmp11 = (unsigned int)FdcInfo; #line 802 - __cil_tmp12 = __cil_tmp11 + __cil_tmp10; + __cil_tmp12 = __cil_tmp11 + __cil_tmp10; #line 802 - mem_109 = (ULONG *)__cil_tmp12; + mem_109 = (ULONG *)__cil_tmp12; #line 802 - __cil_tmp13 = *mem_109; + __cil_tmp13 = *mem_109; #line 802 - __cil_tmp14 = (enum _ACPI_FDI_DEVICE_TYPE )__cil_tmp13; + __cil_tmp14 = (enum _ACPI_FDI_DEVICE_TYPE)__cil_tmp13; #line 803 - if ((int )__cil_tmp14 == 1) { - goto switch_11_1; - } else { + if ((int)__cil_tmp14 == 1) { + goto switch_11_1; + } else { #line 805 - if ((int )__cil_tmp14 == 2) { - goto switch_11_2; - } else { + if ((int)__cil_tmp14 == 2) { + goto switch_11_2; + } else { #line 806 - if ((int )__cil_tmp14 == 3) { - goto switch_11_3; - } else { + if ((int)__cil_tmp14 == 3) { + goto switch_11_3; + } else { #line 807 - if ((int )__cil_tmp14 == 4) { - goto switch_11_4; - } else { + if ((int)__cil_tmp14 == 4) { + goto switch_11_4; + } else { #line 808 - if ((int )__cil_tmp14 == 5) { - goto switch_11_5; - } else { - { - goto switch_11_default; + if ((int)__cil_tmp14 == 5) { + goto switch_11_5; + } else { + { + goto switch_11_default; #line 802 - if (0) { - switch_11_1: /* CIL Label */ + if (0) { + switch_11_1: /* CIL Label */ #line 804 - driveType = (unsigned char)0; - goto switch_11_break; - switch_11_2: /* CIL Label */ + driveType = (unsigned char)0; + goto switch_11_break; + switch_11_2: /* CIL Label */ #line 805 - driveType = (unsigned char)1; - goto switch_11_break; - switch_11_3: /* CIL Label */ + driveType = (unsigned char)1; + goto switch_11_break; + switch_11_3: /* CIL Label */ #line 806 - driveType = (unsigned char)2; - goto switch_11_break; - switch_11_4: /* CIL Label */ + driveType = (unsigned char)2; + goto switch_11_break; + switch_11_4: /* CIL Label */ #line 807 - driveType = (unsigned char)3; - goto switch_11_break; - switch_11_5: /* CIL Label */ + driveType = (unsigned char)3; + goto switch_11_break; + switch_11_5: /* CIL Label */ #line 808 - driveType = (unsigned char)4; - goto switch_11_break; - switch_11_default: /* CIL Label */ + driveType = (unsigned char)4; + goto switch_11_break; + switch_11_default: /* CIL Label */ #line 810 - driveType = (unsigned char)1; - goto switch_11_break; - } else { - switch_11_break: /* CIL Label */ ; - } + driveType = (unsigned char)1; + goto switch_11_break; + } else { + switch_11_break: /* CIL Label */; + } + } + } } } } } } - } - } #line 814 - __cil_tmp15 = (unsigned int )DisketteExtension; + __cil_tmp15 = (unsigned int)DisketteExtension; #line 814 - __cil_tmp16 = __cil_tmp15 + 174; + __cil_tmp16 = __cil_tmp15 + 174; #line 814 - mem_110 = (UCHAR *)__cil_tmp16; + mem_110 = (UCHAR *)__cil_tmp16; #line 814 - *mem_110 = driveType; + *mem_110 = driveType; #line 821 - __cil_tmp17 = (int )driveType; + __cil_tmp17 = (int)driveType; #line 821 - __cil_tmp18 = DriveMediaLimits + __cil_tmp17; + __cil_tmp18 = DriveMediaLimits + __cil_tmp17; #line 821 - mem_111 = (DRIVE_MEDIA_TYPE *)__cil_tmp18; + mem_111 = (DRIVE_MEDIA_TYPE *)__cil_tmp18; #line 821 - __cil_tmp19 = *mem_111; + __cil_tmp19 = *mem_111; #line 821 - __cil_tmp20 = (unsigned int )__cil_tmp19; + __cil_tmp20 = (unsigned int)__cil_tmp19; #line 821 - __cil_tmp21 = DriveMediaConstants + __cil_tmp20; + __cil_tmp21 = DriveMediaConstants + __cil_tmp20; #line 821 - *biosDriveMediaConstants = *__cil_tmp21; + *biosDriveMediaConstants = *__cil_tmp21; #line 824 - __cil_tmp22 = (unsigned int )biosDriveMediaConstants; + __cil_tmp22 = (unsigned int)biosDriveMediaConstants; #line 824 - __cil_tmp23 = __cil_tmp22 + 32; + __cil_tmp23 = __cil_tmp22 + 32; #line 824 - __cil_tmp24 = 64 + 20; + __cil_tmp24 = 64 + 20; #line 824 - __cil_tmp25 = (unsigned int )FdcInfo; + __cil_tmp25 = (unsigned int)FdcInfo; #line 824 - __cil_tmp26 = __cil_tmp25 + __cil_tmp24; + __cil_tmp26 = __cil_tmp25 + __cil_tmp24; #line 824 - mem_112 = (ULONG *)__cil_tmp26; + mem_112 = (ULONG *)__cil_tmp26; #line 824 - __cil_tmp27 = *mem_112; + __cil_tmp27 = *mem_112; #line 824 - mem_113 = (UCHAR *)__cil_tmp23; + mem_113 = (UCHAR *)__cil_tmp23; #line 824 - *mem_113 = (unsigned char )__cil_tmp27; + *mem_113 = (unsigned char)__cil_tmp27; #line 825 - __cil_tmp28 = (unsigned int )biosDriveMediaConstants; + __cil_tmp28 = (unsigned int)biosDriveMediaConstants; #line 825 - __cil_tmp29 = __cil_tmp28 + 33; + __cil_tmp29 = __cil_tmp28 + 33; #line 825 - __cil_tmp30 = 64 + 24; + __cil_tmp30 = 64 + 24; #line 825 - __cil_tmp31 = (unsigned int )FdcInfo; + __cil_tmp31 = (unsigned int)FdcInfo; #line 825 - __cil_tmp32 = __cil_tmp31 + __cil_tmp30; + __cil_tmp32 = __cil_tmp31 + __cil_tmp30; #line 825 - mem_114 = (ULONG *)__cil_tmp32; + mem_114 = (ULONG *)__cil_tmp32; #line 825 - __cil_tmp33 = *mem_114; + __cil_tmp33 = *mem_114; #line 825 - mem_115 = (UCHAR *)__cil_tmp29; + mem_115 = (UCHAR *)__cil_tmp29; #line 825 - *mem_115 = (unsigned char )__cil_tmp33; + *mem_115 = (unsigned char)__cil_tmp33; #line 826 - __cil_tmp34 = (unsigned int )biosDriveMediaConstants; + __cil_tmp34 = (unsigned int)biosDriveMediaConstants; #line 826 - __cil_tmp35 = __cil_tmp34 + 34; + __cil_tmp35 = __cil_tmp34 + 34; #line 826 - __cil_tmp36 = 64 + 28; + __cil_tmp36 = 64 + 28; #line 826 - __cil_tmp37 = (unsigned int )FdcInfo; + __cil_tmp37 = (unsigned int)FdcInfo; #line 826 - __cil_tmp38 = __cil_tmp37 + __cil_tmp36; + __cil_tmp38 = __cil_tmp37 + __cil_tmp36; #line 826 - mem_116 = (ULONG *)__cil_tmp38; + mem_116 = (ULONG *)__cil_tmp38; #line 826 - __cil_tmp39 = *mem_116; + __cil_tmp39 = *mem_116; #line 826 - mem_117 = (UCHAR *)__cil_tmp35; + mem_117 = (UCHAR *)__cil_tmp35; #line 826 - *mem_117 = (unsigned char )__cil_tmp39; + *mem_117 = (unsigned char)__cil_tmp39; #line 827 - __cil_tmp40 = (unsigned int )biosDriveMediaConstants; + __cil_tmp40 = (unsigned int)biosDriveMediaConstants; #line 827 - __cil_tmp41 = __cil_tmp40 + 35; + __cil_tmp41 = __cil_tmp40 + 35; #line 827 - __cil_tmp42 = 64 + 32; + __cil_tmp42 = 64 + 32; #line 827 - __cil_tmp43 = (unsigned int )FdcInfo; + __cil_tmp43 = (unsigned int)FdcInfo; #line 827 - __cil_tmp44 = __cil_tmp43 + __cil_tmp42; + __cil_tmp44 = __cil_tmp43 + __cil_tmp42; #line 827 - mem_118 = (ULONG *)__cil_tmp44; + mem_118 = (ULONG *)__cil_tmp44; #line 827 - __cil_tmp45 = *mem_118; + __cil_tmp45 = *mem_118; #line 827 - mem_119 = (UCHAR *)__cil_tmp41; + mem_119 = (UCHAR *)__cil_tmp41; #line 827 - *mem_119 = (unsigned char )__cil_tmp45; + *mem_119 = (unsigned char)__cil_tmp45; #line 828 - __cil_tmp46 = (unsigned int )biosDriveMediaConstants; + __cil_tmp46 = (unsigned int)biosDriveMediaConstants; #line 828 - __cil_tmp47 = __cil_tmp46 + 38; + __cil_tmp47 = __cil_tmp46 + 38; #line 828 - __cil_tmp48 = 64 + 36; + __cil_tmp48 = 64 + 36; #line 828 - __cil_tmp49 = (unsigned int )FdcInfo; + __cil_tmp49 = (unsigned int)FdcInfo; #line 828 - __cil_tmp50 = __cil_tmp49 + __cil_tmp48; + __cil_tmp50 = __cil_tmp49 + __cil_tmp48; #line 828 - mem_120 = (ULONG *)__cil_tmp50; + mem_120 = (ULONG *)__cil_tmp50; #line 828 - __cil_tmp51 = *mem_120; + __cil_tmp51 = *mem_120; #line 828 - mem_121 = (UCHAR *)__cil_tmp47; + mem_121 = (UCHAR *)__cil_tmp47; #line 828 - *mem_121 = (unsigned char )__cil_tmp51; + *mem_121 = (unsigned char)__cil_tmp51; #line 829 - __cil_tmp52 = (unsigned int )biosDriveMediaConstants; + __cil_tmp52 = (unsigned int)biosDriveMediaConstants; #line 829 - __cil_tmp53 = __cil_tmp52 + 39; + __cil_tmp53 = __cil_tmp52 + 39; #line 829 - __cil_tmp54 = 64 + 40; + __cil_tmp54 = 64 + 40; #line 829 - __cil_tmp55 = (unsigned int )FdcInfo; + __cil_tmp55 = (unsigned int)FdcInfo; #line 829 - __cil_tmp56 = __cil_tmp55 + __cil_tmp54; + __cil_tmp56 = __cil_tmp55 + __cil_tmp54; #line 829 - mem_122 = (ULONG *)__cil_tmp56; + mem_122 = (ULONG *)__cil_tmp56; #line 829 - __cil_tmp57 = *mem_122; + __cil_tmp57 = *mem_122; #line 829 - mem_123 = (UCHAR *)__cil_tmp53; + mem_123 = (UCHAR *)__cil_tmp53; #line 829 - *mem_123 = (unsigned char )__cil_tmp57; + *mem_123 = (unsigned char)__cil_tmp57; #line 830 - __cil_tmp58 = (unsigned int )biosDriveMediaConstants; + __cil_tmp58 = (unsigned int)biosDriveMediaConstants; #line 830 - __cil_tmp59 = __cil_tmp58 + 40; + __cil_tmp59 = __cil_tmp58 + 40; #line 830 - __cil_tmp60 = 64 + 48; + __cil_tmp60 = 64 + 48; #line 830 - __cil_tmp61 = (unsigned int )FdcInfo; + __cil_tmp61 = (unsigned int)FdcInfo; #line 830 - __cil_tmp62 = __cil_tmp61 + __cil_tmp60; + __cil_tmp62 = __cil_tmp61 + __cil_tmp60; #line 830 - mem_124 = (ULONG *)__cil_tmp62; + mem_124 = (ULONG *)__cil_tmp62; #line 830 - __cil_tmp63 = *mem_124; + __cil_tmp63 = *mem_124; #line 830 - mem_125 = (UCHAR *)__cil_tmp59; + mem_125 = (UCHAR *)__cil_tmp59; #line 830 - *mem_125 = (unsigned char )__cil_tmp63; + *mem_125 = (unsigned char)__cil_tmp63; #line 831 - __cil_tmp64 = (unsigned int )biosDriveMediaConstants; + __cil_tmp64 = (unsigned int)biosDriveMediaConstants; #line 831 - __cil_tmp65 = __cil_tmp64 + 41; + __cil_tmp65 = __cil_tmp64 + 41; #line 831 - __cil_tmp66 = 64 + 52; + __cil_tmp66 = 64 + 52; #line 831 - __cil_tmp67 = (unsigned int )FdcInfo; + __cil_tmp67 = (unsigned int)FdcInfo; #line 831 - __cil_tmp68 = __cil_tmp67 + __cil_tmp66; + __cil_tmp68 = __cil_tmp67 + __cil_tmp66; #line 831 - mem_126 = (ULONG *)__cil_tmp68; + mem_126 = (ULONG *)__cil_tmp68; #line 831 - __cil_tmp69 = *mem_126; + __cil_tmp69 = *mem_126; #line 831 - mem_127 = (UCHAR *)__cil_tmp65; + mem_127 = (UCHAR *)__cil_tmp65; #line 831 - *mem_127 = (unsigned char )__cil_tmp69; + *mem_127 = (unsigned char)__cil_tmp69; #line 832 - __cil_tmp70 = (unsigned int )biosDriveMediaConstants; + __cil_tmp70 = (unsigned int)biosDriveMediaConstants; #line 832 - __cil_tmp71 = __cil_tmp70 + 42; + __cil_tmp71 = __cil_tmp70 + 42; #line 832 - __cil_tmp72 = 64 + 56; + __cil_tmp72 = 64 + 56; #line 832 - __cil_tmp73 = (unsigned int )FdcInfo; + __cil_tmp73 = (unsigned int)FdcInfo; #line 832 - __cil_tmp74 = __cil_tmp73 + __cil_tmp72; + __cil_tmp74 = __cil_tmp73 + __cil_tmp72; #line 832 - mem_128 = (ULONG *)__cil_tmp74; + mem_128 = (ULONG *)__cil_tmp74; #line 832 - __cil_tmp75 = *mem_128; + __cil_tmp75 = *mem_128; #line 832 - mem_129 = (UCHAR *)__cil_tmp71; + mem_129 = (UCHAR *)__cil_tmp71; #line 832 - *mem_129 = (unsigned char )__cil_tmp75; + *mem_129 = (unsigned char)__cil_tmp75; #line 833 - __cil_tmp76 = (unsigned int )biosDriveMediaConstants; + __cil_tmp76 = (unsigned int)biosDriveMediaConstants; #line 833 - __cil_tmp77 = __cil_tmp76 + 44; + __cil_tmp77 = __cil_tmp76 + 44; #line 833 - __cil_tmp78 = 64 + 60; + __cil_tmp78 = 64 + 60; #line 833 - __cil_tmp79 = (unsigned int )FdcInfo; + __cil_tmp79 = (unsigned int)FdcInfo; #line 833 - __cil_tmp80 = __cil_tmp79 + __cil_tmp78; + __cil_tmp80 = __cil_tmp79 + __cil_tmp78; #line 833 - mem_130 = (ULONG *)__cil_tmp80; + mem_130 = (ULONG *)__cil_tmp80; #line 833 - __cil_tmp81 = *mem_130; + __cil_tmp81 = *mem_130; #line 833 - __cil_tmp82 = (unsigned char )__cil_tmp81; + __cil_tmp82 = (unsigned char)__cil_tmp81; #line 833 - __cil_tmp83 = (int )__cil_tmp82; + __cil_tmp83 = (int)__cil_tmp82; #line 833 - __cil_tmp84 = __cil_tmp83 * 1000; + __cil_tmp84 = __cil_tmp83 * 1000; #line 833 - __cil_tmp85 = __cil_tmp84 / 8; + __cil_tmp85 = __cil_tmp84 / 8; #line 833 - mem_131 = (USHORT *)__cil_tmp77; + mem_131 = (USHORT *)__cil_tmp77; #line 833 - *mem_131 = (unsigned short )__cil_tmp85; + *mem_131 = (unsigned short)__cil_tmp85; #line 834 - __cil_tmp86 = (unsigned int )biosDriveMediaConstants; + __cil_tmp86 = (unsigned int)biosDriveMediaConstants; #line 834 - __cil_tmp87 = __cil_tmp86 + 46; + __cil_tmp87 = __cil_tmp86 + 46; #line 834 - __cil_tmp88 = 64 + 60; + __cil_tmp88 = 64 + 60; #line 834 - __cil_tmp89 = (unsigned int )FdcInfo; + __cil_tmp89 = (unsigned int)FdcInfo; #line 834 - __cil_tmp90 = __cil_tmp89 + __cil_tmp88; + __cil_tmp90 = __cil_tmp89 + __cil_tmp88; #line 834 - mem_132 = (ULONG *)__cil_tmp90; + mem_132 = (ULONG *)__cil_tmp90; #line 834 - __cil_tmp91 = *mem_132; + __cil_tmp91 = *mem_132; #line 834 - __cil_tmp92 = (unsigned short )__cil_tmp91; + __cil_tmp92 = (unsigned short)__cil_tmp91; #line 834 - __cil_tmp93 = (int )__cil_tmp92; + __cil_tmp93 = (int)__cil_tmp92; #line 834 - __cil_tmp94 = __cil_tmp93 * 1000; + __cil_tmp94 = __cil_tmp93 * 1000; #line 834 - __cil_tmp95 = __cil_tmp94 / 8; + __cil_tmp95 = __cil_tmp94 / 8; #line 834 - mem_133 = (USHORT *)__cil_tmp87; + mem_133 = (USHORT *)__cil_tmp87; #line 834 - *mem_133 = (unsigned short )__cil_tmp95; + *mem_133 = (unsigned short)__cil_tmp95; #line 835 - __cil_tmp96 = (unsigned int )biosDriveMediaConstants; + __cil_tmp96 = (unsigned int)biosDriveMediaConstants; #line 835 - __cil_tmp97 = __cil_tmp96 + 48; + __cil_tmp97 = __cil_tmp96 + 48; #line 835 - __cil_tmp98 = 64 + 8; + __cil_tmp98 = 64 + 8; #line 835 - __cil_tmp99 = (unsigned int )FdcInfo; + __cil_tmp99 = (unsigned int)FdcInfo; #line 835 - __cil_tmp100 = __cil_tmp99 + __cil_tmp98; + __cil_tmp100 = __cil_tmp99 + __cil_tmp98; #line 835 - mem_134 = (ULONG *)__cil_tmp100; + mem_134 = (ULONG *)__cil_tmp100; #line 835 - __cil_tmp101 = *mem_134; + __cil_tmp101 = *mem_134; #line 835 - mem_135 = (UCHAR *)__cil_tmp97; + mem_135 = (UCHAR *)__cil_tmp97; #line 835 - *mem_135 = (unsigned char )__cil_tmp101; + *mem_135 = (unsigned char)__cil_tmp101; #line 836 - __cil_tmp102 = (unsigned int )biosDriveMediaConstants; + __cil_tmp102 = (unsigned int)biosDriveMediaConstants; #line 836 - __cil_tmp103 = __cil_tmp102 + 52; + __cil_tmp103 = __cil_tmp102 + 52; #line 836 - __cil_tmp104 = 64 + 44; + __cil_tmp104 = 64 + 44; #line 836 - __cil_tmp105 = (unsigned int )FdcInfo; + __cil_tmp105 = (unsigned int)FdcInfo; #line 836 - __cil_tmp106 = __cil_tmp105 + __cil_tmp104; + __cil_tmp106 = __cil_tmp105 + __cil_tmp104; #line 836 - mem_136 = (ULONG *)__cil_tmp106; + mem_136 = (ULONG *)__cil_tmp106; #line 836 - __cil_tmp107 = *mem_136; + __cil_tmp107 = *mem_136; #line 836 - mem_137 = (UCHAR *)__cil_tmp103; + mem_137 = (UCHAR *)__cil_tmp103; #line 836 - *mem_137 = (unsigned char )__cil_tmp107; + *mem_137 = (unsigned char)__cil_tmp107; #line 838 - return (0L); -} + return (0L); + } } #line 841 "floppy.c" -NTSTATUS FlQueueIrpToThread(PIRP Irp , PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS status ; - HANDLE threadHandle ; - PIO_STACK_LOCATION irpSp ; - OBJECT_ATTRIBUTES ObjAttributes ; - unsigned int __cil_tmp7 ; - unsigned int __cil_tmp8 ; - unsigned int __cil_tmp9 ; - unsigned int __cil_tmp10 ; - unsigned int __cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - FAST_MUTEX *__cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - BOOLEAN __cil_tmp17 ; - int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - unsigned int __cil_tmp20 ; - FAST_MUTEX *__cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - FAST_MUTEX *__cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - FAST_MUTEX *__cil_tmp32 ; - unsigned int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - LONG __cil_tmp37 ; - unsigned int __cil_tmp38 ; - unsigned int __cil_tmp39 ; - LONG __cil_tmp40 ; - unsigned int __cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - LONG __cil_tmp45 ; - void *__cil_tmp46 ; - OBJECT_ATTRIBUTES *__cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - void *__cil_tmp51 ; - unsigned int __cil_tmp52 ; - unsigned int __cil_tmp53 ; - void *__cil_tmp54 ; - void *__cil_tmp55 ; - CLIENT_ID *__cil_tmp56 ; - void *__cil_tmp57 ; - int __cil_tmp58 ; - unsigned int __cil_tmp59 ; - unsigned int __cil_tmp60 ; - void *__cil_tmp61 ; - unsigned int __cil_tmp62 ; - unsigned int __cil_tmp63 ; - FAST_MUTEX *__cil_tmp64 ; - HANDLE *__cil_tmp65 ; - HANDLE __cil_tmp66 ; - void *__cil_tmp67 ; - struct _OBJECT_TYPE *__cil_tmp68 ; - unsigned int __cil_tmp69 ; - unsigned int __cil_tmp70 ; - PKTHREAD *__cil_tmp71 ; - PVOID *__cil_tmp72 ; - void *__cil_tmp73 ; - struct _OBJECT_HANDLE_INFORMATION *__cil_tmp74 ; - HANDLE *__cil_tmp75 ; - HANDLE __cil_tmp76 ; - unsigned int __cil_tmp77 ; - unsigned int __cil_tmp78 ; - FAST_MUTEX *__cil_tmp79 ; - int __cil_tmp80 ; - unsigned int __cil_tmp81 ; - unsigned int __cil_tmp82 ; - FAST_MUTEX *__cil_tmp83 ; - unsigned int __cil_tmp84 ; - unsigned int __cil_tmp85 ; - unsigned int __cil_tmp86 ; - unsigned int __cil_tmp87 ; - unsigned int __cil_tmp88 ; - struct _IO_STACK_LOCATION *__cil_tmp89 ; - unsigned int __cil_tmp90 ; - unsigned int __cil_tmp91 ; - unsigned int __cil_tmp92 ; - unsigned int __cil_tmp93 ; - unsigned int __cil_tmp94 ; - unsigned int __cil_tmp95 ; - unsigned int __cil_tmp96 ; - struct _IO_STACK_LOCATION *__cil_tmp97 ; - unsigned int __cil_tmp98 ; - unsigned int __cil_tmp99 ; - UCHAR __cil_tmp100 ; - int __cil_tmp101 ; - int __cil_tmp102 ; - unsigned int __cil_tmp103 ; - unsigned int __cil_tmp104 ; - LIST_ENTRY *__cil_tmp105 ; - unsigned int __cil_tmp106 ; - unsigned int __cil_tmp107 ; - unsigned int __cil_tmp108 ; - unsigned int __cil_tmp109 ; - LIST_ENTRY *__cil_tmp110 ; - unsigned int __cil_tmp111 ; - unsigned int __cil_tmp112 ; - KSPIN_LOCK *__cil_tmp113 ; - unsigned int __cil_tmp114 ; - unsigned int __cil_tmp115 ; - KSEMAPHORE *__cil_tmp116 ; - struct _IO_STACK_LOCATION **mem_117 ; - BOOLEAN *mem_118 ; - NTSTATUS *mem_119 ; - ULONG_PTR *mem_120 ; - LONG *mem_121 ; - LONG *mem_122 ; - LONG *mem_123 ; - LONG *mem_124 ; - LONG *mem_125 ; - ULONG *mem_126 ; - HANDLE *mem_127 ; - ULONG *mem_128 ; - PUNICODE_STRING *mem_129 ; - PVOID *mem_130 ; - PVOID *mem_131 ; - LONG *mem_132 ; - struct _IO_STACK_LOCATION **mem_133 ; - struct _IO_STACK_LOCATION **mem_134 ; - UCHAR *mem_135 ; - UCHAR *mem_136 ; +NTSTATUS FlQueueIrpToThread(PIRP Irp, PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS status; + HANDLE threadHandle; + PIO_STACK_LOCATION irpSp; + OBJECT_ATTRIBUTES ObjAttributes; + unsigned int __cil_tmp7; + unsigned int __cil_tmp8; + unsigned int __cil_tmp9; + unsigned int __cil_tmp10; + unsigned int __cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + FAST_MUTEX *__cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + BOOLEAN __cil_tmp17; + int __cil_tmp18; + unsigned int __cil_tmp19; + unsigned int __cil_tmp20; + FAST_MUTEX *__cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + FAST_MUTEX *__cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + FAST_MUTEX *__cil_tmp32; + unsigned int __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + LONG __cil_tmp37; + unsigned int __cil_tmp38; + unsigned int __cil_tmp39; + LONG __cil_tmp40; + unsigned int __cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + LONG __cil_tmp45; + void *__cil_tmp46; + OBJECT_ATTRIBUTES *__cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + void *__cil_tmp51; + unsigned int __cil_tmp52; + unsigned int __cil_tmp53; + void *__cil_tmp54; + void *__cil_tmp55; + CLIENT_ID *__cil_tmp56; + void *__cil_tmp57; + int __cil_tmp58; + unsigned int __cil_tmp59; + unsigned int __cil_tmp60; + void *__cil_tmp61; + unsigned int __cil_tmp62; + unsigned int __cil_tmp63; + FAST_MUTEX *__cil_tmp64; + HANDLE *__cil_tmp65; + HANDLE __cil_tmp66; + void *__cil_tmp67; + struct _OBJECT_TYPE *__cil_tmp68; + unsigned int __cil_tmp69; + unsigned int __cil_tmp70; + PKTHREAD *__cil_tmp71; + PVOID *__cil_tmp72; + void *__cil_tmp73; + struct _OBJECT_HANDLE_INFORMATION *__cil_tmp74; + HANDLE *__cil_tmp75; + HANDLE __cil_tmp76; + unsigned int __cil_tmp77; + unsigned int __cil_tmp78; + FAST_MUTEX *__cil_tmp79; + int __cil_tmp80; + unsigned int __cil_tmp81; + unsigned int __cil_tmp82; + FAST_MUTEX *__cil_tmp83; + unsigned int __cil_tmp84; + unsigned int __cil_tmp85; + unsigned int __cil_tmp86; + unsigned int __cil_tmp87; + unsigned int __cil_tmp88; + struct _IO_STACK_LOCATION *__cil_tmp89; + unsigned int __cil_tmp90; + unsigned int __cil_tmp91; + unsigned int __cil_tmp92; + unsigned int __cil_tmp93; + unsigned int __cil_tmp94; + unsigned int __cil_tmp95; + unsigned int __cil_tmp96; + struct _IO_STACK_LOCATION *__cil_tmp97; + unsigned int __cil_tmp98; + unsigned int __cil_tmp99; + UCHAR __cil_tmp100; + int __cil_tmp101; + int __cil_tmp102; + unsigned int __cil_tmp103; + unsigned int __cil_tmp104; + LIST_ENTRY *__cil_tmp105; + unsigned int __cil_tmp106; + unsigned int __cil_tmp107; + unsigned int __cil_tmp108; + unsigned int __cil_tmp109; + LIST_ENTRY *__cil_tmp110; + unsigned int __cil_tmp111; + unsigned int __cil_tmp112; + KSPIN_LOCK *__cil_tmp113; + unsigned int __cil_tmp114; + unsigned int __cil_tmp115; + KSEMAPHORE *__cil_tmp116; + struct _IO_STACK_LOCATION **mem_117; + BOOLEAN *mem_118; + NTSTATUS *mem_119; + ULONG_PTR *mem_120; + LONG *mem_121; + LONG *mem_122; + LONG *mem_123; + LONG *mem_124; + LONG *mem_125; + ULONG *mem_126; + HANDLE *mem_127; + ULONG *mem_128; + PUNICODE_STRING *mem_129; + PVOID *mem_130; + PVOID *mem_131; + LONG *mem_132; + struct _IO_STACK_LOCATION **mem_133; + struct _IO_STACK_LOCATION **mem_134; + UCHAR *mem_135; + UCHAR *mem_136; { - { + { #line 871 - __cil_tmp7 = 24 + 8; + __cil_tmp7 = 24 + 8; #line 871 - __cil_tmp8 = 0 + __cil_tmp7; + __cil_tmp8 = 0 + __cil_tmp7; #line 871 - __cil_tmp9 = 64 + __cil_tmp8; + __cil_tmp9 = 64 + __cil_tmp8; #line 871 - __cil_tmp10 = (unsigned int )Irp; + __cil_tmp10 = (unsigned int)Irp; #line 871 - __cil_tmp11 = __cil_tmp10 + __cil_tmp9; + __cil_tmp11 = __cil_tmp10 + __cil_tmp9; #line 871 - mem_117 = (struct _IO_STACK_LOCATION **)__cil_tmp11; + mem_117 = (struct _IO_STACK_LOCATION **)__cil_tmp11; #line 871 - irpSp = *mem_117; + irpSp = *mem_117; #line 878 - __cil_tmp12 = (unsigned int )DisketteExtension; + __cil_tmp12 = (unsigned int)DisketteExtension; #line 878 - __cil_tmp13 = __cil_tmp12 + 396; + __cil_tmp13 = __cil_tmp12 + 396; #line 878 - __cil_tmp14 = (FAST_MUTEX *)__cil_tmp13; + __cil_tmp14 = (FAST_MUTEX *)__cil_tmp13; #line 878 - ExAcquireFastMutex(__cil_tmp14); - } - { + ExAcquireFastMutex(__cil_tmp14); + } + { #line 879 - __cil_tmp15 = (unsigned int )DisketteExtension; + __cil_tmp15 = (unsigned int)DisketteExtension; #line 879 - __cil_tmp16 = __cil_tmp15 + 393; + __cil_tmp16 = __cil_tmp15 + 393; #line 879 - mem_118 = (BOOLEAN *)__cil_tmp16; + mem_118 = (BOOLEAN *)__cil_tmp16; #line 879 - __cil_tmp17 = *mem_118; + __cil_tmp17 = *mem_118; #line 879 - __cil_tmp18 = (int )__cil_tmp17; + __cil_tmp18 = (int)__cil_tmp17; #line 879 - if (__cil_tmp18 == 1) { - { + if (__cil_tmp18 == 1) { + { #line 880 - __cil_tmp19 = (unsigned int )DisketteExtension; + __cil_tmp19 = (unsigned int)DisketteExtension; #line 880 - __cil_tmp20 = __cil_tmp19 + 396; + __cil_tmp20 = __cil_tmp19 + 396; #line 880 - __cil_tmp21 = (FAST_MUTEX *)__cil_tmp20; + __cil_tmp21 = (FAST_MUTEX *)__cil_tmp20; #line 880 - ExReleaseFastMutex(__cil_tmp21); - } - { + ExReleaseFastMutex(__cil_tmp21); + } + { #line 882 - while (1) { - while_12_continue: /* CIL Label */ ; - goto while_12_break; - } - while_12_break: /* CIL Label */ ; - } + while (1) { + while_12_continue: /* CIL Label */; + goto while_12_break; + } + while_12_break: /* CIL Label */; + } #line 884 - myStatus = -1073741101L; + myStatus = -1073741101L; #line 886 - __cil_tmp22 = (unsigned int )Irp; + __cil_tmp22 = (unsigned int)Irp; #line 886 - __cil_tmp23 = __cil_tmp22 + 24; + __cil_tmp23 = __cil_tmp22 + 24; #line 886 - mem_119 = (NTSTATUS *)__cil_tmp23; + mem_119 = (NTSTATUS *)__cil_tmp23; #line 886 - *mem_119 = -1073741101L; + *mem_119 = -1073741101L; #line 887 - __cil_tmp24 = 24 + 4; + __cil_tmp24 = 24 + 4; #line 887 - __cil_tmp25 = (unsigned int )Irp; + __cil_tmp25 = (unsigned int)Irp; #line 887 - __cil_tmp26 = __cil_tmp25 + __cil_tmp24; + __cil_tmp26 = __cil_tmp25 + __cil_tmp24; #line 887 - mem_120 = (ULONG_PTR *)__cil_tmp26; + mem_120 = (ULONG_PTR *)__cil_tmp26; #line 887 - *mem_120 = 0UL; + *mem_120 = 0UL; #line 888 - return (-1073741101L); - } else { - - } - } - { + return (-1073741101L); + } else { + } + } + { #line 890 - __cil_tmp27 = (unsigned int )DisketteExtension; + __cil_tmp27 = (unsigned int)DisketteExtension; #line 890 - __cil_tmp28 = __cil_tmp27 + 396; + __cil_tmp28 = __cil_tmp27 + 396; #line 890 - __cil_tmp29 = (FAST_MUTEX *)__cil_tmp28; + __cil_tmp29 = (FAST_MUTEX *)__cil_tmp28; #line 890 - ExReleaseFastMutex(__cil_tmp29); - } - { + ExReleaseFastMutex(__cil_tmp29); + } + { #line 891 - while (1) { - while_13_continue: /* CIL Label */ ; - goto while_13_break; - } - while_13_break: /* CIL Label */ ; - } - { + while (1) { + while_13_continue: /* CIL Label */; + goto while_13_break; + } + while_13_break: /* CIL Label */; + } + { #line 891 - __cil_tmp30 = (unsigned int )DisketteExtension; + __cil_tmp30 = (unsigned int)DisketteExtension; #line 891 - __cil_tmp31 = __cil_tmp30 + 56; + __cil_tmp31 = __cil_tmp30 + 56; #line 891 - __cil_tmp32 = (FAST_MUTEX *)__cil_tmp31; + __cil_tmp32 = (FAST_MUTEX *)__cil_tmp31; #line 891 - ExAcquireFastMutex(__cil_tmp32); + ExAcquireFastMutex(__cil_tmp32); #line 893 - __cil_tmp33 = (unsigned int )DisketteExtension; + __cil_tmp33 = (unsigned int)DisketteExtension; #line 893 - __cil_tmp34 = __cil_tmp33 + 88; + __cil_tmp34 = __cil_tmp33 + 88; #line 893 - __cil_tmp35 = (unsigned int )DisketteExtension; + __cil_tmp35 = (unsigned int)DisketteExtension; #line 893 - __cil_tmp36 = __cil_tmp35 + 88; + __cil_tmp36 = __cil_tmp35 + 88; #line 893 - mem_121 = (LONG *)__cil_tmp36; + mem_121 = (LONG *)__cil_tmp36; #line 893 - __cil_tmp37 = *mem_121; + __cil_tmp37 = *mem_121; #line 893 - mem_122 = (LONG *)__cil_tmp34; + mem_122 = (LONG *)__cil_tmp34; #line 893 - *mem_122 = __cil_tmp37 + 1L; - } - { + *mem_122 = __cil_tmp37 + 1L; + } + { #line 893 - __cil_tmp38 = (unsigned int )DisketteExtension; + __cil_tmp38 = (unsigned int)DisketteExtension; #line 893 - __cil_tmp39 = __cil_tmp38 + 88; + __cil_tmp39 = __cil_tmp38 + 88; #line 893 - mem_123 = (LONG *)__cil_tmp39; + mem_123 = (LONG *)__cil_tmp39; #line 893 - __cil_tmp40 = *mem_123; + __cil_tmp40 = *mem_123; #line 893 - if (__cil_tmp40 == 0L) { - { + if (__cil_tmp40 == 0L) { + { #line 896 - __cil_tmp41 = (unsigned int )DisketteExtension; + __cil_tmp41 = (unsigned int)DisketteExtension; #line 896 - __cil_tmp42 = __cil_tmp41 + 88; + __cil_tmp42 = __cil_tmp41 + 88; #line 896 - __cil_tmp43 = (unsigned int )DisketteExtension; + __cil_tmp43 = (unsigned int)DisketteExtension; #line 896 - __cil_tmp44 = __cil_tmp43 + 88; + __cil_tmp44 = __cil_tmp43 + 88; #line 896 - mem_124 = (LONG *)__cil_tmp44; + mem_124 = (LONG *)__cil_tmp44; #line 896 - __cil_tmp45 = *mem_124; + __cil_tmp45 = *mem_124; #line 896 - mem_125 = (LONG *)__cil_tmp42; + mem_125 = (LONG *)__cil_tmp42; #line 896 - *mem_125 = __cil_tmp45 + 1L; + *mem_125 = __cil_tmp45 + 1L; #line 898 - ExAcquireFastMutex(PagingMutex); + ExAcquireFastMutex(PagingMutex); #line 898 - PagingReferenceCount = PagingReferenceCount + 1UL; - } -#line 898 - if (PagingReferenceCount == 1UL) { - { + PagingReferenceCount = PagingReferenceCount + 1UL; + } #line 898 - __cil_tmp46 = (void *)(& DriverEntry); + if (PagingReferenceCount == 1UL) { + { #line 898 - MmResetDriverPaging(__cil_tmp46); - } - } else { - - } - { + __cil_tmp46 = (void *)(&DriverEntry); #line 898 - ExReleaseFastMutex(PagingMutex); -#line 907 - __cil_tmp47 = & ObjAttributes; + MmResetDriverPaging(__cil_tmp46); + } + } else { + } + { +#line 898 + ExReleaseFastMutex(PagingMutex); +#line 907 + __cil_tmp47 = &ObjAttributes; #line 907 - mem_126 = (ULONG *)__cil_tmp47; + mem_126 = (ULONG *)__cil_tmp47; #line 907 - *mem_126 = (unsigned long )24U; + *mem_126 = (unsigned long)24U; #line 907 - __cil_tmp48 = (unsigned int )(& ObjAttributes) + 4; + __cil_tmp48 = (unsigned int)(&ObjAttributes) + 4; #line 907 - mem_127 = (HANDLE *)__cil_tmp48; + mem_127 = (HANDLE *)__cil_tmp48; #line 907 - *mem_127 = (void *)0; + *mem_127 = (void *)0; #line 907 - __cil_tmp49 = (unsigned int )(& ObjAttributes) + 12; + __cil_tmp49 = (unsigned int)(&ObjAttributes) + 12; #line 907 - mem_128 = (ULONG *)__cil_tmp49; + mem_128 = (ULONG *)__cil_tmp49; #line 907 - *mem_128 = 512UL; + *mem_128 = 512UL; #line 907 - __cil_tmp50 = (unsigned int )(& ObjAttributes) + 8; + __cil_tmp50 = (unsigned int)(&ObjAttributes) + 8; #line 907 - __cil_tmp51 = (void *)0; + __cil_tmp51 = (void *)0; #line 907 - mem_129 = (PUNICODE_STRING *)__cil_tmp50; + mem_129 = (PUNICODE_STRING *)__cil_tmp50; #line 907 - *mem_129 = (UNICODE_STRING *)__cil_tmp51; + *mem_129 = (UNICODE_STRING *)__cil_tmp51; #line 907 - __cil_tmp52 = (unsigned int )(& ObjAttributes) + 16; + __cil_tmp52 = (unsigned int)(&ObjAttributes) + 16; #line 907 - mem_130 = (PVOID *)__cil_tmp52; + mem_130 = (PVOID *)__cil_tmp52; #line 907 - *mem_130 = (void *)0; + *mem_130 = (void *)0; #line 907 - __cil_tmp53 = (unsigned int )(& ObjAttributes) + 20; + __cil_tmp53 = (unsigned int)(&ObjAttributes) + 20; #line 907 - mem_131 = (PVOID *)__cil_tmp53; + mem_131 = (PVOID *)__cil_tmp53; #line 907 - *mem_131 = (void *)0; + *mem_131 = (void *)0; #line 909 - __cil_tmp54 = (void *)0L; + __cil_tmp54 = (void *)0L; #line 909 - __cil_tmp55 = (void *)0; + __cil_tmp55 = (void *)0; #line 909 - __cil_tmp56 = (CLIENT_ID *)__cil_tmp55; + __cil_tmp56 = (CLIENT_ID *)__cil_tmp55; #line 909 - __cil_tmp57 = (void *)DisketteExtension; + __cil_tmp57 = (void *)DisketteExtension; #line 909 - status = PsCreateSystemThread(& threadHandle, 0UL, & ObjAttributes, __cil_tmp54, - __cil_tmp56, & FloppyThread, __cil_tmp57); - } - { + status = PsCreateSystemThread(&threadHandle, 0UL, &ObjAttributes, + __cil_tmp54, __cil_tmp56, &FloppyThread, + __cil_tmp57); + } + { #line 917 - __cil_tmp58 = status >= 0L; + __cil_tmp58 = status >= 0L; #line 917 - if (! __cil_tmp58) { - { + if (!__cil_tmp58) { + { #line 918 - __cil_tmp59 = (unsigned int )DisketteExtension; + __cil_tmp59 = (unsigned int)DisketteExtension; #line 918 - __cil_tmp60 = __cil_tmp59 + 88; + __cil_tmp60 = __cil_tmp59 + 88; #line 918 - mem_132 = (LONG *)__cil_tmp60; + mem_132 = (LONG *)__cil_tmp60; #line 918 - *mem_132 = -1L; + *mem_132 = -1L; #line 920 - ExAcquireFastMutex(PagingMutex); + ExAcquireFastMutex(PagingMutex); #line 920 - PagingReferenceCount = PagingReferenceCount - 1UL; - } + PagingReferenceCount = PagingReferenceCount - 1UL; + } #line 920 - if (PagingReferenceCount == 0UL) { - { + if (PagingReferenceCount == 0UL) { + { #line 920 - __cil_tmp61 = (void *)(& DriverEntry); + __cil_tmp61 = (void *)(&DriverEntry); #line 920 - MmPageEntireDriver(__cil_tmp61); - } - } else { - - } - { + MmPageEntireDriver(__cil_tmp61); + } + } else { + } + { #line 920 - ExReleaseFastMutex(PagingMutex); + ExReleaseFastMutex(PagingMutex); #line 922 - __cil_tmp62 = (unsigned int )DisketteExtension; + __cil_tmp62 = (unsigned int)DisketteExtension; #line 922 - __cil_tmp63 = __cil_tmp62 + 56; + __cil_tmp63 = __cil_tmp62 + 56; #line 922 - __cil_tmp64 = (FAST_MUTEX *)__cil_tmp63; + __cil_tmp64 = (FAST_MUTEX *)__cil_tmp63; #line 922 - ExReleaseFastMutex(__cil_tmp64); - } + ExReleaseFastMutex(__cil_tmp64); + } #line 923 - return (status); - } else { - - } - } - { + return (status); + } else { + } + } + { #line 926 - __cil_tmp65 = & threadHandle; + __cil_tmp65 = &threadHandle; #line 926 - __cil_tmp66 = *__cil_tmp65; + __cil_tmp66 = *__cil_tmp65; #line 926 - __cil_tmp67 = (void *)0; + __cil_tmp67 = (void *)0; #line 926 - __cil_tmp68 = (struct _OBJECT_TYPE *)__cil_tmp67; + __cil_tmp68 = (struct _OBJECT_TYPE *)__cil_tmp67; #line 926 - __cil_tmp69 = (unsigned int )DisketteExtension; + __cil_tmp69 = (unsigned int)DisketteExtension; #line 926 - __cil_tmp70 = __cil_tmp69 + 92; + __cil_tmp70 = __cil_tmp69 + 92; #line 926 - __cil_tmp71 = (PKTHREAD *)__cil_tmp70; + __cil_tmp71 = (PKTHREAD *)__cil_tmp70; #line 926 - __cil_tmp72 = (PVOID *)__cil_tmp71; + __cil_tmp72 = (PVOID *)__cil_tmp71; #line 926 - __cil_tmp73 = (void *)0; + __cil_tmp73 = (void *)0; #line 926 - __cil_tmp74 = (struct _OBJECT_HANDLE_INFORMATION *)__cil_tmp73; + __cil_tmp74 = (struct _OBJECT_HANDLE_INFORMATION *)__cil_tmp73; #line 926 - status = ObReferenceObjectByHandle(__cil_tmp66, 1048576UL, __cil_tmp68, (char)0, - __cil_tmp72, __cil_tmp74); + status = + ObReferenceObjectByHandle(__cil_tmp66, 1048576UL, __cil_tmp68, + (char)0, __cil_tmp72, __cil_tmp74); #line 935 - __cil_tmp75 = & threadHandle; + __cil_tmp75 = &threadHandle; #line 935 - __cil_tmp76 = *__cil_tmp75; + __cil_tmp76 = *__cil_tmp75; #line 935 - ZwClose(__cil_tmp76); + ZwClose(__cil_tmp76); #line 937 - __cil_tmp77 = (unsigned int )DisketteExtension; + __cil_tmp77 = (unsigned int)DisketteExtension; #line 937 - __cil_tmp78 = __cil_tmp77 + 56; + __cil_tmp78 = __cil_tmp77 + 56; #line 937 - __cil_tmp79 = (FAST_MUTEX *)__cil_tmp78; + __cil_tmp79 = (FAST_MUTEX *)__cil_tmp78; #line 937 - ExReleaseFastMutex(__cil_tmp79); - } - { + ExReleaseFastMutex(__cil_tmp79); + } + { #line 939 - __cil_tmp80 = status >= 0L; + __cil_tmp80 = status >= 0L; #line 939 - if (! __cil_tmp80) { + if (!__cil_tmp80) { #line 940 - return (status); - } else { - - } - } - } else { - { + return (status); + } else { + } + } + } else { + { #line 944 - __cil_tmp81 = (unsigned int )DisketteExtension; + __cil_tmp81 = (unsigned int)DisketteExtension; #line 944 - __cil_tmp82 = __cil_tmp81 + 56; + __cil_tmp82 = __cil_tmp81 + 56; #line 944 - __cil_tmp83 = (FAST_MUTEX *)__cil_tmp82; + __cil_tmp83 = (FAST_MUTEX *)__cil_tmp82; #line 944 - ExReleaseFastMutex(__cil_tmp83); + ExReleaseFastMutex(__cil_tmp83); + } + } } - } - } #line 947 - __cil_tmp84 = 24 + 8; + __cil_tmp84 = 24 + 8; #line 947 - __cil_tmp85 = 0 + __cil_tmp84; + __cil_tmp85 = 0 + __cil_tmp84; #line 947 - __cil_tmp86 = 64 + __cil_tmp85; + __cil_tmp86 = 64 + __cil_tmp85; #line 947 - __cil_tmp87 = (unsigned int )Irp; + __cil_tmp87 = (unsigned int)Irp; #line 947 - __cil_tmp88 = __cil_tmp87 + __cil_tmp86; + __cil_tmp88 = __cil_tmp87 + __cil_tmp86; #line 947 - mem_133 = (struct _IO_STACK_LOCATION **)__cil_tmp88; + mem_133 = (struct _IO_STACK_LOCATION **)__cil_tmp88; #line 947 - __cil_tmp89 = *mem_133; + __cil_tmp89 = *mem_133; #line 947 - __cil_tmp90 = (unsigned int )__cil_tmp89; + __cil_tmp90 = (unsigned int)__cil_tmp89; #line 947 - __cil_tmp91 = __cil_tmp90 + 3; + __cil_tmp91 = __cil_tmp90 + 3; #line 947 - __cil_tmp92 = 24 + 8; + __cil_tmp92 = 24 + 8; #line 947 - __cil_tmp93 = 0 + __cil_tmp92; + __cil_tmp93 = 0 + __cil_tmp92; #line 947 - __cil_tmp94 = 64 + __cil_tmp93; + __cil_tmp94 = 64 + __cil_tmp93; #line 947 - __cil_tmp95 = (unsigned int )Irp; + __cil_tmp95 = (unsigned int)Irp; #line 947 - __cil_tmp96 = __cil_tmp95 + __cil_tmp94; + __cil_tmp96 = __cil_tmp95 + __cil_tmp94; #line 947 - mem_134 = (struct _IO_STACK_LOCATION **)__cil_tmp96; + mem_134 = (struct _IO_STACK_LOCATION **)__cil_tmp96; #line 947 - __cil_tmp97 = *mem_134; + __cil_tmp97 = *mem_134; #line 947 - __cil_tmp98 = (unsigned int )__cil_tmp97; + __cil_tmp98 = (unsigned int)__cil_tmp97; #line 947 - __cil_tmp99 = __cil_tmp98 + 3; + __cil_tmp99 = __cil_tmp98 + 3; #line 947 - mem_135 = (UCHAR *)__cil_tmp99; + mem_135 = (UCHAR *)__cil_tmp99; #line 947 - __cil_tmp100 = *mem_135; + __cil_tmp100 = *mem_135; #line 947 - __cil_tmp101 = (int )__cil_tmp100; + __cil_tmp101 = (int)__cil_tmp100; #line 947 - __cil_tmp102 = __cil_tmp101 | 1; + __cil_tmp102 = __cil_tmp101 | 1; #line 947 - mem_136 = (UCHAR *)__cil_tmp91; + mem_136 = (UCHAR *)__cil_tmp91; #line 947 - *mem_136 = (unsigned char )__cil_tmp102; + *mem_136 = (unsigned char)__cil_tmp102; #line 948 - if (pended == 0) { + if (pended == 0) { #line 948 - pended = 1; - } else { - { + pended = 1; + } else { + { #line 949 - __VERIFIER_assert(0); + __VERIFIER_assert(0); + } } - } - { + { #line 952 - __cil_tmp103 = (unsigned int )DisketteExtension; + __cil_tmp103 = (unsigned int)DisketteExtension; #line 952 - __cil_tmp104 = __cil_tmp103 + 96; + __cil_tmp104 = __cil_tmp103 + 96; #line 952 - __cil_tmp105 = (LIST_ENTRY *)__cil_tmp104; + __cil_tmp105 = (LIST_ENTRY *)__cil_tmp104; #line 952 - __cil_tmp106 = 0 + 24; + __cil_tmp106 = 0 + 24; #line 952 - __cil_tmp107 = 64 + __cil_tmp106; + __cil_tmp107 = 64 + __cil_tmp106; #line 952 - __cil_tmp108 = (unsigned int )Irp; + __cil_tmp108 = (unsigned int)Irp; #line 952 - __cil_tmp109 = __cil_tmp108 + __cil_tmp107; + __cil_tmp109 = __cil_tmp108 + __cil_tmp107; #line 952 - __cil_tmp110 = (LIST_ENTRY *)__cil_tmp109; + __cil_tmp110 = (LIST_ENTRY *)__cil_tmp109; #line 952 - __cil_tmp111 = (unsigned int )DisketteExtension; + __cil_tmp111 = (unsigned int)DisketteExtension; #line 952 - __cil_tmp112 = __cil_tmp111 + 52; + __cil_tmp112 = __cil_tmp111 + 52; #line 952 - __cil_tmp113 = (KSPIN_LOCK *)__cil_tmp112; + __cil_tmp113 = (KSPIN_LOCK *)__cil_tmp112; #line 952 - ExfInterlockedInsertTailList(__cil_tmp105, __cil_tmp110, __cil_tmp113); + ExfInterlockedInsertTailList(__cil_tmp105, __cil_tmp110, __cil_tmp113); #line 957 - __cil_tmp114 = (unsigned int )DisketteExtension; + __cil_tmp114 = (unsigned int)DisketteExtension; #line 957 - __cil_tmp115 = __cil_tmp114 + 32; + __cil_tmp115 = __cil_tmp114 + 32; #line 957 - __cil_tmp116 = (KSEMAPHORE *)__cil_tmp115; + __cil_tmp116 = (KSEMAPHORE *)__cil_tmp115; #line 957 - KeReleaseSemaphore(__cil_tmp116, 0L, 1L, (unsigned char)0); - } + KeReleaseSemaphore(__cil_tmp116, 0L, 1L, (unsigned char)0); + } #line 963 - return (259L); -} + return (259L); + } } #line 966 "floppy.c" -NTSTATUS FloppyCreateClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ unsigned int __cil_tmp3 ; - unsigned int __cil_tmp4 ; - unsigned int __cil_tmp5 ; - unsigned int __cil_tmp6 ; - unsigned int __cil_tmp7 ; - NTSTATUS *mem_8 ; - ULONG_PTR *mem_9 ; +NTSTATUS FloppyCreateClose(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + unsigned int __cil_tmp3; + unsigned int __cil_tmp4; + unsigned int __cil_tmp5; + unsigned int __cil_tmp6; + unsigned int __cil_tmp7; + NTSTATUS *mem_8; + ULONG_PTR *mem_9; { - { + { #line 999 - while (1) { - while_14_continue: /* CIL Label */ ; - goto while_14_break; - } - while_14_break: /* CIL Label */ ; - } - { + while (1) { + while_14_continue: /* CIL Label */; + goto while_14_break; + } + while_14_break: /* CIL Label */; + } + { #line 1007 - myStatus = 0L; + myStatus = 0L; #line 1009 - __cil_tmp3 = (unsigned int )Irp; + __cil_tmp3 = (unsigned int)Irp; #line 1009 - __cil_tmp4 = __cil_tmp3 + 24; + __cil_tmp4 = __cil_tmp3 + 24; #line 1009 - mem_8 = (NTSTATUS *)__cil_tmp4; + mem_8 = (NTSTATUS *)__cil_tmp4; #line 1009 - *mem_8 = 0L; + *mem_8 = 0L; #line 1010 - __cil_tmp5 = 24 + 4; + __cil_tmp5 = 24 + 4; #line 1010 - __cil_tmp6 = (unsigned int )Irp; + __cil_tmp6 = (unsigned int)Irp; #line 1010 - __cil_tmp7 = __cil_tmp6 + __cil_tmp5; + __cil_tmp7 = __cil_tmp6 + __cil_tmp5; #line 1010 - mem_9 = (ULONG_PTR *)__cil_tmp7; + mem_9 = (ULONG_PTR *)__cil_tmp7; #line 1010 - *mem_9 = 1UL; + *mem_9 = 1UL; #line 1010 - IofCompleteRequest(Irp, (char)0); - } + IofCompleteRequest(Irp, (char)0); + } #line 1012 - return (0L); -} + return (0L); + } } #line 1015 "floppy.c" -NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - PDISKETTE_EXTENSION disketteExtension ; - PDISK_GEOMETRY outputBuffer ; - NTSTATUS ntStatus ; - ULONG outputBufferLength ; - UCHAR i ; - DRIVE_MEDIA_TYPE lowestDriveMediaType ; - DRIVE_MEDIA_TYPE highestDriveMediaType ; - ULONG formatExParametersSize ; - PFORMAT_EX_PARAMETERS formatExParameters ; - NTSTATUS tmp ; - PMOUNTDEV_NAME mountName ; - PMOUNTDEV_UNIQUE_ID uniqueId ; - BOOLEAN tmp___0 ; - PMOUNTDEV_SUGGESTED_LINK_NAME suggestedName ; - WCHAR driveLetterNameBuffer[10] ; - RTL_QUERY_REGISTRY_TABLE queryTable[2] ; - PWSTR valueName ; - UNICODE_STRING driveLetterName ; - PVOID tmp___1 ; - int tmp___2 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - PVOID __cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - unsigned int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - unsigned int __cil_tmp32 ; - unsigned int __cil_tmp33 ; - FAST_MUTEX *__cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - int __cil_tmp37 ; - int __cil_tmp38 ; - int __cil_tmp39 ; - unsigned long __cil_tmp40 ; - unsigned int __cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - ULONG __cil_tmp45 ; - unsigned int __cil_tmp46 ; - unsigned int __cil_tmp47 ; - FAST_MUTEX *__cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - FAST_MUTEX *__cil_tmp51 ; - unsigned int __cil_tmp52 ; - unsigned int __cil_tmp53 ; - unsigned int __cil_tmp54 ; - unsigned int __cil_tmp55 ; - unsigned int __cil_tmp56 ; - unsigned int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - unsigned int __cil_tmp59 ; - unsigned int __cil_tmp60 ; - BOOLEAN __cil_tmp61 ; - unsigned int __cil_tmp62 ; - unsigned int __cil_tmp63 ; - unsigned int __cil_tmp64 ; - unsigned int __cil_tmp65 ; - CHAR __cil_tmp66 ; - int __cil_tmp67 ; - int __cil_tmp68 ; - unsigned int __cil_tmp69 ; - unsigned int __cil_tmp70 ; - unsigned int __cil_tmp71 ; - unsigned int __cil_tmp72 ; - unsigned int __cil_tmp73 ; - unsigned int __cil_tmp74 ; - unsigned int __cil_tmp75 ; - unsigned int __cil_tmp76 ; - unsigned int __cil_tmp77 ; - unsigned int __cil_tmp78 ; - struct _IO_STACK_LOCATION *__cil_tmp79 ; - unsigned int __cil_tmp80 ; - unsigned int __cil_tmp81 ; - PDEVICE_OBJECT __cil_tmp82 ; - unsigned int __cil_tmp83 ; - unsigned int __cil_tmp84 ; - unsigned int __cil_tmp85 ; - unsigned int __cil_tmp86 ; - ULONG __cil_tmp87 ; - int __cil_tmp88 ; - unsigned long __cil_tmp89 ; - unsigned long __cil_tmp90 ; - unsigned long __cil_tmp91 ; - unsigned int __cil_tmp92 ; - unsigned int __cil_tmp93 ; - ULONG __cil_tmp94 ; - unsigned int __cil_tmp95 ; - unsigned int __cil_tmp96 ; - PVOID __cil_tmp97 ; - unsigned int __cil_tmp98 ; - unsigned int __cil_tmp99 ; - USHORT __cil_tmp100 ; - unsigned int __cil_tmp101 ; - unsigned int __cil_tmp102 ; - unsigned long __cil_tmp103 ; - unsigned int __cil_tmp104 ; - unsigned int __cil_tmp105 ; - ULONG __cil_tmp106 ; - unsigned int __cil_tmp107 ; - unsigned int __cil_tmp108 ; - unsigned int __cil_tmp109 ; - unsigned int __cil_tmp110 ; - unsigned int __cil_tmp111 ; - unsigned int __cil_tmp112 ; - unsigned int __cil_tmp113 ; - WCHAR *__cil_tmp114 ; - void *__cil_tmp115 ; - unsigned int __cil_tmp116 ; - unsigned int __cil_tmp117 ; - unsigned int __cil_tmp118 ; - PWSTR __cil_tmp119 ; - void const *__cil_tmp120 ; - USHORT __cil_tmp121 ; - unsigned int __cil_tmp122 ; - unsigned int __cil_tmp123 ; - unsigned int __cil_tmp124 ; - unsigned int __cil_tmp125 ; - USHORT __cil_tmp126 ; - unsigned int __cil_tmp127 ; - unsigned int __cil_tmp128 ; - unsigned int __cil_tmp129 ; - unsigned int __cil_tmp130 ; - unsigned int __cil_tmp131 ; - PWSTR __cil_tmp132 ; - unsigned long __cil_tmp133 ; - unsigned int __cil_tmp134 ; - unsigned int __cil_tmp135 ; - ULONG __cil_tmp136 ; - unsigned int __cil_tmp137 ; - unsigned int __cil_tmp138 ; - PVOID __cil_tmp139 ; - unsigned int __cil_tmp140 ; - unsigned int __cil_tmp141 ; - USHORT __cil_tmp142 ; - unsigned int __cil_tmp143 ; - unsigned int __cil_tmp144 ; - unsigned long __cil_tmp145 ; - unsigned int __cil_tmp146 ; - unsigned int __cil_tmp147 ; - ULONG __cil_tmp148 ; - unsigned int __cil_tmp149 ; - unsigned int __cil_tmp150 ; - unsigned int __cil_tmp151 ; - unsigned int __cil_tmp152 ; - unsigned int __cil_tmp153 ; - unsigned int __cil_tmp154 ; - unsigned int __cil_tmp155 ; - UCHAR *__cil_tmp156 ; - void *__cil_tmp157 ; - unsigned int __cil_tmp158 ; - unsigned int __cil_tmp159 ; - unsigned int __cil_tmp160 ; - PWSTR __cil_tmp161 ; - void const *__cil_tmp162 ; - USHORT __cil_tmp163 ; - unsigned int __cil_tmp164 ; - unsigned int __cil_tmp165 ; - unsigned int __cil_tmp166 ; - unsigned int __cil_tmp167 ; - USHORT __cil_tmp168 ; - unsigned int __cil_tmp169 ; - unsigned int __cil_tmp170 ; - int __cil_tmp171 ; - int __cil_tmp172 ; - int __cil_tmp173 ; - int __cil_tmp174 ; - int __cil_tmp175 ; - int __cil_tmp176 ; - int __cil_tmp177 ; - int __cil_tmp178 ; - unsigned long __cil_tmp179 ; - unsigned int __cil_tmp180 ; - unsigned int __cil_tmp181 ; - unsigned int __cil_tmp182 ; - unsigned int __cil_tmp183 ; - ULONG __cil_tmp184 ; - unsigned int __cil_tmp185 ; - unsigned int __cil_tmp186 ; - PVOID __cil_tmp187 ; - struct _FORMAT_PARAMETERS *__cil_tmp188 ; - int __cil_tmp189 ; - int __cil_tmp190 ; - int __cil_tmp191 ; - int __cil_tmp192 ; - int __cil_tmp193 ; - unsigned long __cil_tmp194 ; - unsigned int __cil_tmp195 ; - unsigned int __cil_tmp196 ; - unsigned int __cil_tmp197 ; - unsigned int __cil_tmp198 ; - ULONG __cil_tmp199 ; - unsigned long __cil_tmp200 ; - unsigned int __cil_tmp201 ; - unsigned int __cil_tmp202 ; - unsigned int __cil_tmp203 ; - unsigned int __cil_tmp204 ; - ULONG __cil_tmp205 ; - unsigned int __cil_tmp206 ; - unsigned int __cil_tmp207 ; - PVOID __cil_tmp208 ; - unsigned int __cil_tmp209 ; - unsigned int __cil_tmp210 ; - USHORT __cil_tmp211 ; - unsigned int __cil_tmp212 ; - unsigned int __cil_tmp213 ; - unsigned long __cil_tmp214 ; - FORMAT_EX_PARAMETERS *__cil_tmp215 ; - unsigned int __cil_tmp216 ; - unsigned int __cil_tmp217 ; - USHORT (*__cil_tmp218)[1] ; - long __cil_tmp219 ; - unsigned long __cil_tmp220 ; - unsigned int __cil_tmp221 ; - unsigned int __cil_tmp222 ; - unsigned int __cil_tmp223 ; - unsigned int __cil_tmp224 ; - ULONG __cil_tmp225 ; - unsigned int __cil_tmp226 ; - unsigned int __cil_tmp227 ; - USHORT __cil_tmp228 ; - int __cil_tmp229 ; - unsigned int __cil_tmp230 ; - unsigned int __cil_tmp231 ; - USHORT __cil_tmp232 ; - int __cil_tmp233 ; - int __cil_tmp234 ; - int __cil_tmp235 ; - int __cil_tmp236 ; - int __cil_tmp237 ; - int __cil_tmp238 ; - int __cil_tmp239 ; - int __cil_tmp240 ; - int __cil_tmp241 ; - int __cil_tmp242 ; - int __cil_tmp243 ; - int __cil_tmp244 ; - int __cil_tmp245 ; - int __cil_tmp246 ; - int __cil_tmp247 ; - unsigned int __cil_tmp248 ; - unsigned int __cil_tmp249 ; - UCHAR __cil_tmp250 ; - int __cil_tmp251 ; - PDRIVE_MEDIA_LIMITS __cil_tmp252 ; - unsigned int __cil_tmp253 ; - unsigned int __cil_tmp254 ; - unsigned int __cil_tmp255 ; - unsigned int __cil_tmp256 ; - UCHAR __cil_tmp257 ; - int __cil_tmp258 ; - PDRIVE_MEDIA_LIMITS __cil_tmp259 ; - unsigned int __cil_tmp260 ; - unsigned int __cil_tmp261 ; - unsigned long __cil_tmp262 ; - int __cil_tmp263 ; - int __cil_tmp264 ; - int __cil_tmp265 ; - int __cil_tmp266 ; - unsigned int __cil_tmp267 ; - unsigned int __cil_tmp268 ; - unsigned long __cil_tmp269 ; - unsigned long __cil_tmp270 ; - ULONG __cil_tmp271 ; - int __cil_tmp272 ; - int __cil_tmp273 ; - unsigned long __cil_tmp274 ; - unsigned long __cil_tmp275 ; - unsigned int __cil_tmp276 ; - unsigned int __cil_tmp277 ; - PVOID __cil_tmp278 ; - unsigned char __cil_tmp279 ; - int __cil_tmp280 ; - int __cil_tmp281 ; - unsigned int __cil_tmp282 ; - unsigned int __cil_tmp283 ; - int __cil_tmp284 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp285 ; - int __cil_tmp286 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp287 ; - unsigned int __cil_tmp288 ; - unsigned int __cil_tmp289 ; - UCHAR __cil_tmp290 ; - int __cil_tmp291 ; - int __cil_tmp292 ; - unsigned int __cil_tmp293 ; - unsigned int __cil_tmp294 ; - unsigned int __cil_tmp295 ; - unsigned int __cil_tmp296 ; - unsigned int __cil_tmp297 ; - unsigned int __cil_tmp298 ; - int __cil_tmp299 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp300 ; - unsigned int __cil_tmp301 ; - unsigned int __cil_tmp302 ; - UCHAR __cil_tmp303 ; - unsigned int __cil_tmp304 ; - unsigned int __cil_tmp305 ; - int __cil_tmp306 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp307 ; - unsigned int __cil_tmp308 ; - unsigned int __cil_tmp309 ; - UCHAR __cil_tmp310 ; - unsigned int __cil_tmp311 ; - unsigned int __cil_tmp312 ; - int __cil_tmp313 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp314 ; - unsigned int __cil_tmp315 ; - unsigned int __cil_tmp316 ; - USHORT __cil_tmp317 ; - unsigned int __cil_tmp318 ; - unsigned int __cil_tmp319 ; - unsigned int __cil_tmp320 ; - unsigned long __cil_tmp321 ; - unsigned int __cil_tmp322 ; - unsigned int __cil_tmp323 ; - unsigned int __cil_tmp324 ; - ULONG_PTR __cil_tmp325 ; - int __cil_tmp326 ; - int __cil_tmp327 ; - int __cil_tmp328 ; - unsigned long __cil_tmp329 ; - unsigned long __cil_tmp330 ; - KUSER_SHARED_DATA *__cil_tmp331 ; - unsigned int __cil_tmp332 ; - unsigned int __cil_tmp333 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp334 ; - int __cil_tmp335 ; - unsigned int __cil_tmp336 ; - unsigned int __cil_tmp337 ; - ULONG __cil_tmp338 ; - unsigned long __cil_tmp339 ; - unsigned long __cil_tmp340 ; - unsigned int __cil_tmp341 ; - unsigned int __cil_tmp342 ; - ULONG __cil_tmp343 ; - enum _POOL_TYPE __cil_tmp344 ; - unsigned int __cil_tmp345 ; - unsigned long __cil_tmp346 ; - void *__cil_tmp347 ; - unsigned int __cil_tmp348 ; - void *__cil_tmp349 ; - unsigned int __cil_tmp350 ; - unsigned int __cil_tmp351 ; - unsigned int __cil_tmp352 ; - PWSTR __cil_tmp353 ; - void const *__cil_tmp354 ; - unsigned int __cil_tmp355 ; - unsigned int __cil_tmp356 ; - USHORT __cil_tmp357 ; - unsigned int __cil_tmp358 ; - unsigned int __cil_tmp359 ; - unsigned int __cil_tmp360 ; - unsigned int __cil_tmp361 ; - unsigned int __cil_tmp362 ; - UNICODE_STRING *__cil_tmp363 ; - unsigned int __cil_tmp364 ; - unsigned int __cil_tmp365 ; - RTL_QUERY_REGISTRY_TABLE *__cil_tmp366 ; - void *__cil_tmp367 ; - unsigned int __cil_tmp368 ; - unsigned int __cil_tmp369 ; - unsigned int __cil_tmp370 ; - unsigned int __cil_tmp371 ; - unsigned int __cil_tmp372 ; - unsigned int __cil_tmp373 ; - unsigned int __cil_tmp374 ; - unsigned int __cil_tmp375 ; - unsigned int __cil_tmp376 ; - unsigned int __cil_tmp377 ; - WCHAR const *__cil_tmp378 ; - unsigned int __cil_tmp379 ; - unsigned int __cil_tmp380 ; - RTL_QUERY_REGISTRY_TABLE *__cil_tmp381 ; - void *__cil_tmp382 ; - void *__cil_tmp383 ; - int __cil_tmp384 ; - void *__cil_tmp385 ; - UNICODE_STRING *__cil_tmp386 ; - USHORT __cil_tmp387 ; - int __cil_tmp388 ; - void *__cil_tmp389 ; - unsigned int __cil_tmp390 ; - PWSTR __cil_tmp391 ; - PWSTR __cil_tmp392 ; - WCHAR __cil_tmp393 ; - int __cil_tmp394 ; - void *__cil_tmp395 ; - unsigned int __cil_tmp396 ; - PWSTR __cil_tmp397 ; - PWSTR __cil_tmp398 ; - WCHAR __cil_tmp399 ; - int __cil_tmp400 ; - void *__cil_tmp401 ; - unsigned int __cil_tmp402 ; - PWSTR __cil_tmp403 ; - PWSTR __cil_tmp404 ; - WCHAR __cil_tmp405 ; - int __cil_tmp406 ; - void *__cil_tmp407 ; - unsigned int __cil_tmp408 ; - unsigned int __cil_tmp409 ; - PVOID __cil_tmp410 ; - unsigned int __cil_tmp411 ; - unsigned int __cil_tmp412 ; - unsigned int __cil_tmp413 ; - unsigned int __cil_tmp414 ; - unsigned int __cil_tmp415 ; - MOUNTDEV_SUGGESTED_LINK_NAME *__cil_tmp416 ; - unsigned int __cil_tmp417 ; - unsigned int __cil_tmp418 ; - WCHAR (*__cil_tmp419)[1] ; - long __cil_tmp420 ; - long __cil_tmp421 ; - unsigned int __cil_tmp422 ; - unsigned int __cil_tmp423 ; - unsigned int __cil_tmp424 ; - ULONG_PTR __cil_tmp425 ; - unsigned int __cil_tmp426 ; - unsigned int __cil_tmp427 ; - ULONG __cil_tmp428 ; - unsigned int __cil_tmp429 ; - unsigned int __cil_tmp430 ; - unsigned int __cil_tmp431 ; - void *__cil_tmp432 ; - WCHAR const *__cil_tmp433 ; - WCHAR const *__cil_tmp434 ; - void *__cil_tmp435 ; - unsigned int __cil_tmp436 ; - unsigned int __cil_tmp437 ; - unsigned int __cil_tmp438 ; - unsigned int __cil_tmp439 ; - WCHAR *__cil_tmp440 ; - void *__cil_tmp441 ; - void const *__cil_tmp442 ; - unsigned int __cil_tmp443 ; - unsigned int __cil_tmp444 ; - unsigned int __cil_tmp445 ; - unsigned int __cil_tmp446 ; - unsigned int __cil_tmp447 ; - PWSTR __cil_tmp448 ; - PWSTR __cil_tmp449 ; - unsigned int __cil_tmp450 ; - unsigned int __cil_tmp451 ; - unsigned int __cil_tmp452 ; - unsigned int __cil_tmp453 ; - int __cil_tmp454 ; - int __cil_tmp455 ; - KUSER_SHARED_DATA *__cil_tmp456 ; - unsigned int __cil_tmp457 ; - unsigned int __cil_tmp458 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp459 ; - int __cil_tmp460 ; - unsigned long __cil_tmp461 ; - unsigned int __cil_tmp462 ; - unsigned int __cil_tmp463 ; - ULONG __cil_tmp464 ; - unsigned int __cil_tmp465 ; - unsigned int __cil_tmp466 ; - unsigned int __cil_tmp467 ; - unsigned int __cil_tmp468 ; - CHAR __cil_tmp469 ; - int __cil_tmp470 ; - int __cil_tmp471 ; - unsigned int __cil_tmp472 ; - unsigned int __cil_tmp473 ; - unsigned int __cil_tmp474 ; - unsigned int __cil_tmp475 ; - unsigned int __cil_tmp476 ; - unsigned int __cil_tmp477 ; - unsigned int __cil_tmp478 ; - unsigned int __cil_tmp479 ; - unsigned int __cil_tmp480 ; - unsigned int __cil_tmp481 ; - struct _IO_STACK_LOCATION *__cil_tmp482 ; - unsigned int __cil_tmp483 ; - unsigned int __cil_tmp484 ; - PDEVICE_OBJECT __cil_tmp485 ; - unsigned int __cil_tmp486 ; - unsigned int __cil_tmp487 ; - int __cil_tmp488 ; - PVOID *mem_489 ; - struct _IO_STACK_LOCATION **mem_490 ; - BOOLEAN *mem_491 ; - ULONG *mem_492 ; - BOOLEAN *mem_493 ; - ULONG_PTR *mem_494 ; - NTSTATUS *mem_495 ; - BOOLEAN *mem_496 ; - CHAR *mem_497 ; - CHAR *mem_498 ; - struct _IO_STACK_LOCATION **mem_499 ; - struct _IO_STACK_LOCATION **mem_500 ; - PDEVICE_OBJECT *mem_501 ; - ULONG *mem_502 ; - ULONG *mem_503 ; - PVOID *mem_504 ; - USHORT *mem_505 ; - USHORT *mem_506 ; - USHORT *mem_507 ; - ULONG *mem_508 ; - ULONG_PTR *mem_509 ; - PWSTR *mem_510 ; - USHORT *mem_511 ; - USHORT *mem_512 ; - ULONG_PTR *mem_513 ; - PWSTR *mem_514 ; - ULONG *mem_515 ; - PVOID *mem_516 ; - USHORT *mem_517 ; - USHORT *mem_518 ; - USHORT *mem_519 ; - ULONG *mem_520 ; - ULONG_PTR *mem_521 ; - PWSTR *mem_522 ; - USHORT *mem_523 ; - USHORT *mem_524 ; - ULONG_PTR *mem_525 ; - ULONG *mem_526 ; - PVOID *mem_527 ; - ULONG *mem_528 ; - ULONG *mem_529 ; - PVOID *mem_530 ; - USHORT *mem_531 ; - ULONG *mem_532 ; - USHORT *mem_533 ; - USHORT *mem_534 ; - UCHAR *mem_535 ; - DRIVE_MEDIA_TYPE *mem_536 ; - UCHAR *mem_537 ; - DRIVE_MEDIA_TYPE *mem_538 ; - ULONG *mem_539 ; - PVOID *mem_540 ; - MEDIA_TYPE *mem_541 ; - MEDIA_TYPE *mem_542 ; - UCHAR *mem_543 ; - ULONG *mem_544 ; - LONG *mem_545 ; - UCHAR *mem_546 ; - ULONG *mem_547 ; - UCHAR *mem_548 ; - ULONG *mem_549 ; - USHORT *mem_550 ; - ULONG *mem_551 ; - ULONG_PTR *mem_552 ; - ULONG_PTR *mem_553 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_554 ; - ULONG *mem_555 ; - ULONG *mem_556 ; - PWSTR *mem_557 ; - USHORT *mem_558 ; - PWSTR *mem_559 ; - USHORT *mem_560 ; - USHORT *mem_561 ; - ULONG *mem_562 ; - PWSTR *mem_563 ; - PVOID *mem_564 ; - USHORT *mem_565 ; - PWSTR *mem_566 ; - PWSTR *mem_567 ; - PWSTR *mem_568 ; - PVOID *mem_569 ; - BOOLEAN *mem_570 ; - USHORT *mem_571 ; - ULONG_PTR *mem_572 ; - ULONG_PTR *mem_573 ; - ULONG *mem_574 ; - ULONG_PTR *mem_575 ; - PWSTR *mem_576 ; - WCHAR *mem_577 ; - WCHAR *mem_578 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_579 ; - ULONG *mem_580 ; - CHAR *mem_581 ; - CHAR *mem_582 ; - struct _IO_STACK_LOCATION **mem_583 ; - struct _IO_STACK_LOCATION **mem_584 ; - PDEVICE_OBJECT *mem_585 ; - NTSTATUS *mem_586 ; +NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + PDISKETTE_EXTENSION disketteExtension; + PDISK_GEOMETRY outputBuffer; + NTSTATUS ntStatus; + ULONG outputBufferLength; + UCHAR i; + DRIVE_MEDIA_TYPE lowestDriveMediaType; + DRIVE_MEDIA_TYPE highestDriveMediaType; + ULONG formatExParametersSize; + PFORMAT_EX_PARAMETERS formatExParameters; + NTSTATUS tmp; + PMOUNTDEV_NAME mountName; + PMOUNTDEV_UNIQUE_ID uniqueId; + BOOLEAN tmp___0; + PMOUNTDEV_SUGGESTED_LINK_NAME suggestedName; + WCHAR driveLetterNameBuffer[10]; + RTL_QUERY_REGISTRY_TABLE queryTable[2]; + PWSTR valueName; + UNICODE_STRING driveLetterName; + PVOID tmp___1; + int tmp___2; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + PVOID __cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + unsigned int __cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + unsigned int __cil_tmp32; + unsigned int __cil_tmp33; + FAST_MUTEX *__cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + int __cil_tmp37; + int __cil_tmp38; + int __cil_tmp39; + unsigned long __cil_tmp40; + unsigned int __cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + ULONG __cil_tmp45; + unsigned int __cil_tmp46; + unsigned int __cil_tmp47; + FAST_MUTEX *__cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + FAST_MUTEX *__cil_tmp51; + unsigned int __cil_tmp52; + unsigned int __cil_tmp53; + unsigned int __cil_tmp54; + unsigned int __cil_tmp55; + unsigned int __cil_tmp56; + unsigned int __cil_tmp57; + unsigned int __cil_tmp58; + unsigned int __cil_tmp59; + unsigned int __cil_tmp60; + BOOLEAN __cil_tmp61; + unsigned int __cil_tmp62; + unsigned int __cil_tmp63; + unsigned int __cil_tmp64; + unsigned int __cil_tmp65; + CHAR __cil_tmp66; + int __cil_tmp67; + int __cil_tmp68; + unsigned int __cil_tmp69; + unsigned int __cil_tmp70; + unsigned int __cil_tmp71; + unsigned int __cil_tmp72; + unsigned int __cil_tmp73; + unsigned int __cil_tmp74; + unsigned int __cil_tmp75; + unsigned int __cil_tmp76; + unsigned int __cil_tmp77; + unsigned int __cil_tmp78; + struct _IO_STACK_LOCATION *__cil_tmp79; + unsigned int __cil_tmp80; + unsigned int __cil_tmp81; + PDEVICE_OBJECT __cil_tmp82; + unsigned int __cil_tmp83; + unsigned int __cil_tmp84; + unsigned int __cil_tmp85; + unsigned int __cil_tmp86; + ULONG __cil_tmp87; + int __cil_tmp88; + unsigned long __cil_tmp89; + unsigned long __cil_tmp90; + unsigned long __cil_tmp91; + unsigned int __cil_tmp92; + unsigned int __cil_tmp93; + ULONG __cil_tmp94; + unsigned int __cil_tmp95; + unsigned int __cil_tmp96; + PVOID __cil_tmp97; + unsigned int __cil_tmp98; + unsigned int __cil_tmp99; + USHORT __cil_tmp100; + unsigned int __cil_tmp101; + unsigned int __cil_tmp102; + unsigned long __cil_tmp103; + unsigned int __cil_tmp104; + unsigned int __cil_tmp105; + ULONG __cil_tmp106; + unsigned int __cil_tmp107; + unsigned int __cil_tmp108; + unsigned int __cil_tmp109; + unsigned int __cil_tmp110; + unsigned int __cil_tmp111; + unsigned int __cil_tmp112; + unsigned int __cil_tmp113; + WCHAR *__cil_tmp114; + void *__cil_tmp115; + unsigned int __cil_tmp116; + unsigned int __cil_tmp117; + unsigned int __cil_tmp118; + PWSTR __cil_tmp119; + void const *__cil_tmp120; + USHORT __cil_tmp121; + unsigned int __cil_tmp122; + unsigned int __cil_tmp123; + unsigned int __cil_tmp124; + unsigned int __cil_tmp125; + USHORT __cil_tmp126; + unsigned int __cil_tmp127; + unsigned int __cil_tmp128; + unsigned int __cil_tmp129; + unsigned int __cil_tmp130; + unsigned int __cil_tmp131; + PWSTR __cil_tmp132; + unsigned long __cil_tmp133; + unsigned int __cil_tmp134; + unsigned int __cil_tmp135; + ULONG __cil_tmp136; + unsigned int __cil_tmp137; + unsigned int __cil_tmp138; + PVOID __cil_tmp139; + unsigned int __cil_tmp140; + unsigned int __cil_tmp141; + USHORT __cil_tmp142; + unsigned int __cil_tmp143; + unsigned int __cil_tmp144; + unsigned long __cil_tmp145; + unsigned int __cil_tmp146; + unsigned int __cil_tmp147; + ULONG __cil_tmp148; + unsigned int __cil_tmp149; + unsigned int __cil_tmp150; + unsigned int __cil_tmp151; + unsigned int __cil_tmp152; + unsigned int __cil_tmp153; + unsigned int __cil_tmp154; + unsigned int __cil_tmp155; + UCHAR *__cil_tmp156; + void *__cil_tmp157; + unsigned int __cil_tmp158; + unsigned int __cil_tmp159; + unsigned int __cil_tmp160; + PWSTR __cil_tmp161; + void const *__cil_tmp162; + USHORT __cil_tmp163; + unsigned int __cil_tmp164; + unsigned int __cil_tmp165; + unsigned int __cil_tmp166; + unsigned int __cil_tmp167; + USHORT __cil_tmp168; + unsigned int __cil_tmp169; + unsigned int __cil_tmp170; + int __cil_tmp171; + int __cil_tmp172; + int __cil_tmp173; + int __cil_tmp174; + int __cil_tmp175; + int __cil_tmp176; + int __cil_tmp177; + int __cil_tmp178; + unsigned long __cil_tmp179; + unsigned int __cil_tmp180; + unsigned int __cil_tmp181; + unsigned int __cil_tmp182; + unsigned int __cil_tmp183; + ULONG __cil_tmp184; + unsigned int __cil_tmp185; + unsigned int __cil_tmp186; + PVOID __cil_tmp187; + struct _FORMAT_PARAMETERS *__cil_tmp188; + int __cil_tmp189; + int __cil_tmp190; + int __cil_tmp191; + int __cil_tmp192; + int __cil_tmp193; + unsigned long __cil_tmp194; + unsigned int __cil_tmp195; + unsigned int __cil_tmp196; + unsigned int __cil_tmp197; + unsigned int __cil_tmp198; + ULONG __cil_tmp199; + unsigned long __cil_tmp200; + unsigned int __cil_tmp201; + unsigned int __cil_tmp202; + unsigned int __cil_tmp203; + unsigned int __cil_tmp204; + ULONG __cil_tmp205; + unsigned int __cil_tmp206; + unsigned int __cil_tmp207; + PVOID __cil_tmp208; + unsigned int __cil_tmp209; + unsigned int __cil_tmp210; + USHORT __cil_tmp211; + unsigned int __cil_tmp212; + unsigned int __cil_tmp213; + unsigned long __cil_tmp214; + FORMAT_EX_PARAMETERS *__cil_tmp215; + unsigned int __cil_tmp216; + unsigned int __cil_tmp217; + USHORT(*__cil_tmp218)[1]; + long __cil_tmp219; + unsigned long __cil_tmp220; + unsigned int __cil_tmp221; + unsigned int __cil_tmp222; + unsigned int __cil_tmp223; + unsigned int __cil_tmp224; + ULONG __cil_tmp225; + unsigned int __cil_tmp226; + unsigned int __cil_tmp227; + USHORT __cil_tmp228; + int __cil_tmp229; + unsigned int __cil_tmp230; + unsigned int __cil_tmp231; + USHORT __cil_tmp232; + int __cil_tmp233; + int __cil_tmp234; + int __cil_tmp235; + int __cil_tmp236; + int __cil_tmp237; + int __cil_tmp238; + int __cil_tmp239; + int __cil_tmp240; + int __cil_tmp241; + int __cil_tmp242; + int __cil_tmp243; + int __cil_tmp244; + int __cil_tmp245; + int __cil_tmp246; + int __cil_tmp247; + unsigned int __cil_tmp248; + unsigned int __cil_tmp249; + UCHAR __cil_tmp250; + int __cil_tmp251; + PDRIVE_MEDIA_LIMITS __cil_tmp252; + unsigned int __cil_tmp253; + unsigned int __cil_tmp254; + unsigned int __cil_tmp255; + unsigned int __cil_tmp256; + UCHAR __cil_tmp257; + int __cil_tmp258; + PDRIVE_MEDIA_LIMITS __cil_tmp259; + unsigned int __cil_tmp260; + unsigned int __cil_tmp261; + unsigned long __cil_tmp262; + int __cil_tmp263; + int __cil_tmp264; + int __cil_tmp265; + int __cil_tmp266; + unsigned int __cil_tmp267; + unsigned int __cil_tmp268; + unsigned long __cil_tmp269; + unsigned long __cil_tmp270; + ULONG __cil_tmp271; + int __cil_tmp272; + int __cil_tmp273; + unsigned long __cil_tmp274; + unsigned long __cil_tmp275; + unsigned int __cil_tmp276; + unsigned int __cil_tmp277; + PVOID __cil_tmp278; + unsigned char __cil_tmp279; + int __cil_tmp280; + int __cil_tmp281; + unsigned int __cil_tmp282; + unsigned int __cil_tmp283; + int __cil_tmp284; + PDRIVE_MEDIA_CONSTANTS __cil_tmp285; + int __cil_tmp286; + PDRIVE_MEDIA_CONSTANTS __cil_tmp287; + unsigned int __cil_tmp288; + unsigned int __cil_tmp289; + UCHAR __cil_tmp290; + int __cil_tmp291; + int __cil_tmp292; + unsigned int __cil_tmp293; + unsigned int __cil_tmp294; + unsigned int __cil_tmp295; + unsigned int __cil_tmp296; + unsigned int __cil_tmp297; + unsigned int __cil_tmp298; + int __cil_tmp299; + PDRIVE_MEDIA_CONSTANTS __cil_tmp300; + unsigned int __cil_tmp301; + unsigned int __cil_tmp302; + UCHAR __cil_tmp303; + unsigned int __cil_tmp304; + unsigned int __cil_tmp305; + int __cil_tmp306; + PDRIVE_MEDIA_CONSTANTS __cil_tmp307; + unsigned int __cil_tmp308; + unsigned int __cil_tmp309; + UCHAR __cil_tmp310; + unsigned int __cil_tmp311; + unsigned int __cil_tmp312; + int __cil_tmp313; + PDRIVE_MEDIA_CONSTANTS __cil_tmp314; + unsigned int __cil_tmp315; + unsigned int __cil_tmp316; + USHORT __cil_tmp317; + unsigned int __cil_tmp318; + unsigned int __cil_tmp319; + unsigned int __cil_tmp320; + unsigned long __cil_tmp321; + unsigned int __cil_tmp322; + unsigned int __cil_tmp323; + unsigned int __cil_tmp324; + ULONG_PTR __cil_tmp325; + int __cil_tmp326; + int __cil_tmp327; + int __cil_tmp328; + unsigned long __cil_tmp329; + unsigned long __cil_tmp330; + KUSER_SHARED_DATA *__cil_tmp331; + unsigned int __cil_tmp332; + unsigned int __cil_tmp333; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp334; + int __cil_tmp335; + unsigned int __cil_tmp336; + unsigned int __cil_tmp337; + ULONG __cil_tmp338; + unsigned long __cil_tmp339; + unsigned long __cil_tmp340; + unsigned int __cil_tmp341; + unsigned int __cil_tmp342; + ULONG __cil_tmp343; + enum _POOL_TYPE __cil_tmp344; + unsigned int __cil_tmp345; + unsigned long __cil_tmp346; + void *__cil_tmp347; + unsigned int __cil_tmp348; + void *__cil_tmp349; + unsigned int __cil_tmp350; + unsigned int __cil_tmp351; + unsigned int __cil_tmp352; + PWSTR __cil_tmp353; + void const *__cil_tmp354; + unsigned int __cil_tmp355; + unsigned int __cil_tmp356; + USHORT __cil_tmp357; + unsigned int __cil_tmp358; + unsigned int __cil_tmp359; + unsigned int __cil_tmp360; + unsigned int __cil_tmp361; + unsigned int __cil_tmp362; + UNICODE_STRING *__cil_tmp363; + unsigned int __cil_tmp364; + unsigned int __cil_tmp365; + RTL_QUERY_REGISTRY_TABLE *__cil_tmp366; + void *__cil_tmp367; + unsigned int __cil_tmp368; + unsigned int __cil_tmp369; + unsigned int __cil_tmp370; + unsigned int __cil_tmp371; + unsigned int __cil_tmp372; + unsigned int __cil_tmp373; + unsigned int __cil_tmp374; + unsigned int __cil_tmp375; + unsigned int __cil_tmp376; + unsigned int __cil_tmp377; + WCHAR const *__cil_tmp378; + unsigned int __cil_tmp379; + unsigned int __cil_tmp380; + RTL_QUERY_REGISTRY_TABLE *__cil_tmp381; + void *__cil_tmp382; + void *__cil_tmp383; + int __cil_tmp384; + void *__cil_tmp385; + UNICODE_STRING *__cil_tmp386; + USHORT __cil_tmp387; + int __cil_tmp388; + void *__cil_tmp389; + unsigned int __cil_tmp390; + PWSTR __cil_tmp391; + PWSTR __cil_tmp392; + WCHAR __cil_tmp393; + int __cil_tmp394; + void *__cil_tmp395; + unsigned int __cil_tmp396; + PWSTR __cil_tmp397; + PWSTR __cil_tmp398; + WCHAR __cil_tmp399; + int __cil_tmp400; + void *__cil_tmp401; + unsigned int __cil_tmp402; + PWSTR __cil_tmp403; + PWSTR __cil_tmp404; + WCHAR __cil_tmp405; + int __cil_tmp406; + void *__cil_tmp407; + unsigned int __cil_tmp408; + unsigned int __cil_tmp409; + PVOID __cil_tmp410; + unsigned int __cil_tmp411; + unsigned int __cil_tmp412; + unsigned int __cil_tmp413; + unsigned int __cil_tmp414; + unsigned int __cil_tmp415; + MOUNTDEV_SUGGESTED_LINK_NAME *__cil_tmp416; + unsigned int __cil_tmp417; + unsigned int __cil_tmp418; + WCHAR(*__cil_tmp419)[1]; + long __cil_tmp420; + long __cil_tmp421; + unsigned int __cil_tmp422; + unsigned int __cil_tmp423; + unsigned int __cil_tmp424; + ULONG_PTR __cil_tmp425; + unsigned int __cil_tmp426; + unsigned int __cil_tmp427; + ULONG __cil_tmp428; + unsigned int __cil_tmp429; + unsigned int __cil_tmp430; + unsigned int __cil_tmp431; + void *__cil_tmp432; + WCHAR const *__cil_tmp433; + WCHAR const *__cil_tmp434; + void *__cil_tmp435; + unsigned int __cil_tmp436; + unsigned int __cil_tmp437; + unsigned int __cil_tmp438; + unsigned int __cil_tmp439; + WCHAR *__cil_tmp440; + void *__cil_tmp441; + void const *__cil_tmp442; + unsigned int __cil_tmp443; + unsigned int __cil_tmp444; + unsigned int __cil_tmp445; + unsigned int __cil_tmp446; + unsigned int __cil_tmp447; + PWSTR __cil_tmp448; + PWSTR __cil_tmp449; + unsigned int __cil_tmp450; + unsigned int __cil_tmp451; + unsigned int __cil_tmp452; + unsigned int __cil_tmp453; + int __cil_tmp454; + int __cil_tmp455; + KUSER_SHARED_DATA *__cil_tmp456; + unsigned int __cil_tmp457; + unsigned int __cil_tmp458; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp459; + int __cil_tmp460; + unsigned long __cil_tmp461; + unsigned int __cil_tmp462; + unsigned int __cil_tmp463; + ULONG __cil_tmp464; + unsigned int __cil_tmp465; + unsigned int __cil_tmp466; + unsigned int __cil_tmp467; + unsigned int __cil_tmp468; + CHAR __cil_tmp469; + int __cil_tmp470; + int __cil_tmp471; + unsigned int __cil_tmp472; + unsigned int __cil_tmp473; + unsigned int __cil_tmp474; + unsigned int __cil_tmp475; + unsigned int __cil_tmp476; + unsigned int __cil_tmp477; + unsigned int __cil_tmp478; + unsigned int __cil_tmp479; + unsigned int __cil_tmp480; + unsigned int __cil_tmp481; + struct _IO_STACK_LOCATION *__cil_tmp482; + unsigned int __cil_tmp483; + unsigned int __cil_tmp484; + PDEVICE_OBJECT __cil_tmp485; + unsigned int __cil_tmp486; + unsigned int __cil_tmp487; + int __cil_tmp488; + PVOID *mem_489; + struct _IO_STACK_LOCATION **mem_490; + BOOLEAN *mem_491; + ULONG *mem_492; + BOOLEAN *mem_493; + ULONG_PTR *mem_494; + NTSTATUS *mem_495; + BOOLEAN *mem_496; + CHAR *mem_497; + CHAR *mem_498; + struct _IO_STACK_LOCATION **mem_499; + struct _IO_STACK_LOCATION **mem_500; + PDEVICE_OBJECT *mem_501; + ULONG *mem_502; + ULONG *mem_503; + PVOID *mem_504; + USHORT *mem_505; + USHORT *mem_506; + USHORT *mem_507; + ULONG *mem_508; + ULONG_PTR *mem_509; + PWSTR *mem_510; + USHORT *mem_511; + USHORT *mem_512; + ULONG_PTR *mem_513; + PWSTR *mem_514; + ULONG *mem_515; + PVOID *mem_516; + USHORT *mem_517; + USHORT *mem_518; + USHORT *mem_519; + ULONG *mem_520; + ULONG_PTR *mem_521; + PWSTR *mem_522; + USHORT *mem_523; + USHORT *mem_524; + ULONG_PTR *mem_525; + ULONG *mem_526; + PVOID *mem_527; + ULONG *mem_528; + ULONG *mem_529; + PVOID *mem_530; + USHORT *mem_531; + ULONG *mem_532; + USHORT *mem_533; + USHORT *mem_534; + UCHAR *mem_535; + DRIVE_MEDIA_TYPE *mem_536; + UCHAR *mem_537; + DRIVE_MEDIA_TYPE *mem_538; + ULONG *mem_539; + PVOID *mem_540; + MEDIA_TYPE *mem_541; + MEDIA_TYPE *mem_542; + UCHAR *mem_543; + ULONG *mem_544; + LONG *mem_545; + UCHAR *mem_546; + ULONG *mem_547; + UCHAR *mem_548; + ULONG *mem_549; + USHORT *mem_550; + ULONG *mem_551; + ULONG_PTR *mem_552; + ULONG_PTR *mem_553; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_554; + ULONG *mem_555; + ULONG *mem_556; + PWSTR *mem_557; + USHORT *mem_558; + PWSTR *mem_559; + USHORT *mem_560; + USHORT *mem_561; + ULONG *mem_562; + PWSTR *mem_563; + PVOID *mem_564; + USHORT *mem_565; + PWSTR *mem_566; + PWSTR *mem_567; + PWSTR *mem_568; + PVOID *mem_569; + BOOLEAN *mem_570; + USHORT *mem_571; + ULONG_PTR *mem_572; + ULONG_PTR *mem_573; + ULONG *mem_574; + ULONG_PTR *mem_575; + PWSTR *mem_576; + WCHAR *mem_577; + WCHAR *mem_578; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_579; + ULONG *mem_580; + CHAR *mem_581; + CHAR *mem_582; + struct _IO_STACK_LOCATION **mem_583; + struct _IO_STACK_LOCATION **mem_584; + PDEVICE_OBJECT *mem_585; + NTSTATUS *mem_586; { - { + { #line 1054 - while (1) { - while_15_continue: /* CIL Label */ ; - goto while_15_break; - } - while_15_break: /* CIL Label */ ; - } - { + while (1) { + while_15_continue: /* CIL Label */; + goto while_15_break; + } + while_15_break: /* CIL Label */; + } + { #line 1056 - __cil_tmp24 = (unsigned int )DeviceObject; + __cil_tmp24 = (unsigned int)DeviceObject; #line 1056 - __cil_tmp25 = __cil_tmp24 + 40; + __cil_tmp25 = __cil_tmp24 + 40; #line 1056 - mem_489 = (PVOID *)__cil_tmp25; + mem_489 = (PVOID *)__cil_tmp25; #line 1056 - __cil_tmp26 = *mem_489; + __cil_tmp26 = *mem_489; #line 1056 - disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp26; + disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp26; #line 1057 - __cil_tmp27 = 24 + 8; + __cil_tmp27 = 24 + 8; #line 1057 - __cil_tmp28 = 0 + __cil_tmp27; + __cil_tmp28 = 0 + __cil_tmp27; #line 1057 - __cil_tmp29 = 64 + __cil_tmp28; + __cil_tmp29 = 64 + __cil_tmp28; #line 1057 - __cil_tmp30 = (unsigned int )Irp; + __cil_tmp30 = (unsigned int)Irp; #line 1057 - __cil_tmp31 = __cil_tmp30 + __cil_tmp29; + __cil_tmp31 = __cil_tmp30 + __cil_tmp29; #line 1057 - mem_490 = (struct _IO_STACK_LOCATION **)__cil_tmp31; + mem_490 = (struct _IO_STACK_LOCATION **)__cil_tmp31; #line 1057 - irpSp = *mem_490; + irpSp = *mem_490; #line 1062 - __cil_tmp32 = (unsigned int )disketteExtension; + __cil_tmp32 = (unsigned int)disketteExtension; #line 1062 - __cil_tmp33 = __cil_tmp32 + 428; + __cil_tmp33 = __cil_tmp32 + 428; #line 1062 - __cil_tmp34 = (FAST_MUTEX *)__cil_tmp33; + __cil_tmp34 = (FAST_MUTEX *)__cil_tmp33; #line 1062 - ExAcquireFastMutex(__cil_tmp34); - } - { + ExAcquireFastMutex(__cil_tmp34); + } + { #line 1063 - __cil_tmp35 = (unsigned int )disketteExtension; + __cil_tmp35 = (unsigned int)disketteExtension; #line 1063 - __cil_tmp36 = __cil_tmp35 + 14; - { + __cil_tmp36 = __cil_tmp35 + 14; + { #line 1063 - mem_491 = (BOOLEAN *)__cil_tmp36; + mem_491 = (BOOLEAN *)__cil_tmp36; #line 1063 - if (*mem_491) { - { + if (*mem_491) { + { #line 1070 - __cil_tmp37 = 3 << 14; + __cil_tmp37 = 3 << 14; #line 1070 - __cil_tmp38 = 50 << 16; + __cil_tmp38 = 50 << 16; #line 1070 - __cil_tmp39 = __cil_tmp38 | __cil_tmp37; + __cil_tmp39 = __cil_tmp38 | __cil_tmp37; #line 1070 - __cil_tmp40 = (unsigned long )__cil_tmp39; + __cil_tmp40 = (unsigned long)__cil_tmp39; #line 1070 - __cil_tmp41 = 0 + 8; + __cil_tmp41 = 0 + 8; #line 1070 - __cil_tmp42 = 4 + __cil_tmp41; + __cil_tmp42 = 4 + __cil_tmp41; #line 1070 - __cil_tmp43 = (unsigned int )irpSp; + __cil_tmp43 = (unsigned int)irpSp; #line 1070 - __cil_tmp44 = __cil_tmp43 + __cil_tmp42; + __cil_tmp44 = __cil_tmp43 + __cil_tmp42; #line 1070 - mem_492 = (ULONG *)__cil_tmp44; + mem_492 = (ULONG *)__cil_tmp44; #line 1070 - __cil_tmp45 = *mem_492; + __cil_tmp45 = *mem_492; #line 1070 - if (__cil_tmp45 != __cil_tmp40) { - { + if (__cil_tmp45 != __cil_tmp40) { + { #line 1072 - ntStatus = FloppyQueueRequest(disketteExtension, Irp); + ntStatus = FloppyQueueRequest(disketteExtension, Irp); #line 1074 - __cil_tmp46 = (unsigned int )disketteExtension; + __cil_tmp46 = (unsigned int)disketteExtension; #line 1074 - __cil_tmp47 = __cil_tmp46 + 428; + __cil_tmp47 = __cil_tmp46 + 428; #line 1074 - __cil_tmp48 = (FAST_MUTEX *)__cil_tmp47; + __cil_tmp48 = (FAST_MUTEX *)__cil_tmp47; #line 1074 - ExReleaseFastMutex(__cil_tmp48); - } + ExReleaseFastMutex(__cil_tmp48); + } #line 1075 - return (ntStatus); - } else { - - } + return (ntStatus); + } else { + } + } + } else { + } + } } - } else { - - } - } - } - { + { #line 1078 - __cil_tmp49 = (unsigned int )disketteExtension; + __cil_tmp49 = (unsigned int)disketteExtension; #line 1078 - __cil_tmp50 = __cil_tmp49 + 428; + __cil_tmp50 = __cil_tmp49 + 428; #line 1078 - __cil_tmp51 = (FAST_MUTEX *)__cil_tmp50; + __cil_tmp51 = (FAST_MUTEX *)__cil_tmp50; #line 1078 - ExReleaseFastMutex(__cil_tmp51); - } - { + ExReleaseFastMutex(__cil_tmp51); + } + { #line 1083 - __cil_tmp52 = (unsigned int )disketteExtension; + __cil_tmp52 = (unsigned int)disketteExtension; #line 1083 - __cil_tmp53 = __cil_tmp52 + 13; - { + __cil_tmp53 = __cil_tmp52 + 13; + { #line 1083 - mem_493 = (BOOLEAN *)__cil_tmp53; + mem_493 = (BOOLEAN *)__cil_tmp53; #line 1083 - if (*mem_493) { - { + if (*mem_493) { + { #line 1085 - __cil_tmp54 = 24 + 4; + __cil_tmp54 = 24 + 4; #line 1085 - __cil_tmp55 = (unsigned int )Irp; + __cil_tmp55 = (unsigned int)Irp; #line 1085 - __cil_tmp56 = __cil_tmp55 + __cil_tmp54; + __cil_tmp56 = __cil_tmp55 + __cil_tmp54; #line 1085 - mem_494 = (ULONG_PTR *)__cil_tmp56; + mem_494 = (ULONG_PTR *)__cil_tmp56; #line 1085 - *mem_494 = 0UL; + *mem_494 = 0UL; #line 1086 - __cil_tmp57 = (unsigned int )Irp; + __cil_tmp57 = (unsigned int)Irp; #line 1086 - __cil_tmp58 = __cil_tmp57 + 24; + __cil_tmp58 = __cil_tmp57 + 24; #line 1086 - mem_495 = (NTSTATUS *)__cil_tmp58; + mem_495 = (NTSTATUS *)__cil_tmp58; #line 1086 - *mem_495 = -1073741738L; + *mem_495 = -1073741738L; #line 1087 - myStatus = -1073741738L; + myStatus = -1073741738L; #line 1088 - IofCompleteRequest(Irp, (char)0); - } + IofCompleteRequest(Irp, (char)0); + } #line 1089 - return (-1073741738L); - } else { - - } - } - } - { + return (-1073741738L); + } else { + } + } + } + { #line 1095 - __cil_tmp59 = (unsigned int )disketteExtension; + __cil_tmp59 = (unsigned int)disketteExtension; #line 1095 - __cil_tmp60 = __cil_tmp59 + 12; + __cil_tmp60 = __cil_tmp59 + 12; #line 1095 - mem_496 = (BOOLEAN *)__cil_tmp60; + mem_496 = (BOOLEAN *)__cil_tmp60; #line 1095 - __cil_tmp61 = *mem_496; + __cil_tmp61 = *mem_496; #line 1095 - if (! __cil_tmp61) { + if (!__cil_tmp61) { #line 1097 - if (s == 1) { + if (s == 1) { #line 1097 - s = 3; - } else { - { + s = 3; + } else { + { #line 1098 - __VERIFIER_assert(0); - } - } - { + __VERIFIER_assert(0); + } + } + { #line 1099 - __cil_tmp62 = (unsigned int )Irp; + __cil_tmp62 = (unsigned int)Irp; #line 1099 - __cil_tmp63 = __cil_tmp62 + 35; + __cil_tmp63 = __cil_tmp62 + 35; #line 1099 - __cil_tmp64 = (unsigned int )Irp; + __cil_tmp64 = (unsigned int)Irp; #line 1099 - __cil_tmp65 = __cil_tmp64 + 35; + __cil_tmp65 = __cil_tmp64 + 35; #line 1099 - mem_497 = (CHAR *)__cil_tmp65; + mem_497 = (CHAR *)__cil_tmp65; #line 1099 - __cil_tmp66 = *mem_497; + __cil_tmp66 = *mem_497; #line 1099 - __cil_tmp67 = (int )__cil_tmp66; + __cil_tmp67 = (int)__cil_tmp66; #line 1099 - __cil_tmp68 = __cil_tmp67 + 1; + __cil_tmp68 = __cil_tmp67 + 1; #line 1099 - mem_498 = (CHAR *)__cil_tmp63; + mem_498 = (CHAR *)__cil_tmp63; #line 1099 - *mem_498 = (char )__cil_tmp68; + *mem_498 = (char)__cil_tmp68; #line 1099 - __cil_tmp69 = 24 + 8; + __cil_tmp69 = 24 + 8; #line 1099 - __cil_tmp70 = 0 + __cil_tmp69; + __cil_tmp70 = 0 + __cil_tmp69; #line 1099 - __cil_tmp71 = 64 + __cil_tmp70; + __cil_tmp71 = 64 + __cil_tmp70; #line 1099 - __cil_tmp72 = (unsigned int )Irp; + __cil_tmp72 = (unsigned int)Irp; #line 1099 - __cil_tmp73 = __cil_tmp72 + __cil_tmp71; + __cil_tmp73 = __cil_tmp72 + __cil_tmp71; #line 1099 - __cil_tmp74 = 24 + 8; + __cil_tmp74 = 24 + 8; #line 1099 - __cil_tmp75 = 0 + __cil_tmp74; + __cil_tmp75 = 0 + __cil_tmp74; #line 1099 - __cil_tmp76 = 64 + __cil_tmp75; + __cil_tmp76 = 64 + __cil_tmp75; #line 1099 - __cil_tmp77 = (unsigned int )Irp; + __cil_tmp77 = (unsigned int)Irp; #line 1099 - __cil_tmp78 = __cil_tmp77 + __cil_tmp76; + __cil_tmp78 = __cil_tmp77 + __cil_tmp76; #line 1099 - mem_499 = (struct _IO_STACK_LOCATION **)__cil_tmp78; + mem_499 = (struct _IO_STACK_LOCATION **)__cil_tmp78; #line 1099 - __cil_tmp79 = *mem_499; + __cil_tmp79 = *mem_499; #line 1099 - mem_500 = (struct _IO_STACK_LOCATION **)__cil_tmp73; + mem_500 = (struct _IO_STACK_LOCATION **)__cil_tmp73; #line 1099 - *mem_500 = __cil_tmp79 + 1; + *mem_500 = __cil_tmp79 + 1; #line 1100 - __cil_tmp80 = (unsigned int )disketteExtension; + __cil_tmp80 = (unsigned int)disketteExtension; #line 1100 - __cil_tmp81 = __cil_tmp80 + 8; + __cil_tmp81 = __cil_tmp80 + 8; #line 1100 - mem_501 = (PDEVICE_OBJECT *)__cil_tmp81; + mem_501 = (PDEVICE_OBJECT *)__cil_tmp81; #line 1100 - __cil_tmp82 = *mem_501; + __cil_tmp82 = *mem_501; #line 1100 - tmp = IofCallDriver(__cil_tmp82, Irp); - } + tmp = IofCallDriver(__cil_tmp82, Irp); + } #line 1100 - return (tmp); - } else { - - } - } - { + return (tmp); + } else { + } + } + { #line 1103 - __cil_tmp83 = 0 + 8; + __cil_tmp83 = 0 + 8; #line 1103 - __cil_tmp84 = 4 + __cil_tmp83; + __cil_tmp84 = 4 + __cil_tmp83; #line 1103 - __cil_tmp85 = (unsigned int )irpSp; + __cil_tmp85 = (unsigned int)irpSp; #line 1103 - __cil_tmp86 = __cil_tmp85 + __cil_tmp84; + __cil_tmp86 = __cil_tmp85 + __cil_tmp84; #line 1103 - mem_502 = (ULONG *)__cil_tmp86; + mem_502 = (ULONG *)__cil_tmp86; #line 1103 - __cil_tmp87 = *mem_502; + __cil_tmp87 = *mem_502; #line 1104 - if ((int )__cil_tmp87 == (__cil_tmp90 | __cil_tmp89)) { - goto switch_16_exp_0; - } else { + if ((int)__cil_tmp87 == (__cil_tmp90 | __cil_tmp89)) { + goto switch_16_exp_0; + } else { #line 1136 - if ((int )__cil_tmp87 == 77UL << 16) { - goto switch_16_exp_1; - } else { + if ((int)__cil_tmp87 == 77UL << 16) { + goto switch_16_exp_1; + } else { #line 1172 - if ((int )__cil_tmp87 == (__cil_tmp174 | __cil_tmp171)) { - goto switch_16_exp_2; - } else { + if ((int)__cil_tmp87 == (__cil_tmp174 | __cil_tmp171)) { + goto switch_16_exp_2; + } else { #line 1173 - if ((int )__cil_tmp87 == (__cil_tmp178 | __cil_tmp175)) { - goto switch_16_exp_3; - } else { + if ((int)__cil_tmp87 == (__cil_tmp178 | __cil_tmp175)) { + goto switch_16_exp_3; + } else { #line 1241 - if ((int )__cil_tmp87 == (__cil_tmp237 | __cil_tmp234)) { - goto switch_16_exp_4; - } else { + if ((int)__cil_tmp87 == (__cil_tmp237 | __cil_tmp234)) { + goto switch_16_exp_4; + } else { #line 1242 - if ((int )__cil_tmp87 == (__cil_tmp241 | __cil_tmp238)) { - goto switch_16_exp_5; - } else { + if ((int)__cil_tmp87 == (__cil_tmp241 | __cil_tmp238)) { + goto switch_16_exp_5; + } else { #line 1243 - if ((int )__cil_tmp87 == 7 << 16) { - goto switch_16_exp_6; - } else { + if ((int)__cil_tmp87 == 7 << 16) { + goto switch_16_exp_6; + } else { #line 1244 - if ((int )__cil_tmp87 == (__cil_tmp243 | __cil_tmp242)) { - goto switch_16_exp_7; - } else { + if ((int)__cil_tmp87 == (__cil_tmp243 | __cil_tmp242)) { + goto switch_16_exp_7; + } else { #line 1272 - if ((int )__cil_tmp87 == (__cil_tmp245 | __cil_tmp244)) { - goto switch_16_exp_8; - } else { + if ((int)__cil_tmp87 == (__cil_tmp245 | __cil_tmp244)) { + goto switch_16_exp_8; + } else { #line 1273 - if ((int )__cil_tmp87 == (__cil_tmp247 | __cil_tmp246)) { - goto switch_16_exp_9; - } else { + if ((int)__cil_tmp87 == (__cil_tmp247 | __cil_tmp246)) { + goto switch_16_exp_9; + } else { #line 1374 - if ((int )__cil_tmp87 == (__cil_tmp330 | __cil_tmp329)) { - goto switch_16_exp_10; - } else { + if ((int)__cil_tmp87 == + (__cil_tmp330 | __cil_tmp329)) { + goto switch_16_exp_10; + } else { #line 1472 - if ((int )__cil_tmp87 == (__cil_tmp455 | __cil_tmp454)) { - goto switch_16_exp_11; - } else { - { - goto switch_16_default; + if ((int)__cil_tmp87 == + (__cil_tmp455 | __cil_tmp454)) { + goto switch_16_exp_11; + } else { + { + goto switch_16_default; #line 1103 - if (0) { - switch_16_exp_0: /* CIL Label */ - { - __cil_tmp88 = 2 << 2; - __cil_tmp89 = (unsigned long )__cil_tmp88; - __cil_tmp90 = 77UL << 16; - - } - { + if (0) { + switch_16_exp_0 : /* CIL Label */ + { + __cil_tmp88 = 2 << 2; + __cil_tmp89 = (unsigned long)__cil_tmp88; + __cil_tmp90 = 77UL << 16; + } + { #line 1109 - while (1) { - while_17_continue: /* CIL Label */ ; - goto while_17_break; - } - while_17_break: /* CIL Label */ ; - } - { + while (1) { + while_17_continue: /* CIL Label */; + goto while_17_break; + } + while_17_break: /* CIL Label */; + } + { #line 1112 - __cil_tmp91 = (unsigned long )4U; + __cil_tmp91 = (unsigned long)4U; #line 1112 - __cil_tmp92 = (unsigned int )irpSp; + __cil_tmp92 = (unsigned int)irpSp; #line 1112 - __cil_tmp93 = __cil_tmp92 + 4; + __cil_tmp93 = __cil_tmp92 + 4; #line 1112 - mem_503 = (ULONG *)__cil_tmp93; + mem_503 = (ULONG *)__cil_tmp93; #line 1112 - __cil_tmp94 = *mem_503; + __cil_tmp94 = *mem_503; #line 1112 - if (__cil_tmp94 < __cil_tmp91) { + if (__cil_tmp94 < __cil_tmp91) { #line 1115 - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - } + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + } #line 1119 - __cil_tmp95 = (unsigned int )Irp; + __cil_tmp95 = (unsigned int)Irp; #line 1119 - __cil_tmp96 = __cil_tmp95 + 12; + __cil_tmp96 = __cil_tmp95 + 12; #line 1119 - mem_504 = (PVOID *)__cil_tmp96; + mem_504 = (PVOID *)__cil_tmp96; #line 1119 - __cil_tmp97 = *mem_504; + __cil_tmp97 = *mem_504; #line 1119 - mountName = (struct _MOUNTDEV_NAME *)__cil_tmp97; + mountName = + (struct _MOUNTDEV_NAME *)__cil_tmp97; #line 1120 - __cil_tmp98 = (unsigned int )disketteExtension; + __cil_tmp98 = (unsigned int)disketteExtension; #line 1120 - __cil_tmp99 = __cil_tmp98 + 368; + __cil_tmp99 = __cil_tmp98 + 368; #line 1120 - mem_505 = (USHORT *)mountName; + mem_505 = (USHORT *)mountName; #line 1120 - mem_506 = (USHORT *)__cil_tmp99; + mem_506 = (USHORT *)__cil_tmp99; #line 1120 - *mem_505 = *mem_506; - { + *mem_505 = *mem_506; + { #line 1122 - mem_507 = (USHORT *)mountName; + mem_507 = (USHORT *)mountName; #line 1122 - __cil_tmp100 = *mem_507; + __cil_tmp100 = *mem_507; #line 1122 - __cil_tmp101 = (unsigned int )__cil_tmp100; + __cil_tmp101 = (unsigned int)__cil_tmp100; #line 1122 - __cil_tmp102 = 2U + __cil_tmp101; + __cil_tmp102 = 2U + __cil_tmp101; #line 1122 - __cil_tmp103 = (unsigned long )__cil_tmp102; + __cil_tmp103 = (unsigned long)__cil_tmp102; #line 1122 - __cil_tmp104 = (unsigned int )irpSp; + __cil_tmp104 = (unsigned int)irpSp; #line 1122 - __cil_tmp105 = __cil_tmp104 + 4; + __cil_tmp105 = __cil_tmp104 + 4; #line 1122 - mem_508 = (ULONG *)__cil_tmp105; + mem_508 = (ULONG *)__cil_tmp105; #line 1122 - __cil_tmp106 = *mem_508; + __cil_tmp106 = *mem_508; #line 1122 - if (__cil_tmp106 < __cil_tmp103) { + if (__cil_tmp106 < __cil_tmp103) { #line 1125 - ntStatus = -2147483643L; + ntStatus = -2147483643L; #line 1126 - __cil_tmp107 = 24 + 4; + __cil_tmp107 = 24 + 4; #line 1126 - __cil_tmp108 = (unsigned int )Irp; + __cil_tmp108 = (unsigned int)Irp; #line 1126 - __cil_tmp109 = __cil_tmp108 + __cil_tmp107; + __cil_tmp109 = + __cil_tmp108 + __cil_tmp107; #line 1126 - mem_509 = (ULONG_PTR *)__cil_tmp109; + mem_509 = (ULONG_PTR *)__cil_tmp109; #line 1126 - *mem_509 = (unsigned long )4U; - goto switch_16_break; - } else { - - } - } - { + *mem_509 = (unsigned long)4U; + goto switch_16_break; + } else { + } + } + { #line 1131 - __cil_tmp110 = 0 * 2U; + __cil_tmp110 = 0 * 2U; #line 1131 - __cil_tmp111 = 2 + __cil_tmp110; + __cil_tmp111 = 2 + __cil_tmp110; #line 1131 - __cil_tmp112 = (unsigned int )mountName; + __cil_tmp112 = (unsigned int)mountName; #line 1131 - __cil_tmp113 = __cil_tmp112 + __cil_tmp111; + __cil_tmp113 = __cil_tmp112 + __cil_tmp111; #line 1131 - __cil_tmp114 = (WCHAR *)__cil_tmp113; + __cil_tmp114 = (WCHAR *)__cil_tmp113; #line 1131 - __cil_tmp115 = (void *)__cil_tmp114; + __cil_tmp115 = (void *)__cil_tmp114; #line 1131 - __cil_tmp116 = 368 + 4; + __cil_tmp116 = 368 + 4; #line 1131 - __cil_tmp117 = (unsigned int )disketteExtension; + __cil_tmp117 = + (unsigned int)disketteExtension; #line 1131 - __cil_tmp118 = __cil_tmp117 + __cil_tmp116; + __cil_tmp118 = __cil_tmp117 + __cil_tmp116; #line 1131 - mem_510 = (PWSTR *)__cil_tmp118; + mem_510 = (PWSTR *)__cil_tmp118; #line 1131 - __cil_tmp119 = *mem_510; + __cil_tmp119 = *mem_510; #line 1131 - __cil_tmp120 = (void const *)__cil_tmp119; + __cil_tmp120 = (void const *)__cil_tmp119; #line 1131 - mem_511 = (USHORT *)mountName; + mem_511 = (USHORT *)mountName; #line 1131 - __cil_tmp121 = *mem_511; + __cil_tmp121 = *mem_511; #line 1131 - __cil_tmp122 = (unsigned int )__cil_tmp121; + __cil_tmp122 = (unsigned int)__cil_tmp121; #line 1131 - memcpy(__cil_tmp115, __cil_tmp120, __cil_tmp122); + memcpy(__cil_tmp115, __cil_tmp120, + __cil_tmp122); #line 1133 - ntStatus = 0L; + ntStatus = 0L; #line 1134 - __cil_tmp123 = 24 + 4; + __cil_tmp123 = 24 + 4; #line 1134 - __cil_tmp124 = (unsigned int )Irp; + __cil_tmp124 = (unsigned int)Irp; #line 1134 - __cil_tmp125 = __cil_tmp124 + __cil_tmp123; + __cil_tmp125 = __cil_tmp124 + __cil_tmp123; #line 1134 - mem_512 = (USHORT *)mountName; + mem_512 = (USHORT *)mountName; #line 1134 - __cil_tmp126 = *mem_512; + __cil_tmp126 = *mem_512; #line 1134 - __cil_tmp127 = (unsigned int )__cil_tmp126; + __cil_tmp127 = (unsigned int)__cil_tmp126; #line 1134 - __cil_tmp128 = 2U + __cil_tmp127; + __cil_tmp128 = 2U + __cil_tmp127; #line 1134 - mem_513 = (ULONG_PTR *)__cil_tmp125; + mem_513 = (ULONG_PTR *)__cil_tmp125; #line 1134 - *mem_513 = (unsigned long )__cil_tmp128; - } - goto switch_16_break; - switch_16_exp_1: /* CIL Label */ ; - { + *mem_513 = (unsigned long)__cil_tmp128; + } + goto switch_16_break; + switch_16_exp_1: /* CIL Label */; + { #line 1142 - while (1) { - while_18_continue: /* CIL Label */ ; - goto while_18_break; - } - while_18_break: /* CIL Label */ ; - } - { + while (1) { + while_18_continue: /* CIL Label */; + goto while_18_break; + } + while_18_break: /* CIL Label */; + } + { #line 1144 - __cil_tmp129 = 376 + 4; + __cil_tmp129 = 376 + 4; #line 1144 - __cil_tmp130 = (unsigned int )disketteExtension; + __cil_tmp130 = + (unsigned int)disketteExtension; #line 1144 - __cil_tmp131 = __cil_tmp130 + __cil_tmp129; + __cil_tmp131 = __cil_tmp130 + __cil_tmp129; #line 1144 - mem_514 = (PWSTR *)__cil_tmp131; + mem_514 = (PWSTR *)__cil_tmp131; #line 1144 - __cil_tmp132 = *mem_514; + __cil_tmp132 = *mem_514; #line 1144 - if (! __cil_tmp132) { + if (!__cil_tmp132) { #line 1148 - ntStatus = -1073741811L; - goto switch_16_break; - } else { - { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + { #line 1144 - __cil_tmp133 = (unsigned long )4U; + __cil_tmp133 = (unsigned long)4U; #line 1144 - __cil_tmp134 = (unsigned int )irpSp; + __cil_tmp134 = (unsigned int)irpSp; #line 1144 - __cil_tmp135 = __cil_tmp134 + 4; + __cil_tmp135 = __cil_tmp134 + 4; #line 1144 - mem_515 = (ULONG *)__cil_tmp135; + mem_515 = (ULONG *)__cil_tmp135; #line 1144 - __cil_tmp136 = *mem_515; + __cil_tmp136 = *mem_515; #line 1144 - if (__cil_tmp136 < __cil_tmp133) { + if (__cil_tmp136 < __cil_tmp133) { #line 1148 - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - } - } - } -#line 1152 - __cil_tmp137 = (unsigned int )Irp; + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + } + } + } +#line 1152 + __cil_tmp137 = (unsigned int)Irp; #line 1152 - __cil_tmp138 = __cil_tmp137 + 12; + __cil_tmp138 = __cil_tmp137 + 12; #line 1152 - mem_516 = (PVOID *)__cil_tmp138; + mem_516 = (PVOID *)__cil_tmp138; #line 1152 - __cil_tmp139 = *mem_516; + __cil_tmp139 = *mem_516; #line 1152 - uniqueId = (struct _MOUNTDEV_UNIQUE_ID *)__cil_tmp139; + uniqueId = (struct _MOUNTDEV_UNIQUE_ID *) + __cil_tmp139; #line 1153 - __cil_tmp140 = (unsigned int )disketteExtension; + __cil_tmp140 = + (unsigned int)disketteExtension; #line 1153 - __cil_tmp141 = __cil_tmp140 + 376; + __cil_tmp141 = __cil_tmp140 + 376; #line 1153 - mem_517 = (USHORT *)uniqueId; + mem_517 = (USHORT *)uniqueId; #line 1153 - mem_518 = (USHORT *)__cil_tmp141; + mem_518 = (USHORT *)__cil_tmp141; #line 1153 - *mem_517 = *mem_518; - { + *mem_517 = *mem_518; + { #line 1156 - mem_519 = (USHORT *)uniqueId; + mem_519 = (USHORT *)uniqueId; #line 1156 - __cil_tmp142 = *mem_519; + __cil_tmp142 = *mem_519; #line 1156 - __cil_tmp143 = (unsigned int )__cil_tmp142; + __cil_tmp143 = (unsigned int)__cil_tmp142; #line 1156 - __cil_tmp144 = 2U + __cil_tmp143; + __cil_tmp144 = 2U + __cil_tmp143; #line 1156 - __cil_tmp145 = (unsigned long )__cil_tmp144; + __cil_tmp145 = (unsigned long)__cil_tmp144; #line 1156 - __cil_tmp146 = (unsigned int )irpSp; + __cil_tmp146 = (unsigned int)irpSp; #line 1156 - __cil_tmp147 = __cil_tmp146 + 4; + __cil_tmp147 = __cil_tmp146 + 4; #line 1156 - mem_520 = (ULONG *)__cil_tmp147; + mem_520 = (ULONG *)__cil_tmp147; #line 1156 - __cil_tmp148 = *mem_520; + __cil_tmp148 = *mem_520; #line 1156 - if (__cil_tmp148 < __cil_tmp145) { + if (__cil_tmp148 < __cil_tmp145) { #line 1159 - ntStatus = -2147483643L; + ntStatus = -2147483643L; #line 1160 - __cil_tmp149 = 24 + 4; + __cil_tmp149 = 24 + 4; #line 1160 - __cil_tmp150 = (unsigned int )Irp; + __cil_tmp150 = (unsigned int)Irp; #line 1160 - __cil_tmp151 = __cil_tmp150 + __cil_tmp149; + __cil_tmp151 = + __cil_tmp150 + __cil_tmp149; #line 1160 - mem_521 = (ULONG_PTR *)__cil_tmp151; + mem_521 = (ULONG_PTR *)__cil_tmp151; #line 1160 - *mem_521 = (unsigned long )4U; - goto switch_16_break; - } else { - - } - } - { + *mem_521 = (unsigned long)4U; + goto switch_16_break; + } else { + } + } + { #line 1166 - __cil_tmp152 = 0 * 1U; + __cil_tmp152 = 0 * 1U; #line 1166 - __cil_tmp153 = 2 + __cil_tmp152; + __cil_tmp153 = 2 + __cil_tmp152; #line 1166 - __cil_tmp154 = (unsigned int )uniqueId; + __cil_tmp154 = (unsigned int)uniqueId; #line 1166 - __cil_tmp155 = __cil_tmp154 + __cil_tmp153; + __cil_tmp155 = __cil_tmp154 + __cil_tmp153; #line 1166 - __cil_tmp156 = (UCHAR *)__cil_tmp155; + __cil_tmp156 = (UCHAR *)__cil_tmp155; #line 1166 - __cil_tmp157 = (void *)__cil_tmp156; + __cil_tmp157 = (void *)__cil_tmp156; #line 1166 - __cil_tmp158 = 376 + 4; + __cil_tmp158 = 376 + 4; #line 1166 - __cil_tmp159 = (unsigned int )disketteExtension; + __cil_tmp159 = + (unsigned int)disketteExtension; #line 1166 - __cil_tmp160 = __cil_tmp159 + __cil_tmp158; + __cil_tmp160 = __cil_tmp159 + __cil_tmp158; #line 1166 - mem_522 = (PWSTR *)__cil_tmp160; + mem_522 = (PWSTR *)__cil_tmp160; #line 1166 - __cil_tmp161 = *mem_522; + __cil_tmp161 = *mem_522; #line 1166 - __cil_tmp162 = (void const *)__cil_tmp161; + __cil_tmp162 = (void const *)__cil_tmp161; #line 1166 - mem_523 = (USHORT *)uniqueId; + mem_523 = (USHORT *)uniqueId; #line 1166 - __cil_tmp163 = *mem_523; + __cil_tmp163 = *mem_523; #line 1166 - __cil_tmp164 = (unsigned int )__cil_tmp163; + __cil_tmp164 = (unsigned int)__cil_tmp163; #line 1166 - memcpy(__cil_tmp157, __cil_tmp162, __cil_tmp164); + memcpy(__cil_tmp157, __cil_tmp162, + __cil_tmp164); #line 1168 - ntStatus = 0L; + ntStatus = 0L; #line 1169 - __cil_tmp165 = 24 + 4; + __cil_tmp165 = 24 + 4; #line 1169 - __cil_tmp166 = (unsigned int )Irp; + __cil_tmp166 = (unsigned int)Irp; #line 1169 - __cil_tmp167 = __cil_tmp166 + __cil_tmp165; + __cil_tmp167 = __cil_tmp166 + __cil_tmp165; #line 1169 - mem_524 = (USHORT *)uniqueId; + mem_524 = (USHORT *)uniqueId; #line 1169 - __cil_tmp168 = *mem_524; + __cil_tmp168 = *mem_524; #line 1169 - __cil_tmp169 = (unsigned int )__cil_tmp168; + __cil_tmp169 = (unsigned int)__cil_tmp168; #line 1169 - __cil_tmp170 = 2U + __cil_tmp169; + __cil_tmp170 = 2U + __cil_tmp169; #line 1169 - mem_525 = (ULONG_PTR *)__cil_tmp167; + mem_525 = (ULONG_PTR *)__cil_tmp167; #line 1169 - *mem_525 = (unsigned long )__cil_tmp170; - } - goto switch_16_break; - switch_16_exp_2: /* CIL Label */ - { - __cil_tmp171 = 6 << 2; - __cil_tmp172 = 3 << 14; - __cil_tmp173 = 7 << 16; - __cil_tmp174 = __cil_tmp173 | __cil_tmp172; - - } - switch_16_exp_3: /* CIL Label */ - { - __cil_tmp175 = 11 << 2; - __cil_tmp176 = 3 << 14; - __cil_tmp177 = 7 << 16; - __cil_tmp178 = __cil_tmp177 | __cil_tmp176; - - } - { + *mem_525 = (unsigned long)__cil_tmp170; + } + goto switch_16_break; + switch_16_exp_2 : /* CIL Label */ + { + __cil_tmp171 = 6 << 2; + __cil_tmp172 = 3 << 14; + __cil_tmp173 = 7 << 16; + __cil_tmp174 = __cil_tmp173 | __cil_tmp172; + } + switch_16_exp_3 : /* CIL Label */ + { + __cil_tmp175 = 11 << 2; + __cil_tmp176 = 3 << 14; + __cil_tmp177 = 7 << 16; + __cil_tmp178 = __cil_tmp177 | __cil_tmp176; + } + { #line 1181 - __cil_tmp179 = (unsigned long )48U; + __cil_tmp179 = (unsigned long)48U; #line 1181 - __cil_tmp180 = 0 + 4; + __cil_tmp180 = 0 + 4; #line 1181 - __cil_tmp181 = 4 + __cil_tmp180; + __cil_tmp181 = 4 + __cil_tmp180; #line 1181 - __cil_tmp182 = (unsigned int )irpSp; + __cil_tmp182 = (unsigned int)irpSp; #line 1181 - __cil_tmp183 = __cil_tmp182 + __cil_tmp181; + __cil_tmp183 = __cil_tmp182 + __cil_tmp181; #line 1181 - mem_526 = (ULONG *)__cil_tmp183; + mem_526 = (ULONG *)__cil_tmp183; #line 1181 - __cil_tmp184 = *mem_526; + __cil_tmp184 = *mem_526; #line 1181 - if (__cil_tmp184 < __cil_tmp179) { - { + if (__cil_tmp184 < __cil_tmp179) { + { #line 1187 - while (1) { - while_19_continue: /* CIL Label */ ; - goto while_19_break; - } - while_19_break: /* CIL Label */ ; - } + while (1) { + while_19_continue: /* CIL Label */; + goto while_19_break; + } + while_19_break: /* CIL Label */; + } #line 1189 - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - } - { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + } + { #line 1197 - __cil_tmp185 = (unsigned int )Irp; + __cil_tmp185 = (unsigned int)Irp; #line 1197 - __cil_tmp186 = __cil_tmp185 + 12; + __cil_tmp186 = __cil_tmp185 + 12; #line 1197 - mem_527 = (PVOID *)__cil_tmp186; + mem_527 = (PVOID *)__cil_tmp186; #line 1197 - __cil_tmp187 = *mem_527; + __cil_tmp187 = *mem_527; #line 1197 - __cil_tmp188 = (struct _FORMAT_PARAMETERS *)__cil_tmp187; + __cil_tmp188 = (struct _FORMAT_PARAMETERS *) + __cil_tmp187; #line 1197 - tmp___0 = FlCheckFormatParameters(disketteExtension, __cil_tmp188); - } + tmp___0 = FlCheckFormatParameters( + disketteExtension, __cil_tmp188); + } #line 1197 - if (! tmp___0) { - { + if (!tmp___0) { + { #line 1204 - while (1) { - while_20_continue: /* CIL Label */ ; - goto while_20_break; - } - while_20_break: /* CIL Label */ ; - } + while (1) { + while_20_continue: /* CIL Label */; + goto while_20_break; + } + while_20_break: /* CIL Label */; + } #line 1206 - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + { #line 1214 - __cil_tmp189 = 11 << 2; + __cil_tmp189 = 11 << 2; #line 1214 - __cil_tmp190 = 3 << 14; + __cil_tmp190 = 3 << 14; #line 1214 - __cil_tmp191 = 7 << 16; + __cil_tmp191 = 7 << 16; #line 1214 - __cil_tmp192 = __cil_tmp191 | __cil_tmp190; + __cil_tmp192 = __cil_tmp191 | __cil_tmp190; #line 1214 - __cil_tmp193 = __cil_tmp192 | __cil_tmp189; + __cil_tmp193 = __cil_tmp192 | __cil_tmp189; #line 1214 - __cil_tmp194 = (unsigned long )__cil_tmp193; + __cil_tmp194 = (unsigned long)__cil_tmp193; #line 1214 - __cil_tmp195 = 0 + 8; + __cil_tmp195 = 0 + 8; #line 1214 - __cil_tmp196 = 4 + __cil_tmp195; + __cil_tmp196 = 4 + __cil_tmp195; #line 1214 - __cil_tmp197 = (unsigned int )irpSp; + __cil_tmp197 = (unsigned int)irpSp; #line 1214 - __cil_tmp198 = __cil_tmp197 + __cil_tmp196; + __cil_tmp198 = __cil_tmp197 + __cil_tmp196; #line 1214 - mem_528 = (ULONG *)__cil_tmp198; + mem_528 = (ULONG *)__cil_tmp198; #line 1214 - __cil_tmp199 = *mem_528; + __cil_tmp199 = *mem_528; #line 1214 - if (__cil_tmp199 == __cil_tmp194) { - { + if (__cil_tmp199 == __cil_tmp194) { + { #line 1217 - __cil_tmp200 = (unsigned long )56U; + __cil_tmp200 = (unsigned long)56U; #line 1217 - __cil_tmp201 = 0 + 4; + __cil_tmp201 = 0 + 4; #line 1217 - __cil_tmp202 = 4 + __cil_tmp201; + __cil_tmp202 = 4 + __cil_tmp201; #line 1217 - __cil_tmp203 = (unsigned int )irpSp; + __cil_tmp203 = (unsigned int)irpSp; #line 1217 - __cil_tmp204 = __cil_tmp203 + __cil_tmp202; + __cil_tmp204 = + __cil_tmp203 + __cil_tmp202; #line 1217 - mem_529 = (ULONG *)__cil_tmp204; + mem_529 = (ULONG *)__cil_tmp204; #line 1217 - __cil_tmp205 = *mem_529; + __cil_tmp205 = *mem_529; #line 1217 - if (__cil_tmp205 < __cil_tmp200) { + if (__cil_tmp205 < __cil_tmp200) { #line 1220 - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - } + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + } #line 1224 - __cil_tmp206 = (unsigned int )Irp; + __cil_tmp206 = (unsigned int)Irp; #line 1224 - __cil_tmp207 = __cil_tmp206 + 12; + __cil_tmp207 = __cil_tmp206 + 12; #line 1224 - mem_530 = (PVOID *)__cil_tmp207; + mem_530 = (PVOID *)__cil_tmp207; #line 1224 - __cil_tmp208 = *mem_530; + __cil_tmp208 = *mem_530; #line 1224 - formatExParameters = (struct _FORMAT_EX_PARAMETERS *)__cil_tmp208; + formatExParameters = + (struct _FORMAT_EX_PARAMETERS *) + __cil_tmp208; #line 1226 - __cil_tmp209 = (unsigned int )formatExParameters; + __cil_tmp209 = + (unsigned int)formatExParameters; #line 1226 - __cil_tmp210 = __cil_tmp209 + 50; + __cil_tmp210 = __cil_tmp209 + 50; #line 1226 - mem_531 = (USHORT *)__cil_tmp210; + mem_531 = (USHORT *)__cil_tmp210; #line 1226 - __cil_tmp211 = *mem_531; + __cil_tmp211 = *mem_531; #line 1226 - __cil_tmp212 = (unsigned int )__cil_tmp211; + __cil_tmp212 = (unsigned int)__cil_tmp211; #line 1226 - __cil_tmp213 = __cil_tmp212 * 2U; + __cil_tmp213 = __cil_tmp212 * 2U; #line 1226 - __cil_tmp214 = (unsigned long )__cil_tmp213; + __cil_tmp214 = + (unsigned long)__cil_tmp213; #line 1226 - __cil_tmp215 = (FORMAT_EX_PARAMETERS *)0; + __cil_tmp215 = (FORMAT_EX_PARAMETERS *)0; #line 1226 - __cil_tmp216 = (unsigned int )__cil_tmp215; + __cil_tmp216 = (unsigned int)__cil_tmp215; #line 1226 - __cil_tmp217 = __cil_tmp216 + 52; + __cil_tmp217 = __cil_tmp216 + 52; #line 1226 - __cil_tmp218 = (USHORT (*)[1])__cil_tmp217; + __cil_tmp218 = (USHORT(*)[1])__cil_tmp217; #line 1226 - __cil_tmp219 = (long )__cil_tmp218; + __cil_tmp219 = (long)__cil_tmp218; #line 1226 - __cil_tmp220 = (unsigned long )__cil_tmp219; + __cil_tmp220 = + (unsigned long)__cil_tmp219; #line 1226 - formatExParametersSize = __cil_tmp220 + __cil_tmp214; - { + formatExParametersSize = + __cil_tmp220 + __cil_tmp214; + { #line 1230 - __cil_tmp221 = 0 + 4; + __cil_tmp221 = 0 + 4; #line 1230 - __cil_tmp222 = 4 + __cil_tmp221; + __cil_tmp222 = 4 + __cil_tmp221; #line 1230 - __cil_tmp223 = (unsigned int )irpSp; + __cil_tmp223 = (unsigned int)irpSp; #line 1230 - __cil_tmp224 = __cil_tmp223 + __cil_tmp222; + __cil_tmp224 = + __cil_tmp223 + __cil_tmp222; #line 1230 - mem_532 = (ULONG *)__cil_tmp224; + mem_532 = (ULONG *)__cil_tmp224; #line 1230 - __cil_tmp225 = *mem_532; + __cil_tmp225 = *mem_532; #line 1230 - if (__cil_tmp225 < formatExParametersSize) { + if (__cil_tmp225 < + formatExParametersSize) { #line 1235 - ntStatus = -1073741811L; - goto switch_16_break; - } else { - { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + { #line 1230 - __cil_tmp226 = (unsigned int )formatExParameters; + __cil_tmp226 = (unsigned int) + formatExParameters; #line 1230 - __cil_tmp227 = __cil_tmp226 + 48; + __cil_tmp227 = __cil_tmp226 + 48; #line 1230 - mem_533 = (USHORT *)__cil_tmp227; + mem_533 = (USHORT *)__cil_tmp227; #line 1230 - __cil_tmp228 = *mem_533; + __cil_tmp228 = *mem_533; #line 1230 - __cil_tmp229 = (int )__cil_tmp228; + __cil_tmp229 = (int)__cil_tmp228; #line 1230 - if (__cil_tmp229 >= 256) { + if (__cil_tmp229 >= 256) { #line 1235 - ntStatus = -1073741811L; - goto switch_16_break; - } else { - { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + { #line 1230 - __cil_tmp230 = (unsigned int )formatExParameters; + __cil_tmp230 = (unsigned int) + formatExParameters; #line 1230 - __cil_tmp231 = __cil_tmp230 + 50; + __cil_tmp231 = + __cil_tmp230 + 50; #line 1230 - mem_534 = (USHORT *)__cil_tmp231; + mem_534 = + (USHORT *)__cil_tmp231; #line 1230 - __cil_tmp232 = *mem_534; + __cil_tmp232 = *mem_534; #line 1230 - __cil_tmp233 = (int )__cil_tmp232; + __cil_tmp233 = + (int)__cil_tmp232; #line 1230 - if (__cil_tmp233 >= 256) { + if (__cil_tmp233 >= 256) { #line 1235 - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + } + } + } + } + } + } else { + } } + switch_16_exp_4 : /* CIL Label */ + { + __cil_tmp234 = 512 << 2; + __cil_tmp235 = 1 << 14; + __cil_tmp236 = 7 << 16; + __cil_tmp237 = __cil_tmp236 | __cil_tmp235; } + switch_16_exp_5 : /* CIL Label */ + { + __cil_tmp238 = 512 << 2; + __cil_tmp239 = 1 << 14; + __cil_tmp240 = 45 << 16; + __cil_tmp241 = __cil_tmp240 | __cil_tmp239; } - } - } - } else { - - } - } - switch_16_exp_4: /* CIL Label */ - { - __cil_tmp234 = 512 << 2; - __cil_tmp235 = 1 << 14; - __cil_tmp236 = 7 << 16; - __cil_tmp237 = __cil_tmp236 | __cil_tmp235; - - } - switch_16_exp_5: /* CIL Label */ - { - __cil_tmp238 = 512 << 2; - __cil_tmp239 = 1 << 14; - __cil_tmp240 = 45 << 16; - __cil_tmp241 = __cil_tmp240 | __cil_tmp239; - - } - switch_16_exp_6: /* CIL Label */ ; - switch_16_exp_7: /* CIL Label */ - { - __cil_tmp242 = 9 << 2; - __cil_tmp243 = 7 << 16; - - } - { + switch_16_exp_6: /* CIL Label */; + switch_16_exp_7 : /* CIL Label */ + { + __cil_tmp242 = 9 << 2; + __cil_tmp243 = 7 << 16; + } + { #line 1267 - while (1) { - while_21_continue: /* CIL Label */ ; - goto while_21_break; - } - while_21_break: /* CIL Label */ ; - } - { + while (1) { + while_21_continue: /* CIL Label */; + goto while_21_break; + } + while_21_break: /* CIL Label */; + } + { #line 1269 - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - goto switch_16_break; - switch_16_exp_8: /* CIL Label */ - { - __cil_tmp244 = 768 << 2; - __cil_tmp245 = 7 << 16; - - } - switch_16_exp_9: /* CIL Label */ - { - __cil_tmp246 = 768 << 2; - __cil_tmp247 = 45 << 16; - - } - { + ntStatus = FlQueueIrpToThread( + Irp, disketteExtension); + } + goto switch_16_break; + switch_16_exp_8 : /* CIL Label */ + { + __cil_tmp244 = 768 << 2; + __cil_tmp245 = 7 << 16; + } + switch_16_exp_9 : /* CIL Label */ + { + __cil_tmp246 = 768 << 2; + __cil_tmp247 = 45 << 16; + } + { #line 1279 - while (1) { - while_22_continue: /* CIL Label */ ; - goto while_22_break; - } - while_22_break: /* CIL Label */ ; - } + while (1) { + while_22_continue: /* CIL Label */; + goto while_22_break; + } + while_22_break: /* CIL Label */; + } #line 1281 - __cil_tmp248 = (unsigned int )disketteExtension; + __cil_tmp248 = + (unsigned int)disketteExtension; #line 1281 - __cil_tmp249 = __cil_tmp248 + 174; + __cil_tmp249 = __cil_tmp248 + 174; #line 1281 - mem_535 = (UCHAR *)__cil_tmp249; + mem_535 = (UCHAR *)__cil_tmp249; #line 1281 - __cil_tmp250 = *mem_535; + __cil_tmp250 = *mem_535; #line 1281 - __cil_tmp251 = (int )__cil_tmp250; + __cil_tmp251 = (int)__cil_tmp250; #line 1281 - __cil_tmp252 = DriveMediaLimits + __cil_tmp251; + __cil_tmp252 = + DriveMediaLimits + __cil_tmp251; #line 1281 - __cil_tmp253 = (unsigned int )__cil_tmp252; + __cil_tmp253 = (unsigned int)__cil_tmp252; #line 1281 - __cil_tmp254 = __cil_tmp253 + 32; + __cil_tmp254 = __cil_tmp253 + 32; #line 1281 - mem_536 = (DRIVE_MEDIA_TYPE *)__cil_tmp254; + mem_536 = (DRIVE_MEDIA_TYPE *)__cil_tmp254; #line 1281 - lowestDriveMediaType = *mem_536; + lowestDriveMediaType = *mem_536; #line 1283 - __cil_tmp255 = (unsigned int )disketteExtension; + __cil_tmp255 = + (unsigned int)disketteExtension; #line 1283 - __cil_tmp256 = __cil_tmp255 + 174; + __cil_tmp256 = __cil_tmp255 + 174; #line 1283 - mem_537 = (UCHAR *)__cil_tmp256; + mem_537 = (UCHAR *)__cil_tmp256; #line 1283 - __cil_tmp257 = *mem_537; + __cil_tmp257 = *mem_537; #line 1283 - __cil_tmp258 = (int )__cil_tmp257; + __cil_tmp258 = (int)__cil_tmp257; #line 1283 - __cil_tmp259 = DriveMediaLimits + __cil_tmp258; + __cil_tmp259 = + DriveMediaLimits + __cil_tmp258; #line 1283 - mem_538 = (DRIVE_MEDIA_TYPE *)__cil_tmp259; + mem_538 = (DRIVE_MEDIA_TYPE *)__cil_tmp259; #line 1283 - highestDriveMediaType = *mem_538; + highestDriveMediaType = *mem_538; #line 1286 - __cil_tmp260 = (unsigned int )irpSp; + __cil_tmp260 = (unsigned int)irpSp; #line 1286 - __cil_tmp261 = __cil_tmp260 + 4; + __cil_tmp261 = __cil_tmp260 + 4; #line 1286 - mem_539 = (ULONG *)__cil_tmp261; + mem_539 = (ULONG *)__cil_tmp261; #line 1286 - outputBufferLength = *mem_539; - { + outputBufferLength = *mem_539; + { #line 1294 - __cil_tmp262 = (unsigned long )52U; + __cil_tmp262 = (unsigned long)52U; #line 1294 - if (outputBufferLength < __cil_tmp262) { - { + if (outputBufferLength < __cil_tmp262) { + { #line 1299 - while (1) { - while_23_continue: /* CIL Label */ ; - goto while_23_break; - } - while_23_break: /* CIL Label */ ; - } + while (1) { + while_23_continue: /* CIL Label */; + goto while_23_break; + } + while_23_break: /* CIL Label */; + } #line 1301 - ntStatus = -1073741789L; - goto switch_16_break; - } else { - - } - } + ntStatus = -1073741789L; + goto switch_16_break; + } else { + } + } #line 1311 - ntStatus = 0L; - { + ntStatus = 0L; + { #line 1313 - __cil_tmp263 = (int )lowestDriveMediaType; + __cil_tmp263 = (int)lowestDriveMediaType; #line 1313 - __cil_tmp264 = (int )highestDriveMediaType; + __cil_tmp264 = (int)highestDriveMediaType; #line 1313 - __cil_tmp265 = __cil_tmp264 - __cil_tmp263; + __cil_tmp265 = __cil_tmp264 - __cil_tmp263; #line 1313 - __cil_tmp266 = __cil_tmp265 + 1; + __cil_tmp266 = __cil_tmp265 + 1; #line 1313 - __cil_tmp267 = (unsigned int )__cil_tmp266; + __cil_tmp267 = (unsigned int)__cil_tmp266; #line 1313 - __cil_tmp268 = 52U * __cil_tmp267; + __cil_tmp268 = 52U * __cil_tmp267; #line 1313 - __cil_tmp269 = (unsigned long )__cil_tmp268; + __cil_tmp269 = (unsigned long)__cil_tmp268; #line 1313 - if (outputBufferLength < __cil_tmp269) { - { + if (outputBufferLength < __cil_tmp269) { + { #line 1324 - while (1) { - while_24_continue: /* CIL Label */ ; - goto while_24_break; - } - while_24_break: /* CIL Label */ ; - } + while (1) { + while_24_continue: /* CIL Label */; + goto while_24_break; + } + while_24_break: /* CIL Label */; + } #line 1326 - ntStatus = -2147483643L; + ntStatus = -2147483643L; #line 1328 - __cil_tmp270 = (unsigned long )52U; + __cil_tmp270 = (unsigned long)52U; #line 1328 - __cil_tmp271 = outputBufferLength / __cil_tmp270; + __cil_tmp271 = + outputBufferLength / __cil_tmp270; #line 1328 - __cil_tmp272 = (int )lowestDriveMediaType; + __cil_tmp272 = (int)lowestDriveMediaType; #line 1328 - __cil_tmp273 = __cil_tmp272 - 1; + __cil_tmp273 = __cil_tmp272 - 1; #line 1328 - __cil_tmp274 = (unsigned long )__cil_tmp273; + __cil_tmp274 = + (unsigned long)__cil_tmp273; #line 1328 - __cil_tmp275 = __cil_tmp274 + __cil_tmp271; + __cil_tmp275 = + __cil_tmp274 + __cil_tmp271; #line 1328 - highestDriveMediaType = (enum _DRIVE_MEDIA_TYPE )__cil_tmp275; - } else { - - } - } + highestDriveMediaType = + (enum _DRIVE_MEDIA_TYPE)__cil_tmp275; + } else { + } + } #line 1334 - __cil_tmp276 = (unsigned int )Irp; + __cil_tmp276 = (unsigned int)Irp; #line 1334 - __cil_tmp277 = __cil_tmp276 + 12; + __cil_tmp277 = __cil_tmp276 + 12; #line 1334 - mem_540 = (PVOID *)__cil_tmp277; + mem_540 = (PVOID *)__cil_tmp277; #line 1334 - __cil_tmp278 = *mem_540; + __cil_tmp278 = *mem_540; #line 1334 - outputBuffer = (struct _DISK_GEOMETRY *)__cil_tmp278; + outputBuffer = + (struct _DISK_GEOMETRY *)__cil_tmp278; #line 1336 - i = (unsigned char )lowestDriveMediaType; - { + i = (unsigned char)lowestDriveMediaType; + { #line 1336 - while (1) { - while_25_continue: /* CIL Label */ ; - { + while (1) { + while_25_continue: /* CIL Label */; + { #line 1336 - __cil_tmp279 = (unsigned char )highestDriveMediaType; + __cil_tmp279 = (unsigned char) + highestDriveMediaType; #line 1336 - __cil_tmp280 = (int )__cil_tmp279; + __cil_tmp280 = (int)__cil_tmp279; #line 1336 - __cil_tmp281 = (int )i; + __cil_tmp281 = (int)i; #line 1336 - if (__cil_tmp281 <= __cil_tmp280) { + if (__cil_tmp281 <= __cil_tmp280) { - } else { - goto while_25_break; - } - } + } else { + goto while_25_break; + } + } #line 1341 - __cil_tmp282 = (unsigned int )outputBuffer; + __cil_tmp282 = (unsigned int)outputBuffer; #line 1341 - __cil_tmp283 = __cil_tmp282 + 8; + __cil_tmp283 = __cil_tmp282 + 8; #line 1341 - __cil_tmp284 = (int )i; + __cil_tmp284 = (int)i; #line 1341 - __cil_tmp285 = DriveMediaConstants + __cil_tmp284; + __cil_tmp285 = + DriveMediaConstants + __cil_tmp284; #line 1341 - mem_541 = (MEDIA_TYPE *)__cil_tmp283; + mem_541 = (MEDIA_TYPE *)__cil_tmp283; #line 1341 - mem_542 = (MEDIA_TYPE *)__cil_tmp285; + mem_542 = (MEDIA_TYPE *)__cil_tmp285; #line 1341 - *mem_541 = *mem_542; + *mem_541 = *mem_542; #line 1342 - __cil_tmp286 = (int )i; + __cil_tmp286 = (int)i; #line 1342 - __cil_tmp287 = DriveMediaConstants + __cil_tmp286; + __cil_tmp287 = + DriveMediaConstants + __cil_tmp286; #line 1342 - __cil_tmp288 = (unsigned int )__cil_tmp287; + __cil_tmp288 = (unsigned int)__cil_tmp287; #line 1342 - __cil_tmp289 = __cil_tmp288 + 48; + __cil_tmp289 = __cil_tmp288 + 48; #line 1342 - mem_543 = (UCHAR *)__cil_tmp289; + mem_543 = (UCHAR *)__cil_tmp289; #line 1342 - __cil_tmp290 = *mem_543; + __cil_tmp290 = *mem_543; #line 1342 - __cil_tmp291 = (int )__cil_tmp290; + __cil_tmp291 = (int)__cil_tmp290; #line 1342 - __cil_tmp292 = __cil_tmp291 + 1; + __cil_tmp292 = __cil_tmp291 + 1; #line 1342 - mem_544 = (ULONG *)outputBuffer; + mem_544 = (ULONG *)outputBuffer; #line 1342 - *mem_544 = (unsigned long )__cil_tmp292; + *mem_544 = (unsigned long)__cil_tmp292; #line 1344 - __cil_tmp293 = 0 + 4; + __cil_tmp293 = 0 + 4; #line 1344 - __cil_tmp294 = 0 + __cil_tmp293; + __cil_tmp294 = 0 + __cil_tmp293; #line 1344 - __cil_tmp295 = (unsigned int )outputBuffer; + __cil_tmp295 = (unsigned int)outputBuffer; #line 1344 - __cil_tmp296 = __cil_tmp295 + __cil_tmp294; + __cil_tmp296 = + __cil_tmp295 + __cil_tmp294; #line 1344 - mem_545 = (LONG *)__cil_tmp296; + mem_545 = (LONG *)__cil_tmp296; #line 1344 - *mem_545 = 0L; + *mem_545 = 0L; #line 1345 - __cil_tmp297 = (unsigned int )outputBuffer; + __cil_tmp297 = (unsigned int)outputBuffer; #line 1345 - __cil_tmp298 = __cil_tmp297 + 40; + __cil_tmp298 = __cil_tmp297 + 40; #line 1345 - __cil_tmp299 = (int )i; + __cil_tmp299 = (int)i; #line 1345 - __cil_tmp300 = DriveMediaConstants + __cil_tmp299; + __cil_tmp300 = + DriveMediaConstants + __cil_tmp299; #line 1345 - __cil_tmp301 = (unsigned int )__cil_tmp300; + __cil_tmp301 = (unsigned int)__cil_tmp300; #line 1345 - __cil_tmp302 = __cil_tmp301 + 51; + __cil_tmp302 = __cil_tmp301 + 51; #line 1345 - mem_546 = (UCHAR *)__cil_tmp302; + mem_546 = (UCHAR *)__cil_tmp302; #line 1345 - __cil_tmp303 = *mem_546; + __cil_tmp303 = *mem_546; #line 1345 - mem_547 = (ULONG *)__cil_tmp298; + mem_547 = (ULONG *)__cil_tmp298; #line 1345 - *mem_547 = (unsigned long )__cil_tmp303; + *mem_547 = (unsigned long)__cil_tmp303; #line 1347 - __cil_tmp304 = (unsigned int )outputBuffer; + __cil_tmp304 = (unsigned int)outputBuffer; #line 1347 - __cil_tmp305 = __cil_tmp304 + 44; + __cil_tmp305 = __cil_tmp304 + 44; #line 1347 - __cil_tmp306 = (int )i; + __cil_tmp306 = (int)i; #line 1347 - __cil_tmp307 = DriveMediaConstants + __cil_tmp306; + __cil_tmp307 = + DriveMediaConstants + __cil_tmp306; #line 1347 - __cil_tmp308 = (unsigned int )__cil_tmp307; + __cil_tmp308 = (unsigned int)__cil_tmp307; #line 1347 - __cil_tmp309 = __cil_tmp308 + 38; + __cil_tmp309 = __cil_tmp308 + 38; #line 1347 - mem_548 = (UCHAR *)__cil_tmp309; + mem_548 = (UCHAR *)__cil_tmp309; #line 1347 - __cil_tmp310 = *mem_548; + __cil_tmp310 = *mem_548; #line 1347 - mem_549 = (ULONG *)__cil_tmp305; + mem_549 = (ULONG *)__cil_tmp305; #line 1347 - *mem_549 = (unsigned long )__cil_tmp310; + *mem_549 = (unsigned long)__cil_tmp310; #line 1349 - __cil_tmp311 = (unsigned int )outputBuffer; + __cil_tmp311 = (unsigned int)outputBuffer; #line 1349 - __cil_tmp312 = __cil_tmp311 + 48; + __cil_tmp312 = __cil_tmp311 + 48; #line 1349 - __cil_tmp313 = (int )i; + __cil_tmp313 = (int)i; #line 1349 - __cil_tmp314 = DriveMediaConstants + __cil_tmp313; + __cil_tmp314 = + DriveMediaConstants + __cil_tmp313; #line 1349 - __cil_tmp315 = (unsigned int )__cil_tmp314; + __cil_tmp315 = (unsigned int)__cil_tmp314; #line 1349 - __cil_tmp316 = __cil_tmp315 + 36; + __cil_tmp316 = __cil_tmp315 + 36; #line 1349 - mem_550 = (USHORT *)__cil_tmp316; + mem_550 = (USHORT *)__cil_tmp316; #line 1349 - __cil_tmp317 = *mem_550; + __cil_tmp317 = *mem_550; #line 1349 - mem_551 = (ULONG *)__cil_tmp312; + mem_551 = (ULONG *)__cil_tmp312; #line 1349 - *mem_551 = (unsigned long )__cil_tmp317; - { + *mem_551 = (unsigned long)__cil_tmp317; + { #line 1367 - while (1) { - while_26_continue: /* CIL Label */ ; - goto while_26_break; - } - while_26_break: /* CIL Label */ ; - } + while (1) { + while_26_continue: /* CIL Label */; + goto while_26_break; + } + while_26_break: /* CIL Label */; + } #line 1368 - outputBuffer = outputBuffer + 1; + outputBuffer = outputBuffer + 1; #line 1370 - __cil_tmp318 = 24 + 4; + __cil_tmp318 = 24 + 4; #line 1370 - __cil_tmp319 = (unsigned int )Irp; + __cil_tmp319 = (unsigned int)Irp; #line 1370 - __cil_tmp320 = __cil_tmp319 + __cil_tmp318; + __cil_tmp320 = + __cil_tmp319 + __cil_tmp318; #line 1370 - __cil_tmp321 = (unsigned long )52U; + __cil_tmp321 = (unsigned long)52U; #line 1370 - __cil_tmp322 = 24 + 4; + __cil_tmp322 = 24 + 4; #line 1370 - __cil_tmp323 = (unsigned int )Irp; + __cil_tmp323 = (unsigned int)Irp; #line 1370 - __cil_tmp324 = __cil_tmp323 + __cil_tmp322; + __cil_tmp324 = + __cil_tmp323 + __cil_tmp322; #line 1370 - mem_552 = (ULONG_PTR *)__cil_tmp324; + mem_552 = (ULONG_PTR *)__cil_tmp324; #line 1370 - __cil_tmp325 = *mem_552; + __cil_tmp325 = *mem_552; #line 1370 - mem_553 = (ULONG_PTR *)__cil_tmp320; + mem_553 = (ULONG_PTR *)__cil_tmp320; #line 1370 - *mem_553 = __cil_tmp325 + __cil_tmp321; + *mem_553 = __cil_tmp325 + __cil_tmp321; #line 1336 - __cil_tmp326 = (int )i; + __cil_tmp326 = (int)i; #line 1336 - __cil_tmp327 = __cil_tmp326 + 1; + __cil_tmp327 = __cil_tmp326 + 1; #line 1336 - i = (unsigned char )__cil_tmp327; - } - while_25_break: /* CIL Label */ ; - } - goto switch_16_break; - switch_16_exp_10: /* CIL Label */ - { - __cil_tmp328 = 3 << 2; - __cil_tmp329 = (unsigned long )__cil_tmp328; - __cil_tmp330 = 77UL << 16; - - } - { + i = (unsigned char)__cil_tmp327; + } + while_25_break: /* CIL Label */; + } + goto switch_16_break; + switch_16_exp_10 : /* CIL Label */ + { + __cil_tmp328 = 3 << 2; + __cil_tmp329 = (unsigned long)__cil_tmp328; + __cil_tmp330 = 77UL << 16; + } + { #line 1378 - __cil_tmp331 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp331 = + (KUSER_SHARED_DATA * const)4292804608U; #line 1378 - __cil_tmp332 = (unsigned int )__cil_tmp331; + __cil_tmp332 = (unsigned int)__cil_tmp331; #line 1378 - __cil_tmp333 = __cil_tmp332 + 732; + __cil_tmp333 = __cil_tmp332 + 732; #line 1378 - mem_554 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp333; + mem_554 = (ALTERNATIVE_ARCHITECTURE_TYPE *) + __cil_tmp333; #line 1378 - __cil_tmp334 = *mem_554; + __cil_tmp334 = *mem_554; #line 1378 - __cil_tmp335 = (int )__cil_tmp334; + __cil_tmp335 = (int)__cil_tmp334; #line 1378 - if (__cil_tmp335 == 1) { - { + if (__cil_tmp335 == 1) { + { #line 1387 - while (1) { - while_27_continue: /* CIL Label */ ; - goto while_27_break; - } - while_27_break: /* CIL Label */ ; - } - { + while (1) { + while_27_continue: /* CIL Label */; + goto while_27_break; + } + while_27_break: /* CIL Label */; + } + { #line 1389 - __cil_tmp336 = (unsigned int )DeviceObject; + __cil_tmp336 = + (unsigned int)DeviceObject; #line 1389 - __cil_tmp337 = __cil_tmp336 + 32; + __cil_tmp337 = __cil_tmp336 + 32; #line 1389 - mem_555 = (ULONG *)__cil_tmp337; + mem_555 = (ULONG *)__cil_tmp337; #line 1389 - __cil_tmp338 = *mem_555; + __cil_tmp338 = *mem_555; #line 1389 - __cil_tmp339 = __cil_tmp338 & 1UL; + __cil_tmp339 = __cil_tmp338 & 1UL; #line 1389 - if (! __cil_tmp339) { + if (!__cil_tmp339) { #line 1391 - ntStatus = -1073741275L; - goto switch_16_break; - } else { - - } - } - { + ntStatus = -1073741275L; + goto switch_16_break; + } else { + } + } + { #line 1395 - __cil_tmp340 = (unsigned long )6U; + __cil_tmp340 = (unsigned long)6U; #line 1395 - __cil_tmp341 = (unsigned int )irpSp; + __cil_tmp341 = (unsigned int)irpSp; #line 1395 - __cil_tmp342 = __cil_tmp341 + 4; + __cil_tmp342 = __cil_tmp341 + 4; #line 1395 - mem_556 = (ULONG *)__cil_tmp342; + mem_556 = (ULONG *)__cil_tmp342; #line 1395 - __cil_tmp343 = *mem_556; + __cil_tmp343 = *mem_556; #line 1395 - if (__cil_tmp343 < __cil_tmp340) { + if (__cil_tmp343 < __cil_tmp340) { #line 1398 - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - } - { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + } + { #line 1402 - __cil_tmp344 = (enum _POOL_TYPE )1; + __cil_tmp344 = (enum _POOL_TYPE)1; #line 1402 - __cil_tmp345 = 2U * 64U; + __cil_tmp345 = 2U * 64U; #line 1402 - __cil_tmp346 = (unsigned long )__cil_tmp345; + __cil_tmp346 = + (unsigned long)__cil_tmp345; #line 1402 - tmp___1 = ExAllocatePoolWithTag(__cil_tmp344, __cil_tmp346, - 1886350406UL); + tmp___1 = ExAllocatePoolWithTag( + __cil_tmp344, __cil_tmp346, + 1886350406UL); #line 1402 - valueName = (WCHAR *)tmp___1; - } + valueName = (WCHAR *)tmp___1; + } #line 1404 - if (! valueName) { + if (!valueName) { #line 1405 - ntStatus = -1073741670L; - goto switch_16_break; - } else { - - } - { + ntStatus = -1073741670L; + goto switch_16_break; + } else { + } + { #line 1409 - __cil_tmp347 = (void *)valueName; + __cil_tmp347 = (void *)valueName; #line 1409 - __cil_tmp348 = 2U * 64U; + __cil_tmp348 = 2U * 64U; #line 1409 - memset(__cil_tmp347, 0, __cil_tmp348); + memset(__cil_tmp347, 0, __cil_tmp348); #line 1412 - __cil_tmp349 = (void *)valueName; + __cil_tmp349 = (void *)valueName; #line 1412 - __cil_tmp350 = 368 + 4; + __cil_tmp350 = 368 + 4; #line 1412 - __cil_tmp351 = (unsigned int )disketteExtension; + __cil_tmp351 = + (unsigned int)disketteExtension; #line 1412 - __cil_tmp352 = __cil_tmp351 + __cil_tmp350; + __cil_tmp352 = + __cil_tmp351 + __cil_tmp350; #line 1412 - mem_557 = (PWSTR *)__cil_tmp352; + mem_557 = (PWSTR *)__cil_tmp352; #line 1412 - __cil_tmp353 = *mem_557; + __cil_tmp353 = *mem_557; #line 1412 - __cil_tmp354 = (void const *)__cil_tmp353; + __cil_tmp354 = + (void const *)__cil_tmp353; #line 1412 - __cil_tmp355 = (unsigned int )disketteExtension; + __cil_tmp355 = + (unsigned int)disketteExtension; #line 1412 - __cil_tmp356 = __cil_tmp355 + 368; + __cil_tmp356 = __cil_tmp355 + 368; #line 1412 - mem_558 = (USHORT *)__cil_tmp356; + mem_558 = (USHORT *)__cil_tmp356; #line 1412 - __cil_tmp357 = *mem_558; + __cil_tmp357 = *mem_558; #line 1412 - __cil_tmp358 = (unsigned int )__cil_tmp357; + __cil_tmp358 = + (unsigned int)__cil_tmp357; #line 1412 - memcpy(__cil_tmp349, __cil_tmp354, __cil_tmp358); + memcpy(__cil_tmp349, __cil_tmp354, + __cil_tmp358); #line 1414 - __cil_tmp359 = (unsigned int )(& driveLetterName) + 4; + __cil_tmp359 = + (unsigned int)(&driveLetterName) + + 4; #line 1414 - __cil_tmp360 = 0 * 2U; + __cil_tmp360 = 0 * 2U; #line 1414 - __cil_tmp361 = (unsigned int )(driveLetterNameBuffer) + __cil_tmp360; + __cil_tmp361 = + (unsigned int)(driveLetterNameBuffer) + + __cil_tmp360; #line 1414 - mem_559 = (PWSTR *)__cil_tmp359; + mem_559 = (PWSTR *)__cil_tmp359; #line 1414 - *mem_559 = (WCHAR *)__cil_tmp361; + *mem_559 = (WCHAR *)__cil_tmp361; #line 1415 - __cil_tmp362 = (unsigned int )(& driveLetterName) + 2; + __cil_tmp362 = + (unsigned int)(&driveLetterName) + + 2; #line 1415 - mem_560 = (USHORT *)__cil_tmp362; + mem_560 = (USHORT *)__cil_tmp362; #line 1415 - *mem_560 = (unsigned short)20; + *mem_560 = (unsigned short)20; #line 1416 - __cil_tmp363 = & driveLetterName; + __cil_tmp363 = &driveLetterName; #line 1416 - mem_561 = (USHORT *)__cil_tmp363; + mem_561 = (USHORT *)__cil_tmp363; #line 1416 - *mem_561 = (unsigned short)0; + *mem_561 = (unsigned short)0; #line 1418 - __cil_tmp364 = 0 * 28U; + __cil_tmp364 = 0 * 28U; #line 1418 - __cil_tmp365 = (unsigned int )(queryTable) + __cil_tmp364; + __cil_tmp365 = + (unsigned int)(queryTable) + + __cil_tmp364; #line 1418 - __cil_tmp366 = (RTL_QUERY_REGISTRY_TABLE *)__cil_tmp365; + __cil_tmp366 = + (RTL_QUERY_REGISTRY_TABLE *) + __cil_tmp365; #line 1418 - __cil_tmp367 = (void *)__cil_tmp366; + __cil_tmp367 = (void *)__cil_tmp366; #line 1418 - __cil_tmp368 = 2U * 28U; + __cil_tmp368 = 2U * 28U; #line 1418 - memset(__cil_tmp367, 0, __cil_tmp368); + memset(__cil_tmp367, 0, __cil_tmp368); #line 1419 - __cil_tmp369 = 0 * 28U; + __cil_tmp369 = 0 * 28U; #line 1419 - __cil_tmp370 = __cil_tmp369 + 4; + __cil_tmp370 = __cil_tmp369 + 4; #line 1419 - __cil_tmp371 = (unsigned int )(queryTable) + __cil_tmp370; + __cil_tmp371 = + (unsigned int)(queryTable) + + __cil_tmp370; #line 1419 - mem_562 = (ULONG *)__cil_tmp371; + mem_562 = (ULONG *)__cil_tmp371; #line 1419 - *mem_562 = 36UL; + *mem_562 = 36UL; #line 1421 - __cil_tmp372 = 0 * 28U; + __cil_tmp372 = 0 * 28U; #line 1421 - __cil_tmp373 = __cil_tmp372 + 8; + __cil_tmp373 = __cil_tmp372 + 8; #line 1421 - __cil_tmp374 = (unsigned int )(queryTable) + __cil_tmp373; + __cil_tmp374 = + (unsigned int)(queryTable) + + __cil_tmp373; #line 1421 - mem_563 = (PWSTR *)__cil_tmp374; + mem_563 = (PWSTR *)__cil_tmp374; #line 1421 - *mem_563 = valueName; + *mem_563 = valueName; #line 1422 - __cil_tmp375 = 0 * 28U; + __cil_tmp375 = 0 * 28U; #line 1422 - __cil_tmp376 = __cil_tmp375 + 12; + __cil_tmp376 = __cil_tmp375 + 12; #line 1422 - __cil_tmp377 = (unsigned int )(queryTable) + __cil_tmp376; + __cil_tmp377 = + (unsigned int)(queryTable) + + __cil_tmp376; #line 1422 - mem_564 = (PVOID *)__cil_tmp377; + mem_564 = (PVOID *)__cil_tmp377; #line 1422 - *mem_564 = (void *)(& driveLetterName); + *mem_564 = (void *)(&driveLetterName); #line 1424 - __cil_tmp378 = (WCHAR const *)"\\\000R\000e\000g\000i\000s\000t\000r\000y\000\\\000M\000a\000c\000h\000i\000n\000e\000\\\000S\000y\000s\000t\000e\000m\000\\\000D\000I\000S\000K\000"; + __cil_tmp378 = + (WCHAR const + *)"\\\000R\000e\000g\000i\000s" + "\000t\000r\000y\000\\\000M" + "\000a\000c\000h\000i\000n" + "\000e\000\\\000S\000y\000s" + "\000t\000e\000m\000\\\000D" + "\000I\000S\000K\000"; #line 1424 - __cil_tmp379 = 0 * 28U; + __cil_tmp379 = 0 * 28U; #line 1424 - __cil_tmp380 = (unsigned int )(queryTable) + __cil_tmp379; + __cil_tmp380 = + (unsigned int)(queryTable) + + __cil_tmp379; #line 1424 - __cil_tmp381 = (RTL_QUERY_REGISTRY_TABLE *)__cil_tmp380; + __cil_tmp381 = + (RTL_QUERY_REGISTRY_TABLE *) + __cil_tmp380; #line 1424 - __cil_tmp382 = (void *)0; + __cil_tmp382 = (void *)0; #line 1424 - __cil_tmp383 = (void *)0; + __cil_tmp383 = (void *)0; #line 1424 - ntStatus = RtlQueryRegistryValues(0UL, __cil_tmp378, - __cil_tmp381, __cil_tmp382, - __cil_tmp383); - } - { + ntStatus = RtlQueryRegistryValues( + 0UL, __cil_tmp378, __cil_tmp381, + __cil_tmp382, __cil_tmp383); + } + { #line 1428 - __cil_tmp384 = ntStatus >= 0L; + __cil_tmp384 = ntStatus >= 0L; #line 1428 - if (! __cil_tmp384) { - { + if (!__cil_tmp384) { + { #line 1429 - __cil_tmp385 = (void *)valueName; + __cil_tmp385 = (void *)valueName; #line 1429 - ExFreePool(__cil_tmp385); - } - goto switch_16_break; - } else { - - } - } - { + ExFreePool(__cil_tmp385); + } + goto switch_16_break; + } else { + } + } + { #line 1433 - __cil_tmp386 = & driveLetterName; + __cil_tmp386 = &driveLetterName; #line 1433 - mem_565 = (USHORT *)__cil_tmp386; + mem_565 = (USHORT *)__cil_tmp386; #line 1433 - __cil_tmp387 = *mem_565; + __cil_tmp387 = *mem_565; #line 1433 - __cil_tmp388 = (int )__cil_tmp387; + __cil_tmp388 = (int)__cil_tmp387; #line 1433 - if (__cil_tmp388 != 4) { - { + if (__cil_tmp388 != 4) { + { #line 1438 - ntStatus = -1073741275L; + ntStatus = -1073741275L; #line 1439 - __cil_tmp389 = (void *)valueName; + __cil_tmp389 = (void *)valueName; #line 1439 - ExFreePool(__cil_tmp389); - } - goto switch_16_break; - } else { - { + ExFreePool(__cil_tmp389); + } + goto switch_16_break; + } else { + { #line 1433 - __cil_tmp390 = (unsigned int )(& driveLetterName) + 4; + __cil_tmp390 = + (unsigned int)(&driveLetterName) + + 4; #line 1433 - mem_566 = (PWSTR *)__cil_tmp390; + mem_566 = (PWSTR *)__cil_tmp390; #line 1433 - __cil_tmp391 = *mem_566; + __cil_tmp391 = *mem_566; #line 1433 - __cil_tmp392 = __cil_tmp391 + 0; + __cil_tmp392 = __cil_tmp391 + 0; #line 1433 - __cil_tmp393 = *__cil_tmp392; + __cil_tmp393 = *__cil_tmp392; #line 1433 - __cil_tmp394 = (int )__cil_tmp393; + __cil_tmp394 = (int)__cil_tmp393; #line 1433 - if (__cil_tmp394 < 65) { - { + if (__cil_tmp394 < 65) { + { #line 1438 - ntStatus = -1073741275L; + ntStatus = -1073741275L; #line 1439 - __cil_tmp395 = (void *)valueName; + __cil_tmp395 = + (void *)valueName; #line 1439 - ExFreePool(__cil_tmp395); - } - goto switch_16_break; - } else { - { + ExFreePool(__cil_tmp395); + } + goto switch_16_break; + } else { + { #line 1433 - __cil_tmp396 = (unsigned int )(& driveLetterName) + 4; + __cil_tmp396 = + (unsigned int)(&driveLetterName) + + 4; #line 1433 - mem_567 = (PWSTR *)__cil_tmp396; + mem_567 = (PWSTR *)__cil_tmp396; #line 1433 - __cil_tmp397 = *mem_567; + __cil_tmp397 = *mem_567; #line 1433 - __cil_tmp398 = __cil_tmp397 + 0; + __cil_tmp398 = __cil_tmp397 + 0; #line 1433 - __cil_tmp399 = *__cil_tmp398; + __cil_tmp399 = *__cil_tmp398; #line 1433 - __cil_tmp400 = (int )__cil_tmp399; + __cil_tmp400 = + (int)__cil_tmp399; #line 1433 - if (__cil_tmp400 > 90) { - { + if (__cil_tmp400 > 90) { + { #line 1438 - ntStatus = -1073741275L; + ntStatus = -1073741275L; #line 1439 - __cil_tmp401 = (void *)valueName; + __cil_tmp401 = + (void *)valueName; #line 1439 - ExFreePool(__cil_tmp401); - } - goto switch_16_break; - } else { - { + ExFreePool(__cil_tmp401); + } + goto switch_16_break; + } else { + { #line 1433 - __cil_tmp402 = (unsigned int )(& driveLetterName) + 4; + __cil_tmp402 = + (unsigned int)(&driveLetterName) + + 4; #line 1433 - mem_568 = (PWSTR *)__cil_tmp402; + mem_568 = + (PWSTR *)__cil_tmp402; #line 1433 - __cil_tmp403 = *mem_568; + __cil_tmp403 = *mem_568; #line 1433 - __cil_tmp404 = __cil_tmp403 + 1; + __cil_tmp404 = + __cil_tmp403 + 1; #line 1433 - __cil_tmp405 = *__cil_tmp404; + __cil_tmp405 = + *__cil_tmp404; #line 1433 - __cil_tmp406 = (int )__cil_tmp405; + __cil_tmp406 = + (int)__cil_tmp405; #line 1433 - if (__cil_tmp406 != 58) { - { + if (__cil_tmp406 != 58) { + { #line 1438 - ntStatus = -1073741275L; + ntStatus = -1073741275L; #line 1439 - __cil_tmp407 = (void *)valueName; + __cil_tmp407 = + (void *)valueName; #line 1439 - ExFreePool(__cil_tmp407); + ExFreePool( + __cil_tmp407); + } + goto switch_16_break; + } else { + } + } + } + } + } + } + } } - goto switch_16_break; - } else { - - } - } - } - } - } - } - } - } #line 1443 - __cil_tmp408 = (unsigned int )Irp; + __cil_tmp408 = (unsigned int)Irp; #line 1443 - __cil_tmp409 = __cil_tmp408 + 12; + __cil_tmp409 = __cil_tmp408 + 12; #line 1443 - mem_569 = (PVOID *)__cil_tmp409; + mem_569 = (PVOID *)__cil_tmp409; #line 1443 - __cil_tmp410 = *mem_569; + __cil_tmp410 = *mem_569; #line 1443 - suggestedName = (struct _MOUNTDEV_SUGGESTED_LINK_NAME *)__cil_tmp410; + suggestedName = + (struct _MOUNTDEV_SUGGESTED_LINK_NAME + *)__cil_tmp410; #line 1444 - mem_570 = (BOOLEAN *)suggestedName; + mem_570 = (BOOLEAN *)suggestedName; #line 1444 - *mem_570 = (unsigned char)1; + *mem_570 = (unsigned char)1; #line 1445 - __cil_tmp411 = (unsigned int )suggestedName; + __cil_tmp411 = + (unsigned int)suggestedName; #line 1445 - __cil_tmp412 = __cil_tmp411 + 2; + __cil_tmp412 = __cil_tmp411 + 2; #line 1445 - mem_571 = (USHORT *)__cil_tmp412; + mem_571 = (USHORT *)__cil_tmp412; #line 1445 - *mem_571 = (unsigned short)28; + *mem_571 = (unsigned short)28; #line 1447 - __cil_tmp413 = 24 + 4; + __cil_tmp413 = 24 + 4; #line 1447 - __cil_tmp414 = (unsigned int )Irp; + __cil_tmp414 = (unsigned int)Irp; #line 1447 - __cil_tmp415 = __cil_tmp414 + __cil_tmp413; + __cil_tmp415 = + __cil_tmp414 + __cil_tmp413; #line 1447 - __cil_tmp416 = (MOUNTDEV_SUGGESTED_LINK_NAME *)0; + __cil_tmp416 = + (MOUNTDEV_SUGGESTED_LINK_NAME *)0; #line 1447 - __cil_tmp417 = (unsigned int )__cil_tmp416; + __cil_tmp417 = (unsigned int)__cil_tmp416; #line 1447 - __cil_tmp418 = __cil_tmp417 + 4; + __cil_tmp418 = __cil_tmp417 + 4; #line 1447 - __cil_tmp419 = (WCHAR (*)[1])__cil_tmp418; + __cil_tmp419 = (WCHAR(*)[1])__cil_tmp418; #line 1447 - __cil_tmp420 = (long )__cil_tmp419; + __cil_tmp420 = (long)__cil_tmp419; #line 1447 - __cil_tmp421 = __cil_tmp420 + 28L; + __cil_tmp421 = __cil_tmp420 + 28L; #line 1447 - mem_572 = (ULONG_PTR *)__cil_tmp415; + mem_572 = (ULONG_PTR *)__cil_tmp415; #line 1447 - *mem_572 = (unsigned long )__cil_tmp421; - { + *mem_572 = (unsigned long)__cil_tmp421; + { #line 1450 - __cil_tmp422 = 24 + 4; + __cil_tmp422 = 24 + 4; #line 1450 - __cil_tmp423 = (unsigned int )Irp; + __cil_tmp423 = (unsigned int)Irp; #line 1450 - __cil_tmp424 = __cil_tmp423 + __cil_tmp422; + __cil_tmp424 = + __cil_tmp423 + __cil_tmp422; #line 1450 - mem_573 = (ULONG_PTR *)__cil_tmp424; + mem_573 = (ULONG_PTR *)__cil_tmp424; #line 1450 - __cil_tmp425 = *mem_573; + __cil_tmp425 = *mem_573; #line 1450 - __cil_tmp426 = (unsigned int )irpSp; + __cil_tmp426 = (unsigned int)irpSp; #line 1450 - __cil_tmp427 = __cil_tmp426 + 4; + __cil_tmp427 = __cil_tmp426 + 4; #line 1450 - mem_574 = (ULONG *)__cil_tmp427; + mem_574 = (ULONG *)__cil_tmp427; #line 1450 - __cil_tmp428 = *mem_574; + __cil_tmp428 = *mem_574; #line 1450 - if (__cil_tmp428 < __cil_tmp425) { - { + if (__cil_tmp428 < __cil_tmp425) { + { #line 1453 - __cil_tmp429 = 24 + 4; + __cil_tmp429 = 24 + 4; #line 1453 - __cil_tmp430 = (unsigned int )Irp; + __cil_tmp430 = (unsigned int)Irp; #line 1453 - __cil_tmp431 = __cil_tmp430 + __cil_tmp429; + __cil_tmp431 = + __cil_tmp430 + __cil_tmp429; #line 1453 - mem_575 = (ULONG_PTR *)__cil_tmp431; + mem_575 = (ULONG_PTR *)__cil_tmp431; #line 1453 - *mem_575 = (unsigned long )6U; + *mem_575 = (unsigned long)6U; #line 1455 - ntStatus = -2147483643L; + ntStatus = -2147483643L; #line 1456 - __cil_tmp432 = (void *)valueName; + __cil_tmp432 = (void *)valueName; #line 1456 - ExFreePool(__cil_tmp432); - } - goto switch_16_break; - } else { - - } - } - { + ExFreePool(__cil_tmp432); + } + goto switch_16_break; + } else { + } + } + { #line 1460 - __cil_tmp433 = (WCHAR const *)"\\\000R\000e\000g\000i\000s\000t\000r\000y\000\\\000M\000a\000c\000h\000i\000n\000e\000\\\000S\000y\000s\000t\000e\000m\000\\\000D\000I\000S\000K\000"; + __cil_tmp433 = + (WCHAR const + *)"\\\000R\000e\000g\000i\000s" + "\000t\000r\000y\000\\\000M" + "\000a\000c\000h\000i\000n" + "\000e\000\\\000S\000y\000s" + "\000t\000e\000m\000\\\000D" + "\000I\000S\000K\000"; #line 1460 - __cil_tmp434 = (WCHAR const *)valueName; + __cil_tmp434 = (WCHAR const *)valueName; #line 1460 - RtlDeleteRegistryValue(0UL, __cil_tmp433, __cil_tmp434); + RtlDeleteRegistryValue( + 0UL, __cil_tmp433, __cil_tmp434); #line 1464 - __cil_tmp435 = (void *)valueName; + __cil_tmp435 = (void *)valueName; #line 1464 - ExFreePool(__cil_tmp435); + ExFreePool(__cil_tmp435); #line 1466 - __cil_tmp436 = 0 * 2U; + __cil_tmp436 = 0 * 2U; #line 1466 - __cil_tmp437 = 4 + __cil_tmp436; + __cil_tmp437 = 4 + __cil_tmp436; #line 1466 - __cil_tmp438 = (unsigned int )suggestedName; + __cil_tmp438 = + (unsigned int)suggestedName; #line 1466 - __cil_tmp439 = __cil_tmp438 + __cil_tmp437; + __cil_tmp439 = + __cil_tmp438 + __cil_tmp437; #line 1466 - __cil_tmp440 = (WCHAR *)__cil_tmp439; + __cil_tmp440 = (WCHAR *)__cil_tmp439; #line 1466 - __cil_tmp441 = (void *)__cil_tmp440; + __cil_tmp441 = (void *)__cil_tmp440; #line 1466 - __cil_tmp442 = (void const *)"\\\000D\000o\000s\000D\000e\000v\000i\000c\000e\000s\000\\\000"; + __cil_tmp442 = + (void const *)"\\\000D\000o\000s" + "\000D\000e\000v\000i" + "\000c\000e\000s\000" + "\\\000"; #line 1466 - memcpy(__cil_tmp441, __cil_tmp442, 24U); + memcpy(__cil_tmp441, __cil_tmp442, 24U); #line 1467 - __cil_tmp443 = 12 * 2U; + __cil_tmp443 = 12 * 2U; #line 1467 - __cil_tmp444 = 4 + __cil_tmp443; + __cil_tmp444 = 4 + __cil_tmp443; #line 1467 - __cil_tmp445 = (unsigned int )suggestedName; + __cil_tmp445 = + (unsigned int)suggestedName; #line 1467 - __cil_tmp446 = __cil_tmp445 + __cil_tmp444; + __cil_tmp446 = + __cil_tmp445 + __cil_tmp444; #line 1467 - __cil_tmp447 = (unsigned int )(& driveLetterName) + 4; + __cil_tmp447 = + (unsigned int)(&driveLetterName) + + 4; #line 1467 - mem_576 = (PWSTR *)__cil_tmp447; + mem_576 = (PWSTR *)__cil_tmp447; #line 1467 - __cil_tmp448 = *mem_576; + __cil_tmp448 = *mem_576; #line 1467 - __cil_tmp449 = __cil_tmp448 + 0; + __cil_tmp449 = __cil_tmp448 + 0; #line 1467 - mem_577 = (WCHAR *)__cil_tmp446; + mem_577 = (WCHAR *)__cil_tmp446; #line 1467 - *mem_577 = *__cil_tmp449; + *mem_577 = *__cil_tmp449; #line 1468 - __cil_tmp450 = 13 * 2U; + __cil_tmp450 = 13 * 2U; #line 1468 - __cil_tmp451 = 4 + __cil_tmp450; + __cil_tmp451 = 4 + __cil_tmp450; #line 1468 - __cil_tmp452 = (unsigned int )suggestedName; + __cil_tmp452 = + (unsigned int)suggestedName; #line 1468 - __cil_tmp453 = __cil_tmp452 + __cil_tmp451; + __cil_tmp453 = + __cil_tmp452 + __cil_tmp451; #line 1468 - mem_578 = (WCHAR *)__cil_tmp453; + mem_578 = (WCHAR *)__cil_tmp453; #line 1468 - *mem_578 = (unsigned short )':'; - } - goto switch_16_break; - } else { - - } - } - switch_16_exp_11: /* CIL Label */ - { - __cil_tmp454 = 248 << 2; - __cil_tmp455 = 7 << 16; - - } - { + *mem_578 = (unsigned short)':'; + } + goto switch_16_break; + } else { + } + } + switch_16_exp_11 : /* CIL Label */ + { + __cil_tmp454 = 248 << 2; + __cil_tmp455 = 7 << 16; + } + { #line 1478 - __cil_tmp456 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp456 = + (KUSER_SHARED_DATA * const)4292804608U; #line 1478 - __cil_tmp457 = (unsigned int )__cil_tmp456; + __cil_tmp457 = (unsigned int)__cil_tmp456; #line 1478 - __cil_tmp458 = __cil_tmp457 + 732; + __cil_tmp458 = __cil_tmp457 + 732; #line 1478 - mem_579 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp458; + mem_579 = (ALTERNATIVE_ARCHITECTURE_TYPE *) + __cil_tmp458; #line 1478 - __cil_tmp459 = *mem_579; + __cil_tmp459 = *mem_579; #line 1478 - __cil_tmp460 = (int )__cil_tmp459; + __cil_tmp460 = (int)__cil_tmp459; #line 1478 - if (__cil_tmp460 == 1) { - { + if (__cil_tmp460 == 1) { + { #line 1482 - while (1) { - while_28_continue: /* CIL Label */ ; - goto while_28_break; - } - while_28_break: /* CIL Label */ ; - } - { + while (1) { + while_28_continue: /* CIL Label */; + goto while_28_break; + } + while_28_break: /* CIL Label */; + } + { #line 1488 - __cil_tmp461 = (unsigned long )1U; + __cil_tmp461 = (unsigned long)1U; #line 1488 - __cil_tmp462 = (unsigned int )irpSp; + __cil_tmp462 = (unsigned int)irpSp; #line 1488 - __cil_tmp463 = __cil_tmp462 + 4; + __cil_tmp463 = __cil_tmp462 + 4; #line 1488 - mem_580 = (ULONG *)__cil_tmp463; + mem_580 = (ULONG *)__cil_tmp463; #line 1488 - __cil_tmp464 = *mem_580; + __cil_tmp464 = *mem_580; #line 1488 - if (__cil_tmp464 < __cil_tmp461) { - { + if (__cil_tmp464 < __cil_tmp461) { + { #line 1494 - while (1) { - while_29_continue: /* CIL Label */ ; - goto while_29_break; - } - while_29_break: /* CIL Label */ ; - } + while (1) { + while_29_continue: /* CIL Label */; + goto while_29_break; + } + while_29_break: /* CIL Label */; + } #line 1496 - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - } - { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + } + { #line 1507 - while (1) { - while_30_continue: /* CIL Label */ ; - goto while_30_break; - } - while_30_break: /* CIL Label */ ; - } - { + while (1) { + while_30_continue: /* CIL Label */; + goto while_30_break; + } + while_30_break: /* CIL Label */; + } + { #line 1510 - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - goto switch_16_break; - } else { - - } - } - switch_16_default: /* CIL Label */ ; + ntStatus = FlQueueIrpToThread( + Irp, disketteExtension); + } + goto switch_16_break; + } else { + } + } + switch_16_default: /* CIL Label */; #line 1533 - if (s == 1) { + if (s == 1) { #line 1533 - s = 3; - } else { - { + s = 3; + } else { + { #line 1534 - __VERIFIER_assert(0); - } - } - { + __VERIFIER_assert(0); + } + } + { #line 1535 - __cil_tmp465 = (unsigned int )Irp; + __cil_tmp465 = (unsigned int)Irp; #line 1535 - __cil_tmp466 = __cil_tmp465 + 35; + __cil_tmp466 = __cil_tmp465 + 35; #line 1535 - __cil_tmp467 = (unsigned int )Irp; + __cil_tmp467 = (unsigned int)Irp; #line 1535 - __cil_tmp468 = __cil_tmp467 + 35; + __cil_tmp468 = __cil_tmp467 + 35; #line 1535 - mem_581 = (CHAR *)__cil_tmp468; + mem_581 = (CHAR *)__cil_tmp468; #line 1535 - __cil_tmp469 = *mem_581; + __cil_tmp469 = *mem_581; #line 1535 - __cil_tmp470 = (int )__cil_tmp469; + __cil_tmp470 = (int)__cil_tmp469; #line 1535 - __cil_tmp471 = __cil_tmp470 + 1; + __cil_tmp471 = __cil_tmp470 + 1; #line 1535 - mem_582 = (CHAR *)__cil_tmp466; + mem_582 = (CHAR *)__cil_tmp466; #line 1535 - *mem_582 = (char )__cil_tmp471; + *mem_582 = (char)__cil_tmp471; #line 1535 - __cil_tmp472 = 24 + 8; + __cil_tmp472 = 24 + 8; #line 1535 - __cil_tmp473 = 0 + __cil_tmp472; + __cil_tmp473 = 0 + __cil_tmp472; #line 1535 - __cil_tmp474 = 64 + __cil_tmp473; + __cil_tmp474 = 64 + __cil_tmp473; #line 1535 - __cil_tmp475 = (unsigned int )Irp; + __cil_tmp475 = (unsigned int)Irp; #line 1535 - __cil_tmp476 = __cil_tmp475 + __cil_tmp474; + __cil_tmp476 = __cil_tmp475 + __cil_tmp474; #line 1535 - __cil_tmp477 = 24 + 8; + __cil_tmp477 = 24 + 8; #line 1535 - __cil_tmp478 = 0 + __cil_tmp477; + __cil_tmp478 = 0 + __cil_tmp477; #line 1535 - __cil_tmp479 = 64 + __cil_tmp478; + __cil_tmp479 = 64 + __cil_tmp478; #line 1535 - __cil_tmp480 = (unsigned int )Irp; + __cil_tmp480 = (unsigned int)Irp; #line 1535 - __cil_tmp481 = __cil_tmp480 + __cil_tmp479; + __cil_tmp481 = __cil_tmp480 + __cil_tmp479; #line 1535 - mem_583 = (struct _IO_STACK_LOCATION **)__cil_tmp481; + mem_583 = (struct _IO_STACK_LOCATION **) + __cil_tmp481; #line 1535 - __cil_tmp482 = *mem_583; + __cil_tmp482 = *mem_583; #line 1535 - mem_584 = (struct _IO_STACK_LOCATION **)__cil_tmp476; + mem_584 = (struct _IO_STACK_LOCATION **) + __cil_tmp476; #line 1535 - *mem_584 = __cil_tmp482 + 1; + *mem_584 = __cil_tmp482 + 1; #line 1536 - __cil_tmp483 = (unsigned int )disketteExtension; + __cil_tmp483 = + (unsigned int)disketteExtension; #line 1536 - __cil_tmp484 = __cil_tmp483 + 8; + __cil_tmp484 = __cil_tmp483 + 8; #line 1536 - mem_585 = (PDEVICE_OBJECT *)__cil_tmp484; + mem_585 = (PDEVICE_OBJECT *)__cil_tmp484; #line 1536 - __cil_tmp485 = *mem_585; + __cil_tmp485 = *mem_585; #line 1536 - ntStatus = IofCallDriver(__cil_tmp485, Irp); - } + ntStatus = IofCallDriver(__cil_tmp485, Irp); + } #line 1537 - return (ntStatus); - } else { - switch_16_break: /* CIL Label */ ; - } + return (ntStatus); + } else { + switch_16_break: /* CIL Label */; + } + } + } } } } @@ -9202,1848 +9407,1853 @@ NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } - } - } #line 1541 - if (ntStatus != 259L) { + if (ntStatus != 259L) { #line 1543 - __cil_tmp486 = (unsigned int )Irp; + __cil_tmp486 = (unsigned int)Irp; #line 1543 - __cil_tmp487 = __cil_tmp486 + 24; + __cil_tmp487 = __cil_tmp486 + 24; #line 1543 - mem_586 = (NTSTATUS *)__cil_tmp487; + mem_586 = (NTSTATUS *)__cil_tmp487; #line 1543 - *mem_586 = ntStatus; + *mem_586 = ntStatus; #line 1544 - myStatus = ntStatus; - { -#line 1546 - __cil_tmp488 = ntStatus >= 0L; -#line 1546 - if (! __cil_tmp488) { -#line 1546 - if (ntStatus == -1073741661L) { -#line 1546 - tmp___2 = 1; - } else { + myStatus = ntStatus; + { #line 1546 - if (ntStatus == -1073741643L) { + __cil_tmp488 = ntStatus >= 0L; #line 1546 - tmp___2 = 1; - } else { + if (!__cil_tmp488) { #line 1546 - if (ntStatus == -1073741662L) { + if (ntStatus == -1073741661L) { #line 1546 tmp___2 = 1; } else { #line 1546 - if (ntStatus == -1073741805L) { + if (ntStatus == -1073741643L) { #line 1546 tmp___2 = 1; } else { #line 1546 - if (ntStatus == -2147483626L) { + if (ntStatus == -1073741662L) { #line 1546 tmp___2 = 1; } else { #line 1546 - if (ntStatus == -1073741804L) { + if (ntStatus == -1073741805L) { #line 1546 tmp___2 = 1; } else { #line 1546 - if (ntStatus == -1073741806L) { + if (ntStatus == -2147483626L) { #line 1546 tmp___2 = 1; } else { #line 1546 - tmp___2 = 0; + if (ntStatus == -1073741804L) { +#line 1546 + tmp___2 = 1; + } else { +#line 1546 + if (ntStatus == -1073741806L) { +#line 1546 + tmp___2 = 1; + } else { +#line 1546 + tmp___2 = 0; + } + } } } } } } - } - } #line 1546 - if ((unsigned char )tmp___2) { - { + if ((unsigned char)tmp___2) { + { #line 1547 - IoSetHardErrorOrVerifyDevice(Irp, DeviceObject); + IoSetHardErrorOrVerifyDevice(Irp, DeviceObject); + } + } else { + } + } else { } - } else { - } - } else { - - } - } - { + { #line 1550 - IofCompleteRequest(Irp, (char)0); + IofCompleteRequest(Irp, (char)0); + } + } else { } - } else { - - } #line 1553 - return (ntStatus); -} + return (ntStatus); + } } #line 1556 "floppy.c" -NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - PDISKETTE_EXTENSION disketteExtension ; - NTSTATUS ntStatus ; - KEVENT doneEvent ; - PIO_STACK_LOCATION irpSp___0 ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___1 ; - PCONFIGURATION_INFORMATION tmp ; - void *__cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - PVOID __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - UCHAR __cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - UCHAR __cil_tmp32 ; - int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - BOOLEAN __cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - unsigned int __cil_tmp39 ; - unsigned int __cil_tmp40 ; - CHAR __cil_tmp41 ; - int __cil_tmp42 ; - int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - unsigned int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - unsigned int __cil_tmp51 ; - unsigned int __cil_tmp52 ; - unsigned int __cil_tmp53 ; - struct _IO_STACK_LOCATION *__cil_tmp54 ; - unsigned int __cil_tmp55 ; - unsigned int __cil_tmp56 ; - PDEVICE_OBJECT __cil_tmp57 ; - unsigned int __cil_tmp58 ; - unsigned int __cil_tmp59 ; - FAST_MUTEX *__cil_tmp60 ; - unsigned int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - unsigned int __cil_tmp63 ; - unsigned int __cil_tmp64 ; - FAST_MUTEX *__cil_tmp65 ; - unsigned int __cil_tmp66 ; - unsigned int __cil_tmp67 ; - PKTHREAD __cil_tmp68 ; - void *__cil_tmp69 ; - enum _KWAIT_REASON __cil_tmp70 ; - void *__cil_tmp71 ; - LARGE_INTEGER *__cil_tmp72 ; - void *__cil_tmp73 ; - unsigned int __cil_tmp74 ; - unsigned int __cil_tmp75 ; - unsigned int __cil_tmp76 ; - PKTHREAD __cil_tmp77 ; - unsigned int __cil_tmp78 ; - unsigned int __cil_tmp79 ; - unsigned int __cil_tmp80 ; - PKTHREAD __cil_tmp81 ; - void *__cil_tmp82 ; - unsigned int __cil_tmp83 ; - unsigned int __cil_tmp84 ; - void *__cil_tmp85 ; - unsigned int __cil_tmp86 ; - unsigned int __cil_tmp87 ; - unsigned int __cil_tmp88 ; - unsigned int __cil_tmp89 ; - unsigned int __cil_tmp90 ; - unsigned int __cil_tmp91 ; - CHAR __cil_tmp92 ; - int __cil_tmp93 ; - int __cil_tmp94 ; - unsigned int __cil_tmp95 ; - unsigned int __cil_tmp96 ; - unsigned int __cil_tmp97 ; - unsigned int __cil_tmp98 ; - unsigned int __cil_tmp99 ; - unsigned int __cil_tmp100 ; - unsigned int __cil_tmp101 ; - unsigned int __cil_tmp102 ; - unsigned int __cil_tmp103 ; - unsigned int __cil_tmp104 ; - struct _IO_STACK_LOCATION *__cil_tmp105 ; - unsigned int __cil_tmp106 ; - unsigned int __cil_tmp107 ; - PDEVICE_OBJECT __cil_tmp108 ; - unsigned int __cil_tmp109 ; - unsigned int __cil_tmp110 ; - unsigned int __cil_tmp111 ; - unsigned int __cil_tmp112 ; - unsigned int __cil_tmp113 ; - unsigned int __cil_tmp114 ; - unsigned int __cil_tmp115 ; - UCHAR __cil_tmp116 ; - int __cil_tmp117 ; - unsigned int __cil_tmp118 ; - unsigned int __cil_tmp119 ; - BOOLEAN __cil_tmp120 ; - unsigned int __cil_tmp121 ; - unsigned int __cil_tmp122 ; - unsigned int __cil_tmp123 ; - unsigned int __cil_tmp124 ; - unsigned int __cil_tmp125 ; - unsigned int __cil_tmp126 ; - CHAR __cil_tmp127 ; - int __cil_tmp128 ; - int __cil_tmp129 ; - unsigned int __cil_tmp130 ; - unsigned int __cil_tmp131 ; - unsigned int __cil_tmp132 ; - unsigned int __cil_tmp133 ; - unsigned int __cil_tmp134 ; - unsigned int __cil_tmp135 ; - unsigned int __cil_tmp136 ; - unsigned int __cil_tmp137 ; - unsigned int __cil_tmp138 ; - unsigned int __cil_tmp139 ; - struct _IO_STACK_LOCATION *__cil_tmp140 ; - unsigned int __cil_tmp141 ; - unsigned int __cil_tmp142 ; - PDEVICE_OBJECT __cil_tmp143 ; - unsigned int __cil_tmp144 ; - unsigned int __cil_tmp145 ; - unsigned int __cil_tmp146 ; - unsigned int __cil_tmp147 ; - unsigned int __cil_tmp148 ; - unsigned int __cil_tmp149 ; - unsigned int __cil_tmp150 ; - unsigned int __cil_tmp151 ; - unsigned int __cil_tmp152 ; - unsigned int __cil_tmp153 ; - unsigned int __cil_tmp154 ; - unsigned int __cil_tmp155 ; - struct _IO_STACK_LOCATION *__cil_tmp156 ; - void *__cil_tmp157 ; - void const *__cil_tmp158 ; - IO_STACK_LOCATION *__cil_tmp159 ; - unsigned int __cil_tmp160 ; - unsigned int __cil_tmp161 ; - NTSTATUS (**__cil_tmp162)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - long __cil_tmp163 ; - unsigned int __cil_tmp164 ; - unsigned int __cil_tmp165 ; - unsigned int __cil_tmp166 ; - enum _EVENT_TYPE __cil_tmp167 ; - unsigned int __cil_tmp168 ; - unsigned int __cil_tmp169 ; - unsigned int __cil_tmp170 ; - unsigned int __cil_tmp171 ; - unsigned int __cil_tmp172 ; - struct _IO_STACK_LOCATION *__cil_tmp173 ; - unsigned int __cil_tmp174 ; - unsigned int __cil_tmp175 ; - unsigned int __cil_tmp176 ; - unsigned int __cil_tmp177 ; - unsigned int __cil_tmp178 ; - unsigned int __cil_tmp179 ; - unsigned int __cil_tmp180 ; - unsigned int __cil_tmp181 ; - unsigned int __cil_tmp182 ; - unsigned int __cil_tmp183 ; - unsigned int __cil_tmp184 ; - unsigned int __cil_tmp185 ; - UCHAR __cil_tmp186 ; - int __cil_tmp187 ; - int __cil_tmp188 ; - unsigned int __cil_tmp189 ; - unsigned int __cil_tmp190 ; - unsigned int __cil_tmp191 ; - unsigned int __cil_tmp192 ; - UCHAR __cil_tmp193 ; - int __cil_tmp194 ; - int __cil_tmp195 ; - unsigned int __cil_tmp196 ; - unsigned int __cil_tmp197 ; - PDEVICE_OBJECT __cil_tmp198 ; - void *__cil_tmp199 ; - enum _KWAIT_REASON __cil_tmp200 ; - void *__cil_tmp201 ; - LARGE_INTEGER *__cil_tmp202 ; - unsigned int __cil_tmp203 ; - unsigned int __cil_tmp204 ; - FAST_MUTEX *__cil_tmp205 ; - unsigned int __cil_tmp206 ; - unsigned int __cil_tmp207 ; - unsigned int __cil_tmp208 ; - unsigned int __cil_tmp209 ; - FAST_MUTEX *__cil_tmp210 ; - unsigned int __cil_tmp211 ; - unsigned int __cil_tmp212 ; - unsigned int __cil_tmp213 ; - unsigned int __cil_tmp214 ; - unsigned int __cil_tmp215 ; - unsigned int __cil_tmp216 ; - unsigned int __cil_tmp217 ; - unsigned int __cil_tmp218 ; - unsigned int __cil_tmp219 ; - unsigned int __cil_tmp220 ; - unsigned int __cil_tmp221 ; - unsigned int __cil_tmp222 ; - unsigned int __cil_tmp223 ; - CHAR __cil_tmp224 ; - int __cil_tmp225 ; - int __cil_tmp226 ; - unsigned int __cil_tmp227 ; - unsigned int __cil_tmp228 ; - unsigned int __cil_tmp229 ; - unsigned int __cil_tmp230 ; - unsigned int __cil_tmp231 ; - unsigned int __cil_tmp232 ; - unsigned int __cil_tmp233 ; - unsigned int __cil_tmp234 ; - unsigned int __cil_tmp235 ; - unsigned int __cil_tmp236 ; - struct _IO_STACK_LOCATION *__cil_tmp237 ; - unsigned int __cil_tmp238 ; - unsigned int __cil_tmp239 ; - PDEVICE_OBJECT __cil_tmp240 ; - unsigned int __cil_tmp241 ; - unsigned int __cil_tmp242 ; - FAST_MUTEX *__cil_tmp243 ; - unsigned int __cil_tmp244 ; - unsigned int __cil_tmp245 ; - unsigned int __cil_tmp246 ; - unsigned int __cil_tmp247 ; - FAST_MUTEX *__cil_tmp248 ; - unsigned int __cil_tmp249 ; - unsigned int __cil_tmp250 ; - unsigned int __cil_tmp251 ; - unsigned int __cil_tmp252 ; - unsigned int __cil_tmp253 ; - unsigned int __cil_tmp254 ; - unsigned int __cil_tmp255 ; - unsigned int __cil_tmp256 ; - CHAR __cil_tmp257 ; - int __cil_tmp258 ; - int __cil_tmp259 ; - unsigned int __cil_tmp260 ; - unsigned int __cil_tmp261 ; - unsigned int __cil_tmp262 ; - unsigned int __cil_tmp263 ; - unsigned int __cil_tmp264 ; - unsigned int __cil_tmp265 ; - unsigned int __cil_tmp266 ; - unsigned int __cil_tmp267 ; - unsigned int __cil_tmp268 ; - unsigned int __cil_tmp269 ; - struct _IO_STACK_LOCATION *__cil_tmp270 ; - unsigned int __cil_tmp271 ; - unsigned int __cil_tmp272 ; - unsigned int __cil_tmp273 ; - unsigned int __cil_tmp274 ; - PDEVICE_OBJECT __cil_tmp275 ; - void *__cil_tmp276 ; - unsigned int __cil_tmp277 ; - unsigned int __cil_tmp278 ; - unsigned int __cil_tmp279 ; - unsigned int __cil_tmp280 ; - PWSTR __cil_tmp281 ; - unsigned int __cil_tmp282 ; - unsigned int __cil_tmp283 ; - unsigned int __cil_tmp284 ; - UNICODE_STRING *__cil_tmp285 ; - unsigned int __cil_tmp286 ; - unsigned int __cil_tmp287 ; - UNICODE_STRING *__cil_tmp288 ; - unsigned int __cil_tmp289 ; - unsigned int __cil_tmp290 ; - UNICODE_STRING *__cil_tmp291 ; - void *__cil_tmp292 ; - WCHAR const *__cil_tmp293 ; - unsigned int __cil_tmp294 ; - unsigned int __cil_tmp295 ; - UNICODE_STRING *__cil_tmp296 ; - unsigned int __cil_tmp297 ; - unsigned int __cil_tmp298 ; - UNICODE_STRING *__cil_tmp299 ; - void *__cil_tmp300 ; - WCHAR const *__cil_tmp301 ; - unsigned int __cil_tmp302 ; - unsigned int __cil_tmp303 ; - USHORT __cil_tmp304 ; - int __cil_tmp305 ; - unsigned int __cil_tmp306 ; - unsigned int __cil_tmp307 ; - UNICODE_STRING *__cil_tmp308 ; - unsigned int __cil_tmp309 ; - unsigned int __cil_tmp310 ; - UNICODE_STRING *__cil_tmp311 ; - unsigned int __cil_tmp312 ; - unsigned int __cil_tmp313 ; - UNICODE_STRING *__cil_tmp314 ; - void *__cil_tmp315 ; - WCHAR const *__cil_tmp316 ; - unsigned int __cil_tmp317 ; - unsigned int __cil_tmp318 ; - PDEVICE_OBJECT __cil_tmp319 ; - unsigned int __cil_tmp320 ; - unsigned int __cil_tmp321 ; - unsigned int __cil_tmp322 ; - unsigned int __cil_tmp323 ; - ULONG __cil_tmp324 ; - unsigned int __cil_tmp325 ; - unsigned int __cil_tmp326 ; - unsigned int __cil_tmp327 ; - unsigned int __cil_tmp328 ; - CHAR __cil_tmp329 ; - int __cil_tmp330 ; - int __cil_tmp331 ; - unsigned int __cil_tmp332 ; - unsigned int __cil_tmp333 ; - unsigned int __cil_tmp334 ; - unsigned int __cil_tmp335 ; - unsigned int __cil_tmp336 ; - unsigned int __cil_tmp337 ; - unsigned int __cil_tmp338 ; - unsigned int __cil_tmp339 ; - unsigned int __cil_tmp340 ; - unsigned int __cil_tmp341 ; - struct _IO_STACK_LOCATION *__cil_tmp342 ; - unsigned int __cil_tmp343 ; - unsigned int __cil_tmp344 ; - PDEVICE_OBJECT __cil_tmp345 ; - void *__cil_tmp346 ; - PVOID *mem_347 ; - struct _IO_STACK_LOCATION **mem_348 ; - BOOLEAN *mem_349 ; - ULONG_PTR *mem_350 ; - NTSTATUS *mem_351 ; - UCHAR *mem_352 ; - UCHAR *mem_353 ; - BOOLEAN *mem_354 ; - CHAR *mem_355 ; - CHAR *mem_356 ; - struct _IO_STACK_LOCATION **mem_357 ; - struct _IO_STACK_LOCATION **mem_358 ; - PDEVICE_OBJECT *mem_359 ; - BOOLEAN *mem_360 ; - PKTHREAD *mem_361 ; - PKTHREAD *mem_362 ; - PKTHREAD *mem_363 ; - PKTHREAD *mem_364 ; - NTSTATUS *mem_365 ; - CHAR *mem_366 ; - CHAR *mem_367 ; - struct _IO_STACK_LOCATION **mem_368 ; - struct _IO_STACK_LOCATION **mem_369 ; - PDEVICE_OBJECT *mem_370 ; - NTSTATUS *mem_371 ; - ULONG_PTR *mem_372 ; - UCHAR *mem_373 ; - BOOLEAN *mem_374 ; - NTSTATUS *mem_375 ; - CHAR *mem_376 ; - CHAR *mem_377 ; - struct _IO_STACK_LOCATION **mem_378 ; - struct _IO_STACK_LOCATION **mem_379 ; - PDEVICE_OBJECT *mem_380 ; - NTSTATUS *mem_381 ; - struct _IO_STACK_LOCATION **mem_382 ; - struct _IO_STACK_LOCATION **mem_383 ; - UCHAR *mem_384 ; - struct _IO_STACK_LOCATION **mem_385 ; - NTSTATUS (**mem_386)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - PVOID *mem_387 ; - UCHAR *mem_388 ; - UCHAR *mem_389 ; - UCHAR *mem_390 ; - UCHAR *mem_391 ; - UCHAR *mem_392 ; - UCHAR *mem_393 ; - PDEVICE_OBJECT *mem_394 ; - BOOLEAN *mem_395 ; - NTSTATUS *mem_396 ; - ULONG_PTR *mem_397 ; - BOOLEAN *mem_398 ; - NTSTATUS *mem_399 ; - CHAR *mem_400 ; - CHAR *mem_401 ; - struct _IO_STACK_LOCATION **mem_402 ; - struct _IO_STACK_LOCATION **mem_403 ; - PDEVICE_OBJECT *mem_404 ; - BOOLEAN *mem_405 ; - BOOLEAN *mem_406 ; - BOOLEAN *mem_407 ; - CHAR *mem_408 ; - CHAR *mem_409 ; - struct _IO_STACK_LOCATION **mem_410 ; - struct _IO_STACK_LOCATION **mem_411 ; - NTSTATUS *mem_412 ; - PDEVICE_OBJECT *mem_413 ; - PWSTR *mem_414 ; - USHORT *mem_415 ; - PDEVICE_OBJECT *mem_416 ; - ULONG *mem_417 ; - ULONG *mem_418 ; - CHAR *mem_419 ; - CHAR *mem_420 ; - struct _IO_STACK_LOCATION **mem_421 ; - struct _IO_STACK_LOCATION **mem_422 ; - PDEVICE_OBJECT *mem_423 ; +NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + PDISKETTE_EXTENSION disketteExtension; + NTSTATUS ntStatus; + KEVENT doneEvent; + PIO_STACK_LOCATION irpSp___0; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___1; + PCONFIGURATION_INFORMATION tmp; + void *__cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + PVOID __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + UCHAR __cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + UCHAR __cil_tmp32; + int __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + BOOLEAN __cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + unsigned int __cil_tmp39; + unsigned int __cil_tmp40; + CHAR __cil_tmp41; + int __cil_tmp42; + int __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + unsigned int __cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + unsigned int __cil_tmp51; + unsigned int __cil_tmp52; + unsigned int __cil_tmp53; + struct _IO_STACK_LOCATION *__cil_tmp54; + unsigned int __cil_tmp55; + unsigned int __cil_tmp56; + PDEVICE_OBJECT __cil_tmp57; + unsigned int __cil_tmp58; + unsigned int __cil_tmp59; + FAST_MUTEX *__cil_tmp60; + unsigned int __cil_tmp61; + unsigned int __cil_tmp62; + unsigned int __cil_tmp63; + unsigned int __cil_tmp64; + FAST_MUTEX *__cil_tmp65; + unsigned int __cil_tmp66; + unsigned int __cil_tmp67; + PKTHREAD __cil_tmp68; + void *__cil_tmp69; + enum _KWAIT_REASON __cil_tmp70; + void *__cil_tmp71; + LARGE_INTEGER *__cil_tmp72; + void *__cil_tmp73; + unsigned int __cil_tmp74; + unsigned int __cil_tmp75; + unsigned int __cil_tmp76; + PKTHREAD __cil_tmp77; + unsigned int __cil_tmp78; + unsigned int __cil_tmp79; + unsigned int __cil_tmp80; + PKTHREAD __cil_tmp81; + void *__cil_tmp82; + unsigned int __cil_tmp83; + unsigned int __cil_tmp84; + void *__cil_tmp85; + unsigned int __cil_tmp86; + unsigned int __cil_tmp87; + unsigned int __cil_tmp88; + unsigned int __cil_tmp89; + unsigned int __cil_tmp90; + unsigned int __cil_tmp91; + CHAR __cil_tmp92; + int __cil_tmp93; + int __cil_tmp94; + unsigned int __cil_tmp95; + unsigned int __cil_tmp96; + unsigned int __cil_tmp97; + unsigned int __cil_tmp98; + unsigned int __cil_tmp99; + unsigned int __cil_tmp100; + unsigned int __cil_tmp101; + unsigned int __cil_tmp102; + unsigned int __cil_tmp103; + unsigned int __cil_tmp104; + struct _IO_STACK_LOCATION *__cil_tmp105; + unsigned int __cil_tmp106; + unsigned int __cil_tmp107; + PDEVICE_OBJECT __cil_tmp108; + unsigned int __cil_tmp109; + unsigned int __cil_tmp110; + unsigned int __cil_tmp111; + unsigned int __cil_tmp112; + unsigned int __cil_tmp113; + unsigned int __cil_tmp114; + unsigned int __cil_tmp115; + UCHAR __cil_tmp116; + int __cil_tmp117; + unsigned int __cil_tmp118; + unsigned int __cil_tmp119; + BOOLEAN __cil_tmp120; + unsigned int __cil_tmp121; + unsigned int __cil_tmp122; + unsigned int __cil_tmp123; + unsigned int __cil_tmp124; + unsigned int __cil_tmp125; + unsigned int __cil_tmp126; + CHAR __cil_tmp127; + int __cil_tmp128; + int __cil_tmp129; + unsigned int __cil_tmp130; + unsigned int __cil_tmp131; + unsigned int __cil_tmp132; + unsigned int __cil_tmp133; + unsigned int __cil_tmp134; + unsigned int __cil_tmp135; + unsigned int __cil_tmp136; + unsigned int __cil_tmp137; + unsigned int __cil_tmp138; + unsigned int __cil_tmp139; + struct _IO_STACK_LOCATION *__cil_tmp140; + unsigned int __cil_tmp141; + unsigned int __cil_tmp142; + PDEVICE_OBJECT __cil_tmp143; + unsigned int __cil_tmp144; + unsigned int __cil_tmp145; + unsigned int __cil_tmp146; + unsigned int __cil_tmp147; + unsigned int __cil_tmp148; + unsigned int __cil_tmp149; + unsigned int __cil_tmp150; + unsigned int __cil_tmp151; + unsigned int __cil_tmp152; + unsigned int __cil_tmp153; + unsigned int __cil_tmp154; + unsigned int __cil_tmp155; + struct _IO_STACK_LOCATION *__cil_tmp156; + void *__cil_tmp157; + void const *__cil_tmp158; + IO_STACK_LOCATION *__cil_tmp159; + unsigned int __cil_tmp160; + unsigned int __cil_tmp161; + NTSTATUS(**__cil_tmp162) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + long __cil_tmp163; + unsigned int __cil_tmp164; + unsigned int __cil_tmp165; + unsigned int __cil_tmp166; + enum _EVENT_TYPE __cil_tmp167; + unsigned int __cil_tmp168; + unsigned int __cil_tmp169; + unsigned int __cil_tmp170; + unsigned int __cil_tmp171; + unsigned int __cil_tmp172; + struct _IO_STACK_LOCATION *__cil_tmp173; + unsigned int __cil_tmp174; + unsigned int __cil_tmp175; + unsigned int __cil_tmp176; + unsigned int __cil_tmp177; + unsigned int __cil_tmp178; + unsigned int __cil_tmp179; + unsigned int __cil_tmp180; + unsigned int __cil_tmp181; + unsigned int __cil_tmp182; + unsigned int __cil_tmp183; + unsigned int __cil_tmp184; + unsigned int __cil_tmp185; + UCHAR __cil_tmp186; + int __cil_tmp187; + int __cil_tmp188; + unsigned int __cil_tmp189; + unsigned int __cil_tmp190; + unsigned int __cil_tmp191; + unsigned int __cil_tmp192; + UCHAR __cil_tmp193; + int __cil_tmp194; + int __cil_tmp195; + unsigned int __cil_tmp196; + unsigned int __cil_tmp197; + PDEVICE_OBJECT __cil_tmp198; + void *__cil_tmp199; + enum _KWAIT_REASON __cil_tmp200; + void *__cil_tmp201; + LARGE_INTEGER *__cil_tmp202; + unsigned int __cil_tmp203; + unsigned int __cil_tmp204; + FAST_MUTEX *__cil_tmp205; + unsigned int __cil_tmp206; + unsigned int __cil_tmp207; + unsigned int __cil_tmp208; + unsigned int __cil_tmp209; + FAST_MUTEX *__cil_tmp210; + unsigned int __cil_tmp211; + unsigned int __cil_tmp212; + unsigned int __cil_tmp213; + unsigned int __cil_tmp214; + unsigned int __cil_tmp215; + unsigned int __cil_tmp216; + unsigned int __cil_tmp217; + unsigned int __cil_tmp218; + unsigned int __cil_tmp219; + unsigned int __cil_tmp220; + unsigned int __cil_tmp221; + unsigned int __cil_tmp222; + unsigned int __cil_tmp223; + CHAR __cil_tmp224; + int __cil_tmp225; + int __cil_tmp226; + unsigned int __cil_tmp227; + unsigned int __cil_tmp228; + unsigned int __cil_tmp229; + unsigned int __cil_tmp230; + unsigned int __cil_tmp231; + unsigned int __cil_tmp232; + unsigned int __cil_tmp233; + unsigned int __cil_tmp234; + unsigned int __cil_tmp235; + unsigned int __cil_tmp236; + struct _IO_STACK_LOCATION *__cil_tmp237; + unsigned int __cil_tmp238; + unsigned int __cil_tmp239; + PDEVICE_OBJECT __cil_tmp240; + unsigned int __cil_tmp241; + unsigned int __cil_tmp242; + FAST_MUTEX *__cil_tmp243; + unsigned int __cil_tmp244; + unsigned int __cil_tmp245; + unsigned int __cil_tmp246; + unsigned int __cil_tmp247; + FAST_MUTEX *__cil_tmp248; + unsigned int __cil_tmp249; + unsigned int __cil_tmp250; + unsigned int __cil_tmp251; + unsigned int __cil_tmp252; + unsigned int __cil_tmp253; + unsigned int __cil_tmp254; + unsigned int __cil_tmp255; + unsigned int __cil_tmp256; + CHAR __cil_tmp257; + int __cil_tmp258; + int __cil_tmp259; + unsigned int __cil_tmp260; + unsigned int __cil_tmp261; + unsigned int __cil_tmp262; + unsigned int __cil_tmp263; + unsigned int __cil_tmp264; + unsigned int __cil_tmp265; + unsigned int __cil_tmp266; + unsigned int __cil_tmp267; + unsigned int __cil_tmp268; + unsigned int __cil_tmp269; + struct _IO_STACK_LOCATION *__cil_tmp270; + unsigned int __cil_tmp271; + unsigned int __cil_tmp272; + unsigned int __cil_tmp273; + unsigned int __cil_tmp274; + PDEVICE_OBJECT __cil_tmp275; + void *__cil_tmp276; + unsigned int __cil_tmp277; + unsigned int __cil_tmp278; + unsigned int __cil_tmp279; + unsigned int __cil_tmp280; + PWSTR __cil_tmp281; + unsigned int __cil_tmp282; + unsigned int __cil_tmp283; + unsigned int __cil_tmp284; + UNICODE_STRING *__cil_tmp285; + unsigned int __cil_tmp286; + unsigned int __cil_tmp287; + UNICODE_STRING *__cil_tmp288; + unsigned int __cil_tmp289; + unsigned int __cil_tmp290; + UNICODE_STRING *__cil_tmp291; + void *__cil_tmp292; + WCHAR const *__cil_tmp293; + unsigned int __cil_tmp294; + unsigned int __cil_tmp295; + UNICODE_STRING *__cil_tmp296; + unsigned int __cil_tmp297; + unsigned int __cil_tmp298; + UNICODE_STRING *__cil_tmp299; + void *__cil_tmp300; + WCHAR const *__cil_tmp301; + unsigned int __cil_tmp302; + unsigned int __cil_tmp303; + USHORT __cil_tmp304; + int __cil_tmp305; + unsigned int __cil_tmp306; + unsigned int __cil_tmp307; + UNICODE_STRING *__cil_tmp308; + unsigned int __cil_tmp309; + unsigned int __cil_tmp310; + UNICODE_STRING *__cil_tmp311; + unsigned int __cil_tmp312; + unsigned int __cil_tmp313; + UNICODE_STRING *__cil_tmp314; + void *__cil_tmp315; + WCHAR const *__cil_tmp316; + unsigned int __cil_tmp317; + unsigned int __cil_tmp318; + PDEVICE_OBJECT __cil_tmp319; + unsigned int __cil_tmp320; + unsigned int __cil_tmp321; + unsigned int __cil_tmp322; + unsigned int __cil_tmp323; + ULONG __cil_tmp324; + unsigned int __cil_tmp325; + unsigned int __cil_tmp326; + unsigned int __cil_tmp327; + unsigned int __cil_tmp328; + CHAR __cil_tmp329; + int __cil_tmp330; + int __cil_tmp331; + unsigned int __cil_tmp332; + unsigned int __cil_tmp333; + unsigned int __cil_tmp334; + unsigned int __cil_tmp335; + unsigned int __cil_tmp336; + unsigned int __cil_tmp337; + unsigned int __cil_tmp338; + unsigned int __cil_tmp339; + unsigned int __cil_tmp340; + unsigned int __cil_tmp341; + struct _IO_STACK_LOCATION *__cil_tmp342; + unsigned int __cil_tmp343; + unsigned int __cil_tmp344; + PDEVICE_OBJECT __cil_tmp345; + void *__cil_tmp346; + PVOID *mem_347; + struct _IO_STACK_LOCATION **mem_348; + BOOLEAN *mem_349; + ULONG_PTR *mem_350; + NTSTATUS *mem_351; + UCHAR *mem_352; + UCHAR *mem_353; + BOOLEAN *mem_354; + CHAR *mem_355; + CHAR *mem_356; + struct _IO_STACK_LOCATION **mem_357; + struct _IO_STACK_LOCATION **mem_358; + PDEVICE_OBJECT *mem_359; + BOOLEAN *mem_360; + PKTHREAD *mem_361; + PKTHREAD *mem_362; + PKTHREAD *mem_363; + PKTHREAD *mem_364; + NTSTATUS *mem_365; + CHAR *mem_366; + CHAR *mem_367; + struct _IO_STACK_LOCATION **mem_368; + struct _IO_STACK_LOCATION **mem_369; + PDEVICE_OBJECT *mem_370; + NTSTATUS *mem_371; + ULONG_PTR *mem_372; + UCHAR *mem_373; + BOOLEAN *mem_374; + NTSTATUS *mem_375; + CHAR *mem_376; + CHAR *mem_377; + struct _IO_STACK_LOCATION **mem_378; + struct _IO_STACK_LOCATION **mem_379; + PDEVICE_OBJECT *mem_380; + NTSTATUS *mem_381; + struct _IO_STACK_LOCATION **mem_382; + struct _IO_STACK_LOCATION **mem_383; + UCHAR *mem_384; + struct _IO_STACK_LOCATION **mem_385; + NTSTATUS (**mem_386)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + PVOID *mem_387; + UCHAR *mem_388; + UCHAR *mem_389; + UCHAR *mem_390; + UCHAR *mem_391; + UCHAR *mem_392; + UCHAR *mem_393; + PDEVICE_OBJECT *mem_394; + BOOLEAN *mem_395; + NTSTATUS *mem_396; + ULONG_PTR *mem_397; + BOOLEAN *mem_398; + NTSTATUS *mem_399; + CHAR *mem_400; + CHAR *mem_401; + struct _IO_STACK_LOCATION **mem_402; + struct _IO_STACK_LOCATION **mem_403; + PDEVICE_OBJECT *mem_404; + BOOLEAN *mem_405; + BOOLEAN *mem_406; + BOOLEAN *mem_407; + CHAR *mem_408; + CHAR *mem_409; + struct _IO_STACK_LOCATION **mem_410; + struct _IO_STACK_LOCATION **mem_411; + NTSTATUS *mem_412; + PDEVICE_OBJECT *mem_413; + PWSTR *mem_414; + USHORT *mem_415; + PDEVICE_OBJECT *mem_416; + ULONG *mem_417; + ULONG *mem_418; + CHAR *mem_419; + CHAR *mem_420; + struct _IO_STACK_LOCATION **mem_421; + struct _IO_STACK_LOCATION **mem_422; + PDEVICE_OBJECT *mem_423; { #line 1580 - ntStatus = 0L; - { + ntStatus = 0L; + { #line 1583 - while (1) { - while_31_continue: /* CIL Label */ ; - goto while_31_break; - } - while_31_break: /* CIL Label */ ; - } - { + while (1) { + while_31_continue: /* CIL Label */; + goto while_31_break; + } + while_31_break: /* CIL Label */; + } + { #line 1588 - ExAcquireFastMutex(PagingMutex); + ExAcquireFastMutex(PagingMutex); #line 1588 - PagingReferenceCount = PagingReferenceCount + 1UL; - } + PagingReferenceCount = PagingReferenceCount + 1UL; + } #line 1588 - if (PagingReferenceCount == 1UL) { - { + if (PagingReferenceCount == 1UL) { + { #line 1588 - __cil_tmp11 = (void *)(& DriverEntry); + __cil_tmp11 = (void *)(&DriverEntry); #line 1588 - MmResetDriverPaging(__cil_tmp11); + MmResetDriverPaging(__cil_tmp11); + } + } else { } - } else { - - } - { + { #line 1588 - ExReleaseFastMutex(PagingMutex); + ExReleaseFastMutex(PagingMutex); #line 1591 - __cil_tmp12 = (unsigned int )DeviceObject; + __cil_tmp12 = (unsigned int)DeviceObject; #line 1591 - __cil_tmp13 = __cil_tmp12 + 40; + __cil_tmp13 = __cil_tmp12 + 40; #line 1591 - mem_347 = (PVOID *)__cil_tmp13; + mem_347 = (PVOID *)__cil_tmp13; #line 1591 - __cil_tmp14 = *mem_347; + __cil_tmp14 = *mem_347; #line 1591 - disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp14; + disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp14; #line 1593 - __cil_tmp15 = 24 + 8; + __cil_tmp15 = 24 + 8; #line 1593 - __cil_tmp16 = 0 + __cil_tmp15; + __cil_tmp16 = 0 + __cil_tmp15; #line 1593 - __cil_tmp17 = 64 + __cil_tmp16; + __cil_tmp17 = 64 + __cil_tmp16; #line 1593 - __cil_tmp18 = (unsigned int )Irp; + __cil_tmp18 = (unsigned int)Irp; #line 1593 - __cil_tmp19 = __cil_tmp18 + __cil_tmp17; + __cil_tmp19 = __cil_tmp18 + __cil_tmp17; #line 1593 - mem_348 = (struct _IO_STACK_LOCATION **)__cil_tmp19; + mem_348 = (struct _IO_STACK_LOCATION **)__cil_tmp19; #line 1593 - irpSp = *mem_348; - } - { + irpSp = *mem_348; + } + { #line 1595 - __cil_tmp20 = (unsigned int )disketteExtension; + __cil_tmp20 = (unsigned int)disketteExtension; #line 1595 - __cil_tmp21 = __cil_tmp20 + 13; - { + __cil_tmp21 = __cil_tmp20 + 13; + { #line 1595 - mem_349 = (BOOLEAN *)__cil_tmp21; + mem_349 = (BOOLEAN *)__cil_tmp21; #line 1595 - if (*mem_349) { - { + if (*mem_349) { + { #line 1601 - __cil_tmp22 = 24 + 4; + __cil_tmp22 = 24 + 4; #line 1601 - __cil_tmp23 = (unsigned int )Irp; + __cil_tmp23 = (unsigned int)Irp; #line 1601 - __cil_tmp24 = __cil_tmp23 + __cil_tmp22; + __cil_tmp24 = __cil_tmp23 + __cil_tmp22; #line 1601 - mem_350 = (ULONG_PTR *)__cil_tmp24; + mem_350 = (ULONG_PTR *)__cil_tmp24; #line 1601 - *mem_350 = 0UL; + *mem_350 = 0UL; #line 1602 - __cil_tmp25 = (unsigned int )Irp; + __cil_tmp25 = (unsigned int)Irp; #line 1602 - __cil_tmp26 = __cil_tmp25 + 24; + __cil_tmp26 = __cil_tmp25 + 24; #line 1602 - mem_351 = (NTSTATUS *)__cil_tmp26; + mem_351 = (NTSTATUS *)__cil_tmp26; #line 1602 - *mem_351 = -1073741738L; + *mem_351 = -1073741738L; #line 1603 - myStatus = -1073741738L; + myStatus = -1073741738L; #line 1605 - IofCompleteRequest(Irp, (char)0); - } + IofCompleteRequest(Irp, (char)0); + } #line 1606 - return (-1073741738L); - } else { - - } - } - } - { + return (-1073741738L); + } else { + } + } + } + { #line 1607 - __cil_tmp27 = (unsigned int )irpSp; + __cil_tmp27 = (unsigned int)irpSp; #line 1607 - __cil_tmp28 = __cil_tmp27 + 1; + __cil_tmp28 = __cil_tmp27 + 1; #line 1607 - mem_352 = (UCHAR *)__cil_tmp28; + mem_352 = (UCHAR *)__cil_tmp28; #line 1607 - __cil_tmp29 = *mem_352; + __cil_tmp29 = *mem_352; #line 1608 - if ((int )__cil_tmp29 == 0) { - goto switch_32_0; - } else { + if ((int)__cil_tmp29 == 0) { + goto switch_32_0; + } else { #line 1613 - if ((int )__cil_tmp29 == 5) { - goto switch_32_5; - } else { + if ((int)__cil_tmp29 == 5) { + goto switch_32_5; + } else { #line 1614 - if ((int )__cil_tmp29 == 1) { - goto switch_32_1; - } else { + if ((int)__cil_tmp29 == 1) { + goto switch_32_1; + } else { #line 1690 - if ((int )__cil_tmp29 == 6) { - goto switch_32_6; - } else { + if ((int)__cil_tmp29 == 6) { + goto switch_32_6; + } else { #line 1691 - if ((int )__cil_tmp29 == 3) { - goto switch_32_3; - } else { + if ((int)__cil_tmp29 == 3) { + goto switch_32_3; + } else { #line 1779 - if ((int )__cil_tmp29 == 4) { - goto switch_32_4; - } else { + if ((int)__cil_tmp29 == 4) { + goto switch_32_4; + } else { #line 1790 - if ((int )__cil_tmp29 == 2) { - goto switch_32_2; - } else { - { - goto switch_32_default; + if ((int)__cil_tmp29 == 2) { + goto switch_32_2; + } else { + { + goto switch_32_default; #line 1607 - if (0) { - switch_32_0: /* CIL Label */ - { + if (0) { + switch_32_0 : /* CIL Label */ + { #line 1611 - ntStatus = FloppyStartDevice(DeviceObject, Irp); - } - goto switch_32_break; - switch_32_5: /* CIL Label */ ; - switch_32_1: /* CIL Label */ ; - { + ntStatus = FloppyStartDevice(DeviceObject, Irp); + } + goto switch_32_break; + switch_32_5: /* CIL Label */; + switch_32_1: /* CIL Label */; + { #line 1617 - __cil_tmp30 = (unsigned int )irpSp; + __cil_tmp30 = (unsigned int)irpSp; #line 1617 - __cil_tmp31 = __cil_tmp30 + 1; + __cil_tmp31 = __cil_tmp30 + 1; #line 1617 - mem_353 = (UCHAR *)__cil_tmp31; + mem_353 = (UCHAR *)__cil_tmp31; #line 1617 - __cil_tmp32 = *mem_353; + __cil_tmp32 = *mem_353; #line 1617 - __cil_tmp33 = (int )__cil_tmp32; + __cil_tmp33 = (int)__cil_tmp32; #line 1617 - if (__cil_tmp33 == 5) { - { + if (__cil_tmp33 == 5) { + { #line 1618 - while (1) { - while_33_continue: /* CIL Label */ ; - goto while_33_break; - } - while_33_break: /* CIL Label */ ; - } - } else { - { -#line 1620 - while (1) { - while_34_continue: /* CIL Label */ ; - goto while_34_break; - } - while_34_break: /* CIL Label */ ; - } - } - } - { + while (1) { + while_33_continue: /* CIL Label */; + goto while_33_break; + } + while_33_break: /* CIL Label */; + } + } else { + { +#line 1620 + while (1) { + while_34_continue: /* CIL Label */; + goto while_34_break; + } + while_34_break: /* CIL Label */; + } + } + } + { #line 1623 - __cil_tmp34 = (unsigned int )disketteExtension; + __cil_tmp34 = (unsigned int)disketteExtension; #line 1623 - __cil_tmp35 = __cil_tmp34 + 12; + __cil_tmp35 = __cil_tmp34 + 12; #line 1623 - mem_354 = (BOOLEAN *)__cil_tmp35; + mem_354 = (BOOLEAN *)__cil_tmp35; #line 1623 - __cil_tmp36 = *mem_354; + __cil_tmp36 = *mem_354; #line 1623 - if (! __cil_tmp36) { + if (!__cil_tmp36) { #line 1627 - if (s == 1) { + if (s == 1) { #line 1627 - s = 3; - } else { - { + s = 3; + } else { + { #line 1627 - __VERIFIER_assert(0); - } - } - { + __VERIFIER_assert(0); + } + } + { #line 1628 - __cil_tmp37 = (unsigned int )Irp; + __cil_tmp37 = (unsigned int)Irp; #line 1628 - __cil_tmp38 = __cil_tmp37 + 35; + __cil_tmp38 = __cil_tmp37 + 35; #line 1628 - __cil_tmp39 = (unsigned int )Irp; + __cil_tmp39 = (unsigned int)Irp; #line 1628 - __cil_tmp40 = __cil_tmp39 + 35; + __cil_tmp40 = __cil_tmp39 + 35; #line 1628 - mem_355 = (CHAR *)__cil_tmp40; + mem_355 = (CHAR *)__cil_tmp40; #line 1628 - __cil_tmp41 = *mem_355; + __cil_tmp41 = *mem_355; #line 1628 - __cil_tmp42 = (int )__cil_tmp41; + __cil_tmp42 = (int)__cil_tmp41; #line 1628 - __cil_tmp43 = __cil_tmp42 + 1; + __cil_tmp43 = __cil_tmp42 + 1; #line 1628 - mem_356 = (CHAR *)__cil_tmp38; + mem_356 = (CHAR *)__cil_tmp38; #line 1628 - *mem_356 = (char )__cil_tmp43; + *mem_356 = (char)__cil_tmp43; #line 1628 - __cil_tmp44 = 24 + 8; + __cil_tmp44 = 24 + 8; #line 1628 - __cil_tmp45 = 0 + __cil_tmp44; + __cil_tmp45 = 0 + __cil_tmp44; #line 1628 - __cil_tmp46 = 64 + __cil_tmp45; + __cil_tmp46 = 64 + __cil_tmp45; #line 1628 - __cil_tmp47 = (unsigned int )Irp; + __cil_tmp47 = (unsigned int)Irp; #line 1628 - __cil_tmp48 = __cil_tmp47 + __cil_tmp46; + __cil_tmp48 = __cil_tmp47 + __cil_tmp46; #line 1628 - __cil_tmp49 = 24 + 8; + __cil_tmp49 = 24 + 8; #line 1628 - __cil_tmp50 = 0 + __cil_tmp49; + __cil_tmp50 = 0 + __cil_tmp49; #line 1628 - __cil_tmp51 = 64 + __cil_tmp50; + __cil_tmp51 = 64 + __cil_tmp50; #line 1628 - __cil_tmp52 = (unsigned int )Irp; + __cil_tmp52 = (unsigned int)Irp; #line 1628 - __cil_tmp53 = __cil_tmp52 + __cil_tmp51; + __cil_tmp53 = __cil_tmp52 + __cil_tmp51; #line 1628 - mem_357 = (struct _IO_STACK_LOCATION **)__cil_tmp53; + mem_357 = + (struct _IO_STACK_LOCATION **)__cil_tmp53; #line 1628 - __cil_tmp54 = *mem_357; + __cil_tmp54 = *mem_357; #line 1628 - mem_358 = (struct _IO_STACK_LOCATION **)__cil_tmp48; + mem_358 = + (struct _IO_STACK_LOCATION **)__cil_tmp48; #line 1628 - *mem_358 = __cil_tmp54 + 1; + *mem_358 = __cil_tmp54 + 1; #line 1629 - __cil_tmp55 = (unsigned int )disketteExtension; + __cil_tmp55 = (unsigned int)disketteExtension; #line 1629 - __cil_tmp56 = __cil_tmp55 + 8; + __cil_tmp56 = __cil_tmp55 + 8; #line 1629 - mem_359 = (PDEVICE_OBJECT *)__cil_tmp56; + mem_359 = (PDEVICE_OBJECT *)__cil_tmp56; #line 1629 - __cil_tmp57 = *mem_359; + __cil_tmp57 = *mem_359; #line 1629 - ntStatus = IofCallDriver(__cil_tmp57, Irp); - } + ntStatus = IofCallDriver(__cil_tmp57, Irp); + } #line 1631 - return (ntStatus); - } else { - - } - } - { + return (ntStatus); + } else { + } + } + { #line 1637 - __cil_tmp58 = (unsigned int )disketteExtension; + __cil_tmp58 = (unsigned int)disketteExtension; #line 1637 - __cil_tmp59 = __cil_tmp58 + 428; + __cil_tmp59 = __cil_tmp58 + 428; #line 1637 - __cil_tmp60 = (FAST_MUTEX *)__cil_tmp59; + __cil_tmp60 = (FAST_MUTEX *)__cil_tmp59; #line 1637 - ExAcquireFastMutex(__cil_tmp60); + ExAcquireFastMutex(__cil_tmp60); #line 1638 - __cil_tmp61 = (unsigned int )disketteExtension; + __cil_tmp61 = (unsigned int)disketteExtension; #line 1638 - __cil_tmp62 = __cil_tmp61 + 14; + __cil_tmp62 = __cil_tmp61 + 14; #line 1638 - mem_360 = (BOOLEAN *)__cil_tmp62; + mem_360 = (BOOLEAN *)__cil_tmp62; #line 1638 - *mem_360 = (unsigned char)1; + *mem_360 = (unsigned char)1; #line 1639 - __cil_tmp63 = (unsigned int )disketteExtension; + __cil_tmp63 = (unsigned int)disketteExtension; #line 1639 - __cil_tmp64 = __cil_tmp63 + 428; + __cil_tmp64 = __cil_tmp63 + 428; #line 1639 - __cil_tmp65 = (FAST_MUTEX *)__cil_tmp64; + __cil_tmp65 = (FAST_MUTEX *)__cil_tmp64; #line 1639 - ExReleaseFastMutex(__cil_tmp65); + ExReleaseFastMutex(__cil_tmp65); #line 1646 - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } + ntStatus = FlQueueIrpToThread(Irp, disketteExtension); + } #line 1652 - if (ntStatus == 259L) { - { + if (ntStatus == 259L) { + { #line 1656 - __cil_tmp66 = (unsigned int )disketteExtension; + __cil_tmp66 = (unsigned int)disketteExtension; #line 1656 - __cil_tmp67 = __cil_tmp66 + 92; + __cil_tmp67 = __cil_tmp66 + 92; #line 1656 - mem_361 = (PKTHREAD *)__cil_tmp67; + mem_361 = (PKTHREAD *)__cil_tmp67; #line 1656 - __cil_tmp68 = *mem_361; + __cil_tmp68 = *mem_361; #line 1656 - __cil_tmp69 = (void *)__cil_tmp68; + __cil_tmp69 = (void *)__cil_tmp68; #line 1656 - __cil_tmp70 = (enum _KWAIT_REASON )0; + __cil_tmp70 = (enum _KWAIT_REASON)0; #line 1656 - __cil_tmp71 = (void *)0; + __cil_tmp71 = (void *)0; #line 1656 - __cil_tmp72 = (LARGE_INTEGER *)__cil_tmp71; + __cil_tmp72 = (LARGE_INTEGER *)__cil_tmp71; #line 1656 - KeWaitForSingleObject(__cil_tmp69, __cil_tmp70, (char)0, (unsigned char)0, - __cil_tmp72); - } - { + KeWaitForSingleObject(__cil_tmp69, __cil_tmp70, + (char)0, (unsigned char)0, + __cil_tmp72); + } + { #line 1666 - __cil_tmp73 = (void *)0; + __cil_tmp73 = (void *)0; #line 1666 - __cil_tmp74 = (unsigned int )__cil_tmp73; + __cil_tmp74 = (unsigned int)__cil_tmp73; #line 1666 - __cil_tmp75 = (unsigned int )disketteExtension; + __cil_tmp75 = (unsigned int)disketteExtension; #line 1666 - __cil_tmp76 = __cil_tmp75 + 92; + __cil_tmp76 = __cil_tmp75 + 92; #line 1666 - mem_362 = (PKTHREAD *)__cil_tmp76; + mem_362 = (PKTHREAD *)__cil_tmp76; #line 1666 - __cil_tmp77 = *mem_362; + __cil_tmp77 = *mem_362; #line 1666 - __cil_tmp78 = (unsigned int )__cil_tmp77; + __cil_tmp78 = (unsigned int)__cil_tmp77; #line 1666 - if (__cil_tmp78 != __cil_tmp74) { - { + if (__cil_tmp78 != __cil_tmp74) { + { #line 1667 - __cil_tmp79 = (unsigned int )disketteExtension; + __cil_tmp79 = (unsigned int)disketteExtension; #line 1667 - __cil_tmp80 = __cil_tmp79 + 92; + __cil_tmp80 = __cil_tmp79 + 92; #line 1667 - mem_363 = (PKTHREAD *)__cil_tmp80; + mem_363 = (PKTHREAD *)__cil_tmp80; #line 1667 - __cil_tmp81 = *mem_363; + __cil_tmp81 = *mem_363; #line 1667 - __cil_tmp82 = (void *)__cil_tmp81; + __cil_tmp82 = (void *)__cil_tmp81; #line 1667 - ObfDereferenceObject(__cil_tmp82); - } - } else { - - } - } + ObfDereferenceObject(__cil_tmp82); + } + } else { + } + } #line 1670 - __cil_tmp83 = (unsigned int )disketteExtension; + __cil_tmp83 = (unsigned int)disketteExtension; #line 1670 - __cil_tmp84 = __cil_tmp83 + 92; + __cil_tmp84 = __cil_tmp83 + 92; #line 1670 - __cil_tmp85 = (void *)0; + __cil_tmp85 = (void *)0; #line 1670 - mem_364 = (PKTHREAD *)__cil_tmp84; + mem_364 = (PKTHREAD *)__cil_tmp84; #line 1670 - *mem_364 = (struct _KTHREAD *)__cil_tmp85; + *mem_364 = (struct _KTHREAD *)__cil_tmp85; #line 1672 - __cil_tmp86 = (unsigned int )Irp; + __cil_tmp86 = (unsigned int)Irp; #line 1672 - __cil_tmp87 = __cil_tmp86 + 24; + __cil_tmp87 = __cil_tmp86 + 24; #line 1672 - mem_365 = (NTSTATUS *)__cil_tmp87; + mem_365 = (NTSTATUS *)__cil_tmp87; #line 1672 - *mem_365 = 0L; + *mem_365 = 0L; #line 1673 - myStatus = 0L; + myStatus = 0L; #line 1674 - if (s == 1) { + if (s == 1) { #line 1673 - s = 3; - } else { - { + s = 3; + } else { + { #line 1673 - __VERIFIER_assert(0); - } - } - { + __VERIFIER_assert(0); + } + } + { #line 1674 - __cil_tmp88 = (unsigned int )Irp; + __cil_tmp88 = (unsigned int)Irp; #line 1674 - __cil_tmp89 = __cil_tmp88 + 35; + __cil_tmp89 = __cil_tmp88 + 35; #line 1674 - __cil_tmp90 = (unsigned int )Irp; + __cil_tmp90 = (unsigned int)Irp; #line 1674 - __cil_tmp91 = __cil_tmp90 + 35; + __cil_tmp91 = __cil_tmp90 + 35; #line 1674 - mem_366 = (CHAR *)__cil_tmp91; + mem_366 = (CHAR *)__cil_tmp91; #line 1674 - __cil_tmp92 = *mem_366; + __cil_tmp92 = *mem_366; #line 1674 - __cil_tmp93 = (int )__cil_tmp92; + __cil_tmp93 = (int)__cil_tmp92; #line 1674 - __cil_tmp94 = __cil_tmp93 + 1; + __cil_tmp94 = __cil_tmp93 + 1; #line 1674 - mem_367 = (CHAR *)__cil_tmp89; + mem_367 = (CHAR *)__cil_tmp89; #line 1674 - *mem_367 = (char )__cil_tmp94; + *mem_367 = (char)__cil_tmp94; #line 1674 - __cil_tmp95 = 24 + 8; + __cil_tmp95 = 24 + 8; #line 1674 - __cil_tmp96 = 0 + __cil_tmp95; + __cil_tmp96 = 0 + __cil_tmp95; #line 1674 - __cil_tmp97 = 64 + __cil_tmp96; + __cil_tmp97 = 64 + __cil_tmp96; #line 1674 - __cil_tmp98 = (unsigned int )Irp; + __cil_tmp98 = (unsigned int)Irp; #line 1674 - __cil_tmp99 = __cil_tmp98 + __cil_tmp97; + __cil_tmp99 = __cil_tmp98 + __cil_tmp97; #line 1674 - __cil_tmp100 = 24 + 8; + __cil_tmp100 = 24 + 8; #line 1674 - __cil_tmp101 = 0 + __cil_tmp100; + __cil_tmp101 = 0 + __cil_tmp100; #line 1674 - __cil_tmp102 = 64 + __cil_tmp101; + __cil_tmp102 = 64 + __cil_tmp101; #line 1674 - __cil_tmp103 = (unsigned int )Irp; + __cil_tmp103 = (unsigned int)Irp; #line 1674 - __cil_tmp104 = __cil_tmp103 + __cil_tmp102; + __cil_tmp104 = __cil_tmp103 + __cil_tmp102; #line 1674 - mem_368 = (struct _IO_STACK_LOCATION **)__cil_tmp104; + mem_368 = + (struct _IO_STACK_LOCATION **)__cil_tmp104; #line 1674 - __cil_tmp105 = *mem_368; + __cil_tmp105 = *mem_368; #line 1674 - mem_369 = (struct _IO_STACK_LOCATION **)__cil_tmp99; + mem_369 = (struct _IO_STACK_LOCATION **)__cil_tmp99; #line 1674 - *mem_369 = __cil_tmp105 + 1; + *mem_369 = __cil_tmp105 + 1; #line 1675 - __cil_tmp106 = (unsigned int )disketteExtension; + __cil_tmp106 = (unsigned int)disketteExtension; #line 1675 - __cil_tmp107 = __cil_tmp106 + 8; + __cil_tmp107 = __cil_tmp106 + 8; #line 1675 - mem_370 = (PDEVICE_OBJECT *)__cil_tmp107; + mem_370 = (PDEVICE_OBJECT *)__cil_tmp107; #line 1675 - __cil_tmp108 = *mem_370; + __cil_tmp108 = *mem_370; #line 1675 - ntStatus = IofCallDriver(__cil_tmp108, Irp); - } - } else { - { + ntStatus = IofCallDriver(__cil_tmp108, Irp); + } + } else { + { #line 1682 - ntStatus = -1073741823L; + ntStatus = -1073741823L; #line 1683 - __cil_tmp109 = (unsigned int )Irp; + __cil_tmp109 = (unsigned int)Irp; #line 1683 - __cil_tmp110 = __cil_tmp109 + 24; + __cil_tmp110 = __cil_tmp109 + 24; #line 1683 - mem_371 = (NTSTATUS *)__cil_tmp110; + mem_371 = (NTSTATUS *)__cil_tmp110; #line 1683 - *mem_371 = ntStatus; + *mem_371 = ntStatus; #line 1684 - myStatus = ntStatus; + myStatus = ntStatus; #line 1686 - __cil_tmp111 = 24 + 4; + __cil_tmp111 = 24 + 4; #line 1686 - __cil_tmp112 = (unsigned int )Irp; + __cil_tmp112 = (unsigned int)Irp; #line 1686 - __cil_tmp113 = __cil_tmp112 + __cil_tmp111; + __cil_tmp113 = __cil_tmp112 + __cil_tmp111; #line 1686 - mem_372 = (ULONG_PTR *)__cil_tmp113; + mem_372 = (ULONG_PTR *)__cil_tmp113; #line 1686 - *mem_372 = 0UL; + *mem_372 = 0UL; #line 1687 - IofCompleteRequest(Irp, (char)0); - } - } - goto switch_32_break; - switch_32_6: /* CIL Label */ ; - switch_32_3: /* CIL Label */ ; - { + IofCompleteRequest(Irp, (char)0); + } + } + goto switch_32_break; + switch_32_6: /* CIL Label */; + switch_32_3: /* CIL Label */; + { #line 1692 - __cil_tmp114 = (unsigned int )irpSp; + __cil_tmp114 = (unsigned int)irpSp; #line 1692 - __cil_tmp115 = __cil_tmp114 + 1; + __cil_tmp115 = __cil_tmp114 + 1; #line 1692 - mem_373 = (UCHAR *)__cil_tmp115; + mem_373 = (UCHAR *)__cil_tmp115; #line 1692 - __cil_tmp116 = *mem_373; + __cil_tmp116 = *mem_373; #line 1692 - __cil_tmp117 = (int )__cil_tmp116; + __cil_tmp117 = (int)__cil_tmp116; #line 1692 - if (__cil_tmp117 == 6) { - { + if (__cil_tmp117 == 6) { + { #line 1693 - while (1) { - while_35_continue: /* CIL Label */ ; - goto while_35_break; - } - while_35_break: /* CIL Label */ ; - } - } else { - { + while (1) { + while_35_continue: /* CIL Label */; + goto while_35_break; + } + while_35_break: /* CIL Label */; + } + } else { + { #line 1695 - while (1) { - while_36_continue: /* CIL Label */ ; - goto while_36_break; - } - while_36_break: /* CIL Label */ ; - } - } - } - { + while (1) { + while_36_continue: /* CIL Label */; + goto while_36_break; + } + while_36_break: /* CIL Label */; + } + } + } + { #line 1698 - __cil_tmp118 = (unsigned int )disketteExtension; + __cil_tmp118 = (unsigned int)disketteExtension; #line 1698 - __cil_tmp119 = __cil_tmp118 + 12; + __cil_tmp119 = __cil_tmp118 + 12; #line 1698 - mem_374 = (BOOLEAN *)__cil_tmp119; + mem_374 = (BOOLEAN *)__cil_tmp119; #line 1698 - __cil_tmp120 = *mem_374; + __cil_tmp120 = *mem_374; #line 1698 - if (! __cil_tmp120) { + if (!__cil_tmp120) { #line 1706 - __cil_tmp121 = (unsigned int )Irp; + __cil_tmp121 = (unsigned int)Irp; #line 1706 - __cil_tmp122 = __cil_tmp121 + 24; + __cil_tmp122 = __cil_tmp121 + 24; #line 1706 - mem_375 = (NTSTATUS *)__cil_tmp122; + mem_375 = (NTSTATUS *)__cil_tmp122; #line 1706 - *mem_375 = 0L; + *mem_375 = 0L; #line 1707 - myStatus = 0L; + myStatus = 0L; #line 1709 - if (s == 1) { + if (s == 1) { #line 1707 - s = 3; - } else { - { + s = 3; + } else { + { #line 1707 - __VERIFIER_assert(0); - } - } - { + __VERIFIER_assert(0); + } + } + { #line 1708 - __cil_tmp123 = (unsigned int )Irp; + __cil_tmp123 = (unsigned int)Irp; #line 1708 - __cil_tmp124 = __cil_tmp123 + 35; + __cil_tmp124 = __cil_tmp123 + 35; #line 1708 - __cil_tmp125 = (unsigned int )Irp; + __cil_tmp125 = (unsigned int)Irp; #line 1708 - __cil_tmp126 = __cil_tmp125 + 35; + __cil_tmp126 = __cil_tmp125 + 35; #line 1708 - mem_376 = (CHAR *)__cil_tmp126; + mem_376 = (CHAR *)__cil_tmp126; #line 1708 - __cil_tmp127 = *mem_376; + __cil_tmp127 = *mem_376; #line 1708 - __cil_tmp128 = (int )__cil_tmp127; + __cil_tmp128 = (int)__cil_tmp127; #line 1708 - __cil_tmp129 = __cil_tmp128 + 1; + __cil_tmp129 = __cil_tmp128 + 1; #line 1708 - mem_377 = (CHAR *)__cil_tmp124; + mem_377 = (CHAR *)__cil_tmp124; #line 1708 - *mem_377 = (char )__cil_tmp129; + *mem_377 = (char)__cil_tmp129; #line 1708 - __cil_tmp130 = 24 + 8; + __cil_tmp130 = 24 + 8; #line 1708 - __cil_tmp131 = 0 + __cil_tmp130; + __cil_tmp131 = 0 + __cil_tmp130; #line 1708 - __cil_tmp132 = 64 + __cil_tmp131; + __cil_tmp132 = 64 + __cil_tmp131; #line 1708 - __cil_tmp133 = (unsigned int )Irp; + __cil_tmp133 = (unsigned int)Irp; #line 1708 - __cil_tmp134 = __cil_tmp133 + __cil_tmp132; + __cil_tmp134 = __cil_tmp133 + __cil_tmp132; #line 1708 - __cil_tmp135 = 24 + 8; + __cil_tmp135 = 24 + 8; #line 1708 - __cil_tmp136 = 0 + __cil_tmp135; + __cil_tmp136 = 0 + __cil_tmp135; #line 1708 - __cil_tmp137 = 64 + __cil_tmp136; + __cil_tmp137 = 64 + __cil_tmp136; #line 1708 - __cil_tmp138 = (unsigned int )Irp; + __cil_tmp138 = (unsigned int)Irp; #line 1708 - __cil_tmp139 = __cil_tmp138 + __cil_tmp137; + __cil_tmp139 = __cil_tmp138 + __cil_tmp137; #line 1708 - mem_378 = (struct _IO_STACK_LOCATION **)__cil_tmp139; + mem_378 = + (struct _IO_STACK_LOCATION **)__cil_tmp139; #line 1708 - __cil_tmp140 = *mem_378; + __cil_tmp140 = *mem_378; #line 1708 - mem_379 = (struct _IO_STACK_LOCATION **)__cil_tmp134; + mem_379 = + (struct _IO_STACK_LOCATION **)__cil_tmp134; #line 1708 - *mem_379 = __cil_tmp140 + 1; + *mem_379 = __cil_tmp140 + 1; #line 1709 - __cil_tmp141 = (unsigned int )disketteExtension; + __cil_tmp141 = (unsigned int)disketteExtension; #line 1709 - __cil_tmp142 = __cil_tmp141 + 8; + __cil_tmp142 = __cil_tmp141 + 8; #line 1709 - mem_380 = (PDEVICE_OBJECT *)__cil_tmp142; + mem_380 = (PDEVICE_OBJECT *)__cil_tmp142; #line 1709 - __cil_tmp143 = *mem_380; + __cil_tmp143 = *mem_380; #line 1709 - ntStatus = IofCallDriver(__cil_tmp143, Irp); - } - } else { - { + ntStatus = IofCallDriver(__cil_tmp143, Irp); + } + } else { + { #line 1718 - __cil_tmp144 = (unsigned int )Irp; + __cil_tmp144 = (unsigned int)Irp; #line 1718 - __cil_tmp145 = __cil_tmp144 + 24; + __cil_tmp145 = __cil_tmp144 + 24; #line 1718 - mem_381 = (NTSTATUS *)__cil_tmp145; + mem_381 = (NTSTATUS *)__cil_tmp145; #line 1718 - *mem_381 = 0L; + *mem_381 = 0L; #line 1719 - myStatus = 0L; + myStatus = 0L; #line 1723 - __cil_tmp146 = 24 + 8; + __cil_tmp146 = 24 + 8; #line 1723 - __cil_tmp147 = 0 + __cil_tmp146; + __cil_tmp147 = 0 + __cil_tmp146; #line 1723 - __cil_tmp148 = 64 + __cil_tmp147; + __cil_tmp148 = 64 + __cil_tmp147; #line 1723 - __cil_tmp149 = (unsigned int )Irp; + __cil_tmp149 = (unsigned int)Irp; #line 1723 - __cil_tmp150 = __cil_tmp149 + __cil_tmp148; + __cil_tmp150 = __cil_tmp149 + __cil_tmp148; #line 1723 - mem_382 = (struct _IO_STACK_LOCATION **)__cil_tmp150; + mem_382 = + (struct _IO_STACK_LOCATION **)__cil_tmp150; #line 1723 - irpSp___0 = *mem_382; + irpSp___0 = *mem_382; #line 1723 - __cil_tmp151 = 24 + 8; + __cil_tmp151 = 24 + 8; #line 1723 - __cil_tmp152 = 0 + __cil_tmp151; + __cil_tmp152 = 0 + __cil_tmp151; #line 1723 - __cil_tmp153 = 64 + __cil_tmp152; + __cil_tmp153 = 64 + __cil_tmp152; #line 1723 - __cil_tmp154 = (unsigned int )Irp; + __cil_tmp154 = (unsigned int)Irp; #line 1723 - __cil_tmp155 = __cil_tmp154 + __cil_tmp153; + __cil_tmp155 = __cil_tmp154 + __cil_tmp153; #line 1723 - mem_383 = (struct _IO_STACK_LOCATION **)__cil_tmp155; + mem_383 = + (struct _IO_STACK_LOCATION **)__cil_tmp155; #line 1723 - __cil_tmp156 = *mem_383; + __cil_tmp156 = *mem_383; #line 1723 - nextIrpSp = __cil_tmp156 - 1; + nextIrpSp = __cil_tmp156 - 1; #line 1723 - __cil_tmp157 = (void *)nextIrpSp; + __cil_tmp157 = (void *)nextIrpSp; #line 1723 - __cil_tmp158 = (void const *)irpSp___0; + __cil_tmp158 = (void const *)irpSp___0; #line 1723 - __cil_tmp159 = (IO_STACK_LOCATION *)0; + __cil_tmp159 = (IO_STACK_LOCATION *)0; #line 1723 - __cil_tmp160 = (unsigned int )__cil_tmp159; + __cil_tmp160 = (unsigned int)__cil_tmp159; #line 1723 - __cil_tmp161 = __cil_tmp160 + 112; + __cil_tmp161 = __cil_tmp160 + 112; #line 1723 - __cil_tmp162 = (NTSTATUS (**)(PDEVICE_OBJECT DeviceObject , PIRP Irp , - PVOID Context ))__cil_tmp161; + __cil_tmp162 = (NTSTATUS(**)( + PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context))__cil_tmp161; #line 1723 - __cil_tmp163 = (long )__cil_tmp162; + __cil_tmp163 = (long)__cil_tmp162; #line 1723 - __cil_tmp164 = (unsigned int )__cil_tmp163; + __cil_tmp164 = (unsigned int)__cil_tmp163; #line 1723 - memcpy(__cil_tmp157, __cil_tmp158, __cil_tmp164); + memcpy(__cil_tmp157, __cil_tmp158, __cil_tmp164); #line 1723 - __cil_tmp165 = (unsigned int )nextIrpSp; + __cil_tmp165 = (unsigned int)nextIrpSp; #line 1723 - __cil_tmp166 = __cil_tmp165 + 3; + __cil_tmp166 = __cil_tmp165 + 3; #line 1723 - mem_384 = (UCHAR *)__cil_tmp166; + mem_384 = (UCHAR *)__cil_tmp166; #line 1723 - *mem_384 = (unsigned char)0; + *mem_384 = (unsigned char)0; #line 1729 - __cil_tmp167 = (enum _EVENT_TYPE )1; + __cil_tmp167 = (enum _EVENT_TYPE)1; #line 1729 - KeInitializeEvent(& doneEvent, __cil_tmp167, (unsigned char)0); - } + KeInitializeEvent(&doneEvent, __cil_tmp167, + (unsigned char)0); + } #line 1733 - if (s != 1) { - { + if (s != 1) { + { #line 1733 - __VERIFIER_assert(0); - } - } else { + __VERIFIER_assert(0); + } + } else { #line 1735 - if (compRegistered != 0) { - { + if (compRegistered != 0) { + { #line 1735 - __VERIFIER_assert(0); - } - } else { + __VERIFIER_assert(0); + } + } else { #line 1737 - compRegistered = 1; + compRegistered = 1; #line 1738 - compFptr = & FloppyPnpComplete; - } - } - { + compFptr = &FloppyPnpComplete; + } + } + { #line 1744 - __cil_tmp168 = 24 + 8; + __cil_tmp168 = 24 + 8; #line 1744 - __cil_tmp169 = 0 + __cil_tmp168; + __cil_tmp169 = 0 + __cil_tmp168; #line 1744 - __cil_tmp170 = 64 + __cil_tmp169; + __cil_tmp170 = 64 + __cil_tmp169; #line 1744 - __cil_tmp171 = (unsigned int )Irp; + __cil_tmp171 = (unsigned int)Irp; #line 1744 - __cil_tmp172 = __cil_tmp171 + __cil_tmp170; + __cil_tmp172 = __cil_tmp171 + __cil_tmp170; #line 1744 - mem_385 = (struct _IO_STACK_LOCATION **)__cil_tmp172; + mem_385 = + (struct _IO_STACK_LOCATION **)__cil_tmp172; #line 1744 - __cil_tmp173 = *mem_385; + __cil_tmp173 = *mem_385; #line 1744 - irpSp___1 = __cil_tmp173 - 1; + irpSp___1 = __cil_tmp173 - 1; #line 1744 - __cil_tmp174 = (unsigned int )irpSp___1; + __cil_tmp174 = (unsigned int)irpSp___1; #line 1744 - __cil_tmp175 = __cil_tmp174 + 112; + __cil_tmp175 = __cil_tmp174 + 112; #line 1744 - mem_386 = (NTSTATUS (**)(PDEVICE_OBJECT DeviceObject , PIRP Irp , - PVOID Context ))__cil_tmp175; + mem_386 = (NTSTATUS(**)( + PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context))__cil_tmp175; #line 1744 - *mem_386 = & FloppyPnpComplete; + *mem_386 = &FloppyPnpComplete; #line 1744 - __cil_tmp176 = (unsigned int )irpSp___1; + __cil_tmp176 = (unsigned int)irpSp___1; #line 1744 - __cil_tmp177 = __cil_tmp176 + 116; + __cil_tmp177 = __cil_tmp176 + 116; #line 1744 - mem_387 = (PVOID *)__cil_tmp177; + mem_387 = (PVOID *)__cil_tmp177; #line 1744 - *mem_387 = (void *)(& doneEvent); + *mem_387 = (void *)(&doneEvent); #line 1744 - __cil_tmp178 = (unsigned int )irpSp___1; + __cil_tmp178 = (unsigned int)irpSp___1; #line 1744 - __cil_tmp179 = __cil_tmp178 + 3; + __cil_tmp179 = __cil_tmp178 + 3; #line 1744 - mem_388 = (UCHAR *)__cil_tmp179; + mem_388 = (UCHAR *)__cil_tmp179; #line 1744 - *mem_388 = (unsigned char)0; + *mem_388 = (unsigned char)0; #line 1744 - __cil_tmp180 = (unsigned int )irpSp___1; + __cil_tmp180 = (unsigned int)irpSp___1; #line 1744 - __cil_tmp181 = __cil_tmp180 + 3; + __cil_tmp181 = __cil_tmp180 + 3; #line 1744 - mem_389 = (UCHAR *)__cil_tmp181; + mem_389 = (UCHAR *)__cil_tmp181; #line 1744 - *mem_389 = (unsigned char)64; + *mem_389 = (unsigned char)64; #line 1744 - __cil_tmp182 = (unsigned int )irpSp___1; + __cil_tmp182 = (unsigned int)irpSp___1; #line 1744 - __cil_tmp183 = __cil_tmp182 + 3; + __cil_tmp183 = __cil_tmp182 + 3; #line 1744 - __cil_tmp184 = (unsigned int )irpSp___1; + __cil_tmp184 = (unsigned int)irpSp___1; #line 1744 - __cil_tmp185 = __cil_tmp184 + 3; + __cil_tmp185 = __cil_tmp184 + 3; #line 1744 - mem_390 = (UCHAR *)__cil_tmp185; + mem_390 = (UCHAR *)__cil_tmp185; #line 1744 - __cil_tmp186 = *mem_390; + __cil_tmp186 = *mem_390; #line 1744 - __cil_tmp187 = (int )__cil_tmp186; + __cil_tmp187 = (int)__cil_tmp186; #line 1744 - __cil_tmp188 = __cil_tmp187 | 128; + __cil_tmp188 = __cil_tmp187 | 128; #line 1744 - mem_391 = (UCHAR *)__cil_tmp183; + mem_391 = (UCHAR *)__cil_tmp183; #line 1744 - *mem_391 = (unsigned char )__cil_tmp188; + *mem_391 = (unsigned char)__cil_tmp188; #line 1744 - __cil_tmp189 = (unsigned int )irpSp___1; + __cil_tmp189 = (unsigned int)irpSp___1; #line 1744 - __cil_tmp190 = __cil_tmp189 + 3; + __cil_tmp190 = __cil_tmp189 + 3; #line 1744 - __cil_tmp191 = (unsigned int )irpSp___1; + __cil_tmp191 = (unsigned int)irpSp___1; #line 1744 - __cil_tmp192 = __cil_tmp191 + 3; + __cil_tmp192 = __cil_tmp191 + 3; #line 1744 - mem_392 = (UCHAR *)__cil_tmp192; + mem_392 = (UCHAR *)__cil_tmp192; #line 1744 - __cil_tmp193 = *mem_392; + __cil_tmp193 = *mem_392; #line 1744 - __cil_tmp194 = (int )__cil_tmp193; + __cil_tmp194 = (int)__cil_tmp193; #line 1744 - __cil_tmp195 = __cil_tmp194 | 32; + __cil_tmp195 = __cil_tmp194 | 32; #line 1744 - mem_393 = (UCHAR *)__cil_tmp190; + mem_393 = (UCHAR *)__cil_tmp190; #line 1744 - *mem_393 = (unsigned char )__cil_tmp195; + *mem_393 = (unsigned char)__cil_tmp195; #line 1746 - __cil_tmp196 = (unsigned int )disketteExtension; + __cil_tmp196 = (unsigned int)disketteExtension; #line 1746 - __cil_tmp197 = __cil_tmp196 + 8; + __cil_tmp197 = __cil_tmp196 + 8; #line 1746 - mem_394 = (PDEVICE_OBJECT *)__cil_tmp197; + mem_394 = (PDEVICE_OBJECT *)__cil_tmp197; #line 1746 - __cil_tmp198 = *mem_394; + __cil_tmp198 = *mem_394; #line 1746 - ntStatus = IofCallDriver(__cil_tmp198, Irp); - } + ntStatus = IofCallDriver(__cil_tmp198, Irp); + } #line 1748 - if (ntStatus == 259L) { - { + if (ntStatus == 259L) { + { #line 1750 - __cil_tmp199 = (void *)(& doneEvent); + __cil_tmp199 = (void *)(&doneEvent); #line 1750 - __cil_tmp200 = (enum _KWAIT_REASON )0; + __cil_tmp200 = (enum _KWAIT_REASON)0; #line 1750 - __cil_tmp201 = (void *)0; + __cil_tmp201 = (void *)0; #line 1750 - __cil_tmp202 = (LARGE_INTEGER *)__cil_tmp201; + __cil_tmp202 = (LARGE_INTEGER *)__cil_tmp201; #line 1750 - KeWaitForSingleObject(__cil_tmp199, __cil_tmp200, (char)0, (unsigned char)0, - __cil_tmp202); + KeWaitForSingleObject( + __cil_tmp199, __cil_tmp200, (char)0, + (unsigned char)0, __cil_tmp202); #line 1757 - ntStatus = myStatus; - } - } else { - - } - { + ntStatus = myStatus; + } + } else { + } + { #line 1759 - __cil_tmp203 = (unsigned int )disketteExtension; + __cil_tmp203 = (unsigned int)disketteExtension; #line 1759 - __cil_tmp204 = __cil_tmp203 + 428; + __cil_tmp204 = __cil_tmp203 + 428; #line 1759 - __cil_tmp205 = (FAST_MUTEX *)__cil_tmp204; + __cil_tmp205 = (FAST_MUTEX *)__cil_tmp204; #line 1759 - ExAcquireFastMutex(__cil_tmp205); + ExAcquireFastMutex(__cil_tmp205); #line 1760 - __cil_tmp206 = (unsigned int )disketteExtension; + __cil_tmp206 = (unsigned int)disketteExtension; #line 1760 - __cil_tmp207 = __cil_tmp206 + 14; + __cil_tmp207 = __cil_tmp206 + 14; #line 1760 - mem_395 = (BOOLEAN *)__cil_tmp207; + mem_395 = (BOOLEAN *)__cil_tmp207; #line 1760 - *mem_395 = (unsigned char)0; + *mem_395 = (unsigned char)0; #line 1761 - __cil_tmp208 = (unsigned int )disketteExtension; + __cil_tmp208 = (unsigned int)disketteExtension; #line 1761 - __cil_tmp209 = __cil_tmp208 + 428; + __cil_tmp209 = __cil_tmp208 + 428; #line 1761 - __cil_tmp210 = (FAST_MUTEX *)__cil_tmp209; + __cil_tmp210 = (FAST_MUTEX *)__cil_tmp209; #line 1761 - ExReleaseFastMutex(__cil_tmp210); + ExReleaseFastMutex(__cil_tmp210); #line 1766 - FloppyProcessQueuedRequests(disketteExtension); + FloppyProcessQueuedRequests(disketteExtension); #line 1772 - __cil_tmp211 = (unsigned int )Irp; + __cil_tmp211 = (unsigned int)Irp; #line 1772 - __cil_tmp212 = __cil_tmp211 + 24; + __cil_tmp212 = __cil_tmp211 + 24; #line 1772 - mem_396 = (NTSTATUS *)__cil_tmp212; + mem_396 = (NTSTATUS *)__cil_tmp212; #line 1772 - *mem_396 = ntStatus; + *mem_396 = ntStatus; #line 1773 - myStatus = ntStatus; + myStatus = ntStatus; #line 1775 - __cil_tmp213 = 24 + 4; + __cil_tmp213 = 24 + 4; #line 1775 - __cil_tmp214 = (unsigned int )Irp; + __cil_tmp214 = (unsigned int)Irp; #line 1775 - __cil_tmp215 = __cil_tmp214 + __cil_tmp213; + __cil_tmp215 = __cil_tmp214 + __cil_tmp213; #line 1775 - mem_397 = (ULONG_PTR *)__cil_tmp215; + mem_397 = (ULONG_PTR *)__cil_tmp215; #line 1775 - *mem_397 = 0UL; + *mem_397 = 0UL; #line 1776 - IofCompleteRequest(Irp, (char)0); - } - } - } - goto switch_32_break; - switch_32_4: /* CIL Label */ ; - { + IofCompleteRequest(Irp, (char)0); + } + } + } + goto switch_32_break; + switch_32_4: /* CIL Label */; + { #line 1780 - while (1) { - while_37_continue: /* CIL Label */ ; - goto while_37_break; - } - while_37_break: /* CIL Label */ ; - } + while (1) { + while_37_continue: /* CIL Label */; + goto while_37_break; + } + while_37_break: /* CIL Label */; + } #line 1782 - __cil_tmp216 = (unsigned int )disketteExtension; + __cil_tmp216 = (unsigned int)disketteExtension; #line 1782 - __cil_tmp217 = __cil_tmp216 + 12; + __cil_tmp217 = __cil_tmp216 + 12; #line 1782 - mem_398 = (BOOLEAN *)__cil_tmp217; + mem_398 = (BOOLEAN *)__cil_tmp217; #line 1782 - *mem_398 = (unsigned char)0; + *mem_398 = (unsigned char)0; #line 1784 - __cil_tmp218 = (unsigned int )Irp; + __cil_tmp218 = (unsigned int)Irp; #line 1784 - __cil_tmp219 = __cil_tmp218 + 24; + __cil_tmp219 = __cil_tmp218 + 24; #line 1784 - mem_399 = (NTSTATUS *)__cil_tmp219; + mem_399 = (NTSTATUS *)__cil_tmp219; #line 1784 - *mem_399 = 0L; + *mem_399 = 0L; #line 1785 - myStatus = 0L; + myStatus = 0L; #line 1786 - if (s == 1) { + if (s == 1) { #line 1785 - s = 3; - } else { - { + s = 3; + } else { + { #line 1785 - __VERIFIER_assert(0); - } - } - { + __VERIFIER_assert(0); + } + } + { #line 1786 - __cil_tmp220 = (unsigned int )Irp; + __cil_tmp220 = (unsigned int)Irp; #line 1786 - __cil_tmp221 = __cil_tmp220 + 35; + __cil_tmp221 = __cil_tmp220 + 35; #line 1786 - __cil_tmp222 = (unsigned int )Irp; + __cil_tmp222 = (unsigned int)Irp; #line 1786 - __cil_tmp223 = __cil_tmp222 + 35; + __cil_tmp223 = __cil_tmp222 + 35; #line 1786 - mem_400 = (CHAR *)__cil_tmp223; + mem_400 = (CHAR *)__cil_tmp223; #line 1786 - __cil_tmp224 = *mem_400; + __cil_tmp224 = *mem_400; #line 1786 - __cil_tmp225 = (int )__cil_tmp224; + __cil_tmp225 = (int)__cil_tmp224; #line 1786 - __cil_tmp226 = __cil_tmp225 + 1; + __cil_tmp226 = __cil_tmp225 + 1; #line 1786 - mem_401 = (CHAR *)__cil_tmp221; + mem_401 = (CHAR *)__cil_tmp221; #line 1786 - *mem_401 = (char )__cil_tmp226; + *mem_401 = (char)__cil_tmp226; #line 1786 - __cil_tmp227 = 24 + 8; + __cil_tmp227 = 24 + 8; #line 1786 - __cil_tmp228 = 0 + __cil_tmp227; + __cil_tmp228 = 0 + __cil_tmp227; #line 1786 - __cil_tmp229 = 64 + __cil_tmp228; + __cil_tmp229 = 64 + __cil_tmp228; #line 1786 - __cil_tmp230 = (unsigned int )Irp; + __cil_tmp230 = (unsigned int)Irp; #line 1786 - __cil_tmp231 = __cil_tmp230 + __cil_tmp229; + __cil_tmp231 = __cil_tmp230 + __cil_tmp229; #line 1786 - __cil_tmp232 = 24 + 8; + __cil_tmp232 = 24 + 8; #line 1786 - __cil_tmp233 = 0 + __cil_tmp232; + __cil_tmp233 = 0 + __cil_tmp232; #line 1786 - __cil_tmp234 = 64 + __cil_tmp233; + __cil_tmp234 = 64 + __cil_tmp233; #line 1786 - __cil_tmp235 = (unsigned int )Irp; + __cil_tmp235 = (unsigned int)Irp; #line 1786 - __cil_tmp236 = __cil_tmp235 + __cil_tmp234; + __cil_tmp236 = __cil_tmp235 + __cil_tmp234; #line 1786 - mem_402 = (struct _IO_STACK_LOCATION **)__cil_tmp236; + mem_402 = (struct _IO_STACK_LOCATION **)__cil_tmp236; #line 1786 - __cil_tmp237 = *mem_402; + __cil_tmp237 = *mem_402; #line 1786 - mem_403 = (struct _IO_STACK_LOCATION **)__cil_tmp231; + mem_403 = (struct _IO_STACK_LOCATION **)__cil_tmp231; #line 1786 - *mem_403 = __cil_tmp237 + 1; + *mem_403 = __cil_tmp237 + 1; #line 1787 - __cil_tmp238 = (unsigned int )disketteExtension; + __cil_tmp238 = (unsigned int)disketteExtension; #line 1787 - __cil_tmp239 = __cil_tmp238 + 8; + __cil_tmp239 = __cil_tmp238 + 8; #line 1787 - mem_404 = (PDEVICE_OBJECT *)__cil_tmp239; + mem_404 = (PDEVICE_OBJECT *)__cil_tmp239; #line 1787 - __cil_tmp240 = *mem_404; + __cil_tmp240 = *mem_404; #line 1787 - ntStatus = IofCallDriver(__cil_tmp240, Irp); - } - goto switch_32_break; - switch_32_2: /* CIL Label */ ; - { + ntStatus = IofCallDriver(__cil_tmp240, Irp); + } + goto switch_32_break; + switch_32_2: /* CIL Label */; + { #line 1793 - while (1) { - while_38_continue: /* CIL Label */ ; - goto while_38_break; - } - while_38_break: /* CIL Label */ ; - } - { + while (1) { + while_38_continue: /* CIL Label */; + goto while_38_break; + } + while_38_break: /* CIL Label */; + } + { #line 1800 - __cil_tmp241 = (unsigned int )disketteExtension; + __cil_tmp241 = (unsigned int)disketteExtension; #line 1800 - __cil_tmp242 = __cil_tmp241 + 428; + __cil_tmp242 = __cil_tmp241 + 428; #line 1800 - __cil_tmp243 = (FAST_MUTEX *)__cil_tmp242; + __cil_tmp243 = (FAST_MUTEX *)__cil_tmp242; #line 1800 - ExAcquireFastMutex(__cil_tmp243); + ExAcquireFastMutex(__cil_tmp243); #line 1801 - __cil_tmp244 = (unsigned int )disketteExtension; + __cil_tmp244 = (unsigned int)disketteExtension; #line 1801 - __cil_tmp245 = __cil_tmp244 + 14; + __cil_tmp245 = __cil_tmp244 + 14; #line 1801 - mem_405 = (BOOLEAN *)__cil_tmp245; + mem_405 = (BOOLEAN *)__cil_tmp245; #line 1801 - *mem_405 = (unsigned char)0; + *mem_405 = (unsigned char)0; #line 1802 - __cil_tmp246 = (unsigned int )disketteExtension; + __cil_tmp246 = (unsigned int)disketteExtension; #line 1802 - __cil_tmp247 = __cil_tmp246 + 428; + __cil_tmp247 = __cil_tmp246 + 428; #line 1802 - __cil_tmp248 = (FAST_MUTEX *)__cil_tmp247; + __cil_tmp248 = (FAST_MUTEX *)__cil_tmp247; #line 1802 - ExReleaseFastMutex(__cil_tmp248); + ExReleaseFastMutex(__cil_tmp248); #line 1804 - __cil_tmp249 = (unsigned int )disketteExtension; + __cil_tmp249 = (unsigned int)disketteExtension; #line 1804 - __cil_tmp250 = __cil_tmp249 + 12; + __cil_tmp250 = __cil_tmp249 + 12; #line 1804 - mem_406 = (BOOLEAN *)__cil_tmp250; + mem_406 = (BOOLEAN *)__cil_tmp250; #line 1804 - *mem_406 = (unsigned char)0; + *mem_406 = (unsigned char)0; #line 1805 - __cil_tmp251 = (unsigned int )disketteExtension; + __cil_tmp251 = (unsigned int)disketteExtension; #line 1805 - __cil_tmp252 = __cil_tmp251 + 13; + __cil_tmp252 = __cil_tmp251 + 13; #line 1805 - mem_407 = (BOOLEAN *)__cil_tmp252; + mem_407 = (BOOLEAN *)__cil_tmp252; #line 1805 - *mem_407 = (unsigned char)1; + *mem_407 = (unsigned char)1; #line 1815 - FloppyProcessQueuedRequests(disketteExtension); - } + FloppyProcessQueuedRequests(disketteExtension); + } #line 1820 - if (s == 1) { + if (s == 1) { #line 1820 - s = 3; - } else { - { + s = 3; + } else { + { #line 1820 - __VERIFIER_assert(0); - } - } - { + __VERIFIER_assert(0); + } + } + { #line 1821 - __cil_tmp253 = (unsigned int )Irp; + __cil_tmp253 = (unsigned int)Irp; #line 1821 - __cil_tmp254 = __cil_tmp253 + 35; + __cil_tmp254 = __cil_tmp253 + 35; #line 1821 - __cil_tmp255 = (unsigned int )Irp; + __cil_tmp255 = (unsigned int)Irp; #line 1821 - __cil_tmp256 = __cil_tmp255 + 35; + __cil_tmp256 = __cil_tmp255 + 35; #line 1821 - mem_408 = (CHAR *)__cil_tmp256; + mem_408 = (CHAR *)__cil_tmp256; #line 1821 - __cil_tmp257 = *mem_408; + __cil_tmp257 = *mem_408; #line 1821 - __cil_tmp258 = (int )__cil_tmp257; + __cil_tmp258 = (int)__cil_tmp257; #line 1821 - __cil_tmp259 = __cil_tmp258 + 1; + __cil_tmp259 = __cil_tmp258 + 1; #line 1821 - mem_409 = (CHAR *)__cil_tmp254; + mem_409 = (CHAR *)__cil_tmp254; #line 1821 - *mem_409 = (char )__cil_tmp259; + *mem_409 = (char)__cil_tmp259; #line 1821 - __cil_tmp260 = 24 + 8; + __cil_tmp260 = 24 + 8; #line 1821 - __cil_tmp261 = 0 + __cil_tmp260; + __cil_tmp261 = 0 + __cil_tmp260; #line 1821 - __cil_tmp262 = 64 + __cil_tmp261; + __cil_tmp262 = 64 + __cil_tmp261; #line 1821 - __cil_tmp263 = (unsigned int )Irp; + __cil_tmp263 = (unsigned int)Irp; #line 1821 - __cil_tmp264 = __cil_tmp263 + __cil_tmp262; + __cil_tmp264 = __cil_tmp263 + __cil_tmp262; #line 1821 - __cil_tmp265 = 24 + 8; + __cil_tmp265 = 24 + 8; #line 1821 - __cil_tmp266 = 0 + __cil_tmp265; + __cil_tmp266 = 0 + __cil_tmp265; #line 1821 - __cil_tmp267 = 64 + __cil_tmp266; + __cil_tmp267 = 64 + __cil_tmp266; #line 1821 - __cil_tmp268 = (unsigned int )Irp; + __cil_tmp268 = (unsigned int)Irp; #line 1821 - __cil_tmp269 = __cil_tmp268 + __cil_tmp267; + __cil_tmp269 = __cil_tmp268 + __cil_tmp267; #line 1821 - mem_410 = (struct _IO_STACK_LOCATION **)__cil_tmp269; + mem_410 = (struct _IO_STACK_LOCATION **)__cil_tmp269; #line 1821 - __cil_tmp270 = *mem_410; + __cil_tmp270 = *mem_410; #line 1821 - mem_411 = (struct _IO_STACK_LOCATION **)__cil_tmp264; + mem_411 = (struct _IO_STACK_LOCATION **)__cil_tmp264; #line 1821 - *mem_411 = __cil_tmp270 + 1; + *mem_411 = __cil_tmp270 + 1; #line 1822 - __cil_tmp271 = (unsigned int )Irp; + __cil_tmp271 = (unsigned int)Irp; #line 1822 - __cil_tmp272 = __cil_tmp271 + 24; + __cil_tmp272 = __cil_tmp271 + 24; #line 1822 - mem_412 = (NTSTATUS *)__cil_tmp272; + mem_412 = (NTSTATUS *)__cil_tmp272; #line 1822 - *mem_412 = 0L; + *mem_412 = 0L; #line 1823 - myStatus = 0L; + myStatus = 0L; #line 1824 - __cil_tmp273 = (unsigned int )disketteExtension; + __cil_tmp273 = (unsigned int)disketteExtension; #line 1824 - __cil_tmp274 = __cil_tmp273 + 8; + __cil_tmp274 = __cil_tmp273 + 8; #line 1824 - mem_413 = (PDEVICE_OBJECT *)__cil_tmp274; + mem_413 = (PDEVICE_OBJECT *)__cil_tmp274; #line 1824 - __cil_tmp275 = *mem_413; + __cil_tmp275 = *mem_413; #line 1824 - ntStatus = IofCallDriver(__cil_tmp275, Irp); - } - { + ntStatus = IofCallDriver(__cil_tmp275, Irp); + } + { #line 1828 - __cil_tmp276 = (void *)0; + __cil_tmp276 = (void *)0; #line 1828 - __cil_tmp277 = (unsigned int )__cil_tmp276; + __cil_tmp277 = (unsigned int)__cil_tmp276; #line 1828 - __cil_tmp278 = 376 + 4; + __cil_tmp278 = 376 + 4; #line 1828 - __cil_tmp279 = (unsigned int )disketteExtension; + __cil_tmp279 = (unsigned int)disketteExtension; #line 1828 - __cil_tmp280 = __cil_tmp279 + __cil_tmp278; + __cil_tmp280 = __cil_tmp279 + __cil_tmp278; #line 1828 - mem_414 = (PWSTR *)__cil_tmp280; + mem_414 = (PWSTR *)__cil_tmp280; #line 1828 - __cil_tmp281 = *mem_414; + __cil_tmp281 = *mem_414; #line 1828 - __cil_tmp282 = (unsigned int )__cil_tmp281; + __cil_tmp282 = (unsigned int)__cil_tmp281; #line 1828 - if (__cil_tmp282 != __cil_tmp277) { - { + if (__cil_tmp282 != __cil_tmp277) { + { #line 1830 - __cil_tmp283 = (unsigned int )disketteExtension; + __cil_tmp283 = (unsigned int)disketteExtension; #line 1830 - __cil_tmp284 = __cil_tmp283 + 376; + __cil_tmp284 = __cil_tmp283 + 376; #line 1830 - __cil_tmp285 = (UNICODE_STRING *)__cil_tmp284; + __cil_tmp285 = (UNICODE_STRING *)__cil_tmp284; #line 1830 - IoSetDeviceInterfaceState(__cil_tmp285, (unsigned char)0); + IoSetDeviceInterfaceState(__cil_tmp285, + (unsigned char)0); #line 1833 - __cil_tmp286 = (unsigned int )disketteExtension; + __cil_tmp286 = (unsigned int)disketteExtension; #line 1833 - __cil_tmp287 = __cil_tmp286 + 376; + __cil_tmp287 = __cil_tmp286 + 376; #line 1833 - __cil_tmp288 = (UNICODE_STRING *)__cil_tmp287; + __cil_tmp288 = (UNICODE_STRING *)__cil_tmp287; #line 1833 - RtlFreeUnicodeString(__cil_tmp288); + RtlFreeUnicodeString(__cil_tmp288); #line 1834 - __cil_tmp289 = (unsigned int )disketteExtension; + __cil_tmp289 = (unsigned int)disketteExtension; #line 1834 - __cil_tmp290 = __cil_tmp289 + 376; + __cil_tmp290 = __cil_tmp289 + 376; #line 1834 - __cil_tmp291 = (UNICODE_STRING *)__cil_tmp290; + __cil_tmp291 = (UNICODE_STRING *)__cil_tmp290; #line 1834 - __cil_tmp292 = (void *)0; + __cil_tmp292 = (void *)0; #line 1834 - __cil_tmp293 = (WCHAR const *)__cil_tmp292; + __cil_tmp293 = (WCHAR const *)__cil_tmp292; #line 1834 - RtlInitUnicodeString(__cil_tmp291, __cil_tmp293); - } - } else { - - } - } - { + RtlInitUnicodeString(__cil_tmp291, __cil_tmp293); + } + } else { + } + } + { #line 1837 - __cil_tmp294 = (unsigned int )disketteExtension; + __cil_tmp294 = (unsigned int)disketteExtension; #line 1837 - __cil_tmp295 = __cil_tmp294 + 368; + __cil_tmp295 = __cil_tmp294 + 368; #line 1837 - __cil_tmp296 = (UNICODE_STRING *)__cil_tmp295; + __cil_tmp296 = (UNICODE_STRING *)__cil_tmp295; #line 1837 - RtlFreeUnicodeString(__cil_tmp296); + RtlFreeUnicodeString(__cil_tmp296); #line 1838 - __cil_tmp297 = (unsigned int )disketteExtension; + __cil_tmp297 = (unsigned int)disketteExtension; #line 1838 - __cil_tmp298 = __cil_tmp297 + 368; + __cil_tmp298 = __cil_tmp297 + 368; #line 1838 - __cil_tmp299 = (UNICODE_STRING *)__cil_tmp298; + __cil_tmp299 = (UNICODE_STRING *)__cil_tmp298; #line 1838 - __cil_tmp300 = (void *)0; + __cil_tmp300 = (void *)0; #line 1838 - __cil_tmp301 = (WCHAR const *)__cil_tmp300; + __cil_tmp301 = (WCHAR const *)__cil_tmp300; #line 1838 - RtlInitUnicodeString(__cil_tmp299, __cil_tmp301); - } - { + RtlInitUnicodeString(__cil_tmp299, __cil_tmp301); + } + { #line 1840 - __cil_tmp302 = (unsigned int )disketteExtension; + __cil_tmp302 = (unsigned int)disketteExtension; #line 1840 - __cil_tmp303 = __cil_tmp302 + 384; + __cil_tmp303 = __cil_tmp302 + 384; #line 1840 - mem_415 = (USHORT *)__cil_tmp303; + mem_415 = (USHORT *)__cil_tmp303; #line 1840 - __cil_tmp304 = *mem_415; + __cil_tmp304 = *mem_415; #line 1840 - __cil_tmp305 = (int )__cil_tmp304; + __cil_tmp305 = (int)__cil_tmp304; #line 1840 - if (__cil_tmp305 != 0) { - { + if (__cil_tmp305 != 0) { + { #line 1842 - __cil_tmp306 = (unsigned int )disketteExtension; + __cil_tmp306 = (unsigned int)disketteExtension; #line 1842 - __cil_tmp307 = __cil_tmp306 + 384; + __cil_tmp307 = __cil_tmp306 + 384; #line 1842 - __cil_tmp308 = (UNICODE_STRING *)__cil_tmp307; + __cil_tmp308 = (UNICODE_STRING *)__cil_tmp307; #line 1842 - IoDeleteSymbolicLink(__cil_tmp308); + IoDeleteSymbolicLink(__cil_tmp308); #line 1843 - __cil_tmp309 = (unsigned int )disketteExtension; + __cil_tmp309 = (unsigned int)disketteExtension; #line 1843 - __cil_tmp310 = __cil_tmp309 + 384; + __cil_tmp310 = __cil_tmp309 + 384; #line 1843 - __cil_tmp311 = (UNICODE_STRING *)__cil_tmp310; + __cil_tmp311 = (UNICODE_STRING *)__cil_tmp310; #line 1843 - RtlFreeUnicodeString(__cil_tmp311); + RtlFreeUnicodeString(__cil_tmp311); #line 1844 - __cil_tmp312 = (unsigned int )disketteExtension; + __cil_tmp312 = (unsigned int)disketteExtension; #line 1844 - __cil_tmp313 = __cil_tmp312 + 384; + __cil_tmp313 = __cil_tmp312 + 384; #line 1844 - __cil_tmp314 = (UNICODE_STRING *)__cil_tmp313; + __cil_tmp314 = (UNICODE_STRING *)__cil_tmp313; #line 1844 - __cil_tmp315 = (void *)0; + __cil_tmp315 = (void *)0; #line 1844 - __cil_tmp316 = (WCHAR const *)__cil_tmp315; + __cil_tmp316 = (WCHAR const *)__cil_tmp315; #line 1844 - RtlInitUnicodeString(__cil_tmp314, __cil_tmp316); - } - } else { - - } - } - { + RtlInitUnicodeString(__cil_tmp314, __cil_tmp316); + } + } else { + } + } + { #line 1850 - __cil_tmp317 = (unsigned int )disketteExtension; + __cil_tmp317 = (unsigned int)disketteExtension; #line 1850 - __cil_tmp318 = __cil_tmp317 + 8; + __cil_tmp318 = __cil_tmp317 + 8; #line 1850 - mem_416 = (PDEVICE_OBJECT *)__cil_tmp318; + mem_416 = (PDEVICE_OBJECT *)__cil_tmp318; #line 1850 - __cil_tmp319 = *mem_416; + __cil_tmp319 = *mem_416; #line 1850 - IoDetachDevice(__cil_tmp319); + IoDetachDevice(__cil_tmp319); #line 1855 - IoDeleteDevice(DeviceObject); + IoDeleteDevice(DeviceObject); #line 1857 - tmp = IoGetConfigurationInformation(); + tmp = IoGetConfigurationInformation(); #line 1857 - __cil_tmp320 = (unsigned int )tmp; + __cil_tmp320 = (unsigned int)tmp; #line 1857 - __cil_tmp321 = __cil_tmp320 + 4; + __cil_tmp321 = __cil_tmp320 + 4; #line 1857 - __cil_tmp322 = (unsigned int )tmp; + __cil_tmp322 = (unsigned int)tmp; #line 1857 - __cil_tmp323 = __cil_tmp322 + 4; + __cil_tmp323 = __cil_tmp322 + 4; #line 1857 - mem_417 = (ULONG *)__cil_tmp323; + mem_417 = (ULONG *)__cil_tmp323; #line 1857 - __cil_tmp324 = *mem_417; + __cil_tmp324 = *mem_417; #line 1857 - mem_418 = (ULONG *)__cil_tmp321; + mem_418 = (ULONG *)__cil_tmp321; #line 1857 - *mem_418 = __cil_tmp324 - 1UL; - } - goto switch_32_break; - switch_32_default: /* CIL Label */ ; - { + *mem_418 = __cil_tmp324 - 1UL; + } + goto switch_32_break; + switch_32_default: /* CIL Label */; + { #line 1862 - while (1) { - while_39_continue: /* CIL Label */ ; - goto while_39_break; - } - while_39_break: /* CIL Label */ ; - } -#line 1863 - if (s == 1) { + while (1) { + while_39_continue: /* CIL Label */; + goto while_39_break; + } + while_39_break: /* CIL Label */; + } #line 1863 - s = 3; - } else { - { + if (s == 1) { #line 1863 - __VERIFIER_assert(0); - } - } - { + s = 3; + } else { + { +#line 1863 + __VERIFIER_assert(0); + } + } + { #line 1864 - __cil_tmp325 = (unsigned int )Irp; + __cil_tmp325 = (unsigned int)Irp; #line 1864 - __cil_tmp326 = __cil_tmp325 + 35; + __cil_tmp326 = __cil_tmp325 + 35; #line 1864 - __cil_tmp327 = (unsigned int )Irp; + __cil_tmp327 = (unsigned int)Irp; #line 1864 - __cil_tmp328 = __cil_tmp327 + 35; + __cil_tmp328 = __cil_tmp327 + 35; #line 1864 - mem_419 = (CHAR *)__cil_tmp328; + mem_419 = (CHAR *)__cil_tmp328; #line 1864 - __cil_tmp329 = *mem_419; + __cil_tmp329 = *mem_419; #line 1864 - __cil_tmp330 = (int )__cil_tmp329; + __cil_tmp330 = (int)__cil_tmp329; #line 1864 - __cil_tmp331 = __cil_tmp330 + 1; + __cil_tmp331 = __cil_tmp330 + 1; #line 1864 - mem_420 = (CHAR *)__cil_tmp326; + mem_420 = (CHAR *)__cil_tmp326; #line 1864 - *mem_420 = (char )__cil_tmp331; + *mem_420 = (char)__cil_tmp331; #line 1864 - __cil_tmp332 = 24 + 8; + __cil_tmp332 = 24 + 8; #line 1864 - __cil_tmp333 = 0 + __cil_tmp332; + __cil_tmp333 = 0 + __cil_tmp332; #line 1864 - __cil_tmp334 = 64 + __cil_tmp333; + __cil_tmp334 = 64 + __cil_tmp333; #line 1864 - __cil_tmp335 = (unsigned int )Irp; + __cil_tmp335 = (unsigned int)Irp; #line 1864 - __cil_tmp336 = __cil_tmp335 + __cil_tmp334; + __cil_tmp336 = __cil_tmp335 + __cil_tmp334; #line 1864 - __cil_tmp337 = 24 + 8; + __cil_tmp337 = 24 + 8; #line 1864 - __cil_tmp338 = 0 + __cil_tmp337; + __cil_tmp338 = 0 + __cil_tmp337; #line 1864 - __cil_tmp339 = 64 + __cil_tmp338; + __cil_tmp339 = 64 + __cil_tmp338; #line 1864 - __cil_tmp340 = (unsigned int )Irp; + __cil_tmp340 = (unsigned int)Irp; #line 1864 - __cil_tmp341 = __cil_tmp340 + __cil_tmp339; + __cil_tmp341 = __cil_tmp340 + __cil_tmp339; #line 1864 - mem_421 = (struct _IO_STACK_LOCATION **)__cil_tmp341; + mem_421 = (struct _IO_STACK_LOCATION **)__cil_tmp341; #line 1864 - __cil_tmp342 = *mem_421; + __cil_tmp342 = *mem_421; #line 1864 - mem_422 = (struct _IO_STACK_LOCATION **)__cil_tmp336; + mem_422 = (struct _IO_STACK_LOCATION **)__cil_tmp336; #line 1864 - *mem_422 = __cil_tmp342 + 1; + *mem_422 = __cil_tmp342 + 1; #line 1865 - __cil_tmp343 = (unsigned int )disketteExtension; + __cil_tmp343 = (unsigned int)disketteExtension; #line 1865 - __cil_tmp344 = __cil_tmp343 + 8; + __cil_tmp344 = __cil_tmp343 + 8; #line 1865 - mem_423 = (PDEVICE_OBJECT *)__cil_tmp344; + mem_423 = (PDEVICE_OBJECT *)__cil_tmp344; #line 1865 - __cil_tmp345 = *mem_423; + __cil_tmp345 = *mem_423; #line 1865 - ntStatus = IofCallDriver(__cil_tmp345, Irp); + ntStatus = IofCallDriver(__cil_tmp345, Irp); + } + } else { + switch_32_break: /* CIL Label */; + } + } } - } else { - switch_32_break: /* CIL Label */ ; - } } } } @@ -11051,17432 +11261,17623 @@ NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } - } - } - { + { #line 1871 - ExAcquireFastMutex(PagingMutex); + ExAcquireFastMutex(PagingMutex); #line 1871 - PagingReferenceCount = PagingReferenceCount - 1UL; - } + PagingReferenceCount = PagingReferenceCount - 1UL; + } #line 1871 - if (PagingReferenceCount == 0UL) { - { + if (PagingReferenceCount == 0UL) { + { #line 1871 - __cil_tmp346 = (void *)(& DriverEntry); + __cil_tmp346 = (void *)(&DriverEntry); #line 1871 - MmPageEntireDriver(__cil_tmp346); + MmPageEntireDriver(__cil_tmp346); + } + } else { } - } else { - - } - { + { #line 1871 - ExReleaseFastMutex(PagingMutex); - } + ExReleaseFastMutex(PagingMutex); + } #line 1873 - return (ntStatus); -} + return (ntStatus); + } } #line 1876 "floppy.c" -NTSTATUS FloppyStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ NTSTATUS ntStatus ; - NTSTATUS pnpStatus ; - KEVENT doneEvent ; - FDC_INFO fdcInfo ; - CONFIGURATION_TYPE Dc ; - CONFIGURATION_TYPE Fp ; - PDISKETTE_EXTENSION disketteExtension ; - PIO_STACK_LOCATION irpSp ; - PIO_STACK_LOCATION irpSp___0 ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___1 ; - INTERFACE_TYPE InterfaceType ; - CONFIGURATION_TYPE *__cil_tmp15 ; - CONFIGURATION_TYPE *__cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - PVOID __cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - enum _EVENT_TYPE __cil_tmp25 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - unsigned int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - unsigned int __cil_tmp32 ; - unsigned int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - struct _IO_STACK_LOCATION *__cil_tmp36 ; - void *__cil_tmp37 ; - void const *__cil_tmp38 ; - IO_STACK_LOCATION *__cil_tmp39 ; - unsigned int __cil_tmp40 ; - unsigned int __cil_tmp41 ; - NTSTATUS (**__cil_tmp42)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - long __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - unsigned int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - unsigned int __cil_tmp51 ; - struct _IO_STACK_LOCATION *__cil_tmp52 ; - unsigned int __cil_tmp53 ; - unsigned int __cil_tmp54 ; - unsigned int __cil_tmp55 ; - unsigned int __cil_tmp56 ; - unsigned int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - unsigned int __cil_tmp59 ; - unsigned int __cil_tmp60 ; - unsigned int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - unsigned int __cil_tmp63 ; - unsigned int __cil_tmp64 ; - UCHAR __cil_tmp65 ; - int __cil_tmp66 ; - int __cil_tmp67 ; - unsigned int __cil_tmp68 ; - unsigned int __cil_tmp69 ; - unsigned int __cil_tmp70 ; - unsigned int __cil_tmp71 ; - UCHAR __cil_tmp72 ; - int __cil_tmp73 ; - int __cil_tmp74 ; - unsigned int __cil_tmp75 ; - unsigned int __cil_tmp76 ; - PDEVICE_OBJECT __cil_tmp77 ; - void *__cil_tmp78 ; - enum _KWAIT_REASON __cil_tmp79 ; - void *__cil_tmp80 ; - LARGE_INTEGER *__cil_tmp81 ; - unsigned int __cil_tmp82 ; - unsigned int __cil_tmp83 ; - unsigned int __cil_tmp84 ; - unsigned int __cil_tmp85 ; - PDEVICE_OBJECT __cil_tmp86 ; - int __cil_tmp87 ; - int __cil_tmp88 ; - int __cil_tmp89 ; - int __cil_tmp90 ; - unsigned long __cil_tmp91 ; - void *__cil_tmp92 ; - unsigned int __cil_tmp93 ; - unsigned int __cil_tmp94 ; - unsigned int __cil_tmp95 ; - unsigned int __cil_tmp96 ; - unsigned int __cil_tmp97 ; - unsigned int __cil_tmp98 ; - unsigned int __cil_tmp99 ; - UCHAR __cil_tmp100 ; - int __cil_tmp101 ; - unsigned int __cil_tmp102 ; - unsigned int __cil_tmp103 ; - unsigned int __cil_tmp104 ; - ULONG __cil_tmp105 ; - int __cil_tmp106 ; - unsigned int __cil_tmp107 ; - unsigned int __cil_tmp108 ; - UCHAR __cil_tmp109 ; - int __cil_tmp110 ; - int __cil_tmp111 ; - unsigned int __cil_tmp112 ; - unsigned int __cil_tmp113 ; - UCHAR __cil_tmp114 ; - int __cil_tmp115 ; - unsigned int __cil_tmp116 ; - unsigned int __cil_tmp117 ; - unsigned int __cil_tmp118 ; - ULONG __cil_tmp119 ; - int __cil_tmp120 ; - unsigned int __cil_tmp121 ; - unsigned int __cil_tmp122 ; - UCHAR __cil_tmp123 ; - int __cil_tmp124 ; - int __cil_tmp125 ; - int __cil_tmp126 ; - unsigned int __cil_tmp127 ; - unsigned int __cil_tmp128 ; - INTERFACE_TYPE *__cil_tmp129 ; - unsigned int __cil_tmp130 ; - ULONG *__cil_tmp131 ; - unsigned int __cil_tmp132 ; - ULONG *__cil_tmp133 ; - unsigned int __cil_tmp134 ; - ULONG *__cil_tmp135 ; - void *__cil_tmp136 ; - int __cil_tmp137 ; - int __cil_tmp138 ; - KUSER_SHARED_DATA *__cil_tmp139 ; - unsigned int __cil_tmp140 ; - unsigned int __cil_tmp141 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp142 ; - int __cil_tmp143 ; - unsigned int __cil_tmp144 ; - unsigned int __cil_tmp145 ; - unsigned int __cil_tmp146 ; - ULONG __cil_tmp147 ; - unsigned int __cil_tmp148 ; - unsigned int __cil_tmp149 ; - unsigned int __cil_tmp150 ; - ULONG __cil_tmp151 ; - unsigned int __cil_tmp152 ; - unsigned int __cil_tmp153 ; - unsigned int __cil_tmp154 ; - ULONG __cil_tmp155 ; - unsigned int __cil_tmp156 ; - unsigned int __cil_tmp157 ; - unsigned int __cil_tmp158 ; - ULONG __cil_tmp159 ; - int __cil_tmp160 ; - unsigned long __cil_tmp161 ; - unsigned int __cil_tmp162 ; - ULONG __cil_tmp163 ; - unsigned long __cil_tmp164 ; - unsigned int __cil_tmp165 ; - unsigned int __cil_tmp166 ; - PDEVICE_OBJECT __cil_tmp167 ; - GUID *__cil_tmp168 ; - GUID const *__cil_tmp169 ; - void *__cil_tmp170 ; - UNICODE_STRING *__cil_tmp171 ; - unsigned int __cil_tmp172 ; - unsigned int __cil_tmp173 ; - UNICODE_STRING *__cil_tmp174 ; - unsigned int __cil_tmp175 ; - unsigned int __cil_tmp176 ; - UNICODE_STRING *__cil_tmp177 ; - unsigned int __cil_tmp178 ; - unsigned int __cil_tmp179 ; - unsigned int __cil_tmp180 ; - unsigned int __cil_tmp181 ; - FAST_MUTEX *__cil_tmp182 ; - unsigned int __cil_tmp183 ; - unsigned int __cil_tmp184 ; - unsigned int __cil_tmp185 ; - unsigned int __cil_tmp186 ; - FAST_MUTEX *__cil_tmp187 ; - unsigned int __cil_tmp188 ; - unsigned int __cil_tmp189 ; - PVOID *mem_190 ; - struct _IO_STACK_LOCATION **mem_191 ; - struct _IO_STACK_LOCATION **mem_192 ; - struct _IO_STACK_LOCATION **mem_193 ; - UCHAR *mem_194 ; - struct _IO_STACK_LOCATION **mem_195 ; - NTSTATUS (**mem_196)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - PVOID *mem_197 ; - UCHAR *mem_198 ; - UCHAR *mem_199 ; - UCHAR *mem_200 ; - UCHAR *mem_201 ; - UCHAR *mem_202 ; - UCHAR *mem_203 ; - PDEVICE_OBJECT *mem_204 ; - ULONG *mem_205 ; - ULONG *mem_206 ; - PDEVICE_OBJECT *mem_207 ; - ULONG *mem_208 ; - ULONG *mem_209 ; - BOOLEAN *mem_210 ; - BOOLEAN *mem_211 ; - UCHAR *mem_212 ; - ULONG *mem_213 ; - UCHAR *mem_214 ; - UCHAR *mem_215 ; - UCHAR *mem_216 ; - ULONG *mem_217 ; - UCHAR *mem_218 ; - UCHAR *mem_219 ; - INTERFACE_TYPE *mem_220 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_221 ; - ULONG *mem_222 ; - UCHAR *mem_223 ; - ULONG *mem_224 ; - UCHAR *mem_225 ; - ULONG *mem_226 ; - UCHAR *mem_227 ; - ULONG *mem_228 ; - ULONG *mem_229 ; - UCHAR *mem_230 ; - PDEVICE_OBJECT *mem_231 ; - BOOLEAN *mem_232 ; - BOOLEAN *mem_233 ; - NTSTATUS *mem_234 ; +NTSTATUS FloppyStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + NTSTATUS ntStatus; + NTSTATUS pnpStatus; + KEVENT doneEvent; + FDC_INFO fdcInfo; + CONFIGURATION_TYPE Dc; + CONFIGURATION_TYPE Fp; + PDISKETTE_EXTENSION disketteExtension; + PIO_STACK_LOCATION irpSp; + PIO_STACK_LOCATION irpSp___0; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___1; + INTERFACE_TYPE InterfaceType; + CONFIGURATION_TYPE *__cil_tmp15; + CONFIGURATION_TYPE *__cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + PVOID __cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + enum _EVENT_TYPE __cil_tmp25; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + unsigned int __cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + unsigned int __cil_tmp32; + unsigned int __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + struct _IO_STACK_LOCATION *__cil_tmp36; + void *__cil_tmp37; + void const *__cil_tmp38; + IO_STACK_LOCATION *__cil_tmp39; + unsigned int __cil_tmp40; + unsigned int __cil_tmp41; + NTSTATUS(**__cil_tmp42) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + long __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + unsigned int __cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + unsigned int __cil_tmp51; + struct _IO_STACK_LOCATION *__cil_tmp52; + unsigned int __cil_tmp53; + unsigned int __cil_tmp54; + unsigned int __cil_tmp55; + unsigned int __cil_tmp56; + unsigned int __cil_tmp57; + unsigned int __cil_tmp58; + unsigned int __cil_tmp59; + unsigned int __cil_tmp60; + unsigned int __cil_tmp61; + unsigned int __cil_tmp62; + unsigned int __cil_tmp63; + unsigned int __cil_tmp64; + UCHAR __cil_tmp65; + int __cil_tmp66; + int __cil_tmp67; + unsigned int __cil_tmp68; + unsigned int __cil_tmp69; + unsigned int __cil_tmp70; + unsigned int __cil_tmp71; + UCHAR __cil_tmp72; + int __cil_tmp73; + int __cil_tmp74; + unsigned int __cil_tmp75; + unsigned int __cil_tmp76; + PDEVICE_OBJECT __cil_tmp77; + void *__cil_tmp78; + enum _KWAIT_REASON __cil_tmp79; + void *__cil_tmp80; + LARGE_INTEGER *__cil_tmp81; + unsigned int __cil_tmp82; + unsigned int __cil_tmp83; + unsigned int __cil_tmp84; + unsigned int __cil_tmp85; + PDEVICE_OBJECT __cil_tmp86; + int __cil_tmp87; + int __cil_tmp88; + int __cil_tmp89; + int __cil_tmp90; + unsigned long __cil_tmp91; + void *__cil_tmp92; + unsigned int __cil_tmp93; + unsigned int __cil_tmp94; + unsigned int __cil_tmp95; + unsigned int __cil_tmp96; + unsigned int __cil_tmp97; + unsigned int __cil_tmp98; + unsigned int __cil_tmp99; + UCHAR __cil_tmp100; + int __cil_tmp101; + unsigned int __cil_tmp102; + unsigned int __cil_tmp103; + unsigned int __cil_tmp104; + ULONG __cil_tmp105; + int __cil_tmp106; + unsigned int __cil_tmp107; + unsigned int __cil_tmp108; + UCHAR __cil_tmp109; + int __cil_tmp110; + int __cil_tmp111; + unsigned int __cil_tmp112; + unsigned int __cil_tmp113; + UCHAR __cil_tmp114; + int __cil_tmp115; + unsigned int __cil_tmp116; + unsigned int __cil_tmp117; + unsigned int __cil_tmp118; + ULONG __cil_tmp119; + int __cil_tmp120; + unsigned int __cil_tmp121; + unsigned int __cil_tmp122; + UCHAR __cil_tmp123; + int __cil_tmp124; + int __cil_tmp125; + int __cil_tmp126; + unsigned int __cil_tmp127; + unsigned int __cil_tmp128; + INTERFACE_TYPE *__cil_tmp129; + unsigned int __cil_tmp130; + ULONG *__cil_tmp131; + unsigned int __cil_tmp132; + ULONG *__cil_tmp133; + unsigned int __cil_tmp134; + ULONG *__cil_tmp135; + void *__cil_tmp136; + int __cil_tmp137; + int __cil_tmp138; + KUSER_SHARED_DATA *__cil_tmp139; + unsigned int __cil_tmp140; + unsigned int __cil_tmp141; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp142; + int __cil_tmp143; + unsigned int __cil_tmp144; + unsigned int __cil_tmp145; + unsigned int __cil_tmp146; + ULONG __cil_tmp147; + unsigned int __cil_tmp148; + unsigned int __cil_tmp149; + unsigned int __cil_tmp150; + ULONG __cil_tmp151; + unsigned int __cil_tmp152; + unsigned int __cil_tmp153; + unsigned int __cil_tmp154; + ULONG __cil_tmp155; + unsigned int __cil_tmp156; + unsigned int __cil_tmp157; + unsigned int __cil_tmp158; + ULONG __cil_tmp159; + int __cil_tmp160; + unsigned long __cil_tmp161; + unsigned int __cil_tmp162; + ULONG __cil_tmp163; + unsigned long __cil_tmp164; + unsigned int __cil_tmp165; + unsigned int __cil_tmp166; + PDEVICE_OBJECT __cil_tmp167; + GUID *__cil_tmp168; + GUID const *__cil_tmp169; + void *__cil_tmp170; + UNICODE_STRING *__cil_tmp171; + unsigned int __cil_tmp172; + unsigned int __cil_tmp173; + UNICODE_STRING *__cil_tmp174; + unsigned int __cil_tmp175; + unsigned int __cil_tmp176; + UNICODE_STRING *__cil_tmp177; + unsigned int __cil_tmp178; + unsigned int __cil_tmp179; + unsigned int __cil_tmp180; + unsigned int __cil_tmp181; + FAST_MUTEX *__cil_tmp182; + unsigned int __cil_tmp183; + unsigned int __cil_tmp184; + unsigned int __cil_tmp185; + unsigned int __cil_tmp186; + FAST_MUTEX *__cil_tmp187; + unsigned int __cil_tmp188; + unsigned int __cil_tmp189; + PVOID *mem_190; + struct _IO_STACK_LOCATION **mem_191; + struct _IO_STACK_LOCATION **mem_192; + struct _IO_STACK_LOCATION **mem_193; + UCHAR *mem_194; + struct _IO_STACK_LOCATION **mem_195; + NTSTATUS (**mem_196)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + PVOID *mem_197; + UCHAR *mem_198; + UCHAR *mem_199; + UCHAR *mem_200; + UCHAR *mem_201; + UCHAR *mem_202; + UCHAR *mem_203; + PDEVICE_OBJECT *mem_204; + ULONG *mem_205; + ULONG *mem_206; + PDEVICE_OBJECT *mem_207; + ULONG *mem_208; + ULONG *mem_209; + BOOLEAN *mem_210; + BOOLEAN *mem_211; + UCHAR *mem_212; + ULONG *mem_213; + UCHAR *mem_214; + UCHAR *mem_215; + UCHAR *mem_216; + ULONG *mem_217; + UCHAR *mem_218; + UCHAR *mem_219; + INTERFACE_TYPE *mem_220; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_221; + ULONG *mem_222; + UCHAR *mem_223; + ULONG *mem_224; + UCHAR *mem_225; + ULONG *mem_226; + UCHAR *mem_227; + ULONG *mem_228; + ULONG *mem_229; + UCHAR *mem_230; + PDEVICE_OBJECT *mem_231; + BOOLEAN *mem_232; + BOOLEAN *mem_233; + NTSTATUS *mem_234; { #line 1887 - __cil_tmp15 = & Dc; + __cil_tmp15 = &Dc; #line 1887 - *__cil_tmp15 = (enum _CONFIGURATION_TYPE )13; + *__cil_tmp15 = (enum _CONFIGURATION_TYPE)13; #line 1888 - __cil_tmp16 = & Fp; + __cil_tmp16 = &Fp; #line 1888 - *__cil_tmp16 = (enum _CONFIGURATION_TYPE )26; + *__cil_tmp16 = (enum _CONFIGURATION_TYPE)26; #line 1890 - __cil_tmp17 = (unsigned int )DeviceObject; + __cil_tmp17 = (unsigned int)DeviceObject; #line 1890 - __cil_tmp18 = __cil_tmp17 + 40; + __cil_tmp18 = __cil_tmp17 + 40; #line 1890 - mem_190 = (PVOID *)__cil_tmp18; + mem_190 = (PVOID *)__cil_tmp18; #line 1890 - __cil_tmp19 = *mem_190; + __cil_tmp19 = *mem_190; #line 1890 - disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp19; + disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp19; #line 1891 - __cil_tmp20 = 24 + 8; + __cil_tmp20 = 24 + 8; #line 1891 - __cil_tmp21 = 0 + __cil_tmp20; + __cil_tmp21 = 0 + __cil_tmp20; #line 1891 - __cil_tmp22 = 64 + __cil_tmp21; + __cil_tmp22 = 64 + __cil_tmp21; #line 1891 - __cil_tmp23 = (unsigned int )Irp; + __cil_tmp23 = (unsigned int)Irp; #line 1891 - __cil_tmp24 = __cil_tmp23 + __cil_tmp22; + __cil_tmp24 = __cil_tmp23 + __cil_tmp22; #line 1891 - mem_191 = (struct _IO_STACK_LOCATION **)__cil_tmp24; + mem_191 = (struct _IO_STACK_LOCATION **)__cil_tmp24; #line 1891 - irpSp = *mem_191; - { + irpSp = *mem_191; + { #line 1893 - while (1) { - while_40_continue: /* CIL Label */ ; - goto while_40_break; - } - while_40_break: /* CIL Label */ ; - } - { + while (1) { + while_40_continue: /* CIL Label */; + goto while_40_break; + } + while_40_break: /* CIL Label */; + } + { #line 1894 - while (1) { - while_41_continue: /* CIL Label */ ; - goto while_41_break; - } - while_41_break: /* CIL Label */ ; - } - { + while (1) { + while_41_continue: /* CIL Label */; + goto while_41_break; + } + while_41_break: /* CIL Label */; + } + { #line 1895 - while (1) { - while_42_continue: /* CIL Label */ ; - goto while_42_break; - } - while_42_break: /* CIL Label */ ; - } - { + while (1) { + while_42_continue: /* CIL Label */; + goto while_42_break; + } + while_42_break: /* CIL Label */; + } + { #line 1900 - __cil_tmp25 = (enum _EVENT_TYPE )0; + __cil_tmp25 = (enum _EVENT_TYPE)0; #line 1900 - KeInitializeEvent(& doneEvent, __cil_tmp25, (unsigned char)0); + KeInitializeEvent(&doneEvent, __cil_tmp25, (unsigned char)0); #line 1902 - __cil_tmp26 = 24 + 8; + __cil_tmp26 = 24 + 8; #line 1902 - __cil_tmp27 = 0 + __cil_tmp26; + __cil_tmp27 = 0 + __cil_tmp26; #line 1902 - __cil_tmp28 = 64 + __cil_tmp27; + __cil_tmp28 = 64 + __cil_tmp27; #line 1902 - __cil_tmp29 = (unsigned int )Irp; + __cil_tmp29 = (unsigned int)Irp; #line 1902 - __cil_tmp30 = __cil_tmp29 + __cil_tmp28; + __cil_tmp30 = __cil_tmp29 + __cil_tmp28; #line 1902 - mem_192 = (struct _IO_STACK_LOCATION **)__cil_tmp30; + mem_192 = (struct _IO_STACK_LOCATION **)__cil_tmp30; #line 1902 - irpSp___0 = *mem_192; + irpSp___0 = *mem_192; #line 1902 - __cil_tmp31 = 24 + 8; + __cil_tmp31 = 24 + 8; #line 1902 - __cil_tmp32 = 0 + __cil_tmp31; + __cil_tmp32 = 0 + __cil_tmp31; #line 1902 - __cil_tmp33 = 64 + __cil_tmp32; + __cil_tmp33 = 64 + __cil_tmp32; #line 1902 - __cil_tmp34 = (unsigned int )Irp; + __cil_tmp34 = (unsigned int)Irp; #line 1902 - __cil_tmp35 = __cil_tmp34 + __cil_tmp33; + __cil_tmp35 = __cil_tmp34 + __cil_tmp33; #line 1902 - mem_193 = (struct _IO_STACK_LOCATION **)__cil_tmp35; + mem_193 = (struct _IO_STACK_LOCATION **)__cil_tmp35; #line 1902 - __cil_tmp36 = *mem_193; + __cil_tmp36 = *mem_193; #line 1902 - nextIrpSp = __cil_tmp36 - 1; + nextIrpSp = __cil_tmp36 - 1; #line 1902 - __cil_tmp37 = (void *)nextIrpSp; + __cil_tmp37 = (void *)nextIrpSp; #line 1902 - __cil_tmp38 = (void const *)irpSp___0; + __cil_tmp38 = (void const *)irpSp___0; #line 1902 - __cil_tmp39 = (IO_STACK_LOCATION *)0; + __cil_tmp39 = (IO_STACK_LOCATION *)0; #line 1902 - __cil_tmp40 = (unsigned int )__cil_tmp39; + __cil_tmp40 = (unsigned int)__cil_tmp39; #line 1902 - __cil_tmp41 = __cil_tmp40 + 112; + __cil_tmp41 = __cil_tmp40 + 112; #line 1902 - __cil_tmp42 = (NTSTATUS (**)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ))__cil_tmp41; + __cil_tmp42 = (NTSTATUS(**)(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context))__cil_tmp41; #line 1902 - __cil_tmp43 = (long )__cil_tmp42; + __cil_tmp43 = (long)__cil_tmp42; #line 1902 - __cil_tmp44 = (unsigned int )__cil_tmp43; + __cil_tmp44 = (unsigned int)__cil_tmp43; #line 1902 - memcpy(__cil_tmp37, __cil_tmp38, __cil_tmp44); + memcpy(__cil_tmp37, __cil_tmp38, __cil_tmp44); #line 1902 - __cil_tmp45 = (unsigned int )nextIrpSp; + __cil_tmp45 = (unsigned int)nextIrpSp; #line 1902 - __cil_tmp46 = __cil_tmp45 + 3; + __cil_tmp46 = __cil_tmp45 + 3; #line 1902 - mem_194 = (UCHAR *)__cil_tmp46; + mem_194 = (UCHAR *)__cil_tmp46; #line 1902 - *mem_194 = (unsigned char)0; - } -#line 1904 - if (s != 1) { - { -#line 1904 - __VERIFIER_assert(0); + *mem_194 = (unsigned char)0; } - } else { -#line 1906 - if (compRegistered != 0) { +#line 1904 + if (s != 1) { { -#line 1906 - __VERIFIER_assert(0); +#line 1904 + __VERIFIER_assert(0); } } else { +#line 1906 + if (compRegistered != 0) { + { +#line 1906 + __VERIFIER_assert(0); + } + } else { #line 1908 - compRegistered = 1; + compRegistered = 1; #line 1909 - compFptr = & FloppyPnpComplete; + compFptr = &FloppyPnpComplete; + } } - } - { + { #line 1915 - __cil_tmp47 = 24 + 8; + __cil_tmp47 = 24 + 8; #line 1915 - __cil_tmp48 = 0 + __cil_tmp47; + __cil_tmp48 = 0 + __cil_tmp47; #line 1915 - __cil_tmp49 = 64 + __cil_tmp48; + __cil_tmp49 = 64 + __cil_tmp48; #line 1915 - __cil_tmp50 = (unsigned int )Irp; + __cil_tmp50 = (unsigned int)Irp; #line 1915 - __cil_tmp51 = __cil_tmp50 + __cil_tmp49; + __cil_tmp51 = __cil_tmp50 + __cil_tmp49; #line 1915 - mem_195 = (struct _IO_STACK_LOCATION **)__cil_tmp51; + mem_195 = (struct _IO_STACK_LOCATION **)__cil_tmp51; #line 1915 - __cil_tmp52 = *mem_195; + __cil_tmp52 = *mem_195; #line 1915 - irpSp___1 = __cil_tmp52 - 1; + irpSp___1 = __cil_tmp52 - 1; #line 1915 - __cil_tmp53 = (unsigned int )irpSp___1; + __cil_tmp53 = (unsigned int)irpSp___1; #line 1915 - __cil_tmp54 = __cil_tmp53 + 112; + __cil_tmp54 = __cil_tmp53 + 112; #line 1915 - mem_196 = (NTSTATUS (**)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ))__cil_tmp54; + mem_196 = (NTSTATUS(**)(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context))__cil_tmp54; #line 1915 - *mem_196 = & FloppyPnpComplete; + *mem_196 = &FloppyPnpComplete; #line 1915 - __cil_tmp55 = (unsigned int )irpSp___1; + __cil_tmp55 = (unsigned int)irpSp___1; #line 1915 - __cil_tmp56 = __cil_tmp55 + 116; + __cil_tmp56 = __cil_tmp55 + 116; #line 1915 - mem_197 = (PVOID *)__cil_tmp56; + mem_197 = (PVOID *)__cil_tmp56; #line 1915 - *mem_197 = (void *)(& doneEvent); + *mem_197 = (void *)(&doneEvent); #line 1915 - __cil_tmp57 = (unsigned int )irpSp___1; + __cil_tmp57 = (unsigned int)irpSp___1; #line 1915 - __cil_tmp58 = __cil_tmp57 + 3; + __cil_tmp58 = __cil_tmp57 + 3; #line 1915 - mem_198 = (UCHAR *)__cil_tmp58; + mem_198 = (UCHAR *)__cil_tmp58; #line 1915 - *mem_198 = (unsigned char)0; + *mem_198 = (unsigned char)0; #line 1915 - __cil_tmp59 = (unsigned int )irpSp___1; + __cil_tmp59 = (unsigned int)irpSp___1; #line 1915 - __cil_tmp60 = __cil_tmp59 + 3; + __cil_tmp60 = __cil_tmp59 + 3; #line 1915 - mem_199 = (UCHAR *)__cil_tmp60; + mem_199 = (UCHAR *)__cil_tmp60; #line 1915 - *mem_199 = (unsigned char)64; + *mem_199 = (unsigned char)64; #line 1915 - __cil_tmp61 = (unsigned int )irpSp___1; + __cil_tmp61 = (unsigned int)irpSp___1; #line 1915 - __cil_tmp62 = __cil_tmp61 + 3; + __cil_tmp62 = __cil_tmp61 + 3; #line 1915 - __cil_tmp63 = (unsigned int )irpSp___1; + __cil_tmp63 = (unsigned int)irpSp___1; #line 1915 - __cil_tmp64 = __cil_tmp63 + 3; + __cil_tmp64 = __cil_tmp63 + 3; #line 1915 - mem_200 = (UCHAR *)__cil_tmp64; + mem_200 = (UCHAR *)__cil_tmp64; #line 1915 - __cil_tmp65 = *mem_200; + __cil_tmp65 = *mem_200; #line 1915 - __cil_tmp66 = (int )__cil_tmp65; + __cil_tmp66 = (int)__cil_tmp65; #line 1915 - __cil_tmp67 = __cil_tmp66 | 128; + __cil_tmp67 = __cil_tmp66 | 128; #line 1915 - mem_201 = (UCHAR *)__cil_tmp62; + mem_201 = (UCHAR *)__cil_tmp62; #line 1915 - *mem_201 = (unsigned char )__cil_tmp67; + *mem_201 = (unsigned char)__cil_tmp67; #line 1915 - __cil_tmp68 = (unsigned int )irpSp___1; + __cil_tmp68 = (unsigned int)irpSp___1; #line 1915 - __cil_tmp69 = __cil_tmp68 + 3; + __cil_tmp69 = __cil_tmp68 + 3; #line 1915 - __cil_tmp70 = (unsigned int )irpSp___1; + __cil_tmp70 = (unsigned int)irpSp___1; #line 1915 - __cil_tmp71 = __cil_tmp70 + 3; + __cil_tmp71 = __cil_tmp70 + 3; #line 1915 - mem_202 = (UCHAR *)__cil_tmp71; + mem_202 = (UCHAR *)__cil_tmp71; #line 1915 - __cil_tmp72 = *mem_202; + __cil_tmp72 = *mem_202; #line 1915 - __cil_tmp73 = (int )__cil_tmp72; + __cil_tmp73 = (int)__cil_tmp72; #line 1915 - __cil_tmp74 = __cil_tmp73 | 32; + __cil_tmp74 = __cil_tmp73 | 32; #line 1915 - mem_203 = (UCHAR *)__cil_tmp69; + mem_203 = (UCHAR *)__cil_tmp69; #line 1915 - *mem_203 = (unsigned char )__cil_tmp74; + *mem_203 = (unsigned char)__cil_tmp74; #line 1917 - __cil_tmp75 = (unsigned int )disketteExtension; + __cil_tmp75 = (unsigned int)disketteExtension; #line 1917 - __cil_tmp76 = __cil_tmp75 + 8; + __cil_tmp76 = __cil_tmp75 + 8; #line 1917 - mem_204 = (PDEVICE_OBJECT *)__cil_tmp76; + mem_204 = (PDEVICE_OBJECT *)__cil_tmp76; #line 1917 - __cil_tmp77 = *mem_204; + __cil_tmp77 = *mem_204; #line 1917 - ntStatus = IofCallDriver(__cil_tmp77, Irp); - } + ntStatus = IofCallDriver(__cil_tmp77, Irp); + } #line 1919 - if (ntStatus == 259L) { - { + if (ntStatus == 259L) { + { #line 1921 - __cil_tmp78 = (void *)(& doneEvent); + __cil_tmp78 = (void *)(&doneEvent); #line 1921 - __cil_tmp79 = (enum _KWAIT_REASON )0; + __cil_tmp79 = (enum _KWAIT_REASON)0; #line 1921 - __cil_tmp80 = (void *)0; + __cil_tmp80 = (void *)0; #line 1921 - __cil_tmp81 = (LARGE_INTEGER *)__cil_tmp80; + __cil_tmp81 = (LARGE_INTEGER *)__cil_tmp80; #line 1921 - ntStatus = KeWaitForSingleObject(__cil_tmp78, __cil_tmp79, (char)0, (unsigned char)0, - __cil_tmp81); + ntStatus = KeWaitForSingleObject(__cil_tmp78, __cil_tmp79, (char)0, + (unsigned char)0, __cil_tmp81); #line 1930 - ntStatus = myStatus; + ntStatus = myStatus; + } + } else { } - } else { - - } - { + { #line 1932 - __cil_tmp82 = (unsigned int )(& fdcInfo) + 128; + __cil_tmp82 = (unsigned int)(&fdcInfo) + 128; #line 1932 - mem_205 = (ULONG *)__cil_tmp82; + mem_205 = (ULONG *)__cil_tmp82; #line 1932 - *mem_205 = 0UL; + *mem_205 = 0UL; #line 1933 - __cil_tmp83 = (unsigned int )(& fdcInfo) + 132; + __cil_tmp83 = (unsigned int)(&fdcInfo) + 132; #line 1933 - mem_206 = (ULONG *)__cil_tmp83; + mem_206 = (ULONG *)__cil_tmp83; #line 1933 - *mem_206 = 0UL; + *mem_206 = 0UL; #line 1935 - __cil_tmp84 = (unsigned int )disketteExtension; + __cil_tmp84 = (unsigned int)disketteExtension; #line 1935 - __cil_tmp85 = __cil_tmp84 + 8; + __cil_tmp85 = __cil_tmp84 + 8; #line 1935 - mem_207 = (PDEVICE_OBJECT *)__cil_tmp85; + mem_207 = (PDEVICE_OBJECT *)__cil_tmp85; #line 1935 - __cil_tmp86 = *mem_207; + __cil_tmp86 = *mem_207; #line 1935 - __cil_tmp87 = 770 << 2; + __cil_tmp87 = 770 << 2; #line 1935 - __cil_tmp88 = 7 << 16; + __cil_tmp88 = 7 << 16; #line 1935 - __cil_tmp89 = __cil_tmp88 | __cil_tmp87; + __cil_tmp89 = __cil_tmp88 | __cil_tmp87; #line 1935 - __cil_tmp90 = __cil_tmp89 | 3; + __cil_tmp90 = __cil_tmp89 | 3; #line 1935 - __cil_tmp91 = (unsigned long )__cil_tmp90; + __cil_tmp91 = (unsigned long)__cil_tmp90; #line 1935 - __cil_tmp92 = (void *)(& fdcInfo); + __cil_tmp92 = (void *)(&fdcInfo); #line 1935 - ntStatus = FlFdcDeviceIo(__cil_tmp86, __cil_tmp91, __cil_tmp92); - } + ntStatus = FlFdcDeviceIo(__cil_tmp86, __cil_tmp91, __cil_tmp92); + } #line 1939 - if (ntStatus >= 0L) { + if (ntStatus >= 0L) { #line 1941 - __cil_tmp93 = (unsigned int )disketteExtension; + __cil_tmp93 = (unsigned int)disketteExtension; #line 1941 - __cil_tmp94 = __cil_tmp93 + 108; + __cil_tmp94 = __cil_tmp93 + 108; #line 1941 - __cil_tmp95 = (unsigned int )(& fdcInfo) + 56; + __cil_tmp95 = (unsigned int)(&fdcInfo) + 56; #line 1941 - mem_208 = (ULONG *)__cil_tmp94; + mem_208 = (ULONG *)__cil_tmp94; #line 1941 - mem_209 = (ULONG *)__cil_tmp95; + mem_209 = (ULONG *)__cil_tmp95; #line 1941 - *mem_208 = *mem_209; - { + *mem_208 = *mem_209; + { #line 1943 - __cil_tmp96 = (unsigned int )(& fdcInfo) + 60; - { + __cil_tmp96 = (unsigned int)(&fdcInfo) + 60; + { #line 1943 - mem_210 = (BOOLEAN *)__cil_tmp96; + mem_210 = (BOOLEAN *)__cil_tmp96; #line 1943 - if (*mem_210) { - { + if (*mem_210) { + { #line 1943 - __cil_tmp97 = (unsigned int )(& fdcInfo) + 61; - { + __cil_tmp97 = (unsigned int)(&fdcInfo) + 61; + { #line 1943 - mem_211 = (BOOLEAN *)__cil_tmp97; + mem_211 = (BOOLEAN *)__cil_tmp97; #line 1943 - if (*mem_211) { - { + if (*mem_211) { + { #line 1946 - ntStatus = FlAcpiConfigureFloppy(disketteExtension, & fdcInfo); - } - { + ntStatus = + FlAcpiConfigureFloppy(disketteExtension, &fdcInfo); + } + { #line 1948 - __cil_tmp98 = (unsigned int )disketteExtension; + __cil_tmp98 = (unsigned int)disketteExtension; #line 1948 - __cil_tmp99 = __cil_tmp98 + 174; + __cil_tmp99 = __cil_tmp98 + 174; #line 1948 - mem_212 = (UCHAR *)__cil_tmp99; + mem_212 = (UCHAR *)__cil_tmp99; #line 1948 - __cil_tmp100 = *mem_212; + __cil_tmp100 = *mem_212; #line 1948 - __cil_tmp101 = (int )__cil_tmp100; + __cil_tmp101 = (int)__cil_tmp100; #line 1948 - if (__cil_tmp101 == 4) { + if (__cil_tmp101 == 4) { #line 1950 - __cil_tmp102 = (unsigned int )disketteExtension; + __cil_tmp102 = (unsigned int)disketteExtension; #line 1950 - __cil_tmp103 = __cil_tmp102 + 364; + __cil_tmp103 = __cil_tmp102 + 364; #line 1950 - __cil_tmp104 = (unsigned int )(& fdcInfo) + 48; + __cil_tmp104 = (unsigned int)(&fdcInfo) + 48; #line 1950 - mem_213 = (ULONG *)__cil_tmp104; + mem_213 = (ULONG *)__cil_tmp104; #line 1950 - __cil_tmp105 = *mem_213; + __cil_tmp105 = *mem_213; #line 1950 - __cil_tmp106 = 1 << __cil_tmp105; + __cil_tmp106 = 1 << __cil_tmp105; #line 1950 - __cil_tmp107 = (unsigned int )disketteExtension; + __cil_tmp107 = (unsigned int)disketteExtension; #line 1950 - __cil_tmp108 = __cil_tmp107 + 364; + __cil_tmp108 = __cil_tmp107 + 364; #line 1950 - mem_214 = (UCHAR *)__cil_tmp108; + mem_214 = (UCHAR *)__cil_tmp108; #line 1950 - __cil_tmp109 = *mem_214; + __cil_tmp109 = *mem_214; #line 1950 - __cil_tmp110 = (int )__cil_tmp109; + __cil_tmp110 = (int)__cil_tmp109; #line 1950 - __cil_tmp111 = __cil_tmp110 | __cil_tmp106; + __cil_tmp111 = __cil_tmp110 | __cil_tmp106; #line 1950 - mem_215 = (UCHAR *)__cil_tmp103; + mem_215 = (UCHAR *)__cil_tmp103; #line 1950 - *mem_215 = (unsigned char )__cil_tmp111; - } else { - - } - } - } else { - goto _L; - } - } - } - } else { - _L: - { + *mem_215 = (unsigned char)__cil_tmp111; + } else { + } + } + } else { + goto _L; + } + } + } + } else { + _L : { #line 1957 - __cil_tmp112 = (unsigned int )disketteExtension; + __cil_tmp112 = (unsigned int)disketteExtension; #line 1957 - __cil_tmp113 = __cil_tmp112 + 174; + __cil_tmp113 = __cil_tmp112 + 174; #line 1957 - mem_216 = (UCHAR *)__cil_tmp113; + mem_216 = (UCHAR *)__cil_tmp113; #line 1957 - __cil_tmp114 = *mem_216; + __cil_tmp114 = *mem_216; #line 1957 - __cil_tmp115 = (int )__cil_tmp114; + __cil_tmp115 = (int)__cil_tmp114; #line 1957 - if (__cil_tmp115 == 4) { + if (__cil_tmp115 == 4) { #line 1959 - __cil_tmp116 = (unsigned int )disketteExtension; + __cil_tmp116 = (unsigned int)disketteExtension; #line 1959 - __cil_tmp117 = __cil_tmp116 + 364; + __cil_tmp117 = __cil_tmp116 + 364; #line 1959 - __cil_tmp118 = (unsigned int )(& fdcInfo) + 48; + __cil_tmp118 = (unsigned int)(&fdcInfo) + 48; #line 1959 - mem_217 = (ULONG *)__cil_tmp118; + mem_217 = (ULONG *)__cil_tmp118; #line 1959 - __cil_tmp119 = *mem_217; + __cil_tmp119 = *mem_217; #line 1959 - __cil_tmp120 = 1 << __cil_tmp119; + __cil_tmp120 = 1 << __cil_tmp119; #line 1959 - __cil_tmp121 = (unsigned int )disketteExtension; + __cil_tmp121 = (unsigned int)disketteExtension; #line 1959 - __cil_tmp122 = __cil_tmp121 + 364; + __cil_tmp122 = __cil_tmp121 + 364; #line 1959 - mem_218 = (UCHAR *)__cil_tmp122; + mem_218 = (UCHAR *)__cil_tmp122; #line 1959 - __cil_tmp123 = *mem_218; + __cil_tmp123 = *mem_218; #line 1959 - __cil_tmp124 = (int )__cil_tmp123; + __cil_tmp124 = (int)__cil_tmp123; #line 1959 - __cil_tmp125 = __cil_tmp124 | __cil_tmp120; + __cil_tmp125 = __cil_tmp124 | __cil_tmp120; #line 1959 - mem_219 = (UCHAR *)__cil_tmp117; + mem_219 = (UCHAR *)__cil_tmp117; #line 1959 - *mem_219 = (unsigned char )__cil_tmp125; - } else { - - } - } + *mem_219 = (unsigned char)__cil_tmp125; + } else { + } + } #line 1966 - InterfaceType = (enum _INTERFACE_TYPE )0; - { + InterfaceType = (enum _INTERFACE_TYPE)0; + { #line 1966 - while (1) { - while_43_continue: /* CIL Label */ ; - { + while (1) { + while_43_continue: /* CIL Label */; + { #line 1966 - __cil_tmp126 = (int )InterfaceType; + __cil_tmp126 = (int)InterfaceType; #line 1966 - if (__cil_tmp126 < 16) { + if (__cil_tmp126 < 16) { - } else { - goto while_43_break; - } - } - { + } else { + goto while_43_break; + } + } + { #line 1970 - __cil_tmp127 = (unsigned int )(& fdcInfo) + 8; + __cil_tmp127 = (unsigned int)(&fdcInfo) + 8; #line 1970 - mem_220 = (INTERFACE_TYPE *)__cil_tmp127; + mem_220 = (INTERFACE_TYPE *)__cil_tmp127; #line 1970 - *mem_220 = InterfaceType; + *mem_220 = InterfaceType; #line 1971 - __cil_tmp128 = (unsigned int )(& fdcInfo) + 8; + __cil_tmp128 = (unsigned int)(&fdcInfo) + 8; #line 1971 - __cil_tmp129 = (INTERFACE_TYPE *)__cil_tmp128; + __cil_tmp129 = (INTERFACE_TYPE *)__cil_tmp128; #line 1971 - __cil_tmp130 = (unsigned int )(& fdcInfo) + 40; + __cil_tmp130 = (unsigned int)(&fdcInfo) + 40; #line 1971 - __cil_tmp131 = (ULONG *)__cil_tmp130; + __cil_tmp131 = (ULONG *)__cil_tmp130; #line 1971 - __cil_tmp132 = (unsigned int )(& fdcInfo) + 44; + __cil_tmp132 = (unsigned int)(&fdcInfo) + 44; #line 1971 - __cil_tmp133 = (ULONG *)__cil_tmp132; + __cil_tmp133 = (ULONG *)__cil_tmp132; #line 1971 - __cil_tmp134 = (unsigned int )(& fdcInfo) + 48; + __cil_tmp134 = (unsigned int)(&fdcInfo) + 48; #line 1971 - __cil_tmp135 = (ULONG *)__cil_tmp134; + __cil_tmp135 = (ULONG *)__cil_tmp134; #line 1971 - __cil_tmp136 = (void *)disketteExtension; + __cil_tmp136 = (void *)disketteExtension; #line 1971 - ntStatus = IoQueryDeviceDescription(__cil_tmp129, __cil_tmp131, & Dc, __cil_tmp133, - & Fp, __cil_tmp135, & FlConfigCallBack, - __cil_tmp136); - } + ntStatus = IoQueryDeviceDescription( + __cil_tmp129, __cil_tmp131, &Dc, __cil_tmp133, &Fp, + __cil_tmp135, &FlConfigCallBack, __cil_tmp136); + } #line 1980 - if (ntStatus >= 0L) { - { + if (ntStatus >= 0L) { + { #line 1985 - while (1) { - while_44_continue: /* CIL Label */ ; - goto while_44_break; - } - while_44_break: /* CIL Label */ ; - } - goto while_43_break; - } else { - - } + while (1) { + while_44_continue: /* CIL Label */; + goto while_44_break; + } + while_44_break: /* CIL Label */; + } + goto while_43_break; + } else { + } #line 1966 - __cil_tmp137 = (int )InterfaceType; + __cil_tmp137 = (int)InterfaceType; #line 1966 - __cil_tmp138 = __cil_tmp137 + 1; + __cil_tmp138 = __cil_tmp137 + 1; #line 1966 - InterfaceType = (enum _INTERFACE_TYPE )__cil_tmp138; - } - while_43_break: /* CIL Label */ ; + InterfaceType = (enum _INTERFACE_TYPE)__cil_tmp138; + } + while_43_break: /* CIL Label */; + } + } + } } - } - } - } #line 1991 - if (ntStatus >= 0L) { - { + if (ntStatus >= 0L) { + { #line 1993 - __cil_tmp139 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp139 = (KUSER_SHARED_DATA * const)4292804608U; #line 1993 - __cil_tmp140 = (unsigned int )__cil_tmp139; + __cil_tmp140 = (unsigned int)__cil_tmp139; #line 1993 - __cil_tmp141 = __cil_tmp140 + 732; + __cil_tmp141 = __cil_tmp140 + 732; #line 1993 - mem_221 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp141; + mem_221 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp141; #line 1993 - __cil_tmp142 = *mem_221; + __cil_tmp142 = *mem_221; #line 1993 - __cil_tmp143 = (int )__cil_tmp142; + __cil_tmp143 = (int)__cil_tmp142; #line 1993 - if (__cil_tmp143 == 1) { + if (__cil_tmp143 == 1) { #line 1994 - __cil_tmp144 = (unsigned int )disketteExtension; + __cil_tmp144 = (unsigned int)disketteExtension; #line 1994 - __cil_tmp145 = __cil_tmp144 + 248; + __cil_tmp145 = __cil_tmp144 + 248; #line 1994 - __cil_tmp146 = (unsigned int )(& fdcInfo) + 52; + __cil_tmp146 = (unsigned int)(&fdcInfo) + 52; #line 1994 - mem_222 = (ULONG *)__cil_tmp146; + mem_222 = (ULONG *)__cil_tmp146; #line 1994 - __cil_tmp147 = *mem_222; + __cil_tmp147 = *mem_222; #line 1994 - mem_223 = (UCHAR *)__cil_tmp145; + mem_223 = (UCHAR *)__cil_tmp145; #line 1994 - *mem_223 = (unsigned char )__cil_tmp147; + *mem_223 = (unsigned char)__cil_tmp147; #line 1995 - __cil_tmp148 = (unsigned int )disketteExtension; + __cil_tmp148 = (unsigned int)disketteExtension; #line 1995 - __cil_tmp149 = __cil_tmp148 + 249; + __cil_tmp149 = __cil_tmp148 + 249; #line 1995 - __cil_tmp150 = (unsigned int )(& fdcInfo) + 52; + __cil_tmp150 = (unsigned int)(&fdcInfo) + 52; #line 1995 - mem_224 = (ULONG *)__cil_tmp150; + mem_224 = (ULONG *)__cil_tmp150; #line 1995 - __cil_tmp151 = *mem_224; + __cil_tmp151 = *mem_224; #line 1995 - mem_225 = (UCHAR *)__cil_tmp149; + mem_225 = (UCHAR *)__cil_tmp149; #line 1995 - *mem_225 = (unsigned char )__cil_tmp151; - } else { + *mem_225 = (unsigned char)__cil_tmp151; + } else { #line 1997 - __cil_tmp152 = (unsigned int )disketteExtension; + __cil_tmp152 = (unsigned int)disketteExtension; #line 1997 - __cil_tmp153 = __cil_tmp152 + 248; + __cil_tmp153 = __cil_tmp152 + 248; #line 1997 - __cil_tmp154 = (unsigned int )(& fdcInfo) + 48; + __cil_tmp154 = (unsigned int)(&fdcInfo) + 48; #line 1997 - mem_226 = (ULONG *)__cil_tmp154; + mem_226 = (ULONG *)__cil_tmp154; #line 1997 - __cil_tmp155 = *mem_226; + __cil_tmp155 = *mem_226; #line 1997 - mem_227 = (UCHAR *)__cil_tmp153; + mem_227 = (UCHAR *)__cil_tmp153; #line 1997 - *mem_227 = (unsigned char )__cil_tmp155; + *mem_227 = (unsigned char)__cil_tmp155; #line 1998 - __cil_tmp156 = (unsigned int )disketteExtension; + __cil_tmp156 = (unsigned int)disketteExtension; #line 1998 - __cil_tmp157 = __cil_tmp156 + 249; + __cil_tmp157 = __cil_tmp156 + 249; #line 1998 - __cil_tmp158 = (unsigned int )(& fdcInfo) + 48; + __cil_tmp158 = (unsigned int)(&fdcInfo) + 48; #line 1998 - mem_228 = (ULONG *)__cil_tmp158; + mem_228 = (ULONG *)__cil_tmp158; #line 1998 - __cil_tmp159 = *mem_228; + __cil_tmp159 = *mem_228; #line 1998 - __cil_tmp160 = 16 << __cil_tmp159; + __cil_tmp160 = 16 << __cil_tmp159; #line 1998 - __cil_tmp161 = (unsigned long )__cil_tmp160; + __cil_tmp161 = (unsigned long)__cil_tmp160; #line 1998 - __cil_tmp162 = (unsigned int )(& fdcInfo) + 48; + __cil_tmp162 = (unsigned int)(&fdcInfo) + 48; #line 1998 - mem_229 = (ULONG *)__cil_tmp162; + mem_229 = (ULONG *)__cil_tmp162; #line 1998 - __cil_tmp163 = *mem_229; + __cil_tmp163 = *mem_229; #line 1998 - __cil_tmp164 = __cil_tmp163 | __cil_tmp161; + __cil_tmp164 = __cil_tmp163 | __cil_tmp161; #line 1998 - mem_230 = (UCHAR *)__cil_tmp157; + mem_230 = (UCHAR *)__cil_tmp157; #line 1998 - *mem_230 = (unsigned char )__cil_tmp164; - } - } - { + *mem_230 = (unsigned char)__cil_tmp164; + } + } + { #line 2002 - __cil_tmp165 = (unsigned int )disketteExtension; + __cil_tmp165 = (unsigned int)disketteExtension; #line 2002 - __cil_tmp166 = __cil_tmp165 + 4; + __cil_tmp166 = __cil_tmp165 + 4; #line 2002 - mem_231 = (PDEVICE_OBJECT *)__cil_tmp166; + mem_231 = (PDEVICE_OBJECT *)__cil_tmp166; #line 2002 - __cil_tmp167 = *mem_231; + __cil_tmp167 = *mem_231; #line 2002 - __cil_tmp168 = (GUID *)(& MOUNTDEV_MOUNTED_DEVICE_GUID); + __cil_tmp168 = (GUID *)(&MOUNTDEV_MOUNTED_DEVICE_GUID); #line 2002 - __cil_tmp169 = (GUID const *)__cil_tmp168; + __cil_tmp169 = (GUID const *)__cil_tmp168; #line 2002 - __cil_tmp170 = (void *)0; + __cil_tmp170 = (void *)0; #line 2002 - __cil_tmp171 = (UNICODE_STRING *)__cil_tmp170; + __cil_tmp171 = (UNICODE_STRING *)__cil_tmp170; #line 2002 - __cil_tmp172 = (unsigned int )disketteExtension; + __cil_tmp172 = (unsigned int)disketteExtension; #line 2002 - __cil_tmp173 = __cil_tmp172 + 376; + __cil_tmp173 = __cil_tmp172 + 376; #line 2002 - __cil_tmp174 = (UNICODE_STRING *)__cil_tmp173; + __cil_tmp174 = (UNICODE_STRING *)__cil_tmp173; #line 2002 - pnpStatus = IoRegisterDeviceInterface(__cil_tmp167, __cil_tmp169, __cil_tmp171, - __cil_tmp174); - } + pnpStatus = IoRegisterDeviceInterface(__cil_tmp167, __cil_tmp169, + __cil_tmp171, __cil_tmp174); + } #line 2007 - if (pnpStatus >= 0L) { - { + if (pnpStatus >= 0L) { + { #line 2009 - __cil_tmp175 = (unsigned int )disketteExtension; + __cil_tmp175 = (unsigned int)disketteExtension; #line 2009 - __cil_tmp176 = __cil_tmp175 + 376; + __cil_tmp176 = __cil_tmp175 + 376; #line 2009 - __cil_tmp177 = (UNICODE_STRING *)__cil_tmp176; + __cil_tmp177 = (UNICODE_STRING *)__cil_tmp176; #line 2009 - pnpStatus = IoSetDeviceInterfaceState(__cil_tmp177, (unsigned char)1); + pnpStatus = + IoSetDeviceInterfaceState(__cil_tmp177, (unsigned char)1); + } + } else { } - } else { - - } - { + { #line 2013 - __cil_tmp178 = (unsigned int )disketteExtension; + __cil_tmp178 = (unsigned int)disketteExtension; #line 2013 - __cil_tmp179 = __cil_tmp178 + 12; + __cil_tmp179 = __cil_tmp178 + 12; #line 2013 - mem_232 = (BOOLEAN *)__cil_tmp179; + mem_232 = (BOOLEAN *)__cil_tmp179; #line 2013 - *mem_232 = (unsigned char)1; + *mem_232 = (unsigned char)1; #line 2015 - __cil_tmp180 = (unsigned int )disketteExtension; + __cil_tmp180 = (unsigned int)disketteExtension; #line 2015 - __cil_tmp181 = __cil_tmp180 + 428; + __cil_tmp181 = __cil_tmp180 + 428; #line 2015 - __cil_tmp182 = (FAST_MUTEX *)__cil_tmp181; + __cil_tmp182 = (FAST_MUTEX *)__cil_tmp181; #line 2015 - ExAcquireFastMutex(__cil_tmp182); + ExAcquireFastMutex(__cil_tmp182); #line 2016 - __cil_tmp183 = (unsigned int )disketteExtension; + __cil_tmp183 = (unsigned int)disketteExtension; #line 2016 - __cil_tmp184 = __cil_tmp183 + 14; + __cil_tmp184 = __cil_tmp183 + 14; #line 2016 - mem_233 = (BOOLEAN *)__cil_tmp184; + mem_233 = (BOOLEAN *)__cil_tmp184; #line 2016 - *mem_233 = (unsigned char)0; + *mem_233 = (unsigned char)0; #line 2017 - __cil_tmp185 = (unsigned int )disketteExtension; + __cil_tmp185 = (unsigned int)disketteExtension; #line 2017 - __cil_tmp186 = __cil_tmp185 + 428; + __cil_tmp186 = __cil_tmp185 + 428; #line 2017 - __cil_tmp187 = (FAST_MUTEX *)__cil_tmp186; + __cil_tmp187 = (FAST_MUTEX *)__cil_tmp186; #line 2017 - ExReleaseFastMutex(__cil_tmp187); + ExReleaseFastMutex(__cil_tmp187); #line 2019 - FloppyProcessQueuedRequests(disketteExtension); + FloppyProcessQueuedRequests(disketteExtension); + } + } else { } } else { - } - } else { - - } - { + { #line 2023 - __cil_tmp188 = (unsigned int )Irp; + __cil_tmp188 = (unsigned int)Irp; #line 2023 - __cil_tmp189 = __cil_tmp188 + 24; + __cil_tmp189 = __cil_tmp188 + 24; #line 2023 - mem_234 = (NTSTATUS *)__cil_tmp189; + mem_234 = (NTSTATUS *)__cil_tmp189; #line 2023 - *mem_234 = ntStatus; + *mem_234 = ntStatus; #line 2024 - myStatus = ntStatus; + myStatus = ntStatus; #line 2025 - IofCompleteRequest(Irp, (char)0); - } + IofCompleteRequest(Irp, (char)0); + } #line 2026 - return (ntStatus); -} + return (ntStatus); + } } #line 2029 "floppy.c" -NTSTATUS FloppyPnpComplete(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) -{ struct _KEVENT *__cil_tmp4 ; +NTSTATUS FloppyPnpComplete(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context) { + struct _KEVENT *__cil_tmp4; { - { + { #line 2043 - __cil_tmp4 = (struct _KEVENT *)Context; + __cil_tmp4 = (struct _KEVENT *)Context; #line 2043 - KeSetEvent(__cil_tmp4, 1L, (unsigned char)0); - } + KeSetEvent(__cil_tmp4, 1L, (unsigned char)0); + } #line 2047 - return (-1073741802L); -} + return (-1073741802L); + } } #line 2050 "floppy.c" -NTSTATUS FloppyPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDISKETTE_EXTENSION disketteExtension ; - NTSTATUS ntStatus ; - PIO_STACK_LOCATION irpSp ; - POWER_STATE_TYPE type ; - POWER_STATE state ; - BOOLEAN WaitForCompletion ; - unsigned int __cil_tmp9 ; - unsigned int __cil_tmp10 ; - PVOID __cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - unsigned int __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - UCHAR __cil_tmp27 ; - int __cil_tmp28 ; - int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - FAST_MUTEX *__cil_tmp32 ; - unsigned int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - LONG __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - FAST_MUTEX *__cil_tmp38 ; - unsigned int __cil_tmp39 ; - unsigned int __cil_tmp40 ; - unsigned int __cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - FAST_MUTEX *__cil_tmp46 ; - int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - FAST_MUTEX *__cil_tmp50 ; - int __cil_tmp51 ; - unsigned int __cil_tmp52 ; - unsigned int __cil_tmp53 ; - unsigned int __cil_tmp54 ; - unsigned int __cil_tmp55 ; - unsigned int __cil_tmp56 ; - unsigned int __cil_tmp57 ; - FAST_MUTEX *__cil_tmp58 ; - void *__cil_tmp59 ; - unsigned int __cil_tmp60 ; - unsigned int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - PKTHREAD __cil_tmp63 ; - unsigned int __cil_tmp64 ; - int __cil_tmp65 ; - unsigned int __cil_tmp66 ; - unsigned int __cil_tmp67 ; - PKTHREAD __cil_tmp68 ; - void *__cil_tmp69 ; - enum _KWAIT_REASON __cil_tmp70 ; - void *__cil_tmp71 ; - LARGE_INTEGER *__cil_tmp72 ; - unsigned int __cil_tmp73 ; - unsigned int __cil_tmp74 ; - unsigned int __cil_tmp75 ; - unsigned int __cil_tmp76 ; - CHAR __cil_tmp77 ; - int __cil_tmp78 ; - int __cil_tmp79 ; - unsigned int __cil_tmp80 ; - unsigned int __cil_tmp81 ; - unsigned int __cil_tmp82 ; - unsigned int __cil_tmp83 ; - unsigned int __cil_tmp84 ; - unsigned int __cil_tmp85 ; - unsigned int __cil_tmp86 ; - unsigned int __cil_tmp87 ; - unsigned int __cil_tmp88 ; - unsigned int __cil_tmp89 ; - struct _IO_STACK_LOCATION *__cil_tmp90 ; - unsigned int __cil_tmp91 ; - unsigned int __cil_tmp92 ; - PDEVICE_OBJECT __cil_tmp93 ; - PVOID *mem_94 ; - struct _IO_STACK_LOCATION **mem_95 ; - POWER_STATE_TYPE *mem_96 ; - POWER_STATE *mem_97 ; - UCHAR *mem_98 ; - LONG *mem_99 ; - ULONG_PTR *mem_100 ; - NTSTATUS *mem_101 ; - BOOLEAN *mem_102 ; - BOOLEAN *mem_103 ; - PKTHREAD *mem_104 ; - PKTHREAD *mem_105 ; - CHAR *mem_106 ; - CHAR *mem_107 ; - struct _IO_STACK_LOCATION **mem_108 ; - struct _IO_STACK_LOCATION **mem_109 ; - PDEVICE_OBJECT *mem_110 ; +NTSTATUS FloppyPower(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDISKETTE_EXTENSION disketteExtension; + NTSTATUS ntStatus; + PIO_STACK_LOCATION irpSp; + POWER_STATE_TYPE type; + POWER_STATE state; + BOOLEAN WaitForCompletion; + unsigned int __cil_tmp9; + unsigned int __cil_tmp10; + PVOID __cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + unsigned int __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + UCHAR __cil_tmp27; + int __cil_tmp28; + int __cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + FAST_MUTEX *__cil_tmp32; + unsigned int __cil_tmp33; + unsigned int __cil_tmp34; + LONG __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + FAST_MUTEX *__cil_tmp38; + unsigned int __cil_tmp39; + unsigned int __cil_tmp40; + unsigned int __cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + FAST_MUTEX *__cil_tmp46; + int __cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + FAST_MUTEX *__cil_tmp50; + int __cil_tmp51; + unsigned int __cil_tmp52; + unsigned int __cil_tmp53; + unsigned int __cil_tmp54; + unsigned int __cil_tmp55; + unsigned int __cil_tmp56; + unsigned int __cil_tmp57; + FAST_MUTEX *__cil_tmp58; + void *__cil_tmp59; + unsigned int __cil_tmp60; + unsigned int __cil_tmp61; + unsigned int __cil_tmp62; + PKTHREAD __cil_tmp63; + unsigned int __cil_tmp64; + int __cil_tmp65; + unsigned int __cil_tmp66; + unsigned int __cil_tmp67; + PKTHREAD __cil_tmp68; + void *__cil_tmp69; + enum _KWAIT_REASON __cil_tmp70; + void *__cil_tmp71; + LARGE_INTEGER *__cil_tmp72; + unsigned int __cil_tmp73; + unsigned int __cil_tmp74; + unsigned int __cil_tmp75; + unsigned int __cil_tmp76; + CHAR __cil_tmp77; + int __cil_tmp78; + int __cil_tmp79; + unsigned int __cil_tmp80; + unsigned int __cil_tmp81; + unsigned int __cil_tmp82; + unsigned int __cil_tmp83; + unsigned int __cil_tmp84; + unsigned int __cil_tmp85; + unsigned int __cil_tmp86; + unsigned int __cil_tmp87; + unsigned int __cil_tmp88; + unsigned int __cil_tmp89; + struct _IO_STACK_LOCATION *__cil_tmp90; + unsigned int __cil_tmp91; + unsigned int __cil_tmp92; + PDEVICE_OBJECT __cil_tmp93; + PVOID *mem_94; + struct _IO_STACK_LOCATION **mem_95; + POWER_STATE_TYPE *mem_96; + POWER_STATE *mem_97; + UCHAR *mem_98; + LONG *mem_99; + ULONG_PTR *mem_100; + NTSTATUS *mem_101; + BOOLEAN *mem_102; + BOOLEAN *mem_103; + PKTHREAD *mem_104; + PKTHREAD *mem_105; + CHAR *mem_106; + CHAR *mem_107; + struct _IO_STACK_LOCATION **mem_108; + struct _IO_STACK_LOCATION **mem_109; + PDEVICE_OBJECT *mem_110; { #line 2071 - ntStatus = myStatus; + ntStatus = myStatus; #line 2075 - WaitForCompletion = (unsigned char)1; - { + WaitForCompletion = (unsigned char)1; + { #line 2077 - while (1) { - while_45_continue: /* CIL Label */ ; - goto while_45_break; - } - while_45_break: /* CIL Label */ ; - } + while (1) { + while_45_continue: /* CIL Label */; + goto while_45_break; + } + while_45_break: /* CIL Label */; + } #line 2079 - __cil_tmp9 = (unsigned int )DeviceObject; + __cil_tmp9 = (unsigned int)DeviceObject; #line 2079 - __cil_tmp10 = __cil_tmp9 + 40; + __cil_tmp10 = __cil_tmp9 + 40; #line 2079 - mem_94 = (PVOID *)__cil_tmp10; + mem_94 = (PVOID *)__cil_tmp10; #line 2079 - __cil_tmp11 = *mem_94; + __cil_tmp11 = *mem_94; #line 2079 - disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp11; + disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp11; #line 2080 - __cil_tmp12 = 24 + 8; + __cil_tmp12 = 24 + 8; #line 2080 - __cil_tmp13 = 0 + __cil_tmp12; + __cil_tmp13 = 0 + __cil_tmp12; #line 2080 - __cil_tmp14 = 64 + __cil_tmp13; + __cil_tmp14 = 64 + __cil_tmp13; #line 2080 - __cil_tmp15 = (unsigned int )Irp; + __cil_tmp15 = (unsigned int)Irp; #line 2080 - __cil_tmp16 = __cil_tmp15 + __cil_tmp14; + __cil_tmp16 = __cil_tmp15 + __cil_tmp14; #line 2080 - mem_95 = (struct _IO_STACK_LOCATION **)__cil_tmp16; + mem_95 = (struct _IO_STACK_LOCATION **)__cil_tmp16; #line 2080 - irpSp = *mem_95; + irpSp = *mem_95; #line 2082 - __cil_tmp17 = 0 + 4; + __cil_tmp17 = 0 + 4; #line 2082 - __cil_tmp18 = 4 + __cil_tmp17; + __cil_tmp18 = 4 + __cil_tmp17; #line 2082 - __cil_tmp19 = (unsigned int )irpSp; + __cil_tmp19 = (unsigned int)irpSp; #line 2082 - __cil_tmp20 = __cil_tmp19 + __cil_tmp18; + __cil_tmp20 = __cil_tmp19 + __cil_tmp18; #line 2082 - mem_96 = (POWER_STATE_TYPE *)__cil_tmp20; + mem_96 = (POWER_STATE_TYPE *)__cil_tmp20; #line 2082 - type = *mem_96; + type = *mem_96; #line 2083 - __cil_tmp21 = 0 + 36; + __cil_tmp21 = 0 + 36; #line 2083 - __cil_tmp22 = 4 + __cil_tmp21; + __cil_tmp22 = 4 + __cil_tmp21; #line 2083 - __cil_tmp23 = (unsigned int )irpSp; + __cil_tmp23 = (unsigned int)irpSp; #line 2083 - __cil_tmp24 = __cil_tmp23 + __cil_tmp22; + __cil_tmp24 = __cil_tmp23 + __cil_tmp22; #line 2083 - mem_97 = (POWER_STATE *)__cil_tmp24; + mem_97 = (POWER_STATE *)__cil_tmp24; #line 2083 - state = *mem_97; - { + state = *mem_97; + { #line 2085 - __cil_tmp25 = (unsigned int )irpSp; + __cil_tmp25 = (unsigned int)irpSp; #line 2085 - __cil_tmp26 = __cil_tmp25 + 1; + __cil_tmp26 = __cil_tmp25 + 1; #line 2085 - mem_98 = (UCHAR *)__cil_tmp26; + mem_98 = (UCHAR *)__cil_tmp26; #line 2085 - __cil_tmp27 = *mem_98; + __cil_tmp27 = *mem_98; #line 2086 - if ((int )__cil_tmp27 == 3) { - goto switch_46_3; - } else { + if ((int)__cil_tmp27 == 3) { + goto switch_46_3; + } else { #line 2124 - if ((int )__cil_tmp27 == 2) { - goto switch_46_2; - } else { - { - goto switch_46_default; + if ((int)__cil_tmp27 == 2) { + goto switch_46_2; + } else { + { + goto switch_46_default; #line 2085 - if (0) { - switch_46_3: /* CIL Label */ ; - { + if (0) { + switch_46_3: /* CIL Label */; + { #line 2090 - while (1) { - while_47_continue: /* CIL Label */ ; - goto while_47_break; - } - while_47_break: /* CIL Label */ ; - } - { + while (1) { + while_47_continue: /* CIL Label */; + goto while_47_break; + } + while_47_break: /* CIL Label */; + } + { #line 2092 - __cil_tmp28 = (int )type; + __cil_tmp28 = (int)type; #line 2092 - if (__cil_tmp28 == 0) { - { + if (__cil_tmp28 == 0) { + { #line 2092 - __cil_tmp29 = (int )state.SystemState; + __cil_tmp29 = (int)state.SystemState; #line 2092 - if (__cil_tmp29 > 5) { + if (__cil_tmp29 > 5) { #line 2097 - ntStatus = 0L; - goto switch_46_break; - } else { - - } - } - } else { - - } - } - { + ntStatus = 0L; + goto switch_46_break; + } else { + } + } + } else { + } + } + { #line 2107 - __cil_tmp30 = (unsigned int )disketteExtension; + __cil_tmp30 = (unsigned int)disketteExtension; #line 2107 - __cil_tmp31 = __cil_tmp30 + 56; + __cil_tmp31 = __cil_tmp30 + 56; #line 2107 - __cil_tmp32 = (FAST_MUTEX *)__cil_tmp31; + __cil_tmp32 = (FAST_MUTEX *)__cil_tmp31; #line 2107 - ExAcquireFastMutex(__cil_tmp32); - } - { + ExAcquireFastMutex(__cil_tmp32); + } + { #line 2108 - __cil_tmp33 = (unsigned int )disketteExtension; + __cil_tmp33 = (unsigned int)disketteExtension; #line 2108 - __cil_tmp34 = __cil_tmp33 + 88; + __cil_tmp34 = __cil_tmp33 + 88; #line 2108 - mem_99 = (LONG *)__cil_tmp34; + mem_99 = (LONG *)__cil_tmp34; #line 2108 - __cil_tmp35 = *mem_99; + __cil_tmp35 = *mem_99; #line 2108 - if (__cil_tmp35 >= 0L) { - { + if (__cil_tmp35 >= 0L) { + { #line 2109 - __cil_tmp36 = (unsigned int )disketteExtension; + __cil_tmp36 = (unsigned int)disketteExtension; #line 2109 - __cil_tmp37 = __cil_tmp36 + 56; + __cil_tmp37 = __cil_tmp36 + 56; #line 2109 - __cil_tmp38 = (FAST_MUTEX *)__cil_tmp37; + __cil_tmp38 = (FAST_MUTEX *)__cil_tmp37; #line 2109 - ExReleaseFastMutex(__cil_tmp38); - } - { + ExReleaseFastMutex(__cil_tmp38); + } + { #line 2111 - while (1) { - while_48_continue: /* CIL Label */ ; - goto while_48_break; - } - while_48_break: /* CIL Label */ ; - } - { + while (1) { + while_48_continue: /* CIL Label */; + goto while_48_break; + } + while_48_break: /* CIL Label */; + } + { #line 2113 - PoStartNextPowerIrp(Irp); + PoStartNextPowerIrp(Irp); #line 2114 - __cil_tmp39 = 24 + 4; + __cil_tmp39 = 24 + 4; #line 2114 - __cil_tmp40 = (unsigned int )Irp; + __cil_tmp40 = (unsigned int)Irp; #line 2114 - __cil_tmp41 = __cil_tmp40 + __cil_tmp39; + __cil_tmp41 = __cil_tmp40 + __cil_tmp39; #line 2114 - mem_100 = (ULONG_PTR *)__cil_tmp41; + mem_100 = (ULONG_PTR *)__cil_tmp41; #line 2114 - *mem_100 = 0UL; + *mem_100 = 0UL; #line 2115 - __cil_tmp42 = (unsigned int )Irp; + __cil_tmp42 = (unsigned int)Irp; #line 2115 - __cil_tmp43 = __cil_tmp42 + 24; + __cil_tmp43 = __cil_tmp42 + 24; #line 2115 - mem_101 = (NTSTATUS *)__cil_tmp43; + mem_101 = (NTSTATUS *)__cil_tmp43; #line 2115 - *mem_101 = -2147483631L; + *mem_101 = -2147483631L; #line 2116 - myStatus = -2147483631L; + myStatus = -2147483631L; #line 2117 - IofCompleteRequest(Irp, (char)0); - } + IofCompleteRequest(Irp, (char)0); + } #line 2118 - return (-2147483631L); - } else { - - } - } - { + return (-2147483631L); + } else { + } + } + { #line 2120 - __cil_tmp44 = (unsigned int )disketteExtension; + __cil_tmp44 = (unsigned int)disketteExtension; #line 2120 - __cil_tmp45 = __cil_tmp44 + 56; + __cil_tmp45 = __cil_tmp44 + 56; #line 2120 - __cil_tmp46 = (FAST_MUTEX *)__cil_tmp45; + __cil_tmp46 = (FAST_MUTEX *)__cil_tmp45; #line 2120 - ExReleaseFastMutex(__cil_tmp46); + ExReleaseFastMutex(__cil_tmp46); #line 2122 - ntStatus = 0L; - } - goto switch_46_break; - switch_46_2: /* CIL Label */ ; - { + ntStatus = 0L; + } + goto switch_46_break; + switch_46_2: /* CIL Label */; + { #line 2131 - __cil_tmp47 = (int )type; + __cil_tmp47 = (int)type; #line 2131 - if (__cil_tmp47 == 0) { - { + if (__cil_tmp47 == 0) { + { #line 2132 - __cil_tmp48 = (unsigned int )disketteExtension; + __cil_tmp48 = (unsigned int)disketteExtension; #line 2132 - __cil_tmp49 = __cil_tmp48 + 396; + __cil_tmp49 = __cil_tmp48 + 396; #line 2132 - __cil_tmp50 = (FAST_MUTEX *)__cil_tmp49; + __cil_tmp50 = (FAST_MUTEX *)__cil_tmp49; #line 2132 - ExAcquireFastMutex(__cil_tmp50); - } - { + ExAcquireFastMutex(__cil_tmp50); + } + { #line 2133 - __cil_tmp51 = (int )state.SystemState; + __cil_tmp51 = (int)state.SystemState; #line 2133 - if (__cil_tmp51 == 1) { - { + if (__cil_tmp51 == 1) { + { #line 2134 - while (1) { - while_49_continue: /* CIL Label */ ; - goto while_49_break; - } - while_49_break: /* CIL Label */ ; - } + while (1) { + while_49_continue: /* CIL Label */; + goto while_49_break; + } + while_49_break: /* CIL Label */; + } #line 2135 - __cil_tmp52 = (unsigned int )disketteExtension; + __cil_tmp52 = (unsigned int)disketteExtension; #line 2135 - __cil_tmp53 = __cil_tmp52 + 393; + __cil_tmp53 = __cil_tmp52 + 393; #line 2135 - mem_102 = (BOOLEAN *)__cil_tmp53; + mem_102 = (BOOLEAN *)__cil_tmp53; #line 2135 - *mem_102 = (unsigned char)0; + *mem_102 = (unsigned char)0; #line 2136 - WaitForCompletion = (unsigned char)0; - } else { - { + WaitForCompletion = (unsigned char)0; + } else { + { #line 2138 - while (1) { - while_50_continue: /* CIL Label */ ; - goto while_50_break; - } - while_50_break: /* CIL Label */ ; - } + while (1) { + while_50_continue: /* CIL Label */; + goto while_50_break; + } + while_50_break: /* CIL Label */; + } #line 2139 - WaitForCompletion = (unsigned char)1; + WaitForCompletion = (unsigned char)1; #line 2140 - __cil_tmp54 = (unsigned int )disketteExtension; + __cil_tmp54 = (unsigned int)disketteExtension; #line 2140 - __cil_tmp55 = __cil_tmp54 + 393; + __cil_tmp55 = __cil_tmp54 + 393; #line 2140 - mem_103 = (BOOLEAN *)__cil_tmp55; + mem_103 = (BOOLEAN *)__cil_tmp55; #line 2140 - *mem_103 = (unsigned char)1; - } - } - { + *mem_103 = (unsigned char)1; + } + } + { #line 2142 - __cil_tmp56 = (unsigned int )disketteExtension; + __cil_tmp56 = (unsigned int)disketteExtension; #line 2142 - __cil_tmp57 = __cil_tmp56 + 396; + __cil_tmp57 = __cil_tmp56 + 396; #line 2142 - __cil_tmp58 = (FAST_MUTEX *)__cil_tmp57; + __cil_tmp58 = (FAST_MUTEX *)__cil_tmp57; #line 2142 - ExReleaseFastMutex(__cil_tmp58); - } - { + ExReleaseFastMutex(__cil_tmp58); + } + { #line 2147 - __cil_tmp59 = (void *)0; + __cil_tmp59 = (void *)0; #line 2147 - __cil_tmp60 = (unsigned int )__cil_tmp59; + __cil_tmp60 = (unsigned int)__cil_tmp59; #line 2147 - __cil_tmp61 = (unsigned int )disketteExtension; + __cil_tmp61 = (unsigned int)disketteExtension; #line 2147 - __cil_tmp62 = __cil_tmp61 + 92; + __cil_tmp62 = __cil_tmp61 + 92; #line 2147 - mem_104 = (PKTHREAD *)__cil_tmp62; + mem_104 = (PKTHREAD *)__cil_tmp62; #line 2147 - __cil_tmp63 = *mem_104; + __cil_tmp63 = *mem_104; #line 2147 - __cil_tmp64 = (unsigned int )__cil_tmp63; + __cil_tmp64 = (unsigned int)__cil_tmp63; #line 2147 - if (__cil_tmp64 != __cil_tmp60) { - { + if (__cil_tmp64 != __cil_tmp60) { + { #line 2147 - __cil_tmp65 = (int )WaitForCompletion; + __cil_tmp65 = (int)WaitForCompletion; #line 2147 - if (__cil_tmp65 == 1) { - { + if (__cil_tmp65 == 1) { + { #line 2149 - __cil_tmp66 = (unsigned int )disketteExtension; + __cil_tmp66 = (unsigned int)disketteExtension; #line 2149 - __cil_tmp67 = __cil_tmp66 + 92; + __cil_tmp67 = __cil_tmp66 + 92; #line 2149 - mem_105 = (PKTHREAD *)__cil_tmp67; + mem_105 = (PKTHREAD *)__cil_tmp67; #line 2149 - __cil_tmp68 = *mem_105; + __cil_tmp68 = *mem_105; #line 2149 - __cil_tmp69 = (void *)__cil_tmp68; + __cil_tmp69 = (void *)__cil_tmp68; #line 2149 - __cil_tmp70 = (enum _KWAIT_REASON )0; + __cil_tmp70 = (enum _KWAIT_REASON)0; #line 2149 - __cil_tmp71 = (void *)0; + __cil_tmp71 = (void *)0; #line 2149 - __cil_tmp72 = (LARGE_INTEGER *)__cil_tmp71; + __cil_tmp72 = (LARGE_INTEGER *)__cil_tmp71; #line 2149 - KeWaitForSingleObject(__cil_tmp69, __cil_tmp70, (char)0, (unsigned char)0, - __cil_tmp72); + KeWaitForSingleObject(__cil_tmp69, __cil_tmp70, + (char)0, (unsigned char)0, + __cil_tmp72); + } + } else { + } + } + } else { + } + } + } else { + } + } + { +#line 2157 + while (1) { + while_51_continue: /* CIL Label */; + goto while_51_break; + } + while_51_break: /* CIL Label */; } +#line 2158 + ntStatus = 0L; + goto switch_46_break; + switch_46_default: /* CIL Label */; + goto switch_46_break; } else { - + switch_46_break: /* CIL Label */; } - } - } else { - - } } - } else { - - } - } - { -#line 2157 - while (1) { - while_51_continue: /* CIL Label */ ; - goto while_51_break; - } - while_51_break: /* CIL Label */ ; } -#line 2158 - ntStatus = 0L; - goto switch_46_break; - switch_46_default: /* CIL Label */ ; - goto switch_46_break; - } else { - switch_46_break: /* CIL Label */ ; - } } } - } - } - { + { #line 2168 - PoStartNextPowerIrp(Irp); - } + PoStartNextPowerIrp(Irp); + } #line 2169 - if (s == 1) { + if (s == 1) { #line 2169 - s = 3; - } else { - { + s = 3; + } else { + { #line 2169 - __VERIFIER_assert(0); + __VERIFIER_assert(0); + } } - } - { + { #line 2170 - __cil_tmp73 = (unsigned int )Irp; + __cil_tmp73 = (unsigned int)Irp; #line 2170 - __cil_tmp74 = __cil_tmp73 + 35; + __cil_tmp74 = __cil_tmp73 + 35; #line 2170 - __cil_tmp75 = (unsigned int )Irp; + __cil_tmp75 = (unsigned int)Irp; #line 2170 - __cil_tmp76 = __cil_tmp75 + 35; + __cil_tmp76 = __cil_tmp75 + 35; #line 2170 - mem_106 = (CHAR *)__cil_tmp76; + mem_106 = (CHAR *)__cil_tmp76; #line 2170 - __cil_tmp77 = *mem_106; + __cil_tmp77 = *mem_106; #line 2170 - __cil_tmp78 = (int )__cil_tmp77; + __cil_tmp78 = (int)__cil_tmp77; #line 2170 - __cil_tmp79 = __cil_tmp78 + 1; + __cil_tmp79 = __cil_tmp78 + 1; #line 2170 - mem_107 = (CHAR *)__cil_tmp74; + mem_107 = (CHAR *)__cil_tmp74; #line 2170 - *mem_107 = (char )__cil_tmp79; + *mem_107 = (char)__cil_tmp79; #line 2170 - __cil_tmp80 = 24 + 8; + __cil_tmp80 = 24 + 8; #line 2170 - __cil_tmp81 = 0 + __cil_tmp80; + __cil_tmp81 = 0 + __cil_tmp80; #line 2170 - __cil_tmp82 = 64 + __cil_tmp81; + __cil_tmp82 = 64 + __cil_tmp81; #line 2170 - __cil_tmp83 = (unsigned int )Irp; + __cil_tmp83 = (unsigned int)Irp; #line 2170 - __cil_tmp84 = __cil_tmp83 + __cil_tmp82; + __cil_tmp84 = __cil_tmp83 + __cil_tmp82; #line 2170 - __cil_tmp85 = 24 + 8; + __cil_tmp85 = 24 + 8; #line 2170 - __cil_tmp86 = 0 + __cil_tmp85; + __cil_tmp86 = 0 + __cil_tmp85; #line 2170 - __cil_tmp87 = 64 + __cil_tmp86; + __cil_tmp87 = 64 + __cil_tmp86; #line 2170 - __cil_tmp88 = (unsigned int )Irp; + __cil_tmp88 = (unsigned int)Irp; #line 2170 - __cil_tmp89 = __cil_tmp88 + __cil_tmp87; + __cil_tmp89 = __cil_tmp88 + __cil_tmp87; #line 2170 - mem_108 = (struct _IO_STACK_LOCATION **)__cil_tmp89; + mem_108 = (struct _IO_STACK_LOCATION **)__cil_tmp89; #line 2170 - __cil_tmp90 = *mem_108; + __cil_tmp90 = *mem_108; #line 2170 - mem_109 = (struct _IO_STACK_LOCATION **)__cil_tmp84; + mem_109 = (struct _IO_STACK_LOCATION **)__cil_tmp84; #line 2170 - *mem_109 = __cil_tmp90 + 1; + *mem_109 = __cil_tmp90 + 1; #line 2171 - __cil_tmp91 = (unsigned int )disketteExtension; + __cil_tmp91 = (unsigned int)disketteExtension; #line 2171 - __cil_tmp92 = __cil_tmp91 + 8; + __cil_tmp92 = __cil_tmp91 + 8; #line 2171 - mem_110 = (PDEVICE_OBJECT *)__cil_tmp92; + mem_110 = (PDEVICE_OBJECT *)__cil_tmp92; #line 2171 - __cil_tmp93 = *mem_110; + __cil_tmp93 = *mem_110; #line 2171 - ntStatus = PoCallDriver(__cil_tmp93, Irp); - } + ntStatus = PoCallDriver(__cil_tmp93, Irp); + } #line 2173 - return (ntStatus); -} + return (ntStatus); + } } #line 2176 "floppy.c" -NTSTATUS FloppyReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - NTSTATUS ntStatus ; - PDISKETTE_EXTENSION disketteExtension ; - unsigned int __cil_tmp6 ; - unsigned int __cil_tmp7 ; - PVOID __cil_tmp8 ; - unsigned int __cil_tmp9 ; - unsigned int __cil_tmp10 ; - unsigned int __cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - unsigned int __cil_tmp14 ; - unsigned int __cil_tmp15 ; - FAST_MUTEX *__cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - unsigned int __cil_tmp20 ; - FAST_MUTEX *__cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - FAST_MUTEX *__cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - BOOLEAN __cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - unsigned int __cil_tmp32 ; - unsigned int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - MEDIA_TYPE __cil_tmp39 ; - int __cil_tmp40 ; - unsigned int __cil_tmp41 ; - unsigned int __cil_tmp42 ; - ULONG __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - ULONG __cil_tmp46 ; - unsigned int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - ULONG __cil_tmp51 ; - ULONG __cil_tmp52 ; - unsigned int __cil_tmp53 ; - unsigned int __cil_tmp54 ; - ULONG __cil_tmp55 ; - ULONG __cil_tmp56 ; - unsigned int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - ULONG __cil_tmp59 ; - unsigned long __cil_tmp60 ; - unsigned int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - unsigned int __cil_tmp63 ; - unsigned int __cil_tmp64 ; - unsigned int __cil_tmp65 ; - unsigned int __cil_tmp66 ; - unsigned int __cil_tmp67 ; - unsigned int __cil_tmp68 ; - unsigned int __cil_tmp69 ; - PVOID *mem_70 ; - struct _IO_STACK_LOCATION **mem_71 ; - BOOLEAN *mem_72 ; - BOOLEAN *mem_73 ; - BOOLEAN *mem_74 ; - BOOLEAN *mem_75 ; - ULONG_PTR *mem_76 ; - NTSTATUS *mem_77 ; - MEDIA_TYPE *mem_78 ; - ULONG *mem_79 ; - ULONG *mem_80 ; - ULONG *mem_81 ; - ULONG *mem_82 ; - ULONG *mem_83 ; - ULONG *mem_84 ; - ULONG_PTR *mem_85 ; - NTSTATUS *mem_86 ; - NTSTATUS *mem_87 ; +NTSTATUS FloppyReadWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + NTSTATUS ntStatus; + PDISKETTE_EXTENSION disketteExtension; + unsigned int __cil_tmp6; + unsigned int __cil_tmp7; + PVOID __cil_tmp8; + unsigned int __cil_tmp9; + unsigned int __cil_tmp10; + unsigned int __cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + unsigned int __cil_tmp14; + unsigned int __cil_tmp15; + FAST_MUTEX *__cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + unsigned int __cil_tmp20; + FAST_MUTEX *__cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + FAST_MUTEX *__cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + BOOLEAN __cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + unsigned int __cil_tmp32; + unsigned int __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + MEDIA_TYPE __cil_tmp39; + int __cil_tmp40; + unsigned int __cil_tmp41; + unsigned int __cil_tmp42; + ULONG __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + ULONG __cil_tmp46; + unsigned int __cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + ULONG __cil_tmp51; + ULONG __cil_tmp52; + unsigned int __cil_tmp53; + unsigned int __cil_tmp54; + ULONG __cil_tmp55; + ULONG __cil_tmp56; + unsigned int __cil_tmp57; + unsigned int __cil_tmp58; + ULONG __cil_tmp59; + unsigned long __cil_tmp60; + unsigned int __cil_tmp61; + unsigned int __cil_tmp62; + unsigned int __cil_tmp63; + unsigned int __cil_tmp64; + unsigned int __cil_tmp65; + unsigned int __cil_tmp66; + unsigned int __cil_tmp67; + unsigned int __cil_tmp68; + unsigned int __cil_tmp69; + PVOID *mem_70; + struct _IO_STACK_LOCATION **mem_71; + BOOLEAN *mem_72; + BOOLEAN *mem_73; + BOOLEAN *mem_74; + BOOLEAN *mem_75; + ULONG_PTR *mem_76; + NTSTATUS *mem_77; + MEDIA_TYPE *mem_78; + ULONG *mem_79; + ULONG *mem_80; + ULONG *mem_81; + ULONG *mem_82; + ULONG *mem_83; + ULONG *mem_84; + ULONG_PTR *mem_85; + NTSTATUS *mem_86; + NTSTATUS *mem_87; { - { + { #line 2208 - while (1) { - while_52_continue: /* CIL Label */ ; - goto while_52_break; - } - while_52_break: /* CIL Label */ ; - } - { + while (1) { + while_52_continue: /* CIL Label */; + goto while_52_break; + } + while_52_break: /* CIL Label */; + } + { #line 2210 - __cil_tmp6 = (unsigned int )DeviceObject; + __cil_tmp6 = (unsigned int)DeviceObject; #line 2210 - __cil_tmp7 = __cil_tmp6 + 40; + __cil_tmp7 = __cil_tmp6 + 40; #line 2210 - mem_70 = (PVOID *)__cil_tmp7; + mem_70 = (PVOID *)__cil_tmp7; #line 2210 - __cil_tmp8 = *mem_70; + __cil_tmp8 = *mem_70; #line 2210 - disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp8; + disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp8; #line 2212 - __cil_tmp9 = 24 + 8; + __cil_tmp9 = 24 + 8; #line 2212 - __cil_tmp10 = 0 + __cil_tmp9; + __cil_tmp10 = 0 + __cil_tmp9; #line 2212 - __cil_tmp11 = 64 + __cil_tmp10; + __cil_tmp11 = 64 + __cil_tmp10; #line 2212 - __cil_tmp12 = (unsigned int )Irp; + __cil_tmp12 = (unsigned int)Irp; #line 2212 - __cil_tmp13 = __cil_tmp12 + __cil_tmp11; + __cil_tmp13 = __cil_tmp12 + __cil_tmp11; #line 2212 - mem_71 = (struct _IO_STACK_LOCATION **)__cil_tmp13; + mem_71 = (struct _IO_STACK_LOCATION **)__cil_tmp13; #line 2212 - irpSp = *mem_71; + irpSp = *mem_71; #line 2218 - __cil_tmp14 = (unsigned int )disketteExtension; + __cil_tmp14 = (unsigned int)disketteExtension; #line 2218 - __cil_tmp15 = __cil_tmp14 + 428; + __cil_tmp15 = __cil_tmp14 + 428; #line 2218 - __cil_tmp16 = (FAST_MUTEX *)__cil_tmp15; + __cil_tmp16 = (FAST_MUTEX *)__cil_tmp15; #line 2218 - ExAcquireFastMutex(__cil_tmp16); - } - { + ExAcquireFastMutex(__cil_tmp16); + } + { #line 2219 - __cil_tmp17 = (unsigned int )disketteExtension; + __cil_tmp17 = (unsigned int)disketteExtension; #line 2219 - __cil_tmp18 = __cil_tmp17 + 14; - { + __cil_tmp18 = __cil_tmp17 + 14; + { #line 2219 - mem_72 = (BOOLEAN *)__cil_tmp18; + mem_72 = (BOOLEAN *)__cil_tmp18; #line 2219 - if (*mem_72) { - { + if (*mem_72) { + { #line 2221 - ntStatus = FloppyQueueRequest(disketteExtension, Irp); + ntStatus = FloppyQueueRequest(disketteExtension, Irp); #line 2223 - __cil_tmp19 = (unsigned int )disketteExtension; + __cil_tmp19 = (unsigned int)disketteExtension; #line 2223 - __cil_tmp20 = __cil_tmp19 + 428; + __cil_tmp20 = __cil_tmp19 + 428; #line 2223 - __cil_tmp21 = (FAST_MUTEX *)__cil_tmp20; + __cil_tmp21 = (FAST_MUTEX *)__cil_tmp20; #line 2223 - ExReleaseFastMutex(__cil_tmp21); - } + ExReleaseFastMutex(__cil_tmp21); + } #line 2224 - return (ntStatus); - } else { - - } - } - } - { + return (ntStatus); + } else { + } + } + } + { #line 2226 - __cil_tmp22 = (unsigned int )disketteExtension; + __cil_tmp22 = (unsigned int)disketteExtension; #line 2226 - __cil_tmp23 = __cil_tmp22 + 428; + __cil_tmp23 = __cil_tmp22 + 428; #line 2226 - __cil_tmp24 = (FAST_MUTEX *)__cil_tmp23; + __cil_tmp24 = (FAST_MUTEX *)__cil_tmp23; #line 2226 - ExReleaseFastMutex(__cil_tmp24); - } - { + ExReleaseFastMutex(__cil_tmp24); + } + { #line 2232 - __cil_tmp25 = (unsigned int )disketteExtension; + __cil_tmp25 = (unsigned int)disketteExtension; #line 2232 - __cil_tmp26 = __cil_tmp25 + 13; - { + __cil_tmp26 = __cil_tmp25 + 13; + { #line 2232 - mem_73 = (BOOLEAN *)__cil_tmp26; + mem_73 = (BOOLEAN *)__cil_tmp26; #line 2232 - if (*mem_73) { - goto _L; - } else { - { + if (*mem_73) { + goto _L; + } else { + { #line 2232 - __cil_tmp27 = (unsigned int )disketteExtension; + __cil_tmp27 = (unsigned int)disketteExtension; #line 2232 - __cil_tmp28 = __cil_tmp27 + 12; + __cil_tmp28 = __cil_tmp27 + 12; #line 2232 - mem_74 = (BOOLEAN *)__cil_tmp28; + mem_74 = (BOOLEAN *)__cil_tmp28; #line 2232 - __cil_tmp29 = *mem_74; + __cil_tmp29 = *mem_74; #line 2232 - if (! __cil_tmp29) { - _L: - { + if (!__cil_tmp29) { + _L : { #line 2234 - __cil_tmp30 = (unsigned int )disketteExtension; + __cil_tmp30 = (unsigned int)disketteExtension; #line 2234 - __cil_tmp31 = __cil_tmp30 + 13; - { + __cil_tmp31 = __cil_tmp30 + 13; + { #line 2234 - mem_75 = (BOOLEAN *)__cil_tmp31; + mem_75 = (BOOLEAN *)__cil_tmp31; #line 2234 - if (*mem_75) { + if (*mem_75) { #line 2235 - ntStatus = -1073741738L; - } else { + ntStatus = -1073741738L; + } else { #line 2237 - ntStatus = -1073741823L; - } - } - } - { + ntStatus = -1073741823L; + } + } + } + { #line 2239 - __cil_tmp32 = 24 + 4; + __cil_tmp32 = 24 + 4; #line 2239 - __cil_tmp33 = (unsigned int )Irp; + __cil_tmp33 = (unsigned int)Irp; #line 2239 - __cil_tmp34 = __cil_tmp33 + __cil_tmp32; + __cil_tmp34 = __cil_tmp33 + __cil_tmp32; #line 2239 - mem_76 = (ULONG_PTR *)__cil_tmp34; + mem_76 = (ULONG_PTR *)__cil_tmp34; #line 2239 - *mem_76 = 0UL; + *mem_76 = 0UL; #line 2240 - __cil_tmp35 = (unsigned int )Irp; + __cil_tmp35 = (unsigned int)Irp; #line 2240 - __cil_tmp36 = __cil_tmp35 + 24; + __cil_tmp36 = __cil_tmp35 + 24; #line 2240 - mem_77 = (NTSTATUS *)__cil_tmp36; + mem_77 = (NTSTATUS *)__cil_tmp36; #line 2240 - *mem_77 = ntStatus; + *mem_77 = ntStatus; #line 2241 - myStatus = ntStatus; + myStatus = ntStatus; #line 2242 - IofCompleteRequest(Irp, (char)0); - } + IofCompleteRequest(Irp, (char)0); + } #line 2243 - return (ntStatus); - } else { - - } + return (ntStatus); + } else { + } + } + } + } } - } - } - } - { + { #line 2245 - __cil_tmp37 = (unsigned int )disketteExtension; + __cil_tmp37 = (unsigned int)disketteExtension; #line 2245 - __cil_tmp38 = __cil_tmp37 + 184; + __cil_tmp38 = __cil_tmp37 + 184; #line 2245 - mem_78 = (MEDIA_TYPE *)__cil_tmp38; + mem_78 = (MEDIA_TYPE *)__cil_tmp38; #line 2245 - __cil_tmp39 = *mem_78; + __cil_tmp39 = *mem_78; #line 2245 - __cil_tmp40 = (int )__cil_tmp39; + __cil_tmp40 = (int)__cil_tmp39; #line 2245 - if (__cil_tmp40 > 0) { - { + if (__cil_tmp40 > 0) { + { #line 2245 - __cil_tmp41 = (unsigned int )disketteExtension; + __cil_tmp41 = (unsigned int)disketteExtension; #line 2245 - __cil_tmp42 = __cil_tmp41 + 180; + __cil_tmp42 = __cil_tmp41 + 180; #line 2245 - mem_79 = (ULONG *)__cil_tmp42; + mem_79 = (ULONG *)__cil_tmp42; #line 2245 - __cil_tmp43 = *mem_79; + __cil_tmp43 = *mem_79; #line 2245 - __cil_tmp44 = (unsigned int )irpSp; + __cil_tmp44 = (unsigned int)irpSp; #line 2245 - __cil_tmp45 = __cil_tmp44 + 4; + __cil_tmp45 = __cil_tmp44 + 4; #line 2245 - mem_80 = (ULONG *)__cil_tmp45; + mem_80 = (ULONG *)__cil_tmp45; #line 2245 - __cil_tmp46 = *mem_80; + __cil_tmp46 = *mem_80; #line 2245 - __cil_tmp47 = 0 + 8; + __cil_tmp47 = 0 + 8; #line 2245 - __cil_tmp48 = 4 + __cil_tmp47; + __cil_tmp48 = 4 + __cil_tmp47; #line 2245 - __cil_tmp49 = (unsigned int )irpSp; + __cil_tmp49 = (unsigned int)irpSp; #line 2245 - __cil_tmp50 = __cil_tmp49 + __cil_tmp48; + __cil_tmp50 = __cil_tmp49 + __cil_tmp48; #line 2245 - mem_81 = (ULONG *)__cil_tmp50; + mem_81 = (ULONG *)__cil_tmp50; #line 2245 - __cil_tmp51 = *mem_81; + __cil_tmp51 = *mem_81; #line 2245 - __cil_tmp52 = __cil_tmp51 + __cil_tmp46; + __cil_tmp52 = __cil_tmp51 + __cil_tmp46; #line 2245 - if (__cil_tmp52 > __cil_tmp43) { - goto _L___1; - } else { - { + if (__cil_tmp52 > __cil_tmp43) { + goto _L___1; + } else { + { #line 2245 - __cil_tmp53 = (unsigned int )disketteExtension; + __cil_tmp53 = (unsigned int)disketteExtension; #line 2245 - __cil_tmp54 = __cil_tmp53 + 176; + __cil_tmp54 = __cil_tmp53 + 176; #line 2245 - mem_82 = (ULONG *)__cil_tmp54; + mem_82 = (ULONG *)__cil_tmp54; #line 2245 - __cil_tmp55 = *mem_82; + __cil_tmp55 = *mem_82; #line 2245 - __cil_tmp56 = __cil_tmp55 - 1UL; + __cil_tmp56 = __cil_tmp55 - 1UL; #line 2245 - __cil_tmp57 = (unsigned int )irpSp; + __cil_tmp57 = (unsigned int)irpSp; #line 2245 - __cil_tmp58 = __cil_tmp57 + 4; + __cil_tmp58 = __cil_tmp57 + 4; #line 2245 - mem_83 = (ULONG *)__cil_tmp58; + mem_83 = (ULONG *)__cil_tmp58; #line 2245 - __cil_tmp59 = *mem_83; + __cil_tmp59 = *mem_83; #line 2245 - __cil_tmp60 = __cil_tmp59 & __cil_tmp56; + __cil_tmp60 = __cil_tmp59 & __cil_tmp56; #line 2245 - if (__cil_tmp60 != 0UL) { - _L___1: - { + if (__cil_tmp60 != 0UL) { + _L___1 : { #line 2252 - while (1) { - while_53_continue: /* CIL Label */ ; - goto while_53_break; - } - while_53_break: /* CIL Label */ ; - } - { + while (1) { + while_53_continue: /* CIL Label */; + goto while_53_break; + } + while_53_break: /* CIL Label */; + } + { #line 2261 - while (1) { - while_54_continue: /* CIL Label */ ; - goto while_54_break; - } - while_54_break: /* CIL Label */ ; - } + while (1) { + while_54_continue: /* CIL Label */; + goto while_54_break; + } + while_54_break: /* CIL Label */; + } #line 2263 - ntStatus = -1073741811L; + ntStatus = -1073741811L; + } else { + goto _L___0; + } + } + } + } } else { - goto _L___0; - } - } - } - } - } else { - _L___0: - { + _L___0 : { #line 2272 - __cil_tmp61 = (unsigned int )irpSp; + __cil_tmp61 = (unsigned int)irpSp; #line 2272 - __cil_tmp62 = __cil_tmp61 + 4; - { + __cil_tmp62 = __cil_tmp61 + 4; + { #line 2272 - mem_84 = (ULONG *)__cil_tmp62; + mem_84 = (ULONG *)__cil_tmp62; #line 2272 - if (*mem_84) { - { + if (*mem_84) { + { #line 2279 - while (1) { - while_55_continue: /* CIL Label */ ; - goto while_55_break; - } - while_55_break: /* CIL Label */ ; - } - { + while (1) { + while_55_continue: /* CIL Label */; + goto while_55_break; + } + while_55_break: /* CIL Label */; + } + { #line 2281 - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - } else { + ntStatus = FlQueueIrpToThread(Irp, disketteExtension); + } + } else { #line 2288 - __cil_tmp63 = 24 + 4; + __cil_tmp63 = 24 + 4; #line 2288 - __cil_tmp64 = (unsigned int )Irp; + __cil_tmp64 = (unsigned int)Irp; #line 2288 - __cil_tmp65 = __cil_tmp64 + __cil_tmp63; + __cil_tmp65 = __cil_tmp64 + __cil_tmp63; #line 2288 - mem_85 = (ULONG_PTR *)__cil_tmp65; + mem_85 = (ULONG_PTR *)__cil_tmp65; #line 2288 - *mem_85 = 0UL; + *mem_85 = 0UL; #line 2289 - __cil_tmp66 = (unsigned int )Irp; + __cil_tmp66 = (unsigned int)Irp; #line 2289 - __cil_tmp67 = __cil_tmp66 + 24; + __cil_tmp67 = __cil_tmp66 + 24; #line 2289 - mem_86 = (NTSTATUS *)__cil_tmp67; + mem_86 = (NTSTATUS *)__cil_tmp67; #line 2289 - *mem_86 = 0L; + *mem_86 = 0L; #line 2290 - myStatus = 0L; - { + myStatus = 0L; + { #line 2291 - while (1) { - while_56_continue: /* CIL Label */ ; - goto while_56_break; - } - while_56_break: /* CIL Label */ ; - } - { + while (1) { + while_56_continue: /* CIL Label */; + goto while_56_break; + } + while_56_break: /* CIL Label */; + } + { #line 2292 - IofCompleteRequest(Irp, (char)0); - } + IofCompleteRequest(Irp, (char)0); + } #line 2293 - return (0L); - } - } + return (0L); + } + } + } + } } - } - } #line 2297 - if (ntStatus != 259L) { + if (ntStatus != 259L) { #line 2298 - __cil_tmp68 = (unsigned int )Irp; + __cil_tmp68 = (unsigned int)Irp; #line 2298 - __cil_tmp69 = __cil_tmp68 + 24; + __cil_tmp69 = __cil_tmp68 + 24; #line 2298 - mem_87 = (NTSTATUS *)__cil_tmp69; + mem_87 = (NTSTATUS *)__cil_tmp69; #line 2298 - *mem_87 = ntStatus; + *mem_87 = ntStatus; #line 2299 - myStatus = ntStatus; - { + myStatus = ntStatus; + { #line 2301 - while (1) { - while_57_continue: /* CIL Label */ ; - goto while_57_break; - } - while_57_break: /* CIL Label */ ; - } - { + while (1) { + while_57_continue: /* CIL Label */; + goto while_57_break; + } + while_57_break: /* CIL Label */; + } + { #line 2302 - IofCompleteRequest(Irp, (char)0); + IofCompleteRequest(Irp, (char)0); + } + } else { } - } else { - - } #line 2305 - return (ntStatus); -} + return (ntStatus); + } } #line 2308 "floppy.c" -NTSTATUS FlInterpretError(UCHAR StatusRegister1 , UCHAR StatusRegister2 ) -{ int __cil_tmp3 ; - int __cil_tmp4 ; - int __cil_tmp5 ; - int __cil_tmp6 ; - int __cil_tmp7 ; - int __cil_tmp8 ; - int __cil_tmp9 ; - int __cil_tmp10 ; - int __cil_tmp11 ; - int __cil_tmp12 ; - int __cil_tmp13 ; +NTSTATUS FlInterpretError(UCHAR StatusRegister1, UCHAR StatusRegister2) { + int __cil_tmp3; + int __cil_tmp4; + int __cil_tmp5; + int __cil_tmp6; + int __cil_tmp7; + int __cil_tmp8; + int __cil_tmp9; + int __cil_tmp10; + int __cil_tmp11; + int __cil_tmp12; + int __cil_tmp13; { - { + { #line 2335 - __cil_tmp3 = (int )StatusRegister1; + __cil_tmp3 = (int)StatusRegister1; #line 2335 - if (__cil_tmp3 & 32) { - goto _L; - } else { - { + if (__cil_tmp3 & 32) { + goto _L; + } else { + { #line 2335 - __cil_tmp4 = (int )StatusRegister2; + __cil_tmp4 = (int)StatusRegister2; #line 2335 - if (__cil_tmp4 & 32) { - _L: - { + if (__cil_tmp4 & 32) { + _L : { #line 2341 - while (1) { - while_58_continue: /* CIL Label */ ; - goto while_58_break; - } - while_58_break: /* CIL Label */ ; - } + while (1) { + while_58_continue: /* CIL Label */; + goto while_58_break; + } + while_58_break: /* CIL Label */; + } #line 2342 - return (-1073741761L); - } else { - - } + return (-1073741761L); + } else { + } + } + } } - } - } - { + { #line 2345 - __cil_tmp5 = (int )StatusRegister1; + __cil_tmp5 = (int)StatusRegister1; #line 2345 - if (__cil_tmp5 & 16) { - { + if (__cil_tmp5 & 16) { + { #line 2350 - while (1) { - while_59_continue: /* CIL Label */ ; - goto while_59_break; - } - while_59_break: /* CIL Label */ ; - } + while (1) { + while_59_continue: /* CIL Label */; + goto while_59_break; + } + while_59_break: /* CIL Label */; + } #line 2351 - return (-1073741764L); - } else { - - } - } - { + return (-1073741764L); + } else { + } + } + { #line 2354 - __cil_tmp6 = (int )StatusRegister1; + __cil_tmp6 = (int)StatusRegister1; #line 2354 - if (__cil_tmp6 & 4) { - goto _L___0; - } else { - { + if (__cil_tmp6 & 4) { + goto _L___0; + } else { + { #line 2354 - __cil_tmp7 = (int )StatusRegister1; + __cil_tmp7 = (int)StatusRegister1; #line 2354 - if (__cil_tmp7 & 128) { - _L___0: - { + if (__cil_tmp7 & 128) { + _L___0 : { #line 2360 - while (1) { - while_60_continue: /* CIL Label */ ; - goto while_60_break; - } - while_60_break: /* CIL Label */ ; - } + while (1) { + while_60_continue: /* CIL Label */; + goto while_60_break; + } + while_60_break: /* CIL Label */; + } #line 2361 - return (-1073741803L); - } else { - - } + return (-1073741803L); + } else { + } + } + } } - } - } - { + { #line 2364 - __cil_tmp8 = (int )StatusRegister2; + __cil_tmp8 = (int)StatusRegister2; #line 2364 - if (__cil_tmp8 & 1) { - goto _L___1; - } else { - { + if (__cil_tmp8 & 1) { + goto _L___1; + } else { + { #line 2364 - __cil_tmp9 = (int )StatusRegister2; + __cil_tmp9 = (int)StatusRegister2; #line 2364 - if (__cil_tmp9 & 2) { - goto _L___1; - } else { - { + if (__cil_tmp9 & 2) { + goto _L___1; + } else { + { #line 2364 - __cil_tmp10 = (int )StatusRegister2; + __cil_tmp10 = (int)StatusRegister2; #line 2364 - if (__cil_tmp10 & 64) { - _L___1: - { + if (__cil_tmp10 & 64) { + _L___1 : { #line 2371 - while (1) { - while_61_continue: /* CIL Label */ ; - goto while_61_break; - } - while_61_break: /* CIL Label */ ; - } + while (1) { + while_61_continue: /* CIL Label */; + goto while_61_break; + } + while_61_break: /* CIL Label */; + } #line 2372 - return (-1073741668L); - } else { - - } + return (-1073741668L); + } else { + } + } + } + } } } - } - } - } - { + { #line 2375 - __cil_tmp11 = (int )StatusRegister1; + __cil_tmp11 = (int)StatusRegister1; #line 2375 - if (__cil_tmp11 & 2) { - { + if (__cil_tmp11 & 2) { + { #line 2380 - while (1) { - while_62_continue: /* CIL Label */ ; - goto while_62_break; - } - while_62_break: /* CIL Label */ ; - } + while (1) { + while_62_continue: /* CIL Label */; + goto while_62_break; + } + while_62_break: /* CIL Label */; + } #line 2381 - return (-1073741662L); - } else { - - } - } - { + return (-1073741662L); + } else { + } + } + { #line 2384 - __cil_tmp12 = (int )StatusRegister1; + __cil_tmp12 = (int)StatusRegister1; #line 2384 - if (__cil_tmp12 & 1) { - { + if (__cil_tmp12 & 1) { + { #line 2389 - while (1) { - while_63_continue: /* CIL Label */ ; - goto while_63_break; - } - while_63_break: /* CIL Label */ ; - } + while (1) { + while_63_continue: /* CIL Label */; + goto while_63_break; + } + while_63_break: /* CIL Label */; + } #line 2390 - return (-1073741467L); - } else { - - } - } - { + return (-1073741467L); + } else { + } + } + { #line 2394 - __cil_tmp13 = (int )StatusRegister2; + __cil_tmp13 = (int)StatusRegister2; #line 2394 - if (__cil_tmp13 & 16) { - { + if (__cil_tmp13 & 16) { + { #line 2399 - while (1) { - while_64_continue: /* CIL Label */ ; - goto while_64_break; - } - while_64_break: /* CIL Label */ ; - } + while (1) { + while_64_continue: /* CIL Label */; + goto while_64_break; + } + while_64_break: /* CIL Label */; + } #line 2400 - return (-1073741466L); - } else { - - } - } - { + return (-1073741466L); + } else { + } + } + { #line 2412 - while (1) { - while_65_continue: /* CIL Label */ ; - goto while_65_break; - } - while_65_break: /* CIL Label */ ; - } + while (1) { + while_65_continue: /* CIL Label */; + goto while_65_break; + } + while_65_break: /* CIL Label */; + } #line 2413 - return (-1073741465L); -} + return (-1073741465L); + } } #line 2416 "floppy.c" -void FlFinishOperation(PIRP Irp , PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - int tmp ; - unsigned int __cil_tmp5 ; - unsigned int __cil_tmp6 ; - unsigned int __cil_tmp7 ; - unsigned int __cil_tmp8 ; - unsigned int __cil_tmp9 ; - unsigned int __cil_tmp10 ; - UCHAR __cil_tmp11 ; - int __cil_tmp12 ; - int __cil_tmp13 ; - unsigned int __cil_tmp14 ; - unsigned int __cil_tmp15 ; - UCHAR __cil_tmp16 ; - int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - FAST_MUTEX *__cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - LONG __cil_tmp27 ; - unsigned int __cil_tmp28 ; - unsigned int __cil_tmp29 ; - FAST_MUTEX *__cil_tmp30 ; - unsigned int __cil_tmp31 ; - unsigned int __cil_tmp32 ; - LIST_ENTRY *__cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - LIST_ENTRY *__cil_tmp38 ; - unsigned int __cil_tmp39 ; - unsigned int __cil_tmp40 ; - KSPIN_LOCK *__cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - PDEVICE_OBJECT __cil_tmp47 ; - BOOLEAN *mem_48 ; - UCHAR *mem_49 ; - UCHAR *mem_50 ; - UCHAR *mem_51 ; - MEDIA_TYPE *mem_52 ; - LONG *mem_53 ; - LONG *mem_54 ; - UCHAR *mem_55 ; - PDEVICE_OBJECT *mem_56 ; +void FlFinishOperation(PIRP Irp, PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + int tmp; + unsigned int __cil_tmp5; + unsigned int __cil_tmp6; + unsigned int __cil_tmp7; + unsigned int __cil_tmp8; + unsigned int __cil_tmp9; + unsigned int __cil_tmp10; + UCHAR __cil_tmp11; + int __cil_tmp12; + int __cil_tmp13; + unsigned int __cil_tmp14; + unsigned int __cil_tmp15; + UCHAR __cil_tmp16; + int __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + FAST_MUTEX *__cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + LONG __cil_tmp27; + unsigned int __cil_tmp28; + unsigned int __cil_tmp29; + FAST_MUTEX *__cil_tmp30; + unsigned int __cil_tmp31; + unsigned int __cil_tmp32; + LIST_ENTRY *__cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + LIST_ENTRY *__cil_tmp38; + unsigned int __cil_tmp39; + unsigned int __cil_tmp40; + KSPIN_LOCK *__cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + int __cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + PDEVICE_OBJECT __cil_tmp47; + BOOLEAN *mem_48; + UCHAR *mem_49; + UCHAR *mem_50; + UCHAR *mem_51; + MEDIA_TYPE *mem_52; + LONG *mem_53; + LONG *mem_54; + UCHAR *mem_55; + PDEVICE_OBJECT *mem_56; { - { + { #line 2454 - while (1) { - while_66_continue: /* CIL Label */ ; - goto while_66_break; - } - while_66_break: /* CIL Label */ ; - } + while (1) { + while_66_continue: /* CIL Label */; + goto while_66_break; + } + while_66_break: /* CIL Label */; + } #line 2461 - if (myStatus != 0L) { - { + if (myStatus != 0L) { + { #line 2461 - __cil_tmp5 = (unsigned int )DisketteExtension; + __cil_tmp5 = (unsigned int)DisketteExtension; #line 2461 - __cil_tmp6 = __cil_tmp5 + 104; - { + __cil_tmp6 = __cil_tmp5 + 104; + { #line 2461 - mem_48 = (BOOLEAN *)__cil_tmp6; + mem_48 = (BOOLEAN *)__cil_tmp6; #line 2461 - if (*mem_48) { + if (*mem_48) { #line 2464 - __cil_tmp7 = (unsigned int )DisketteExtension; + __cil_tmp7 = (unsigned int)DisketteExtension; #line 2464 - __cil_tmp8 = __cil_tmp7 + 105; + __cil_tmp8 = __cil_tmp7 + 105; #line 2464 - __cil_tmp9 = (unsigned int )DisketteExtension; + __cil_tmp9 = (unsigned int)DisketteExtension; #line 2464 - __cil_tmp10 = __cil_tmp9 + 105; + __cil_tmp10 = __cil_tmp9 + 105; #line 2464 - mem_49 = (UCHAR *)__cil_tmp10; + mem_49 = (UCHAR *)__cil_tmp10; #line 2464 - __cil_tmp11 = *mem_49; + __cil_tmp11 = *mem_49; #line 2464 - __cil_tmp12 = (int )__cil_tmp11; + __cil_tmp12 = (int)__cil_tmp11; #line 2464 - __cil_tmp13 = __cil_tmp12 + 1; + __cil_tmp13 = __cil_tmp12 + 1; #line 2464 - mem_50 = (UCHAR *)__cil_tmp8; + mem_50 = (UCHAR *)__cil_tmp8; #line 2464 - *mem_50 = (unsigned char )__cil_tmp13; - { + *mem_50 = (unsigned char)__cil_tmp13; + { #line 2465 - __cil_tmp14 = (unsigned int )DisketteExtension; + __cil_tmp14 = (unsigned int)DisketteExtension; #line 2465 - __cil_tmp15 = __cil_tmp14 + 105; + __cil_tmp15 = __cil_tmp14 + 105; #line 2465 - mem_51 = (UCHAR *)__cil_tmp15; + mem_51 = (UCHAR *)__cil_tmp15; #line 2465 - __cil_tmp16 = *mem_51; + __cil_tmp16 = *mem_51; #line 2465 - __cil_tmp17 = (int )__cil_tmp16; + __cil_tmp17 = (int)__cil_tmp16; #line 2465 - if (__cil_tmp17 < 2) { - { + if (__cil_tmp17 < 2) { + { #line 2475 - ntStatus = FlInitializeControllerHardware(DisketteExtension); - } + ntStatus = FlInitializeControllerHardware(DisketteExtension); + } #line 2477 - if (ntStatus >= 0L) { - { + if (ntStatus >= 0L) { + { #line 2482 - while (1) { - while_67_continue: /* CIL Label */ ; - goto while_67_break; - } - while_67_break: /* CIL Label */ ; - } + while (1) { + while_67_continue: /* CIL Label */; + goto while_67_break; + } + while_67_break: /* CIL Label */; + } #line 2490 - __cil_tmp18 = (unsigned int )DisketteExtension; + __cil_tmp18 = (unsigned int)DisketteExtension; #line 2490 - __cil_tmp19 = __cil_tmp18 + 184; + __cil_tmp19 = __cil_tmp18 + 184; #line 2490 - mem_52 = (MEDIA_TYPE *)__cil_tmp19; + mem_52 = (MEDIA_TYPE *)__cil_tmp19; #line 2490 - *mem_52 = (enum _MEDIA_TYPE )-1; - { + *mem_52 = (enum _MEDIA_TYPE) - 1; + { #line 2496 - while (1) { - while_68_continue: /* CIL Label */ ; - goto while_68_break; - } - while_68_break: /* CIL Label */ ; - } - { + while (1) { + while_68_continue: /* CIL Label */; + goto while_68_break; + } + while_68_break: /* CIL Label */; + } + { #line 2498 - __cil_tmp20 = (unsigned int )DisketteExtension; + __cil_tmp20 = (unsigned int)DisketteExtension; #line 2498 - __cil_tmp21 = __cil_tmp20 + 56; + __cil_tmp21 = __cil_tmp20 + 56; #line 2498 - __cil_tmp22 = (FAST_MUTEX *)__cil_tmp21; + __cil_tmp22 = (FAST_MUTEX *)__cil_tmp21; #line 2498 - ExAcquireFastMutex(__cil_tmp22); + ExAcquireFastMutex(__cil_tmp22); #line 2500 - __cil_tmp23 = (unsigned int )DisketteExtension; + __cil_tmp23 = (unsigned int)DisketteExtension; #line 2500 - __cil_tmp24 = __cil_tmp23 + 88; + __cil_tmp24 = __cil_tmp23 + 88; #line 2500 - __cil_tmp25 = (unsigned int )DisketteExtension; + __cil_tmp25 = (unsigned int)DisketteExtension; #line 2500 - __cil_tmp26 = __cil_tmp25 + 88; + __cil_tmp26 = __cil_tmp25 + 88; #line 2500 - mem_53 = (LONG *)__cil_tmp26; + mem_53 = (LONG *)__cil_tmp26; #line 2500 - __cil_tmp27 = *mem_53; + __cil_tmp27 = *mem_53; #line 2500 - mem_54 = (LONG *)__cil_tmp24; + mem_54 = (LONG *)__cil_tmp24; #line 2500 - *mem_54 = __cil_tmp27 + 1L; + *mem_54 = __cil_tmp27 + 1L; #line 2501 - __cil_tmp28 = (unsigned int )DisketteExtension; + __cil_tmp28 = (unsigned int)DisketteExtension; #line 2501 - __cil_tmp29 = __cil_tmp28 + 56; + __cil_tmp29 = __cil_tmp28 + 56; #line 2501 - __cil_tmp30 = (FAST_MUTEX *)__cil_tmp29; + __cil_tmp30 = (FAST_MUTEX *)__cil_tmp29; #line 2501 - ExReleaseFastMutex(__cil_tmp30); + ExReleaseFastMutex(__cil_tmp30); #line 2503 - __cil_tmp31 = (unsigned int )DisketteExtension; + __cil_tmp31 = (unsigned int)DisketteExtension; #line 2503 - __cil_tmp32 = __cil_tmp31 + 96; + __cil_tmp32 = __cil_tmp31 + 96; #line 2503 - __cil_tmp33 = (LIST_ENTRY *)__cil_tmp32; + __cil_tmp33 = (LIST_ENTRY *)__cil_tmp32; #line 2503 - __cil_tmp34 = 0 + 24; + __cil_tmp34 = 0 + 24; #line 2503 - __cil_tmp35 = 64 + __cil_tmp34; + __cil_tmp35 = 64 + __cil_tmp34; #line 2503 - __cil_tmp36 = (unsigned int )Irp; + __cil_tmp36 = (unsigned int)Irp; #line 2503 - __cil_tmp37 = __cil_tmp36 + __cil_tmp35; + __cil_tmp37 = __cil_tmp36 + __cil_tmp35; #line 2503 - __cil_tmp38 = (LIST_ENTRY *)__cil_tmp37; + __cil_tmp38 = (LIST_ENTRY *)__cil_tmp37; #line 2503 - __cil_tmp39 = (unsigned int )DisketteExtension; + __cil_tmp39 = (unsigned int)DisketteExtension; #line 2503 - __cil_tmp40 = __cil_tmp39 + 52; + __cil_tmp40 = __cil_tmp39 + 52; #line 2503 - __cil_tmp41 = (KSPIN_LOCK *)__cil_tmp40; + __cil_tmp41 = (KSPIN_LOCK *)__cil_tmp40; #line 2503 - ExfInterlockedInsertHeadList(__cil_tmp33, __cil_tmp38, __cil_tmp41); - } - } else { - - } - { + ExfInterlockedInsertHeadList(__cil_tmp33, __cil_tmp38, + __cil_tmp41); + } + } else { + } + { #line 2514 - while (1) { - while_69_continue: /* CIL Label */ ; - goto while_69_break; - } - while_69_break: /* CIL Label */ ; + while (1) { + while_69_continue: /* CIL Label */; + goto while_69_break; + } + while_69_break: /* CIL Label */; + } + } else { + } + } + } else { + } } - } else { - - } } } else { - - } } - } - } else { - - } #line 2524 - __cil_tmp42 = (unsigned int )DisketteExtension; + __cil_tmp42 = (unsigned int)DisketteExtension; #line 2524 - __cil_tmp43 = __cil_tmp42 + 105; + __cil_tmp43 = __cil_tmp42 + 105; #line 2524 - mem_55 = (UCHAR *)__cil_tmp43; + mem_55 = (UCHAR *)__cil_tmp43; #line 2524 - *mem_55 = (unsigned char)0; - { -#line 2541 - __cil_tmp44 = myStatus >= 0L; -#line 2541 - if (! __cil_tmp44) { -#line 2541 - if (myStatus == -1073741661L) { -#line 2541 - tmp = 1; - } else { + *mem_55 = (unsigned char)0; + { #line 2541 - if (myStatus == -1073741643L) { + __cil_tmp44 = myStatus >= 0L; #line 2541 - tmp = 1; - } else { + if (!__cil_tmp44) { #line 2541 - if (myStatus == -1073741662L) { + if (myStatus == -1073741661L) { #line 2541 tmp = 1; } else { #line 2541 - if (myStatus == -1073741805L) { + if (myStatus == -1073741643L) { #line 2541 tmp = 1; } else { #line 2541 - if (myStatus == -2147483626L) { + if (myStatus == -1073741662L) { #line 2541 tmp = 1; } else { #line 2541 - if (myStatus == -1073741804L) { + if (myStatus == -1073741805L) { #line 2541 tmp = 1; } else { #line 2541 - if (myStatus == -1073741806L) { + if (myStatus == -2147483626L) { #line 2541 tmp = 1; } else { #line 2541 - tmp = 0; + if (myStatus == -1073741804L) { +#line 2541 + tmp = 1; + } else { +#line 2541 + if (myStatus == -1073741806L) { +#line 2541 + tmp = 1; + } else { +#line 2541 + tmp = 0; + } + } } } } } } - } - } #line 2541 - if ((unsigned char )tmp) { - { + if ((unsigned char)tmp) { + { #line 2535 - __cil_tmp45 = (unsigned int )DisketteExtension; + __cil_tmp45 = (unsigned int)DisketteExtension; #line 2535 - __cil_tmp46 = __cil_tmp45 + 28; + __cil_tmp46 = __cil_tmp45 + 28; #line 2535 - mem_56 = (PDEVICE_OBJECT *)__cil_tmp46; + mem_56 = (PDEVICE_OBJECT *)__cil_tmp46; #line 2535 - __cil_tmp47 = *mem_56; + __cil_tmp47 = *mem_56; #line 2535 - IoSetHardErrorOrVerifyDevice(Irp, __cil_tmp47); + IoSetHardErrorOrVerifyDevice(Irp, __cil_tmp47); + } + } else { + } + } else { } - } else { - } - } else { - - } - } #line 2549 - if (myStatus != 0L) { + if (myStatus != 0L) { #line 2549 - if (myStatus != -2147483626L) { + if (myStatus != -2147483626L) { #line 2549 - if (myStatus != -1073741805L) { - { + if (myStatus != -1073741805L) { + { #line 2551 - while (1) { - while_70_continue: /* CIL Label */ ; - goto while_70_break; - } - while_70_break: /* CIL Label */ ; + while (1) { + while_70_continue: /* CIL Label */; + goto while_70_break; + } + while_70_break: /* CIL Label */; + } + } else { + goto _L___0; } } else { goto _L___0; } } else { - goto _L___0; - } - } else { - _L___0: - { + _L___0 : { #line 2558 - while (1) { - while_71_continue: /* CIL Label */ ; - goto while_71_break; + while (1) { + while_71_continue: /* CIL Label */; + goto while_71_break; + } + while_71_break: /* CIL Label */; } - while_71_break: /* CIL Label */ ; } - } - { + { #line 2564 - while (1) { - while_72_continue: /* CIL Label */ ; - goto while_72_break; - } - while_72_break: /* CIL Label */ ; - } - { + while (1) { + while_72_continue: /* CIL Label */; + goto while_72_break; + } + while_72_break: /* CIL Label */; + } + { #line 2569 - while (1) { - while_73_continue: /* CIL Label */ ; - goto while_73_break; - } - while_73_break: /* CIL Label */ ; - } - { + while (1) { + while_73_continue: /* CIL Label */; + goto while_73_break; + } + while_73_break: /* CIL Label */; + } + { #line 2579 - IofCompleteRequest(Irp, (char)1); - } + IofCompleteRequest(Irp, (char)1); + } #line 2582 - return; -} + return; + } } #line 2582 "floppy.c" -NTSTATUS FlStartDrive(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp , BOOLEAN WriteOperation , - BOOLEAN SetUpMedia , BOOLEAN IgnoreChange ) -{ LARGE_INTEGER delay ; - BOOLEAN motorStarted ; - UCHAR driveStatus ; - NTSTATUS ntStatus ; - FDC_ENABLE_PARMS fdcEnableParms ; - FDC_DISK_CHANGE_PARMS fdcDiskChangeParms ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - UCHAR __cil_tmp14 ; - int __cil_tmp15 ; - PDRIVE_MEDIA_LIMITS __cil_tmp16 ; - DRIVE_MEDIA_TYPE __cil_tmp17 ; - unsigned int __cil_tmp18 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - MEDIA_TYPE __cil_tmp24 ; - int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp28 ; - unsigned int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - MEDIA_TYPE __cil_tmp31 ; - int __cil_tmp32 ; - unsigned int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp35 ; - FDC_ENABLE_PARMS *__cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - unsigned int __cil_tmp39 ; - unsigned int __cil_tmp40 ; - unsigned int __cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - unsigned int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - PDEVICE_OBJECT __cil_tmp49 ; - int __cil_tmp50 ; - int __cil_tmp51 ; - int __cil_tmp52 ; - int __cil_tmp53 ; - unsigned long __cil_tmp54 ; - void *__cil_tmp55 ; - unsigned int __cil_tmp56 ; - unsigned int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - unsigned int __cil_tmp59 ; - unsigned int __cil_tmp60 ; - unsigned int __cil_tmp61 ; - PDEVICE_OBJECT __cil_tmp62 ; - int __cil_tmp63 ; - int __cil_tmp64 ; - int __cil_tmp65 ; - int __cil_tmp66 ; - unsigned long __cil_tmp67 ; - void *__cil_tmp68 ; - FDC_DISK_CHANGE_PARMS *__cil_tmp69 ; - int __cil_tmp70 ; - unsigned int __cil_tmp71 ; - unsigned int __cil_tmp72 ; - UCHAR __cil_tmp73 ; - int __cil_tmp74 ; - unsigned int __cil_tmp75 ; - unsigned int __cil_tmp76 ; - UCHAR __cil_tmp77 ; - int __cil_tmp78 ; - int __cil_tmp79 ; - unsigned int __cil_tmp80 ; - unsigned int __cil_tmp81 ; - unsigned int __cil_tmp82 ; - unsigned int __cil_tmp83 ; - PDEVICE_OBJECT __cil_tmp84 ; - unsigned int __cil_tmp85 ; - unsigned int __cil_tmp86 ; - PVPB __cil_tmp87 ; - unsigned int __cil_tmp88 ; - unsigned int __cil_tmp89 ; - USHORT __cil_tmp90 ; - int __cil_tmp91 ; - unsigned int __cil_tmp92 ; - unsigned int __cil_tmp93 ; - PDEVICE_OBJECT __cil_tmp94 ; - unsigned int __cil_tmp95 ; - unsigned int __cil_tmp96 ; - PDEVICE_OBJECT __cil_tmp97 ; - unsigned int __cil_tmp98 ; - unsigned int __cil_tmp99 ; - unsigned int __cil_tmp100 ; - unsigned int __cil_tmp101 ; - PDEVICE_OBJECT __cil_tmp102 ; - unsigned int __cil_tmp103 ; - unsigned int __cil_tmp104 ; - ULONG __cil_tmp105 ; - unsigned int __cil_tmp106 ; - unsigned int __cil_tmp107 ; - UCHAR __cil_tmp108 ; - int __cil_tmp109 ; - KUSER_SHARED_DATA *__cil_tmp110 ; - unsigned int __cil_tmp111 ; - unsigned int __cil_tmp112 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp113 ; - int __cil_tmp114 ; - unsigned int __cil_tmp115 ; - unsigned int __cil_tmp116 ; - unsigned int __cil_tmp117 ; - unsigned int __cil_tmp118 ; - unsigned int __cil_tmp119 ; - unsigned int __cil_tmp120 ; - unsigned int __cil_tmp121 ; - unsigned int __cil_tmp122 ; - unsigned int __cil_tmp123 ; - unsigned int __cil_tmp124 ; - unsigned int __cil_tmp125 ; - unsigned int __cil_tmp126 ; - unsigned int __cil_tmp127 ; - unsigned int __cil_tmp128 ; - UCHAR *__cil_tmp129 ; - unsigned int __cil_tmp130 ; - unsigned int __cil_tmp131 ; - unsigned int __cil_tmp132 ; - unsigned int __cil_tmp133 ; - UCHAR *__cil_tmp134 ; - void *__cil_tmp135 ; - struct _MDL *__cil_tmp136 ; - int __cil_tmp137 ; - unsigned int __cil_tmp138 ; - unsigned int __cil_tmp139 ; - unsigned int __cil_tmp140 ; - unsigned int __cil_tmp141 ; - UCHAR __cil_tmp142 ; - int __cil_tmp143 ; - int __cil_tmp144 ; - unsigned int __cil_tmp145 ; - unsigned int __cil_tmp146 ; - PDEVICE_OBJECT __cil_tmp147 ; - unsigned int __cil_tmp148 ; - unsigned int __cil_tmp149 ; - PVPB __cil_tmp150 ; - unsigned int __cil_tmp151 ; - unsigned int __cil_tmp152 ; - USHORT __cil_tmp153 ; - int __cil_tmp154 ; - unsigned int __cil_tmp155 ; - unsigned int __cil_tmp156 ; - PDEVICE_OBJECT __cil_tmp157 ; - unsigned int __cil_tmp158 ; - unsigned int __cil_tmp159 ; - unsigned int __cil_tmp160 ; - unsigned int __cil_tmp161 ; - PDEVICE_OBJECT __cil_tmp162 ; - unsigned int __cil_tmp163 ; - unsigned int __cil_tmp164 ; - ULONG __cil_tmp165 ; - unsigned int __cil_tmp166 ; - unsigned int __cil_tmp167 ; - unsigned int __cil_tmp168 ; - unsigned int __cil_tmp169 ; - unsigned int __cil_tmp170 ; - unsigned int __cil_tmp171 ; - unsigned int __cil_tmp172 ; - unsigned int __cil_tmp173 ; - unsigned int __cil_tmp174 ; - unsigned int __cil_tmp175 ; - unsigned int __cil_tmp176 ; - unsigned int __cil_tmp177 ; - unsigned int __cil_tmp178 ; - unsigned int __cil_tmp179 ; - unsigned int __cil_tmp180 ; - unsigned int __cil_tmp181 ; - unsigned int __cil_tmp182 ; - unsigned int __cil_tmp183 ; - UCHAR *__cil_tmp184 ; - unsigned int __cil_tmp185 ; - unsigned int __cil_tmp186 ; - unsigned int __cil_tmp187 ; - unsigned int __cil_tmp188 ; - UCHAR *__cil_tmp189 ; - void *__cil_tmp190 ; - struct _MDL *__cil_tmp191 ; - int __cil_tmp192 ; - unsigned int __cil_tmp193 ; - unsigned int __cil_tmp194 ; - unsigned int __cil_tmp195 ; - unsigned int __cil_tmp196 ; - UCHAR __cil_tmp197 ; - int __cil_tmp198 ; - int __cil_tmp199 ; - unsigned int __cil_tmp200 ; - unsigned int __cil_tmp201 ; - unsigned int __cil_tmp202 ; - unsigned int __cil_tmp203 ; - UCHAR __cil_tmp204 ; - int __cil_tmp205 ; - unsigned int __cil_tmp206 ; - unsigned int __cil_tmp207 ; - unsigned int __cil_tmp208 ; - unsigned int __cil_tmp209 ; - unsigned int __cil_tmp210 ; - unsigned int __cil_tmp211 ; - unsigned int __cil_tmp212 ; - unsigned int __cil_tmp213 ; - unsigned int __cil_tmp214 ; - unsigned int __cil_tmp215 ; - unsigned int __cil_tmp216 ; - unsigned int __cil_tmp217 ; - unsigned int __cil_tmp218 ; - unsigned int __cil_tmp219 ; - unsigned int __cil_tmp220 ; - unsigned int __cil_tmp221 ; - LARGE_INTEGER *__cil_tmp222 ; - unsigned int __cil_tmp223 ; - unsigned int __cil_tmp224 ; - unsigned int __cil_tmp225 ; - unsigned int __cil_tmp226 ; - unsigned int __cil_tmp227 ; - unsigned int __cil_tmp228 ; - UCHAR *__cil_tmp229 ; - unsigned int __cil_tmp230 ; - unsigned int __cil_tmp231 ; - unsigned int __cil_tmp232 ; - unsigned int __cil_tmp233 ; - UCHAR *__cil_tmp234 ; - void *__cil_tmp235 ; - struct _MDL *__cil_tmp236 ; - LARGE_INTEGER *__cil_tmp237 ; - unsigned int __cil_tmp238 ; - unsigned int __cil_tmp239 ; - int __cil_tmp240 ; - unsigned int __cil_tmp241 ; - unsigned int __cil_tmp242 ; - unsigned int __cil_tmp243 ; - unsigned int __cil_tmp244 ; - UCHAR __cil_tmp245 ; - int __cil_tmp246 ; - int __cil_tmp247 ; - unsigned int __cil_tmp248 ; - unsigned int __cil_tmp249 ; - unsigned int __cil_tmp250 ; - unsigned int __cil_tmp251 ; - UCHAR __cil_tmp252 ; - int __cil_tmp253 ; - unsigned int __cil_tmp254 ; - unsigned int __cil_tmp255 ; - KUSER_SHARED_DATA *__cil_tmp256 ; - unsigned int __cil_tmp257 ; - unsigned int __cil_tmp258 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp259 ; - int __cil_tmp260 ; - unsigned int __cil_tmp261 ; - unsigned int __cil_tmp262 ; - unsigned int __cil_tmp263 ; - unsigned int __cil_tmp264 ; - unsigned int __cil_tmp265 ; - unsigned int __cil_tmp266 ; - unsigned int __cil_tmp267 ; - unsigned int __cil_tmp268 ; - unsigned int __cil_tmp269 ; - unsigned int __cil_tmp270 ; - unsigned int __cil_tmp271 ; - unsigned int __cil_tmp272 ; - unsigned int __cil_tmp273 ; - unsigned int __cil_tmp274 ; - UCHAR *__cil_tmp275 ; - unsigned int __cil_tmp276 ; - unsigned int __cil_tmp277 ; - unsigned int __cil_tmp278 ; - unsigned int __cil_tmp279 ; - UCHAR *__cil_tmp280 ; - void *__cil_tmp281 ; - struct _MDL *__cil_tmp282 ; - int __cil_tmp283 ; - unsigned int __cil_tmp284 ; - unsigned int __cil_tmp285 ; - unsigned int __cil_tmp286 ; - unsigned int __cil_tmp287 ; - UCHAR __cil_tmp288 ; - int __cil_tmp289 ; - unsigned int __cil_tmp290 ; - unsigned int __cil_tmp291 ; - PDEVICE_OBJECT __cil_tmp292 ; - int __cil_tmp293 ; - int __cil_tmp294 ; - int __cil_tmp295 ; - int __cil_tmp296 ; - unsigned long __cil_tmp297 ; - void *__cil_tmp298 ; - FDC_DISK_CHANGE_PARMS *__cil_tmp299 ; - int __cil_tmp300 ; - int __cil_tmp301 ; - unsigned int __cil_tmp302 ; - unsigned int __cil_tmp303 ; - PDEVICE_OBJECT __cil_tmp304 ; - unsigned int __cil_tmp305 ; - unsigned int __cil_tmp306 ; - PVPB __cil_tmp307 ; - unsigned int __cil_tmp308 ; - unsigned int __cil_tmp309 ; - USHORT __cil_tmp310 ; - int __cil_tmp311 ; - unsigned int __cil_tmp312 ; - unsigned int __cil_tmp313 ; - PDEVICE_OBJECT __cil_tmp314 ; - unsigned int __cil_tmp315 ; - unsigned int __cil_tmp316 ; - unsigned int __cil_tmp317 ; - unsigned int __cil_tmp318 ; - PDEVICE_OBJECT __cil_tmp319 ; - unsigned int __cil_tmp320 ; - unsigned int __cil_tmp321 ; - ULONG __cil_tmp322 ; - int __cil_tmp323 ; - unsigned int __cil_tmp324 ; - unsigned int __cil_tmp325 ; - PDEVICE_OBJECT __cil_tmp326 ; - unsigned int __cil_tmp327 ; - unsigned int __cil_tmp328 ; - PVPB __cil_tmp329 ; - unsigned int __cil_tmp330 ; - unsigned int __cil_tmp331 ; - USHORT __cil_tmp332 ; - int __cil_tmp333 ; - KUSER_SHARED_DATA *__cil_tmp334 ; - unsigned int __cil_tmp335 ; - unsigned int __cil_tmp336 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp337 ; - int __cil_tmp338 ; - unsigned int __cil_tmp339 ; - unsigned int __cil_tmp340 ; - MEDIA_TYPE __cil_tmp341 ; - int __cil_tmp342 ; - unsigned int __cil_tmp343 ; - unsigned int __cil_tmp344 ; - MEDIA_TYPE __cil_tmp345 ; - int __cil_tmp346 ; - unsigned int __cil_tmp347 ; - unsigned int __cil_tmp348 ; - DRIVE_MEDIA_TYPE __cil_tmp349 ; - int __cil_tmp350 ; - unsigned int __cil_tmp351 ; - unsigned int __cil_tmp352 ; - DRIVE_MEDIA_TYPE __cil_tmp353 ; - int __cil_tmp354 ; - int __cil_tmp355 ; - unsigned int __cil_tmp356 ; - unsigned int __cil_tmp357 ; - unsigned int __cil_tmp358 ; - unsigned int __cil_tmp359 ; - unsigned int __cil_tmp360 ; - unsigned int __cil_tmp361 ; - unsigned int __cil_tmp362 ; - unsigned int __cil_tmp363 ; - unsigned int __cil_tmp364 ; - unsigned int __cil_tmp365 ; - unsigned int __cil_tmp366 ; - unsigned int __cil_tmp367 ; - unsigned int __cil_tmp368 ; - unsigned int __cil_tmp369 ; - UCHAR *__cil_tmp370 ; - unsigned int __cil_tmp371 ; - unsigned int __cil_tmp372 ; - unsigned int __cil_tmp373 ; - unsigned int __cil_tmp374 ; - UCHAR *__cil_tmp375 ; - void *__cil_tmp376 ; - struct _MDL *__cil_tmp377 ; - int __cil_tmp378 ; - KUSER_SHARED_DATA *__cil_tmp379 ; - unsigned int __cil_tmp380 ; - unsigned int __cil_tmp381 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp382 ; - int __cil_tmp383 ; - unsigned int __cil_tmp384 ; - unsigned int __cil_tmp385 ; - unsigned int __cil_tmp386 ; - unsigned int __cil_tmp387 ; - UCHAR __cil_tmp388 ; - int __cil_tmp389 ; - int __cil_tmp390 ; - unsigned int __cil_tmp391 ; - unsigned int __cil_tmp392 ; - unsigned int __cil_tmp393 ; - unsigned int __cil_tmp394 ; - UCHAR __cil_tmp395 ; - int __cil_tmp396 ; - UCHAR *mem_397 ; - DRIVE_MEDIA_TYPE *mem_398 ; - DRIVE_MEDIA_CONSTANTS *mem_399 ; - MEDIA_TYPE *mem_400 ; - DRIVE_MEDIA_CONSTANTS *mem_401 ; - MEDIA_TYPE *mem_402 ; - DRIVE_MEDIA_CONSTANTS *mem_403 ; - UCHAR *mem_404 ; - UCHAR *mem_405 ; - USHORT *mem_406 ; - USHORT *mem_407 ; - USHORT *mem_408 ; - USHORT *mem_409 ; - PDEVICE_OBJECT *mem_410 ; - BOOLEAN *mem_411 ; - UCHAR *mem_412 ; - UCHAR *mem_413 ; - PDEVICE_OBJECT *mem_414 ; - UCHAR *mem_415 ; - UCHAR *mem_416 ; - UCHAR *mem_417 ; - MEDIA_TYPE *mem_418 ; - PDEVICE_OBJECT *mem_419 ; - PVPB *mem_420 ; - USHORT *mem_421 ; - PDEVICE_OBJECT *mem_422 ; - PDEVICE_OBJECT *mem_423 ; - PDEVICE_OBJECT *mem_424 ; - ULONG *mem_425 ; - ULONG *mem_426 ; - UCHAR *mem_427 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_428 ; - UCHAR *mem_429 ; - UCHAR *mem_430 ; - UCHAR *mem_431 ; - UCHAR *mem_432 ; - PDEVICE_OBJECT *mem_433 ; - PVPB *mem_434 ; - USHORT *mem_435 ; - PDEVICE_OBJECT *mem_436 ; - PDEVICE_OBJECT *mem_437 ; - ULONG *mem_438 ; - ULONG *mem_439 ; - UCHAR *mem_440 ; - UCHAR *mem_441 ; - UCHAR *mem_442 ; - UCHAR *mem_443 ; - UCHAR *mem_444 ; - UCHAR *mem_445 ; - BOOLEAN *mem_446 ; - UCHAR *mem_447 ; - UCHAR *mem_448 ; - UCHAR *mem_449 ; - UCHAR *mem_450 ; - ULONG *mem_451 ; - LONG *mem_452 ; - ULONG *mem_453 ; - LONG *mem_454 ; - UCHAR *mem_455 ; - UCHAR *mem_456 ; - BOOLEAN *mem_457 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_458 ; - UCHAR *mem_459 ; - UCHAR *mem_460 ; - UCHAR *mem_461 ; - UCHAR *mem_462 ; - PDEVICE_OBJECT *mem_463 ; - UCHAR *mem_464 ; - PDEVICE_OBJECT *mem_465 ; - PVPB *mem_466 ; - USHORT *mem_467 ; - PDEVICE_OBJECT *mem_468 ; - PDEVICE_OBJECT *mem_469 ; - ULONG *mem_470 ; - ULONG *mem_471 ; - PDEVICE_OBJECT *mem_472 ; - PVPB *mem_473 ; - USHORT *mem_474 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_475 ; - MEDIA_TYPE *mem_476 ; - MEDIA_TYPE *mem_477 ; - DRIVE_MEDIA_TYPE *mem_478 ; - DRIVE_MEDIA_TYPE *mem_479 ; - UCHAR *mem_480 ; - UCHAR *mem_481 ; - UCHAR *mem_482 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_483 ; - UCHAR *mem_484 ; - UCHAR *mem_485 ; +NTSTATUS FlStartDrive(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp, + BOOLEAN WriteOperation, BOOLEAN SetUpMedia, + BOOLEAN IgnoreChange) { + LARGE_INTEGER delay; + BOOLEAN motorStarted; + UCHAR driveStatus; + NTSTATUS ntStatus; + FDC_ENABLE_PARMS fdcEnableParms; + FDC_DISK_CHANGE_PARMS fdcDiskChangeParms; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + UCHAR __cil_tmp14; + int __cil_tmp15; + PDRIVE_MEDIA_LIMITS __cil_tmp16; + DRIVE_MEDIA_TYPE __cil_tmp17; + unsigned int __cil_tmp18; + PDRIVE_MEDIA_CONSTANTS __cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + MEDIA_TYPE __cil_tmp24; + int __cil_tmp25; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + PDRIVE_MEDIA_CONSTANTS __cil_tmp28; + unsigned int __cil_tmp29; + unsigned int __cil_tmp30; + MEDIA_TYPE __cil_tmp31; + int __cil_tmp32; + unsigned int __cil_tmp33; + unsigned int __cil_tmp34; + PDRIVE_MEDIA_CONSTANTS __cil_tmp35; + FDC_ENABLE_PARMS *__cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + unsigned int __cil_tmp39; + unsigned int __cil_tmp40; + unsigned int __cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + unsigned int __cil_tmp47; + unsigned int __cil_tmp48; + PDEVICE_OBJECT __cil_tmp49; + int __cil_tmp50; + int __cil_tmp51; + int __cil_tmp52; + int __cil_tmp53; + unsigned long __cil_tmp54; + void *__cil_tmp55; + unsigned int __cil_tmp56; + unsigned int __cil_tmp57; + unsigned int __cil_tmp58; + unsigned int __cil_tmp59; + unsigned int __cil_tmp60; + unsigned int __cil_tmp61; + PDEVICE_OBJECT __cil_tmp62; + int __cil_tmp63; + int __cil_tmp64; + int __cil_tmp65; + int __cil_tmp66; + unsigned long __cil_tmp67; + void *__cil_tmp68; + FDC_DISK_CHANGE_PARMS *__cil_tmp69; + int __cil_tmp70; + unsigned int __cil_tmp71; + unsigned int __cil_tmp72; + UCHAR __cil_tmp73; + int __cil_tmp74; + unsigned int __cil_tmp75; + unsigned int __cil_tmp76; + UCHAR __cil_tmp77; + int __cil_tmp78; + int __cil_tmp79; + unsigned int __cil_tmp80; + unsigned int __cil_tmp81; + unsigned int __cil_tmp82; + unsigned int __cil_tmp83; + PDEVICE_OBJECT __cil_tmp84; + unsigned int __cil_tmp85; + unsigned int __cil_tmp86; + PVPB __cil_tmp87; + unsigned int __cil_tmp88; + unsigned int __cil_tmp89; + USHORT __cil_tmp90; + int __cil_tmp91; + unsigned int __cil_tmp92; + unsigned int __cil_tmp93; + PDEVICE_OBJECT __cil_tmp94; + unsigned int __cil_tmp95; + unsigned int __cil_tmp96; + PDEVICE_OBJECT __cil_tmp97; + unsigned int __cil_tmp98; + unsigned int __cil_tmp99; + unsigned int __cil_tmp100; + unsigned int __cil_tmp101; + PDEVICE_OBJECT __cil_tmp102; + unsigned int __cil_tmp103; + unsigned int __cil_tmp104; + ULONG __cil_tmp105; + unsigned int __cil_tmp106; + unsigned int __cil_tmp107; + UCHAR __cil_tmp108; + int __cil_tmp109; + KUSER_SHARED_DATA *__cil_tmp110; + unsigned int __cil_tmp111; + unsigned int __cil_tmp112; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp113; + int __cil_tmp114; + unsigned int __cil_tmp115; + unsigned int __cil_tmp116; + unsigned int __cil_tmp117; + unsigned int __cil_tmp118; + unsigned int __cil_tmp119; + unsigned int __cil_tmp120; + unsigned int __cil_tmp121; + unsigned int __cil_tmp122; + unsigned int __cil_tmp123; + unsigned int __cil_tmp124; + unsigned int __cil_tmp125; + unsigned int __cil_tmp126; + unsigned int __cil_tmp127; + unsigned int __cil_tmp128; + UCHAR *__cil_tmp129; + unsigned int __cil_tmp130; + unsigned int __cil_tmp131; + unsigned int __cil_tmp132; + unsigned int __cil_tmp133; + UCHAR *__cil_tmp134; + void *__cil_tmp135; + struct _MDL *__cil_tmp136; + int __cil_tmp137; + unsigned int __cil_tmp138; + unsigned int __cil_tmp139; + unsigned int __cil_tmp140; + unsigned int __cil_tmp141; + UCHAR __cil_tmp142; + int __cil_tmp143; + int __cil_tmp144; + unsigned int __cil_tmp145; + unsigned int __cil_tmp146; + PDEVICE_OBJECT __cil_tmp147; + unsigned int __cil_tmp148; + unsigned int __cil_tmp149; + PVPB __cil_tmp150; + unsigned int __cil_tmp151; + unsigned int __cil_tmp152; + USHORT __cil_tmp153; + int __cil_tmp154; + unsigned int __cil_tmp155; + unsigned int __cil_tmp156; + PDEVICE_OBJECT __cil_tmp157; + unsigned int __cil_tmp158; + unsigned int __cil_tmp159; + unsigned int __cil_tmp160; + unsigned int __cil_tmp161; + PDEVICE_OBJECT __cil_tmp162; + unsigned int __cil_tmp163; + unsigned int __cil_tmp164; + ULONG __cil_tmp165; + unsigned int __cil_tmp166; + unsigned int __cil_tmp167; + unsigned int __cil_tmp168; + unsigned int __cil_tmp169; + unsigned int __cil_tmp170; + unsigned int __cil_tmp171; + unsigned int __cil_tmp172; + unsigned int __cil_tmp173; + unsigned int __cil_tmp174; + unsigned int __cil_tmp175; + unsigned int __cil_tmp176; + unsigned int __cil_tmp177; + unsigned int __cil_tmp178; + unsigned int __cil_tmp179; + unsigned int __cil_tmp180; + unsigned int __cil_tmp181; + unsigned int __cil_tmp182; + unsigned int __cil_tmp183; + UCHAR *__cil_tmp184; + unsigned int __cil_tmp185; + unsigned int __cil_tmp186; + unsigned int __cil_tmp187; + unsigned int __cil_tmp188; + UCHAR *__cil_tmp189; + void *__cil_tmp190; + struct _MDL *__cil_tmp191; + int __cil_tmp192; + unsigned int __cil_tmp193; + unsigned int __cil_tmp194; + unsigned int __cil_tmp195; + unsigned int __cil_tmp196; + UCHAR __cil_tmp197; + int __cil_tmp198; + int __cil_tmp199; + unsigned int __cil_tmp200; + unsigned int __cil_tmp201; + unsigned int __cil_tmp202; + unsigned int __cil_tmp203; + UCHAR __cil_tmp204; + int __cil_tmp205; + unsigned int __cil_tmp206; + unsigned int __cil_tmp207; + unsigned int __cil_tmp208; + unsigned int __cil_tmp209; + unsigned int __cil_tmp210; + unsigned int __cil_tmp211; + unsigned int __cil_tmp212; + unsigned int __cil_tmp213; + unsigned int __cil_tmp214; + unsigned int __cil_tmp215; + unsigned int __cil_tmp216; + unsigned int __cil_tmp217; + unsigned int __cil_tmp218; + unsigned int __cil_tmp219; + unsigned int __cil_tmp220; + unsigned int __cil_tmp221; + LARGE_INTEGER *__cil_tmp222; + unsigned int __cil_tmp223; + unsigned int __cil_tmp224; + unsigned int __cil_tmp225; + unsigned int __cil_tmp226; + unsigned int __cil_tmp227; + unsigned int __cil_tmp228; + UCHAR *__cil_tmp229; + unsigned int __cil_tmp230; + unsigned int __cil_tmp231; + unsigned int __cil_tmp232; + unsigned int __cil_tmp233; + UCHAR *__cil_tmp234; + void *__cil_tmp235; + struct _MDL *__cil_tmp236; + LARGE_INTEGER *__cil_tmp237; + unsigned int __cil_tmp238; + unsigned int __cil_tmp239; + int __cil_tmp240; + unsigned int __cil_tmp241; + unsigned int __cil_tmp242; + unsigned int __cil_tmp243; + unsigned int __cil_tmp244; + UCHAR __cil_tmp245; + int __cil_tmp246; + int __cil_tmp247; + unsigned int __cil_tmp248; + unsigned int __cil_tmp249; + unsigned int __cil_tmp250; + unsigned int __cil_tmp251; + UCHAR __cil_tmp252; + int __cil_tmp253; + unsigned int __cil_tmp254; + unsigned int __cil_tmp255; + KUSER_SHARED_DATA *__cil_tmp256; + unsigned int __cil_tmp257; + unsigned int __cil_tmp258; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp259; + int __cil_tmp260; + unsigned int __cil_tmp261; + unsigned int __cil_tmp262; + unsigned int __cil_tmp263; + unsigned int __cil_tmp264; + unsigned int __cil_tmp265; + unsigned int __cil_tmp266; + unsigned int __cil_tmp267; + unsigned int __cil_tmp268; + unsigned int __cil_tmp269; + unsigned int __cil_tmp270; + unsigned int __cil_tmp271; + unsigned int __cil_tmp272; + unsigned int __cil_tmp273; + unsigned int __cil_tmp274; + UCHAR *__cil_tmp275; + unsigned int __cil_tmp276; + unsigned int __cil_tmp277; + unsigned int __cil_tmp278; + unsigned int __cil_tmp279; + UCHAR *__cil_tmp280; + void *__cil_tmp281; + struct _MDL *__cil_tmp282; + int __cil_tmp283; + unsigned int __cil_tmp284; + unsigned int __cil_tmp285; + unsigned int __cil_tmp286; + unsigned int __cil_tmp287; + UCHAR __cil_tmp288; + int __cil_tmp289; + unsigned int __cil_tmp290; + unsigned int __cil_tmp291; + PDEVICE_OBJECT __cil_tmp292; + int __cil_tmp293; + int __cil_tmp294; + int __cil_tmp295; + int __cil_tmp296; + unsigned long __cil_tmp297; + void *__cil_tmp298; + FDC_DISK_CHANGE_PARMS *__cil_tmp299; + int __cil_tmp300; + int __cil_tmp301; + unsigned int __cil_tmp302; + unsigned int __cil_tmp303; + PDEVICE_OBJECT __cil_tmp304; + unsigned int __cil_tmp305; + unsigned int __cil_tmp306; + PVPB __cil_tmp307; + unsigned int __cil_tmp308; + unsigned int __cil_tmp309; + USHORT __cil_tmp310; + int __cil_tmp311; + unsigned int __cil_tmp312; + unsigned int __cil_tmp313; + PDEVICE_OBJECT __cil_tmp314; + unsigned int __cil_tmp315; + unsigned int __cil_tmp316; + unsigned int __cil_tmp317; + unsigned int __cil_tmp318; + PDEVICE_OBJECT __cil_tmp319; + unsigned int __cil_tmp320; + unsigned int __cil_tmp321; + ULONG __cil_tmp322; + int __cil_tmp323; + unsigned int __cil_tmp324; + unsigned int __cil_tmp325; + PDEVICE_OBJECT __cil_tmp326; + unsigned int __cil_tmp327; + unsigned int __cil_tmp328; + PVPB __cil_tmp329; + unsigned int __cil_tmp330; + unsigned int __cil_tmp331; + USHORT __cil_tmp332; + int __cil_tmp333; + KUSER_SHARED_DATA *__cil_tmp334; + unsigned int __cil_tmp335; + unsigned int __cil_tmp336; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp337; + int __cil_tmp338; + unsigned int __cil_tmp339; + unsigned int __cil_tmp340; + MEDIA_TYPE __cil_tmp341; + int __cil_tmp342; + unsigned int __cil_tmp343; + unsigned int __cil_tmp344; + MEDIA_TYPE __cil_tmp345; + int __cil_tmp346; + unsigned int __cil_tmp347; + unsigned int __cil_tmp348; + DRIVE_MEDIA_TYPE __cil_tmp349; + int __cil_tmp350; + unsigned int __cil_tmp351; + unsigned int __cil_tmp352; + DRIVE_MEDIA_TYPE __cil_tmp353; + int __cil_tmp354; + int __cil_tmp355; + unsigned int __cil_tmp356; + unsigned int __cil_tmp357; + unsigned int __cil_tmp358; + unsigned int __cil_tmp359; + unsigned int __cil_tmp360; + unsigned int __cil_tmp361; + unsigned int __cil_tmp362; + unsigned int __cil_tmp363; + unsigned int __cil_tmp364; + unsigned int __cil_tmp365; + unsigned int __cil_tmp366; + unsigned int __cil_tmp367; + unsigned int __cil_tmp368; + unsigned int __cil_tmp369; + UCHAR *__cil_tmp370; + unsigned int __cil_tmp371; + unsigned int __cil_tmp372; + unsigned int __cil_tmp373; + unsigned int __cil_tmp374; + UCHAR *__cil_tmp375; + void *__cil_tmp376; + struct _MDL *__cil_tmp377; + int __cil_tmp378; + KUSER_SHARED_DATA *__cil_tmp379; + unsigned int __cil_tmp380; + unsigned int __cil_tmp381; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp382; + int __cil_tmp383; + unsigned int __cil_tmp384; + unsigned int __cil_tmp385; + unsigned int __cil_tmp386; + unsigned int __cil_tmp387; + UCHAR __cil_tmp388; + int __cil_tmp389; + int __cil_tmp390; + unsigned int __cil_tmp391; + unsigned int __cil_tmp392; + unsigned int __cil_tmp393; + unsigned int __cil_tmp394; + UCHAR __cil_tmp395; + int __cil_tmp396; + UCHAR *mem_397; + DRIVE_MEDIA_TYPE *mem_398; + DRIVE_MEDIA_CONSTANTS *mem_399; + MEDIA_TYPE *mem_400; + DRIVE_MEDIA_CONSTANTS *mem_401; + MEDIA_TYPE *mem_402; + DRIVE_MEDIA_CONSTANTS *mem_403; + UCHAR *mem_404; + UCHAR *mem_405; + USHORT *mem_406; + USHORT *mem_407; + USHORT *mem_408; + USHORT *mem_409; + PDEVICE_OBJECT *mem_410; + BOOLEAN *mem_411; + UCHAR *mem_412; + UCHAR *mem_413; + PDEVICE_OBJECT *mem_414; + UCHAR *mem_415; + UCHAR *mem_416; + UCHAR *mem_417; + MEDIA_TYPE *mem_418; + PDEVICE_OBJECT *mem_419; + PVPB *mem_420; + USHORT *mem_421; + PDEVICE_OBJECT *mem_422; + PDEVICE_OBJECT *mem_423; + PDEVICE_OBJECT *mem_424; + ULONG *mem_425; + ULONG *mem_426; + UCHAR *mem_427; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_428; + UCHAR *mem_429; + UCHAR *mem_430; + UCHAR *mem_431; + UCHAR *mem_432; + PDEVICE_OBJECT *mem_433; + PVPB *mem_434; + USHORT *mem_435; + PDEVICE_OBJECT *mem_436; + PDEVICE_OBJECT *mem_437; + ULONG *mem_438; + ULONG *mem_439; + UCHAR *mem_440; + UCHAR *mem_441; + UCHAR *mem_442; + UCHAR *mem_443; + UCHAR *mem_444; + UCHAR *mem_445; + BOOLEAN *mem_446; + UCHAR *mem_447; + UCHAR *mem_448; + UCHAR *mem_449; + UCHAR *mem_450; + ULONG *mem_451; + LONG *mem_452; + ULONG *mem_453; + LONG *mem_454; + UCHAR *mem_455; + UCHAR *mem_456; + BOOLEAN *mem_457; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_458; + UCHAR *mem_459; + UCHAR *mem_460; + UCHAR *mem_461; + UCHAR *mem_462; + PDEVICE_OBJECT *mem_463; + UCHAR *mem_464; + PDEVICE_OBJECT *mem_465; + PVPB *mem_466; + USHORT *mem_467; + PDEVICE_OBJECT *mem_468; + PDEVICE_OBJECT *mem_469; + ULONG *mem_470; + ULONG *mem_471; + PDEVICE_OBJECT *mem_472; + PVPB *mem_473; + USHORT *mem_474; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_475; + MEDIA_TYPE *mem_476; + MEDIA_TYPE *mem_477; + DRIVE_MEDIA_TYPE *mem_478; + DRIVE_MEDIA_TYPE *mem_479; + UCHAR *mem_480; + UCHAR *mem_481; + UCHAR *mem_482; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_483; + UCHAR *mem_484; + UCHAR *mem_485; { #line 2630 - ntStatus = 0L; - { + ntStatus = 0L; + { #line 2637 - while (1) { - while_74_continue: /* CIL Label */ ; - goto while_74_break; - } - while_74_break: /* CIL Label */ ; - } + while (1) { + while_74_continue: /* CIL Label */; + goto while_74_break; + } + while_74_break: /* CIL Label */; + } #line 2654 - __cil_tmp12 = (unsigned int )DisketteExtension; + __cil_tmp12 = (unsigned int)DisketteExtension; #line 2654 - __cil_tmp13 = __cil_tmp12 + 174; + __cil_tmp13 = __cil_tmp12 + 174; #line 2654 - mem_397 = (UCHAR *)__cil_tmp13; + mem_397 = (UCHAR *)__cil_tmp13; #line 2654 - __cil_tmp14 = *mem_397; + __cil_tmp14 = *mem_397; #line 2654 - __cil_tmp15 = (int )__cil_tmp14; + __cil_tmp15 = (int)__cil_tmp14; #line 2654 - __cil_tmp16 = DriveMediaLimits + __cil_tmp15; + __cil_tmp16 = DriveMediaLimits + __cil_tmp15; #line 2654 - mem_398 = (DRIVE_MEDIA_TYPE *)__cil_tmp16; + mem_398 = (DRIVE_MEDIA_TYPE *)__cil_tmp16; #line 2654 - __cil_tmp17 = *mem_398; + __cil_tmp17 = *mem_398; #line 2654 - __cil_tmp18 = (unsigned int )__cil_tmp17; + __cil_tmp18 = (unsigned int)__cil_tmp17; #line 2654 - __cil_tmp19 = DriveMediaConstants + __cil_tmp18; + __cil_tmp19 = DriveMediaConstants + __cil_tmp18; #line 2654 - __cil_tmp20 = (unsigned int )DisketteExtension; + __cil_tmp20 = (unsigned int)DisketteExtension; #line 2654 - __cil_tmp21 = __cil_tmp20 + 252; + __cil_tmp21 = __cil_tmp20 + 252; #line 2654 - mem_399 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp21; + mem_399 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp21; #line 2654 - *__cil_tmp19 = *mem_399; - { + *__cil_tmp19 = *mem_399; + { #line 2657 - __cil_tmp22 = (unsigned int )DisketteExtension; + __cil_tmp22 = (unsigned int)DisketteExtension; #line 2657 - __cil_tmp23 = __cil_tmp22 + 184; + __cil_tmp23 = __cil_tmp22 + 184; #line 2657 - mem_400 = (MEDIA_TYPE *)__cil_tmp23; + mem_400 = (MEDIA_TYPE *)__cil_tmp23; #line 2657 - __cil_tmp24 = *mem_400; + __cil_tmp24 = *mem_400; #line 2657 - __cil_tmp25 = (int )__cil_tmp24; + __cil_tmp25 = (int)__cil_tmp24; #line 2657 - if (__cil_tmp25 == -1) { + if (__cil_tmp25 == -1) { #line 2659 - __cil_tmp26 = (unsigned int )DisketteExtension; + __cil_tmp26 = (unsigned int)DisketteExtension; #line 2659 - __cil_tmp27 = __cil_tmp26 + 308; + __cil_tmp27 = __cil_tmp26 + 308; #line 2659 - __cil_tmp28 = DriveMediaConstants + 0; + __cil_tmp28 = DriveMediaConstants + 0; #line 2659 - mem_401 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp27; + mem_401 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp27; #line 2659 - *mem_401 = *__cil_tmp28; - } else { - { + *mem_401 = *__cil_tmp28; + } else { + { #line 2657 - __cil_tmp29 = (unsigned int )DisketteExtension; + __cil_tmp29 = (unsigned int)DisketteExtension; #line 2657 - __cil_tmp30 = __cil_tmp29 + 184; + __cil_tmp30 = __cil_tmp29 + 184; #line 2657 - mem_402 = (MEDIA_TYPE *)__cil_tmp30; + mem_402 = (MEDIA_TYPE *)__cil_tmp30; #line 2657 - __cil_tmp31 = *mem_402; + __cil_tmp31 = *mem_402; #line 2657 - __cil_tmp32 = (int )__cil_tmp31; + __cil_tmp32 = (int)__cil_tmp31; #line 2657 - if (__cil_tmp32 == 0) { + if (__cil_tmp32 == 0) { #line 2659 - __cil_tmp33 = (unsigned int )DisketteExtension; + __cil_tmp33 = (unsigned int)DisketteExtension; #line 2659 - __cil_tmp34 = __cil_tmp33 + 308; + __cil_tmp34 = __cil_tmp33 + 308; #line 2659 - __cil_tmp35 = DriveMediaConstants + 0; + __cil_tmp35 = DriveMediaConstants + 0; #line 2659 - mem_403 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp34; + mem_403 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp34; #line 2659 - *mem_403 = *__cil_tmp35; - } else { - - } + *mem_403 = *__cil_tmp35; + } else { + } + } + } } - } - } #line 2669 - __cil_tmp36 = & fdcEnableParms; + __cil_tmp36 = &fdcEnableParms; #line 2669 - __cil_tmp37 = (unsigned int )DisketteExtension; + __cil_tmp37 = (unsigned int)DisketteExtension; #line 2669 - __cil_tmp38 = __cil_tmp37 + 249; + __cil_tmp38 = __cil_tmp37 + 249; #line 2669 - mem_404 = (UCHAR *)__cil_tmp36; + mem_404 = (UCHAR *)__cil_tmp36; #line 2669 - mem_405 = (UCHAR *)__cil_tmp38; + mem_405 = (UCHAR *)__cil_tmp38; #line 2669 - *mem_404 = *mem_405; + *mem_404 = *mem_405; #line 2670 - if (WriteOperation) { + if (WriteOperation) { #line 2671 - __cil_tmp39 = (unsigned int )(& fdcEnableParms) + 2; + __cil_tmp39 = (unsigned int)(&fdcEnableParms) + 2; #line 2671 - __cil_tmp40 = 308 + 46; + __cil_tmp40 = 308 + 46; #line 2671 - __cil_tmp41 = (unsigned int )DisketteExtension; + __cil_tmp41 = (unsigned int)DisketteExtension; #line 2671 - __cil_tmp42 = __cil_tmp41 + __cil_tmp40; + __cil_tmp42 = __cil_tmp41 + __cil_tmp40; #line 2671 - mem_406 = (USHORT *)__cil_tmp39; + mem_406 = (USHORT *)__cil_tmp39; #line 2671 - mem_407 = (USHORT *)__cil_tmp42; + mem_407 = (USHORT *)__cil_tmp42; #line 2671 - *mem_406 = *mem_407; - } else { + *mem_406 = *mem_407; + } else { #line 2674 - __cil_tmp43 = (unsigned int )(& fdcEnableParms) + 2; + __cil_tmp43 = (unsigned int)(&fdcEnableParms) + 2; #line 2674 - __cil_tmp44 = 308 + 44; + __cil_tmp44 = 308 + 44; #line 2674 - __cil_tmp45 = (unsigned int )DisketteExtension; + __cil_tmp45 = (unsigned int)DisketteExtension; #line 2674 - __cil_tmp46 = __cil_tmp45 + __cil_tmp44; + __cil_tmp46 = __cil_tmp45 + __cil_tmp44; #line 2674 - mem_408 = (USHORT *)__cil_tmp43; + mem_408 = (USHORT *)__cil_tmp43; #line 2674 - mem_409 = (USHORT *)__cil_tmp46; + mem_409 = (USHORT *)__cil_tmp46; #line 2674 - *mem_408 = *mem_409; - } - { + *mem_408 = *mem_409; + } + { #line 2678 - __cil_tmp47 = (unsigned int )DisketteExtension; + __cil_tmp47 = (unsigned int)DisketteExtension; #line 2678 - __cil_tmp48 = __cil_tmp47 + 8; + __cil_tmp48 = __cil_tmp47 + 8; #line 2678 - mem_410 = (PDEVICE_OBJECT *)__cil_tmp48; + mem_410 = (PDEVICE_OBJECT *)__cil_tmp48; #line 2678 - __cil_tmp49 = *mem_410; + __cil_tmp49 = *mem_410; #line 2678 - __cil_tmp50 = 774 << 2; + __cil_tmp50 = 774 << 2; #line 2678 - __cil_tmp51 = 7 << 16; + __cil_tmp51 = 7 << 16; #line 2678 - __cil_tmp52 = __cil_tmp51 | __cil_tmp50; + __cil_tmp52 = __cil_tmp51 | __cil_tmp50; #line 2678 - __cil_tmp53 = __cil_tmp52 | 3; + __cil_tmp53 = __cil_tmp52 | 3; #line 2678 - __cil_tmp54 = (unsigned long )__cil_tmp53; + __cil_tmp54 = (unsigned long)__cil_tmp53; #line 2678 - __cil_tmp55 = (void *)(& fdcEnableParms); + __cil_tmp55 = (void *)(&fdcEnableParms); #line 2678 - ntStatus = FlFdcDeviceIo(__cil_tmp49, __cil_tmp54, __cil_tmp55); + ntStatus = FlFdcDeviceIo(__cil_tmp49, __cil_tmp54, __cil_tmp55); #line 2682 - __cil_tmp56 = (unsigned int )(& fdcEnableParms) + 4; + __cil_tmp56 = (unsigned int)(&fdcEnableParms) + 4; #line 2682 - mem_411 = (BOOLEAN *)__cil_tmp56; + mem_411 = (BOOLEAN *)__cil_tmp56; #line 2682 - motorStarted = *mem_411; - } + motorStarted = *mem_411; + } #line 2684 - if (ntStatus >= 0L) { - { + if (ntStatus >= 0L) { + { #line 2686 - __cil_tmp57 = (unsigned int )(& fdcDiskChangeParms) + 1; + __cil_tmp57 = (unsigned int)(&fdcDiskChangeParms) + 1; #line 2686 - __cil_tmp58 = (unsigned int )DisketteExtension; + __cil_tmp58 = (unsigned int)DisketteExtension; #line 2686 - __cil_tmp59 = __cil_tmp58 + 249; + __cil_tmp59 = __cil_tmp58 + 249; #line 2686 - mem_412 = (UCHAR *)__cil_tmp57; + mem_412 = (UCHAR *)__cil_tmp57; #line 2686 - mem_413 = (UCHAR *)__cil_tmp59; + mem_413 = (UCHAR *)__cil_tmp59; #line 2686 - *mem_412 = *mem_413; + *mem_412 = *mem_413; #line 2688 - __cil_tmp60 = (unsigned int )DisketteExtension; + __cil_tmp60 = (unsigned int)DisketteExtension; #line 2688 - __cil_tmp61 = __cil_tmp60 + 8; + __cil_tmp61 = __cil_tmp60 + 8; #line 2688 - mem_414 = (PDEVICE_OBJECT *)__cil_tmp61; + mem_414 = (PDEVICE_OBJECT *)__cil_tmp61; #line 2688 - __cil_tmp62 = *mem_414; + __cil_tmp62 = *mem_414; #line 2688 - __cil_tmp63 = 776 << 2; + __cil_tmp63 = 776 << 2; #line 2688 - __cil_tmp64 = 7 << 16; + __cil_tmp64 = 7 << 16; #line 2688 - __cil_tmp65 = __cil_tmp64 | __cil_tmp63; + __cil_tmp65 = __cil_tmp64 | __cil_tmp63; #line 2688 - __cil_tmp66 = __cil_tmp65 | 3; + __cil_tmp66 = __cil_tmp65 | 3; #line 2688 - __cil_tmp67 = (unsigned long )__cil_tmp66; + __cil_tmp67 = (unsigned long)__cil_tmp66; #line 2688 - __cil_tmp68 = (void *)(& fdcDiskChangeParms); + __cil_tmp68 = (void *)(&fdcDiskChangeParms); #line 2688 - ntStatus = FlFdcDeviceIo(__cil_tmp62, __cil_tmp67, __cil_tmp68); + ntStatus = FlFdcDeviceIo(__cil_tmp62, __cil_tmp67, __cil_tmp68); #line 2692 - __cil_tmp69 = & fdcDiskChangeParms; + __cil_tmp69 = &fdcDiskChangeParms; #line 2692 - mem_415 = (UCHAR *)__cil_tmp69; + mem_415 = (UCHAR *)__cil_tmp69; #line 2692 - driveStatus = *mem_415; + driveStatus = *mem_415; + } + } else { } - } else { - - } - { + { #line 2695 - __cil_tmp70 = ntStatus >= 0L; + __cil_tmp70 = ntStatus >= 0L; #line 2695 - if (! __cil_tmp70) { + if (!__cil_tmp70) { #line 2696 - return (ntStatus); - } else { - - } - } - { + return (ntStatus); + } else { + } + } + { #line 2708 - __cil_tmp71 = (unsigned int )DisketteExtension; + __cil_tmp71 = (unsigned int)DisketteExtension; #line 2708 - __cil_tmp72 = __cil_tmp71 + 174; + __cil_tmp72 = __cil_tmp71 + 174; #line 2708 - mem_416 = (UCHAR *)__cil_tmp72; + mem_416 = (UCHAR *)__cil_tmp72; #line 2708 - __cil_tmp73 = *mem_416; + __cil_tmp73 = *mem_416; #line 2708 - __cil_tmp74 = (int )__cil_tmp73; + __cil_tmp74 = (int)__cil_tmp73; #line 2708 - if (__cil_tmp74 == 0) { + if (__cil_tmp74 == 0) { #line 2708 - if (motorStarted) { - goto _L___1; - } else { - goto _L___3; - } - } else { - _L___3: - { + if (motorStarted) { + goto _L___1; + } else { + goto _L___3; + } + } else { + _L___3 : { #line 2708 - __cil_tmp75 = (unsigned int )DisketteExtension; + __cil_tmp75 = (unsigned int)DisketteExtension; #line 2708 - __cil_tmp76 = __cil_tmp75 + 174; + __cil_tmp76 = __cil_tmp75 + 174; #line 2708 - mem_417 = (UCHAR *)__cil_tmp76; + mem_417 = (UCHAR *)__cil_tmp76; #line 2708 - __cil_tmp77 = *mem_417; + __cil_tmp77 = *mem_417; #line 2708 - __cil_tmp78 = (int )__cil_tmp77; + __cil_tmp78 = (int)__cil_tmp77; #line 2708 - if (__cil_tmp78 != 0) { - { + if (__cil_tmp78 != 0) { + { #line 2708 - __cil_tmp79 = (int )driveStatus; + __cil_tmp79 = (int)driveStatus; #line 2708 - if (__cil_tmp79 & 128) { - _L___1: - { + if (__cil_tmp79 & 128) { + _L___1 : { #line 2716 - while (1) { - while_75_continue: /* CIL Label */ ; - goto while_75_break; - } - while_75_break: /* CIL Label */ ; - } + while (1) { + while_75_continue: /* CIL Label */; + goto while_75_break; + } + while_75_break: /* CIL Label */; + } #line 2718 - __cil_tmp80 = (unsigned int )DisketteExtension; + __cil_tmp80 = (unsigned int)DisketteExtension; #line 2718 - __cil_tmp81 = __cil_tmp80 + 184; + __cil_tmp81 = __cil_tmp80 + 184; #line 2718 - mem_418 = (MEDIA_TYPE *)__cil_tmp81; + mem_418 = (MEDIA_TYPE *)__cil_tmp81; #line 2718 - *mem_418 = (enum _MEDIA_TYPE )-1; - { + *mem_418 = (enum _MEDIA_TYPE) - 1; + { #line 2725 - __cil_tmp82 = (unsigned int )DisketteExtension; + __cil_tmp82 = (unsigned int)DisketteExtension; #line 2725 - __cil_tmp83 = __cil_tmp82 + 28; + __cil_tmp83 = __cil_tmp82 + 28; #line 2725 - mem_419 = (PDEVICE_OBJECT *)__cil_tmp83; + mem_419 = (PDEVICE_OBJECT *)__cil_tmp83; #line 2725 - __cil_tmp84 = *mem_419; + __cil_tmp84 = *mem_419; #line 2725 - __cil_tmp85 = (unsigned int )__cil_tmp84; + __cil_tmp85 = (unsigned int)__cil_tmp84; #line 2725 - __cil_tmp86 = __cil_tmp85 + 36; + __cil_tmp86 = __cil_tmp85 + 36; #line 2725 - mem_420 = (PVPB *)__cil_tmp86; + mem_420 = (PVPB *)__cil_tmp86; #line 2725 - __cil_tmp87 = *mem_420; + __cil_tmp87 = *mem_420; #line 2725 - __cil_tmp88 = (unsigned int )__cil_tmp87; + __cil_tmp88 = (unsigned int)__cil_tmp87; #line 2725 - __cil_tmp89 = __cil_tmp88 + 4; + __cil_tmp89 = __cil_tmp88 + 4; #line 2725 - mem_421 = (USHORT *)__cil_tmp89; + mem_421 = (USHORT *)__cil_tmp89; #line 2725 - __cil_tmp90 = *mem_421; + __cil_tmp90 = *mem_421; #line 2725 - __cil_tmp91 = (int )__cil_tmp90; + __cil_tmp91 = (int)__cil_tmp90; #line 2725 - if (__cil_tmp91 & 1) { + if (__cil_tmp91 & 1) { #line 2727 - if (Irp) { - { + if (Irp) { + { #line 2728 - __cil_tmp92 = (unsigned int )DisketteExtension; + __cil_tmp92 = (unsigned int)DisketteExtension; #line 2728 - __cil_tmp93 = __cil_tmp92 + 28; + __cil_tmp93 = __cil_tmp92 + 28; #line 2728 - mem_422 = (PDEVICE_OBJECT *)__cil_tmp93; + mem_422 = (PDEVICE_OBJECT *)__cil_tmp93; #line 2728 - __cil_tmp94 = *mem_422; + __cil_tmp94 = *mem_422; #line 2728 - IoSetHardErrorOrVerifyDevice(Irp, __cil_tmp94); - } - } else { - - } + IoSetHardErrorOrVerifyDevice(Irp, __cil_tmp94); + } + } else { + } #line 2731 - __cil_tmp95 = (unsigned int )DisketteExtension; + __cil_tmp95 = (unsigned int)DisketteExtension; #line 2731 - __cil_tmp96 = __cil_tmp95 + 28; + __cil_tmp96 = __cil_tmp95 + 28; #line 2731 - mem_423 = (PDEVICE_OBJECT *)__cil_tmp96; + mem_423 = (PDEVICE_OBJECT *)__cil_tmp96; #line 2731 - __cil_tmp97 = *mem_423; + __cil_tmp97 = *mem_423; #line 2731 - __cil_tmp98 = (unsigned int )__cil_tmp97; + __cil_tmp98 = (unsigned int)__cil_tmp97; #line 2731 - __cil_tmp99 = __cil_tmp98 + 28; + __cil_tmp99 = __cil_tmp98 + 28; #line 2731 - __cil_tmp100 = (unsigned int )DisketteExtension; + __cil_tmp100 = (unsigned int)DisketteExtension; #line 2731 - __cil_tmp101 = __cil_tmp100 + 28; + __cil_tmp101 = __cil_tmp100 + 28; #line 2731 - mem_424 = (PDEVICE_OBJECT *)__cil_tmp101; + mem_424 = (PDEVICE_OBJECT *)__cil_tmp101; #line 2731 - __cil_tmp102 = *mem_424; + __cil_tmp102 = *mem_424; #line 2731 - __cil_tmp103 = (unsigned int )__cil_tmp102; + __cil_tmp103 = (unsigned int)__cil_tmp102; #line 2731 - __cil_tmp104 = __cil_tmp103 + 28; + __cil_tmp104 = __cil_tmp103 + 28; #line 2731 - mem_425 = (ULONG *)__cil_tmp104; + mem_425 = (ULONG *)__cil_tmp104; #line 2731 - __cil_tmp105 = *mem_425; + __cil_tmp105 = *mem_425; #line 2731 - mem_426 = (ULONG *)__cil_tmp99; + mem_426 = (ULONG *)__cil_tmp99; #line 2731 - *mem_426 = __cil_tmp105 | 2UL; - } else { - - } - } - { + *mem_426 = __cil_tmp105 | 2UL; + } else { + } + } + { #line 2741 - __cil_tmp106 = (unsigned int )DisketteExtension; + __cil_tmp106 = (unsigned int)DisketteExtension; #line 2741 - __cil_tmp107 = __cil_tmp106 + 174; + __cil_tmp107 = __cil_tmp106 + 174; #line 2741 - mem_427 = (UCHAR *)__cil_tmp107; + mem_427 = (UCHAR *)__cil_tmp107; #line 2741 - __cil_tmp108 = *mem_427; + __cil_tmp108 = *mem_427; #line 2741 - __cil_tmp109 = (int )__cil_tmp108; + __cil_tmp109 = (int)__cil_tmp108; #line 2741 - if (__cil_tmp109 != 0) { - { + if (__cil_tmp109 != 0) { + { #line 2743 - __cil_tmp110 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp110 = (KUSER_SHARED_DATA * const)4292804608U; #line 2743 - __cil_tmp111 = (unsigned int )__cil_tmp110; + __cil_tmp111 = (unsigned int)__cil_tmp110; #line 2743 - __cil_tmp112 = __cil_tmp111 + 732; + __cil_tmp112 = __cil_tmp111 + 732; #line 2743 - mem_428 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp112; + mem_428 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp112; #line 2743 - __cil_tmp113 = *mem_428; + __cil_tmp113 = *mem_428; #line 2743 - __cil_tmp114 = (int )__cil_tmp113; + __cil_tmp114 = (int)__cil_tmp113; #line 2743 - if (__cil_tmp114 == 1) { - { + if (__cil_tmp114 == 1) { + { #line 2749 - __cil_tmp115 = 0 * 1U; + __cil_tmp115 = 0 * 1U; #line 2749 - __cil_tmp116 = 112 + __cil_tmp115; + __cil_tmp116 = 112 + __cil_tmp115; #line 2749 - __cil_tmp117 = (unsigned int )DisketteExtension; + __cil_tmp117 = (unsigned int)DisketteExtension; #line 2749 - __cil_tmp118 = __cil_tmp117 + __cil_tmp116; + __cil_tmp118 = __cil_tmp117 + __cil_tmp116; #line 2749 - mem_429 = (UCHAR *)__cil_tmp118; + mem_429 = (UCHAR *)__cil_tmp118; #line 2749 - *mem_429 = (unsigned char)14; + *mem_429 = (unsigned char)14; #line 2750 - __cil_tmp119 = 1 * 1U; + __cil_tmp119 = 1 * 1U; #line 2750 - __cil_tmp120 = 112 + __cil_tmp119; + __cil_tmp120 = 112 + __cil_tmp119; #line 2750 - __cil_tmp121 = (unsigned int )DisketteExtension; + __cil_tmp121 = (unsigned int)DisketteExtension; #line 2750 - __cil_tmp122 = __cil_tmp121 + __cil_tmp120; + __cil_tmp122 = __cil_tmp121 + __cil_tmp120; #line 2750 - __cil_tmp123 = (unsigned int )DisketteExtension; + __cil_tmp123 = (unsigned int)DisketteExtension; #line 2750 - __cil_tmp124 = __cil_tmp123 + 248; + __cil_tmp124 = __cil_tmp123 + 248; #line 2750 - mem_430 = (UCHAR *)__cil_tmp122; + mem_430 = (UCHAR *)__cil_tmp122; #line 2750 - mem_431 = (UCHAR *)__cil_tmp124; + mem_431 = (UCHAR *)__cil_tmp124; #line 2750 - *mem_430 = *mem_431; + *mem_430 = *mem_431; #line 2752 - __cil_tmp125 = 0 * 1U; + __cil_tmp125 = 0 * 1U; #line 2752 - __cil_tmp126 = 112 + __cil_tmp125; + __cil_tmp126 = 112 + __cil_tmp125; #line 2752 - __cil_tmp127 = (unsigned int )DisketteExtension; + __cil_tmp127 = (unsigned int)DisketteExtension; #line 2752 - __cil_tmp128 = __cil_tmp127 + __cil_tmp126; + __cil_tmp128 = __cil_tmp127 + __cil_tmp126; #line 2752 - __cil_tmp129 = (UCHAR *)__cil_tmp128; + __cil_tmp129 = (UCHAR *)__cil_tmp128; #line 2752 - __cil_tmp130 = 0 * 1U; + __cil_tmp130 = 0 * 1U; #line 2752 - __cil_tmp131 = 112 + __cil_tmp130; + __cil_tmp131 = 112 + __cil_tmp130; #line 2752 - __cil_tmp132 = (unsigned int )DisketteExtension; + __cil_tmp132 = (unsigned int)DisketteExtension; #line 2752 - __cil_tmp133 = __cil_tmp132 + __cil_tmp131; + __cil_tmp133 = __cil_tmp132 + __cil_tmp131; #line 2752 - __cil_tmp134 = (UCHAR *)__cil_tmp133; + __cil_tmp134 = (UCHAR *)__cil_tmp133; #line 2752 - __cil_tmp135 = (void *)0; + __cil_tmp135 = (void *)0; #line 2752 - __cil_tmp136 = (struct _MDL *)__cil_tmp135; + __cil_tmp136 = (struct _MDL *)__cil_tmp135; #line 2752 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp129, __cil_tmp134, - __cil_tmp136, 0UL, 0UL); - } - { + ntStatus = FlIssueCommand(DisketteExtension, + __cil_tmp129, __cil_tmp134, + __cil_tmp136, 0UL, 0UL); + } + { #line 2759 - __cil_tmp137 = ntStatus >= 0L; + __cil_tmp137 = ntStatus >= 0L; #line 2759 - if (! __cil_tmp137) { - { + if (!__cil_tmp137) { + { #line 2764 - while (1) { - while_76_continue: /* CIL Label */ ; - goto while_76_break; - } - while_76_break: /* CIL Label */ ; - } + while (1) { + while_76_continue: /* CIL Label */; + goto while_76_break; + } + while_76_break: /* CIL Label */; + } #line 2766 - return (ntStatus); - } else { - - } - } - { + return (ntStatus); + } else { + } + } + { #line 2769 - __cil_tmp138 = 0 * 1U; + __cil_tmp138 = 0 * 1U; #line 2769 - __cil_tmp139 = 112 + __cil_tmp138; + __cil_tmp139 = 112 + __cil_tmp138; #line 2769 - __cil_tmp140 = (unsigned int )DisketteExtension; + __cil_tmp140 = (unsigned int)DisketteExtension; #line 2769 - __cil_tmp141 = __cil_tmp140 + __cil_tmp139; + __cil_tmp141 = __cil_tmp140 + __cil_tmp139; #line 2769 - mem_432 = (UCHAR *)__cil_tmp141; + mem_432 = (UCHAR *)__cil_tmp141; #line 2769 - __cil_tmp142 = *mem_432; + __cil_tmp142 = *mem_432; #line 2769 - __cil_tmp143 = (int )__cil_tmp142; + __cil_tmp143 = (int)__cil_tmp142; #line 2769 - if (__cil_tmp143 & 32) { + if (__cil_tmp143 & 32) { #line 2771 - driveStatus = (unsigned char)127; - } else { + driveStatus = (unsigned char)127; + } else { #line 2775 - driveStatus = (unsigned char)128; - } - } - { + driveStatus = (unsigned char)128; + } + } + { #line 2778 - __cil_tmp144 = (int )driveStatus; + __cil_tmp144 = (int)driveStatus; #line 2778 - if (__cil_tmp144 & 128) { - { + if (__cil_tmp144 & 128) { + { #line 2788 - while (1) { - while_77_continue: /* CIL Label */ ; - goto while_77_break; - } - while_77_break: /* CIL Label */ ; - } - { + while (1) { + while_77_continue: /* CIL Label */; + goto while_77_break; + } + while_77_break: /* CIL Label */; + } + { #line 2795 - __cil_tmp145 = (unsigned int )DisketteExtension; + __cil_tmp145 = (unsigned int)DisketteExtension; #line 2795 - __cil_tmp146 = __cil_tmp145 + 28; + __cil_tmp146 = __cil_tmp145 + 28; #line 2795 - mem_433 = (PDEVICE_OBJECT *)__cil_tmp146; + mem_433 = (PDEVICE_OBJECT *)__cil_tmp146; #line 2795 - __cil_tmp147 = *mem_433; + __cil_tmp147 = *mem_433; #line 2795 - __cil_tmp148 = (unsigned int )__cil_tmp147; + __cil_tmp148 = (unsigned int)__cil_tmp147; #line 2795 - __cil_tmp149 = __cil_tmp148 + 36; + __cil_tmp149 = __cil_tmp148 + 36; #line 2795 - mem_434 = (PVPB *)__cil_tmp149; + mem_434 = (PVPB *)__cil_tmp149; #line 2795 - __cil_tmp150 = *mem_434; + __cil_tmp150 = *mem_434; #line 2795 - __cil_tmp151 = (unsigned int )__cil_tmp150; + __cil_tmp151 = (unsigned int)__cil_tmp150; #line 2795 - __cil_tmp152 = __cil_tmp151 + 4; + __cil_tmp152 = __cil_tmp151 + 4; #line 2795 - mem_435 = (USHORT *)__cil_tmp152; + mem_435 = (USHORT *)__cil_tmp152; #line 2795 - __cil_tmp153 = *mem_435; + __cil_tmp153 = *mem_435; #line 2795 - __cil_tmp154 = (int )__cil_tmp153; + __cil_tmp154 = (int)__cil_tmp153; #line 2795 - if (__cil_tmp154 & 1) { + if (__cil_tmp154 & 1) { #line 2797 - __cil_tmp155 = (unsigned int )DisketteExtension; + __cil_tmp155 = (unsigned int)DisketteExtension; #line 2797 - __cil_tmp156 = __cil_tmp155 + 28; + __cil_tmp156 = __cil_tmp155 + 28; #line 2797 - mem_436 = (PDEVICE_OBJECT *)__cil_tmp156; + mem_436 = (PDEVICE_OBJECT *)__cil_tmp156; #line 2797 - __cil_tmp157 = *mem_436; + __cil_tmp157 = *mem_436; #line 2797 - __cil_tmp158 = (unsigned int )__cil_tmp157; + __cil_tmp158 = (unsigned int)__cil_tmp157; #line 2797 - __cil_tmp159 = __cil_tmp158 + 28; + __cil_tmp159 = __cil_tmp158 + 28; #line 2797 - __cil_tmp160 = (unsigned int )DisketteExtension; + __cil_tmp160 = (unsigned int)DisketteExtension; #line 2797 - __cil_tmp161 = __cil_tmp160 + 28; + __cil_tmp161 = __cil_tmp160 + 28; #line 2797 - mem_437 = (PDEVICE_OBJECT *)__cil_tmp161; + mem_437 = (PDEVICE_OBJECT *)__cil_tmp161; #line 2797 - __cil_tmp162 = *mem_437; + __cil_tmp162 = *mem_437; #line 2797 - __cil_tmp163 = (unsigned int )__cil_tmp162; + __cil_tmp163 = (unsigned int)__cil_tmp162; #line 2797 - __cil_tmp164 = __cil_tmp163 + 28; + __cil_tmp164 = __cil_tmp163 + 28; #line 2797 - mem_438 = (ULONG *)__cil_tmp164; + mem_438 = (ULONG *)__cil_tmp164; #line 2797 - __cil_tmp165 = *mem_438; + __cil_tmp165 = *mem_438; #line 2797 - mem_439 = (ULONG *)__cil_tmp159; + mem_439 = (ULONG *)__cil_tmp159; #line 2797 - *mem_439 = __cil_tmp165 & 4294967293UL; - } else { - - } - } + *mem_439 = __cil_tmp165 & 4294967293UL; + } else { + } + } #line 2801 - return (-1073741805L); - } else { - - } - } - } else { - - } - } - { + return (-1073741805L); + } else { + } + } + } else { + } + } + { #line 2815 - __cil_tmp166 = 0 * 1U; + __cil_tmp166 = 0 * 1U; #line 2815 - __cil_tmp167 = 112 + __cil_tmp166; + __cil_tmp167 = 112 + __cil_tmp166; #line 2815 - __cil_tmp168 = (unsigned int )DisketteExtension; + __cil_tmp168 = (unsigned int)DisketteExtension; #line 2815 - __cil_tmp169 = __cil_tmp168 + __cil_tmp167; + __cil_tmp169 = __cil_tmp168 + __cil_tmp167; #line 2815 - mem_440 = (UCHAR *)__cil_tmp169; + mem_440 = (UCHAR *)__cil_tmp169; #line 2815 - *mem_440 = (unsigned char)16; + *mem_440 = (unsigned char)16; #line 2816 - __cil_tmp170 = 1 * 1U; + __cil_tmp170 = 1 * 1U; #line 2816 - __cil_tmp171 = 112 + __cil_tmp170; + __cil_tmp171 = 112 + __cil_tmp170; #line 2816 - __cil_tmp172 = (unsigned int )DisketteExtension; + __cil_tmp172 = (unsigned int)DisketteExtension; #line 2816 - __cil_tmp173 = __cil_tmp172 + __cil_tmp171; + __cil_tmp173 = __cil_tmp172 + __cil_tmp171; #line 2816 - __cil_tmp174 = (unsigned int )DisketteExtension; + __cil_tmp174 = (unsigned int)DisketteExtension; #line 2816 - __cil_tmp175 = __cil_tmp174 + 248; + __cil_tmp175 = __cil_tmp174 + 248; #line 2816 - mem_441 = (UCHAR *)__cil_tmp173; + mem_441 = (UCHAR *)__cil_tmp173; #line 2816 - mem_442 = (UCHAR *)__cil_tmp175; + mem_442 = (UCHAR *)__cil_tmp175; #line 2816 - *mem_441 = *mem_442; + *mem_441 = *mem_442; #line 2817 - __cil_tmp176 = 2 * 1U; + __cil_tmp176 = 2 * 1U; #line 2817 - __cil_tmp177 = 112 + __cil_tmp176; + __cil_tmp177 = 112 + __cil_tmp176; #line 2817 - __cil_tmp178 = (unsigned int )DisketteExtension; + __cil_tmp178 = (unsigned int)DisketteExtension; #line 2817 - __cil_tmp179 = __cil_tmp178 + __cil_tmp177; + __cil_tmp179 = __cil_tmp178 + __cil_tmp177; #line 2817 - mem_443 = (UCHAR *)__cil_tmp179; + mem_443 = (UCHAR *)__cil_tmp179; #line 2817 - *mem_443 = (unsigned char)1; + *mem_443 = (unsigned char)1; #line 2819 - __cil_tmp180 = 0 * 1U; + __cil_tmp180 = 0 * 1U; #line 2819 - __cil_tmp181 = 112 + __cil_tmp180; + __cil_tmp181 = 112 + __cil_tmp180; #line 2819 - __cil_tmp182 = (unsigned int )DisketteExtension; + __cil_tmp182 = (unsigned int)DisketteExtension; #line 2819 - __cil_tmp183 = __cil_tmp182 + __cil_tmp181; + __cil_tmp183 = __cil_tmp182 + __cil_tmp181; #line 2819 - __cil_tmp184 = (UCHAR *)__cil_tmp183; + __cil_tmp184 = (UCHAR *)__cil_tmp183; #line 2819 - __cil_tmp185 = 0 * 1U; + __cil_tmp185 = 0 * 1U; #line 2819 - __cil_tmp186 = 112 + __cil_tmp185; + __cil_tmp186 = 112 + __cil_tmp185; #line 2819 - __cil_tmp187 = (unsigned int )DisketteExtension; + __cil_tmp187 = (unsigned int)DisketteExtension; #line 2819 - __cil_tmp188 = __cil_tmp187 + __cil_tmp186; + __cil_tmp188 = __cil_tmp187 + __cil_tmp186; #line 2819 - __cil_tmp189 = (UCHAR *)__cil_tmp188; + __cil_tmp189 = (UCHAR *)__cil_tmp188; #line 2819 - __cil_tmp190 = (void *)0; + __cil_tmp190 = (void *)0; #line 2819 - __cil_tmp191 = (struct _MDL *)__cil_tmp190; + __cil_tmp191 = (struct _MDL *)__cil_tmp190; #line 2819 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp184, __cil_tmp189, - __cil_tmp191, 0UL, 0UL); - } - { + ntStatus = + FlIssueCommand(DisketteExtension, __cil_tmp184, + __cil_tmp189, __cil_tmp191, 0UL, 0UL); + } + { #line 2826 - __cil_tmp192 = ntStatus >= 0L; + __cil_tmp192 = ntStatus >= 0L; #line 2826 - if (! __cil_tmp192) { - { + if (!__cil_tmp192) { + { #line 2829 - while (1) { - while_78_continue: /* CIL Label */ ; - goto while_78_break; - } - while_78_break: /* CIL Label */ ; - } + while (1) { + while_78_continue: /* CIL Label */; + goto while_78_break; + } + while_78_break: /* CIL Label */; + } #line 2831 - return (ntStatus); - } else { - { + return (ntStatus); + } else { + { #line 2835 - __cil_tmp193 = 0 * 1U; + __cil_tmp193 = 0 * 1U; #line 2835 - __cil_tmp194 = 112 + __cil_tmp193; + __cil_tmp194 = 112 + __cil_tmp193; #line 2835 - __cil_tmp195 = (unsigned int )DisketteExtension; + __cil_tmp195 = (unsigned int)DisketteExtension; #line 2835 - __cil_tmp196 = __cil_tmp195 + __cil_tmp194; + __cil_tmp196 = __cil_tmp195 + __cil_tmp194; #line 2835 - mem_444 = (UCHAR *)__cil_tmp196; + mem_444 = (UCHAR *)__cil_tmp196; #line 2835 - __cil_tmp197 = *mem_444; + __cil_tmp197 = *mem_444; #line 2835 - __cil_tmp198 = (int )__cil_tmp197; + __cil_tmp198 = (int)__cil_tmp197; #line 2835 - __cil_tmp199 = __cil_tmp198 & 32; + __cil_tmp199 = __cil_tmp198 & 32; #line 2835 - if (! __cil_tmp199) { - goto _L; - } else { - { + if (!__cil_tmp199) { + goto _L; + } else { + { #line 2835 - __cil_tmp200 = 1 * 1U; + __cil_tmp200 = 1 * 1U; #line 2835 - __cil_tmp201 = 112 + __cil_tmp200; + __cil_tmp201 = 112 + __cil_tmp200; #line 2835 - __cil_tmp202 = (unsigned int )DisketteExtension; + __cil_tmp202 = (unsigned int)DisketteExtension; #line 2835 - __cil_tmp203 = __cil_tmp202 + __cil_tmp201; + __cil_tmp203 = __cil_tmp202 + __cil_tmp201; #line 2835 - mem_445 = (UCHAR *)__cil_tmp203; + mem_445 = (UCHAR *)__cil_tmp203; #line 2835 - __cil_tmp204 = *mem_445; + __cil_tmp204 = *mem_445; #line 2835 - __cil_tmp205 = (int )__cil_tmp204; + __cil_tmp205 = (int)__cil_tmp204; #line 2835 - if (__cil_tmp205 != 1) { - _L: - { + if (__cil_tmp205 != 1) { + _L : { #line 2841 - while (1) { - while_79_continue: /* CIL Label */ ; - goto while_79_break; - } - while_79_break: /* CIL Label */ ; - } + while (1) { + while_79_continue: /* CIL Label */; + goto while_79_break; + } + while_79_break: /* CIL Label */; + } #line 2843 - __cil_tmp206 = (unsigned int )DisketteExtension; + __cil_tmp206 = (unsigned int)DisketteExtension; #line 2843 - __cil_tmp207 = __cil_tmp206 + 104; + __cil_tmp207 = __cil_tmp206 + 104; #line 2843 - mem_446 = (BOOLEAN *)__cil_tmp207; + mem_446 = (BOOLEAN *)__cil_tmp207; #line 2843 - *mem_446 = (unsigned char)1; + *mem_446 = (unsigned char)1; #line 2845 - return (-1073741464L); - } else { - - } - } - } - } - } - } - { + return (-1073741464L); + } else { + } + } + } + } + } + } + { #line 2853 - __cil_tmp208 = 0 * 1U; + __cil_tmp208 = 0 * 1U; #line 2853 - __cil_tmp209 = 112 + __cil_tmp208; + __cil_tmp209 = 112 + __cil_tmp208; #line 2853 - __cil_tmp210 = (unsigned int )DisketteExtension; + __cil_tmp210 = (unsigned int)DisketteExtension; #line 2853 - __cil_tmp211 = __cil_tmp210 + __cil_tmp209; + __cil_tmp211 = __cil_tmp210 + __cil_tmp209; #line 2853 - mem_447 = (UCHAR *)__cil_tmp211; + mem_447 = (UCHAR *)__cil_tmp211; #line 2853 - *mem_447 = (unsigned char)16; + *mem_447 = (unsigned char)16; #line 2854 - __cil_tmp212 = 1 * 1U; + __cil_tmp212 = 1 * 1U; #line 2854 - __cil_tmp213 = 112 + __cil_tmp212; + __cil_tmp213 = 112 + __cil_tmp212; #line 2854 - __cil_tmp214 = (unsigned int )DisketteExtension; + __cil_tmp214 = (unsigned int)DisketteExtension; #line 2854 - __cil_tmp215 = __cil_tmp214 + __cil_tmp213; + __cil_tmp215 = __cil_tmp214 + __cil_tmp213; #line 2854 - __cil_tmp216 = (unsigned int )DisketteExtension; + __cil_tmp216 = (unsigned int)DisketteExtension; #line 2854 - __cil_tmp217 = __cil_tmp216 + 248; + __cil_tmp217 = __cil_tmp216 + 248; #line 2854 - mem_448 = (UCHAR *)__cil_tmp215; + mem_448 = (UCHAR *)__cil_tmp215; #line 2854 - mem_449 = (UCHAR *)__cil_tmp217; + mem_449 = (UCHAR *)__cil_tmp217; #line 2854 - *mem_448 = *mem_449; + *mem_448 = *mem_449; #line 2855 - __cil_tmp218 = 2 * 1U; + __cil_tmp218 = 2 * 1U; #line 2855 - __cil_tmp219 = 112 + __cil_tmp218; + __cil_tmp219 = 112 + __cil_tmp218; #line 2855 - __cil_tmp220 = (unsigned int )DisketteExtension; + __cil_tmp220 = (unsigned int)DisketteExtension; #line 2855 - __cil_tmp221 = __cil_tmp220 + __cil_tmp219; + __cil_tmp221 = __cil_tmp220 + __cil_tmp219; #line 2855 - mem_450 = (UCHAR *)__cil_tmp221; + mem_450 = (UCHAR *)__cil_tmp221; #line 2855 - *mem_450 = (unsigned char)0; + *mem_450 = (unsigned char)0; #line 2862 - __cil_tmp222 = & delay; + __cil_tmp222 = &delay; #line 2862 - mem_451 = (ULONG *)__cil_tmp222; + mem_451 = (ULONG *)__cil_tmp222; #line 2862 - *mem_451 = 4294966396UL; + *mem_451 = 4294966396UL; #line 2863 - __cil_tmp223 = 0 + 4; + __cil_tmp223 = 0 + 4; #line 2863 - __cil_tmp224 = (unsigned int )(& delay) + __cil_tmp223; + __cil_tmp224 = (unsigned int)(&delay) + __cil_tmp223; #line 2863 - mem_452 = (LONG *)__cil_tmp224; + mem_452 = (LONG *)__cil_tmp224; #line 2863 - *mem_452 = -1L; + *mem_452 = -1L; #line 2864 - KeDelayExecutionThread((char)0, (unsigned char)0, & delay); + KeDelayExecutionThread((char)0, (unsigned char)0, &delay); #line 2865 - __cil_tmp225 = 0 * 1U; + __cil_tmp225 = 0 * 1U; #line 2865 - __cil_tmp226 = 112 + __cil_tmp225; + __cil_tmp226 = 112 + __cil_tmp225; #line 2865 - __cil_tmp227 = (unsigned int )DisketteExtension; + __cil_tmp227 = (unsigned int)DisketteExtension; #line 2865 - __cil_tmp228 = __cil_tmp227 + __cil_tmp226; + __cil_tmp228 = __cil_tmp227 + __cil_tmp226; #line 2865 - __cil_tmp229 = (UCHAR *)__cil_tmp228; + __cil_tmp229 = (UCHAR *)__cil_tmp228; #line 2865 - __cil_tmp230 = 0 * 1U; + __cil_tmp230 = 0 * 1U; #line 2865 - __cil_tmp231 = 112 + __cil_tmp230; + __cil_tmp231 = 112 + __cil_tmp230; #line 2865 - __cil_tmp232 = (unsigned int )DisketteExtension; + __cil_tmp232 = (unsigned int)DisketteExtension; #line 2865 - __cil_tmp233 = __cil_tmp232 + __cil_tmp231; + __cil_tmp233 = __cil_tmp232 + __cil_tmp231; #line 2865 - __cil_tmp234 = (UCHAR *)__cil_tmp233; + __cil_tmp234 = (UCHAR *)__cil_tmp233; #line 2865 - __cil_tmp235 = (void *)0; + __cil_tmp235 = (void *)0; #line 2865 - __cil_tmp236 = (struct _MDL *)__cil_tmp235; + __cil_tmp236 = (struct _MDL *)__cil_tmp235; #line 2865 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp229, __cil_tmp234, - __cil_tmp236, 0UL, 0UL); + ntStatus = + FlIssueCommand(DisketteExtension, __cil_tmp229, + __cil_tmp234, __cil_tmp236, 0UL, 0UL); #line 2875 - __cil_tmp237 = & delay; + __cil_tmp237 = &delay; #line 2875 - mem_453 = (ULONG *)__cil_tmp237; + mem_453 = (ULONG *)__cil_tmp237; #line 2875 - *mem_453 = 4294967291UL; + *mem_453 = 4294967291UL; #line 2876 - __cil_tmp238 = 0 + 4; + __cil_tmp238 = 0 + 4; #line 2876 - __cil_tmp239 = (unsigned int )(& delay) + __cil_tmp238; + __cil_tmp239 = (unsigned int)(&delay) + __cil_tmp238; #line 2876 - mem_454 = (LONG *)__cil_tmp239; + mem_454 = (LONG *)__cil_tmp239; #line 2876 - *mem_454 = -1L; + *mem_454 = -1L; #line 2877 - KeDelayExecutionThread((char)0, (unsigned char)0, & delay); - } - { + KeDelayExecutionThread((char)0, (unsigned char)0, &delay); + } + { #line 2879 - __cil_tmp240 = ntStatus >= 0L; + __cil_tmp240 = ntStatus >= 0L; #line 2879 - if (! __cil_tmp240) { - { + if (!__cil_tmp240) { + { #line 2882 - while (1) { - while_80_continue: /* CIL Label */ ; - goto while_80_break; - } - while_80_break: /* CIL Label */ ; - } + while (1) { + while_80_continue: /* CIL Label */; + goto while_80_break; + } + while_80_break: /* CIL Label */; + } #line 2884 - return (ntStatus); - } else { - { + return (ntStatus); + } else { + { #line 2888 - __cil_tmp241 = 0 * 1U; + __cil_tmp241 = 0 * 1U; #line 2888 - __cil_tmp242 = 112 + __cil_tmp241; + __cil_tmp242 = 112 + __cil_tmp241; #line 2888 - __cil_tmp243 = (unsigned int )DisketteExtension; + __cil_tmp243 = (unsigned int)DisketteExtension; #line 2888 - __cil_tmp244 = __cil_tmp243 + __cil_tmp242; + __cil_tmp244 = __cil_tmp243 + __cil_tmp242; #line 2888 - mem_455 = (UCHAR *)__cil_tmp244; + mem_455 = (UCHAR *)__cil_tmp244; #line 2888 - __cil_tmp245 = *mem_455; + __cil_tmp245 = *mem_455; #line 2888 - __cil_tmp246 = (int )__cil_tmp245; + __cil_tmp246 = (int)__cil_tmp245; #line 2888 - __cil_tmp247 = __cil_tmp246 & 32; + __cil_tmp247 = __cil_tmp246 & 32; #line 2888 - if (! __cil_tmp247) { - goto _L___0; - } else { - { + if (!__cil_tmp247) { + goto _L___0; + } else { + { #line 2888 - __cil_tmp248 = 1 * 1U; + __cil_tmp248 = 1 * 1U; #line 2888 - __cil_tmp249 = 112 + __cil_tmp248; + __cil_tmp249 = 112 + __cil_tmp248; #line 2888 - __cil_tmp250 = (unsigned int )DisketteExtension; + __cil_tmp250 = (unsigned int)DisketteExtension; #line 2888 - __cil_tmp251 = __cil_tmp250 + __cil_tmp249; + __cil_tmp251 = __cil_tmp250 + __cil_tmp249; #line 2888 - mem_456 = (UCHAR *)__cil_tmp251; + mem_456 = (UCHAR *)__cil_tmp251; #line 2888 - __cil_tmp252 = *mem_456; + __cil_tmp252 = *mem_456; #line 2888 - __cil_tmp253 = (int )__cil_tmp252; + __cil_tmp253 = (int)__cil_tmp252; #line 2888 - if (__cil_tmp253 != 0) { - _L___0: - { + if (__cil_tmp253 != 0) { + _L___0 : { #line 2894 - while (1) { - while_81_continue: /* CIL Label */ ; - goto while_81_break; - } - while_81_break: /* CIL Label */ ; - } + while (1) { + while_81_continue: /* CIL Label */; + goto while_81_break; + } + while_81_break: /* CIL Label */; + } #line 2896 - __cil_tmp254 = (unsigned int )DisketteExtension; + __cil_tmp254 = (unsigned int)DisketteExtension; #line 2896 - __cil_tmp255 = __cil_tmp254 + 104; + __cil_tmp255 = __cil_tmp254 + 104; #line 2896 - mem_457 = (BOOLEAN *)__cil_tmp255; + mem_457 = (BOOLEAN *)__cil_tmp255; #line 2896 - *mem_457 = (unsigned char)1; + *mem_457 = (unsigned char)1; #line 2898 - return (-1073741464L); - } else { - - } - } - } - } - } - } - { + return (-1073741464L); + } else { + } + } + } + } + } + } + { #line 2903 - __cil_tmp256 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp256 = (KUSER_SHARED_DATA * const)4292804608U; #line 2903 - __cil_tmp257 = (unsigned int )__cil_tmp256; + __cil_tmp257 = (unsigned int)__cil_tmp256; #line 2903 - __cil_tmp258 = __cil_tmp257 + 732; + __cil_tmp258 = __cil_tmp257 + 732; #line 2903 - mem_458 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp258; + mem_458 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp258; #line 2903 - __cil_tmp259 = *mem_458; + __cil_tmp259 = *mem_458; #line 2903 - __cil_tmp260 = (int )__cil_tmp259; + __cil_tmp260 = (int)__cil_tmp259; #line 2903 - if (__cil_tmp260 == 1) { - { + if (__cil_tmp260 == 1) { + { #line 2909 - __cil_tmp261 = 0 * 1U; + __cil_tmp261 = 0 * 1U; #line 2909 - __cil_tmp262 = 112 + __cil_tmp261; + __cil_tmp262 = 112 + __cil_tmp261; #line 2909 - __cil_tmp263 = (unsigned int )DisketteExtension; + __cil_tmp263 = (unsigned int)DisketteExtension; #line 2909 - __cil_tmp264 = __cil_tmp263 + __cil_tmp262; + __cil_tmp264 = __cil_tmp263 + __cil_tmp262; #line 2909 - mem_459 = (UCHAR *)__cil_tmp264; + mem_459 = (UCHAR *)__cil_tmp264; #line 2909 - *mem_459 = (unsigned char)14; + *mem_459 = (unsigned char)14; #line 2910 - __cil_tmp265 = 1 * 1U; + __cil_tmp265 = 1 * 1U; #line 2910 - __cil_tmp266 = 112 + __cil_tmp265; + __cil_tmp266 = 112 + __cil_tmp265; #line 2910 - __cil_tmp267 = (unsigned int )DisketteExtension; + __cil_tmp267 = (unsigned int)DisketteExtension; #line 2910 - __cil_tmp268 = __cil_tmp267 + __cil_tmp266; + __cil_tmp268 = __cil_tmp267 + __cil_tmp266; #line 2910 - __cil_tmp269 = (unsigned int )DisketteExtension; + __cil_tmp269 = (unsigned int)DisketteExtension; #line 2910 - __cil_tmp270 = __cil_tmp269 + 248; + __cil_tmp270 = __cil_tmp269 + 248; #line 2910 - mem_460 = (UCHAR *)__cil_tmp268; + mem_460 = (UCHAR *)__cil_tmp268; #line 2910 - mem_461 = (UCHAR *)__cil_tmp270; + mem_461 = (UCHAR *)__cil_tmp270; #line 2910 - *mem_460 = *mem_461; + *mem_460 = *mem_461; #line 2912 - __cil_tmp271 = 0 * 1U; + __cil_tmp271 = 0 * 1U; #line 2912 - __cil_tmp272 = 112 + __cil_tmp271; + __cil_tmp272 = 112 + __cil_tmp271; #line 2912 - __cil_tmp273 = (unsigned int )DisketteExtension; + __cil_tmp273 = (unsigned int)DisketteExtension; #line 2912 - __cil_tmp274 = __cil_tmp273 + __cil_tmp272; + __cil_tmp274 = __cil_tmp273 + __cil_tmp272; #line 2912 - __cil_tmp275 = (UCHAR *)__cil_tmp274; + __cil_tmp275 = (UCHAR *)__cil_tmp274; #line 2912 - __cil_tmp276 = 0 * 1U; + __cil_tmp276 = 0 * 1U; #line 2912 - __cil_tmp277 = 112 + __cil_tmp276; + __cil_tmp277 = 112 + __cil_tmp276; #line 2912 - __cil_tmp278 = (unsigned int )DisketteExtension; + __cil_tmp278 = (unsigned int)DisketteExtension; #line 2912 - __cil_tmp279 = __cil_tmp278 + __cil_tmp277; + __cil_tmp279 = __cil_tmp278 + __cil_tmp277; #line 2912 - __cil_tmp280 = (UCHAR *)__cil_tmp279; + __cil_tmp280 = (UCHAR *)__cil_tmp279; #line 2912 - __cil_tmp281 = (void *)0; + __cil_tmp281 = (void *)0; #line 2912 - __cil_tmp282 = (struct _MDL *)__cil_tmp281; + __cil_tmp282 = (struct _MDL *)__cil_tmp281; #line 2912 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp275, __cil_tmp280, - __cil_tmp282, 0UL, 0UL); - } - { + ntStatus = FlIssueCommand(DisketteExtension, + __cil_tmp275, __cil_tmp280, + __cil_tmp282, 0UL, 0UL); + } + { #line 2919 - __cil_tmp283 = ntStatus >= 0L; + __cil_tmp283 = ntStatus >= 0L; #line 2919 - if (! __cil_tmp283) { - { + if (!__cil_tmp283) { + { #line 2924 - while (1) { - while_82_continue: /* CIL Label */ ; - goto while_82_break; - } - while_82_break: /* CIL Label */ ; - } + while (1) { + while_82_continue: /* CIL Label */; + goto while_82_break; + } + while_82_break: /* CIL Label */; + } #line 2926 - return (ntStatus); - } else { - - } - } - { + return (ntStatus); + } else { + } + } + { #line 2929 - __cil_tmp284 = 0 * 1U; + __cil_tmp284 = 0 * 1U; #line 2929 - __cil_tmp285 = 112 + __cil_tmp284; + __cil_tmp285 = 112 + __cil_tmp284; #line 2929 - __cil_tmp286 = (unsigned int )DisketteExtension; + __cil_tmp286 = (unsigned int)DisketteExtension; #line 2929 - __cil_tmp287 = __cil_tmp286 + __cil_tmp285; + __cil_tmp287 = __cil_tmp286 + __cil_tmp285; #line 2929 - mem_462 = (UCHAR *)__cil_tmp287; + mem_462 = (UCHAR *)__cil_tmp287; #line 2929 - __cil_tmp288 = *mem_462; + __cil_tmp288 = *mem_462; #line 2929 - __cil_tmp289 = (int )__cil_tmp288; + __cil_tmp289 = (int)__cil_tmp288; #line 2929 - if (__cil_tmp289 & 32) { + if (__cil_tmp289 & 32) { #line 2931 - driveStatus = (unsigned char)127; - } else { + driveStatus = (unsigned char)127; + } else { #line 2935 - driveStatus = (unsigned char)128; - } - } - } else { - { + driveStatus = (unsigned char)128; + } + } + } else { + { #line 2939 - __cil_tmp290 = (unsigned int )DisketteExtension; + __cil_tmp290 = (unsigned int)DisketteExtension; #line 2939 - __cil_tmp291 = __cil_tmp290 + 8; + __cil_tmp291 = __cil_tmp290 + 8; #line 2939 - mem_463 = (PDEVICE_OBJECT *)__cil_tmp291; + mem_463 = (PDEVICE_OBJECT *)__cil_tmp291; #line 2939 - __cil_tmp292 = *mem_463; + __cil_tmp292 = *mem_463; #line 2939 - __cil_tmp293 = 776 << 2; + __cil_tmp293 = 776 << 2; #line 2939 - __cil_tmp294 = 7 << 16; + __cil_tmp294 = 7 << 16; #line 2939 - __cil_tmp295 = __cil_tmp294 | __cil_tmp293; + __cil_tmp295 = __cil_tmp294 | __cil_tmp293; #line 2939 - __cil_tmp296 = __cil_tmp295 | 3; + __cil_tmp296 = __cil_tmp295 | 3; #line 2939 - __cil_tmp297 = (unsigned long )__cil_tmp296; + __cil_tmp297 = (unsigned long)__cil_tmp296; #line 2939 - __cil_tmp298 = (void *)(& fdcDiskChangeParms); + __cil_tmp298 = (void *)(&fdcDiskChangeParms); #line 2939 - ntStatus = FlFdcDeviceIo(__cil_tmp292, __cil_tmp297, __cil_tmp298); + ntStatus = FlFdcDeviceIo(__cil_tmp292, __cil_tmp297, + __cil_tmp298); #line 2943 - __cil_tmp299 = & fdcDiskChangeParms; + __cil_tmp299 = &fdcDiskChangeParms; #line 2943 - mem_464 = (UCHAR *)__cil_tmp299; + mem_464 = (UCHAR *)__cil_tmp299; #line 2943 - driveStatus = *mem_464; - } - { + driveStatus = *mem_464; + } + { #line 2945 - __cil_tmp300 = ntStatus >= 0L; + __cil_tmp300 = ntStatus >= 0L; #line 2945 - if (! __cil_tmp300) { + if (!__cil_tmp300) { #line 2946 - return (ntStatus); - } else { - - } - } - } - } - { + return (ntStatus); + } else { + } + } + } + } + { #line 2950 - __cil_tmp301 = (int )driveStatus; + __cil_tmp301 = (int)driveStatus; #line 2950 - if (__cil_tmp301 & 128) { - { + if (__cil_tmp301 & 128) { + { #line 2960 - while (1) { - while_83_continue: /* CIL Label */ ; - goto while_83_break; - } - while_83_break: /* CIL Label */ ; - } - { + while (1) { + while_83_continue: /* CIL Label */; + goto while_83_break; + } + while_83_break: /* CIL Label */; + } + { #line 2967 - __cil_tmp302 = (unsigned int )DisketteExtension; + __cil_tmp302 = (unsigned int)DisketteExtension; #line 2967 - __cil_tmp303 = __cil_tmp302 + 28; + __cil_tmp303 = __cil_tmp302 + 28; #line 2967 - mem_465 = (PDEVICE_OBJECT *)__cil_tmp303; + mem_465 = (PDEVICE_OBJECT *)__cil_tmp303; #line 2967 - __cil_tmp304 = *mem_465; + __cil_tmp304 = *mem_465; #line 2967 - __cil_tmp305 = (unsigned int )__cil_tmp304; + __cil_tmp305 = (unsigned int)__cil_tmp304; #line 2967 - __cil_tmp306 = __cil_tmp305 + 36; + __cil_tmp306 = __cil_tmp305 + 36; #line 2967 - mem_466 = (PVPB *)__cil_tmp306; + mem_466 = (PVPB *)__cil_tmp306; #line 2967 - __cil_tmp307 = *mem_466; + __cil_tmp307 = *mem_466; #line 2967 - __cil_tmp308 = (unsigned int )__cil_tmp307; + __cil_tmp308 = (unsigned int)__cil_tmp307; #line 2967 - __cil_tmp309 = __cil_tmp308 + 4; + __cil_tmp309 = __cil_tmp308 + 4; #line 2967 - mem_467 = (USHORT *)__cil_tmp309; + mem_467 = (USHORT *)__cil_tmp309; #line 2967 - __cil_tmp310 = *mem_467; + __cil_tmp310 = *mem_467; #line 2967 - __cil_tmp311 = (int )__cil_tmp310; + __cil_tmp311 = (int)__cil_tmp310; #line 2967 - if (__cil_tmp311 & 1) { + if (__cil_tmp311 & 1) { #line 2969 - __cil_tmp312 = (unsigned int )DisketteExtension; + __cil_tmp312 = (unsigned int)DisketteExtension; #line 2969 - __cil_tmp313 = __cil_tmp312 + 28; + __cil_tmp313 = __cil_tmp312 + 28; #line 2969 - mem_468 = (PDEVICE_OBJECT *)__cil_tmp313; + mem_468 = (PDEVICE_OBJECT *)__cil_tmp313; #line 2969 - __cil_tmp314 = *mem_468; + __cil_tmp314 = *mem_468; #line 2969 - __cil_tmp315 = (unsigned int )__cil_tmp314; + __cil_tmp315 = (unsigned int)__cil_tmp314; #line 2969 - __cil_tmp316 = __cil_tmp315 + 28; + __cil_tmp316 = __cil_tmp315 + 28; #line 2969 - __cil_tmp317 = (unsigned int )DisketteExtension; + __cil_tmp317 = (unsigned int)DisketteExtension; #line 2969 - __cil_tmp318 = __cil_tmp317 + 28; + __cil_tmp318 = __cil_tmp317 + 28; #line 2969 - mem_469 = (PDEVICE_OBJECT *)__cil_tmp318; + mem_469 = (PDEVICE_OBJECT *)__cil_tmp318; #line 2969 - __cil_tmp319 = *mem_469; + __cil_tmp319 = *mem_469; #line 2969 - __cil_tmp320 = (unsigned int )__cil_tmp319; + __cil_tmp320 = (unsigned int)__cil_tmp319; #line 2969 - __cil_tmp321 = __cil_tmp320 + 28; + __cil_tmp321 = __cil_tmp320 + 28; #line 2969 - mem_470 = (ULONG *)__cil_tmp321; + mem_470 = (ULONG *)__cil_tmp321; #line 2969 - __cil_tmp322 = *mem_470; + __cil_tmp322 = *mem_470; #line 2969 - mem_471 = (ULONG *)__cil_tmp316; + mem_471 = (ULONG *)__cil_tmp316; #line 2969 - *mem_471 = __cil_tmp322 & 4294967293UL; - } else { - - } - } + *mem_471 = __cil_tmp322 & 4294967293UL; + } else { + } + } #line 2973 - return (-1073741805L); - } else { - - } - } - } else { - - } - } - { + return (-1073741805L); + } else { + } + } + } else { + } + } + { #line 2982 - __cil_tmp323 = (int )IgnoreChange; + __cil_tmp323 = (int)IgnoreChange; #line 2982 - if (__cil_tmp323 == 0) { - { + if (__cil_tmp323 == 0) { + { #line 2984 - __cil_tmp324 = (unsigned int )DisketteExtension; + __cil_tmp324 = (unsigned int)DisketteExtension; #line 2984 - __cil_tmp325 = __cil_tmp324 + 28; + __cil_tmp325 = __cil_tmp324 + 28; #line 2984 - mem_472 = (PDEVICE_OBJECT *)__cil_tmp325; + mem_472 = (PDEVICE_OBJECT *)__cil_tmp325; #line 2984 - __cil_tmp326 = *mem_472; + __cil_tmp326 = *mem_472; #line 2984 - __cil_tmp327 = (unsigned int )__cil_tmp326; + __cil_tmp327 = (unsigned int)__cil_tmp326; #line 2984 - __cil_tmp328 = __cil_tmp327 + 36; + __cil_tmp328 = __cil_tmp327 + 36; #line 2984 - mem_473 = (PVPB *)__cil_tmp328; + mem_473 = (PVPB *)__cil_tmp328; #line 2984 - __cil_tmp329 = *mem_473; + __cil_tmp329 = *mem_473; #line 2984 - __cil_tmp330 = (unsigned int )__cil_tmp329; + __cil_tmp330 = (unsigned int)__cil_tmp329; #line 2984 - __cil_tmp331 = __cil_tmp330 + 4; + __cil_tmp331 = __cil_tmp330 + 4; #line 2984 - mem_474 = (USHORT *)__cil_tmp331; + mem_474 = (USHORT *)__cil_tmp331; #line 2984 - __cil_tmp332 = *mem_474; + __cil_tmp332 = *mem_474; #line 2984 - __cil_tmp333 = (int )__cil_tmp332; + __cil_tmp333 = (int)__cil_tmp332; #line 2984 - if (__cil_tmp333 & 1) { - { + if (__cil_tmp333 & 1) { + { #line 2994 - while (1) { - while_84_continue: /* CIL Label */ ; - goto while_84_break; - } - while_84_break: /* CIL Label */ ; - } + while (1) { + while_84_continue: /* CIL Label */; + goto while_84_break; + } + while_84_break: /* CIL Label */; + } #line 2996 - return (-2147483626L); - } else { + return (-2147483626L); + } else { #line 3000 - return (-1073741435L); - } + return (-1073741435L); + } + } + } else { + } + } + } else { + goto _L___2; + } } } else { - - } - } - } else { - goto _L___2; - } - } - } else { - _L___2: - { + _L___2 : { #line 3004 - __cil_tmp334 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp334 = (KUSER_SHARED_DATA * const)4292804608U; #line 3004 - __cil_tmp335 = (unsigned int )__cil_tmp334; + __cil_tmp335 = (unsigned int)__cil_tmp334; #line 3004 - __cil_tmp336 = __cil_tmp335 + 732; + __cil_tmp336 = __cil_tmp335 + 732; #line 3004 - mem_475 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp336; + mem_475 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp336; #line 3004 - __cil_tmp337 = *mem_475; + __cil_tmp337 = *mem_475; #line 3004 - __cil_tmp338 = (int )__cil_tmp337; + __cil_tmp338 = (int)__cil_tmp337; #line 3004 - if (__cil_tmp338 == 1) { - { + if (__cil_tmp338 == 1) { + { #line 3006 - FlHdbit(DisketteExtension); + FlHdbit(DisketteExtension); + } + } else { + } + } } - } else { - } } } - } - } - } #line 3011 - if (SetUpMedia) { - { + if (SetUpMedia) { + { #line 3013 - __cil_tmp339 = (unsigned int )DisketteExtension; + __cil_tmp339 = (unsigned int)DisketteExtension; #line 3013 - __cil_tmp340 = __cil_tmp339 + 184; + __cil_tmp340 = __cil_tmp339 + 184; #line 3013 - mem_476 = (MEDIA_TYPE *)__cil_tmp340; + mem_476 = (MEDIA_TYPE *)__cil_tmp340; #line 3013 - __cil_tmp341 = *mem_476; + __cil_tmp341 = *mem_476; #line 3013 - __cil_tmp342 = (int )__cil_tmp341; + __cil_tmp342 = (int)__cil_tmp341; #line 3013 - if (__cil_tmp342 == -1) { - { + if (__cil_tmp342 == -1) { + { #line 3015 - ntStatus = FlDetermineMediaType(DisketteExtension); - } - } else { - { + ntStatus = FlDetermineMediaType(DisketteExtension); + } + } else { + { #line 3019 - __cil_tmp343 = (unsigned int )DisketteExtension; + __cil_tmp343 = (unsigned int)DisketteExtension; #line 3019 - __cil_tmp344 = __cil_tmp343 + 184; + __cil_tmp344 = __cil_tmp343 + 184; #line 3019 - mem_477 = (MEDIA_TYPE *)__cil_tmp344; + mem_477 = (MEDIA_TYPE *)__cil_tmp344; #line 3019 - __cil_tmp345 = *mem_477; + __cil_tmp345 = *mem_477; #line 3019 - __cil_tmp346 = (int )__cil_tmp345; + __cil_tmp346 = (int)__cil_tmp345; #line 3019 - if (__cil_tmp346 == 0) { - { + if (__cil_tmp346 == 0) { + { #line 3029 - while (1) { - while_85_continue: /* CIL Label */ ; - goto while_85_break; - } - while_85_break: /* CIL Label */ ; - } + while (1) { + while_85_continue: /* CIL Label */; + goto while_85_break; + } + while_85_break: /* CIL Label */; + } #line 3030 - return (-1073741804L); - } else { - { + return (-1073741804L); + } else { + { #line 3034 - __cil_tmp347 = (unsigned int )DisketteExtension; + __cil_tmp347 = (unsigned int)DisketteExtension; #line 3034 - __cil_tmp348 = __cil_tmp347 + 140; + __cil_tmp348 = __cil_tmp347 + 140; #line 3034 - mem_478 = (DRIVE_MEDIA_TYPE *)__cil_tmp348; + mem_478 = (DRIVE_MEDIA_TYPE *)__cil_tmp348; #line 3034 - __cil_tmp349 = *mem_478; + __cil_tmp349 = *mem_478; #line 3034 - __cil_tmp350 = (int )__cil_tmp349; + __cil_tmp350 = (int)__cil_tmp349; #line 3034 - __cil_tmp351 = (unsigned int )DisketteExtension; + __cil_tmp351 = (unsigned int)DisketteExtension; #line 3034 - __cil_tmp352 = __cil_tmp351 + 216; + __cil_tmp352 = __cil_tmp351 + 216; #line 3034 - mem_479 = (DRIVE_MEDIA_TYPE *)__cil_tmp352; + mem_479 = (DRIVE_MEDIA_TYPE *)__cil_tmp352; #line 3034 - __cil_tmp353 = *mem_479; + __cil_tmp353 = *mem_479; #line 3034 - __cil_tmp354 = (int )__cil_tmp353; + __cil_tmp354 = (int)__cil_tmp353; #line 3034 - if (__cil_tmp354 != __cil_tmp350) { - { + if (__cil_tmp354 != __cil_tmp350) { + { #line 3042 - ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); - } - { + ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); + } + { #line 3043 - __cil_tmp355 = ntStatus >= 0L; + __cil_tmp355 = ntStatus >= 0L; #line 3043 - if (! __cil_tmp355) { - { + if (!__cil_tmp355) { + { #line 3050 - while (1) { - while_86_continue: /* CIL Label */ ; - goto while_86_break; - } - while_86_break: /* CIL Label */ ; + while (1) { + while_86_continue: /* CIL Label */; + goto while_86_break; + } + while_86_break: /* CIL Label */; + } + } else { + } + } + } else { + } + } } - } else { - } - } - } else { - - } } } - } - } + } else { } - } else { - - } #line 3063 - if (WriteOperation) { + if (WriteOperation) { #line 3063 - if (ntStatus >= 0L) { - { + if (ntStatus >= 0L) { + { #line 3065 - __cil_tmp356 = 0 * 1U; + __cil_tmp356 = 0 * 1U; #line 3065 - __cil_tmp357 = 112 + __cil_tmp356; + __cil_tmp357 = 112 + __cil_tmp356; #line 3065 - __cil_tmp358 = (unsigned int )DisketteExtension; + __cil_tmp358 = (unsigned int)DisketteExtension; #line 3065 - __cil_tmp359 = __cil_tmp358 + __cil_tmp357; + __cil_tmp359 = __cil_tmp358 + __cil_tmp357; #line 3065 - mem_480 = (UCHAR *)__cil_tmp359; + mem_480 = (UCHAR *)__cil_tmp359; #line 3065 - *mem_480 = (unsigned char)14; + *mem_480 = (unsigned char)14; #line 3066 - __cil_tmp360 = 1 * 1U; + __cil_tmp360 = 1 * 1U; #line 3066 - __cil_tmp361 = 112 + __cil_tmp360; + __cil_tmp361 = 112 + __cil_tmp360; #line 3066 - __cil_tmp362 = (unsigned int )DisketteExtension; + __cil_tmp362 = (unsigned int)DisketteExtension; #line 3066 - __cil_tmp363 = __cil_tmp362 + __cil_tmp361; + __cil_tmp363 = __cil_tmp362 + __cil_tmp361; #line 3066 - __cil_tmp364 = (unsigned int )DisketteExtension; + __cil_tmp364 = (unsigned int)DisketteExtension; #line 3066 - __cil_tmp365 = __cil_tmp364 + 248; + __cil_tmp365 = __cil_tmp364 + 248; #line 3066 - mem_481 = (UCHAR *)__cil_tmp363; + mem_481 = (UCHAR *)__cil_tmp363; #line 3066 - mem_482 = (UCHAR *)__cil_tmp365; + mem_482 = (UCHAR *)__cil_tmp365; #line 3066 - *mem_481 = *mem_482; + *mem_481 = *mem_482; #line 3068 - __cil_tmp366 = 0 * 1U; + __cil_tmp366 = 0 * 1U; #line 3068 - __cil_tmp367 = 112 + __cil_tmp366; + __cil_tmp367 = 112 + __cil_tmp366; #line 3068 - __cil_tmp368 = (unsigned int )DisketteExtension; + __cil_tmp368 = (unsigned int)DisketteExtension; #line 3068 - __cil_tmp369 = __cil_tmp368 + __cil_tmp367; + __cil_tmp369 = __cil_tmp368 + __cil_tmp367; #line 3068 - __cil_tmp370 = (UCHAR *)__cil_tmp369; + __cil_tmp370 = (UCHAR *)__cil_tmp369; #line 3068 - __cil_tmp371 = 0 * 1U; + __cil_tmp371 = 0 * 1U; #line 3068 - __cil_tmp372 = 112 + __cil_tmp371; + __cil_tmp372 = 112 + __cil_tmp371; #line 3068 - __cil_tmp373 = (unsigned int )DisketteExtension; + __cil_tmp373 = (unsigned int)DisketteExtension; #line 3068 - __cil_tmp374 = __cil_tmp373 + __cil_tmp372; + __cil_tmp374 = __cil_tmp373 + __cil_tmp372; #line 3068 - __cil_tmp375 = (UCHAR *)__cil_tmp374; + __cil_tmp375 = (UCHAR *)__cil_tmp374; #line 3068 - __cil_tmp376 = (void *)0; + __cil_tmp376 = (void *)0; #line 3068 - __cil_tmp377 = (struct _MDL *)__cil_tmp376; + __cil_tmp377 = (struct _MDL *)__cil_tmp376; #line 3068 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp370, __cil_tmp375, __cil_tmp377, - 0UL, 0UL); - } - { + ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp370, + __cil_tmp375, __cil_tmp377, 0UL, 0UL); + } + { #line 3075 - __cil_tmp378 = ntStatus >= 0L; + __cil_tmp378 = ntStatus >= 0L; #line 3075 - if (! __cil_tmp378) { - { + if (!__cil_tmp378) { + { #line 3080 - while (1) { - while_87_continue: /* CIL Label */ ; - goto while_87_break; - } - while_87_break: /* CIL Label */ ; - } + while (1) { + while_87_continue: /* CIL Label */; + goto while_87_break; + } + while_87_break: /* CIL Label */; + } #line 3082 - return (ntStatus); - } else { - - } - } - { + return (ntStatus); + } else { + } + } + { #line 3085 - __cil_tmp379 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp379 = (KUSER_SHARED_DATA * const)4292804608U; #line 3085 - __cil_tmp380 = (unsigned int )__cil_tmp379; + __cil_tmp380 = (unsigned int)__cil_tmp379; #line 3085 - __cil_tmp381 = __cil_tmp380 + 732; + __cil_tmp381 = __cil_tmp380 + 732; #line 3085 - mem_483 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp381; + mem_483 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp381; #line 3085 - __cil_tmp382 = *mem_483; + __cil_tmp382 = *mem_483; #line 3085 - __cil_tmp383 = (int )__cil_tmp382; + __cil_tmp383 = (int)__cil_tmp382; #line 3085 - if (__cil_tmp383 == 1) { - { + if (__cil_tmp383 == 1) { + { #line 3089 - __cil_tmp384 = 0 * 1U; + __cil_tmp384 = 0 * 1U; #line 3089 - __cil_tmp385 = 112 + __cil_tmp384; + __cil_tmp385 = 112 + __cil_tmp384; #line 3089 - __cil_tmp386 = (unsigned int )DisketteExtension; + __cil_tmp386 = (unsigned int)DisketteExtension; #line 3089 - __cil_tmp387 = __cil_tmp386 + __cil_tmp385; + __cil_tmp387 = __cil_tmp386 + __cil_tmp385; #line 3089 - mem_484 = (UCHAR *)__cil_tmp387; + mem_484 = (UCHAR *)__cil_tmp387; #line 3089 - __cil_tmp388 = *mem_484; + __cil_tmp388 = *mem_484; #line 3089 - __cil_tmp389 = (int )__cil_tmp388; + __cil_tmp389 = (int)__cil_tmp388; #line 3089 - __cil_tmp390 = __cil_tmp389 & 32; + __cil_tmp390 = __cil_tmp389 & 32; #line 3089 - if (! __cil_tmp390) { - { + if (!__cil_tmp390) { + { #line 3094 - while (1) { - while_88_continue: /* CIL Label */ ; - goto while_88_break; - } - while_88_break: /* CIL Label */ ; - } + while (1) { + while_88_continue: /* CIL Label */; + goto while_88_break; + } + while_88_break: /* CIL Label */; + } #line 3095 - return (-1073741805L); - } else { - - } + return (-1073741805L); + } else { + } + } + } else { + } } - } else { - - } - } - { + { #line 3099 - __cil_tmp391 = 0 * 1U; + __cil_tmp391 = 0 * 1U; #line 3099 - __cil_tmp392 = 112 + __cil_tmp391; + __cil_tmp392 = 112 + __cil_tmp391; #line 3099 - __cil_tmp393 = (unsigned int )DisketteExtension; + __cil_tmp393 = (unsigned int)DisketteExtension; #line 3099 - __cil_tmp394 = __cil_tmp393 + __cil_tmp392; + __cil_tmp394 = __cil_tmp393 + __cil_tmp392; #line 3099 - mem_485 = (UCHAR *)__cil_tmp394; + mem_485 = (UCHAR *)__cil_tmp394; #line 3099 - __cil_tmp395 = *mem_485; + __cil_tmp395 = *mem_485; #line 3099 - __cil_tmp396 = (int )__cil_tmp395; + __cil_tmp396 = (int)__cil_tmp395; #line 3099 - if (__cil_tmp396 & 64) { - { + if (__cil_tmp396 & 64) { + { #line 3104 - while (1) { - while_89_continue: /* CIL Label */ ; - goto while_89_break; - } - while_89_break: /* CIL Label */ ; - } + while (1) { + while_89_continue: /* CIL Label */; + goto while_89_break; + } + while_89_break: /* CIL Label */; + } #line 3105 - return (-1073741662L); + return (-1073741662L); + } else { + } + } } else { - - } } } else { - } - } else { - - } #line 3109 - return (ntStatus); -} + return (ntStatus); + } } #line 3112 "floppy.c" -NTSTATUS FlDatarateSpecifyConfigure(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - unsigned int __cil_tmp3 ; - unsigned int __cil_tmp4 ; - unsigned int __cil_tmp5 ; - unsigned int __cil_tmp6 ; - unsigned int __cil_tmp7 ; - unsigned int __cil_tmp8 ; - unsigned int __cil_tmp9 ; - unsigned int __cil_tmp10 ; - unsigned int __cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - unsigned int __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - UCHAR __cil_tmp25 ; - int __cil_tmp26 ; - int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - unsigned int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - UCHAR __cil_tmp31 ; - unsigned int __cil_tmp32 ; - unsigned int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - unsigned int __cil_tmp39 ; - UCHAR __cil_tmp40 ; - int __cil_tmp41 ; - int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - unsigned int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - UCHAR *__cil_tmp51 ; - unsigned int __cil_tmp52 ; - unsigned int __cil_tmp53 ; - unsigned int __cil_tmp54 ; - unsigned int __cil_tmp55 ; - UCHAR *__cil_tmp56 ; - void *__cil_tmp57 ; - struct _MDL *__cil_tmp58 ; - unsigned int __cil_tmp59 ; - unsigned int __cil_tmp60 ; - unsigned int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - unsigned int __cil_tmp63 ; - unsigned int __cil_tmp64 ; - unsigned int __cil_tmp65 ; - unsigned int __cil_tmp66 ; - unsigned int __cil_tmp67 ; - unsigned int __cil_tmp68 ; - unsigned int __cil_tmp69 ; - unsigned int __cil_tmp70 ; - unsigned int __cil_tmp71 ; - unsigned int __cil_tmp72 ; - unsigned int __cil_tmp73 ; - unsigned int __cil_tmp74 ; - unsigned int __cil_tmp75 ; - unsigned int __cil_tmp76 ; - unsigned int __cil_tmp77 ; - unsigned int __cil_tmp78 ; - unsigned int __cil_tmp79 ; - unsigned int __cil_tmp80 ; - unsigned int __cil_tmp81 ; - unsigned int __cil_tmp82 ; - UCHAR *__cil_tmp83 ; - unsigned int __cil_tmp84 ; - unsigned int __cil_tmp85 ; - unsigned int __cil_tmp86 ; - unsigned int __cil_tmp87 ; - UCHAR *__cil_tmp88 ; - void *__cil_tmp89 ; - struct _MDL *__cil_tmp90 ; - unsigned int __cil_tmp91 ; - unsigned int __cil_tmp92 ; - PDEVICE_OBJECT __cil_tmp93 ; - int __cil_tmp94 ; - int __cil_tmp95 ; - int __cil_tmp96 ; - int __cil_tmp97 ; - unsigned long __cil_tmp98 ; - unsigned int __cil_tmp99 ; - unsigned int __cil_tmp100 ; - unsigned int __cil_tmp101 ; - UCHAR *__cil_tmp102 ; - void *__cil_tmp103 ; - unsigned int __cil_tmp104 ; - unsigned int __cil_tmp105 ; - unsigned int __cil_tmp106 ; - unsigned int __cil_tmp107 ; - unsigned int __cil_tmp108 ; - unsigned int __cil_tmp109 ; - BOOLEAN *mem_110 ; - UCHAR *mem_111 ; - UCHAR *mem_112 ; - UCHAR *mem_113 ; - UCHAR *mem_114 ; - UCHAR *mem_115 ; - UCHAR *mem_116 ; - UCHAR *mem_117 ; - UCHAR *mem_118 ; - UCHAR *mem_119 ; - BOOLEAN *mem_120 ; - UCHAR *mem_121 ; - UCHAR *mem_122 ; - UCHAR *mem_123 ; - UCHAR *mem_124 ; - UCHAR *mem_125 ; - PDEVICE_OBJECT *mem_126 ; - DRIVE_MEDIA_TYPE *mem_127 ; - DRIVE_MEDIA_TYPE *mem_128 ; - DRIVE_MEDIA_TYPE *mem_129 ; +NTSTATUS FlDatarateSpecifyConfigure(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + unsigned int __cil_tmp3; + unsigned int __cil_tmp4; + unsigned int __cil_tmp5; + unsigned int __cil_tmp6; + unsigned int __cil_tmp7; + unsigned int __cil_tmp8; + unsigned int __cil_tmp9; + unsigned int __cil_tmp10; + unsigned int __cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + unsigned int __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + UCHAR __cil_tmp25; + int __cil_tmp26; + int __cil_tmp27; + unsigned int __cil_tmp28; + unsigned int __cil_tmp29; + unsigned int __cil_tmp30; + UCHAR __cil_tmp31; + unsigned int __cil_tmp32; + unsigned int __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + unsigned int __cil_tmp39; + UCHAR __cil_tmp40; + int __cil_tmp41; + int __cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + unsigned int __cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + UCHAR *__cil_tmp51; + unsigned int __cil_tmp52; + unsigned int __cil_tmp53; + unsigned int __cil_tmp54; + unsigned int __cil_tmp55; + UCHAR *__cil_tmp56; + void *__cil_tmp57; + struct _MDL *__cil_tmp58; + unsigned int __cil_tmp59; + unsigned int __cil_tmp60; + unsigned int __cil_tmp61; + unsigned int __cil_tmp62; + unsigned int __cil_tmp63; + unsigned int __cil_tmp64; + unsigned int __cil_tmp65; + unsigned int __cil_tmp66; + unsigned int __cil_tmp67; + unsigned int __cil_tmp68; + unsigned int __cil_tmp69; + unsigned int __cil_tmp70; + unsigned int __cil_tmp71; + unsigned int __cil_tmp72; + unsigned int __cil_tmp73; + unsigned int __cil_tmp74; + unsigned int __cil_tmp75; + unsigned int __cil_tmp76; + unsigned int __cil_tmp77; + unsigned int __cil_tmp78; + unsigned int __cil_tmp79; + unsigned int __cil_tmp80; + unsigned int __cil_tmp81; + unsigned int __cil_tmp82; + UCHAR *__cil_tmp83; + unsigned int __cil_tmp84; + unsigned int __cil_tmp85; + unsigned int __cil_tmp86; + unsigned int __cil_tmp87; + UCHAR *__cil_tmp88; + void *__cil_tmp89; + struct _MDL *__cil_tmp90; + unsigned int __cil_tmp91; + unsigned int __cil_tmp92; + PDEVICE_OBJECT __cil_tmp93; + int __cil_tmp94; + int __cil_tmp95; + int __cil_tmp96; + int __cil_tmp97; + unsigned long __cil_tmp98; + unsigned int __cil_tmp99; + unsigned int __cil_tmp100; + unsigned int __cil_tmp101; + UCHAR *__cil_tmp102; + void *__cil_tmp103; + unsigned int __cil_tmp104; + unsigned int __cil_tmp105; + unsigned int __cil_tmp106; + unsigned int __cil_tmp107; + unsigned int __cil_tmp108; + unsigned int __cil_tmp109; + BOOLEAN *mem_110; + UCHAR *mem_111; + UCHAR *mem_112; + UCHAR *mem_113; + UCHAR *mem_114; + UCHAR *mem_115; + UCHAR *mem_116; + UCHAR *mem_117; + UCHAR *mem_118; + UCHAR *mem_119; + BOOLEAN *mem_120; + UCHAR *mem_121; + UCHAR *mem_122; + UCHAR *mem_123; + UCHAR *mem_124; + UCHAR *mem_125; + PDEVICE_OBJECT *mem_126; + DRIVE_MEDIA_TYPE *mem_127; + DRIVE_MEDIA_TYPE *mem_128; + DRIVE_MEDIA_TYPE *mem_129; { #line 3142 - ntStatus = 0L; - { + ntStatus = 0L; + { #line 3148 - __cil_tmp3 = (unsigned int )DisketteExtension; + __cil_tmp3 = (unsigned int)DisketteExtension; #line 3148 - __cil_tmp4 = __cil_tmp3 + 365; - { + __cil_tmp4 = __cil_tmp3 + 365; + { #line 3148 - mem_110 = (BOOLEAN *)__cil_tmp4; + mem_110 = (BOOLEAN *)__cil_tmp4; #line 3148 - if (*mem_110) { + if (*mem_110) { #line 3150 - __cil_tmp5 = 0 * 1U; + __cil_tmp5 = 0 * 1U; #line 3150 - __cil_tmp6 = 112 + __cil_tmp5; + __cil_tmp6 = 112 + __cil_tmp5; #line 3150 - __cil_tmp7 = (unsigned int )DisketteExtension; + __cil_tmp7 = (unsigned int)DisketteExtension; #line 3150 - __cil_tmp8 = __cil_tmp7 + __cil_tmp6; + __cil_tmp8 = __cil_tmp7 + __cil_tmp6; #line 3150 - mem_111 = (UCHAR *)__cil_tmp8; + mem_111 = (UCHAR *)__cil_tmp8; #line 3150 - *mem_111 = (unsigned char)17; + *mem_111 = (unsigned char)17; #line 3151 - __cil_tmp9 = 1 * 1U; + __cil_tmp9 = 1 * 1U; #line 3151 - __cil_tmp10 = 112 + __cil_tmp9; + __cil_tmp10 = 112 + __cil_tmp9; #line 3151 - __cil_tmp11 = (unsigned int )DisketteExtension; + __cil_tmp11 = (unsigned int)DisketteExtension; #line 3151 - __cil_tmp12 = __cil_tmp11 + __cil_tmp10; + __cil_tmp12 = __cil_tmp11 + __cil_tmp10; #line 3151 - mem_112 = (UCHAR *)__cil_tmp12; + mem_112 = (UCHAR *)__cil_tmp12; #line 3151 - *mem_112 = (unsigned char)0; + *mem_112 = (unsigned char)0; #line 3153 - __cil_tmp13 = 2 * 1U; + __cil_tmp13 = 2 * 1U; #line 3153 - __cil_tmp14 = 112 + __cil_tmp13; + __cil_tmp14 = 112 + __cil_tmp13; #line 3153 - __cil_tmp15 = (unsigned int )DisketteExtension; + __cil_tmp15 = (unsigned int)DisketteExtension; #line 3153 - __cil_tmp16 = __cil_tmp15 + __cil_tmp14; + __cil_tmp16 = __cil_tmp15 + __cil_tmp14; #line 3153 - mem_113 = (UCHAR *)__cil_tmp16; + mem_113 = (UCHAR *)__cil_tmp16; #line 3153 - *mem_113 = (unsigned char)15; + *mem_113 = (unsigned char)15; #line 3154 - __cil_tmp17 = 2 * 1U; + __cil_tmp17 = 2 * 1U; #line 3154 - __cil_tmp18 = 112 + __cil_tmp17; + __cil_tmp18 = 112 + __cil_tmp17; #line 3154 - __cil_tmp19 = (unsigned int )DisketteExtension; + __cil_tmp19 = (unsigned int)DisketteExtension; #line 3154 - __cil_tmp20 = __cil_tmp19 + __cil_tmp18; + __cil_tmp20 = __cil_tmp19 + __cil_tmp18; #line 3154 - __cil_tmp21 = 2 * 1U; + __cil_tmp21 = 2 * 1U; #line 3154 - __cil_tmp22 = 112 + __cil_tmp21; + __cil_tmp22 = 112 + __cil_tmp21; #line 3154 - __cil_tmp23 = (unsigned int )DisketteExtension; + __cil_tmp23 = (unsigned int)DisketteExtension; #line 3154 - __cil_tmp24 = __cil_tmp23 + __cil_tmp22; + __cil_tmp24 = __cil_tmp23 + __cil_tmp22; #line 3154 - mem_114 = (UCHAR *)__cil_tmp24; + mem_114 = (UCHAR *)__cil_tmp24; #line 3154 - __cil_tmp25 = *mem_114; + __cil_tmp25 = *mem_114; #line 3154 - __cil_tmp26 = (int )__cil_tmp25; + __cil_tmp26 = (int)__cil_tmp25; #line 3154 - __cil_tmp27 = __cil_tmp26 + 16; + __cil_tmp27 = __cil_tmp26 + 16; #line 3154 - mem_115 = (UCHAR *)__cil_tmp20; + mem_115 = (UCHAR *)__cil_tmp20; #line 3154 - *mem_115 = (unsigned char )__cil_tmp27; - { + *mem_115 = (unsigned char)__cil_tmp27; + { #line 3156 - __cil_tmp28 = 308 + 49; + __cil_tmp28 = 308 + 49; #line 3156 - __cil_tmp29 = (unsigned int )DisketteExtension; + __cil_tmp29 = (unsigned int)DisketteExtension; #line 3156 - __cil_tmp30 = __cil_tmp29 + __cil_tmp28; + __cil_tmp30 = __cil_tmp29 + __cil_tmp28; #line 3156 - mem_116 = (UCHAR *)__cil_tmp30; + mem_116 = (UCHAR *)__cil_tmp30; #line 3156 - __cil_tmp31 = *mem_116; + __cil_tmp31 = *mem_116; #line 3156 - if (! __cil_tmp31) { + if (!__cil_tmp31) { #line 3157 - __cil_tmp32 = 2 * 1U; + __cil_tmp32 = 2 * 1U; #line 3157 - __cil_tmp33 = 112 + __cil_tmp32; + __cil_tmp33 = 112 + __cil_tmp32; #line 3157 - __cil_tmp34 = (unsigned int )DisketteExtension; + __cil_tmp34 = (unsigned int)DisketteExtension; #line 3157 - __cil_tmp35 = __cil_tmp34 + __cil_tmp33; + __cil_tmp35 = __cil_tmp34 + __cil_tmp33; #line 3157 - __cil_tmp36 = 2 * 1U; + __cil_tmp36 = 2 * 1U; #line 3157 - __cil_tmp37 = 112 + __cil_tmp36; + __cil_tmp37 = 112 + __cil_tmp36; #line 3157 - __cil_tmp38 = (unsigned int )DisketteExtension; + __cil_tmp38 = (unsigned int)DisketteExtension; #line 3157 - __cil_tmp39 = __cil_tmp38 + __cil_tmp37; + __cil_tmp39 = __cil_tmp38 + __cil_tmp37; #line 3157 - mem_117 = (UCHAR *)__cil_tmp39; + mem_117 = (UCHAR *)__cil_tmp39; #line 3157 - __cil_tmp40 = *mem_117; + __cil_tmp40 = *mem_117; #line 3157 - __cil_tmp41 = (int )__cil_tmp40; + __cil_tmp41 = (int)__cil_tmp40; #line 3157 - __cil_tmp42 = __cil_tmp41 + 64; + __cil_tmp42 = __cil_tmp41 + 64; #line 3157 - mem_118 = (UCHAR *)__cil_tmp35; + mem_118 = (UCHAR *)__cil_tmp35; #line 3157 - *mem_118 = (unsigned char )__cil_tmp42; - } else { - - } - } - { + *mem_118 = (unsigned char)__cil_tmp42; + } else { + } + } + { #line 3160 - __cil_tmp43 = 3 * 1U; + __cil_tmp43 = 3 * 1U; #line 3160 - __cil_tmp44 = 112 + __cil_tmp43; + __cil_tmp44 = 112 + __cil_tmp43; #line 3160 - __cil_tmp45 = (unsigned int )DisketteExtension; + __cil_tmp45 = (unsigned int)DisketteExtension; #line 3160 - __cil_tmp46 = __cil_tmp45 + __cil_tmp44; + __cil_tmp46 = __cil_tmp45 + __cil_tmp44; #line 3160 - mem_119 = (UCHAR *)__cil_tmp46; + mem_119 = (UCHAR *)__cil_tmp46; #line 3160 - *mem_119 = (unsigned char)0; + *mem_119 = (unsigned char)0; #line 3162 - __cil_tmp47 = 0 * 1U; + __cil_tmp47 = 0 * 1U; #line 3162 - __cil_tmp48 = 112 + __cil_tmp47; + __cil_tmp48 = 112 + __cil_tmp47; #line 3162 - __cil_tmp49 = (unsigned int )DisketteExtension; + __cil_tmp49 = (unsigned int)DisketteExtension; #line 3162 - __cil_tmp50 = __cil_tmp49 + __cil_tmp48; + __cil_tmp50 = __cil_tmp49 + __cil_tmp48; #line 3162 - __cil_tmp51 = (UCHAR *)__cil_tmp50; + __cil_tmp51 = (UCHAR *)__cil_tmp50; #line 3162 - __cil_tmp52 = 0 * 1U; + __cil_tmp52 = 0 * 1U; #line 3162 - __cil_tmp53 = 112 + __cil_tmp52; + __cil_tmp53 = 112 + __cil_tmp52; #line 3162 - __cil_tmp54 = (unsigned int )DisketteExtension; + __cil_tmp54 = (unsigned int)DisketteExtension; #line 3162 - __cil_tmp55 = __cil_tmp54 + __cil_tmp53; + __cil_tmp55 = __cil_tmp54 + __cil_tmp53; #line 3162 - __cil_tmp56 = (UCHAR *)__cil_tmp55; + __cil_tmp56 = (UCHAR *)__cil_tmp55; #line 3162 - __cil_tmp57 = (void *)0; + __cil_tmp57 = (void *)0; #line 3162 - __cil_tmp58 = (struct _MDL *)__cil_tmp57; + __cil_tmp58 = (struct _MDL *)__cil_tmp57; #line 3162 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp51, __cil_tmp56, __cil_tmp58, - 0UL, 0UL); - } + ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp51, + __cil_tmp56, __cil_tmp58, 0UL, 0UL); + } #line 3169 - if (ntStatus == -1073741661L) { + if (ntStatus == -1073741661L) { #line 3171 - __cil_tmp59 = (unsigned int )DisketteExtension; + __cil_tmp59 = (unsigned int)DisketteExtension; #line 3171 - __cil_tmp60 = __cil_tmp59 + 365; + __cil_tmp60 = __cil_tmp59 + 365; #line 3171 - mem_120 = (BOOLEAN *)__cil_tmp60; + mem_120 = (BOOLEAN *)__cil_tmp60; #line 3171 - *mem_120 = (unsigned char)0; + *mem_120 = (unsigned char)0; #line 3172 - ntStatus = 0L; - } else { - + ntStatus = 0L; + } else { + } + } else { + } + } } - } else { - - } - } - } #line 3181 - if (ntStatus >= 0L) { - goto _L; - } else { + if (ntStatus >= 0L) { + goto _L; + } else { #line 3181 - if (ntStatus == -1073741661L) { - _L: - { + if (ntStatus == -1073741661L) { + _L : { #line 3184 - __cil_tmp61 = 0 * 1U; + __cil_tmp61 = 0 * 1U; #line 3184 - __cil_tmp62 = 112 + __cil_tmp61; + __cil_tmp62 = 112 + __cil_tmp61; #line 3184 - __cil_tmp63 = (unsigned int )DisketteExtension; + __cil_tmp63 = (unsigned int)DisketteExtension; #line 3184 - __cil_tmp64 = __cil_tmp63 + __cil_tmp62; + __cil_tmp64 = __cil_tmp63 + __cil_tmp62; #line 3184 - mem_121 = (UCHAR *)__cil_tmp64; + mem_121 = (UCHAR *)__cil_tmp64; #line 3184 - *mem_121 = (unsigned char)13; + *mem_121 = (unsigned char)13; #line 3185 - __cil_tmp65 = 1 * 1U; + __cil_tmp65 = 1 * 1U; #line 3185 - __cil_tmp66 = 112 + __cil_tmp65; + __cil_tmp66 = 112 + __cil_tmp65; #line 3185 - __cil_tmp67 = (unsigned int )DisketteExtension; + __cil_tmp67 = (unsigned int)DisketteExtension; #line 3185 - __cil_tmp68 = __cil_tmp67 + __cil_tmp66; + __cil_tmp68 = __cil_tmp67 + __cil_tmp66; #line 3185 - __cil_tmp69 = 308 + 32; + __cil_tmp69 = 308 + 32; #line 3185 - __cil_tmp70 = (unsigned int )DisketteExtension; + __cil_tmp70 = (unsigned int)DisketteExtension; #line 3185 - __cil_tmp71 = __cil_tmp70 + __cil_tmp69; + __cil_tmp71 = __cil_tmp70 + __cil_tmp69; #line 3185 - mem_122 = (UCHAR *)__cil_tmp68; + mem_122 = (UCHAR *)__cil_tmp68; #line 3185 - mem_123 = (UCHAR *)__cil_tmp71; + mem_123 = (UCHAR *)__cil_tmp71; #line 3185 - *mem_122 = *mem_123; + *mem_122 = *mem_123; #line 3188 - __cil_tmp72 = 2 * 1U; + __cil_tmp72 = 2 * 1U; #line 3188 - __cil_tmp73 = 112 + __cil_tmp72; + __cil_tmp73 = 112 + __cil_tmp72; #line 3188 - __cil_tmp74 = (unsigned int )DisketteExtension; + __cil_tmp74 = (unsigned int)DisketteExtension; #line 3188 - __cil_tmp75 = __cil_tmp74 + __cil_tmp73; + __cil_tmp75 = __cil_tmp74 + __cil_tmp73; #line 3188 - __cil_tmp76 = 308 + 33; + __cil_tmp76 = 308 + 33; #line 3188 - __cil_tmp77 = (unsigned int )DisketteExtension; + __cil_tmp77 = (unsigned int)DisketteExtension; #line 3188 - __cil_tmp78 = __cil_tmp77 + __cil_tmp76; + __cil_tmp78 = __cil_tmp77 + __cil_tmp76; #line 3188 - mem_124 = (UCHAR *)__cil_tmp75; + mem_124 = (UCHAR *)__cil_tmp75; #line 3188 - mem_125 = (UCHAR *)__cil_tmp78; + mem_125 = (UCHAR *)__cil_tmp78; #line 3188 - *mem_124 = *mem_125; + *mem_124 = *mem_125; #line 3191 - __cil_tmp79 = 0 * 1U; + __cil_tmp79 = 0 * 1U; #line 3191 - __cil_tmp80 = 112 + __cil_tmp79; + __cil_tmp80 = 112 + __cil_tmp79; #line 3191 - __cil_tmp81 = (unsigned int )DisketteExtension; + __cil_tmp81 = (unsigned int)DisketteExtension; #line 3191 - __cil_tmp82 = __cil_tmp81 + __cil_tmp80; + __cil_tmp82 = __cil_tmp81 + __cil_tmp80; #line 3191 - __cil_tmp83 = (UCHAR *)__cil_tmp82; + __cil_tmp83 = (UCHAR *)__cil_tmp82; #line 3191 - __cil_tmp84 = 0 * 1U; + __cil_tmp84 = 0 * 1U; #line 3191 - __cil_tmp85 = 112 + __cil_tmp84; + __cil_tmp85 = 112 + __cil_tmp84; #line 3191 - __cil_tmp86 = (unsigned int )DisketteExtension; + __cil_tmp86 = (unsigned int)DisketteExtension; #line 3191 - __cil_tmp87 = __cil_tmp86 + __cil_tmp85; + __cil_tmp87 = __cil_tmp86 + __cil_tmp85; #line 3191 - __cil_tmp88 = (UCHAR *)__cil_tmp87; + __cil_tmp88 = (UCHAR *)__cil_tmp87; #line 3191 - __cil_tmp89 = (void *)0; + __cil_tmp89 = (void *)0; #line 3191 - __cil_tmp90 = (struct _MDL *)__cil_tmp89; + __cil_tmp90 = (struct _MDL *)__cil_tmp89; #line 3191 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp83, __cil_tmp88, __cil_tmp90, - 0UL, 0UL); + ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp83, __cil_tmp88, + __cil_tmp90, 0UL, 0UL); } #line 3198 - if (ntStatus >= 0L) { - { + if (ntStatus >= 0L) { + { #line 3204 - __cil_tmp91 = (unsigned int )DisketteExtension; + __cil_tmp91 = (unsigned int)DisketteExtension; #line 3204 - __cil_tmp92 = __cil_tmp91 + 8; + __cil_tmp92 = __cil_tmp91 + 8; #line 3204 - mem_126 = (PDEVICE_OBJECT *)__cil_tmp92; + mem_126 = (PDEVICE_OBJECT *)__cil_tmp92; #line 3204 - __cil_tmp93 = *mem_126; + __cil_tmp93 = *mem_126; #line 3204 - __cil_tmp94 = 777 << 2; + __cil_tmp94 = 777 << 2; #line 3204 - __cil_tmp95 = 7 << 16; + __cil_tmp95 = 7 << 16; #line 3204 - __cil_tmp96 = __cil_tmp95 | __cil_tmp94; + __cil_tmp96 = __cil_tmp95 | __cil_tmp94; #line 3204 - __cil_tmp97 = __cil_tmp96 | 3; + __cil_tmp97 = __cil_tmp96 | 3; #line 3204 - __cil_tmp98 = (unsigned long )__cil_tmp97; + __cil_tmp98 = (unsigned long)__cil_tmp97; #line 3204 - __cil_tmp99 = 308 + 50; + __cil_tmp99 = 308 + 50; #line 3204 - __cil_tmp100 = (unsigned int )DisketteExtension; + __cil_tmp100 = (unsigned int)DisketteExtension; #line 3204 - __cil_tmp101 = __cil_tmp100 + __cil_tmp99; + __cil_tmp101 = __cil_tmp100 + __cil_tmp99; #line 3204 - __cil_tmp102 = (UCHAR *)__cil_tmp101; + __cil_tmp102 = (UCHAR *)__cil_tmp101; #line 3204 - __cil_tmp103 = (void *)__cil_tmp102; + __cil_tmp103 = (void *)__cil_tmp102; #line 3204 - ntStatus = FlFdcDeviceIo(__cil_tmp93, __cil_tmp98, __cil_tmp103); - } + ntStatus = FlFdcDeviceIo(__cil_tmp93, __cil_tmp98, __cil_tmp103); + } #line 3214 - if (ntStatus >= 0L) { - { + if (ntStatus >= 0L) { + { #line 3216 - ntStatus = FlRecalibrateDrive(DisketteExtension); + ntStatus = FlRecalibrateDrive(DisketteExtension); + } + } else { } } else { - + { +#line 3222 + while (1) { + while_90_continue: /* CIL Label */; + goto while_90_break; + } + while_90_break: /* CIL Label */; + } } } else { { -#line 3222 - while (1) { - while_90_continue: /* CIL Label */ ; - goto while_90_break; - } - while_90_break: /* CIL Label */ ; - } - } - } else { - { #line 3228 - while (1) { - while_91_continue: /* CIL Label */ ; - goto while_91_break; - } - while_91_break: /* CIL Label */ ; + while (1) { + while_91_continue: /* CIL Label */; + goto while_91_break; + } + while_91_break: /* CIL Label */; + } } } - } #line 3231 - if (ntStatus >= 0L) { + if (ntStatus >= 0L) { #line 3233 - __cil_tmp104 = (unsigned int )DisketteExtension; + __cil_tmp104 = (unsigned int)DisketteExtension; #line 3233 - __cil_tmp105 = __cil_tmp104 + 140; + __cil_tmp105 = __cil_tmp104 + 140; #line 3233 - __cil_tmp106 = (unsigned int )DisketteExtension; + __cil_tmp106 = (unsigned int)DisketteExtension; #line 3233 - __cil_tmp107 = __cil_tmp106 + 216; + __cil_tmp107 = __cil_tmp106 + 216; #line 3233 - mem_127 = (DRIVE_MEDIA_TYPE *)__cil_tmp105; + mem_127 = (DRIVE_MEDIA_TYPE *)__cil_tmp105; #line 3233 - mem_128 = (DRIVE_MEDIA_TYPE *)__cil_tmp107; + mem_128 = (DRIVE_MEDIA_TYPE *)__cil_tmp107; #line 3233 - *mem_127 = *mem_128; - } else { + *mem_127 = *mem_128; + } else { #line 3238 - __cil_tmp108 = (unsigned int )DisketteExtension; + __cil_tmp108 = (unsigned int)DisketteExtension; #line 3238 - __cil_tmp109 = __cil_tmp108 + 140; + __cil_tmp109 = __cil_tmp108 + 140; #line 3238 - mem_129 = (DRIVE_MEDIA_TYPE *)__cil_tmp109; + mem_129 = (DRIVE_MEDIA_TYPE *)__cil_tmp109; #line 3238 - *mem_129 = (enum _DRIVE_MEDIA_TYPE )0; - { + *mem_129 = (enum _DRIVE_MEDIA_TYPE)0; + { #line 3242 - while (1) { - while_92_continue: /* CIL Label */ ; - goto while_92_break; - } - while_92_break: /* CIL Label */ ; + while (1) { + while_92_continue: /* CIL Label */; + goto while_92_break; + } + while_92_break: /* CIL Label */; + } } - } #line 3245 - return (ntStatus); -} + return (ntStatus); + } } #line 3248 "floppy.c" -NTSTATUS FlRecalibrateDrive(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - UCHAR recalibrateCount ; - UCHAR fifoBuffer[2] ; - unsigned int __cil_tmp5 ; - unsigned int __cil_tmp6 ; - unsigned int __cil_tmp7 ; - unsigned int __cil_tmp8 ; - unsigned int __cil_tmp9 ; - unsigned int __cil_tmp10 ; - unsigned int __cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - unsigned int __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - UCHAR *__cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - UCHAR *__cil_tmp24 ; - void *__cil_tmp25 ; - struct _MDL *__cil_tmp26 ; - int __cil_tmp27 ; - KUSER_SHARED_DATA *__cil_tmp28 ; - unsigned int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp31 ; - int __cil_tmp32 ; - unsigned int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - unsigned int __cil_tmp39 ; - unsigned int __cil_tmp40 ; - unsigned int __cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - unsigned int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - unsigned int __cil_tmp51 ; - unsigned int __cil_tmp52 ; - unsigned int __cil_tmp53 ; - unsigned int __cil_tmp54 ; - unsigned int __cil_tmp55 ; - unsigned int __cil_tmp56 ; - unsigned int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - UCHAR *__cil_tmp59 ; - unsigned int __cil_tmp60 ; - unsigned int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - unsigned int __cil_tmp63 ; - UCHAR *__cil_tmp64 ; - void *__cil_tmp65 ; - struct _MDL *__cil_tmp66 ; - int __cil_tmp67 ; - unsigned int __cil_tmp68 ; - unsigned int __cil_tmp69 ; - unsigned int __cil_tmp70 ; - unsigned int __cil_tmp71 ; - unsigned int __cil_tmp72 ; - unsigned int __cil_tmp73 ; - unsigned int __cil_tmp74 ; - unsigned int __cil_tmp75 ; - unsigned int __cil_tmp76 ; - unsigned int __cil_tmp77 ; - unsigned int __cil_tmp78 ; - unsigned int __cil_tmp79 ; - unsigned int __cil_tmp80 ; - unsigned int __cil_tmp81 ; - unsigned int __cil_tmp82 ; - unsigned int __cil_tmp83 ; - UCHAR __cil_tmp84 ; - int __cil_tmp85 ; - int __cil_tmp86 ; - unsigned int __cil_tmp87 ; - unsigned int __cil_tmp88 ; - unsigned int __cil_tmp89 ; - unsigned int __cil_tmp90 ; - UCHAR __cil_tmp91 ; - int __cil_tmp92 ; - unsigned int __cil_tmp93 ; - unsigned int __cil_tmp94 ; - int __cil_tmp95 ; - int __cil_tmp96 ; - int __cil_tmp97 ; - int __cil_tmp98 ; - int __cil_tmp99 ; - UCHAR *mem_100 ; - UCHAR *mem_101 ; - UCHAR *mem_102 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_103 ; - UCHAR *mem_104 ; - UCHAR *mem_105 ; - UCHAR *mem_106 ; - UCHAR *mem_107 ; - UCHAR *mem_108 ; - UCHAR *mem_109 ; - UCHAR *mem_110 ; - UCHAR *mem_111 ; - UCHAR *mem_112 ; - UCHAR *mem_113 ; - UCHAR *mem_114 ; - UCHAR *mem_115 ; - UCHAR *mem_116 ; - BOOLEAN *mem_117 ; +NTSTATUS FlRecalibrateDrive(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + UCHAR recalibrateCount; + UCHAR fifoBuffer[2]; + unsigned int __cil_tmp5; + unsigned int __cil_tmp6; + unsigned int __cil_tmp7; + unsigned int __cil_tmp8; + unsigned int __cil_tmp9; + unsigned int __cil_tmp10; + unsigned int __cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + unsigned int __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + UCHAR *__cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + UCHAR *__cil_tmp24; + void *__cil_tmp25; + struct _MDL *__cil_tmp26; + int __cil_tmp27; + KUSER_SHARED_DATA *__cil_tmp28; + unsigned int __cil_tmp29; + unsigned int __cil_tmp30; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp31; + int __cil_tmp32; + unsigned int __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + unsigned int __cil_tmp39; + unsigned int __cil_tmp40; + unsigned int __cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + unsigned int __cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + unsigned int __cil_tmp51; + unsigned int __cil_tmp52; + unsigned int __cil_tmp53; + unsigned int __cil_tmp54; + unsigned int __cil_tmp55; + unsigned int __cil_tmp56; + unsigned int __cil_tmp57; + unsigned int __cil_tmp58; + UCHAR *__cil_tmp59; + unsigned int __cil_tmp60; + unsigned int __cil_tmp61; + unsigned int __cil_tmp62; + unsigned int __cil_tmp63; + UCHAR *__cil_tmp64; + void *__cil_tmp65; + struct _MDL *__cil_tmp66; + int __cil_tmp67; + unsigned int __cil_tmp68; + unsigned int __cil_tmp69; + unsigned int __cil_tmp70; + unsigned int __cil_tmp71; + unsigned int __cil_tmp72; + unsigned int __cil_tmp73; + unsigned int __cil_tmp74; + unsigned int __cil_tmp75; + unsigned int __cil_tmp76; + unsigned int __cil_tmp77; + unsigned int __cil_tmp78; + unsigned int __cil_tmp79; + unsigned int __cil_tmp80; + unsigned int __cil_tmp81; + unsigned int __cil_tmp82; + unsigned int __cil_tmp83; + UCHAR __cil_tmp84; + int __cil_tmp85; + int __cil_tmp86; + unsigned int __cil_tmp87; + unsigned int __cil_tmp88; + unsigned int __cil_tmp89; + unsigned int __cil_tmp90; + UCHAR __cil_tmp91; + int __cil_tmp92; + unsigned int __cil_tmp93; + unsigned int __cil_tmp94; + int __cil_tmp95; + int __cil_tmp96; + int __cil_tmp97; + int __cil_tmp98; + int __cil_tmp99; + UCHAR *mem_100; + UCHAR *mem_101; + UCHAR *mem_102; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_103; + UCHAR *mem_104; + UCHAR *mem_105; + UCHAR *mem_106; + UCHAR *mem_107; + UCHAR *mem_108; + UCHAR *mem_109; + UCHAR *mem_110; + UCHAR *mem_111; + UCHAR *mem_112; + UCHAR *mem_113; + UCHAR *mem_114; + UCHAR *mem_115; + UCHAR *mem_116; + BOOLEAN *mem_117; { #line 3278 - recalibrateCount = (unsigned char)0; - { -#line 3280 - while (1) { - while_93_continue: /* CIL Label */ ; + recalibrateCount = (unsigned char)0; { +#line 3280 + while (1) { + while_93_continue: /* CIL Label */; + { #line 3286 - __cil_tmp5 = 0 * 1U; + __cil_tmp5 = 0 * 1U; #line 3286 - __cil_tmp6 = 112 + __cil_tmp5; + __cil_tmp6 = 112 + __cil_tmp5; #line 3286 - __cil_tmp7 = (unsigned int )DisketteExtension; + __cil_tmp7 = (unsigned int)DisketteExtension; #line 3286 - __cil_tmp8 = __cil_tmp7 + __cil_tmp6; + __cil_tmp8 = __cil_tmp7 + __cil_tmp6; #line 3286 - mem_100 = (UCHAR *)__cil_tmp8; + mem_100 = (UCHAR *)__cil_tmp8; #line 3286 - *mem_100 = (unsigned char)11; + *mem_100 = (unsigned char)11; #line 3287 - __cil_tmp9 = 1 * 1U; + __cil_tmp9 = 1 * 1U; #line 3287 - __cil_tmp10 = 112 + __cil_tmp9; + __cil_tmp10 = 112 + __cil_tmp9; #line 3287 - __cil_tmp11 = (unsigned int )DisketteExtension; + __cil_tmp11 = (unsigned int)DisketteExtension; #line 3287 - __cil_tmp12 = __cil_tmp11 + __cil_tmp10; + __cil_tmp12 = __cil_tmp11 + __cil_tmp10; #line 3287 - __cil_tmp13 = (unsigned int )DisketteExtension; + __cil_tmp13 = (unsigned int)DisketteExtension; #line 3287 - __cil_tmp14 = __cil_tmp13 + 248; + __cil_tmp14 = __cil_tmp13 + 248; #line 3287 - mem_101 = (UCHAR *)__cil_tmp12; + mem_101 = (UCHAR *)__cil_tmp12; #line 3287 - mem_102 = (UCHAR *)__cil_tmp14; + mem_102 = (UCHAR *)__cil_tmp14; #line 3287 - *mem_101 = *mem_102; + *mem_101 = *mem_102; #line 3289 - __cil_tmp15 = 0 * 1U; + __cil_tmp15 = 0 * 1U; #line 3289 - __cil_tmp16 = 112 + __cil_tmp15; + __cil_tmp16 = 112 + __cil_tmp15; #line 3289 - __cil_tmp17 = (unsigned int )DisketteExtension; + __cil_tmp17 = (unsigned int)DisketteExtension; #line 3289 - __cil_tmp18 = __cil_tmp17 + __cil_tmp16; + __cil_tmp18 = __cil_tmp17 + __cil_tmp16; #line 3289 - __cil_tmp19 = (UCHAR *)__cil_tmp18; + __cil_tmp19 = (UCHAR *)__cil_tmp18; #line 3289 - __cil_tmp20 = 0 * 1U; + __cil_tmp20 = 0 * 1U; #line 3289 - __cil_tmp21 = 112 + __cil_tmp20; + __cil_tmp21 = 112 + __cil_tmp20; #line 3289 - __cil_tmp22 = (unsigned int )DisketteExtension; + __cil_tmp22 = (unsigned int)DisketteExtension; #line 3289 - __cil_tmp23 = __cil_tmp22 + __cil_tmp21; + __cil_tmp23 = __cil_tmp22 + __cil_tmp21; #line 3289 - __cil_tmp24 = (UCHAR *)__cil_tmp23; + __cil_tmp24 = (UCHAR *)__cil_tmp23; #line 3289 - __cil_tmp25 = (void *)0; + __cil_tmp25 = (void *)0; #line 3289 - __cil_tmp26 = (struct _MDL *)__cil_tmp25; + __cil_tmp26 = (struct _MDL *)__cil_tmp25; #line 3289 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp19, __cil_tmp24, __cil_tmp26, - 0UL, 0UL); - } - { + ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp19, __cil_tmp24, + __cil_tmp26, 0UL, 0UL); + } + { #line 3296 - __cil_tmp27 = ntStatus >= 0L; + __cil_tmp27 = ntStatus >= 0L; #line 3296 - if (! __cil_tmp27) { - { + if (!__cil_tmp27) { + { #line 3301 - while (1) { - while_94_continue: /* CIL Label */ ; - goto while_94_break; - } - while_94_break: /* CIL Label */ ; - } - } else { - - } - } + while (1) { + while_94_continue: /* CIL Label */; + goto while_94_break; + } + while_94_break: /* CIL Label */; + } + } else { + } + } #line 3305 - if (ntStatus >= 0L) { - { + if (ntStatus >= 0L) { + { #line 3307 - __cil_tmp28 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp28 = (KUSER_SHARED_DATA * const)4292804608U; #line 3307 - __cil_tmp29 = (unsigned int )__cil_tmp28; + __cil_tmp29 = (unsigned int)__cil_tmp28; #line 3307 - __cil_tmp30 = __cil_tmp29 + 732; + __cil_tmp30 = __cil_tmp29 + 732; #line 3307 - mem_103 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp30; + mem_103 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp30; #line 3307 - __cil_tmp31 = *mem_103; + __cil_tmp31 = *mem_103; #line 3307 - __cil_tmp32 = (int )__cil_tmp31; + __cil_tmp32 = (int)__cil_tmp31; #line 3307 - if (__cil_tmp32 == 1) { - { + if (__cil_tmp32 == 1) { + { #line 3313 - __cil_tmp33 = 0 * 1U; + __cil_tmp33 = 0 * 1U; #line 3313 - __cil_tmp34 = (unsigned int )(fifoBuffer) + __cil_tmp33; + __cil_tmp34 = (unsigned int)(fifoBuffer) + __cil_tmp33; #line 3313 - __cil_tmp35 = 0 * 1U; + __cil_tmp35 = 0 * 1U; #line 3313 - __cil_tmp36 = 112 + __cil_tmp35; + __cil_tmp36 = 112 + __cil_tmp35; #line 3313 - __cil_tmp37 = (unsigned int )DisketteExtension; + __cil_tmp37 = (unsigned int)DisketteExtension; #line 3313 - __cil_tmp38 = __cil_tmp37 + __cil_tmp36; + __cil_tmp38 = __cil_tmp37 + __cil_tmp36; #line 3313 - mem_104 = (UCHAR *)__cil_tmp34; + mem_104 = (UCHAR *)__cil_tmp34; #line 3313 - mem_105 = (UCHAR *)__cil_tmp38; + mem_105 = (UCHAR *)__cil_tmp38; #line 3313 - *mem_104 = *mem_105; + *mem_104 = *mem_105; #line 3314 - __cil_tmp39 = 1 * 1U; + __cil_tmp39 = 1 * 1U; #line 3314 - __cil_tmp40 = (unsigned int )(fifoBuffer) + __cil_tmp39; + __cil_tmp40 = (unsigned int)(fifoBuffer) + __cil_tmp39; #line 3314 - __cil_tmp41 = 1 * 1U; + __cil_tmp41 = 1 * 1U; #line 3314 - __cil_tmp42 = 112 + __cil_tmp41; + __cil_tmp42 = 112 + __cil_tmp41; #line 3314 - __cil_tmp43 = (unsigned int )DisketteExtension; + __cil_tmp43 = (unsigned int)DisketteExtension; #line 3314 - __cil_tmp44 = __cil_tmp43 + __cil_tmp42; + __cil_tmp44 = __cil_tmp43 + __cil_tmp42; #line 3314 - mem_106 = (UCHAR *)__cil_tmp40; + mem_106 = (UCHAR *)__cil_tmp40; #line 3314 - mem_107 = (UCHAR *)__cil_tmp44; + mem_107 = (UCHAR *)__cil_tmp44; #line 3314 - *mem_106 = *mem_107; + *mem_106 = *mem_107; #line 3319 - __cil_tmp45 = 0 * 1U; + __cil_tmp45 = 0 * 1U; #line 3319 - __cil_tmp46 = 112 + __cil_tmp45; + __cil_tmp46 = 112 + __cil_tmp45; #line 3319 - __cil_tmp47 = (unsigned int )DisketteExtension; + __cil_tmp47 = (unsigned int)DisketteExtension; #line 3319 - __cil_tmp48 = __cil_tmp47 + __cil_tmp46; + __cil_tmp48 = __cil_tmp47 + __cil_tmp46; #line 3319 - mem_108 = (UCHAR *)__cil_tmp48; + mem_108 = (UCHAR *)__cil_tmp48; #line 3319 - *mem_108 = (unsigned char)14; + *mem_108 = (unsigned char)14; #line 3320 - __cil_tmp49 = 1 * 1U; + __cil_tmp49 = 1 * 1U; #line 3320 - __cil_tmp50 = 112 + __cil_tmp49; + __cil_tmp50 = 112 + __cil_tmp49; #line 3320 - __cil_tmp51 = (unsigned int )DisketteExtension; + __cil_tmp51 = (unsigned int)DisketteExtension; #line 3320 - __cil_tmp52 = __cil_tmp51 + __cil_tmp50; + __cil_tmp52 = __cil_tmp51 + __cil_tmp50; #line 3320 - __cil_tmp53 = (unsigned int )DisketteExtension; + __cil_tmp53 = (unsigned int)DisketteExtension; #line 3320 - __cil_tmp54 = __cil_tmp53 + 248; + __cil_tmp54 = __cil_tmp53 + 248; #line 3320 - mem_109 = (UCHAR *)__cil_tmp52; + mem_109 = (UCHAR *)__cil_tmp52; #line 3320 - mem_110 = (UCHAR *)__cil_tmp54; + mem_110 = (UCHAR *)__cil_tmp54; #line 3320 - *mem_109 = *mem_110; + *mem_109 = *mem_110; #line 3322 - __cil_tmp55 = 0 * 1U; + __cil_tmp55 = 0 * 1U; #line 3322 - __cil_tmp56 = 112 + __cil_tmp55; + __cil_tmp56 = 112 + __cil_tmp55; #line 3322 - __cil_tmp57 = (unsigned int )DisketteExtension; + __cil_tmp57 = (unsigned int)DisketteExtension; #line 3322 - __cil_tmp58 = __cil_tmp57 + __cil_tmp56; + __cil_tmp58 = __cil_tmp57 + __cil_tmp56; #line 3322 - __cil_tmp59 = (UCHAR *)__cil_tmp58; + __cil_tmp59 = (UCHAR *)__cil_tmp58; #line 3322 - __cil_tmp60 = 0 * 1U; + __cil_tmp60 = 0 * 1U; #line 3322 - __cil_tmp61 = 112 + __cil_tmp60; + __cil_tmp61 = 112 + __cil_tmp60; #line 3322 - __cil_tmp62 = (unsigned int )DisketteExtension; + __cil_tmp62 = (unsigned int)DisketteExtension; #line 3322 - __cil_tmp63 = __cil_tmp62 + __cil_tmp61; + __cil_tmp63 = __cil_tmp62 + __cil_tmp61; #line 3322 - __cil_tmp64 = (UCHAR *)__cil_tmp63; + __cil_tmp64 = (UCHAR *)__cil_tmp63; #line 3322 - __cil_tmp65 = (void *)0; + __cil_tmp65 = (void *)0; #line 3322 - __cil_tmp66 = (struct _MDL *)__cil_tmp65; + __cil_tmp66 = (struct _MDL *)__cil_tmp65; #line 3322 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp59, __cil_tmp64, __cil_tmp66, - 0UL, 0UL); - } - { + ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp59, + __cil_tmp64, __cil_tmp66, 0UL, 0UL); + } + { #line 3329 - __cil_tmp67 = ntStatus >= 0L; + __cil_tmp67 = ntStatus >= 0L; #line 3329 - if (! __cil_tmp67) { - { + if (!__cil_tmp67) { + { #line 3334 - while (1) { - while_95_continue: /* CIL Label */ ; - goto while_95_break; - } - while_95_break: /* CIL Label */ ; - } + while (1) { + while_95_continue: /* CIL Label */; + goto while_95_break; + } + while_95_break: /* CIL Label */; + } #line 3336 - return (ntStatus); - } else { - - } - } + return (ntStatus); + } else { + } + } #line 3339 - __cil_tmp68 = 0 * 1U; + __cil_tmp68 = 0 * 1U; #line 3339 - __cil_tmp69 = 112 + __cil_tmp68; + __cil_tmp69 = 112 + __cil_tmp68; #line 3339 - __cil_tmp70 = (unsigned int )DisketteExtension; + __cil_tmp70 = (unsigned int)DisketteExtension; #line 3339 - __cil_tmp71 = __cil_tmp70 + __cil_tmp69; + __cil_tmp71 = __cil_tmp70 + __cil_tmp69; #line 3339 - __cil_tmp72 = 0 * 1U; + __cil_tmp72 = 0 * 1U; #line 3339 - __cil_tmp73 = (unsigned int )(fifoBuffer) + __cil_tmp72; + __cil_tmp73 = (unsigned int)(fifoBuffer) + __cil_tmp72; #line 3339 - mem_111 = (UCHAR *)__cil_tmp71; + mem_111 = (UCHAR *)__cil_tmp71; #line 3339 - mem_112 = (UCHAR *)__cil_tmp73; + mem_112 = (UCHAR *)__cil_tmp73; #line 3339 - *mem_111 = *mem_112; + *mem_111 = *mem_112; #line 3340 - __cil_tmp74 = 1 * 1U; + __cil_tmp74 = 1 * 1U; #line 3340 - __cil_tmp75 = 112 + __cil_tmp74; + __cil_tmp75 = 112 + __cil_tmp74; #line 3340 - __cil_tmp76 = (unsigned int )DisketteExtension; + __cil_tmp76 = (unsigned int)DisketteExtension; #line 3340 - __cil_tmp77 = __cil_tmp76 + __cil_tmp75; + __cil_tmp77 = __cil_tmp76 + __cil_tmp75; #line 3340 - __cil_tmp78 = 1 * 1U; + __cil_tmp78 = 1 * 1U; #line 3340 - __cil_tmp79 = (unsigned int )(fifoBuffer) + __cil_tmp78; + __cil_tmp79 = (unsigned int)(fifoBuffer) + __cil_tmp78; #line 3340 - mem_113 = (UCHAR *)__cil_tmp77; + mem_113 = (UCHAR *)__cil_tmp77; #line 3340 - mem_114 = (UCHAR *)__cil_tmp79; + mem_114 = (UCHAR *)__cil_tmp79; #line 3340 - *mem_113 = *mem_114; - } else { - - } - } - { + *mem_113 = *mem_114; + } else { + } + } + { #line 3344 - __cil_tmp80 = 0 * 1U; + __cil_tmp80 = 0 * 1U; #line 3344 - __cil_tmp81 = 112 + __cil_tmp80; + __cil_tmp81 = 112 + __cil_tmp80; #line 3344 - __cil_tmp82 = (unsigned int )DisketteExtension; + __cil_tmp82 = (unsigned int)DisketteExtension; #line 3344 - __cil_tmp83 = __cil_tmp82 + __cil_tmp81; + __cil_tmp83 = __cil_tmp82 + __cil_tmp81; #line 3344 - mem_115 = (UCHAR *)__cil_tmp83; + mem_115 = (UCHAR *)__cil_tmp83; #line 3344 - __cil_tmp84 = *mem_115; + __cil_tmp84 = *mem_115; #line 3344 - __cil_tmp85 = (int )__cil_tmp84; + __cil_tmp85 = (int)__cil_tmp84; #line 3344 - __cil_tmp86 = __cil_tmp85 & 32; + __cil_tmp86 = __cil_tmp85 & 32; #line 3344 - if (! __cil_tmp86) { - goto _L; - } else { - { + if (!__cil_tmp86) { + goto _L; + } else { + { #line 3344 - __cil_tmp87 = 1 * 1U; + __cil_tmp87 = 1 * 1U; #line 3344 - __cil_tmp88 = 112 + __cil_tmp87; + __cil_tmp88 = 112 + __cil_tmp87; #line 3344 - __cil_tmp89 = (unsigned int )DisketteExtension; + __cil_tmp89 = (unsigned int)DisketteExtension; #line 3344 - __cil_tmp90 = __cil_tmp89 + __cil_tmp88; + __cil_tmp90 = __cil_tmp89 + __cil_tmp88; #line 3344 - mem_116 = (UCHAR *)__cil_tmp90; + mem_116 = (UCHAR *)__cil_tmp90; #line 3344 - __cil_tmp91 = *mem_116; + __cil_tmp91 = *mem_116; #line 3344 - __cil_tmp92 = (int )__cil_tmp91; + __cil_tmp92 = (int)__cil_tmp91; #line 3344 - if (__cil_tmp92 != 0) { - _L: - { + if (__cil_tmp92 != 0) { + _L : { #line 3350 - while (1) { - while_96_continue: /* CIL Label */ ; - goto while_96_break; - } - while_96_break: /* CIL Label */ ; - } + while (1) { + while_96_continue: /* CIL Label */; + goto while_96_break; + } + while_96_break: /* CIL Label */; + } #line 3352 - __cil_tmp93 = (unsigned int )DisketteExtension; + __cil_tmp93 = (unsigned int)DisketteExtension; #line 3352 - __cil_tmp94 = __cil_tmp93 + 104; + __cil_tmp94 = __cil_tmp93 + 104; #line 3352 - mem_117 = (BOOLEAN *)__cil_tmp94; + mem_117 = (BOOLEAN *)__cil_tmp94; #line 3352 - *mem_117 = (unsigned char)1; + *mem_117 = (unsigned char)1; #line 3354 - ntStatus = -1073741464L; + ntStatus = -1073741464L; + } else { + } + } + } + } } else { - - } } - } - } - } else { - - } #line 3358 - __cil_tmp95 = (int )recalibrateCount; + __cil_tmp95 = (int)recalibrateCount; #line 3358 - __cil_tmp96 = __cil_tmp95 + 1; + __cil_tmp96 = __cil_tmp95 + 1; #line 3358 - recalibrateCount = (unsigned char )__cil_tmp96; - { + recalibrateCount = (unsigned char)__cil_tmp96; + { #line 3280 - __cil_tmp97 = ntStatus >= 0L; + __cil_tmp97 = ntStatus >= 0L; #line 3280 - if (! __cil_tmp97) { - { + if (!__cil_tmp97) { + { #line 3280 - __cil_tmp98 = (int )recalibrateCount; + __cil_tmp98 = (int)recalibrateCount; #line 3280 - __cil_tmp99 = __cil_tmp98 < 2; + __cil_tmp99 = __cil_tmp98 < 2; #line 3280 - if (! __cil_tmp99) { - goto while_93_break; - } else { - - } + if (!__cil_tmp99) { + goto while_93_break; + } else { + } + } + } else { + goto while_93_break; + } + } } - } else { - goto while_93_break; - } + while_93_break: /* CIL Label */; } - } - while_93_break: /* CIL Label */ ; - } - { + { #line 3365 - while (1) { - while_97_continue: /* CIL Label */ ; - goto while_97_break; - } - while_97_break: /* CIL Label */ ; - } + while (1) { + while_97_continue: /* CIL Label */; + goto while_97_break; + } + while_97_break: /* CIL Label */; + } #line 3367 - return (ntStatus); -} + return (ntStatus); + } } #line 3370 "floppy.c" -NTSTATUS FlDetermineMediaType(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - BOOLEAN mediaTypesExhausted ; - ULONG retries ; - USHORT sectorLengthCode ; - PBOOT_SECTOR_INFO bootSector ; - LARGE_INTEGER offset ; - PIRP irp ; - int tmp ; - PVOID tmp___0 ; - int tmp___1 ; - unsigned int __cil_tmp13 ; - unsigned int __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - UCHAR __cil_tmp19 ; - int __cil_tmp20 ; - PDRIVE_MEDIA_LIMITS __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - DRIVE_MEDIA_TYPE __cil_tmp26 ; - unsigned int __cil_tmp27 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp28 ; - KUSER_SHARED_DATA *__cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp32 ; - int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - DRIVE_MEDIA_TYPE __cil_tmp36 ; - unsigned int __cil_tmp37 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp38 ; - unsigned int __cil_tmp39 ; - unsigned int __cil_tmp40 ; - UCHAR __cil_tmp41 ; - int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - DRIVE_MEDIA_TYPE __cil_tmp45 ; - unsigned int __cil_tmp46 ; - unsigned int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - unsigned int __cil_tmp51 ; - unsigned int __cil_tmp52 ; - UCHAR __cil_tmp53 ; - int __cil_tmp54 ; - int __cil_tmp55 ; - int __cil_tmp56 ; - unsigned int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - UCHAR __cil_tmp59 ; - int __cil_tmp60 ; - int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - unsigned int __cil_tmp63 ; - unsigned int __cil_tmp64 ; - unsigned int __cil_tmp65 ; - unsigned int __cil_tmp66 ; - unsigned int __cil_tmp67 ; - unsigned int __cil_tmp68 ; - unsigned int __cil_tmp69 ; - UCHAR *__cil_tmp70 ; - unsigned int __cil_tmp71 ; - unsigned int __cil_tmp72 ; - unsigned int __cil_tmp73 ; - unsigned int __cil_tmp74 ; - UCHAR *__cil_tmp75 ; - void *__cil_tmp76 ; - struct _MDL *__cil_tmp77 ; - int __cil_tmp78 ; - unsigned int __cil_tmp79 ; - unsigned int __cil_tmp80 ; - UCHAR __cil_tmp81 ; - int __cil_tmp82 ; - int __cil_tmp83 ; - int __cil_tmp84 ; - unsigned int __cil_tmp85 ; - unsigned int __cil_tmp86 ; - UCHAR __cil_tmp87 ; - int __cil_tmp88 ; - int __cil_tmp89 ; - unsigned char __cil_tmp90 ; - int __cil_tmp91 ; - unsigned int __cil_tmp92 ; - unsigned int __cil_tmp93 ; - unsigned int __cil_tmp94 ; - unsigned int __cil_tmp95 ; - UCHAR __cil_tmp96 ; - int __cil_tmp97 ; - int __cil_tmp98 ; - unsigned int __cil_tmp99 ; - unsigned int __cil_tmp100 ; - unsigned int __cil_tmp101 ; - unsigned int __cil_tmp102 ; - UCHAR __cil_tmp103 ; - int __cil_tmp104 ; - unsigned int __cil_tmp105 ; - unsigned int __cil_tmp106 ; - unsigned int __cil_tmp107 ; - unsigned int __cil_tmp108 ; - UCHAR __cil_tmp109 ; - int __cil_tmp110 ; - KUSER_SHARED_DATA *__cil_tmp111 ; - unsigned int __cil_tmp112 ; - unsigned int __cil_tmp113 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp114 ; - int __cil_tmp115 ; - int __cil_tmp116 ; - unsigned int __cil_tmp117 ; - unsigned int __cil_tmp118 ; - unsigned int __cil_tmp119 ; - unsigned int __cil_tmp120 ; - UCHAR __cil_tmp121 ; - int __cil_tmp122 ; - unsigned int __cil_tmp123 ; - unsigned int __cil_tmp124 ; - unsigned int __cil_tmp125 ; - unsigned int __cil_tmp126 ; - DRIVE_MEDIA_TYPE __cil_tmp127 ; - int __cil_tmp128 ; - int __cil_tmp129 ; - unsigned int __cil_tmp130 ; - unsigned int __cil_tmp131 ; - unsigned int __cil_tmp132 ; - unsigned int __cil_tmp133 ; - DRIVE_MEDIA_TYPE __cil_tmp134 ; - unsigned int __cil_tmp135 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp136 ; - unsigned int __cil_tmp137 ; - unsigned int __cil_tmp138 ; - UCHAR __cil_tmp139 ; - int __cil_tmp140 ; - PDRIVE_MEDIA_LIMITS __cil_tmp141 ; - unsigned int __cil_tmp142 ; - unsigned int __cil_tmp143 ; - DRIVE_MEDIA_TYPE __cil_tmp144 ; - char __cil_tmp145 ; - int __cil_tmp146 ; - unsigned int __cil_tmp147 ; - unsigned int __cil_tmp148 ; - DRIVE_MEDIA_TYPE __cil_tmp149 ; - char __cil_tmp150 ; - int __cil_tmp151 ; - unsigned int __cil_tmp152 ; - unsigned int __cil_tmp153 ; - KUSER_SHARED_DATA *__cil_tmp154 ; - unsigned int __cil_tmp155 ; - unsigned int __cil_tmp156 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp157 ; - int __cil_tmp158 ; - unsigned int __cil_tmp159 ; - unsigned int __cil_tmp160 ; - unsigned int __cil_tmp161 ; - unsigned int __cil_tmp162 ; - unsigned int __cil_tmp163 ; - unsigned int __cil_tmp164 ; - USHORT __cil_tmp165 ; - unsigned int __cil_tmp166 ; - unsigned int __cil_tmp167 ; - unsigned int __cil_tmp168 ; - unsigned int __cil_tmp169 ; - UCHAR __cil_tmp170 ; - int __cil_tmp171 ; - unsigned int __cil_tmp172 ; - unsigned int __cil_tmp173 ; - UCHAR __cil_tmp174 ; - int __cil_tmp175 ; - int __cil_tmp176 ; - unsigned int __cil_tmp177 ; - unsigned int __cil_tmp178 ; - UCHAR __cil_tmp179 ; - int __cil_tmp180 ; - unsigned int __cil_tmp181 ; - unsigned int __cil_tmp182 ; - USHORT __cil_tmp183 ; - int __cil_tmp184 ; - int __cil_tmp185 ; - int __cil_tmp186 ; - int __cil_tmp187 ; - unsigned int __cil_tmp188 ; - unsigned int __cil_tmp189 ; - unsigned int __cil_tmp190 ; - unsigned int __cil_tmp191 ; - DRIVE_MEDIA_TYPE __cil_tmp192 ; - unsigned int __cil_tmp193 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp194 ; - KUSER_SHARED_DATA *__cil_tmp195 ; - unsigned int __cil_tmp196 ; - unsigned int __cil_tmp197 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp198 ; - int __cil_tmp199 ; - enum _POOL_TYPE __cil_tmp200 ; - unsigned long __cil_tmp201 ; - unsigned int __cil_tmp202 ; - unsigned int __cil_tmp203 ; - LARGE_INTEGER *__cil_tmp204 ; - unsigned int __cil_tmp205 ; - unsigned int __cil_tmp206 ; - LONG __cil_tmp207 ; - KUSER_SHARED_DATA *__cil_tmp208 ; - unsigned int __cil_tmp209 ; - unsigned int __cil_tmp210 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp211 ; - int __cil_tmp212 ; - unsigned int __cil_tmp213 ; - unsigned int __cil_tmp214 ; - PDEVICE_OBJECT __cil_tmp215 ; - void *__cil_tmp216 ; - unsigned long __cil_tmp217 ; - void *__cil_tmp218 ; - struct _IO_STATUS_BLOCK *__cil_tmp219 ; - void *__cil_tmp220 ; - unsigned int __cil_tmp221 ; - unsigned int __cil_tmp222 ; - unsigned int __cil_tmp223 ; - unsigned int __cil_tmp224 ; - CHAR __cil_tmp225 ; - int __cil_tmp226 ; - int __cil_tmp227 ; - unsigned int __cil_tmp228 ; - unsigned int __cil_tmp229 ; - unsigned int __cil_tmp230 ; - unsigned int __cil_tmp231 ; - unsigned int __cil_tmp232 ; - unsigned int __cil_tmp233 ; - unsigned int __cil_tmp234 ; - unsigned int __cil_tmp235 ; - unsigned int __cil_tmp236 ; - unsigned int __cil_tmp237 ; - struct _IO_STACK_LOCATION *__cil_tmp238 ; - unsigned int __cil_tmp239 ; - unsigned int __cil_tmp240 ; - PMDL __cil_tmp241 ; - unsigned int __cil_tmp242 ; - unsigned int __cil_tmp243 ; - PMDL __cil_tmp244 ; - void *__cil_tmp245 ; - int __cil_tmp246 ; - unsigned int __cil_tmp247 ; - unsigned int __cil_tmp248 ; - unsigned int __cil_tmp249 ; - unsigned int __cil_tmp250 ; - DRIVE_MEDIA_TYPE __cil_tmp251 ; - int __cil_tmp252 ; - int __cil_tmp253 ; - unsigned int __cil_tmp254 ; - unsigned int __cil_tmp255 ; - unsigned int __cil_tmp256 ; - unsigned int __cil_tmp257 ; - DRIVE_MEDIA_TYPE __cil_tmp258 ; - unsigned int __cil_tmp259 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp260 ; - unsigned int __cil_tmp261 ; - unsigned int __cil_tmp262 ; - UCHAR __cil_tmp263 ; - int __cil_tmp264 ; - PDRIVE_MEDIA_LIMITS __cil_tmp265 ; - unsigned int __cil_tmp266 ; - unsigned int __cil_tmp267 ; - DRIVE_MEDIA_TYPE __cil_tmp268 ; - char __cil_tmp269 ; - int __cil_tmp270 ; - unsigned int __cil_tmp271 ; - unsigned int __cil_tmp272 ; - DRIVE_MEDIA_TYPE __cil_tmp273 ; - char __cil_tmp274 ; - int __cil_tmp275 ; - unsigned int __cil_tmp276 ; - unsigned int __cil_tmp277 ; - int __cil_tmp278 ; - int __cil_tmp279 ; - int __cil_tmp280 ; - unsigned int __cil_tmp281 ; - unsigned int __cil_tmp282 ; - unsigned int __cil_tmp283 ; - unsigned int __cil_tmp284 ; - unsigned int __cil_tmp285 ; - unsigned int __cil_tmp286 ; - USHORT __cil_tmp287 ; - unsigned int __cil_tmp288 ; - unsigned int __cil_tmp289 ; - unsigned int __cil_tmp290 ; - unsigned int __cil_tmp291 ; - UCHAR __cil_tmp292 ; - int __cil_tmp293 ; - unsigned int __cil_tmp294 ; - unsigned int __cil_tmp295 ; - UCHAR __cil_tmp296 ; - int __cil_tmp297 ; - int __cil_tmp298 ; - unsigned int __cil_tmp299 ; - unsigned int __cil_tmp300 ; - UCHAR __cil_tmp301 ; - int __cil_tmp302 ; - unsigned int __cil_tmp303 ; - unsigned int __cil_tmp304 ; - USHORT __cil_tmp305 ; - int __cil_tmp306 ; - int __cil_tmp307 ; - int __cil_tmp308 ; - int __cil_tmp309 ; - unsigned int __cil_tmp310 ; - unsigned int __cil_tmp311 ; - unsigned int __cil_tmp312 ; - unsigned int __cil_tmp313 ; - DRIVE_MEDIA_TYPE __cil_tmp314 ; - unsigned int __cil_tmp315 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp316 ; - BOOLEAN *mem_317 ; - UCHAR *mem_318 ; - DRIVE_MEDIA_TYPE *mem_319 ; - DRIVE_MEDIA_TYPE *mem_320 ; - DRIVE_MEDIA_TYPE *mem_321 ; - DRIVE_MEDIA_CONSTANTS *mem_322 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_323 ; - DRIVE_MEDIA_TYPE *mem_324 ; - UCHAR *mem_325 ; - DRIVE_MEDIA_TYPE *mem_326 ; - UCHAR *mem_327 ; - UCHAR *mem_328 ; - UCHAR *mem_329 ; - UCHAR *mem_330 ; - UCHAR *mem_331 ; - UCHAR *mem_332 ; - UCHAR *mem_333 ; - UCHAR *mem_334 ; - UCHAR *mem_335 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_336 ; - UCHAR *mem_337 ; - DRIVE_MEDIA_TYPE *mem_338 ; - DRIVE_MEDIA_TYPE *mem_339 ; - DRIVE_MEDIA_TYPE *mem_340 ; - DRIVE_MEDIA_CONSTANTS *mem_341 ; - UCHAR *mem_342 ; - DRIVE_MEDIA_TYPE *mem_343 ; - DRIVE_MEDIA_TYPE *mem_344 ; - MEDIA_TYPE *mem_345 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_346 ; - MEDIA_TYPE *mem_347 ; - MEDIA_TYPE *mem_348 ; - USHORT *mem_349 ; - ULONG *mem_350 ; - UCHAR *mem_351 ; - UCHAR *mem_352 ; - UCHAR *mem_353 ; - USHORT *mem_354 ; - ULONG *mem_355 ; - DRIVE_MEDIA_TYPE *mem_356 ; - DRIVE_MEDIA_CONSTANTS *mem_357 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_358 ; - LONG *mem_359 ; - LONG *mem_360 ; - ULONG *mem_361 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_362 ; - PDEVICE_OBJECT *mem_363 ; - CHAR *mem_364 ; - CHAR *mem_365 ; - struct _IO_STACK_LOCATION **mem_366 ; - struct _IO_STACK_LOCATION **mem_367 ; - PMDL *mem_368 ; - PMDL *mem_369 ; - DRIVE_MEDIA_TYPE *mem_370 ; - DRIVE_MEDIA_TYPE *mem_371 ; - DRIVE_MEDIA_TYPE *mem_372 ; - DRIVE_MEDIA_CONSTANTS *mem_373 ; - UCHAR *mem_374 ; - DRIVE_MEDIA_TYPE *mem_375 ; - DRIVE_MEDIA_TYPE *mem_376 ; - MEDIA_TYPE *mem_377 ; - MEDIA_TYPE *mem_378 ; - MEDIA_TYPE *mem_379 ; - USHORT *mem_380 ; - ULONG *mem_381 ; - UCHAR *mem_382 ; - UCHAR *mem_383 ; - UCHAR *mem_384 ; - USHORT *mem_385 ; - ULONG *mem_386 ; - DRIVE_MEDIA_TYPE *mem_387 ; - DRIVE_MEDIA_CONSTANTS *mem_388 ; +NTSTATUS FlDetermineMediaType(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + BOOLEAN mediaTypesExhausted; + ULONG retries; + USHORT sectorLengthCode; + PBOOT_SECTOR_INFO bootSector; + LARGE_INTEGER offset; + PIRP irp; + int tmp; + PVOID tmp___0; + int tmp___1; + unsigned int __cil_tmp13; + unsigned int __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + UCHAR __cil_tmp19; + int __cil_tmp20; + PDRIVE_MEDIA_LIMITS __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + DRIVE_MEDIA_TYPE __cil_tmp26; + unsigned int __cil_tmp27; + PDRIVE_MEDIA_CONSTANTS __cil_tmp28; + KUSER_SHARED_DATA *__cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp32; + int __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + DRIVE_MEDIA_TYPE __cil_tmp36; + unsigned int __cil_tmp37; + PDRIVE_MEDIA_CONSTANTS __cil_tmp38; + unsigned int __cil_tmp39; + unsigned int __cil_tmp40; + UCHAR __cil_tmp41; + int __cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + DRIVE_MEDIA_TYPE __cil_tmp45; + unsigned int __cil_tmp46; + unsigned int __cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + unsigned int __cil_tmp51; + unsigned int __cil_tmp52; + UCHAR __cil_tmp53; + int __cil_tmp54; + int __cil_tmp55; + int __cil_tmp56; + unsigned int __cil_tmp57; + unsigned int __cil_tmp58; + UCHAR __cil_tmp59; + int __cil_tmp60; + int __cil_tmp61; + unsigned int __cil_tmp62; + unsigned int __cil_tmp63; + unsigned int __cil_tmp64; + unsigned int __cil_tmp65; + unsigned int __cil_tmp66; + unsigned int __cil_tmp67; + unsigned int __cil_tmp68; + unsigned int __cil_tmp69; + UCHAR *__cil_tmp70; + unsigned int __cil_tmp71; + unsigned int __cil_tmp72; + unsigned int __cil_tmp73; + unsigned int __cil_tmp74; + UCHAR *__cil_tmp75; + void *__cil_tmp76; + struct _MDL *__cil_tmp77; + int __cil_tmp78; + unsigned int __cil_tmp79; + unsigned int __cil_tmp80; + UCHAR __cil_tmp81; + int __cil_tmp82; + int __cil_tmp83; + int __cil_tmp84; + unsigned int __cil_tmp85; + unsigned int __cil_tmp86; + UCHAR __cil_tmp87; + int __cil_tmp88; + int __cil_tmp89; + unsigned char __cil_tmp90; + int __cil_tmp91; + unsigned int __cil_tmp92; + unsigned int __cil_tmp93; + unsigned int __cil_tmp94; + unsigned int __cil_tmp95; + UCHAR __cil_tmp96; + int __cil_tmp97; + int __cil_tmp98; + unsigned int __cil_tmp99; + unsigned int __cil_tmp100; + unsigned int __cil_tmp101; + unsigned int __cil_tmp102; + UCHAR __cil_tmp103; + int __cil_tmp104; + unsigned int __cil_tmp105; + unsigned int __cil_tmp106; + unsigned int __cil_tmp107; + unsigned int __cil_tmp108; + UCHAR __cil_tmp109; + int __cil_tmp110; + KUSER_SHARED_DATA *__cil_tmp111; + unsigned int __cil_tmp112; + unsigned int __cil_tmp113; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp114; + int __cil_tmp115; + int __cil_tmp116; + unsigned int __cil_tmp117; + unsigned int __cil_tmp118; + unsigned int __cil_tmp119; + unsigned int __cil_tmp120; + UCHAR __cil_tmp121; + int __cil_tmp122; + unsigned int __cil_tmp123; + unsigned int __cil_tmp124; + unsigned int __cil_tmp125; + unsigned int __cil_tmp126; + DRIVE_MEDIA_TYPE __cil_tmp127; + int __cil_tmp128; + int __cil_tmp129; + unsigned int __cil_tmp130; + unsigned int __cil_tmp131; + unsigned int __cil_tmp132; + unsigned int __cil_tmp133; + DRIVE_MEDIA_TYPE __cil_tmp134; + unsigned int __cil_tmp135; + PDRIVE_MEDIA_CONSTANTS __cil_tmp136; + unsigned int __cil_tmp137; + unsigned int __cil_tmp138; + UCHAR __cil_tmp139; + int __cil_tmp140; + PDRIVE_MEDIA_LIMITS __cil_tmp141; + unsigned int __cil_tmp142; + unsigned int __cil_tmp143; + DRIVE_MEDIA_TYPE __cil_tmp144; + char __cil_tmp145; + int __cil_tmp146; + unsigned int __cil_tmp147; + unsigned int __cil_tmp148; + DRIVE_MEDIA_TYPE __cil_tmp149; + char __cil_tmp150; + int __cil_tmp151; + unsigned int __cil_tmp152; + unsigned int __cil_tmp153; + KUSER_SHARED_DATA *__cil_tmp154; + unsigned int __cil_tmp155; + unsigned int __cil_tmp156; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp157; + int __cil_tmp158; + unsigned int __cil_tmp159; + unsigned int __cil_tmp160; + unsigned int __cil_tmp161; + unsigned int __cil_tmp162; + unsigned int __cil_tmp163; + unsigned int __cil_tmp164; + USHORT __cil_tmp165; + unsigned int __cil_tmp166; + unsigned int __cil_tmp167; + unsigned int __cil_tmp168; + unsigned int __cil_tmp169; + UCHAR __cil_tmp170; + int __cil_tmp171; + unsigned int __cil_tmp172; + unsigned int __cil_tmp173; + UCHAR __cil_tmp174; + int __cil_tmp175; + int __cil_tmp176; + unsigned int __cil_tmp177; + unsigned int __cil_tmp178; + UCHAR __cil_tmp179; + int __cil_tmp180; + unsigned int __cil_tmp181; + unsigned int __cil_tmp182; + USHORT __cil_tmp183; + int __cil_tmp184; + int __cil_tmp185; + int __cil_tmp186; + int __cil_tmp187; + unsigned int __cil_tmp188; + unsigned int __cil_tmp189; + unsigned int __cil_tmp190; + unsigned int __cil_tmp191; + DRIVE_MEDIA_TYPE __cil_tmp192; + unsigned int __cil_tmp193; + PDRIVE_MEDIA_CONSTANTS __cil_tmp194; + KUSER_SHARED_DATA *__cil_tmp195; + unsigned int __cil_tmp196; + unsigned int __cil_tmp197; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp198; + int __cil_tmp199; + enum _POOL_TYPE __cil_tmp200; + unsigned long __cil_tmp201; + unsigned int __cil_tmp202; + unsigned int __cil_tmp203; + LARGE_INTEGER *__cil_tmp204; + unsigned int __cil_tmp205; + unsigned int __cil_tmp206; + LONG __cil_tmp207; + KUSER_SHARED_DATA *__cil_tmp208; + unsigned int __cil_tmp209; + unsigned int __cil_tmp210; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp211; + int __cil_tmp212; + unsigned int __cil_tmp213; + unsigned int __cil_tmp214; + PDEVICE_OBJECT __cil_tmp215; + void *__cil_tmp216; + unsigned long __cil_tmp217; + void *__cil_tmp218; + struct _IO_STATUS_BLOCK *__cil_tmp219; + void *__cil_tmp220; + unsigned int __cil_tmp221; + unsigned int __cil_tmp222; + unsigned int __cil_tmp223; + unsigned int __cil_tmp224; + CHAR __cil_tmp225; + int __cil_tmp226; + int __cil_tmp227; + unsigned int __cil_tmp228; + unsigned int __cil_tmp229; + unsigned int __cil_tmp230; + unsigned int __cil_tmp231; + unsigned int __cil_tmp232; + unsigned int __cil_tmp233; + unsigned int __cil_tmp234; + unsigned int __cil_tmp235; + unsigned int __cil_tmp236; + unsigned int __cil_tmp237; + struct _IO_STACK_LOCATION *__cil_tmp238; + unsigned int __cil_tmp239; + unsigned int __cil_tmp240; + PMDL __cil_tmp241; + unsigned int __cil_tmp242; + unsigned int __cil_tmp243; + PMDL __cil_tmp244; + void *__cil_tmp245; + int __cil_tmp246; + unsigned int __cil_tmp247; + unsigned int __cil_tmp248; + unsigned int __cil_tmp249; + unsigned int __cil_tmp250; + DRIVE_MEDIA_TYPE __cil_tmp251; + int __cil_tmp252; + int __cil_tmp253; + unsigned int __cil_tmp254; + unsigned int __cil_tmp255; + unsigned int __cil_tmp256; + unsigned int __cil_tmp257; + DRIVE_MEDIA_TYPE __cil_tmp258; + unsigned int __cil_tmp259; + PDRIVE_MEDIA_CONSTANTS __cil_tmp260; + unsigned int __cil_tmp261; + unsigned int __cil_tmp262; + UCHAR __cil_tmp263; + int __cil_tmp264; + PDRIVE_MEDIA_LIMITS __cil_tmp265; + unsigned int __cil_tmp266; + unsigned int __cil_tmp267; + DRIVE_MEDIA_TYPE __cil_tmp268; + char __cil_tmp269; + int __cil_tmp270; + unsigned int __cil_tmp271; + unsigned int __cil_tmp272; + DRIVE_MEDIA_TYPE __cil_tmp273; + char __cil_tmp274; + int __cil_tmp275; + unsigned int __cil_tmp276; + unsigned int __cil_tmp277; + int __cil_tmp278; + int __cil_tmp279; + int __cil_tmp280; + unsigned int __cil_tmp281; + unsigned int __cil_tmp282; + unsigned int __cil_tmp283; + unsigned int __cil_tmp284; + unsigned int __cil_tmp285; + unsigned int __cil_tmp286; + USHORT __cil_tmp287; + unsigned int __cil_tmp288; + unsigned int __cil_tmp289; + unsigned int __cil_tmp290; + unsigned int __cil_tmp291; + UCHAR __cil_tmp292; + int __cil_tmp293; + unsigned int __cil_tmp294; + unsigned int __cil_tmp295; + UCHAR __cil_tmp296; + int __cil_tmp297; + int __cil_tmp298; + unsigned int __cil_tmp299; + unsigned int __cil_tmp300; + UCHAR __cil_tmp301; + int __cil_tmp302; + unsigned int __cil_tmp303; + unsigned int __cil_tmp304; + USHORT __cil_tmp305; + int __cil_tmp306; + int __cil_tmp307; + int __cil_tmp308; + int __cil_tmp309; + unsigned int __cil_tmp310; + unsigned int __cil_tmp311; + unsigned int __cil_tmp312; + unsigned int __cil_tmp313; + DRIVE_MEDIA_TYPE __cil_tmp314; + unsigned int __cil_tmp315; + PDRIVE_MEDIA_CONSTANTS __cil_tmp316; + BOOLEAN *mem_317; + UCHAR *mem_318; + DRIVE_MEDIA_TYPE *mem_319; + DRIVE_MEDIA_TYPE *mem_320; + DRIVE_MEDIA_TYPE *mem_321; + DRIVE_MEDIA_CONSTANTS *mem_322; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_323; + DRIVE_MEDIA_TYPE *mem_324; + UCHAR *mem_325; + DRIVE_MEDIA_TYPE *mem_326; + UCHAR *mem_327; + UCHAR *mem_328; + UCHAR *mem_329; + UCHAR *mem_330; + UCHAR *mem_331; + UCHAR *mem_332; + UCHAR *mem_333; + UCHAR *mem_334; + UCHAR *mem_335; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_336; + UCHAR *mem_337; + DRIVE_MEDIA_TYPE *mem_338; + DRIVE_MEDIA_TYPE *mem_339; + DRIVE_MEDIA_TYPE *mem_340; + DRIVE_MEDIA_CONSTANTS *mem_341; + UCHAR *mem_342; + DRIVE_MEDIA_TYPE *mem_343; + DRIVE_MEDIA_TYPE *mem_344; + MEDIA_TYPE *mem_345; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_346; + MEDIA_TYPE *mem_347; + MEDIA_TYPE *mem_348; + USHORT *mem_349; + ULONG *mem_350; + UCHAR *mem_351; + UCHAR *mem_352; + UCHAR *mem_353; + USHORT *mem_354; + ULONG *mem_355; + DRIVE_MEDIA_TYPE *mem_356; + DRIVE_MEDIA_CONSTANTS *mem_357; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_358; + LONG *mem_359; + LONG *mem_360; + ULONG *mem_361; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_362; + PDEVICE_OBJECT *mem_363; + CHAR *mem_364; + CHAR *mem_365; + struct _IO_STACK_LOCATION **mem_366; + struct _IO_STACK_LOCATION **mem_367; + PMDL *mem_368; + PMDL *mem_369; + DRIVE_MEDIA_TYPE *mem_370; + DRIVE_MEDIA_TYPE *mem_371; + DRIVE_MEDIA_TYPE *mem_372; + DRIVE_MEDIA_CONSTANTS *mem_373; + UCHAR *mem_374; + DRIVE_MEDIA_TYPE *mem_375; + DRIVE_MEDIA_TYPE *mem_376; + MEDIA_TYPE *mem_377; + MEDIA_TYPE *mem_378; + MEDIA_TYPE *mem_379; + USHORT *mem_380; + ULONG *mem_381; + UCHAR *mem_382; + UCHAR *mem_383; + UCHAR *mem_384; + USHORT *mem_385; + ULONG *mem_386; + DRIVE_MEDIA_TYPE *mem_387; + DRIVE_MEDIA_CONSTANTS *mem_388; { #line 3400 - retries = 0UL; - { + retries = 0UL; + { #line 3410 - while (1) { - while_98_continue: /* CIL Label */ ; - goto while_98_break; - } - while_98_break: /* CIL Label */ ; - } + while (1) { + while_98_continue: /* CIL Label */; + goto while_98_break; + } + while_98_break: /* CIL Label */; + } #line 3412 - __cil_tmp13 = (unsigned int )DisketteExtension; + __cil_tmp13 = (unsigned int)DisketteExtension; #line 3412 - __cil_tmp14 = __cil_tmp13 + 250; + __cil_tmp14 = __cil_tmp13 + 250; #line 3412 - mem_317 = (BOOLEAN *)__cil_tmp14; + mem_317 = (BOOLEAN *)__cil_tmp14; #line 3412 - *mem_317 = (unsigned char)0; + *mem_317 = (unsigned char)0; #line 3418 - retries = 0UL; - { + retries = 0UL; + { #line 3418 - while (1) { - while_99_continue: /* CIL Label */ ; + while (1) { + while_99_continue: /* CIL Label */; #line 3418 - if (retries < 3UL) { + if (retries < 3UL) { - } else { - goto while_99_break; - } + } else { + goto while_99_break; + } #line 3420 - if (retries) { - { + if (retries) { + { #line 3432 - while (1) { - while_100_continue: /* CIL Label */ ; - goto while_100_break; - } - while_100_break: /* CIL Label */ ; - } - { + while (1) { + while_100_continue: /* CIL Label */; + goto while_100_break; + } + while_100_break: /* CIL Label */; + } + { #line 3433 - FlInitializeControllerHardware(DisketteExtension); - } - } else { - - } + FlInitializeControllerHardware(DisketteExtension); + } + } else { + } #line 3443 - __cil_tmp15 = (unsigned int )DisketteExtension; + __cil_tmp15 = (unsigned int)DisketteExtension; #line 3443 - __cil_tmp16 = __cil_tmp15 + 216; + __cil_tmp16 = __cil_tmp15 + 216; #line 3443 - __cil_tmp17 = (unsigned int )DisketteExtension; + __cil_tmp17 = (unsigned int)DisketteExtension; #line 3443 - __cil_tmp18 = __cil_tmp17 + 174; + __cil_tmp18 = __cil_tmp17 + 174; #line 3443 - mem_318 = (UCHAR *)__cil_tmp18; + mem_318 = (UCHAR *)__cil_tmp18; #line 3443 - __cil_tmp19 = *mem_318; + __cil_tmp19 = *mem_318; #line 3443 - __cil_tmp20 = (int )__cil_tmp19; + __cil_tmp20 = (int)__cil_tmp19; #line 3443 - __cil_tmp21 = DriveMediaLimits + __cil_tmp20; + __cil_tmp21 = DriveMediaLimits + __cil_tmp20; #line 3443 - mem_319 = (DRIVE_MEDIA_TYPE *)__cil_tmp16; + mem_319 = (DRIVE_MEDIA_TYPE *)__cil_tmp16; #line 3443 - mem_320 = (DRIVE_MEDIA_TYPE *)__cil_tmp21; + mem_320 = (DRIVE_MEDIA_TYPE *)__cil_tmp21; #line 3443 - *mem_319 = *mem_320; + *mem_319 = *mem_320; #line 3445 - __cil_tmp22 = (unsigned int )DisketteExtension; + __cil_tmp22 = (unsigned int)DisketteExtension; #line 3445 - __cil_tmp23 = __cil_tmp22 + 308; + __cil_tmp23 = __cil_tmp22 + 308; #line 3445 - __cil_tmp24 = (unsigned int )DisketteExtension; + __cil_tmp24 = (unsigned int)DisketteExtension; #line 3445 - __cil_tmp25 = __cil_tmp24 + 216; + __cil_tmp25 = __cil_tmp24 + 216; #line 3445 - mem_321 = (DRIVE_MEDIA_TYPE *)__cil_tmp25; + mem_321 = (DRIVE_MEDIA_TYPE *)__cil_tmp25; #line 3445 - __cil_tmp26 = *mem_321; + __cil_tmp26 = *mem_321; #line 3445 - __cil_tmp27 = (unsigned int )__cil_tmp26; + __cil_tmp27 = (unsigned int)__cil_tmp26; #line 3445 - __cil_tmp28 = DriveMediaConstants + __cil_tmp27; + __cil_tmp28 = DriveMediaConstants + __cil_tmp27; #line 3445 - mem_322 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp23; + mem_322 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp23; #line 3445 - *mem_322 = *__cil_tmp28; + *mem_322 = *__cil_tmp28; #line 3448 - mediaTypesExhausted = (unsigned char)0; - { + mediaTypesExhausted = (unsigned char)0; + { #line 3450 - while (1) { - while_101_continue: /* CIL Label */ ; - { + while (1) { + while_101_continue: /* CIL Label */; + { #line 3452 - __cil_tmp29 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp29 = (KUSER_SHARED_DATA * const)4292804608U; #line 3452 - __cil_tmp30 = (unsigned int )__cil_tmp29; + __cil_tmp30 = (unsigned int)__cil_tmp29; #line 3452 - __cil_tmp31 = __cil_tmp30 + 732; + __cil_tmp31 = __cil_tmp30 + 732; #line 3452 - mem_323 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp31; + mem_323 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp31; #line 3452 - __cil_tmp32 = *mem_323; + __cil_tmp32 = *mem_323; #line 3452 - __cil_tmp33 = (int )__cil_tmp32; + __cil_tmp33 = (int)__cil_tmp32; #line 3452 - if (__cil_tmp33 == 1) { - { + if (__cil_tmp33 == 1) { + { #line 3453 - __cil_tmp34 = (unsigned int )DisketteExtension; + __cil_tmp34 = (unsigned int)DisketteExtension; #line 3453 - __cil_tmp35 = __cil_tmp34 + 216; + __cil_tmp35 = __cil_tmp34 + 216; #line 3453 - mem_324 = (DRIVE_MEDIA_TYPE *)__cil_tmp35; + mem_324 = (DRIVE_MEDIA_TYPE *)__cil_tmp35; #line 3453 - __cil_tmp36 = *mem_324; + __cil_tmp36 = *mem_324; #line 3453 - __cil_tmp37 = (unsigned int )__cil_tmp36; + __cil_tmp37 = (unsigned int)__cil_tmp36; #line 3453 - __cil_tmp38 = DriveMediaConstants + __cil_tmp37; + __cil_tmp38 = DriveMediaConstants + __cil_tmp37; #line 3453 - __cil_tmp39 = (unsigned int )__cil_tmp38; + __cil_tmp39 = (unsigned int)__cil_tmp38; #line 3453 - __cil_tmp40 = __cil_tmp39 + 35; + __cil_tmp40 = __cil_tmp39 + 35; #line 3453 - mem_325 = (UCHAR *)__cil_tmp40; + mem_325 = (UCHAR *)__cil_tmp40; #line 3453 - __cil_tmp41 = *mem_325; + __cil_tmp41 = *mem_325; #line 3453 - sectorLengthCode = (unsigned short )__cil_tmp41; + sectorLengthCode = (unsigned short)__cil_tmp41; #line 3455 - FlHdbit(DisketteExtension); - } - } else { - - } - } - { + FlHdbit(DisketteExtension); + } + } else { + } + } + { #line 3459 - ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); - } - { + ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); + } + { #line 3461 - __cil_tmp42 = ntStatus >= 0L; + __cil_tmp42 = ntStatus >= 0L; #line 3461 - if (! __cil_tmp42) { - { + if (!__cil_tmp42) { + { #line 3471 - while (1) { - while_102_continue: /* CIL Label */ ; - goto while_102_break; - } - while_102_break: /* CIL Label */ ; - } + while (1) { + while_102_continue: /* CIL Label */; + goto while_102_break; + } + while_102_break: /* CIL Label */; + } #line 3472 - mediaTypesExhausted = (unsigned char)1; - } else { - { + mediaTypesExhausted = (unsigned char)1; + } else { + { #line 3481 - __cil_tmp43 = (unsigned int )DisketteExtension; + __cil_tmp43 = (unsigned int)DisketteExtension; #line 3481 - __cil_tmp44 = __cil_tmp43 + 216; + __cil_tmp44 = __cil_tmp43 + 216; #line 3481 - mem_326 = (DRIVE_MEDIA_TYPE *)__cil_tmp44; + mem_326 = (DRIVE_MEDIA_TYPE *)__cil_tmp44; #line 3481 - __cil_tmp45 = *mem_326; + __cil_tmp45 = *mem_326; #line 3481 - __cil_tmp46 = (unsigned int )__cil_tmp45; + __cil_tmp46 = (unsigned int)__cil_tmp45; #line 3481 - driveMediaConstants = DriveMediaConstants + __cil_tmp46; + driveMediaConstants = DriveMediaConstants + __cil_tmp46; #line 3488 - __cil_tmp47 = 1 * 1U; + __cil_tmp47 = 1 * 1U; #line 3488 - __cil_tmp48 = 112 + __cil_tmp47; + __cil_tmp48 = 112 + __cil_tmp47; #line 3488 - __cil_tmp49 = (unsigned int )DisketteExtension; + __cil_tmp49 = (unsigned int)DisketteExtension; #line 3488 - __cil_tmp50 = __cil_tmp49 + __cil_tmp48; + __cil_tmp50 = __cil_tmp49 + __cil_tmp48; #line 3488 - __cil_tmp51 = (unsigned int )driveMediaConstants; + __cil_tmp51 = (unsigned int)driveMediaConstants; #line 3488 - __cil_tmp52 = __cil_tmp51 + 51; + __cil_tmp52 = __cil_tmp51 + 51; #line 3488 - mem_327 = (UCHAR *)__cil_tmp52; + mem_327 = (UCHAR *)__cil_tmp52; #line 3488 - __cil_tmp53 = *mem_327; + __cil_tmp53 = *mem_327; #line 3488 - __cil_tmp54 = (int )__cil_tmp53; + __cil_tmp54 = (int)__cil_tmp53; #line 3488 - __cil_tmp55 = __cil_tmp54 - 1; + __cil_tmp55 = __cil_tmp54 - 1; #line 3488 - __cil_tmp56 = __cil_tmp55 << 2; + __cil_tmp56 = __cil_tmp55 << 2; #line 3488 - __cil_tmp57 = (unsigned int )DisketteExtension; + __cil_tmp57 = (unsigned int)DisketteExtension; #line 3488 - __cil_tmp58 = __cil_tmp57 + 248; + __cil_tmp58 = __cil_tmp57 + 248; #line 3488 - mem_328 = (UCHAR *)__cil_tmp58; + mem_328 = (UCHAR *)__cil_tmp58; #line 3488 - __cil_tmp59 = *mem_328; + __cil_tmp59 = *mem_328; #line 3488 - __cil_tmp60 = (int )__cil_tmp59; + __cil_tmp60 = (int)__cil_tmp59; #line 3488 - __cil_tmp61 = __cil_tmp60 | __cil_tmp56; + __cil_tmp61 = __cil_tmp60 | __cil_tmp56; #line 3488 - mem_329 = (UCHAR *)__cil_tmp50; + mem_329 = (UCHAR *)__cil_tmp50; #line 3488 - *mem_329 = (unsigned char )__cil_tmp61; + *mem_329 = (unsigned char)__cil_tmp61; #line 3492 - __cil_tmp62 = 0 * 1U; + __cil_tmp62 = 0 * 1U; #line 3492 - __cil_tmp63 = 112 + __cil_tmp62; + __cil_tmp63 = 112 + __cil_tmp62; #line 3492 - __cil_tmp64 = (unsigned int )DisketteExtension; + __cil_tmp64 = (unsigned int)DisketteExtension; #line 3492 - __cil_tmp65 = __cil_tmp64 + __cil_tmp63; + __cil_tmp65 = __cil_tmp64 + __cil_tmp63; #line 3492 - mem_330 = (UCHAR *)__cil_tmp65; + mem_330 = (UCHAR *)__cil_tmp65; #line 3492 - *mem_330 = (unsigned char)84; + *mem_330 = (unsigned char)84; #line 3495 - __cil_tmp66 = 0 * 1U; + __cil_tmp66 = 0 * 1U; #line 3495 - __cil_tmp67 = 112 + __cil_tmp66; + __cil_tmp67 = 112 + __cil_tmp66; #line 3495 - __cil_tmp68 = (unsigned int )DisketteExtension; + __cil_tmp68 = (unsigned int)DisketteExtension; #line 3495 - __cil_tmp69 = __cil_tmp68 + __cil_tmp67; + __cil_tmp69 = __cil_tmp68 + __cil_tmp67; #line 3495 - __cil_tmp70 = (UCHAR *)__cil_tmp69; + __cil_tmp70 = (UCHAR *)__cil_tmp69; #line 3495 - __cil_tmp71 = 0 * 1U; + __cil_tmp71 = 0 * 1U; #line 3495 - __cil_tmp72 = 112 + __cil_tmp71; + __cil_tmp72 = 112 + __cil_tmp71; #line 3495 - __cil_tmp73 = (unsigned int )DisketteExtension; + __cil_tmp73 = (unsigned int)DisketteExtension; #line 3495 - __cil_tmp74 = __cil_tmp73 + __cil_tmp72; + __cil_tmp74 = __cil_tmp73 + __cil_tmp72; #line 3495 - __cil_tmp75 = (UCHAR *)__cil_tmp74; + __cil_tmp75 = (UCHAR *)__cil_tmp74; #line 3495 - __cil_tmp76 = (void *)0; + __cil_tmp76 = (void *)0; #line 3495 - __cil_tmp77 = (struct _MDL *)__cil_tmp76; + __cil_tmp77 = (struct _MDL *)__cil_tmp76; #line 3495 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp70, __cil_tmp75, __cil_tmp77, - 0UL, 0UL); - } - { + ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp70, + __cil_tmp75, __cil_tmp77, 0UL, 0UL); + } + { #line 3502 - __cil_tmp78 = ntStatus >= 0L; + __cil_tmp78 = ntStatus >= 0L; #line 3502 - if (! __cil_tmp78) { - goto _L; - } else { - { + if (!__cil_tmp78) { + goto _L; + } else { + { #line 3502 - __cil_tmp79 = (unsigned int )driveMediaConstants; + __cil_tmp79 = (unsigned int)driveMediaConstants; #line 3502 - __cil_tmp80 = __cil_tmp79 + 51; + __cil_tmp80 = __cil_tmp79 + 51; #line 3502 - mem_331 = (UCHAR *)__cil_tmp80; + mem_331 = (UCHAR *)__cil_tmp80; #line 3502 - __cil_tmp81 = *mem_331; + __cil_tmp81 = *mem_331; #line 3502 - __cil_tmp82 = (int )__cil_tmp81; + __cil_tmp82 = (int)__cil_tmp81; #line 3502 - __cil_tmp83 = __cil_tmp82 - 1; + __cil_tmp83 = __cil_tmp82 - 1; #line 3502 - __cil_tmp84 = __cil_tmp83 << 2; + __cil_tmp84 = __cil_tmp83 << 2; #line 3502 - __cil_tmp85 = (unsigned int )DisketteExtension; + __cil_tmp85 = (unsigned int)DisketteExtension; #line 3502 - __cil_tmp86 = __cil_tmp85 + 248; + __cil_tmp86 = __cil_tmp85 + 248; #line 3502 - mem_332 = (UCHAR *)__cil_tmp86; + mem_332 = (UCHAR *)__cil_tmp86; #line 3502 - __cil_tmp87 = *mem_332; + __cil_tmp87 = *mem_332; #line 3502 - __cil_tmp88 = (int )__cil_tmp87; + __cil_tmp88 = (int)__cil_tmp87; #line 3502 - __cil_tmp89 = __cil_tmp88 | __cil_tmp84; + __cil_tmp89 = __cil_tmp88 | __cil_tmp84; #line 3502 - __cil_tmp90 = (unsigned char )__cil_tmp89; + __cil_tmp90 = (unsigned char)__cil_tmp89; #line 3502 - __cil_tmp91 = (int )__cil_tmp90; + __cil_tmp91 = (int)__cil_tmp90; #line 3502 - __cil_tmp92 = 0 * 1U; + __cil_tmp92 = 0 * 1U; #line 3502 - __cil_tmp93 = 112 + __cil_tmp92; + __cil_tmp93 = 112 + __cil_tmp92; #line 3502 - __cil_tmp94 = (unsigned int )DisketteExtension; + __cil_tmp94 = (unsigned int)DisketteExtension; #line 3502 - __cil_tmp95 = __cil_tmp94 + __cil_tmp93; + __cil_tmp95 = __cil_tmp94 + __cil_tmp93; #line 3502 - mem_333 = (UCHAR *)__cil_tmp95; + mem_333 = (UCHAR *)__cil_tmp95; #line 3502 - __cil_tmp96 = *mem_333; + __cil_tmp96 = *mem_333; #line 3502 - __cil_tmp97 = (int )__cil_tmp96; + __cil_tmp97 = (int)__cil_tmp96; #line 3502 - __cil_tmp98 = __cil_tmp97 & -33; + __cil_tmp98 = __cil_tmp97 & -33; #line 3502 - if (__cil_tmp98 != __cil_tmp91) { - goto _L; - } else { - { + if (__cil_tmp98 != __cil_tmp91) { + goto _L; + } else { + { #line 3502 - __cil_tmp99 = 1 * 1U; + __cil_tmp99 = 1 * 1U; #line 3502 - __cil_tmp100 = 112 + __cil_tmp99; + __cil_tmp100 = 112 + __cil_tmp99; #line 3502 - __cil_tmp101 = (unsigned int )DisketteExtension; + __cil_tmp101 = (unsigned int)DisketteExtension; #line 3502 - __cil_tmp102 = __cil_tmp101 + __cil_tmp100; + __cil_tmp102 = __cil_tmp101 + __cil_tmp100; #line 3502 - mem_334 = (UCHAR *)__cil_tmp102; + mem_334 = (UCHAR *)__cil_tmp102; #line 3502 - __cil_tmp103 = *mem_334; + __cil_tmp103 = *mem_334; #line 3502 - __cil_tmp104 = (int )__cil_tmp103; + __cil_tmp104 = (int)__cil_tmp103; #line 3502 - if (__cil_tmp104 != 0) { - goto _L; - } else { - { + if (__cil_tmp104 != 0) { + goto _L; + } else { + { #line 3502 - __cil_tmp105 = 2 * 1U; + __cil_tmp105 = 2 * 1U; #line 3502 - __cil_tmp106 = 112 + __cil_tmp105; + __cil_tmp106 = 112 + __cil_tmp105; #line 3502 - __cil_tmp107 = (unsigned int )DisketteExtension; + __cil_tmp107 = (unsigned int)DisketteExtension; #line 3502 - __cil_tmp108 = __cil_tmp107 + __cil_tmp106; + __cil_tmp108 = __cil_tmp107 + __cil_tmp106; #line 3502 - mem_335 = (UCHAR *)__cil_tmp108; + mem_335 = (UCHAR *)__cil_tmp108; #line 3502 - __cil_tmp109 = *mem_335; + __cil_tmp109 = *mem_335; #line 3502 - __cil_tmp110 = (int )__cil_tmp109; + __cil_tmp110 = (int)__cil_tmp109; #line 3502 - if (__cil_tmp110 != 0) { - goto _L; - } else { - { + if (__cil_tmp110 != 0) { + goto _L; + } else { + { #line 3502 - __cil_tmp111 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp111 = + (KUSER_SHARED_DATA * const)4292804608U; #line 3502 - __cil_tmp112 = (unsigned int )__cil_tmp111; + __cil_tmp112 = (unsigned int)__cil_tmp111; #line 3502 - __cil_tmp113 = __cil_tmp112 + 732; + __cil_tmp113 = __cil_tmp112 + 732; #line 3502 - mem_336 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp113; + mem_336 = (ALTERNATIVE_ARCHITECTURE_TYPE *) + __cil_tmp113; #line 3502 - __cil_tmp114 = *mem_336; + __cil_tmp114 = *mem_336; #line 3502 - __cil_tmp115 = (int )__cil_tmp114; + __cil_tmp115 = (int)__cil_tmp114; #line 3502 - if (__cil_tmp115 == 1) { - { + if (__cil_tmp115 == 1) { + { #line 3502 - __cil_tmp116 = (int )sectorLengthCode; + __cil_tmp116 = (int)sectorLengthCode; #line 3502 - __cil_tmp117 = 6 * 1U; + __cil_tmp117 = 6 * 1U; #line 3502 - __cil_tmp118 = 112 + __cil_tmp117; + __cil_tmp118 = 112 + __cil_tmp117; #line 3502 - __cil_tmp119 = (unsigned int )DisketteExtension; + __cil_tmp119 = + (unsigned int)DisketteExtension; #line 3502 - __cil_tmp120 = __cil_tmp119 + __cil_tmp118; + __cil_tmp120 = + __cil_tmp119 + __cil_tmp118; #line 3502 - mem_337 = (UCHAR *)__cil_tmp120; + mem_337 = (UCHAR *)__cil_tmp120; #line 3502 - __cil_tmp121 = *mem_337; + __cil_tmp121 = *mem_337; #line 3502 - __cil_tmp122 = (int )__cil_tmp121; + __cil_tmp122 = (int)__cil_tmp121; #line 3502 - if (__cil_tmp122 != __cil_tmp116) { - _L: - { + if (__cil_tmp122 != __cil_tmp116) { + _L : { #line 3522 - while (1) { - while_103_continue: /* CIL Label */ ; - goto while_103_break; - } - while_103_break: /* CIL Label */ ; - } + while (1) { + while_103_continue: /* CIL Label */; + goto while_103_break; + } + while_103_break: /* CIL Label */; + } #line 3524 - __cil_tmp123 = (unsigned int )DisketteExtension; + __cil_tmp123 = + (unsigned int)DisketteExtension; #line 3524 - __cil_tmp124 = __cil_tmp123 + 216; + __cil_tmp124 = __cil_tmp123 + 216; #line 3524 - __cil_tmp125 = (unsigned int )DisketteExtension; + __cil_tmp125 = + (unsigned int)DisketteExtension; #line 3524 - __cil_tmp126 = __cil_tmp125 + 216; + __cil_tmp126 = __cil_tmp125 + 216; #line 3524 - mem_338 = (DRIVE_MEDIA_TYPE *)__cil_tmp126; + mem_338 = + (DRIVE_MEDIA_TYPE *)__cil_tmp126; #line 3524 - __cil_tmp127 = *mem_338; + __cil_tmp127 = *mem_338; #line 3524 - __cil_tmp128 = (int )__cil_tmp127; + __cil_tmp128 = (int)__cil_tmp127; #line 3524 - __cil_tmp129 = __cil_tmp128 - 1; + __cil_tmp129 = __cil_tmp128 - 1; #line 3524 - mem_339 = (DRIVE_MEDIA_TYPE *)__cil_tmp124; + mem_339 = + (DRIVE_MEDIA_TYPE *)__cil_tmp124; #line 3524 - *mem_339 = (enum _DRIVE_MEDIA_TYPE )__cil_tmp129; + *mem_339 = (enum _DRIVE_MEDIA_TYPE) + __cil_tmp129; #line 3525 - __cil_tmp130 = (unsigned int )DisketteExtension; + __cil_tmp130 = + (unsigned int)DisketteExtension; #line 3525 - __cil_tmp131 = __cil_tmp130 + 308; + __cil_tmp131 = __cil_tmp130 + 308; #line 3525 - __cil_tmp132 = (unsigned int )DisketteExtension; + __cil_tmp132 = + (unsigned int)DisketteExtension; #line 3525 - __cil_tmp133 = __cil_tmp132 + 216; + __cil_tmp133 = __cil_tmp132 + 216; #line 3525 - mem_340 = (DRIVE_MEDIA_TYPE *)__cil_tmp133; + mem_340 = + (DRIVE_MEDIA_TYPE *)__cil_tmp133; #line 3525 - __cil_tmp134 = *mem_340; + __cil_tmp134 = *mem_340; #line 3525 - __cil_tmp135 = (unsigned int )__cil_tmp134; + __cil_tmp135 = + (unsigned int)__cil_tmp134; #line 3525 - __cil_tmp136 = DriveMediaConstants + __cil_tmp135; + __cil_tmp136 = + DriveMediaConstants + __cil_tmp135; #line 3525 - mem_341 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp131; + mem_341 = (DRIVE_MEDIA_CONSTANTS *) + __cil_tmp131; #line 3525 - *mem_341 = *__cil_tmp136; + *mem_341 = *__cil_tmp136; #line 3528 - if (ntStatus != -1073741661L) { + if (ntStatus != -1073741661L) { #line 3530 - ntStatus = -1073741804L; - } else { - - } - { + ntStatus = -1073741804L; + } else { + } + { #line 3538 - __cil_tmp137 = (unsigned int )DisketteExtension; + __cil_tmp137 = + (unsigned int)DisketteExtension; #line 3538 - __cil_tmp138 = __cil_tmp137 + 174; + __cil_tmp138 = __cil_tmp137 + 174; #line 3538 - mem_342 = (UCHAR *)__cil_tmp138; + mem_342 = (UCHAR *)__cil_tmp138; #line 3538 - __cil_tmp139 = *mem_342; + __cil_tmp139 = *mem_342; #line 3538 - __cil_tmp140 = (int )__cil_tmp139; + __cil_tmp140 = (int)__cil_tmp139; #line 3538 - __cil_tmp141 = DriveMediaLimits + __cil_tmp140; + __cil_tmp141 = + DriveMediaLimits + __cil_tmp140; #line 3538 - __cil_tmp142 = (unsigned int )__cil_tmp141; + __cil_tmp142 = + (unsigned int)__cil_tmp141; #line 3538 - __cil_tmp143 = __cil_tmp142 + 32; + __cil_tmp143 = __cil_tmp142 + 32; #line 3538 - mem_343 = (DRIVE_MEDIA_TYPE *)__cil_tmp143; + mem_343 = + (DRIVE_MEDIA_TYPE *)__cil_tmp143; #line 3538 - __cil_tmp144 = *mem_343; + __cil_tmp144 = *mem_343; #line 3538 - __cil_tmp145 = (char )__cil_tmp144; + __cil_tmp145 = (char)__cil_tmp144; #line 3538 - __cil_tmp146 = (int )__cil_tmp145; + __cil_tmp146 = (int)__cil_tmp145; #line 3538 - __cil_tmp147 = (unsigned int )DisketteExtension; + __cil_tmp147 = + (unsigned int)DisketteExtension; #line 3538 - __cil_tmp148 = __cil_tmp147 + 216; + __cil_tmp148 = __cil_tmp147 + 216; #line 3538 - mem_344 = (DRIVE_MEDIA_TYPE *)__cil_tmp148; + mem_344 = + (DRIVE_MEDIA_TYPE *)__cil_tmp148; #line 3538 - __cil_tmp149 = *mem_344; + __cil_tmp149 = *mem_344; #line 3538 - __cil_tmp150 = (char )__cil_tmp149; + __cil_tmp150 = (char)__cil_tmp149; #line 3538 - __cil_tmp151 = (int )__cil_tmp150; + __cil_tmp151 = (int)__cil_tmp150; #line 3538 - if (__cil_tmp151 < __cil_tmp146) { + if (__cil_tmp151 < __cil_tmp146) { #line 3542 - __cil_tmp152 = (unsigned int )DisketteExtension; + __cil_tmp152 = + (unsigned int)DisketteExtension; #line 3542 - __cil_tmp153 = __cil_tmp152 + 184; + __cil_tmp153 = __cil_tmp152 + 184; #line 3542 - mem_345 = (MEDIA_TYPE *)__cil_tmp153; + mem_345 = + (MEDIA_TYPE *)__cil_tmp153; #line 3542 - *mem_345 = (enum _MEDIA_TYPE )0; + *mem_345 = (enum _MEDIA_TYPE)0; #line 3543 - mediaTypesExhausted = (unsigned char)1; - { + mediaTypesExhausted = + (unsigned char)1; + { #line 3548 - while (1) { - while_104_continue: /* CIL Label */ ; - goto while_104_break; - } - while_104_break: /* CIL Label */ ; - } - } else { - - } - } - } else { - goto _L___0; - } - } - } else { - _L___0: - { + while (1) { + while_104_continue + : /* CIL Label */; + goto while_104_break; + } + while_104_break: /* CIL Label */; + } + } else { + } + } + } else { + goto _L___0; + } + } + } else { + _L___0 : { #line 3553 - __cil_tmp154 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp154 = + (KUSER_SHARED_DATA * const)4292804608U; #line 3553 - __cil_tmp155 = (unsigned int )__cil_tmp154; + __cil_tmp155 = (unsigned int)__cil_tmp154; #line 3553 - __cil_tmp156 = __cil_tmp155 + 732; + __cil_tmp156 = __cil_tmp155 + 732; #line 3553 - mem_346 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp156; + mem_346 = (ALTERNATIVE_ARCHITECTURE_TYPE *) + __cil_tmp156; #line 3553 - __cil_tmp157 = *mem_346; + __cil_tmp157 = *mem_346; #line 3553 - __cil_tmp158 = (int )__cil_tmp157; + __cil_tmp158 = (int)__cil_tmp157; #line 3553 - if (__cil_tmp158 == 1) { + if (__cil_tmp158 == 1) { #line 3558 - __cil_tmp159 = (unsigned int )DisketteExtension; + __cil_tmp159 = + (unsigned int)DisketteExtension; #line 3558 - __cil_tmp160 = __cil_tmp159 + 184; + __cil_tmp160 = __cil_tmp159 + 184; #line 3558 - mem_347 = (MEDIA_TYPE *)__cil_tmp160; + mem_347 = (MEDIA_TYPE *)__cil_tmp160; #line 3558 - mem_348 = (MEDIA_TYPE *)driveMediaConstants; + mem_348 = + (MEDIA_TYPE *)driveMediaConstants; #line 3558 - *mem_347 = *mem_348; + *mem_347 = *mem_348; #line 3560 - __cil_tmp161 = (unsigned int )DisketteExtension; + __cil_tmp161 = + (unsigned int)DisketteExtension; #line 3560 - __cil_tmp162 = __cil_tmp161 + 176; + __cil_tmp162 = __cil_tmp161 + 176; #line 3560 - __cil_tmp163 = (unsigned int )driveMediaConstants; + __cil_tmp163 = + (unsigned int)driveMediaConstants; #line 3560 - __cil_tmp164 = __cil_tmp163 + 36; + __cil_tmp164 = __cil_tmp163 + 36; #line 3560 - mem_349 = (USHORT *)__cil_tmp164; + mem_349 = (USHORT *)__cil_tmp164; #line 3560 - __cil_tmp165 = *mem_349; + __cil_tmp165 = *mem_349; #line 3560 - mem_350 = (ULONG *)__cil_tmp162; + mem_350 = (ULONG *)__cil_tmp162; #line 3560 - *mem_350 = (unsigned long )__cil_tmp165; - { + *mem_350 = (unsigned long)__cil_tmp165; + { #line 3566 - while (1) { - while_105_continue: /* CIL Label */ ; - goto while_105_break; - } - while_105_break: /* CIL Label */ ; - } + while (1) { + while_105_continue: /* CIL Label */; + goto while_105_break; + } + while_105_break: /* CIL Label */; + } #line 3568 - __cil_tmp166 = (unsigned int )DisketteExtension; + __cil_tmp166 = + (unsigned int)DisketteExtension; #line 3568 - __cil_tmp167 = __cil_tmp166 + 180; + __cil_tmp167 = __cil_tmp166 + 180; #line 3568 - __cil_tmp168 = (unsigned int )driveMediaConstants; + __cil_tmp168 = + (unsigned int)driveMediaConstants; #line 3568 - __cil_tmp169 = __cil_tmp168 + 51; + __cil_tmp169 = __cil_tmp168 + 51; #line 3568 - mem_351 = (UCHAR *)__cil_tmp169; + mem_351 = (UCHAR *)__cil_tmp169; #line 3568 - __cil_tmp170 = *mem_351; + __cil_tmp170 = *mem_351; #line 3568 - __cil_tmp171 = (int )__cil_tmp170; + __cil_tmp171 = (int)__cil_tmp170; #line 3568 - __cil_tmp172 = (unsigned int )driveMediaConstants; + __cil_tmp172 = + (unsigned int)driveMediaConstants; #line 3568 - __cil_tmp173 = __cil_tmp172 + 48; + __cil_tmp173 = __cil_tmp172 + 48; #line 3568 - mem_352 = (UCHAR *)__cil_tmp173; + mem_352 = (UCHAR *)__cil_tmp173; #line 3568 - __cil_tmp174 = *mem_352; + __cil_tmp174 = *mem_352; #line 3568 - __cil_tmp175 = (int )__cil_tmp174; + __cil_tmp175 = (int)__cil_tmp174; #line 3568 - __cil_tmp176 = 1 + __cil_tmp175; + __cil_tmp176 = 1 + __cil_tmp175; #line 3568 - __cil_tmp177 = (unsigned int )driveMediaConstants; + __cil_tmp177 = + (unsigned int)driveMediaConstants; #line 3568 - __cil_tmp178 = __cil_tmp177 + 38; + __cil_tmp178 = __cil_tmp177 + 38; #line 3568 - mem_353 = (UCHAR *)__cil_tmp178; + mem_353 = (UCHAR *)__cil_tmp178; #line 3568 - __cil_tmp179 = *mem_353; + __cil_tmp179 = *mem_353; #line 3568 - __cil_tmp180 = (int )__cil_tmp179; + __cil_tmp180 = (int)__cil_tmp179; #line 3568 - __cil_tmp181 = (unsigned int )driveMediaConstants; + __cil_tmp181 = + (unsigned int)driveMediaConstants; #line 3568 - __cil_tmp182 = __cil_tmp181 + 36; + __cil_tmp182 = __cil_tmp181 + 36; #line 3568 - mem_354 = (USHORT *)__cil_tmp182; + mem_354 = (USHORT *)__cil_tmp182; #line 3568 - __cil_tmp183 = *mem_354; + __cil_tmp183 = *mem_354; #line 3568 - __cil_tmp184 = (int )__cil_tmp183; + __cil_tmp184 = (int)__cil_tmp183; #line 3568 - __cil_tmp185 = __cil_tmp184 * __cil_tmp180; + __cil_tmp185 = + __cil_tmp184 * __cil_tmp180; #line 3568 - __cil_tmp186 = __cil_tmp185 * __cil_tmp176; + __cil_tmp186 = + __cil_tmp185 * __cil_tmp176; #line 3568 - __cil_tmp187 = __cil_tmp186 * __cil_tmp171; + __cil_tmp187 = + __cil_tmp186 * __cil_tmp171; #line 3568 - mem_355 = (ULONG *)__cil_tmp167; + mem_355 = (ULONG *)__cil_tmp167; #line 3568 - *mem_355 = (unsigned long )__cil_tmp187; + *mem_355 = (unsigned long)__cil_tmp187; #line 3578 - __cil_tmp188 = (unsigned int )DisketteExtension; + __cil_tmp188 = + (unsigned int)DisketteExtension; #line 3578 - __cil_tmp189 = __cil_tmp188 + 308; + __cil_tmp189 = __cil_tmp188 + 308; #line 3578 - __cil_tmp190 = (unsigned int )DisketteExtension; + __cil_tmp190 = + (unsigned int)DisketteExtension; #line 3578 - __cil_tmp191 = __cil_tmp190 + 216; + __cil_tmp191 = __cil_tmp190 + 216; #line 3578 - mem_356 = (DRIVE_MEDIA_TYPE *)__cil_tmp191; + mem_356 = + (DRIVE_MEDIA_TYPE *)__cil_tmp191; #line 3578 - __cil_tmp192 = *mem_356; + __cil_tmp192 = *mem_356; #line 3578 - __cil_tmp193 = (unsigned int )__cil_tmp192; + __cil_tmp193 = (unsigned int)__cil_tmp192; #line 3578 - __cil_tmp194 = DriveMediaConstants + __cil_tmp193; + __cil_tmp194 = + DriveMediaConstants + __cil_tmp193; #line 3578 - mem_357 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp189; + mem_357 = + (DRIVE_MEDIA_CONSTANTS *)__cil_tmp189; #line 3578 - *mem_357 = *__cil_tmp194; - { + *mem_357 = *__cil_tmp194; + { #line 3588 - __cil_tmp195 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp195 = (KUSER_SHARED_DATA * + const)4292804608U; #line 3588 - __cil_tmp196 = (unsigned int )__cil_tmp195; + __cil_tmp196 = + (unsigned int)__cil_tmp195; #line 3588 - __cil_tmp197 = __cil_tmp196 + 732; + __cil_tmp197 = __cil_tmp196 + 732; #line 3588 - mem_358 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp197; + mem_358 = + (ALTERNATIVE_ARCHITECTURE_TYPE *) + __cil_tmp197; #line 3588 - __cil_tmp198 = *mem_358; + __cil_tmp198 = *mem_358; #line 3588 - __cil_tmp199 = (int )__cil_tmp198; + __cil_tmp199 = (int)__cil_tmp198; #line 3588 - if (__cil_tmp199 == 1) { + if (__cil_tmp199 == 1) { #line 3588 - tmp = 1024; - } else { + tmp = 1024; + } else { #line 3588 - tmp = 512; - } - } - { + tmp = 512; + } + } + { #line 3588 - __cil_tmp200 = (enum _POOL_TYPE )4; + __cil_tmp200 = (enum _POOL_TYPE)4; #line 3588 - __cil_tmp201 = (unsigned long )tmp; + __cil_tmp201 = (unsigned long)tmp; #line 3588 - tmp___0 = ExAllocatePoolWithTag(__cil_tmp200, __cil_tmp201, 1886350406UL); + tmp___0 = ExAllocatePoolWithTag( + __cil_tmp200, __cil_tmp201, + 1886350406UL); #line 3588 - bootSector = (struct _BOOT_SECTOR_INFO *)tmp___0; - } + bootSector = + (struct _BOOT_SECTOR_INFO *)tmp___0; + } #line 3589 - if (! bootSector) { + if (!bootSector) { #line 3590 - return (-1073741670L); - } else { - - } + return (-1073741670L); + } else { + } #line 3593 - __cil_tmp202 = 0 + 4; + __cil_tmp202 = 0 + 4; #line 3593 - __cil_tmp203 = (unsigned int )(& offset) + __cil_tmp202; + __cil_tmp203 = (unsigned int)(&offset) + + __cil_tmp202; #line 3593 - mem_359 = (LONG *)__cil_tmp203; + mem_359 = (LONG *)__cil_tmp203; #line 3593 - *mem_359 = 0L; + *mem_359 = 0L; #line 3593 - __cil_tmp204 = & offset; + __cil_tmp204 = &offset; #line 3593 - __cil_tmp205 = 0 + 4; + __cil_tmp205 = 0 + 4; #line 3593 - __cil_tmp206 = (unsigned int )(& offset) + __cil_tmp205; + __cil_tmp206 = (unsigned int)(&offset) + + __cil_tmp205; #line 3593 - mem_360 = (LONG *)__cil_tmp206; + mem_360 = (LONG *)__cil_tmp206; #line 3593 - __cil_tmp207 = *mem_360; + __cil_tmp207 = *mem_360; #line 3593 - mem_361 = (ULONG *)__cil_tmp204; + mem_361 = (ULONG *)__cil_tmp204; #line 3593 - *mem_361 = (unsigned long )__cil_tmp207; - { + *mem_361 = (unsigned long)__cil_tmp207; + { #line 3594 - __cil_tmp208 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp208 = (KUSER_SHARED_DATA * + const)4292804608U; #line 3594 - __cil_tmp209 = (unsigned int )__cil_tmp208; + __cil_tmp209 = + (unsigned int)__cil_tmp208; #line 3594 - __cil_tmp210 = __cil_tmp209 + 732; + __cil_tmp210 = __cil_tmp209 + 732; #line 3594 - mem_362 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp210; + mem_362 = + (ALTERNATIVE_ARCHITECTURE_TYPE *) + __cil_tmp210; #line 3594 - __cil_tmp211 = *mem_362; + __cil_tmp211 = *mem_362; #line 3594 - __cil_tmp212 = (int )__cil_tmp211; + __cil_tmp212 = (int)__cil_tmp211; #line 3594 - if (__cil_tmp212 == 1) { + if (__cil_tmp212 == 1) { #line 3594 - tmp___1 = 1024; - } else { + tmp___1 = 1024; + } else { #line 3594 - tmp___1 = 512; - } - } - { + tmp___1 = 512; + } + } + { #line 3594 - __cil_tmp213 = (unsigned int )DisketteExtension; + __cil_tmp213 = + (unsigned int)DisketteExtension; #line 3594 - __cil_tmp214 = __cil_tmp213 + 28; + __cil_tmp214 = __cil_tmp213 + 28; #line 3594 - mem_363 = (PDEVICE_OBJECT *)__cil_tmp214; + mem_363 = + (PDEVICE_OBJECT *)__cil_tmp214; #line 3594 - __cil_tmp215 = *mem_363; + __cil_tmp215 = *mem_363; #line 3594 - __cil_tmp216 = (void *)bootSector; + __cil_tmp216 = (void *)bootSector; #line 3594 - __cil_tmp217 = (unsigned long )tmp___1; + __cil_tmp217 = (unsigned long)tmp___1; #line 3594 - __cil_tmp218 = (void *)0; + __cil_tmp218 = (void *)0; #line 3594 - __cil_tmp219 = (struct _IO_STATUS_BLOCK *)__cil_tmp218; + __cil_tmp219 = + (struct _IO_STATUS_BLOCK *) + __cil_tmp218; #line 3594 - irp = IoBuildAsynchronousFsdRequest(3UL, __cil_tmp215, __cil_tmp216, - __cil_tmp217, & offset, __cil_tmp219); - } + irp = IoBuildAsynchronousFsdRequest( + 3UL, __cil_tmp215, __cil_tmp216, + __cil_tmp217, &offset, + __cil_tmp219); + } #line 3600 - if (! irp) { - { + if (!irp) { + { #line 3603 - while (1) { - while_106_continue: /* CIL Label */ ; - goto while_106_break; - } - while_106_break: /* CIL Label */ ; - } - { + while (1) { + while_106_continue: /* CIL Label */; + goto while_106_break; + } + while_106_break: /* CIL Label */; + } + { #line 3604 - __cil_tmp220 = (void *)bootSector; + __cil_tmp220 = (void *)bootSector; #line 3604 - ExFreePool(__cil_tmp220); - } + ExFreePool(__cil_tmp220); + } #line 3605 - return (-1073741670L); - } else { - - } - { + return (-1073741670L); + } else { + } + { #line 3607 - __cil_tmp221 = (unsigned int )irp; + __cil_tmp221 = (unsigned int)irp; #line 3607 - __cil_tmp222 = __cil_tmp221 + 35; + __cil_tmp222 = __cil_tmp221 + 35; #line 3607 - __cil_tmp223 = (unsigned int )irp; + __cil_tmp223 = (unsigned int)irp; #line 3607 - __cil_tmp224 = __cil_tmp223 + 35; + __cil_tmp224 = __cil_tmp223 + 35; #line 3607 - mem_364 = (CHAR *)__cil_tmp224; + mem_364 = (CHAR *)__cil_tmp224; #line 3607 - __cil_tmp225 = *mem_364; + __cil_tmp225 = *mem_364; #line 3607 - __cil_tmp226 = (int )__cil_tmp225; + __cil_tmp226 = (int)__cil_tmp225; #line 3607 - __cil_tmp227 = __cil_tmp226 - 1; + __cil_tmp227 = __cil_tmp226 - 1; #line 3607 - mem_365 = (CHAR *)__cil_tmp222; + mem_365 = (CHAR *)__cil_tmp222; #line 3607 - *mem_365 = (char )__cil_tmp227; + *mem_365 = (char)__cil_tmp227; #line 3608 - __cil_tmp228 = 24 + 8; + __cil_tmp228 = 24 + 8; #line 3608 - __cil_tmp229 = 0 + __cil_tmp228; + __cil_tmp229 = 0 + __cil_tmp228; #line 3608 - __cil_tmp230 = 64 + __cil_tmp229; + __cil_tmp230 = 64 + __cil_tmp229; #line 3608 - __cil_tmp231 = (unsigned int )irp; + __cil_tmp231 = (unsigned int)irp; #line 3608 - __cil_tmp232 = __cil_tmp231 + __cil_tmp230; + __cil_tmp232 = + __cil_tmp231 + __cil_tmp230; #line 3608 - __cil_tmp233 = 24 + 8; + __cil_tmp233 = 24 + 8; #line 3608 - __cil_tmp234 = 0 + __cil_tmp233; + __cil_tmp234 = 0 + __cil_tmp233; #line 3608 - __cil_tmp235 = 64 + __cil_tmp234; + __cil_tmp235 = 64 + __cil_tmp234; #line 3608 - __cil_tmp236 = (unsigned int )irp; + __cil_tmp236 = (unsigned int)irp; #line 3608 - __cil_tmp237 = __cil_tmp236 + __cil_tmp235; + __cil_tmp237 = + __cil_tmp236 + __cil_tmp235; #line 3608 - mem_366 = (struct _IO_STACK_LOCATION **)__cil_tmp237; + mem_366 = (struct _IO_STACK_LOCATION **) + __cil_tmp237; #line 3608 - __cil_tmp238 = *mem_366; + __cil_tmp238 = *mem_366; #line 3608 - mem_367 = (struct _IO_STACK_LOCATION **)__cil_tmp232; + mem_367 = (struct _IO_STACK_LOCATION **) + __cil_tmp232; #line 3608 - *mem_367 = __cil_tmp238 - 1; + *mem_367 = __cil_tmp238 - 1; #line 3613 - ntStatus = FlReadWrite(DisketteExtension, irp, (unsigned char)1); - } - { + ntStatus = + FlReadWrite(DisketteExtension, irp, + (unsigned char)1); + } + { #line 3618 - while (1) { - while_107_continue: /* CIL Label */ ; - goto while_107_break; - } - while_107_break: /* CIL Label */ ; - } - { + while (1) { + while_107_continue: /* CIL Label */; + goto while_107_break; + } + while_107_break: /* CIL Label */; + } + { #line 3620 - __cil_tmp239 = (unsigned int )irp; + __cil_tmp239 = (unsigned int)irp; #line 3620 - __cil_tmp240 = __cil_tmp239 + 4; + __cil_tmp240 = __cil_tmp239 + 4; #line 3620 - mem_368 = (PMDL *)__cil_tmp240; + mem_368 = (PMDL *)__cil_tmp240; #line 3620 - __cil_tmp241 = *mem_368; + __cil_tmp241 = *mem_368; #line 3620 - MmUnlockPages(__cil_tmp241); + MmUnlockPages(__cil_tmp241); #line 3621 - __cil_tmp242 = (unsigned int )irp; + __cil_tmp242 = (unsigned int)irp; #line 3621 - __cil_tmp243 = __cil_tmp242 + 4; + __cil_tmp243 = __cil_tmp242 + 4; #line 3621 - mem_369 = (PMDL *)__cil_tmp243; + mem_369 = (PMDL *)__cil_tmp243; #line 3621 - __cil_tmp244 = *mem_369; + __cil_tmp244 = *mem_369; #line 3621 - IoFreeMdl(__cil_tmp244); + IoFreeMdl(__cil_tmp244); #line 3622 - IoFreeIrp(irp); + IoFreeIrp(irp); #line 3623 - __cil_tmp245 = (void *)bootSector; + __cil_tmp245 = (void *)bootSector; #line 3623 - ExFreePool(__cil_tmp245); - } - { + ExFreePool(__cil_tmp245); + } + { #line 3625 - __cil_tmp246 = ntStatus >= 0L; + __cil_tmp246 = ntStatus >= 0L; #line 3625 - if (! __cil_tmp246) { - { + if (!__cil_tmp246) { + { #line 3642 - while (1) { - while_108_continue: /* CIL Label */ ; - goto while_108_break; - } - while_108_break: /* CIL Label */ ; - } + while (1) { + while_108_continue: /* CIL Label */; + goto while_108_break; + } + while_108_break: /* CIL Label */; + } #line 3644 - __cil_tmp247 = (unsigned int )DisketteExtension; + __cil_tmp247 = + (unsigned int)DisketteExtension; #line 3644 - __cil_tmp248 = __cil_tmp247 + 216; + __cil_tmp248 = __cil_tmp247 + 216; #line 3644 - __cil_tmp249 = (unsigned int )DisketteExtension; + __cil_tmp249 = + (unsigned int)DisketteExtension; #line 3644 - __cil_tmp250 = __cil_tmp249 + 216; + __cil_tmp250 = __cil_tmp249 + 216; #line 3644 - mem_370 = (DRIVE_MEDIA_TYPE *)__cil_tmp250; + mem_370 = + (DRIVE_MEDIA_TYPE *)__cil_tmp250; #line 3644 - __cil_tmp251 = *mem_370; + __cil_tmp251 = *mem_370; #line 3644 - __cil_tmp252 = (int )__cil_tmp251; + __cil_tmp252 = (int)__cil_tmp251; #line 3644 - __cil_tmp253 = __cil_tmp252 - 1; + __cil_tmp253 = __cil_tmp252 - 1; #line 3644 - mem_371 = (DRIVE_MEDIA_TYPE *)__cil_tmp248; + mem_371 = + (DRIVE_MEDIA_TYPE *)__cil_tmp248; #line 3644 - *mem_371 = (enum _DRIVE_MEDIA_TYPE )__cil_tmp253; + *mem_371 = (enum _DRIVE_MEDIA_TYPE) + __cil_tmp253; #line 3646 - __cil_tmp254 = (unsigned int )DisketteExtension; + __cil_tmp254 = + (unsigned int)DisketteExtension; #line 3646 - __cil_tmp255 = __cil_tmp254 + 308; + __cil_tmp255 = __cil_tmp254 + 308; #line 3646 - __cil_tmp256 = (unsigned int )DisketteExtension; + __cil_tmp256 = + (unsigned int)DisketteExtension; #line 3646 - __cil_tmp257 = __cil_tmp256 + 216; + __cil_tmp257 = __cil_tmp256 + 216; #line 3646 - mem_372 = (DRIVE_MEDIA_TYPE *)__cil_tmp257; + mem_372 = + (DRIVE_MEDIA_TYPE *)__cil_tmp257; #line 3646 - __cil_tmp258 = *mem_372; + __cil_tmp258 = *mem_372; #line 3646 - __cil_tmp259 = (unsigned int )__cil_tmp258; + __cil_tmp259 = + (unsigned int)__cil_tmp258; #line 3646 - __cil_tmp260 = DriveMediaConstants + __cil_tmp259; + __cil_tmp260 = DriveMediaConstants + + __cil_tmp259; #line 3646 - mem_373 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp255; + mem_373 = (DRIVE_MEDIA_CONSTANTS *) + __cil_tmp255; #line 3646 - *mem_373 = *__cil_tmp260; + *mem_373 = *__cil_tmp260; #line 3649 - if (ntStatus != -1073741661L) { + if (ntStatus != -1073741661L) { #line 3651 - ntStatus = -1073741804L; - } else { - - } - { + ntStatus = -1073741804L; + } else { + } + { #line 3660 - __cil_tmp261 = (unsigned int )DisketteExtension; + __cil_tmp261 = + (unsigned int)DisketteExtension; #line 3660 - __cil_tmp262 = __cil_tmp261 + 174; + __cil_tmp262 = __cil_tmp261 + 174; #line 3660 - mem_374 = (UCHAR *)__cil_tmp262; + mem_374 = (UCHAR *)__cil_tmp262; #line 3660 - __cil_tmp263 = *mem_374; + __cil_tmp263 = *mem_374; #line 3660 - __cil_tmp264 = (int )__cil_tmp263; + __cil_tmp264 = (int)__cil_tmp263; #line 3660 - __cil_tmp265 = DriveMediaLimits + __cil_tmp264; + __cil_tmp265 = + DriveMediaLimits + __cil_tmp264; #line 3660 - __cil_tmp266 = (unsigned int )__cil_tmp265; + __cil_tmp266 = + (unsigned int)__cil_tmp265; #line 3660 - __cil_tmp267 = __cil_tmp266 + 32; + __cil_tmp267 = __cil_tmp266 + 32; #line 3660 - mem_375 = (DRIVE_MEDIA_TYPE *)__cil_tmp267; + mem_375 = (DRIVE_MEDIA_TYPE *) + __cil_tmp267; #line 3660 - __cil_tmp268 = *mem_375; + __cil_tmp268 = *mem_375; #line 3660 - __cil_tmp269 = (char )__cil_tmp268; + __cil_tmp269 = (char)__cil_tmp268; #line 3660 - __cil_tmp270 = (int )__cil_tmp269; + __cil_tmp270 = (int)__cil_tmp269; #line 3660 - __cil_tmp271 = (unsigned int )DisketteExtension; + __cil_tmp271 = + (unsigned int)DisketteExtension; #line 3660 - __cil_tmp272 = __cil_tmp271 + 216; + __cil_tmp272 = __cil_tmp271 + 216; #line 3660 - mem_376 = (DRIVE_MEDIA_TYPE *)__cil_tmp272; + mem_376 = (DRIVE_MEDIA_TYPE *) + __cil_tmp272; #line 3660 - __cil_tmp273 = *mem_376; + __cil_tmp273 = *mem_376; #line 3660 - __cil_tmp274 = (char )__cil_tmp273; + __cil_tmp274 = (char)__cil_tmp273; #line 3660 - __cil_tmp275 = (int )__cil_tmp274; + __cil_tmp275 = (int)__cil_tmp274; #line 3660 - if (__cil_tmp275 < __cil_tmp270) { + if (__cil_tmp275 < __cil_tmp270) { #line 3664 - __cil_tmp276 = (unsigned int )DisketteExtension; + __cil_tmp276 = (unsigned int) + DisketteExtension; #line 3664 - __cil_tmp277 = __cil_tmp276 + 184; + __cil_tmp277 = __cil_tmp276 + 184; #line 3664 - mem_377 = (MEDIA_TYPE *)__cil_tmp277; + mem_377 = + (MEDIA_TYPE *)__cil_tmp277; #line 3664 - *mem_377 = (enum _MEDIA_TYPE )0; + *mem_377 = (enum _MEDIA_TYPE)0; #line 3665 - mediaTypesExhausted = (unsigned char)1; - { + mediaTypesExhausted = + (unsigned char)1; + { #line 3670 - while (1) { - while_109_continue: /* CIL Label */ ; - goto while_109_break; - } - while_109_break: /* CIL Label */ ; + while (1) { + while_109_continue + : /* CIL Label */; + goto while_109_break; + } + while_109_break: /* CIL Label */; + } + } else { + } + } + } else { + } + } + } else { + } + } + } + } + } + } + } } - } else { - } - } - } else { - - } } - } else { - } - } - } } } - } - } } - } - } - } - } - } - } - { + { #line 3450 - __cil_tmp278 = ntStatus >= 0L; + __cil_tmp278 = ntStatus >= 0L; #line 3450 - if (! __cil_tmp278) { - { + if (!__cil_tmp278) { + { #line 3450 - __cil_tmp279 = ! mediaTypesExhausted; + __cil_tmp279 = !mediaTypesExhausted; #line 3450 - if (! __cil_tmp279) { - goto while_101_break; - } else { - - } + if (!__cil_tmp279) { + goto while_101_break; + } else { + } + } + } else { + goto while_101_break; + } + } + } + while_101_break: /* CIL Label */; } - } else { - goto while_101_break; - } - } - } - while_101_break: /* CIL Label */ ; - } #line 3680 - if (ntStatus >= 0L) { - { + if (ntStatus >= 0L) { + { #line 3689 - while (1) { - while_110_continue: /* CIL Label */ ; - goto while_110_break; - } - while_110_break: /* CIL Label */ ; + while (1) { + while_110_continue: /* CIL Label */; + goto while_110_break; + } + while_110_break: /* CIL Label */; + } + goto while_99_break; + } else { + } +#line 3418 + retries = retries + 1UL; } - goto while_99_break; - } else { - + while_99_break: /* CIL Label */; } -#line 3418 - retries = retries + 1UL; - } - while_99_break: /* CIL Label */ ; - } - { + { #line 3694 - __cil_tmp280 = ntStatus >= 0L; + __cil_tmp280 = ntStatus >= 0L; #line 3694 - if (! __cil_tmp280) { - goto _L___1; - } else { + if (!__cil_tmp280) { + goto _L___1; + } else { #line 3694 - if (mediaTypesExhausted) { - _L___1: - { + if (mediaTypesExhausted) { + _L___1 : { #line 3701 - while (1) { - while_111_continue: /* CIL Label */ ; - goto while_111_break; - } - while_111_break: /* CIL Label */ ; - } + while (1) { + while_111_continue: /* CIL Label */; + goto while_111_break; + } + while_111_break: /* CIL Label */; + } #line 3702 - return (ntStatus); - } else { - + return (ntStatus); + } else { + } + } } - } - } #line 3705 - __cil_tmp281 = (unsigned int )DisketteExtension; + __cil_tmp281 = (unsigned int)DisketteExtension; #line 3705 - __cil_tmp282 = __cil_tmp281 + 184; + __cil_tmp282 = __cil_tmp281 + 184; #line 3705 - mem_378 = (MEDIA_TYPE *)__cil_tmp282; + mem_378 = (MEDIA_TYPE *)__cil_tmp282; #line 3705 - mem_379 = (MEDIA_TYPE *)driveMediaConstants; + mem_379 = (MEDIA_TYPE *)driveMediaConstants; #line 3705 - *mem_378 = *mem_379; + *mem_378 = *mem_379; #line 3706 - __cil_tmp283 = (unsigned int )DisketteExtension; + __cil_tmp283 = (unsigned int)DisketteExtension; #line 3706 - __cil_tmp284 = __cil_tmp283 + 176; + __cil_tmp284 = __cil_tmp283 + 176; #line 3706 - __cil_tmp285 = (unsigned int )driveMediaConstants; + __cil_tmp285 = (unsigned int)driveMediaConstants; #line 3706 - __cil_tmp286 = __cil_tmp285 + 36; + __cil_tmp286 = __cil_tmp285 + 36; #line 3706 - mem_380 = (USHORT *)__cil_tmp286; + mem_380 = (USHORT *)__cil_tmp286; #line 3706 - __cil_tmp287 = *mem_380; + __cil_tmp287 = *mem_380; #line 3706 - mem_381 = (ULONG *)__cil_tmp284; + mem_381 = (ULONG *)__cil_tmp284; #line 3706 - *mem_381 = (unsigned long )__cil_tmp287; + *mem_381 = (unsigned long)__cil_tmp287; #line 3708 - __cil_tmp288 = (unsigned int )DisketteExtension; + __cil_tmp288 = (unsigned int)DisketteExtension; #line 3708 - __cil_tmp289 = __cil_tmp288 + 180; + __cil_tmp289 = __cil_tmp288 + 180; #line 3708 - __cil_tmp290 = (unsigned int )driveMediaConstants; + __cil_tmp290 = (unsigned int)driveMediaConstants; #line 3708 - __cil_tmp291 = __cil_tmp290 + 51; + __cil_tmp291 = __cil_tmp290 + 51; #line 3708 - mem_382 = (UCHAR *)__cil_tmp291; + mem_382 = (UCHAR *)__cil_tmp291; #line 3708 - __cil_tmp292 = *mem_382; + __cil_tmp292 = *mem_382; #line 3708 - __cil_tmp293 = (int )__cil_tmp292; + __cil_tmp293 = (int)__cil_tmp292; #line 3708 - __cil_tmp294 = (unsigned int )driveMediaConstants; + __cil_tmp294 = (unsigned int)driveMediaConstants; #line 3708 - __cil_tmp295 = __cil_tmp294 + 48; + __cil_tmp295 = __cil_tmp294 + 48; #line 3708 - mem_383 = (UCHAR *)__cil_tmp295; + mem_383 = (UCHAR *)__cil_tmp295; #line 3708 - __cil_tmp296 = *mem_383; + __cil_tmp296 = *mem_383; #line 3708 - __cil_tmp297 = (int )__cil_tmp296; + __cil_tmp297 = (int)__cil_tmp296; #line 3708 - __cil_tmp298 = 1 + __cil_tmp297; + __cil_tmp298 = 1 + __cil_tmp297; #line 3708 - __cil_tmp299 = (unsigned int )driveMediaConstants; + __cil_tmp299 = (unsigned int)driveMediaConstants; #line 3708 - __cil_tmp300 = __cil_tmp299 + 38; + __cil_tmp300 = __cil_tmp299 + 38; #line 3708 - mem_384 = (UCHAR *)__cil_tmp300; + mem_384 = (UCHAR *)__cil_tmp300; #line 3708 - __cil_tmp301 = *mem_384; + __cil_tmp301 = *mem_384; #line 3708 - __cil_tmp302 = (int )__cil_tmp301; + __cil_tmp302 = (int)__cil_tmp301; #line 3708 - __cil_tmp303 = (unsigned int )driveMediaConstants; + __cil_tmp303 = (unsigned int)driveMediaConstants; #line 3708 - __cil_tmp304 = __cil_tmp303 + 36; + __cil_tmp304 = __cil_tmp303 + 36; #line 3708 - mem_385 = (USHORT *)__cil_tmp304; + mem_385 = (USHORT *)__cil_tmp304; #line 3708 - __cil_tmp305 = *mem_385; + __cil_tmp305 = *mem_385; #line 3708 - __cil_tmp306 = (int )__cil_tmp305; + __cil_tmp306 = (int)__cil_tmp305; #line 3708 - __cil_tmp307 = __cil_tmp306 * __cil_tmp302; + __cil_tmp307 = __cil_tmp306 * __cil_tmp302; #line 3708 - __cil_tmp308 = __cil_tmp307 * __cil_tmp298; + __cil_tmp308 = __cil_tmp307 * __cil_tmp298; #line 3708 - __cil_tmp309 = __cil_tmp308 * __cil_tmp293; + __cil_tmp309 = __cil_tmp308 * __cil_tmp293; #line 3708 - mem_386 = (ULONG *)__cil_tmp289; + mem_386 = (ULONG *)__cil_tmp289; #line 3708 - *mem_386 = (unsigned long )__cil_tmp309; - { + *mem_386 = (unsigned long)__cil_tmp309; + { #line 3720 - while (1) { - while_112_continue: /* CIL Label */ ; - goto while_112_break; - } - while_112_break: /* CIL Label */ ; - } - { + while (1) { + while_112_continue: /* CIL Label */; + goto while_112_break; + } + while_112_break: /* CIL Label */; + } + { #line 3725 - __cil_tmp310 = (unsigned int )DisketteExtension; + __cil_tmp310 = (unsigned int)DisketteExtension; #line 3725 - __cil_tmp311 = __cil_tmp310 + 308; + __cil_tmp311 = __cil_tmp310 + 308; #line 3725 - __cil_tmp312 = (unsigned int )DisketteExtension; + __cil_tmp312 = (unsigned int)DisketteExtension; #line 3725 - __cil_tmp313 = __cil_tmp312 + 216; + __cil_tmp313 = __cil_tmp312 + 216; #line 3725 - mem_387 = (DRIVE_MEDIA_TYPE *)__cil_tmp313; + mem_387 = (DRIVE_MEDIA_TYPE *)__cil_tmp313; #line 3725 - __cil_tmp314 = *mem_387; + __cil_tmp314 = *mem_387; #line 3725 - __cil_tmp315 = (unsigned int )__cil_tmp314; + __cil_tmp315 = (unsigned int)__cil_tmp314; #line 3725 - __cil_tmp316 = DriveMediaConstants + __cil_tmp315; + __cil_tmp316 = DriveMediaConstants + __cil_tmp315; #line 3725 - mem_388 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp311; + mem_388 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp311; #line 3725 - *mem_388 = *__cil_tmp316; + *mem_388 = *__cil_tmp316; #line 3731 - FlCheckBootSector(DisketteExtension); - } + FlCheckBootSector(DisketteExtension); + } #line 3733 - return (ntStatus); -} + return (ntStatus); + } } #line 3736 "floppy.c" -void FlAllocateIoBuffer(PDISKETTE_EXTENSION DisketteExtension , ULONG BufferSize ) -{ BOOLEAN allocateContiguous ; - LARGE_INTEGER maxDmaAddress ; - PVOID tmp ; - PVOID tmp___0 ; - unsigned int __cil_tmp7 ; - unsigned int __cil_tmp8 ; - unsigned int __cil_tmp9 ; - unsigned int __cil_tmp10 ; - ULONG __cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - ULONG __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - enum _POOL_TYPE __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - PUCHAR __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - PUCHAR __cil_tmp27 ; - void *__cil_tmp28 ; - void *__cil_tmp29 ; - struct _IRP *__cil_tmp30 ; - unsigned int __cil_tmp31 ; - unsigned int __cil_tmp32 ; - PMDL __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - PUCHAR __cil_tmp36 ; - void *__cil_tmp37 ; - unsigned int __cil_tmp38 ; - unsigned int __cil_tmp39 ; - PUCHAR __cil_tmp40 ; - void *__cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - void *__cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - PMDL __cil_tmp47 ; - enum _LOCK_OPERATION __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - PUCHAR __cil_tmp51 ; - void *__cil_tmp52 ; - unsigned int __cil_tmp53 ; - unsigned int __cil_tmp54 ; - PUCHAR __cil_tmp55 ; - void *__cil_tmp56 ; - unsigned int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - void *__cil_tmp59 ; - unsigned int __cil_tmp60 ; - unsigned int __cil_tmp61 ; - PUCHAR *mem_62 ; - ULONG *mem_63 ; - ULONG *mem_64 ; - PUCHAR *mem_65 ; - PUCHAR *mem_66 ; - PUCHAR *mem_67 ; - PUCHAR *mem_68 ; - PMDL *mem_69 ; - PMDL *mem_70 ; - PUCHAR *mem_71 ; - PUCHAR *mem_72 ; - PUCHAR *mem_73 ; - PMDL *mem_74 ; - PUCHAR *mem_75 ; - PUCHAR *mem_76 ; - PUCHAR *mem_77 ; - ULONG *mem_78 ; +void FlAllocateIoBuffer(PDISKETTE_EXTENSION DisketteExtension, + ULONG BufferSize) { + BOOLEAN allocateContiguous; + LARGE_INTEGER maxDmaAddress; + PVOID tmp; + PVOID tmp___0; + unsigned int __cil_tmp7; + unsigned int __cil_tmp8; + unsigned int __cil_tmp9; + unsigned int __cil_tmp10; + ULONG __cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + ULONG __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + enum _POOL_TYPE __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + PUCHAR __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + PUCHAR __cil_tmp27; + void *__cil_tmp28; + void *__cil_tmp29; + struct _IRP *__cil_tmp30; + unsigned int __cil_tmp31; + unsigned int __cil_tmp32; + PMDL __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + PUCHAR __cil_tmp36; + void *__cil_tmp37; + unsigned int __cil_tmp38; + unsigned int __cil_tmp39; + PUCHAR __cil_tmp40; + void *__cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + void *__cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + PMDL __cil_tmp47; + enum _LOCK_OPERATION __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + PUCHAR __cil_tmp51; + void *__cil_tmp52; + unsigned int __cil_tmp53; + unsigned int __cil_tmp54; + PUCHAR __cil_tmp55; + void *__cil_tmp56; + unsigned int __cil_tmp57; + unsigned int __cil_tmp58; + void *__cil_tmp59; + unsigned int __cil_tmp60; + unsigned int __cil_tmp61; + PUCHAR *mem_62; + ULONG *mem_63; + ULONG *mem_64; + PUCHAR *mem_65; + PUCHAR *mem_66; + PUCHAR *mem_67; + PUCHAR *mem_68; + PMDL *mem_69; + PMDL *mem_70; + PUCHAR *mem_71; + PUCHAR *mem_72; + PUCHAR *mem_73; + PMDL *mem_74; + PUCHAR *mem_75; + PUCHAR *mem_76; + PUCHAR *mem_77; + ULONG *mem_78; { - { + { #line 3764 - __cil_tmp7 = (unsigned int )DisketteExtension; + __cil_tmp7 = (unsigned int)DisketteExtension; #line 3764 - __cil_tmp8 = __cil_tmp7 + 124; - { + __cil_tmp8 = __cil_tmp7 + 124; + { #line 3764 - mem_62 = (PUCHAR *)__cil_tmp8; + mem_62 = (PUCHAR *)__cil_tmp8; #line 3764 - if (*mem_62) { - { + if (*mem_62) { + { #line 3765 - __cil_tmp9 = (unsigned int )DisketteExtension; + __cil_tmp9 = (unsigned int)DisketteExtension; #line 3765 - __cil_tmp10 = __cil_tmp9 + 132; + __cil_tmp10 = __cil_tmp9 + 132; #line 3765 - mem_63 = (ULONG *)__cil_tmp10; + mem_63 = (ULONG *)__cil_tmp10; #line 3765 - __cil_tmp11 = *mem_63; + __cil_tmp11 = *mem_63; #line 3765 - if (__cil_tmp11 >= BufferSize) { - - } else { + if (__cil_tmp11 >= BufferSize) { - } - } - { + } else { + } + } + { #line 3768 - FlFreeIoBuffer(DisketteExtension); + FlFreeIoBuffer(DisketteExtension); + } + } else { + } + } } - } else { - - } - } - } - { + { #line 3771 - __cil_tmp12 = (unsigned int )DisketteExtension; + __cil_tmp12 = (unsigned int)DisketteExtension; #line 3771 - __cil_tmp13 = __cil_tmp12 + 108; + __cil_tmp13 = __cil_tmp12 + 108; #line 3771 - mem_64 = (ULONG *)__cil_tmp13; + mem_64 = (ULONG *)__cil_tmp13; #line 3771 - __cil_tmp14 = *mem_64; + __cil_tmp14 = *mem_64; #line 3771 - if (BufferSize > __cil_tmp14) { + if (BufferSize > __cil_tmp14) { #line 3772 - allocateContiguous = (unsigned char)1; - } else { + allocateContiguous = (unsigned char)1; + } else { #line 3774 - allocateContiguous = (unsigned char)0; - } - } + allocateContiguous = (unsigned char)0; + } + } #line 3777 - if (allocateContiguous) { - { + if (allocateContiguous) { + { #line 3778 - maxDmaAddress.QuadPart = 16777215LL; + maxDmaAddress.QuadPart = 16777215LL; #line 3779 - tmp = MmAllocateContiguousMemory(BufferSize, maxDmaAddress); + tmp = MmAllocateContiguousMemory(BufferSize, maxDmaAddress); #line 3779 - __cil_tmp15 = (unsigned int )DisketteExtension; + __cil_tmp15 = (unsigned int)DisketteExtension; #line 3779 - __cil_tmp16 = __cil_tmp15 + 124; + __cil_tmp16 = __cil_tmp15 + 124; #line 3779 - mem_65 = (PUCHAR *)__cil_tmp16; + mem_65 = (PUCHAR *)__cil_tmp16; #line 3779 - *mem_65 = (UCHAR *)tmp; - } - } else { - { + *mem_65 = (UCHAR *)tmp; + } + } else { + { #line 3782 - __cil_tmp17 = (enum _POOL_TYPE )4; + __cil_tmp17 = (enum _POOL_TYPE)4; #line 3782 - tmp___0 = ExAllocatePoolWithTag(__cil_tmp17, BufferSize, 1886350406UL); + tmp___0 = ExAllocatePoolWithTag(__cil_tmp17, BufferSize, 1886350406UL); #line 3782 - __cil_tmp18 = (unsigned int )DisketteExtension; + __cil_tmp18 = (unsigned int)DisketteExtension; #line 3782 - __cil_tmp19 = __cil_tmp18 + 124; + __cil_tmp19 = __cil_tmp18 + 124; #line 3782 - mem_66 = (PUCHAR *)__cil_tmp19; + mem_66 = (PUCHAR *)__cil_tmp19; #line 3782 - *mem_66 = (UCHAR *)tmp___0; + *mem_66 = (UCHAR *)tmp___0; + } } - } - { + { #line 3786 - __cil_tmp20 = (unsigned int )DisketteExtension; + __cil_tmp20 = (unsigned int)DisketteExtension; #line 3786 - __cil_tmp21 = __cil_tmp20 + 124; + __cil_tmp21 = __cil_tmp20 + 124; #line 3786 - mem_67 = (PUCHAR *)__cil_tmp21; + mem_67 = (PUCHAR *)__cil_tmp21; #line 3786 - __cil_tmp22 = *mem_67; + __cil_tmp22 = *mem_67; #line 3786 - if (! __cil_tmp22) { - - } else { + if (!__cil_tmp22) { - } - } - { + } else { + } + } + { #line 3790 - __cil_tmp23 = (unsigned int )DisketteExtension; + __cil_tmp23 = (unsigned int)DisketteExtension; #line 3790 - __cil_tmp24 = __cil_tmp23 + 128; + __cil_tmp24 = __cil_tmp23 + 128; #line 3790 - __cil_tmp25 = (unsigned int )DisketteExtension; + __cil_tmp25 = (unsigned int)DisketteExtension; #line 3790 - __cil_tmp26 = __cil_tmp25 + 124; + __cil_tmp26 = __cil_tmp25 + 124; #line 3790 - mem_68 = (PUCHAR *)__cil_tmp26; + mem_68 = (PUCHAR *)__cil_tmp26; #line 3790 - __cil_tmp27 = *mem_68; + __cil_tmp27 = *mem_68; #line 3790 - __cil_tmp28 = (void *)__cil_tmp27; + __cil_tmp28 = (void *)__cil_tmp27; #line 3790 - __cil_tmp29 = (void *)0; + __cil_tmp29 = (void *)0; #line 3790 - __cil_tmp30 = (struct _IRP *)__cil_tmp29; + __cil_tmp30 = (struct _IRP *)__cil_tmp29; #line 3790 - mem_69 = (PMDL *)__cil_tmp24; + mem_69 = (PMDL *)__cil_tmp24; #line 3790 - *mem_69 = IoAllocateMdl(__cil_tmp28, BufferSize, (unsigned char)0, (unsigned char)0, - __cil_tmp30); - } - { + *mem_69 = IoAllocateMdl(__cil_tmp28, BufferSize, (unsigned char)0, + (unsigned char)0, __cil_tmp30); + } + { #line 3792 - __cil_tmp31 = (unsigned int )DisketteExtension; + __cil_tmp31 = (unsigned int)DisketteExtension; #line 3792 - __cil_tmp32 = __cil_tmp31 + 128; + __cil_tmp32 = __cil_tmp31 + 128; #line 3792 - mem_70 = (PMDL *)__cil_tmp32; + mem_70 = (PMDL *)__cil_tmp32; #line 3792 - __cil_tmp33 = *mem_70; + __cil_tmp33 = *mem_70; #line 3792 - if (! __cil_tmp33) { + if (!__cil_tmp33) { #line 3793 - if (allocateContiguous) { - { + if (allocateContiguous) { + { #line 3794 - __cil_tmp34 = (unsigned int )DisketteExtension; + __cil_tmp34 = (unsigned int)DisketteExtension; #line 3794 - __cil_tmp35 = __cil_tmp34 + 124; + __cil_tmp35 = __cil_tmp34 + 124; #line 3794 - mem_71 = (PUCHAR *)__cil_tmp35; + mem_71 = (PUCHAR *)__cil_tmp35; #line 3794 - __cil_tmp36 = *mem_71; + __cil_tmp36 = *mem_71; #line 3794 - __cil_tmp37 = (void *)__cil_tmp36; + __cil_tmp37 = (void *)__cil_tmp36; #line 3794 - MmFreeContiguousMemory(__cil_tmp37); - } - } else { - { + MmFreeContiguousMemory(__cil_tmp37); + } + } else { + { #line 3796 - __cil_tmp38 = (unsigned int )DisketteExtension; + __cil_tmp38 = (unsigned int)DisketteExtension; #line 3796 - __cil_tmp39 = __cil_tmp38 + 124; + __cil_tmp39 = __cil_tmp38 + 124; #line 3796 - mem_72 = (PUCHAR *)__cil_tmp39; + mem_72 = (PUCHAR *)__cil_tmp39; #line 3796 - __cil_tmp40 = *mem_72; + __cil_tmp40 = *mem_72; #line 3796 - __cil_tmp41 = (void *)__cil_tmp40; + __cil_tmp41 = (void *)__cil_tmp40; #line 3796 - ExFreePool(__cil_tmp41); - } - } + ExFreePool(__cil_tmp41); + } + } #line 3798 - __cil_tmp42 = (unsigned int )DisketteExtension; + __cil_tmp42 = (unsigned int)DisketteExtension; #line 3798 - __cil_tmp43 = __cil_tmp42 + 124; + __cil_tmp43 = __cil_tmp42 + 124; #line 3798 - __cil_tmp44 = (void *)0; + __cil_tmp44 = (void *)0; #line 3798 - mem_73 = (PUCHAR *)__cil_tmp43; + mem_73 = (PUCHAR *)__cil_tmp43; #line 3798 - *mem_73 = (UCHAR *)__cil_tmp44; - } else { - - } - } - { + *mem_73 = (UCHAR *)__cil_tmp44; + } else { + } + } + { #line 3803 - __cil_tmp45 = (unsigned int )DisketteExtension; + __cil_tmp45 = (unsigned int)DisketteExtension; #line 3803 - __cil_tmp46 = __cil_tmp45 + 128; + __cil_tmp46 = __cil_tmp45 + 128; #line 3803 - mem_74 = (PMDL *)__cil_tmp46; + mem_74 = (PMDL *)__cil_tmp46; #line 3803 - __cil_tmp47 = *mem_74; + __cil_tmp47 = *mem_74; #line 3803 - __cil_tmp48 = (enum _LOCK_OPERATION )2; + __cil_tmp48 = (enum _LOCK_OPERATION)2; #line 3803 - MmProbeAndLockPages(__cil_tmp47, (char)0, __cil_tmp48); - } - { + MmProbeAndLockPages(__cil_tmp47, (char)0, __cil_tmp48); + } + { #line 3809 - while (1) { - while_113_continue: /* CIL Label */ ; - goto while_113_break; - } - while_113_break: /* CIL Label */ ; - } + while (1) { + while_113_continue: /* CIL Label */; + goto while_113_break; + } + while_113_break: /* CIL Label */; + } #line 3810 - if (allocateContiguous) { - { + if (allocateContiguous) { + { #line 3811 - __cil_tmp49 = (unsigned int )DisketteExtension; + __cil_tmp49 = (unsigned int)DisketteExtension; #line 3811 - __cil_tmp50 = __cil_tmp49 + 124; + __cil_tmp50 = __cil_tmp49 + 124; #line 3811 - mem_75 = (PUCHAR *)__cil_tmp50; + mem_75 = (PUCHAR *)__cil_tmp50; #line 3811 - __cil_tmp51 = *mem_75; + __cil_tmp51 = *mem_75; #line 3811 - __cil_tmp52 = (void *)__cil_tmp51; + __cil_tmp52 = (void *)__cil_tmp51; #line 3811 - MmFreeContiguousMemory(__cil_tmp52); - } - } else { - { + MmFreeContiguousMemory(__cil_tmp52); + } + } else { + { #line 3813 - __cil_tmp53 = (unsigned int )DisketteExtension; + __cil_tmp53 = (unsigned int)DisketteExtension; #line 3813 - __cil_tmp54 = __cil_tmp53 + 124; + __cil_tmp54 = __cil_tmp53 + 124; #line 3813 - mem_76 = (PUCHAR *)__cil_tmp54; + mem_76 = (PUCHAR *)__cil_tmp54; #line 3813 - __cil_tmp55 = *mem_76; + __cil_tmp55 = *mem_76; #line 3813 - __cil_tmp56 = (void *)__cil_tmp55; + __cil_tmp56 = (void *)__cil_tmp55; #line 3813 - ExFreePool(__cil_tmp56); + ExFreePool(__cil_tmp56); + } } - } #line 3815 - __cil_tmp57 = (unsigned int )DisketteExtension; + __cil_tmp57 = (unsigned int)DisketteExtension; #line 3815 - __cil_tmp58 = __cil_tmp57 + 124; + __cil_tmp58 = __cil_tmp57 + 124; #line 3815 - __cil_tmp59 = (void *)0; + __cil_tmp59 = (void *)0; #line 3815 - mem_77 = (PUCHAR *)__cil_tmp58; + mem_77 = (PUCHAR *)__cil_tmp58; #line 3815 - *mem_77 = (UCHAR *)__cil_tmp59; + *mem_77 = (UCHAR *)__cil_tmp59; #line 3819 - __cil_tmp60 = (unsigned int )DisketteExtension; + __cil_tmp60 = (unsigned int)DisketteExtension; #line 3819 - __cil_tmp61 = __cil_tmp60 + 132; + __cil_tmp61 = __cil_tmp60 + 132; #line 3819 - mem_78 = (ULONG *)__cil_tmp61; + mem_78 = (ULONG *)__cil_tmp61; #line 3819 - *mem_78 = BufferSize; + *mem_78 = BufferSize; #line 3821 - return; -} + return; + } } #line 3822 "floppy.c" -void FlFreeIoBuffer(PDISKETTE_EXTENSION DisketteExtension ) -{ BOOLEAN contiguousBuffer ; - unsigned int __cil_tmp3 ; - unsigned int __cil_tmp4 ; - PUCHAR __cil_tmp5 ; - unsigned int __cil_tmp6 ; - unsigned int __cil_tmp7 ; - ULONG __cil_tmp8 ; - unsigned int __cil_tmp9 ; - unsigned int __cil_tmp10 ; - ULONG __cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - unsigned int __cil_tmp14 ; - unsigned int __cil_tmp15 ; - PMDL __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - PMDL __cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - void *__cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - PUCHAR __cil_tmp25 ; - void *__cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - PUCHAR __cil_tmp29 ; - void *__cil_tmp30 ; - unsigned int __cil_tmp31 ; - unsigned int __cil_tmp32 ; - void *__cil_tmp33 ; - PUCHAR *mem_34 ; - ULONG *mem_35 ; - ULONG *mem_36 ; - ULONG *mem_37 ; - PMDL *mem_38 ; - PMDL *mem_39 ; - PMDL *mem_40 ; - PUCHAR *mem_41 ; - PUCHAR *mem_42 ; - PUCHAR *mem_43 ; +void FlFreeIoBuffer(PDISKETTE_EXTENSION DisketteExtension) { + BOOLEAN contiguousBuffer; + unsigned int __cil_tmp3; + unsigned int __cil_tmp4; + PUCHAR __cil_tmp5; + unsigned int __cil_tmp6; + unsigned int __cil_tmp7; + ULONG __cil_tmp8; + unsigned int __cil_tmp9; + unsigned int __cil_tmp10; + ULONG __cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + unsigned int __cil_tmp14; + unsigned int __cil_tmp15; + PMDL __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + PMDL __cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + void *__cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + PUCHAR __cil_tmp25; + void *__cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + PUCHAR __cil_tmp29; + void *__cil_tmp30; + unsigned int __cil_tmp31; + unsigned int __cil_tmp32; + void *__cil_tmp33; + PUCHAR *mem_34; + ULONG *mem_35; + ULONG *mem_36; + ULONG *mem_37; + PMDL *mem_38; + PMDL *mem_39; + PMDL *mem_40; + PUCHAR *mem_41; + PUCHAR *mem_42; + PUCHAR *mem_43; { - { + { #line 3846 - __cil_tmp3 = (unsigned int )DisketteExtension; + __cil_tmp3 = (unsigned int)DisketteExtension; #line 3846 - __cil_tmp4 = __cil_tmp3 + 124; + __cil_tmp4 = __cil_tmp3 + 124; #line 3846 - mem_34 = (PUCHAR *)__cil_tmp4; + mem_34 = (PUCHAR *)__cil_tmp4; #line 3846 - __cil_tmp5 = *mem_34; + __cil_tmp5 = *mem_34; #line 3846 - if (! __cil_tmp5) { - - } else { + if (!__cil_tmp5) { - } - } - { + } else { + } + } + { #line 3850 - __cil_tmp6 = (unsigned int )DisketteExtension; + __cil_tmp6 = (unsigned int)DisketteExtension; #line 3850 - __cil_tmp7 = __cil_tmp6 + 108; + __cil_tmp7 = __cil_tmp6 + 108; #line 3850 - mem_35 = (ULONG *)__cil_tmp7; + mem_35 = (ULONG *)__cil_tmp7; #line 3850 - __cil_tmp8 = *mem_35; + __cil_tmp8 = *mem_35; #line 3850 - __cil_tmp9 = (unsigned int )DisketteExtension; + __cil_tmp9 = (unsigned int)DisketteExtension; #line 3850 - __cil_tmp10 = __cil_tmp9 + 132; + __cil_tmp10 = __cil_tmp9 + 132; #line 3850 - mem_36 = (ULONG *)__cil_tmp10; + mem_36 = (ULONG *)__cil_tmp10; #line 3850 - __cil_tmp11 = *mem_36; + __cil_tmp11 = *mem_36; #line 3850 - if (__cil_tmp11 > __cil_tmp8) { + if (__cil_tmp11 > __cil_tmp8) { #line 3853 - contiguousBuffer = (unsigned char)1; - } else { + contiguousBuffer = (unsigned char)1; + } else { #line 3855 - contiguousBuffer = (unsigned char)0; - } - } - { + contiguousBuffer = (unsigned char)0; + } + } + { #line 3858 - __cil_tmp12 = (unsigned int )DisketteExtension; + __cil_tmp12 = (unsigned int)DisketteExtension; #line 3858 - __cil_tmp13 = __cil_tmp12 + 132; + __cil_tmp13 = __cil_tmp12 + 132; #line 3858 - mem_37 = (ULONG *)__cil_tmp13; + mem_37 = (ULONG *)__cil_tmp13; #line 3858 - *mem_37 = 0UL; + *mem_37 = 0UL; #line 3860 - __cil_tmp14 = (unsigned int )DisketteExtension; + __cil_tmp14 = (unsigned int)DisketteExtension; #line 3860 - __cil_tmp15 = __cil_tmp14 + 128; + __cil_tmp15 = __cil_tmp14 + 128; #line 3860 - mem_38 = (PMDL *)__cil_tmp15; + mem_38 = (PMDL *)__cil_tmp15; #line 3860 - __cil_tmp16 = *mem_38; + __cil_tmp16 = *mem_38; #line 3860 - MmUnlockPages(__cil_tmp16); + MmUnlockPages(__cil_tmp16); #line 3861 - __cil_tmp17 = (unsigned int )DisketteExtension; + __cil_tmp17 = (unsigned int)DisketteExtension; #line 3861 - __cil_tmp18 = __cil_tmp17 + 128; + __cil_tmp18 = __cil_tmp17 + 128; #line 3861 - mem_39 = (PMDL *)__cil_tmp18; + mem_39 = (PMDL *)__cil_tmp18; #line 3861 - __cil_tmp19 = *mem_39; + __cil_tmp19 = *mem_39; #line 3861 - IoFreeMdl(__cil_tmp19); + IoFreeMdl(__cil_tmp19); #line 3862 - __cil_tmp20 = (unsigned int )DisketteExtension; + __cil_tmp20 = (unsigned int)DisketteExtension; #line 3862 - __cil_tmp21 = __cil_tmp20 + 128; + __cil_tmp21 = __cil_tmp20 + 128; #line 3862 - __cil_tmp22 = (void *)0; + __cil_tmp22 = (void *)0; #line 3862 - mem_40 = (PMDL *)__cil_tmp21; + mem_40 = (PMDL *)__cil_tmp21; #line 3862 - *mem_40 = (struct _MDL *)__cil_tmp22; - } + *mem_40 = (struct _MDL *)__cil_tmp22; + } #line 3863 - if (contiguousBuffer) { - { + if (contiguousBuffer) { + { #line 3864 - __cil_tmp23 = (unsigned int )DisketteExtension; + __cil_tmp23 = (unsigned int)DisketteExtension; #line 3864 - __cil_tmp24 = __cil_tmp23 + 124; + __cil_tmp24 = __cil_tmp23 + 124; #line 3864 - mem_41 = (PUCHAR *)__cil_tmp24; + mem_41 = (PUCHAR *)__cil_tmp24; #line 3864 - __cil_tmp25 = *mem_41; + __cil_tmp25 = *mem_41; #line 3864 - __cil_tmp26 = (void *)__cil_tmp25; + __cil_tmp26 = (void *)__cil_tmp25; #line 3864 - MmFreeContiguousMemory(__cil_tmp26); - } - } else { - { + MmFreeContiguousMemory(__cil_tmp26); + } + } else { + { #line 3866 - __cil_tmp27 = (unsigned int )DisketteExtension; + __cil_tmp27 = (unsigned int)DisketteExtension; #line 3866 - __cil_tmp28 = __cil_tmp27 + 124; + __cil_tmp28 = __cil_tmp27 + 124; #line 3866 - mem_42 = (PUCHAR *)__cil_tmp28; + mem_42 = (PUCHAR *)__cil_tmp28; #line 3866 - __cil_tmp29 = *mem_42; + __cil_tmp29 = *mem_42; #line 3866 - __cil_tmp30 = (void *)__cil_tmp29; + __cil_tmp30 = (void *)__cil_tmp29; #line 3866 - ExFreePool(__cil_tmp30); + ExFreePool(__cil_tmp30); + } } - } #line 3868 - __cil_tmp31 = (unsigned int )DisketteExtension; + __cil_tmp31 = (unsigned int)DisketteExtension; #line 3868 - __cil_tmp32 = __cil_tmp31 + 124; + __cil_tmp32 = __cil_tmp31 + 124; #line 3868 - __cil_tmp33 = (void *)0; + __cil_tmp33 = (void *)0; #line 3868 - mem_43 = (PUCHAR *)__cil_tmp32; + mem_43 = (PUCHAR *)__cil_tmp32; #line 3868 - *mem_43 = (UCHAR *)__cil_tmp33; + *mem_43 = (UCHAR *)__cil_tmp33; #line 3871 - return; -} + return; + } } #line 3871 "floppy.c" -void FloppyThread(PVOID Context ) -{ PIRP irp ; - PIO_STACK_LOCATION irpSp ; - PLIST_ENTRY request ; - PDISKETTE_EXTENSION disketteExtension ; - NTSTATUS ntStatus ; - NTSTATUS waitStatus ; - LARGE_INTEGER queueWait ; - LARGE_INTEGER acquireWait ; - PKTHREAD tmp ; - PDISK_GEOMETRY outputBuffer ; - PSENSE_DEVISE_STATUS_PTOS outputBuffer___0 ; - LARGE_INTEGER *__cil_tmp13 ; - LARGE_INTEGER *__cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - KSEMAPHORE *__cil_tmp17 ; - void *__cil_tmp18 ; - enum _KWAIT_REASON __cil_tmp19 ; - KUSER_SHARED_DATA *__cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp23 ; - int __cil_tmp24 ; - int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - unsigned int __cil_tmp29 ; - PDEVICE_OBJECT __cil_tmp30 ; - int __cil_tmp31 ; - int __cil_tmp32 ; - int __cil_tmp33 ; - int __cil_tmp34 ; - unsigned long __cil_tmp35 ; - void *__cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - PDEVICE_OBJECT __cil_tmp39 ; - int __cil_tmp40 ; - int __cil_tmp41 ; - int __cil_tmp42 ; - int __cil_tmp43 ; - unsigned long __cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - PDEVICE_OBJECT __cil_tmp47 ; - void *__cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - unsigned int __cil_tmp51 ; - unsigned int __cil_tmp52 ; - FAST_MUTEX *__cil_tmp53 ; - unsigned int __cil_tmp54 ; - unsigned int __cil_tmp55 ; - LONG __cil_tmp56 ; - unsigned int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - void *__cil_tmp59 ; - unsigned int __cil_tmp60 ; - unsigned int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - PKTHREAD __cil_tmp63 ; - unsigned int __cil_tmp64 ; - unsigned int __cil_tmp65 ; - unsigned int __cil_tmp66 ; - PKTHREAD __cil_tmp67 ; - void *__cil_tmp68 ; - unsigned int __cil_tmp69 ; - unsigned int __cil_tmp70 ; - void *__cil_tmp71 ; - unsigned int __cil_tmp72 ; - unsigned int __cil_tmp73 ; - FAST_MUTEX *__cil_tmp74 ; - KUSER_SHARED_DATA *__cil_tmp75 ; - unsigned int __cil_tmp76 ; - unsigned int __cil_tmp77 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp78 ; - int __cil_tmp79 ; - unsigned int __cil_tmp80 ; - unsigned int __cil_tmp81 ; - unsigned int __cil_tmp82 ; - unsigned int __cil_tmp83 ; - PDEVICE_OBJECT __cil_tmp84 ; - int __cil_tmp85 ; - int __cil_tmp86 ; - int __cil_tmp87 ; - int __cil_tmp88 ; - unsigned long __cil_tmp89 ; - void *__cil_tmp90 ; - unsigned int __cil_tmp91 ; - unsigned int __cil_tmp92 ; - PDEVICE_OBJECT __cil_tmp93 ; - int __cil_tmp94 ; - int __cil_tmp95 ; - int __cil_tmp96 ; - int __cil_tmp97 ; - unsigned long __cil_tmp98 ; - void *__cil_tmp99 ; - unsigned int __cil_tmp100 ; - unsigned int __cil_tmp101 ; - PDEVICE_OBJECT __cil_tmp102 ; - int __cil_tmp103 ; - int __cil_tmp104 ; - int __cil_tmp105 ; - int __cil_tmp106 ; - unsigned long __cil_tmp107 ; - unsigned int __cil_tmp108 ; - unsigned int __cil_tmp109 ; - PDEVICE_OBJECT __cil_tmp110 ; - void *__cil_tmp111 ; - unsigned int __cil_tmp112 ; - unsigned int __cil_tmp113 ; - unsigned int __cil_tmp114 ; - unsigned int __cil_tmp115 ; - void *__cil_tmp116 ; - unsigned int __cil_tmp117 ; - unsigned int __cil_tmp118 ; - FAST_MUTEX *__cil_tmp119 ; - unsigned int __cil_tmp120 ; - unsigned int __cil_tmp121 ; - LIST_ENTRY *__cil_tmp122 ; - unsigned int __cil_tmp123 ; - unsigned int __cil_tmp124 ; - KSPIN_LOCK *__cil_tmp125 ; - unsigned int __cil_tmp126 ; - unsigned int __cil_tmp127 ; - FAST_MUTEX *__cil_tmp128 ; - unsigned int __cil_tmp129 ; - unsigned int __cil_tmp130 ; - unsigned int __cil_tmp131 ; - unsigned int __cil_tmp132 ; - LONG __cil_tmp133 ; - unsigned int __cil_tmp134 ; - unsigned int __cil_tmp135 ; - FAST_MUTEX *__cil_tmp136 ; - unsigned int __cil_tmp137 ; - unsigned int __cil_tmp138 ; - unsigned int __cil_tmp139 ; - unsigned int __cil_tmp140 ; - IRP *__cil_tmp141 ; - unsigned int __cil_tmp142 ; - unsigned int __cil_tmp143 ; - LIST_ENTRY *__cil_tmp144 ; - unsigned long __cil_tmp145 ; - CHAR *__cil_tmp146 ; - CHAR *__cil_tmp147 ; - unsigned int __cil_tmp148 ; - unsigned int __cil_tmp149 ; - FAST_MUTEX *__cil_tmp150 ; - unsigned int __cil_tmp151 ; - unsigned int __cil_tmp152 ; - BOOLEAN __cil_tmp153 ; - int __cil_tmp154 ; - unsigned int __cil_tmp155 ; - unsigned int __cil_tmp156 ; - FAST_MUTEX *__cil_tmp157 ; - unsigned int __cil_tmp158 ; - unsigned int __cil_tmp159 ; - IRP *__cil_tmp160 ; - unsigned int __cil_tmp161 ; - unsigned int __cil_tmp162 ; - LIST_ENTRY *__cil_tmp163 ; - unsigned long __cil_tmp164 ; - CHAR *__cil_tmp165 ; - CHAR *__cil_tmp166 ; - unsigned int __cil_tmp167 ; - unsigned int __cil_tmp168 ; - unsigned int __cil_tmp169 ; - unsigned int __cil_tmp170 ; - unsigned int __cil_tmp171 ; - unsigned int __cil_tmp172 ; - unsigned int __cil_tmp173 ; - FAST_MUTEX *__cil_tmp174 ; - unsigned int __cil_tmp175 ; - unsigned int __cil_tmp176 ; - unsigned int __cil_tmp177 ; - unsigned int __cil_tmp178 ; - unsigned int __cil_tmp179 ; - UCHAR __cil_tmp180 ; - unsigned int __cil_tmp181 ; - unsigned int __cil_tmp182 ; - UCHAR __cil_tmp183 ; - int __cil_tmp184 ; - unsigned int __cil_tmp185 ; - unsigned int __cil_tmp186 ; - UCHAR __cil_tmp187 ; - int __cil_tmp188 ; - KUSER_SHARED_DATA *__cil_tmp189 ; - unsigned int __cil_tmp190 ; - unsigned int __cil_tmp191 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp192 ; - int __cil_tmp193 ; - unsigned int __cil_tmp194 ; - unsigned int __cil_tmp195 ; - unsigned int __cil_tmp196 ; - unsigned int __cil_tmp197 ; - PDEVICE_OBJECT __cil_tmp198 ; - int __cil_tmp199 ; - int __cil_tmp200 ; - int __cil_tmp201 ; - int __cil_tmp202 ; - unsigned long __cil_tmp203 ; - void *__cil_tmp204 ; - unsigned int __cil_tmp205 ; - unsigned int __cil_tmp206 ; - unsigned int __cil_tmp207 ; - unsigned int __cil_tmp208 ; - unsigned int __cil_tmp209 ; - unsigned int __cil_tmp210 ; - unsigned int __cil_tmp211 ; - unsigned int __cil_tmp212 ; - PDEVICE_OBJECT __cil_tmp213 ; - int __cil_tmp214 ; - int __cil_tmp215 ; - int __cil_tmp216 ; - int __cil_tmp217 ; - unsigned long __cil_tmp218 ; - void *__cil_tmp219 ; - unsigned int __cil_tmp220 ; - unsigned int __cil_tmp221 ; - PDEVICE_OBJECT __cil_tmp222 ; - int __cil_tmp223 ; - int __cil_tmp224 ; - int __cil_tmp225 ; - int __cil_tmp226 ; - unsigned long __cil_tmp227 ; - unsigned int __cil_tmp228 ; - unsigned int __cil_tmp229 ; - PDEVICE_OBJECT __cil_tmp230 ; - void *__cil_tmp231 ; - unsigned int __cil_tmp232 ; - unsigned int __cil_tmp233 ; - unsigned int __cil_tmp234 ; - unsigned int __cil_tmp235 ; - FAST_MUTEX *__cil_tmp236 ; - unsigned int __cil_tmp237 ; - unsigned int __cil_tmp238 ; - unsigned int __cil_tmp239 ; - unsigned int __cil_tmp240 ; - FAST_MUTEX *__cil_tmp241 ; - void *__cil_tmp242 ; - unsigned int __cil_tmp243 ; - unsigned int __cil_tmp244 ; - BOOLEAN __cil_tmp245 ; - unsigned int __cil_tmp246 ; - unsigned int __cil_tmp247 ; - PDEVICE_OBJECT __cil_tmp248 ; - int __cil_tmp249 ; - int __cil_tmp250 ; - int __cil_tmp251 ; - int __cil_tmp252 ; - unsigned long __cil_tmp253 ; - void *__cil_tmp254 ; - unsigned int __cil_tmp255 ; - unsigned int __cil_tmp256 ; - KUSER_SHARED_DATA *__cil_tmp257 ; - unsigned int __cil_tmp258 ; - unsigned int __cil_tmp259 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp260 ; - int __cil_tmp261 ; - unsigned int __cil_tmp262 ; - unsigned int __cil_tmp263 ; - unsigned int __cil_tmp264 ; - unsigned int __cil_tmp265 ; - PDEVICE_OBJECT __cil_tmp266 ; - unsigned int __cil_tmp267 ; - unsigned int __cil_tmp268 ; - ULONG __cil_tmp269 ; - unsigned int __cil_tmp270 ; - unsigned int __cil_tmp271 ; - UCHAR __cil_tmp272 ; - int __cil_tmp273 ; - int __cil_tmp274 ; - unsigned int __cil_tmp275 ; - unsigned int __cil_tmp276 ; - BOOLEAN __cil_tmp277 ; - unsigned int __cil_tmp278 ; - unsigned int __cil_tmp279 ; - PDEVICE_OBJECT __cil_tmp280 ; - int __cil_tmp281 ; - int __cil_tmp282 ; - int __cil_tmp283 ; - int __cil_tmp284 ; - unsigned long __cil_tmp285 ; - void *__cil_tmp286 ; - unsigned int __cil_tmp287 ; - unsigned int __cil_tmp288 ; - KUSER_SHARED_DATA *__cil_tmp289 ; - unsigned int __cil_tmp290 ; - unsigned int __cil_tmp291 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp292 ; - int __cil_tmp293 ; - unsigned int __cil_tmp294 ; - unsigned int __cil_tmp295 ; - unsigned int __cil_tmp296 ; - unsigned int __cil_tmp297 ; - PDEVICE_OBJECT __cil_tmp298 ; - unsigned int __cil_tmp299 ; - unsigned int __cil_tmp300 ; - ULONG __cil_tmp301 ; - unsigned int __cil_tmp302 ; - unsigned int __cil_tmp303 ; - UCHAR __cil_tmp304 ; - int __cil_tmp305 ; - int __cil_tmp306 ; - unsigned int __cil_tmp307 ; - unsigned int __cil_tmp308 ; - unsigned int __cil_tmp309 ; - unsigned int __cil_tmp310 ; - ULONG __cil_tmp311 ; - int __cil_tmp312 ; - int __cil_tmp313 ; - int __cil_tmp314 ; - int __cil_tmp315 ; - int __cil_tmp316 ; - int __cil_tmp317 ; - int __cil_tmp318 ; - int __cil_tmp319 ; - unsigned int __cil_tmp320 ; - unsigned int __cil_tmp321 ; - UCHAR __cil_tmp322 ; - int __cil_tmp323 ; - int __cil_tmp324 ; - int __cil_tmp325 ; - int __cil_tmp326 ; - unsigned char __cil_tmp327 ; - int __cil_tmp328 ; - int __cil_tmp329 ; - unsigned int __cil_tmp330 ; - unsigned int __cil_tmp331 ; - unsigned long __cil_tmp332 ; - unsigned int __cil_tmp333 ; - unsigned int __cil_tmp334 ; - ULONG __cil_tmp335 ; - unsigned int __cil_tmp336 ; - unsigned int __cil_tmp337 ; - UCHAR __cil_tmp338 ; - int __cil_tmp339 ; - int __cil_tmp340 ; - int __cil_tmp341 ; - int __cil_tmp342 ; - unsigned char __cil_tmp343 ; - unsigned int __cil_tmp344 ; - unsigned int __cil_tmp345 ; - PVOID __cil_tmp346 ; - unsigned int __cil_tmp347 ; - unsigned int __cil_tmp348 ; - unsigned int __cil_tmp349 ; - unsigned int __cil_tmp350 ; - unsigned int __cil_tmp351 ; - unsigned int __cil_tmp352 ; - MEDIA_TYPE __cil_tmp353 ; - int __cil_tmp354 ; - unsigned int __cil_tmp355 ; - unsigned int __cil_tmp356 ; - unsigned int __cil_tmp357 ; - unsigned int __cil_tmp358 ; - unsigned int __cil_tmp359 ; - unsigned int __cil_tmp360 ; - unsigned int __cil_tmp361 ; - unsigned int __cil_tmp362 ; - unsigned int __cil_tmp363 ; - unsigned int __cil_tmp364 ; - unsigned int __cil_tmp365 ; - unsigned int __cil_tmp366 ; - unsigned int __cil_tmp367 ; - UCHAR __cil_tmp368 ; - int __cil_tmp369 ; - int __cil_tmp370 ; - unsigned int __cil_tmp371 ; - unsigned int __cil_tmp372 ; - unsigned int __cil_tmp373 ; - unsigned int __cil_tmp374 ; - unsigned int __cil_tmp375 ; - unsigned int __cil_tmp376 ; - unsigned int __cil_tmp377 ; - unsigned int __cil_tmp378 ; - unsigned int __cil_tmp379 ; - UCHAR __cil_tmp380 ; - unsigned int __cil_tmp381 ; - unsigned int __cil_tmp382 ; - unsigned int __cil_tmp383 ; - unsigned int __cil_tmp384 ; - unsigned int __cil_tmp385 ; - UCHAR __cil_tmp386 ; - unsigned int __cil_tmp387 ; - unsigned int __cil_tmp388 ; - unsigned int __cil_tmp389 ; - unsigned int __cil_tmp390 ; - unsigned int __cil_tmp391 ; - USHORT __cil_tmp392 ; - unsigned int __cil_tmp393 ; - unsigned int __cil_tmp394 ; - unsigned int __cil_tmp395 ; - int __cil_tmp396 ; - int __cil_tmp397 ; - int __cil_tmp398 ; - int __cil_tmp399 ; - int __cil_tmp400 ; - int __cil_tmp401 ; - int __cil_tmp402 ; - int __cil_tmp403 ; - unsigned int __cil_tmp404 ; - unsigned int __cil_tmp405 ; - int __cil_tmp406 ; - int __cil_tmp407 ; - KUSER_SHARED_DATA *__cil_tmp408 ; - unsigned int __cil_tmp409 ; - unsigned int __cil_tmp410 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp411 ; - int __cil_tmp412 ; - unsigned int __cil_tmp413 ; - unsigned int __cil_tmp414 ; - unsigned int __cil_tmp415 ; - unsigned int __cil_tmp416 ; - unsigned int __cil_tmp417 ; - unsigned int __cil_tmp418 ; - unsigned int __cil_tmp419 ; - unsigned int __cil_tmp420 ; - unsigned int __cil_tmp421 ; - unsigned int __cil_tmp422 ; - unsigned int __cil_tmp423 ; - unsigned int __cil_tmp424 ; - unsigned int __cil_tmp425 ; - unsigned int __cil_tmp426 ; - UCHAR *__cil_tmp427 ; - unsigned int __cil_tmp428 ; - unsigned int __cil_tmp429 ; - unsigned int __cil_tmp430 ; - unsigned int __cil_tmp431 ; - UCHAR *__cil_tmp432 ; - void *__cil_tmp433 ; - struct _MDL *__cil_tmp434 ; - unsigned int __cil_tmp435 ; - unsigned int __cil_tmp436 ; - PVOID __cil_tmp437 ; - unsigned int __cil_tmp438 ; - unsigned int __cil_tmp439 ; - unsigned int __cil_tmp440 ; - unsigned int __cil_tmp441 ; - unsigned int __cil_tmp442 ; - unsigned int __cil_tmp443 ; - unsigned int __cil_tmp444 ; - unsigned int __cil_tmp445 ; - unsigned int __cil_tmp446 ; - unsigned int __cil_tmp447 ; - unsigned int __cil_tmp448 ; - LIST_ENTRY *__cil_tmp449 ; - unsigned int __cil_tmp450 ; - unsigned int __cil_tmp451 ; - KSPIN_LOCK *__cil_tmp452 ; - unsigned int __cil_tmp453 ; - unsigned int __cil_tmp454 ; - FAST_MUTEX *__cil_tmp455 ; - unsigned int __cil_tmp456 ; - unsigned int __cil_tmp457 ; - unsigned int __cil_tmp458 ; - unsigned int __cil_tmp459 ; - LONG __cil_tmp460 ; - unsigned int __cil_tmp461 ; - unsigned int __cil_tmp462 ; - FAST_MUTEX *__cil_tmp463 ; - unsigned int __cil_tmp464 ; - unsigned int __cil_tmp465 ; - IRP *__cil_tmp466 ; - unsigned int __cil_tmp467 ; - unsigned int __cil_tmp468 ; - LIST_ENTRY *__cil_tmp469 ; - unsigned long __cil_tmp470 ; - CHAR *__cil_tmp471 ; - CHAR *__cil_tmp472 ; - unsigned int __cil_tmp473 ; - unsigned int __cil_tmp474 ; - unsigned int __cil_tmp475 ; - unsigned int __cil_tmp476 ; - KUSER_SHARED_DATA *__cil_tmp477 ; - unsigned int __cil_tmp478 ; - unsigned int __cil_tmp479 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp480 ; - int __cil_tmp481 ; - unsigned int __cil_tmp482 ; - unsigned int __cil_tmp483 ; - unsigned int __cil_tmp484 ; - unsigned int __cil_tmp485 ; - PDEVICE_OBJECT __cil_tmp486 ; - int __cil_tmp487 ; - int __cil_tmp488 ; - int __cil_tmp489 ; - int __cil_tmp490 ; - unsigned long __cil_tmp491 ; - unsigned int __cil_tmp492 ; - unsigned int __cil_tmp493 ; - PDEVICE_OBJECT __cil_tmp494 ; - void *__cil_tmp495 ; - unsigned int __cil_tmp496 ; - unsigned int __cil_tmp497 ; - unsigned int __cil_tmp498 ; - unsigned int __cil_tmp499 ; - LONGLONG *mem_500 ; - LONGLONG *mem_501 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_502 ; - BOOLEAN *mem_503 ; - PDEVICE_OBJECT *mem_504 ; - PDEVICE_OBJECT *mem_505 ; - PDEVICE_OBJECT *mem_506 ; - BOOLEAN *mem_507 ; - LONG *mem_508 ; - LONG *mem_509 ; - PKTHREAD *mem_510 ; - PKTHREAD *mem_511 ; - PKTHREAD *mem_512 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_513 ; - BOOLEAN *mem_514 ; - PDEVICE_OBJECT *mem_515 ; - PDEVICE_OBJECT *mem_516 ; - PDEVICE_OBJECT *mem_517 ; - PDEVICE_OBJECT *mem_518 ; - BOOLEAN *mem_519 ; - BOOLEAN *mem_520 ; - LONG *mem_521 ; - LONG *mem_522 ; - BOOLEAN *mem_523 ; - BOOLEAN *mem_524 ; - NTSTATUS *mem_525 ; - ULONG_PTR *mem_526 ; - struct _IO_STACK_LOCATION **mem_527 ; - UCHAR *mem_528 ; - UCHAR *mem_529 ; - UCHAR *mem_530 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_531 ; - BOOLEAN *mem_532 ; - PDEVICE_OBJECT *mem_533 ; - BOOLEAN *mem_534 ; - BOOLEAN *mem_535 ; - BOOLEAN *mem_536 ; - PDEVICE_OBJECT *mem_537 ; - PDEVICE_OBJECT *mem_538 ; - PDEVICE_OBJECT *mem_539 ; - BOOLEAN *mem_540 ; - LONG *mem_541 ; - BOOLEAN *mem_542 ; - PDEVICE_OBJECT *mem_543 ; - BOOLEAN *mem_544 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_545 ; - BOOLEAN *mem_546 ; - PDEVICE_OBJECT *mem_547 ; - ULONG *mem_548 ; - UCHAR *mem_549 ; - BOOLEAN *mem_550 ; - PDEVICE_OBJECT *mem_551 ; - BOOLEAN *mem_552 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_553 ; - BOOLEAN *mem_554 ; - PDEVICE_OBJECT *mem_555 ; - ULONG *mem_556 ; - UCHAR *mem_557 ; - ULONG *mem_558 ; - UCHAR *mem_559 ; - BOOLEAN *mem_560 ; - ULONG *mem_561 ; - UCHAR *mem_562 ; - PVOID *mem_563 ; - MEDIA_TYPE *mem_564 ; - MEDIA_TYPE *mem_565 ; - MEDIA_TYPE *mem_566 ; - ULONG *mem_567 ; - LONG *mem_568 ; - ULONG *mem_569 ; - ULONG *mem_570 ; - ULONG *mem_571 ; - UCHAR *mem_572 ; - ULONG *mem_573 ; - LONG *mem_574 ; - UCHAR *mem_575 ; - ULONG *mem_576 ; - UCHAR *mem_577 ; - ULONG *mem_578 ; - USHORT *mem_579 ; - ULONG *mem_580 ; - ULONG_PTR *mem_581 ; - PUCHAR *mem_582 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_583 ; - UCHAR *mem_584 ; - UCHAR *mem_585 ; - UCHAR *mem_586 ; - PVOID *mem_587 ; - UCHAR *mem_588 ; - UCHAR *mem_589 ; - ULONG_PTR *mem_590 ; - BOOLEAN *mem_591 ; - NTSTATUS *mem_592 ; - LONG *mem_593 ; - LONG *mem_594 ; - NTSTATUS *mem_595 ; - PUCHAR *mem_596 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_597 ; - BOOLEAN *mem_598 ; - PDEVICE_OBJECT *mem_599 ; - PDEVICE_OBJECT *mem_600 ; - BOOLEAN *mem_601 ; - BOOLEAN *mem_602 ; +void FloppyThread(PVOID Context) { + PIRP irp; + PIO_STACK_LOCATION irpSp; + PLIST_ENTRY request; + PDISKETTE_EXTENSION disketteExtension; + NTSTATUS ntStatus; + NTSTATUS waitStatus; + LARGE_INTEGER queueWait; + LARGE_INTEGER acquireWait; + PKTHREAD tmp; + PDISK_GEOMETRY outputBuffer; + PSENSE_DEVISE_STATUS_PTOS outputBuffer___0; + LARGE_INTEGER *__cil_tmp13; + LARGE_INTEGER *__cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + KSEMAPHORE *__cil_tmp17; + void *__cil_tmp18; + enum _KWAIT_REASON __cil_tmp19; + KUSER_SHARED_DATA *__cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp23; + int __cil_tmp24; + int __cil_tmp25; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + unsigned int __cil_tmp29; + PDEVICE_OBJECT __cil_tmp30; + int __cil_tmp31; + int __cil_tmp32; + int __cil_tmp33; + int __cil_tmp34; + unsigned long __cil_tmp35; + void *__cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + PDEVICE_OBJECT __cil_tmp39; + int __cil_tmp40; + int __cil_tmp41; + int __cil_tmp42; + int __cil_tmp43; + unsigned long __cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + PDEVICE_OBJECT __cil_tmp47; + void *__cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + unsigned int __cil_tmp51; + unsigned int __cil_tmp52; + FAST_MUTEX *__cil_tmp53; + unsigned int __cil_tmp54; + unsigned int __cil_tmp55; + LONG __cil_tmp56; + unsigned int __cil_tmp57; + unsigned int __cil_tmp58; + void *__cil_tmp59; + unsigned int __cil_tmp60; + unsigned int __cil_tmp61; + unsigned int __cil_tmp62; + PKTHREAD __cil_tmp63; + unsigned int __cil_tmp64; + unsigned int __cil_tmp65; + unsigned int __cil_tmp66; + PKTHREAD __cil_tmp67; + void *__cil_tmp68; + unsigned int __cil_tmp69; + unsigned int __cil_tmp70; + void *__cil_tmp71; + unsigned int __cil_tmp72; + unsigned int __cil_tmp73; + FAST_MUTEX *__cil_tmp74; + KUSER_SHARED_DATA *__cil_tmp75; + unsigned int __cil_tmp76; + unsigned int __cil_tmp77; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp78; + int __cil_tmp79; + unsigned int __cil_tmp80; + unsigned int __cil_tmp81; + unsigned int __cil_tmp82; + unsigned int __cil_tmp83; + PDEVICE_OBJECT __cil_tmp84; + int __cil_tmp85; + int __cil_tmp86; + int __cil_tmp87; + int __cil_tmp88; + unsigned long __cil_tmp89; + void *__cil_tmp90; + unsigned int __cil_tmp91; + unsigned int __cil_tmp92; + PDEVICE_OBJECT __cil_tmp93; + int __cil_tmp94; + int __cil_tmp95; + int __cil_tmp96; + int __cil_tmp97; + unsigned long __cil_tmp98; + void *__cil_tmp99; + unsigned int __cil_tmp100; + unsigned int __cil_tmp101; + PDEVICE_OBJECT __cil_tmp102; + int __cil_tmp103; + int __cil_tmp104; + int __cil_tmp105; + int __cil_tmp106; + unsigned long __cil_tmp107; + unsigned int __cil_tmp108; + unsigned int __cil_tmp109; + PDEVICE_OBJECT __cil_tmp110; + void *__cil_tmp111; + unsigned int __cil_tmp112; + unsigned int __cil_tmp113; + unsigned int __cil_tmp114; + unsigned int __cil_tmp115; + void *__cil_tmp116; + unsigned int __cil_tmp117; + unsigned int __cil_tmp118; + FAST_MUTEX *__cil_tmp119; + unsigned int __cil_tmp120; + unsigned int __cil_tmp121; + LIST_ENTRY *__cil_tmp122; + unsigned int __cil_tmp123; + unsigned int __cil_tmp124; + KSPIN_LOCK *__cil_tmp125; + unsigned int __cil_tmp126; + unsigned int __cil_tmp127; + FAST_MUTEX *__cil_tmp128; + unsigned int __cil_tmp129; + unsigned int __cil_tmp130; + unsigned int __cil_tmp131; + unsigned int __cil_tmp132; + LONG __cil_tmp133; + unsigned int __cil_tmp134; + unsigned int __cil_tmp135; + FAST_MUTEX *__cil_tmp136; + unsigned int __cil_tmp137; + unsigned int __cil_tmp138; + unsigned int __cil_tmp139; + unsigned int __cil_tmp140; + IRP *__cil_tmp141; + unsigned int __cil_tmp142; + unsigned int __cil_tmp143; + LIST_ENTRY *__cil_tmp144; + unsigned long __cil_tmp145; + CHAR *__cil_tmp146; + CHAR *__cil_tmp147; + unsigned int __cil_tmp148; + unsigned int __cil_tmp149; + FAST_MUTEX *__cil_tmp150; + unsigned int __cil_tmp151; + unsigned int __cil_tmp152; + BOOLEAN __cil_tmp153; + int __cil_tmp154; + unsigned int __cil_tmp155; + unsigned int __cil_tmp156; + FAST_MUTEX *__cil_tmp157; + unsigned int __cil_tmp158; + unsigned int __cil_tmp159; + IRP *__cil_tmp160; + unsigned int __cil_tmp161; + unsigned int __cil_tmp162; + LIST_ENTRY *__cil_tmp163; + unsigned long __cil_tmp164; + CHAR *__cil_tmp165; + CHAR *__cil_tmp166; + unsigned int __cil_tmp167; + unsigned int __cil_tmp168; + unsigned int __cil_tmp169; + unsigned int __cil_tmp170; + unsigned int __cil_tmp171; + unsigned int __cil_tmp172; + unsigned int __cil_tmp173; + FAST_MUTEX *__cil_tmp174; + unsigned int __cil_tmp175; + unsigned int __cil_tmp176; + unsigned int __cil_tmp177; + unsigned int __cil_tmp178; + unsigned int __cil_tmp179; + UCHAR __cil_tmp180; + unsigned int __cil_tmp181; + unsigned int __cil_tmp182; + UCHAR __cil_tmp183; + int __cil_tmp184; + unsigned int __cil_tmp185; + unsigned int __cil_tmp186; + UCHAR __cil_tmp187; + int __cil_tmp188; + KUSER_SHARED_DATA *__cil_tmp189; + unsigned int __cil_tmp190; + unsigned int __cil_tmp191; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp192; + int __cil_tmp193; + unsigned int __cil_tmp194; + unsigned int __cil_tmp195; + unsigned int __cil_tmp196; + unsigned int __cil_tmp197; + PDEVICE_OBJECT __cil_tmp198; + int __cil_tmp199; + int __cil_tmp200; + int __cil_tmp201; + int __cil_tmp202; + unsigned long __cil_tmp203; + void *__cil_tmp204; + unsigned int __cil_tmp205; + unsigned int __cil_tmp206; + unsigned int __cil_tmp207; + unsigned int __cil_tmp208; + unsigned int __cil_tmp209; + unsigned int __cil_tmp210; + unsigned int __cil_tmp211; + unsigned int __cil_tmp212; + PDEVICE_OBJECT __cil_tmp213; + int __cil_tmp214; + int __cil_tmp215; + int __cil_tmp216; + int __cil_tmp217; + unsigned long __cil_tmp218; + void *__cil_tmp219; + unsigned int __cil_tmp220; + unsigned int __cil_tmp221; + PDEVICE_OBJECT __cil_tmp222; + int __cil_tmp223; + int __cil_tmp224; + int __cil_tmp225; + int __cil_tmp226; + unsigned long __cil_tmp227; + unsigned int __cil_tmp228; + unsigned int __cil_tmp229; + PDEVICE_OBJECT __cil_tmp230; + void *__cil_tmp231; + unsigned int __cil_tmp232; + unsigned int __cil_tmp233; + unsigned int __cil_tmp234; + unsigned int __cil_tmp235; + FAST_MUTEX *__cil_tmp236; + unsigned int __cil_tmp237; + unsigned int __cil_tmp238; + unsigned int __cil_tmp239; + unsigned int __cil_tmp240; + FAST_MUTEX *__cil_tmp241; + void *__cil_tmp242; + unsigned int __cil_tmp243; + unsigned int __cil_tmp244; + BOOLEAN __cil_tmp245; + unsigned int __cil_tmp246; + unsigned int __cil_tmp247; + PDEVICE_OBJECT __cil_tmp248; + int __cil_tmp249; + int __cil_tmp250; + int __cil_tmp251; + int __cil_tmp252; + unsigned long __cil_tmp253; + void *__cil_tmp254; + unsigned int __cil_tmp255; + unsigned int __cil_tmp256; + KUSER_SHARED_DATA *__cil_tmp257; + unsigned int __cil_tmp258; + unsigned int __cil_tmp259; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp260; + int __cil_tmp261; + unsigned int __cil_tmp262; + unsigned int __cil_tmp263; + unsigned int __cil_tmp264; + unsigned int __cil_tmp265; + PDEVICE_OBJECT __cil_tmp266; + unsigned int __cil_tmp267; + unsigned int __cil_tmp268; + ULONG __cil_tmp269; + unsigned int __cil_tmp270; + unsigned int __cil_tmp271; + UCHAR __cil_tmp272; + int __cil_tmp273; + int __cil_tmp274; + unsigned int __cil_tmp275; + unsigned int __cil_tmp276; + BOOLEAN __cil_tmp277; + unsigned int __cil_tmp278; + unsigned int __cil_tmp279; + PDEVICE_OBJECT __cil_tmp280; + int __cil_tmp281; + int __cil_tmp282; + int __cil_tmp283; + int __cil_tmp284; + unsigned long __cil_tmp285; + void *__cil_tmp286; + unsigned int __cil_tmp287; + unsigned int __cil_tmp288; + KUSER_SHARED_DATA *__cil_tmp289; + unsigned int __cil_tmp290; + unsigned int __cil_tmp291; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp292; + int __cil_tmp293; + unsigned int __cil_tmp294; + unsigned int __cil_tmp295; + unsigned int __cil_tmp296; + unsigned int __cil_tmp297; + PDEVICE_OBJECT __cil_tmp298; + unsigned int __cil_tmp299; + unsigned int __cil_tmp300; + ULONG __cil_tmp301; + unsigned int __cil_tmp302; + unsigned int __cil_tmp303; + UCHAR __cil_tmp304; + int __cil_tmp305; + int __cil_tmp306; + unsigned int __cil_tmp307; + unsigned int __cil_tmp308; + unsigned int __cil_tmp309; + unsigned int __cil_tmp310; + ULONG __cil_tmp311; + int __cil_tmp312; + int __cil_tmp313; + int __cil_tmp314; + int __cil_tmp315; + int __cil_tmp316; + int __cil_tmp317; + int __cil_tmp318; + int __cil_tmp319; + unsigned int __cil_tmp320; + unsigned int __cil_tmp321; + UCHAR __cil_tmp322; + int __cil_tmp323; + int __cil_tmp324; + int __cil_tmp325; + int __cil_tmp326; + unsigned char __cil_tmp327; + int __cil_tmp328; + int __cil_tmp329; + unsigned int __cil_tmp330; + unsigned int __cil_tmp331; + unsigned long __cil_tmp332; + unsigned int __cil_tmp333; + unsigned int __cil_tmp334; + ULONG __cil_tmp335; + unsigned int __cil_tmp336; + unsigned int __cil_tmp337; + UCHAR __cil_tmp338; + int __cil_tmp339; + int __cil_tmp340; + int __cil_tmp341; + int __cil_tmp342; + unsigned char __cil_tmp343; + unsigned int __cil_tmp344; + unsigned int __cil_tmp345; + PVOID __cil_tmp346; + unsigned int __cil_tmp347; + unsigned int __cil_tmp348; + unsigned int __cil_tmp349; + unsigned int __cil_tmp350; + unsigned int __cil_tmp351; + unsigned int __cil_tmp352; + MEDIA_TYPE __cil_tmp353; + int __cil_tmp354; + unsigned int __cil_tmp355; + unsigned int __cil_tmp356; + unsigned int __cil_tmp357; + unsigned int __cil_tmp358; + unsigned int __cil_tmp359; + unsigned int __cil_tmp360; + unsigned int __cil_tmp361; + unsigned int __cil_tmp362; + unsigned int __cil_tmp363; + unsigned int __cil_tmp364; + unsigned int __cil_tmp365; + unsigned int __cil_tmp366; + unsigned int __cil_tmp367; + UCHAR __cil_tmp368; + int __cil_tmp369; + int __cil_tmp370; + unsigned int __cil_tmp371; + unsigned int __cil_tmp372; + unsigned int __cil_tmp373; + unsigned int __cil_tmp374; + unsigned int __cil_tmp375; + unsigned int __cil_tmp376; + unsigned int __cil_tmp377; + unsigned int __cil_tmp378; + unsigned int __cil_tmp379; + UCHAR __cil_tmp380; + unsigned int __cil_tmp381; + unsigned int __cil_tmp382; + unsigned int __cil_tmp383; + unsigned int __cil_tmp384; + unsigned int __cil_tmp385; + UCHAR __cil_tmp386; + unsigned int __cil_tmp387; + unsigned int __cil_tmp388; + unsigned int __cil_tmp389; + unsigned int __cil_tmp390; + unsigned int __cil_tmp391; + USHORT __cil_tmp392; + unsigned int __cil_tmp393; + unsigned int __cil_tmp394; + unsigned int __cil_tmp395; + int __cil_tmp396; + int __cil_tmp397; + int __cil_tmp398; + int __cil_tmp399; + int __cil_tmp400; + int __cil_tmp401; + int __cil_tmp402; + int __cil_tmp403; + unsigned int __cil_tmp404; + unsigned int __cil_tmp405; + int __cil_tmp406; + int __cil_tmp407; + KUSER_SHARED_DATA *__cil_tmp408; + unsigned int __cil_tmp409; + unsigned int __cil_tmp410; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp411; + int __cil_tmp412; + unsigned int __cil_tmp413; + unsigned int __cil_tmp414; + unsigned int __cil_tmp415; + unsigned int __cil_tmp416; + unsigned int __cil_tmp417; + unsigned int __cil_tmp418; + unsigned int __cil_tmp419; + unsigned int __cil_tmp420; + unsigned int __cil_tmp421; + unsigned int __cil_tmp422; + unsigned int __cil_tmp423; + unsigned int __cil_tmp424; + unsigned int __cil_tmp425; + unsigned int __cil_tmp426; + UCHAR *__cil_tmp427; + unsigned int __cil_tmp428; + unsigned int __cil_tmp429; + unsigned int __cil_tmp430; + unsigned int __cil_tmp431; + UCHAR *__cil_tmp432; + void *__cil_tmp433; + struct _MDL *__cil_tmp434; + unsigned int __cil_tmp435; + unsigned int __cil_tmp436; + PVOID __cil_tmp437; + unsigned int __cil_tmp438; + unsigned int __cil_tmp439; + unsigned int __cil_tmp440; + unsigned int __cil_tmp441; + unsigned int __cil_tmp442; + unsigned int __cil_tmp443; + unsigned int __cil_tmp444; + unsigned int __cil_tmp445; + unsigned int __cil_tmp446; + unsigned int __cil_tmp447; + unsigned int __cil_tmp448; + LIST_ENTRY *__cil_tmp449; + unsigned int __cil_tmp450; + unsigned int __cil_tmp451; + KSPIN_LOCK *__cil_tmp452; + unsigned int __cil_tmp453; + unsigned int __cil_tmp454; + FAST_MUTEX *__cil_tmp455; + unsigned int __cil_tmp456; + unsigned int __cil_tmp457; + unsigned int __cil_tmp458; + unsigned int __cil_tmp459; + LONG __cil_tmp460; + unsigned int __cil_tmp461; + unsigned int __cil_tmp462; + FAST_MUTEX *__cil_tmp463; + unsigned int __cil_tmp464; + unsigned int __cil_tmp465; + IRP *__cil_tmp466; + unsigned int __cil_tmp467; + unsigned int __cil_tmp468; + LIST_ENTRY *__cil_tmp469; + unsigned long __cil_tmp470; + CHAR *__cil_tmp471; + CHAR *__cil_tmp472; + unsigned int __cil_tmp473; + unsigned int __cil_tmp474; + unsigned int __cil_tmp475; + unsigned int __cil_tmp476; + KUSER_SHARED_DATA *__cil_tmp477; + unsigned int __cil_tmp478; + unsigned int __cil_tmp479; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp480; + int __cil_tmp481; + unsigned int __cil_tmp482; + unsigned int __cil_tmp483; + unsigned int __cil_tmp484; + unsigned int __cil_tmp485; + PDEVICE_OBJECT __cil_tmp486; + int __cil_tmp487; + int __cil_tmp488; + int __cil_tmp489; + int __cil_tmp490; + unsigned long __cil_tmp491; + unsigned int __cil_tmp492; + unsigned int __cil_tmp493; + PDEVICE_OBJECT __cil_tmp494; + void *__cil_tmp495; + unsigned int __cil_tmp496; + unsigned int __cil_tmp497; + unsigned int __cil_tmp498; + unsigned int __cil_tmp499; + LONGLONG *mem_500; + LONGLONG *mem_501; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_502; + BOOLEAN *mem_503; + PDEVICE_OBJECT *mem_504; + PDEVICE_OBJECT *mem_505; + PDEVICE_OBJECT *mem_506; + BOOLEAN *mem_507; + LONG *mem_508; + LONG *mem_509; + PKTHREAD *mem_510; + PKTHREAD *mem_511; + PKTHREAD *mem_512; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_513; + BOOLEAN *mem_514; + PDEVICE_OBJECT *mem_515; + PDEVICE_OBJECT *mem_516; + PDEVICE_OBJECT *mem_517; + PDEVICE_OBJECT *mem_518; + BOOLEAN *mem_519; + BOOLEAN *mem_520; + LONG *mem_521; + LONG *mem_522; + BOOLEAN *mem_523; + BOOLEAN *mem_524; + NTSTATUS *mem_525; + ULONG_PTR *mem_526; + struct _IO_STACK_LOCATION **mem_527; + UCHAR *mem_528; + UCHAR *mem_529; + UCHAR *mem_530; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_531; + BOOLEAN *mem_532; + PDEVICE_OBJECT *mem_533; + BOOLEAN *mem_534; + BOOLEAN *mem_535; + BOOLEAN *mem_536; + PDEVICE_OBJECT *mem_537; + PDEVICE_OBJECT *mem_538; + PDEVICE_OBJECT *mem_539; + BOOLEAN *mem_540; + LONG *mem_541; + BOOLEAN *mem_542; + PDEVICE_OBJECT *mem_543; + BOOLEAN *mem_544; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_545; + BOOLEAN *mem_546; + PDEVICE_OBJECT *mem_547; + ULONG *mem_548; + UCHAR *mem_549; + BOOLEAN *mem_550; + PDEVICE_OBJECT *mem_551; + BOOLEAN *mem_552; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_553; + BOOLEAN *mem_554; + PDEVICE_OBJECT *mem_555; + ULONG *mem_556; + UCHAR *mem_557; + ULONG *mem_558; + UCHAR *mem_559; + BOOLEAN *mem_560; + ULONG *mem_561; + UCHAR *mem_562; + PVOID *mem_563; + MEDIA_TYPE *mem_564; + MEDIA_TYPE *mem_565; + MEDIA_TYPE *mem_566; + ULONG *mem_567; + LONG *mem_568; + ULONG *mem_569; + ULONG *mem_570; + ULONG *mem_571; + UCHAR *mem_572; + ULONG *mem_573; + LONG *mem_574; + UCHAR *mem_575; + ULONG *mem_576; + UCHAR *mem_577; + ULONG *mem_578; + USHORT *mem_579; + ULONG *mem_580; + ULONG_PTR *mem_581; + PUCHAR *mem_582; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_583; + UCHAR *mem_584; + UCHAR *mem_585; + UCHAR *mem_586; + PVOID *mem_587; + UCHAR *mem_588; + UCHAR *mem_589; + ULONG_PTR *mem_590; + BOOLEAN *mem_591; + NTSTATUS *mem_592; + LONG *mem_593; + LONG *mem_594; + NTSTATUS *mem_595; + PUCHAR *mem_596; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_597; + BOOLEAN *mem_598; + PDEVICE_OBJECT *mem_599; + PDEVICE_OBJECT *mem_600; + BOOLEAN *mem_601; + BOOLEAN *mem_602; { - { + { #line 3904 - disketteExtension = (DISKETTE_EXTENSION *)Context; + disketteExtension = (DISKETTE_EXTENSION *)Context; #line 3905 - ntStatus = 0L; + ntStatus = 0L; #line 3915 - tmp = KeGetCurrentThread(); + tmp = KeGetCurrentThread(); #line 3915 - KeSetPriorityThread(tmp, 16L); + KeSetPriorityThread(tmp, 16L); #line 3917 - __cil_tmp13 = & queueWait; + __cil_tmp13 = &queueWait; #line 3917 - mem_500 = (LONGLONG *)__cil_tmp13; + mem_500 = (LONGLONG *)__cil_tmp13; #line 3917 - *mem_500 = -30000000LL; + *mem_500 = -30000000LL; #line 3918 - __cil_tmp14 = & acquireWait; + __cil_tmp14 = &acquireWait; #line 3918 - mem_501 = (LONGLONG *)__cil_tmp14; + mem_501 = (LONGLONG *)__cil_tmp14; #line 3918 - *mem_501 = -150000000LL; - } - { -#line 3920 - while (1) { - while_114_continue: /* CIL Label */ ; + *mem_501 = -150000000LL; + } { +#line 3920 + while (1) { + while_114_continue: /* CIL Label */; + { #line 3929 - __cil_tmp15 = (unsigned int )disketteExtension; + __cil_tmp15 = (unsigned int)disketteExtension; #line 3929 - __cil_tmp16 = __cil_tmp15 + 32; + __cil_tmp16 = __cil_tmp15 + 32; #line 3929 - __cil_tmp17 = (KSEMAPHORE *)__cil_tmp16; + __cil_tmp17 = (KSEMAPHORE *)__cil_tmp16; #line 3929 - __cil_tmp18 = (void *)__cil_tmp17; + __cil_tmp18 = (void *)__cil_tmp17; #line 3929 - __cil_tmp19 = (enum _KWAIT_REASON )0; + __cil_tmp19 = (enum _KWAIT_REASON)0; #line 3929 - waitStatus = KeWaitForSingleObject(__cil_tmp18, __cil_tmp19, (char)0, (unsigned char)0, - & queueWait); - } + waitStatus = KeWaitForSingleObject(__cil_tmp18, __cil_tmp19, (char)0, + (unsigned char)0, &queueWait); + } #line 3936 - if (waitStatus == 258L) { - { + if (waitStatus == 258L) { + { #line 3938 - __cil_tmp20 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp20 = (KUSER_SHARED_DATA * const)4292804608U; #line 3938 - __cil_tmp21 = (unsigned int )__cil_tmp20; + __cil_tmp21 = (unsigned int)__cil_tmp20; #line 3938 - __cil_tmp22 = __cil_tmp21 + 732; + __cil_tmp22 = __cil_tmp21 + 732; #line 3938 - mem_502 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp22; + mem_502 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp22; #line 3938 - __cil_tmp23 = *mem_502; + __cil_tmp23 = *mem_502; #line 3938 - __cil_tmp24 = (int )__cil_tmp23; + __cil_tmp24 = (int)__cil_tmp23; #line 3938 - __cil_tmp25 = __cil_tmp24 == 1; + __cil_tmp25 = __cil_tmp24 == 1; #line 3938 - if (! __cil_tmp25) { - { + if (!__cil_tmp25) { + { #line 3938 - __cil_tmp26 = (unsigned int )disketteExtension; + __cil_tmp26 = (unsigned int)disketteExtension; #line 3938 - __cil_tmp27 = __cil_tmp26 + 172; - { + __cil_tmp27 = __cil_tmp26 + 172; + { #line 3938 - mem_503 = (BOOLEAN *)__cil_tmp27; + mem_503 = (BOOLEAN *)__cil_tmp27; #line 3938 - if (*mem_503) { - { + if (*mem_503) { + { #line 3943 - while (1) { - while_115_continue: /* CIL Label */ ; - goto while_115_break; - } - while_115_break: /* CIL Label */ ; - } - { + while (1) { + while_115_continue: /* CIL Label */; + goto while_115_break; + } + while_115_break: /* CIL Label */; + } + { #line 3944 - __cil_tmp28 = (unsigned int )disketteExtension; + __cil_tmp28 = (unsigned int)disketteExtension; #line 3944 - __cil_tmp29 = __cil_tmp28 + 8; + __cil_tmp29 = __cil_tmp28 + 8; #line 3944 - mem_504 = (PDEVICE_OBJECT *)__cil_tmp29; + mem_504 = (PDEVICE_OBJECT *)__cil_tmp29; #line 3944 - __cil_tmp30 = *mem_504; + __cil_tmp30 = *mem_504; #line 3944 - __cil_tmp31 = 775 << 2; + __cil_tmp31 = 775 << 2; #line 3944 - __cil_tmp32 = 7 << 16; + __cil_tmp32 = 7 << 16; #line 3944 - __cil_tmp33 = __cil_tmp32 | __cil_tmp31; + __cil_tmp33 = __cil_tmp32 | __cil_tmp31; #line 3944 - __cil_tmp34 = __cil_tmp33 | 3; + __cil_tmp34 = __cil_tmp33 | 3; #line 3944 - __cil_tmp35 = (unsigned long )__cil_tmp34; + __cil_tmp35 = (unsigned long)__cil_tmp34; #line 3944 - __cil_tmp36 = (void *)0; + __cil_tmp36 = (void *)0; #line 3944 - FlFdcDeviceIo(__cil_tmp30, __cil_tmp35, __cil_tmp36); + FlFdcDeviceIo(__cil_tmp30, __cil_tmp35, __cil_tmp36); #line 3948 - __cil_tmp37 = (unsigned int )disketteExtension; + __cil_tmp37 = (unsigned int)disketteExtension; #line 3948 - __cil_tmp38 = __cil_tmp37 + 8; + __cil_tmp38 = __cil_tmp37 + 8; #line 3948 - mem_505 = (PDEVICE_OBJECT *)__cil_tmp38; + mem_505 = (PDEVICE_OBJECT *)__cil_tmp38; #line 3948 - __cil_tmp39 = *mem_505; + __cil_tmp39 = *mem_505; #line 3948 - __cil_tmp40 = 769 << 2; + __cil_tmp40 = 769 << 2; #line 3948 - __cil_tmp41 = 7 << 16; + __cil_tmp41 = 7 << 16; #line 3948 - __cil_tmp42 = __cil_tmp41 | __cil_tmp40; + __cil_tmp42 = __cil_tmp41 | __cil_tmp40; #line 3948 - __cil_tmp43 = __cil_tmp42 | 3; + __cil_tmp43 = __cil_tmp42 | 3; #line 3948 - __cil_tmp44 = (unsigned long )__cil_tmp43; + __cil_tmp44 = (unsigned long)__cil_tmp43; #line 3948 - __cil_tmp45 = (unsigned int )disketteExtension; + __cil_tmp45 = (unsigned int)disketteExtension; #line 3948 - __cil_tmp46 = __cil_tmp45 + 28; + __cil_tmp46 = __cil_tmp45 + 28; #line 3948 - mem_506 = (PDEVICE_OBJECT *)__cil_tmp46; + mem_506 = (PDEVICE_OBJECT *)__cil_tmp46; #line 3948 - __cil_tmp47 = *mem_506; + __cil_tmp47 = *mem_506; #line 3948 - __cil_tmp48 = (void *)__cil_tmp47; + __cil_tmp48 = (void *)__cil_tmp47; #line 3948 - FlFdcDeviceIo(__cil_tmp39, __cil_tmp44, __cil_tmp48); + FlFdcDeviceIo(__cil_tmp39, __cil_tmp44, __cil_tmp48); #line 3952 - __cil_tmp49 = (unsigned int )disketteExtension; + __cil_tmp49 = (unsigned int)disketteExtension; #line 3952 - __cil_tmp50 = __cil_tmp49 + 172; + __cil_tmp50 = __cil_tmp49 + 172; #line 3952 - mem_507 = (BOOLEAN *)__cil_tmp50; + mem_507 = (BOOLEAN *)__cil_tmp50; #line 3952 - *mem_507 = (unsigned char)0; + *mem_507 = (unsigned char)0; + } + } else { + } + } + } + } else { + } } - } else { - - } - } - } - } else { - - } - } - { + { #line 3956 - __cil_tmp51 = (unsigned int )disketteExtension; + __cil_tmp51 = (unsigned int)disketteExtension; #line 3956 - __cil_tmp52 = __cil_tmp51 + 56; + __cil_tmp52 = __cil_tmp51 + 56; #line 3956 - __cil_tmp53 = (FAST_MUTEX *)__cil_tmp52; + __cil_tmp53 = (FAST_MUTEX *)__cil_tmp52; #line 3956 - ExAcquireFastMutex(__cil_tmp53); - } - { + ExAcquireFastMutex(__cil_tmp53); + } + { #line 3958 - __cil_tmp54 = (unsigned int )disketteExtension; + __cil_tmp54 = (unsigned int)disketteExtension; #line 3958 - __cil_tmp55 = __cil_tmp54 + 88; + __cil_tmp55 = __cil_tmp54 + 88; #line 3958 - mem_508 = (LONG *)__cil_tmp55; + mem_508 = (LONG *)__cil_tmp55; #line 3958 - __cil_tmp56 = *mem_508; + __cil_tmp56 = *mem_508; #line 3958 - if (__cil_tmp56 == 0L) { + if (__cil_tmp56 == 0L) { #line 3959 - __cil_tmp57 = (unsigned int )disketteExtension; + __cil_tmp57 = (unsigned int)disketteExtension; #line 3959 - __cil_tmp58 = __cil_tmp57 + 88; + __cil_tmp58 = __cil_tmp57 + 88; #line 3959 - mem_509 = (LONG *)__cil_tmp58; + mem_509 = (LONG *)__cil_tmp58; #line 3959 - *mem_509 = -1L; - { + *mem_509 = -1L; + { #line 3969 - __cil_tmp59 = (void *)0; + __cil_tmp59 = (void *)0; #line 3969 - __cil_tmp60 = (unsigned int )__cil_tmp59; + __cil_tmp60 = (unsigned int)__cil_tmp59; #line 3969 - __cil_tmp61 = (unsigned int )disketteExtension; + __cil_tmp61 = (unsigned int)disketteExtension; #line 3969 - __cil_tmp62 = __cil_tmp61 + 92; + __cil_tmp62 = __cil_tmp61 + 92; #line 3969 - mem_510 = (PKTHREAD *)__cil_tmp62; + mem_510 = (PKTHREAD *)__cil_tmp62; #line 3969 - __cil_tmp63 = *mem_510; + __cil_tmp63 = *mem_510; #line 3969 - __cil_tmp64 = (unsigned int )__cil_tmp63; + __cil_tmp64 = (unsigned int)__cil_tmp63; #line 3969 - if (__cil_tmp64 != __cil_tmp60) { - { + if (__cil_tmp64 != __cil_tmp60) { + { #line 3971 - __cil_tmp65 = (unsigned int )disketteExtension; + __cil_tmp65 = (unsigned int)disketteExtension; #line 3971 - __cil_tmp66 = __cil_tmp65 + 92; + __cil_tmp66 = __cil_tmp65 + 92; #line 3971 - mem_511 = (PKTHREAD *)__cil_tmp66; + mem_511 = (PKTHREAD *)__cil_tmp66; #line 3971 - __cil_tmp67 = *mem_511; + __cil_tmp67 = *mem_511; #line 3971 - __cil_tmp68 = (void *)__cil_tmp67; + __cil_tmp68 = (void *)__cil_tmp67; #line 3971 - ObfDereferenceObject(__cil_tmp68); + ObfDereferenceObject(__cil_tmp68); #line 3972 - __cil_tmp69 = (unsigned int )disketteExtension; + __cil_tmp69 = (unsigned int)disketteExtension; #line 3972 - __cil_tmp70 = __cil_tmp69 + 92; + __cil_tmp70 = __cil_tmp69 + 92; #line 3972 - __cil_tmp71 = (void *)0; + __cil_tmp71 = (void *)0; #line 3972 - mem_512 = (PKTHREAD *)__cil_tmp70; + mem_512 = (PKTHREAD *)__cil_tmp70; #line 3972 - *mem_512 = (struct _KTHREAD *)__cil_tmp71; - } - } else { - - } - } - { + *mem_512 = (struct _KTHREAD *)__cil_tmp71; + } + } else { + } + } + { #line 3975 - __cil_tmp72 = (unsigned int )disketteExtension; + __cil_tmp72 = (unsigned int)disketteExtension; #line 3975 - __cil_tmp73 = __cil_tmp72 + 56; + __cil_tmp73 = __cil_tmp72 + 56; #line 3975 - __cil_tmp74 = (FAST_MUTEX *)__cil_tmp73; + __cil_tmp74 = (FAST_MUTEX *)__cil_tmp73; #line 3975 - ExReleaseFastMutex(__cil_tmp74); - } - { + ExReleaseFastMutex(__cil_tmp74); + } + { #line 3977 - __cil_tmp75 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp75 = (KUSER_SHARED_DATA * const)4292804608U; #line 3977 - __cil_tmp76 = (unsigned int )__cil_tmp75; + __cil_tmp76 = (unsigned int)__cil_tmp75; #line 3977 - __cil_tmp77 = __cil_tmp76 + 732; + __cil_tmp77 = __cil_tmp76 + 732; #line 3977 - mem_513 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp77; + mem_513 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp77; #line 3977 - __cil_tmp78 = *mem_513; + __cil_tmp78 = *mem_513; #line 3977 - __cil_tmp79 = (int )__cil_tmp78; + __cil_tmp79 = (int)__cil_tmp78; #line 3977 - if (__cil_tmp79 == 1) { - { + if (__cil_tmp79 == 1) { + { #line 3978 - __cil_tmp80 = (unsigned int )disketteExtension; + __cil_tmp80 = (unsigned int)disketteExtension; #line 3978 - __cil_tmp81 = __cil_tmp80 + 392; - { + __cil_tmp81 = __cil_tmp80 + 392; + { #line 3978 - mem_514 = (BOOLEAN *)__cil_tmp81; + mem_514 = (BOOLEAN *)__cil_tmp81; #line 3978 - if (*mem_514) { - { + if (*mem_514) { + { #line 3979 - __cil_tmp82 = (unsigned int )disketteExtension; + __cil_tmp82 = (unsigned int)disketteExtension; #line 3979 - __cil_tmp83 = __cil_tmp82 + 8; + __cil_tmp83 = __cil_tmp82 + 8; #line 3979 - mem_515 = (PDEVICE_OBJECT *)__cil_tmp83; + mem_515 = (PDEVICE_OBJECT *)__cil_tmp83; #line 3979 - __cil_tmp84 = *mem_515; + __cil_tmp84 = *mem_515; #line 3979 - __cil_tmp85 = 768 << 2; + __cil_tmp85 = 768 << 2; #line 3979 - __cil_tmp86 = 7 << 16; + __cil_tmp86 = 7 << 16; #line 3979 - __cil_tmp87 = __cil_tmp86 | __cil_tmp85; + __cil_tmp87 = __cil_tmp86 | __cil_tmp85; #line 3979 - __cil_tmp88 = __cil_tmp87 | 3; + __cil_tmp88 = __cil_tmp87 | 3; #line 3979 - __cil_tmp89 = (unsigned long )__cil_tmp88; + __cil_tmp89 = (unsigned long)__cil_tmp88; #line 3979 - __cil_tmp90 = (void *)(& acquireWait); + __cil_tmp90 = (void *)(&acquireWait); #line 3979 - ntStatus = FlFdcDeviceIo(__cil_tmp84, __cil_tmp89, __cil_tmp90); + ntStatus = FlFdcDeviceIo(__cil_tmp84, __cil_tmp89, + __cil_tmp90); #line 3984 - __cil_tmp91 = (unsigned int )disketteExtension; + __cil_tmp91 = (unsigned int)disketteExtension; #line 3984 - __cil_tmp92 = __cil_tmp91 + 8; + __cil_tmp92 = __cil_tmp91 + 8; #line 3984 - mem_516 = (PDEVICE_OBJECT *)__cil_tmp92; + mem_516 = (PDEVICE_OBJECT *)__cil_tmp92; #line 3984 - __cil_tmp93 = *mem_516; + __cil_tmp93 = *mem_516; #line 3984 - __cil_tmp94 = 775 << 2; + __cil_tmp94 = 775 << 2; #line 3984 - __cil_tmp95 = 7 << 16; + __cil_tmp95 = 7 << 16; #line 3984 - __cil_tmp96 = __cil_tmp95 | __cil_tmp94; + __cil_tmp96 = __cil_tmp95 | __cil_tmp94; #line 3984 - __cil_tmp97 = __cil_tmp96 | 3; + __cil_tmp97 = __cil_tmp96 | 3; #line 3984 - __cil_tmp98 = (unsigned long )__cil_tmp97; + __cil_tmp98 = (unsigned long)__cil_tmp97; #line 3984 - __cil_tmp99 = (void *)0; + __cil_tmp99 = (void *)0; #line 3984 - FlFdcDeviceIo(__cil_tmp93, __cil_tmp98, __cil_tmp99); + FlFdcDeviceIo(__cil_tmp93, __cil_tmp98, __cil_tmp99); #line 3988 - __cil_tmp100 = (unsigned int )disketteExtension; + __cil_tmp100 = (unsigned int)disketteExtension; #line 3988 - __cil_tmp101 = __cil_tmp100 + 8; + __cil_tmp101 = __cil_tmp100 + 8; #line 3988 - mem_517 = (PDEVICE_OBJECT *)__cil_tmp101; + mem_517 = (PDEVICE_OBJECT *)__cil_tmp101; #line 3988 - __cil_tmp102 = *mem_517; + __cil_tmp102 = *mem_517; #line 3988 - __cil_tmp103 = 769 << 2; + __cil_tmp103 = 769 << 2; #line 3988 - __cil_tmp104 = 7 << 16; + __cil_tmp104 = 7 << 16; #line 3988 - __cil_tmp105 = __cil_tmp104 | __cil_tmp103; + __cil_tmp105 = __cil_tmp104 | __cil_tmp103; #line 3988 - __cil_tmp106 = __cil_tmp105 | 3; + __cil_tmp106 = __cil_tmp105 | 3; #line 3988 - __cil_tmp107 = (unsigned long )__cil_tmp106; + __cil_tmp107 = (unsigned long)__cil_tmp106; #line 3988 - __cil_tmp108 = (unsigned int )disketteExtension; + __cil_tmp108 = (unsigned int)disketteExtension; #line 3988 - __cil_tmp109 = __cil_tmp108 + 28; + __cil_tmp109 = __cil_tmp108 + 28; #line 3988 - mem_518 = (PDEVICE_OBJECT *)__cil_tmp109; + mem_518 = (PDEVICE_OBJECT *)__cil_tmp109; #line 3988 - __cil_tmp110 = *mem_518; + __cil_tmp110 = *mem_518; #line 3988 - __cil_tmp111 = (void *)__cil_tmp110; + __cil_tmp111 = (void *)__cil_tmp110; #line 3988 - FlFdcDeviceIo(__cil_tmp102, __cil_tmp107, __cil_tmp111); + FlFdcDeviceIo(__cil_tmp102, __cil_tmp107, + __cil_tmp111); #line 3992 - __cil_tmp112 = (unsigned int )disketteExtension; + __cil_tmp112 = (unsigned int)disketteExtension; #line 3992 - __cil_tmp113 = __cil_tmp112 + 172; + __cil_tmp113 = __cil_tmp112 + 172; #line 3992 - mem_519 = (BOOLEAN *)__cil_tmp113; + mem_519 = (BOOLEAN *)__cil_tmp113; #line 3992 - *mem_519 = (unsigned char)0; + *mem_519 = (unsigned char)0; #line 3993 - __cil_tmp114 = (unsigned int )disketteExtension; + __cil_tmp114 = (unsigned int)disketteExtension; #line 3993 - __cil_tmp115 = __cil_tmp114 + 392; + __cil_tmp115 = __cil_tmp114 + 392; #line 3993 - mem_520 = (BOOLEAN *)__cil_tmp115; + mem_520 = (BOOLEAN *)__cil_tmp115; #line 3993 - *mem_520 = (unsigned char)0; - } - } else { - - } - } - } - } else { - - } - } - { + *mem_520 = (unsigned char)0; + } + } else { + } + } + } + } else { + } + } + { #line 3997 - ExAcquireFastMutex(PagingMutex); + ExAcquireFastMutex(PagingMutex); #line 3997 - PagingReferenceCount = PagingReferenceCount - 1UL; - } + PagingReferenceCount = PagingReferenceCount - 1UL; + } #line 3997 - if (PagingReferenceCount == 0UL) { - { + if (PagingReferenceCount == 0UL) { + { #line 3997 - __cil_tmp116 = (void *)(& DriverEntry); + __cil_tmp116 = (void *)(&DriverEntry); #line 3997 - MmPageEntireDriver(__cil_tmp116); - } - } else { - - } - { + MmPageEntireDriver(__cil_tmp116); + } + } else { + } + { #line 3997 - ExReleaseFastMutex(PagingMutex); - } - { + ExReleaseFastMutex(PagingMutex); + } + { #line 4001 - while (1) { - while_116_continue: /* CIL Label */ ; - goto while_116_break; - } - while_116_break: /* CIL Label */ ; - } - { + while (1) { + while_116_continue: /* CIL Label */; + goto while_116_break; + } + while_116_break: /* CIL Label */; + } + { #line 4002 - PsTerminateSystemThread(0L); - } - } else { - - } - } - { + PsTerminateSystemThread(0L); + } + } else { + } + } + { #line 4005 - __cil_tmp117 = (unsigned int )disketteExtension; + __cil_tmp117 = (unsigned int)disketteExtension; #line 4005 - __cil_tmp118 = __cil_tmp117 + 56; + __cil_tmp118 = __cil_tmp117 + 56; #line 4005 - __cil_tmp119 = (FAST_MUTEX *)__cil_tmp118; + __cil_tmp119 = (FAST_MUTEX *)__cil_tmp118; #line 4005 - ExReleaseFastMutex(__cil_tmp119); - } - goto __Cont; - } else { - - } - { + ExReleaseFastMutex(__cil_tmp119); + } + goto __Cont; + } else { + } + { #line 4009 - while (1) { - while_117_continue: /* CIL Label */ ; - { + while (1) { + while_117_continue: /* CIL Label */; + { #line 4009 - __cil_tmp120 = (unsigned int )disketteExtension; + __cil_tmp120 = (unsigned int)disketteExtension; #line 4009 - __cil_tmp121 = __cil_tmp120 + 96; + __cil_tmp121 = __cil_tmp120 + 96; #line 4009 - __cil_tmp122 = (LIST_ENTRY *)__cil_tmp121; + __cil_tmp122 = (LIST_ENTRY *)__cil_tmp121; #line 4009 - __cil_tmp123 = (unsigned int )disketteExtension; + __cil_tmp123 = (unsigned int)disketteExtension; #line 4009 - __cil_tmp124 = __cil_tmp123 + 52; + __cil_tmp124 = __cil_tmp123 + 52; #line 4009 - __cil_tmp125 = (KSPIN_LOCK *)__cil_tmp124; + __cil_tmp125 = (KSPIN_LOCK *)__cil_tmp124; #line 4009 - request = ExfInterlockedRemoveHeadList(__cil_tmp122, __cil_tmp125); - } + request = + ExfInterlockedRemoveHeadList(__cil_tmp122, __cil_tmp125); + } #line 4009 - if (! request) { - goto while_117_break; - } else { - - } - { + if (!request) { + goto while_117_break; + } else { + } + { #line 4013 - __cil_tmp126 = (unsigned int )disketteExtension; + __cil_tmp126 = (unsigned int)disketteExtension; #line 4013 - __cil_tmp127 = __cil_tmp126 + 56; + __cil_tmp127 = __cil_tmp126 + 56; #line 4013 - __cil_tmp128 = (FAST_MUTEX *)__cil_tmp127; + __cil_tmp128 = (FAST_MUTEX *)__cil_tmp127; #line 4013 - ExAcquireFastMutex(__cil_tmp128); + ExAcquireFastMutex(__cil_tmp128); #line 4015 - __cil_tmp129 = (unsigned int )disketteExtension; + __cil_tmp129 = (unsigned int)disketteExtension; #line 4015 - __cil_tmp130 = __cil_tmp129 + 88; + __cil_tmp130 = __cil_tmp129 + 88; #line 4015 - __cil_tmp131 = (unsigned int )disketteExtension; + __cil_tmp131 = (unsigned int)disketteExtension; #line 4015 - __cil_tmp132 = __cil_tmp131 + 88; + __cil_tmp132 = __cil_tmp131 + 88; #line 4015 - mem_521 = (LONG *)__cil_tmp132; + mem_521 = (LONG *)__cil_tmp132; #line 4015 - __cil_tmp133 = *mem_521; + __cil_tmp133 = *mem_521; #line 4015 - mem_522 = (LONG *)__cil_tmp130; + mem_522 = (LONG *)__cil_tmp130; #line 4015 - *mem_522 = __cil_tmp133 - 1L; + *mem_522 = __cil_tmp133 - 1L; #line 4016 - __cil_tmp134 = (unsigned int )disketteExtension; + __cil_tmp134 = (unsigned int)disketteExtension; #line 4016 - __cil_tmp135 = __cil_tmp134 + 56; + __cil_tmp135 = __cil_tmp134 + 56; #line 4016 - __cil_tmp136 = (FAST_MUTEX *)__cil_tmp135; + __cil_tmp136 = (FAST_MUTEX *)__cil_tmp135; #line 4016 - ExReleaseFastMutex(__cil_tmp136); + ExReleaseFastMutex(__cil_tmp136); #line 4018 - __cil_tmp137 = (unsigned int )disketteExtension; + __cil_tmp137 = (unsigned int)disketteExtension; #line 4018 - __cil_tmp138 = __cil_tmp137 + 104; + __cil_tmp138 = __cil_tmp137 + 104; #line 4018 - mem_523 = (BOOLEAN *)__cil_tmp138; + mem_523 = (BOOLEAN *)__cil_tmp138; #line 4018 - *mem_523 = (unsigned char)0; + *mem_523 = (unsigned char)0; #line 4020 - __cil_tmp139 = 0 + 24; + __cil_tmp139 = 0 + 24; #line 4020 - __cil_tmp140 = 64 + __cil_tmp139; + __cil_tmp140 = 64 + __cil_tmp139; #line 4020 - __cil_tmp141 = (IRP *)0; + __cil_tmp141 = (IRP *)0; #line 4020 - __cil_tmp142 = (unsigned int )__cil_tmp141; + __cil_tmp142 = (unsigned int)__cil_tmp141; #line 4020 - __cil_tmp143 = __cil_tmp142 + __cil_tmp140; + __cil_tmp143 = __cil_tmp142 + __cil_tmp140; #line 4020 - __cil_tmp144 = (LIST_ENTRY *)__cil_tmp143; + __cil_tmp144 = (LIST_ENTRY *)__cil_tmp143; #line 4020 - __cil_tmp145 = (unsigned long )__cil_tmp144; + __cil_tmp145 = (unsigned long)__cil_tmp144; #line 4020 - __cil_tmp146 = (CHAR *)request; + __cil_tmp146 = (CHAR *)request; #line 4020 - __cil_tmp147 = __cil_tmp146 - __cil_tmp145; + __cil_tmp147 = __cil_tmp146 - __cil_tmp145; #line 4020 - irp = (IRP *)__cil_tmp147; + irp = (IRP *)__cil_tmp147; #line 4026 - __cil_tmp148 = (unsigned int )disketteExtension; + __cil_tmp148 = (unsigned int)disketteExtension; #line 4026 - __cil_tmp149 = __cil_tmp148 + 396; + __cil_tmp149 = __cil_tmp148 + 396; #line 4026 - __cil_tmp150 = (FAST_MUTEX *)__cil_tmp149; + __cil_tmp150 = (FAST_MUTEX *)__cil_tmp149; #line 4026 - ExAcquireFastMutex(__cil_tmp150); - } - { + ExAcquireFastMutex(__cil_tmp150); + } + { #line 4027 - __cil_tmp151 = (unsigned int )disketteExtension; + __cil_tmp151 = (unsigned int)disketteExtension; #line 4027 - __cil_tmp152 = __cil_tmp151 + 393; + __cil_tmp152 = __cil_tmp151 + 393; #line 4027 - mem_524 = (BOOLEAN *)__cil_tmp152; + mem_524 = (BOOLEAN *)__cil_tmp152; #line 4027 - __cil_tmp153 = *mem_524; + __cil_tmp153 = *mem_524; #line 4027 - __cil_tmp154 = (int )__cil_tmp153; + __cil_tmp154 = (int)__cil_tmp153; #line 4027 - if (__cil_tmp154 == 1) { - { + if (__cil_tmp154 == 1) { + { #line 4028 - __cil_tmp155 = (unsigned int )disketteExtension; + __cil_tmp155 = (unsigned int)disketteExtension; #line 4028 - __cil_tmp156 = __cil_tmp155 + 396; + __cil_tmp156 = __cil_tmp155 + 396; #line 4028 - __cil_tmp157 = (FAST_MUTEX *)__cil_tmp156; + __cil_tmp157 = (FAST_MUTEX *)__cil_tmp156; #line 4028 - ExReleaseFastMutex(__cil_tmp157); - } - { + ExReleaseFastMutex(__cil_tmp157); + } + { #line 4030 - while (1) { - while_118_continue: /* CIL Label */ ; - goto while_118_break; - } - while_118_break: /* CIL Label */ ; - } - { + while (1) { + while_118_continue: /* CIL Label */; + goto while_118_break; + } + while_118_break: /* CIL Label */; + } + { #line 4032 - __cil_tmp158 = 0 + 24; + __cil_tmp158 = 0 + 24; #line 4032 - __cil_tmp159 = 64 + __cil_tmp158; + __cil_tmp159 = 64 + __cil_tmp158; #line 4032 - __cil_tmp160 = (IRP *)0; + __cil_tmp160 = (IRP *)0; #line 4032 - __cil_tmp161 = (unsigned int )__cil_tmp160; + __cil_tmp161 = (unsigned int)__cil_tmp160; #line 4032 - __cil_tmp162 = __cil_tmp161 + __cil_tmp159; + __cil_tmp162 = __cil_tmp161 + __cil_tmp159; #line 4032 - __cil_tmp163 = (LIST_ENTRY *)__cil_tmp162; + __cil_tmp163 = (LIST_ENTRY *)__cil_tmp162; #line 4032 - __cil_tmp164 = (unsigned long )__cil_tmp163; + __cil_tmp164 = (unsigned long)__cil_tmp163; #line 4032 - __cil_tmp165 = (CHAR *)request; + __cil_tmp165 = (CHAR *)request; #line 4032 - __cil_tmp166 = __cil_tmp165 - __cil_tmp164; + __cil_tmp166 = __cil_tmp165 - __cil_tmp164; #line 4032 - irp = (IRP *)__cil_tmp166; + irp = (IRP *)__cil_tmp166; #line 4033 - __cil_tmp167 = (unsigned int )irp; + __cil_tmp167 = (unsigned int)irp; #line 4033 - __cil_tmp168 = __cil_tmp167 + 24; + __cil_tmp168 = __cil_tmp167 + 24; #line 4033 - mem_525 = (NTSTATUS *)__cil_tmp168; + mem_525 = (NTSTATUS *)__cil_tmp168; #line 4033 - *mem_525 = -1073741101L; + *mem_525 = -1073741101L; #line 4034 - __cil_tmp169 = 24 + 4; + __cil_tmp169 = 24 + 4; #line 4034 - __cil_tmp170 = (unsigned int )irp; + __cil_tmp170 = (unsigned int)irp; #line 4034 - __cil_tmp171 = __cil_tmp170 + __cil_tmp169; + __cil_tmp171 = __cil_tmp170 + __cil_tmp169; #line 4034 - mem_526 = (ULONG_PTR *)__cil_tmp171; + mem_526 = (ULONG_PTR *)__cil_tmp171; #line 4034 - *mem_526 = 0UL; + *mem_526 = 0UL; #line 4035 - IofCompleteRequest(irp, (char)0); - } - goto while_117_continue; - } else { - - } - } - { + IofCompleteRequest(irp, (char)0); + } + goto while_117_continue; + } else { + } + } + { #line 4038 - __cil_tmp172 = (unsigned int )disketteExtension; + __cil_tmp172 = (unsigned int)disketteExtension; #line 4038 - __cil_tmp173 = __cil_tmp172 + 396; + __cil_tmp173 = __cil_tmp172 + 396; #line 4038 - __cil_tmp174 = (FAST_MUTEX *)__cil_tmp173; + __cil_tmp174 = (FAST_MUTEX *)__cil_tmp173; #line 4038 - ExReleaseFastMutex(__cil_tmp174); - } - { + ExReleaseFastMutex(__cil_tmp174); + } + { #line 4039 - while (1) { - while_119_continue: /* CIL Label */ ; - goto while_119_break; - } - while_119_break: /* CIL Label */ ; - } + while (1) { + while_119_continue: /* CIL Label */; + goto while_119_break; + } + while_119_break: /* CIL Label */; + } #line 4041 - __cil_tmp175 = 24 + 8; + __cil_tmp175 = 24 + 8; #line 4041 - __cil_tmp176 = 0 + __cil_tmp175; + __cil_tmp176 = 0 + __cil_tmp175; #line 4041 - __cil_tmp177 = 64 + __cil_tmp176; + __cil_tmp177 = 64 + __cil_tmp176; #line 4041 - __cil_tmp178 = (unsigned int )irp; + __cil_tmp178 = (unsigned int)irp; #line 4041 - __cil_tmp179 = __cil_tmp178 + __cil_tmp177; + __cil_tmp179 = __cil_tmp178 + __cil_tmp177; #line 4041 - mem_527 = (struct _IO_STACK_LOCATION **)__cil_tmp179; + mem_527 = (struct _IO_STACK_LOCATION **)__cil_tmp179; #line 4041 - irpSp = *mem_527; - { + irpSp = *mem_527; + { #line 4047 - while (1) { - while_120_continue: /* CIL Label */ ; - goto while_120_break; - } - while_120_break: /* CIL Label */ ; - } - { + while (1) { + while_120_continue: /* CIL Label */; + goto while_120_break; + } + while_120_break: /* CIL Label */; + } + { #line 4048 - mem_528 = (UCHAR *)irpSp; + mem_528 = (UCHAR *)irpSp; #line 4048 - __cil_tmp180 = *mem_528; + __cil_tmp180 = *mem_528; #line 4049 - if ((int )__cil_tmp180 == 27) { - goto switch_121_27; - } else { + if ((int)__cil_tmp180 == 27) { + goto switch_121_27; + } else { #line 4096 - if ((int )__cil_tmp180 == 3) { - goto switch_121_3; - } else { + if ((int)__cil_tmp180 == 3) { + goto switch_121_3; + } else { #line 4097 - if ((int )__cil_tmp180 == 4) { - goto switch_121_4; - } else { + if ((int)__cil_tmp180 == 4) { + goto switch_121_4; + } else { #line 4154 - if ((int )__cil_tmp180 == 14) { - goto switch_121_14; - } else { - { - goto switch_121_default; + if ((int)__cil_tmp180 == 14) { + goto switch_121_14; + } else { + { + goto switch_121_default; #line 4048 - if (0) { - switch_121_27: /* CIL Label */ ; - { + if (0) { + switch_121_27: /* CIL Label */; + { #line 4052 - while (1) { - while_122_continue: /* CIL Label */ ; - goto while_122_break; - } - while_122_break: /* CIL Label */ ; - } - { + while (1) { + while_122_continue: /* CIL Label */; + goto while_122_break; + } + while_122_break: /* CIL Label */; + } + { #line 4054 - __cil_tmp181 = (unsigned int )irpSp; + __cil_tmp181 = (unsigned int)irpSp; #line 4054 - __cil_tmp182 = __cil_tmp181 + 1; + __cil_tmp182 = __cil_tmp181 + 1; #line 4054 - mem_529 = (UCHAR *)__cil_tmp182; + mem_529 = (UCHAR *)__cil_tmp182; #line 4054 - __cil_tmp183 = *mem_529; + __cil_tmp183 = *mem_529; #line 4054 - __cil_tmp184 = (int )__cil_tmp183; + __cil_tmp184 = (int)__cil_tmp183; #line 4054 - if (__cil_tmp184 == 1) { - goto _L; - } else { - { + if (__cil_tmp184 == 1) { + goto _L; + } else { + { #line 4054 - __cil_tmp185 = (unsigned int )irpSp; + __cil_tmp185 = (unsigned int)irpSp; #line 4054 - __cil_tmp186 = __cil_tmp185 + 1; + __cil_tmp186 = __cil_tmp185 + 1; #line 4054 - mem_530 = (UCHAR *)__cil_tmp186; + mem_530 = (UCHAR *)__cil_tmp186; #line 4054 - __cil_tmp187 = *mem_530; + __cil_tmp187 = *mem_530; #line 4054 - __cil_tmp188 = (int )__cil_tmp187; + __cil_tmp188 = (int)__cil_tmp187; #line 4054 - if (__cil_tmp188 == 5) { - _L: - { + if (__cil_tmp188 == 5) { + _L : { #line 4057 - __cil_tmp189 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp189 = + (KUSER_SHARED_DATA * const)4292804608U; #line 4057 - __cil_tmp190 = (unsigned int )__cil_tmp189; + __cil_tmp190 = (unsigned int)__cil_tmp189; #line 4057 - __cil_tmp191 = __cil_tmp190 + 732; + __cil_tmp191 = __cil_tmp190 + 732; #line 4057 - mem_531 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp191; + mem_531 = (ALTERNATIVE_ARCHITECTURE_TYPE *) + __cil_tmp191; #line 4057 - __cil_tmp192 = *mem_531; + __cil_tmp192 = *mem_531; #line 4057 - __cil_tmp193 = (int )__cil_tmp192; + __cil_tmp193 = (int)__cil_tmp192; #line 4057 - if (__cil_tmp193 == 1) { - { + if (__cil_tmp193 == 1) { + { #line 4058 - __cil_tmp194 = (unsigned int )disketteExtension; + __cil_tmp194 = + (unsigned int)disketteExtension; #line 4058 - __cil_tmp195 = __cil_tmp194 + 392; - { + __cil_tmp195 = __cil_tmp194 + 392; + { #line 4058 - mem_532 = (BOOLEAN *)__cil_tmp195; + mem_532 = (BOOLEAN *)__cil_tmp195; #line 4058 - if (*mem_532) { - { + if (*mem_532) { + { #line 4059 - __cil_tmp196 = (unsigned int )disketteExtension; + __cil_tmp196 = + (unsigned int)disketteExtension; #line 4059 - __cil_tmp197 = __cil_tmp196 + 8; + __cil_tmp197 = __cil_tmp196 + 8; #line 4059 - mem_533 = (PDEVICE_OBJECT *)__cil_tmp197; + mem_533 = + (PDEVICE_OBJECT *)__cil_tmp197; #line 4059 - __cil_tmp198 = *mem_533; + __cil_tmp198 = *mem_533; #line 4059 - __cil_tmp199 = 768 << 2; + __cil_tmp199 = 768 << 2; #line 4059 - __cil_tmp200 = 7 << 16; + __cil_tmp200 = 7 << 16; #line 4059 - __cil_tmp201 = __cil_tmp200 | __cil_tmp199; + __cil_tmp201 = + __cil_tmp200 | __cil_tmp199; #line 4059 - __cil_tmp202 = __cil_tmp201 | 3; + __cil_tmp202 = __cil_tmp201 | 3; #line 4059 - __cil_tmp203 = (unsigned long )__cil_tmp202; + __cil_tmp203 = + (unsigned long)__cil_tmp202; #line 4059 - __cil_tmp204 = (void *)(& acquireWait); + __cil_tmp204 = + (void *)(&acquireWait); #line 4059 - FlFdcDeviceIo(__cil_tmp198, __cil_tmp203, __cil_tmp204); + FlFdcDeviceIo(__cil_tmp198, + __cil_tmp203, + __cil_tmp204); #line 4063 - __cil_tmp205 = (unsigned int )disketteExtension; + __cil_tmp205 = + (unsigned int)disketteExtension; #line 4063 - __cil_tmp206 = __cil_tmp205 + 392; + __cil_tmp206 = __cil_tmp205 + 392; #line 4063 - mem_534 = (BOOLEAN *)__cil_tmp206; + mem_534 = (BOOLEAN *)__cil_tmp206; #line 4063 - *mem_534 = (unsigned char)0; + *mem_534 = (unsigned char)0; #line 4064 - __cil_tmp207 = (unsigned int )disketteExtension; + __cil_tmp207 = + (unsigned int)disketteExtension; #line 4064 - __cil_tmp208 = __cil_tmp207 + 172; + __cil_tmp208 = __cil_tmp207 + 172; #line 4064 - mem_535 = (BOOLEAN *)__cil_tmp208; + mem_535 = (BOOLEAN *)__cil_tmp208; #line 4064 - *mem_535 = (unsigned char)1; - } - } else { - - } - } - } - } else { - - } - } - { + *mem_535 = (unsigned char)1; + } + } else { + } + } + } + } else { + } + } + { #line 4068 - __cil_tmp209 = (unsigned int )disketteExtension; + __cil_tmp209 = + (unsigned int)disketteExtension; #line 4068 - __cil_tmp210 = __cil_tmp209 + 172; - { + __cil_tmp210 = __cil_tmp209 + 172; + { #line 4068 - mem_536 = (BOOLEAN *)__cil_tmp210; + mem_536 = (BOOLEAN *)__cil_tmp210; #line 4068 - if (*mem_536) { - { + if (*mem_536) { + { #line 4070 - __cil_tmp211 = (unsigned int )disketteExtension; + __cil_tmp211 = + (unsigned int)disketteExtension; #line 4070 - __cil_tmp212 = __cil_tmp211 + 8; + __cil_tmp212 = __cil_tmp211 + 8; #line 4070 - mem_537 = (PDEVICE_OBJECT *)__cil_tmp212; + mem_537 = + (PDEVICE_OBJECT *)__cil_tmp212; #line 4070 - __cil_tmp213 = *mem_537; + __cil_tmp213 = *mem_537; #line 4070 - __cil_tmp214 = 775 << 2; + __cil_tmp214 = 775 << 2; #line 4070 - __cil_tmp215 = 7 << 16; + __cil_tmp215 = 7 << 16; #line 4070 - __cil_tmp216 = __cil_tmp215 | __cil_tmp214; + __cil_tmp216 = + __cil_tmp215 | __cil_tmp214; #line 4070 - __cil_tmp217 = __cil_tmp216 | 3; + __cil_tmp217 = __cil_tmp216 | 3; #line 4070 - __cil_tmp218 = (unsigned long )__cil_tmp217; + __cil_tmp218 = + (unsigned long)__cil_tmp217; #line 4070 - __cil_tmp219 = (void *)0; + __cil_tmp219 = (void *)0; #line 4070 - FlFdcDeviceIo(__cil_tmp213, __cil_tmp218, __cil_tmp219); + FlFdcDeviceIo(__cil_tmp213, + __cil_tmp218, + __cil_tmp219); #line 4074 - __cil_tmp220 = (unsigned int )disketteExtension; + __cil_tmp220 = + (unsigned int)disketteExtension; #line 4074 - __cil_tmp221 = __cil_tmp220 + 8; + __cil_tmp221 = __cil_tmp220 + 8; #line 4074 - mem_538 = (PDEVICE_OBJECT *)__cil_tmp221; + mem_538 = + (PDEVICE_OBJECT *)__cil_tmp221; #line 4074 - __cil_tmp222 = *mem_538; + __cil_tmp222 = *mem_538; #line 4074 - __cil_tmp223 = 769 << 2; + __cil_tmp223 = 769 << 2; #line 4074 - __cil_tmp224 = 7 << 16; + __cil_tmp224 = 7 << 16; #line 4074 - __cil_tmp225 = __cil_tmp224 | __cil_tmp223; + __cil_tmp225 = + __cil_tmp224 | __cil_tmp223; #line 4074 - __cil_tmp226 = __cil_tmp225 | 3; + __cil_tmp226 = __cil_tmp225 | 3; #line 4074 - __cil_tmp227 = (unsigned long )__cil_tmp226; + __cil_tmp227 = + (unsigned long)__cil_tmp226; #line 4074 - __cil_tmp228 = (unsigned int )disketteExtension; + __cil_tmp228 = + (unsigned int)disketteExtension; #line 4074 - __cil_tmp229 = __cil_tmp228 + 28; + __cil_tmp229 = __cil_tmp228 + 28; #line 4074 - mem_539 = (PDEVICE_OBJECT *)__cil_tmp229; + mem_539 = + (PDEVICE_OBJECT *)__cil_tmp229; #line 4074 - __cil_tmp230 = *mem_539; + __cil_tmp230 = *mem_539; #line 4074 - __cil_tmp231 = (void *)__cil_tmp230; + __cil_tmp231 = (void *)__cil_tmp230; #line 4074 - FlFdcDeviceIo(__cil_tmp222, __cil_tmp227, __cil_tmp231); + FlFdcDeviceIo(__cil_tmp222, + __cil_tmp227, + __cil_tmp231); #line 4078 - __cil_tmp232 = (unsigned int )disketteExtension; + __cil_tmp232 = + (unsigned int)disketteExtension; #line 4078 - __cil_tmp233 = __cil_tmp232 + 172; + __cil_tmp233 = __cil_tmp232 + 172; #line 4078 - mem_540 = (BOOLEAN *)__cil_tmp233; + mem_540 = (BOOLEAN *)__cil_tmp233; #line 4078 - *mem_540 = (unsigned char)0; - } - } else { - - } - } - } - { + *mem_540 = (unsigned char)0; + } + } else { + } + } + } + { #line 4082 - __cil_tmp234 = (unsigned int )disketteExtension; + __cil_tmp234 = + (unsigned int)disketteExtension; #line 4082 - __cil_tmp235 = __cil_tmp234 + 56; + __cil_tmp235 = __cil_tmp234 + 56; #line 4082 - __cil_tmp236 = (FAST_MUTEX *)__cil_tmp235; + __cil_tmp236 = (FAST_MUTEX *)__cil_tmp235; #line 4082 - ExAcquireFastMutex(__cil_tmp236); + ExAcquireFastMutex(__cil_tmp236); #line 4084 - __cil_tmp237 = (unsigned int )disketteExtension; + __cil_tmp237 = + (unsigned int)disketteExtension; #line 4084 - __cil_tmp238 = __cil_tmp237 + 88; + __cil_tmp238 = __cil_tmp237 + 88; #line 4084 - mem_541 = (LONG *)__cil_tmp238; + mem_541 = (LONG *)__cil_tmp238; #line 4084 - *mem_541 = -1L; + *mem_541 = -1L; #line 4085 - __cil_tmp239 = (unsigned int )disketteExtension; + __cil_tmp239 = + (unsigned int)disketteExtension; #line 4085 - __cil_tmp240 = __cil_tmp239 + 56; + __cil_tmp240 = __cil_tmp239 + 56; #line 4085 - __cil_tmp241 = (FAST_MUTEX *)__cil_tmp240; + __cil_tmp241 = (FAST_MUTEX *)__cil_tmp240; #line 4085 - ExReleaseFastMutex(__cil_tmp241); + ExReleaseFastMutex(__cil_tmp241); #line 4087 - ExAcquireFastMutex(PagingMutex); + ExAcquireFastMutex(PagingMutex); #line 4087 - PagingReferenceCount = PagingReferenceCount - 1UL; - } + PagingReferenceCount = + PagingReferenceCount - 1UL; + } #line 4087 - if (PagingReferenceCount == 0UL) { - { + if (PagingReferenceCount == 0UL) { + { #line 4087 - __cil_tmp242 = (void *)(& DriverEntry); + __cil_tmp242 = (void *)(&DriverEntry); #line 4087 - MmPageEntireDriver(__cil_tmp242); - } - } else { - - } - { + MmPageEntireDriver(__cil_tmp242); + } + } else { + } + { #line 4087 - ExReleaseFastMutex(PagingMutex); + ExReleaseFastMutex(PagingMutex); #line 4089 - PsTerminateSystemThread(0L); - } - } else { + PsTerminateSystemThread(0L); + } + } else { #line 4093 - ntStatus = -1073741808L; - } - } - } - } - goto switch_121_break; - switch_121_3: /* CIL Label */ ; - switch_121_4: /* CIL Label */ ; - { + ntStatus = -1073741808L; + } + } + } + } + goto switch_121_break; + switch_121_3: /* CIL Label */; + switch_121_4: /* CIL Label */; + { #line 4108 - __cil_tmp243 = (unsigned int )disketteExtension; + __cil_tmp243 = (unsigned int)disketteExtension; #line 4108 - __cil_tmp244 = __cil_tmp243 + 172; + __cil_tmp244 = __cil_tmp243 + 172; #line 4108 - mem_542 = (BOOLEAN *)__cil_tmp244; + mem_542 = (BOOLEAN *)__cil_tmp244; #line 4108 - __cil_tmp245 = *mem_542; + __cil_tmp245 = *mem_542; #line 4108 - if (! __cil_tmp245) { - { + if (!__cil_tmp245) { + { #line 4110 - __cil_tmp246 = (unsigned int )disketteExtension; + __cil_tmp246 = (unsigned int)disketteExtension; #line 4110 - __cil_tmp247 = __cil_tmp246 + 8; + __cil_tmp247 = __cil_tmp246 + 8; #line 4110 - mem_543 = (PDEVICE_OBJECT *)__cil_tmp247; + mem_543 = (PDEVICE_OBJECT *)__cil_tmp247; #line 4110 - __cil_tmp248 = *mem_543; + __cil_tmp248 = *mem_543; #line 4110 - __cil_tmp249 = 768 << 2; + __cil_tmp249 = 768 << 2; #line 4110 - __cil_tmp250 = 7 << 16; + __cil_tmp250 = 7 << 16; #line 4110 - __cil_tmp251 = __cil_tmp250 | __cil_tmp249; + __cil_tmp251 = __cil_tmp250 | __cil_tmp249; #line 4110 - __cil_tmp252 = __cil_tmp251 | 3; + __cil_tmp252 = __cil_tmp251 | 3; #line 4110 - __cil_tmp253 = (unsigned long )__cil_tmp252; + __cil_tmp253 = (unsigned long)__cil_tmp252; #line 4110 - __cil_tmp254 = (void *)(& acquireWait); + __cil_tmp254 = (void *)(&acquireWait); #line 4110 - ntStatus = FlFdcDeviceIo(__cil_tmp248, __cil_tmp253, __cil_tmp254); - } + ntStatus = FlFdcDeviceIo( + __cil_tmp248, __cil_tmp253, __cil_tmp254); + } #line 4115 - if (ntStatus >= 0L) { + if (ntStatus >= 0L) { #line 4116 - __cil_tmp255 = (unsigned int )disketteExtension; + __cil_tmp255 = (unsigned int)disketteExtension; #line 4116 - __cil_tmp256 = __cil_tmp255 + 172; + __cil_tmp256 = __cil_tmp255 + 172; #line 4116 - mem_544 = (BOOLEAN *)__cil_tmp256; + mem_544 = (BOOLEAN *)__cil_tmp256; #line 4116 - *mem_544 = (unsigned char)1; - { + *mem_544 = (unsigned char)1; + { #line 4117 - __cil_tmp257 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp257 = + (KUSER_SHARED_DATA * const)4292804608U; #line 4117 - __cil_tmp258 = (unsigned int )__cil_tmp257; + __cil_tmp258 = (unsigned int)__cil_tmp257; #line 4117 - __cil_tmp259 = __cil_tmp258 + 732; + __cil_tmp259 = __cil_tmp258 + 732; #line 4117 - mem_545 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp259; + mem_545 = (ALTERNATIVE_ARCHITECTURE_TYPE *) + __cil_tmp259; #line 4117 - __cil_tmp260 = *mem_545; + __cil_tmp260 = *mem_545; #line 4117 - __cil_tmp261 = (int )__cil_tmp260; + __cil_tmp261 = (int)__cil_tmp260; #line 4117 - if (__cil_tmp261 == 1) { + if (__cil_tmp261 == 1) { #line 4117 - __cil_tmp262 = (unsigned int )disketteExtension; + __cil_tmp262 = + (unsigned int)disketteExtension; #line 4117 - __cil_tmp263 = __cil_tmp262 + 392; + __cil_tmp263 = __cil_tmp262 + 392; #line 4117 - mem_546 = (BOOLEAN *)__cil_tmp263; + mem_546 = (BOOLEAN *)__cil_tmp263; #line 4117 - *mem_546 = (unsigned char)0; - } else { - - } - } - } else { - goto switch_121_break; - } - } else { - - } - } - { + *mem_546 = (unsigned char)0; + } else { + } + } + } else { + goto switch_121_break; + } + } else { + } + } + { #line 4128 - __cil_tmp264 = (unsigned int )disketteExtension; + __cil_tmp264 = (unsigned int)disketteExtension; #line 4128 - __cil_tmp265 = __cil_tmp264 + 28; + __cil_tmp265 = __cil_tmp264 + 28; #line 4128 - mem_547 = (PDEVICE_OBJECT *)__cil_tmp265; + mem_547 = (PDEVICE_OBJECT *)__cil_tmp265; #line 4128 - __cil_tmp266 = *mem_547; + __cil_tmp266 = *mem_547; #line 4128 - __cil_tmp267 = (unsigned int )__cil_tmp266; + __cil_tmp267 = (unsigned int)__cil_tmp266; #line 4128 - __cil_tmp268 = __cil_tmp267 + 28; + __cil_tmp268 = __cil_tmp267 + 28; #line 4128 - mem_548 = (ULONG *)__cil_tmp268; + mem_548 = (ULONG *)__cil_tmp268; #line 4128 - __cil_tmp269 = *mem_548; + __cil_tmp269 = *mem_548; #line 4128 - if (__cil_tmp269 & 2UL) { - { + if (__cil_tmp269 & 2UL) { + { #line 4128 - __cil_tmp270 = (unsigned int )irpSp; + __cil_tmp270 = (unsigned int)irpSp; #line 4128 - __cil_tmp271 = __cil_tmp270 + 2; + __cil_tmp271 = __cil_tmp270 + 2; #line 4128 - mem_549 = (UCHAR *)__cil_tmp271; + mem_549 = (UCHAR *)__cil_tmp271; #line 4128 - __cil_tmp272 = *mem_549; + __cil_tmp272 = *mem_549; #line 4128 - __cil_tmp273 = (int )__cil_tmp272; + __cil_tmp273 = (int)__cil_tmp272; #line 4128 - __cil_tmp274 = __cil_tmp273 & 2; + __cil_tmp274 = __cil_tmp273 & 2; #line 4128 - if (! __cil_tmp274) { - { + if (!__cil_tmp274) { + { #line 4136 - while (1) { - while_123_continue: /* CIL Label */ ; - goto while_123_break; - } - while_123_break: /* CIL Label */ ; - } + while (1) { + while_123_continue: /* CIL Label */; + goto while_123_break; + } + while_123_break: /* CIL Label */; + } #line 4145 - ntStatus = -2147483626L; - } else { - { + ntStatus = -2147483626L; + } else { + { #line 4149 - ntStatus = FlReadWrite(disketteExtension, irp, (unsigned char)0); - } - } - } - } else { - { + ntStatus = + FlReadWrite(disketteExtension, irp, + (unsigned char)0); + } + } + } + } else { + { #line 4149 - ntStatus = FlReadWrite(disketteExtension, irp, (unsigned char)0); - } - } - } - goto switch_121_break; - switch_121_14: /* CIL Label */ ; - { + ntStatus = FlReadWrite(disketteExtension, irp, + (unsigned char)0); + } + } + } + goto switch_121_break; + switch_121_14: /* CIL Label */; + { #line 4161 - __cil_tmp275 = (unsigned int )disketteExtension; + __cil_tmp275 = (unsigned int)disketteExtension; #line 4161 - __cil_tmp276 = __cil_tmp275 + 172; + __cil_tmp276 = __cil_tmp275 + 172; #line 4161 - mem_550 = (BOOLEAN *)__cil_tmp276; + mem_550 = (BOOLEAN *)__cil_tmp276; #line 4161 - __cil_tmp277 = *mem_550; + __cil_tmp277 = *mem_550; #line 4161 - if (! __cil_tmp277) { - { + if (!__cil_tmp277) { + { #line 4163 - __cil_tmp278 = (unsigned int )disketteExtension; + __cil_tmp278 = (unsigned int)disketteExtension; #line 4163 - __cil_tmp279 = __cil_tmp278 + 8; + __cil_tmp279 = __cil_tmp278 + 8; #line 4163 - mem_551 = (PDEVICE_OBJECT *)__cil_tmp279; + mem_551 = (PDEVICE_OBJECT *)__cil_tmp279; #line 4163 - __cil_tmp280 = *mem_551; + __cil_tmp280 = *mem_551; #line 4163 - __cil_tmp281 = 768 << 2; + __cil_tmp281 = 768 << 2; #line 4163 - __cil_tmp282 = 7 << 16; + __cil_tmp282 = 7 << 16; #line 4163 - __cil_tmp283 = __cil_tmp282 | __cil_tmp281; + __cil_tmp283 = __cil_tmp282 | __cil_tmp281; #line 4163 - __cil_tmp284 = __cil_tmp283 | 3; + __cil_tmp284 = __cil_tmp283 | 3; #line 4163 - __cil_tmp285 = (unsigned long )__cil_tmp284; + __cil_tmp285 = (unsigned long)__cil_tmp284; #line 4163 - __cil_tmp286 = (void *)(& acquireWait); + __cil_tmp286 = (void *)(&acquireWait); #line 4163 - ntStatus = FlFdcDeviceIo(__cil_tmp280, __cil_tmp285, __cil_tmp286); - } + ntStatus = FlFdcDeviceIo( + __cil_tmp280, __cil_tmp285, __cil_tmp286); + } #line 4168 - if (ntStatus >= 0L) { + if (ntStatus >= 0L) { #line 4169 - __cil_tmp287 = (unsigned int )disketteExtension; + __cil_tmp287 = (unsigned int)disketteExtension; #line 4169 - __cil_tmp288 = __cil_tmp287 + 172; + __cil_tmp288 = __cil_tmp287 + 172; #line 4169 - mem_552 = (BOOLEAN *)__cil_tmp288; + mem_552 = (BOOLEAN *)__cil_tmp288; #line 4169 - *mem_552 = (unsigned char)1; - { + *mem_552 = (unsigned char)1; + { #line 4170 - __cil_tmp289 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp289 = + (KUSER_SHARED_DATA * const)4292804608U; #line 4170 - __cil_tmp290 = (unsigned int )__cil_tmp289; + __cil_tmp290 = (unsigned int)__cil_tmp289; #line 4170 - __cil_tmp291 = __cil_tmp290 + 732; + __cil_tmp291 = __cil_tmp290 + 732; #line 4170 - mem_553 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp291; + mem_553 = (ALTERNATIVE_ARCHITECTURE_TYPE *) + __cil_tmp291; #line 4170 - __cil_tmp292 = *mem_553; + __cil_tmp292 = *mem_553; #line 4170 - __cil_tmp293 = (int )__cil_tmp292; + __cil_tmp293 = (int)__cil_tmp292; #line 4170 - if (__cil_tmp293 == 1) { + if (__cil_tmp293 == 1) { #line 4170 - __cil_tmp294 = (unsigned int )disketteExtension; + __cil_tmp294 = + (unsigned int)disketteExtension; #line 4170 - __cil_tmp295 = __cil_tmp294 + 392; + __cil_tmp295 = __cil_tmp294 + 392; #line 4170 - mem_554 = (BOOLEAN *)__cil_tmp295; + mem_554 = (BOOLEAN *)__cil_tmp295; #line 4170 - *mem_554 = (unsigned char)0; - } else { - - } - } - } else { - goto switch_121_break; - } - } else { - - } - } - { + *mem_554 = (unsigned char)0; + } else { + } + } + } else { + goto switch_121_break; + } + } else { + } + } + { #line 4180 - __cil_tmp296 = (unsigned int )disketteExtension; + __cil_tmp296 = (unsigned int)disketteExtension; #line 4180 - __cil_tmp297 = __cil_tmp296 + 28; + __cil_tmp297 = __cil_tmp296 + 28; #line 4180 - mem_555 = (PDEVICE_OBJECT *)__cil_tmp297; + mem_555 = (PDEVICE_OBJECT *)__cil_tmp297; #line 4180 - __cil_tmp298 = *mem_555; + __cil_tmp298 = *mem_555; #line 4180 - __cil_tmp299 = (unsigned int )__cil_tmp298; + __cil_tmp299 = (unsigned int)__cil_tmp298; #line 4180 - __cil_tmp300 = __cil_tmp299 + 28; + __cil_tmp300 = __cil_tmp299 + 28; #line 4180 - mem_556 = (ULONG *)__cil_tmp300; + mem_556 = (ULONG *)__cil_tmp300; #line 4180 - __cil_tmp301 = *mem_556; + __cil_tmp301 = *mem_556; #line 4180 - if (__cil_tmp301 & 2UL) { - { + if (__cil_tmp301 & 2UL) { + { #line 4180 - __cil_tmp302 = (unsigned int )irpSp; + __cil_tmp302 = (unsigned int)irpSp; #line 4180 - __cil_tmp303 = __cil_tmp302 + 2; + __cil_tmp303 = __cil_tmp302 + 2; #line 4180 - mem_557 = (UCHAR *)__cil_tmp303; + mem_557 = (UCHAR *)__cil_tmp303; #line 4180 - __cil_tmp304 = *mem_557; + __cil_tmp304 = *mem_557; #line 4180 - __cil_tmp305 = (int )__cil_tmp304; + __cil_tmp305 = (int)__cil_tmp304; #line 4180 - __cil_tmp306 = __cil_tmp305 & 2; + __cil_tmp306 = __cil_tmp305 & 2; #line 4180 - if (! __cil_tmp306) { - { + if (!__cil_tmp306) { + { #line 4188 - while (1) { - while_124_continue: /* CIL Label */ ; - goto while_124_break; - } - while_124_break: /* CIL Label */ ; - } + while (1) { + while_124_continue: /* CIL Label */; + goto while_124_break; + } + while_124_break: /* CIL Label */; + } #line 4196 - ntStatus = -2147483626L; - } else { - goto _L___2; - } - } - } else { - _L___2: - { + ntStatus = -2147483626L; + } else { + goto _L___2; + } + } + } else { + _L___2 : { #line 4200 - __cil_tmp307 = 0 + 8; + __cil_tmp307 = 0 + 8; #line 4200 - __cil_tmp308 = 4 + __cil_tmp307; + __cil_tmp308 = 4 + __cil_tmp307; #line 4200 - __cil_tmp309 = (unsigned int )irpSp; + __cil_tmp309 = (unsigned int)irpSp; #line 4200 - __cil_tmp310 = __cil_tmp309 + __cil_tmp308; + __cil_tmp310 = __cil_tmp309 + __cil_tmp308; #line 4200 - mem_558 = (ULONG *)__cil_tmp310; + mem_558 = (ULONG *)__cil_tmp310; #line 4200 - __cil_tmp311 = *mem_558; + __cil_tmp311 = *mem_558; #line 4201 - if ((int )__cil_tmp311 == (__cil_tmp315 | __cil_tmp312)) { - goto switch_125_exp_12; - } else { + if ((int)__cil_tmp311 == + (__cil_tmp315 | __cil_tmp312)) { + goto switch_125_exp_12; + } else { #line 4202 - if ((int )__cil_tmp311 == (__cil_tmp319 | __cil_tmp316)) { - goto switch_125_exp_13; - } else { + if ((int)__cil_tmp311 == + (__cil_tmp319 | __cil_tmp316)) { + goto switch_125_exp_13; + } else { #line 4232 - if ((int )__cil_tmp311 == (__cil_tmp329 | __cil_tmp328)) { - goto switch_125_exp_14; - } else { + if ((int)__cil_tmp311 == + (__cil_tmp329 | __cil_tmp328)) { + goto switch_125_exp_14; + } else { #line 4261 - if ((int )__cil_tmp311 == 7 << 16) { - goto switch_125_exp_15; - } else { + if ((int)__cil_tmp311 == 7 << 16) { + goto switch_125_exp_15; + } else { #line 4392 - if ((int )__cil_tmp311 == (__cil_tmp399 | __cil_tmp396)) { - goto switch_125_exp_16; - } else { + if ((int)__cil_tmp311 == + (__cil_tmp399 | __cil_tmp396)) { + goto switch_125_exp_16; + } else { #line 4393 - if ((int )__cil_tmp311 == (__cil_tmp403 | __cil_tmp400)) { - goto switch_125_exp_17; - } else { + if ((int)__cil_tmp311 == + (__cil_tmp403 | __cil_tmp400)) { + goto switch_125_exp_17; + } else { #line 4444 - if ((int )__cil_tmp311 == (__cil_tmp407 | __cil_tmp406)) { - goto switch_125_exp_18; - } else { + if ((int)__cil_tmp311 == + (__cil_tmp407 | __cil_tmp406)) { + goto switch_125_exp_18; + } else { #line 4200 - if (0) { - switch_125_exp_12: /* CIL Label */ - { - __cil_tmp312 = 512 << 2; - __cil_tmp313 = 1 << 14; - __cil_tmp314 = 45 << 16; - __cil_tmp315 = __cil_tmp314 | __cil_tmp313; - - } - switch_125_exp_13: /* CIL Label */ - { - __cil_tmp316 = 512 << 2; - __cil_tmp317 = 1 << 14; - __cil_tmp318 = 7 << 16; - __cil_tmp319 = __cil_tmp318 | __cil_tmp317; - - } - { + if (0) { + switch_125_exp_12 : /* CIL Label */ + { + __cil_tmp312 = 512 << 2; + __cil_tmp313 = 1 << 14; + __cil_tmp314 = 45 << 16; + __cil_tmp315 = + __cil_tmp314 | __cil_tmp313; + } + switch_125_exp_13 : /* CIL Label */ + { + __cil_tmp316 = 512 << 2; + __cil_tmp317 = 1 << 14; + __cil_tmp318 = 7 << 16; + __cil_tmp319 = + __cil_tmp318 | __cil_tmp317; + } + { #line 4215 - while (1) { - while_126_continue: /* CIL Label */ ; - goto while_126_break; - } - while_126_break: /* CIL Label */ ; - } - { + while (1) { + while_126_continue + : /* CIL Label */; + goto while_126_break; + } + while_126_break: /* CIL Label */; + } + { #line 4223 - __cil_tmp320 = (unsigned int )irpSp; + __cil_tmp320 = + (unsigned int)irpSp; #line 4223 - __cil_tmp321 = __cil_tmp320 + 2; + __cil_tmp321 = __cil_tmp320 + 2; #line 4223 - mem_559 = (UCHAR *)__cil_tmp321; + mem_559 = (UCHAR *)__cil_tmp321; #line 4223 - __cil_tmp322 = *mem_559; + __cil_tmp322 = *mem_559; #line 4223 - __cil_tmp323 = (int )__cil_tmp322; + __cil_tmp323 = + (int)__cil_tmp322; #line 4223 - __cil_tmp324 = __cil_tmp323 & 2; + __cil_tmp324 = __cil_tmp323 & 2; #line 4223 - __cil_tmp325 = ! __cil_tmp324; + __cil_tmp325 = !__cil_tmp324; #line 4223 - __cil_tmp326 = ! __cil_tmp325; + __cil_tmp326 = !__cil_tmp325; #line 4223 - __cil_tmp327 = (unsigned char )__cil_tmp326; + __cil_tmp327 = + (unsigned char)__cil_tmp326; #line 4223 - ntStatus = FlStartDrive(disketteExtension, irp, - (unsigned char)0, (unsigned char)0, - __cil_tmp327); - } - goto switch_125_break; - switch_125_exp_14: /* CIL Label */ - { - __cil_tmp328 = 9 << 2; - __cil_tmp329 = 7 << 16; - - } - { + ntStatus = FlStartDrive( + disketteExtension, irp, + (unsigned char)0, + (unsigned char)0, + __cil_tmp327); + } + goto switch_125_break; + switch_125_exp_14 : /* CIL Label */ + { + __cil_tmp328 = 9 << 2; + __cil_tmp329 = 7 << 16; + } + { #line 4244 - while (1) { - while_127_continue: /* CIL Label */ ; - goto while_127_break; - } - while_127_break: /* CIL Label */ ; - } - { + while (1) { + while_127_continue + : /* CIL Label */; + goto while_127_break; + } + while_127_break: /* CIL Label */; + } + { #line 4246 - __cil_tmp330 = (unsigned int )disketteExtension; + __cil_tmp330 = (unsigned int) + disketteExtension; #line 4246 - __cil_tmp331 = __cil_tmp330 + 250; - { + __cil_tmp331 = + __cil_tmp330 + 250; + { #line 4246 - mem_560 = (BOOLEAN *)__cil_tmp331; + mem_560 = + (BOOLEAN *)__cil_tmp331; #line 4246 - if (*mem_560) { + if (*mem_560) { #line 4248 - ntStatus = -1073741811L; - } else { - { + ntStatus = -1073741811L; + } else { + { #line 4252 - ntStatus = FlStartDrive(disketteExtension, irp, - (unsigned char)1, (unsigned char)0, - (unsigned char)1); - } - } - } - } - goto switch_125_break; - switch_125_exp_15: /* CIL Label */ ; - { + ntStatus = FlStartDrive( + disketteExtension, + irp, (unsigned char)1, + (unsigned char)0, + (unsigned char)1); + } + } + } + } + goto switch_125_break; + switch_125_exp_15: /* CIL Label */; + { #line 4268 - while (1) { - while_128_continue: /* CIL Label */ ; - goto while_128_break; - } - while_128_break: /* CIL Label */ ; - } - { + while (1) { + while_128_continue + : /* CIL Label */; + goto while_128_break; + } + while_128_break: /* CIL Label */; + } + { #line 4276 - __cil_tmp332 = (unsigned long )52U; + __cil_tmp332 = + (unsigned long)52U; #line 4276 - __cil_tmp333 = (unsigned int )irpSp; + __cil_tmp333 = + (unsigned int)irpSp; #line 4276 - __cil_tmp334 = __cil_tmp333 + 4; + __cil_tmp334 = __cil_tmp333 + 4; #line 4276 - mem_561 = (ULONG *)__cil_tmp334; + mem_561 = (ULONG *)__cil_tmp334; #line 4276 - __cil_tmp335 = *mem_561; + __cil_tmp335 = *mem_561; #line 4276 - if (__cil_tmp335 < __cil_tmp332) { + if (__cil_tmp335 < + __cil_tmp332) { #line 4280 - ntStatus = -1073741811L; - } else { - { + ntStatus = -1073741811L; + } else { + { #line 4284 - __cil_tmp336 = (unsigned int )irpSp; + __cil_tmp336 = + (unsigned int)irpSp; #line 4284 - __cil_tmp337 = __cil_tmp336 + 2; + __cil_tmp337 = + __cil_tmp336 + 2; #line 4284 - mem_562 = (UCHAR *)__cil_tmp337; + mem_562 = + (UCHAR *)__cil_tmp337; #line 4284 - __cil_tmp338 = *mem_562; + __cil_tmp338 = *mem_562; #line 4284 - __cil_tmp339 = (int )__cil_tmp338; + __cil_tmp339 = + (int)__cil_tmp338; #line 4284 - __cil_tmp340 = __cil_tmp339 & 2; + __cil_tmp340 = + __cil_tmp339 & 2; #line 4284 - __cil_tmp341 = ! __cil_tmp340; + __cil_tmp341 = + !__cil_tmp340; #line 4284 - __cil_tmp342 = ! __cil_tmp341; + __cil_tmp342 = + !__cil_tmp341; #line 4284 - __cil_tmp343 = (unsigned char )__cil_tmp342; + __cil_tmp343 = + (unsigned char) + __cil_tmp342; #line 4284 - ntStatus = FlStartDrive(disketteExtension, irp, - (unsigned char)0, (unsigned char)1, - __cil_tmp343); - } - } - } + ntStatus = FlStartDrive( + disketteExtension, irp, + (unsigned char)0, + (unsigned char)1, + __cil_tmp343); + } + } + } #line 4299 - if (ntStatus >= 0L) { - goto _L___0; - } else { + if (ntStatus >= 0L) { + goto _L___0; + } else { #line 4299 - if (ntStatus == -1073741804L) { - _L___0: + if (ntStatus == -1073741804L) { + _L___0: #line 4302 - __cil_tmp344 = (unsigned int )irp; + __cil_tmp344 = + (unsigned int)irp; #line 4302 - __cil_tmp345 = __cil_tmp344 + 12; + __cil_tmp345 = + __cil_tmp344 + 12; #line 4302 - mem_563 = (PVOID *)__cil_tmp345; + mem_563 = + (PVOID *)__cil_tmp345; #line 4302 - __cil_tmp346 = *mem_563; + __cil_tmp346 = *mem_563; #line 4302 - outputBuffer = (struct _DISK_GEOMETRY *)__cil_tmp346; + outputBuffer = + (struct _DISK_GEOMETRY *) + __cil_tmp346; #line 4310 - ntStatus = 0L; + ntStatus = 0L; #line 4312 - __cil_tmp347 = (unsigned int )outputBuffer; + __cil_tmp347 = (unsigned int) + outputBuffer; #line 4312 - __cil_tmp348 = __cil_tmp347 + 8; + __cil_tmp348 = + __cil_tmp347 + 8; #line 4312 - __cil_tmp349 = (unsigned int )disketteExtension; + __cil_tmp349 = (unsigned int) + disketteExtension; #line 4312 - __cil_tmp350 = __cil_tmp349 + 184; + __cil_tmp350 = + __cil_tmp349 + 184; #line 4312 - mem_564 = (MEDIA_TYPE *)__cil_tmp348; + mem_564 = (MEDIA_TYPE *) + __cil_tmp348; #line 4312 - mem_565 = (MEDIA_TYPE *)__cil_tmp350; + mem_565 = (MEDIA_TYPE *) + __cil_tmp350; #line 4312 - *mem_564 = *mem_565; - { + *mem_564 = *mem_565; + { #line 4320 - __cil_tmp351 = (unsigned int )disketteExtension; + __cil_tmp351 = + (unsigned int) + disketteExtension; #line 4320 - __cil_tmp352 = __cil_tmp351 + 184; + __cil_tmp352 = + __cil_tmp351 + 184; #line 4320 - mem_566 = (MEDIA_TYPE *)__cil_tmp352; + mem_566 = (MEDIA_TYPE *) + __cil_tmp352; #line 4320 - __cil_tmp353 = *mem_566; + __cil_tmp353 = *mem_566; #line 4320 - __cil_tmp354 = (int )__cil_tmp353; + __cil_tmp354 = + (int)__cil_tmp353; #line 4320 - if (__cil_tmp354 == 0) { - { + if (__cil_tmp354 == 0) { + { #line 4326 - while (1) { - while_129_continue: /* CIL Label */ ; - goto while_129_break; - } - while_129_break: /* CIL Label */ ; - } + while (1) { + while_129_continue + : /* CIL Label */; + goto while_129_break; + } + while_129_break + : /* CIL Label */; + } #line 4333 - mem_567 = (ULONG *)outputBuffer; + mem_567 = + (ULONG *)outputBuffer; #line 4333 - *mem_567 = 0UL; + *mem_567 = 0UL; #line 4334 - __cil_tmp355 = 0 + 4; + __cil_tmp355 = 0 + 4; #line 4334 - __cil_tmp356 = 0 + __cil_tmp355; + __cil_tmp356 = + 0 + __cil_tmp355; #line 4334 - __cil_tmp357 = (unsigned int )outputBuffer; + __cil_tmp357 = + (unsigned int) + outputBuffer; #line 4334 - __cil_tmp358 = __cil_tmp357 + __cil_tmp356; + __cil_tmp358 = + __cil_tmp357 + + __cil_tmp356; #line 4334 - mem_568 = (LONG *)__cil_tmp358; + mem_568 = + (LONG *)__cil_tmp358; #line 4334 - *mem_568 = 0L; + *mem_568 = 0L; #line 4335 - __cil_tmp359 = (unsigned int )outputBuffer; + __cil_tmp359 = + (unsigned int) + outputBuffer; #line 4335 - __cil_tmp360 = __cil_tmp359 + 40; + __cil_tmp360 = + __cil_tmp359 + 40; #line 4335 - mem_569 = (ULONG *)__cil_tmp360; + mem_569 = + (ULONG *)__cil_tmp360; #line 4335 - *mem_569 = 0UL; + *mem_569 = 0UL; #line 4336 - __cil_tmp361 = (unsigned int )outputBuffer; + __cil_tmp361 = + (unsigned int) + outputBuffer; #line 4336 - __cil_tmp362 = __cil_tmp361 + 44; + __cil_tmp362 = + __cil_tmp361 + 44; #line 4336 - mem_570 = (ULONG *)__cil_tmp362; + mem_570 = + (ULONG *)__cil_tmp362; #line 4336 - *mem_570 = 0UL; + *mem_570 = 0UL; #line 4337 - __cil_tmp363 = (unsigned int )outputBuffer; + __cil_tmp363 = + (unsigned int) + outputBuffer; #line 4337 - __cil_tmp364 = __cil_tmp363 + 48; + __cil_tmp364 = + __cil_tmp363 + 48; #line 4337 - mem_571 = (ULONG *)__cil_tmp364; + mem_571 = + (ULONG *)__cil_tmp364; #line 4337 - *mem_571 = 0UL; - } else { - { + *mem_571 = 0UL; + } else { + { #line 4349 - while (1) { - while_130_continue: /* CIL Label */ ; - goto while_130_break; - } - while_130_break: /* CIL Label */ ; - } + while (1) { + while_130_continue + : /* CIL Label */; + goto while_130_break; + } + while_130_break + : /* CIL Label */; + } #line 4350 - __cil_tmp365 = 308 + 48; + __cil_tmp365 = 308 + 48; #line 4350 - __cil_tmp366 = (unsigned int )disketteExtension; + __cil_tmp366 = + (unsigned int) + disketteExtension; #line 4350 - __cil_tmp367 = __cil_tmp366 + __cil_tmp365; + __cil_tmp367 = + __cil_tmp366 + + __cil_tmp365; #line 4350 - mem_572 = (UCHAR *)__cil_tmp367; + mem_572 = + (UCHAR *)__cil_tmp367; #line 4350 - __cil_tmp368 = *mem_572; + __cil_tmp368 = *mem_572; #line 4350 - __cil_tmp369 = (int )__cil_tmp368; + __cil_tmp369 = + (int)__cil_tmp368; #line 4350 - __cil_tmp370 = __cil_tmp369 + 1; + __cil_tmp370 = + __cil_tmp369 + 1; #line 4350 - mem_573 = (ULONG *)outputBuffer; + mem_573 = + (ULONG *)outputBuffer; #line 4350 - *mem_573 = (unsigned long )__cil_tmp370; + *mem_573 = (unsigned long) + __cil_tmp370; #line 4354 - __cil_tmp371 = 0 + 4; + __cil_tmp371 = 0 + 4; #line 4354 - __cil_tmp372 = 0 + __cil_tmp371; + __cil_tmp372 = + 0 + __cil_tmp371; #line 4354 - __cil_tmp373 = (unsigned int )outputBuffer; + __cil_tmp373 = + (unsigned int) + outputBuffer; #line 4354 - __cil_tmp374 = __cil_tmp373 + __cil_tmp372; + __cil_tmp374 = + __cil_tmp373 + + __cil_tmp372; #line 4354 - mem_574 = (LONG *)__cil_tmp374; + mem_574 = + (LONG *)__cil_tmp374; #line 4354 - *mem_574 = 0L; + *mem_574 = 0L; #line 4356 - __cil_tmp375 = (unsigned int )outputBuffer; + __cil_tmp375 = + (unsigned int) + outputBuffer; #line 4356 - __cil_tmp376 = __cil_tmp375 + 40; + __cil_tmp376 = + __cil_tmp375 + 40; #line 4356 - __cil_tmp377 = 308 + 51; + __cil_tmp377 = 308 + 51; #line 4356 - __cil_tmp378 = (unsigned int )disketteExtension; + __cil_tmp378 = + (unsigned int) + disketteExtension; #line 4356 - __cil_tmp379 = __cil_tmp378 + __cil_tmp377; + __cil_tmp379 = + __cil_tmp378 + + __cil_tmp377; #line 4356 - mem_575 = (UCHAR *)__cil_tmp379; + mem_575 = + (UCHAR *)__cil_tmp379; #line 4356 - __cil_tmp380 = *mem_575; + __cil_tmp380 = *mem_575; #line 4356 - mem_576 = (ULONG *)__cil_tmp376; + mem_576 = + (ULONG *)__cil_tmp376; #line 4356 - *mem_576 = (unsigned long )__cil_tmp380; + *mem_576 = (unsigned long) + __cil_tmp380; #line 4360 - __cil_tmp381 = (unsigned int )outputBuffer; + __cil_tmp381 = + (unsigned int) + outputBuffer; #line 4360 - __cil_tmp382 = __cil_tmp381 + 44; + __cil_tmp382 = + __cil_tmp381 + 44; #line 4360 - __cil_tmp383 = 308 + 38; + __cil_tmp383 = 308 + 38; #line 4360 - __cil_tmp384 = (unsigned int )disketteExtension; + __cil_tmp384 = + (unsigned int) + disketteExtension; #line 4360 - __cil_tmp385 = __cil_tmp384 + __cil_tmp383; + __cil_tmp385 = + __cil_tmp384 + + __cil_tmp383; #line 4360 - mem_577 = (UCHAR *)__cil_tmp385; + mem_577 = + (UCHAR *)__cil_tmp385; #line 4360 - __cil_tmp386 = *mem_577; + __cil_tmp386 = *mem_577; #line 4360 - mem_578 = (ULONG *)__cil_tmp382; + mem_578 = + (ULONG *)__cil_tmp382; #line 4360 - *mem_578 = (unsigned long )__cil_tmp386; + *mem_578 = (unsigned long) + __cil_tmp386; #line 4364 - __cil_tmp387 = (unsigned int )outputBuffer; + __cil_tmp387 = + (unsigned int) + outputBuffer; #line 4364 - __cil_tmp388 = __cil_tmp387 + 48; + __cil_tmp388 = + __cil_tmp387 + 48; #line 4364 - __cil_tmp389 = 308 + 36; + __cil_tmp389 = 308 + 36; #line 4364 - __cil_tmp390 = (unsigned int )disketteExtension; + __cil_tmp390 = + (unsigned int) + disketteExtension; #line 4364 - __cil_tmp391 = __cil_tmp390 + __cil_tmp389; + __cil_tmp391 = + __cil_tmp390 + + __cil_tmp389; #line 4364 - mem_579 = (USHORT *)__cil_tmp391; + mem_579 = (USHORT *) + __cil_tmp391; #line 4364 - __cil_tmp392 = *mem_579; + __cil_tmp392 = *mem_579; #line 4364 - mem_580 = (ULONG *)__cil_tmp388; + mem_580 = + (ULONG *)__cil_tmp388; #line 4364 - *mem_580 = (unsigned long )__cil_tmp392; - } - } - { + *mem_580 = (unsigned long) + __cil_tmp392; + } + } + { #line 4384 - while (1) { - while_131_continue: /* CIL Label */ ; - goto while_131_break; - } - while_131_break: /* CIL Label */ ; - } - } else { - - } - } + while (1) { + while_131_continue + : /* CIL Label */; + goto while_131_break; + } + while_131_break + : /* CIL Label */; + } + } else { + } + } #line 4388 - __cil_tmp393 = 24 + 4; + __cil_tmp393 = 24 + 4; #line 4388 - __cil_tmp394 = (unsigned int )irp; + __cil_tmp394 = (unsigned int)irp; #line 4388 - __cil_tmp395 = __cil_tmp394 + __cil_tmp393; + __cil_tmp395 = + __cil_tmp394 + __cil_tmp393; #line 4388 - mem_581 = (ULONG_PTR *)__cil_tmp395; + mem_581 = + (ULONG_PTR *)__cil_tmp395; #line 4388 - *mem_581 = (unsigned long )52U; - goto switch_125_break; - switch_125_exp_16: /* CIL Label */ - { - __cil_tmp396 = 11 << 2; - __cil_tmp397 = 3 << 14; - __cil_tmp398 = 7 << 16; - __cil_tmp399 = __cil_tmp398 | __cil_tmp397; - - } - switch_125_exp_17: /* CIL Label */ - { - __cil_tmp400 = 6 << 2; - __cil_tmp401 = 3 << 14; - __cil_tmp402 = 7 << 16; - __cil_tmp403 = __cil_tmp402 | __cil_tmp401; - - } - { + *mem_581 = (unsigned long)52U; + goto switch_125_break; + switch_125_exp_16 : /* CIL Label */ + { + __cil_tmp396 = 11 << 2; + __cil_tmp397 = 3 << 14; + __cil_tmp398 = 7 << 16; + __cil_tmp399 = + __cil_tmp398 | __cil_tmp397; + } + switch_125_exp_17 : /* CIL Label */ + { + __cil_tmp400 = 6 << 2; + __cil_tmp401 = 3 << 14; + __cil_tmp402 = 7 << 16; + __cil_tmp403 = + __cil_tmp402 | __cil_tmp401; + } + { #line 4400 - while (1) { - while_132_continue: /* CIL Label */ ; - goto while_132_break; - } - while_132_break: /* CIL Label */ ; - } - { + while (1) { + while_132_continue + : /* CIL Label */; + goto while_132_break; + } + while_132_break: /* CIL Label */; + } + { #line 4407 - ntStatus = FlStartDrive(disketteExtension, irp, - (unsigned char)1, (unsigned char)0, - (unsigned char)0); - } + ntStatus = FlStartDrive( + disketteExtension, irp, + (unsigned char)1, + (unsigned char)0, + (unsigned char)0); + } #line 4420 - if (ntStatus >= 0L) { - goto _L___1; - } else { + if (ntStatus >= 0L) { + goto _L___1; + } else { #line 4420 - if (ntStatus == -1073741804L) { - _L___1: - { + if (ntStatus == -1073741804L) { + _L___1 : { #line 4432 - FlAllocateIoBuffer(disketteExtension, 4096UL); - } - { + FlAllocateIoBuffer( + disketteExtension, + 4096UL); + } + { #line 4435 - __cil_tmp404 = (unsigned int )disketteExtension; + __cil_tmp404 = + (unsigned int) + disketteExtension; #line 4435 - __cil_tmp405 = __cil_tmp404 + 124; - { + __cil_tmp405 = + __cil_tmp404 + 124; + { #line 4435 - mem_582 = (PUCHAR *)__cil_tmp405; + mem_582 = (PUCHAR *) + __cil_tmp405; #line 4435 - if (*mem_582) { - { + if (*mem_582) { + { #line 4436 - ntStatus = FlFormat(disketteExtension, irp); - } - } else { + ntStatus = FlFormat( + disketteExtension, + irp); + } + } else { #line 4439 - ntStatus = -1073741670L; - } - } - } - } else { - - } - } - goto switch_125_break; - switch_125_exp_18: /* CIL Label */ - { - __cil_tmp406 = 248 << 2; - __cil_tmp407 = 7 << 16; - - } - { + ntStatus = -1073741670L; + } + } + } + } else { + } + } + goto switch_125_break; + switch_125_exp_18 : /* CIL Label */ + { + __cil_tmp406 = 248 << 2; + __cil_tmp407 = 7 << 16; + } + { #line 4448 - __cil_tmp408 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp408 = + (KUSER_SHARED_DATA * + const)4292804608U; #line 4448 - __cil_tmp409 = (unsigned int )__cil_tmp408; + __cil_tmp409 = + (unsigned int)__cil_tmp408; #line 4448 - __cil_tmp410 = __cil_tmp409 + 732; + __cil_tmp410 = + __cil_tmp409 + 732; #line 4448 - mem_583 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp410; + mem_583 = + (ALTERNATIVE_ARCHITECTURE_TYPE + *)__cil_tmp410; #line 4448 - __cil_tmp411 = *mem_583; + __cil_tmp411 = *mem_583; #line 4448 - __cil_tmp412 = (int )__cil_tmp411; + __cil_tmp412 = + (int)__cil_tmp411; #line 4448 - if (__cil_tmp412 == 1) { - { + if (__cil_tmp412 == 1) { + { #line 4449 - __cil_tmp413 = 0 * 1U; + __cil_tmp413 = 0 * 1U; #line 4449 - __cil_tmp414 = 112 + __cil_tmp413; + __cil_tmp414 = + 112 + __cil_tmp413; #line 4449 - __cil_tmp415 = (unsigned int )disketteExtension; + __cil_tmp415 = + (unsigned int) + disketteExtension; #line 4449 - __cil_tmp416 = __cil_tmp415 + __cil_tmp414; + __cil_tmp416 = + __cil_tmp415 + + __cil_tmp414; #line 4449 - mem_584 = (UCHAR *)__cil_tmp416; + mem_584 = + (UCHAR *)__cil_tmp416; #line 4449 - *mem_584 = (unsigned char)14; + *mem_584 = + (unsigned char)14; #line 4450 - __cil_tmp417 = 1 * 1U; + __cil_tmp417 = 1 * 1U; #line 4450 - __cil_tmp418 = 112 + __cil_tmp417; + __cil_tmp418 = + 112 + __cil_tmp417; #line 4450 - __cil_tmp419 = (unsigned int )disketteExtension; + __cil_tmp419 = + (unsigned int) + disketteExtension; #line 4450 - __cil_tmp420 = __cil_tmp419 + __cil_tmp418; + __cil_tmp420 = + __cil_tmp419 + + __cil_tmp418; #line 4450 - __cil_tmp421 = (unsigned int )disketteExtension; + __cil_tmp421 = + (unsigned int) + disketteExtension; #line 4450 - __cil_tmp422 = __cil_tmp421 + 248; + __cil_tmp422 = + __cil_tmp421 + 248; #line 4450 - mem_585 = (UCHAR *)__cil_tmp420; + mem_585 = + (UCHAR *)__cil_tmp420; #line 4450 - mem_586 = (UCHAR *)__cil_tmp422; + mem_586 = + (UCHAR *)__cil_tmp422; #line 4450 - *mem_585 = *mem_586; + *mem_585 = *mem_586; #line 4452 - __cil_tmp423 = 0 * 1U; + __cil_tmp423 = 0 * 1U; #line 4452 - __cil_tmp424 = 112 + __cil_tmp423; + __cil_tmp424 = + 112 + __cil_tmp423; #line 4452 - __cil_tmp425 = (unsigned int )disketteExtension; + __cil_tmp425 = + (unsigned int) + disketteExtension; #line 4452 - __cil_tmp426 = __cil_tmp425 + __cil_tmp424; + __cil_tmp426 = + __cil_tmp425 + + __cil_tmp424; #line 4452 - __cil_tmp427 = (UCHAR *)__cil_tmp426; + __cil_tmp427 = + (UCHAR *)__cil_tmp426; #line 4452 - __cil_tmp428 = 0 * 1U; + __cil_tmp428 = 0 * 1U; #line 4452 - __cil_tmp429 = 112 + __cil_tmp428; + __cil_tmp429 = + 112 + __cil_tmp428; #line 4452 - __cil_tmp430 = (unsigned int )disketteExtension; + __cil_tmp430 = + (unsigned int) + disketteExtension; #line 4452 - __cil_tmp431 = __cil_tmp430 + __cil_tmp429; + __cil_tmp431 = + __cil_tmp430 + + __cil_tmp429; #line 4452 - __cil_tmp432 = (UCHAR *)__cil_tmp431; + __cil_tmp432 = + (UCHAR *)__cil_tmp431; #line 4452 - __cil_tmp433 = (void *)0; + __cil_tmp433 = (void *)0; #line 4452 - __cil_tmp434 = (struct _MDL *)__cil_tmp433; + __cil_tmp434 = + (struct _MDL *) + __cil_tmp433; #line 4452 - ntStatus = FlIssueCommand(disketteExtension, __cil_tmp427, - __cil_tmp432, __cil_tmp434, - 0UL, 0UL); - } + ntStatus = FlIssueCommand( + disketteExtension, + __cil_tmp427, + __cil_tmp432, + __cil_tmp434, 0UL, 0UL); + } #line 4459 - if (ntStatus >= 0L) { + if (ntStatus >= 0L) { #line 4461 - __cil_tmp435 = (unsigned int )irp; + __cil_tmp435 = + (unsigned int)irp; #line 4461 - __cil_tmp436 = __cil_tmp435 + 12; + __cil_tmp436 = + __cil_tmp435 + 12; #line 4461 - mem_587 = (PVOID *)__cil_tmp436; + mem_587 = + (PVOID *)__cil_tmp436; #line 4461 - __cil_tmp437 = *mem_587; + __cil_tmp437 = *mem_587; #line 4461 - outputBuffer___0 = (struct _SENSE_DEVISE_STATUS_PTOS *)__cil_tmp437; + outputBuffer___0 = + (struct + _SENSE_DEVISE_STATUS_PTOS + *)__cil_tmp437; #line 4463 - __cil_tmp438 = 0 * 1U; + __cil_tmp438 = 0 * 1U; #line 4463 - __cil_tmp439 = (unsigned int )(Result_Status3_PTOS) + __cil_tmp438; + __cil_tmp439 = + (unsigned int)(Result_Status3_PTOS) + + __cil_tmp438; #line 4463 - mem_588 = (UCHAR *)outputBuffer___0; + mem_588 = (UCHAR *) + outputBuffer___0; #line 4463 - mem_589 = (UCHAR *)__cil_tmp439; + mem_589 = + (UCHAR *)__cil_tmp439; #line 4463 - *mem_588 = *mem_589; + *mem_588 = *mem_589; #line 4466 - __cil_tmp440 = 24 + 4; + __cil_tmp440 = 24 + 4; #line 4466 - __cil_tmp441 = (unsigned int )irp; + __cil_tmp441 = + (unsigned int)irp; #line 4466 - __cil_tmp442 = __cil_tmp441 + __cil_tmp440; + __cil_tmp442 = + __cil_tmp441 + + __cil_tmp440; #line 4466 - mem_590 = (ULONG_PTR *)__cil_tmp442; + mem_590 = (ULONG_PTR *) + __cil_tmp442; #line 4466 - *mem_590 = (unsigned long )1U; - } else { - + *mem_590 = + (unsigned long)1U; + } else { + } + goto switch_125_break; + } else { + } + } + } else { + switch_125_break: /* CIL Label */; + } + } + } + } } - goto switch_125_break; - } else { - } - } - } else { - switch_125_break: /* CIL Label */ ; } } } + } + } + goto switch_121_break; + switch_121_default: /* CIL Label */; + { +#line 4483 + while (1) { + while_133_continue: /* CIL Label */; + goto while_133_break; + } + while_133_break: /* CIL Label */; } +#line 4485 + ntStatus = -1073741822L; + } else { + switch_121_break: /* CIL Label */; } } } } - } - } - } - goto switch_121_break; - switch_121_default: /* CIL Label */ ; - { -#line 4483 - while (1) { - while_133_continue: /* CIL Label */ ; - goto while_133_break; } - while_133_break: /* CIL Label */ ; - } -#line 4485 - ntStatus = -1073741822L; - } else { - switch_121_break: /* CIL Label */ ; - } } } - } - } - } - } #line 4490 - if (ntStatus == -2147483631L) { - { + if (ntStatus == -2147483631L) { + { #line 4496 - while (1) { - while_134_continue: /* CIL Label */ ; - { + while (1) { + while_134_continue: /* CIL Label */; + { #line 4498 - __cil_tmp443 = (unsigned int )disketteExtension; + __cil_tmp443 = (unsigned int)disketteExtension; #line 4498 - __cil_tmp444 = __cil_tmp443 + 104; + __cil_tmp444 = __cil_tmp443 + 104; #line 4498 - mem_591 = (BOOLEAN *)__cil_tmp444; + mem_591 = (BOOLEAN *)__cil_tmp444; #line 4498 - *mem_591 = (unsigned char)0; + *mem_591 = (unsigned char)0; #line 4500 - __cil_tmp445 = (unsigned int )irp; + __cil_tmp445 = (unsigned int)irp; #line 4500 - __cil_tmp446 = __cil_tmp445 + 24; + __cil_tmp446 = __cil_tmp445 + 24; #line 4500 - mem_592 = (NTSTATUS *)__cil_tmp446; + mem_592 = (NTSTATUS *)__cil_tmp446; #line 4500 - *mem_592 = -2147483631L; + *mem_592 = -2147483631L; #line 4502 - IofCompleteRequest(irp, (char)1); + IofCompleteRequest(irp, (char)1); #line 4504 - __cil_tmp447 = (unsigned int )disketteExtension; + __cil_tmp447 = (unsigned int)disketteExtension; #line 4504 - __cil_tmp448 = __cil_tmp447 + 96; + __cil_tmp448 = __cil_tmp447 + 96; #line 4504 - __cil_tmp449 = (LIST_ENTRY *)__cil_tmp448; + __cil_tmp449 = (LIST_ENTRY *)__cil_tmp448; #line 4504 - __cil_tmp450 = (unsigned int )disketteExtension; + __cil_tmp450 = (unsigned int)disketteExtension; #line 4504 - __cil_tmp451 = __cil_tmp450 + 52; + __cil_tmp451 = __cil_tmp450 + 52; #line 4504 - __cil_tmp452 = (KSPIN_LOCK *)__cil_tmp451; + __cil_tmp452 = (KSPIN_LOCK *)__cil_tmp451; #line 4504 - request = ExfInterlockedRemoveHeadList(__cil_tmp449, __cil_tmp452); - } + request = ExfInterlockedRemoveHeadList(__cil_tmp449, + __cil_tmp452); + } #line 4508 - if (! request) { - goto while_134_break; - } else { - - } - { + if (!request) { + goto while_134_break; + } else { + } + { #line 4512 - __cil_tmp453 = (unsigned int )disketteExtension; + __cil_tmp453 = (unsigned int)disketteExtension; #line 4512 - __cil_tmp454 = __cil_tmp453 + 56; + __cil_tmp454 = __cil_tmp453 + 56; #line 4512 - __cil_tmp455 = (FAST_MUTEX *)__cil_tmp454; + __cil_tmp455 = (FAST_MUTEX *)__cil_tmp454; #line 4512 - ExAcquireFastMutex(__cil_tmp455); + ExAcquireFastMutex(__cil_tmp455); #line 4515 - __cil_tmp456 = (unsigned int )disketteExtension; + __cil_tmp456 = (unsigned int)disketteExtension; #line 4515 - __cil_tmp457 = __cil_tmp456 + 88; + __cil_tmp457 = __cil_tmp456 + 88; #line 4515 - __cil_tmp458 = (unsigned int )disketteExtension; + __cil_tmp458 = (unsigned int)disketteExtension; #line 4515 - __cil_tmp459 = __cil_tmp458 + 88; + __cil_tmp459 = __cil_tmp458 + 88; #line 4515 - mem_593 = (LONG *)__cil_tmp459; + mem_593 = (LONG *)__cil_tmp459; #line 4515 - __cil_tmp460 = *mem_593; + __cil_tmp460 = *mem_593; #line 4515 - mem_594 = (LONG *)__cil_tmp457; + mem_594 = (LONG *)__cil_tmp457; #line 4515 - *mem_594 = __cil_tmp460 - 1L; + *mem_594 = __cil_tmp460 - 1L; #line 4516 - __cil_tmp461 = (unsigned int )disketteExtension; + __cil_tmp461 = (unsigned int)disketteExtension; #line 4516 - __cil_tmp462 = __cil_tmp461 + 56; + __cil_tmp462 = __cil_tmp461 + 56; #line 4516 - __cil_tmp463 = (FAST_MUTEX *)__cil_tmp462; + __cil_tmp463 = (FAST_MUTEX *)__cil_tmp462; #line 4516 - ExReleaseFastMutex(__cil_tmp463); + ExReleaseFastMutex(__cil_tmp463); #line 4519 - __cil_tmp464 = 0 + 24; + __cil_tmp464 = 0 + 24; #line 4519 - __cil_tmp465 = 64 + __cil_tmp464; + __cil_tmp465 = 64 + __cil_tmp464; #line 4519 - __cil_tmp466 = (IRP *)0; + __cil_tmp466 = (IRP *)0; #line 4519 - __cil_tmp467 = (unsigned int )__cil_tmp466; + __cil_tmp467 = (unsigned int)__cil_tmp466; #line 4519 - __cil_tmp468 = __cil_tmp467 + __cil_tmp465; + __cil_tmp468 = __cil_tmp467 + __cil_tmp465; #line 4519 - __cil_tmp469 = (LIST_ENTRY *)__cil_tmp468; + __cil_tmp469 = (LIST_ENTRY *)__cil_tmp468; #line 4519 - __cil_tmp470 = (unsigned long )__cil_tmp469; + __cil_tmp470 = (unsigned long)__cil_tmp469; #line 4519 - __cil_tmp471 = (CHAR *)request; + __cil_tmp471 = (CHAR *)request; #line 4519 - __cil_tmp472 = __cil_tmp471 - __cil_tmp470; + __cil_tmp472 = __cil_tmp471 - __cil_tmp470; #line 4519 - irp = (IRP *)__cil_tmp472; - } - } - while_134_break: /* CIL Label */ ; - } - } else { + irp = (IRP *)__cil_tmp472; + } + } + while_134_break: /* CIL Label */; + } + } else { #line 4531 - __cil_tmp473 = (unsigned int )irp; + __cil_tmp473 = (unsigned int)irp; #line 4531 - __cil_tmp474 = __cil_tmp473 + 24; + __cil_tmp474 = __cil_tmp473 + 24; #line 4531 - mem_595 = (NTSTATUS *)__cil_tmp474; + mem_595 = (NTSTATUS *)__cil_tmp474; #line 4531 - *mem_595 = ntStatus; - { + *mem_595 = ntStatus; + { #line 4536 - __cil_tmp475 = (unsigned int )disketteExtension; + __cil_tmp475 = (unsigned int)disketteExtension; #line 4536 - __cil_tmp476 = __cil_tmp475 + 124; - { + __cil_tmp476 = __cil_tmp475 + 124; + { #line 4536 - mem_596 = (PUCHAR *)__cil_tmp476; + mem_596 = (PUCHAR *)__cil_tmp476; #line 4536 - if (*mem_596) { - { + if (*mem_596) { + { #line 4537 - FlFreeIoBuffer(disketteExtension); + FlFreeIoBuffer(disketteExtension); + } + } else { + } + } + } + { +#line 4540 + FlFinishOperation(irp, disketteExtension); + } + } } - } else { - - } - } + while_117_break: /* CIL Label */; } { -#line 4540 - FlFinishOperation(irp, disketteExtension); - } - } - } - while_117_break: /* CIL Label */ ; - } - { #line 4546 - __cil_tmp477 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp477 = (KUSER_SHARED_DATA * const)4292804608U; #line 4546 - __cil_tmp478 = (unsigned int )__cil_tmp477; + __cil_tmp478 = (unsigned int)__cil_tmp477; #line 4546 - __cil_tmp479 = __cil_tmp478 + 732; + __cil_tmp479 = __cil_tmp478 + 732; #line 4546 - mem_597 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp479; + mem_597 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp479; #line 4546 - __cil_tmp480 = *mem_597; + __cil_tmp480 = *mem_597; #line 4546 - __cil_tmp481 = (int )__cil_tmp480; + __cil_tmp481 = (int)__cil_tmp480; #line 4546 - if (__cil_tmp481 == 1) { - { + if (__cil_tmp481 == 1) { + { #line 4547 - __cil_tmp482 = (unsigned int )disketteExtension; + __cil_tmp482 = (unsigned int)disketteExtension; #line 4547 - __cil_tmp483 = __cil_tmp482 + 172; - { + __cil_tmp483 = __cil_tmp482 + 172; + { #line 4547 - mem_598 = (BOOLEAN *)__cil_tmp483; + mem_598 = (BOOLEAN *)__cil_tmp483; #line 4547 - if (*mem_598) { - { + if (*mem_598) { + { #line 4548 - __cil_tmp484 = (unsigned int )disketteExtension; + __cil_tmp484 = (unsigned int)disketteExtension; #line 4548 - __cil_tmp485 = __cil_tmp484 + 8; + __cil_tmp485 = __cil_tmp484 + 8; #line 4548 - mem_599 = (PDEVICE_OBJECT *)__cil_tmp485; + mem_599 = (PDEVICE_OBJECT *)__cil_tmp485; #line 4548 - __cil_tmp486 = *mem_599; + __cil_tmp486 = *mem_599; #line 4548 - __cil_tmp487 = 769 << 2; + __cil_tmp487 = 769 << 2; #line 4548 - __cil_tmp488 = 7 << 16; + __cil_tmp488 = 7 << 16; #line 4548 - __cil_tmp489 = __cil_tmp488 | __cil_tmp487; + __cil_tmp489 = __cil_tmp488 | __cil_tmp487; #line 4548 - __cil_tmp490 = __cil_tmp489 | 3; + __cil_tmp490 = __cil_tmp489 | 3; #line 4548 - __cil_tmp491 = (unsigned long )__cil_tmp490; + __cil_tmp491 = (unsigned long)__cil_tmp490; #line 4548 - __cil_tmp492 = (unsigned int )disketteExtension; + __cil_tmp492 = (unsigned int)disketteExtension; #line 4548 - __cil_tmp493 = __cil_tmp492 + 28; + __cil_tmp493 = __cil_tmp492 + 28; #line 4548 - mem_600 = (PDEVICE_OBJECT *)__cil_tmp493; + mem_600 = (PDEVICE_OBJECT *)__cil_tmp493; #line 4548 - __cil_tmp494 = *mem_600; + __cil_tmp494 = *mem_600; #line 4548 - __cil_tmp495 = (void *)__cil_tmp494; + __cil_tmp495 = (void *)__cil_tmp494; #line 4548 - FlFdcDeviceIo(__cil_tmp486, __cil_tmp491, __cil_tmp495); + FlFdcDeviceIo(__cil_tmp486, __cil_tmp491, __cil_tmp495); #line 4552 - __cil_tmp496 = (unsigned int )disketteExtension; + __cil_tmp496 = (unsigned int)disketteExtension; #line 4552 - __cil_tmp497 = __cil_tmp496 + 172; + __cil_tmp497 = __cil_tmp496 + 172; #line 4552 - mem_601 = (BOOLEAN *)__cil_tmp497; + mem_601 = (BOOLEAN *)__cil_tmp497; #line 4552 - *mem_601 = (unsigned char)0; + *mem_601 = (unsigned char)0; #line 4553 - __cil_tmp498 = (unsigned int )disketteExtension; + __cil_tmp498 = (unsigned int)disketteExtension; #line 4553 - __cil_tmp499 = __cil_tmp498 + 392; + __cil_tmp499 = __cil_tmp498 + 392; #line 4553 - mem_602 = (BOOLEAN *)__cil_tmp499; + mem_602 = (BOOLEAN *)__cil_tmp499; #line 4553 - *mem_602 = (unsigned char)1; + *mem_602 = (unsigned char)1; + } + } else { + } + } + } + } else { + } } - } else { - - } + __Cont:; } - } - } else { - - } + while_114_break: /* CIL Label */; } - __Cont: ; } - while_114_break: /* CIL Label */ ; - } -} } #line 4560 "floppy.c" -void FlConsolidateMediaTypeWithBootSector(PDISKETTE_EXTENSION DisketteExtension , - PBOOT_SECTOR_INFO BootSector ) -{ USHORT bpbNumberOfSectors ; - USHORT bpbNumberOfHeads ; - USHORT bpbSectorsPerTrack ; - USHORT bpbBytesPerSector ; - USHORT bpbMediaByte ; - USHORT bpbMaximumTrack ; - MEDIA_TYPE bpbMediaType ; - ULONG i ; - ULONG n ; - PDRIVE_MEDIA_CONSTANTS readidDriveMediaConstants ; - BOOLEAN changeToBpbMedia ; - int tmp ; - SIZE_T tmp___0 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - UCHAR __cil_tmp20 ; - int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - UCHAR __cil_tmp26 ; - int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - unsigned int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - UCHAR __cil_tmp32 ; - int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - UCHAR __cil_tmp38 ; - int __cil_tmp39 ; - int __cil_tmp40 ; - int __cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - UCHAR __cil_tmp46 ; - int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - unsigned int __cil_tmp51 ; - UCHAR __cil_tmp52 ; - int __cil_tmp53 ; - int __cil_tmp54 ; - int __cil_tmp55 ; - unsigned int __cil_tmp56 ; - unsigned int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - unsigned int __cil_tmp59 ; - UCHAR __cil_tmp60 ; - int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - unsigned int __cil_tmp63 ; - unsigned int __cil_tmp64 ; - unsigned int __cil_tmp65 ; - UCHAR __cil_tmp66 ; - int __cil_tmp67 ; - int __cil_tmp68 ; - int __cil_tmp69 ; - unsigned int __cil_tmp70 ; - unsigned int __cil_tmp71 ; - unsigned int __cil_tmp72 ; - unsigned int __cil_tmp73 ; - UCHAR __cil_tmp74 ; - int __cil_tmp75 ; - unsigned int __cil_tmp76 ; - unsigned int __cil_tmp77 ; - unsigned int __cil_tmp78 ; - unsigned int __cil_tmp79 ; - UCHAR __cil_tmp80 ; - int __cil_tmp81 ; - int __cil_tmp82 ; - int __cil_tmp83 ; - unsigned int __cil_tmp84 ; - unsigned int __cil_tmp85 ; - unsigned int __cil_tmp86 ; - unsigned int __cil_tmp87 ; - UCHAR __cil_tmp88 ; - int __cil_tmp89 ; - int __cil_tmp90 ; - int __cil_tmp91 ; - int __cil_tmp92 ; - int __cil_tmp93 ; - int __cil_tmp94 ; - KUSER_SHARED_DATA *__cil_tmp95 ; - unsigned int __cil_tmp96 ; - unsigned int __cil_tmp97 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp98 ; - int __cil_tmp99 ; - unsigned long __cil_tmp100 ; - int __cil_tmp101 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp102 ; - unsigned int __cil_tmp103 ; - unsigned int __cil_tmp104 ; - USHORT __cil_tmp105 ; - int __cil_tmp106 ; - int __cil_tmp107 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp108 ; - unsigned int __cil_tmp109 ; - unsigned int __cil_tmp110 ; - UCHAR __cil_tmp111 ; - int __cil_tmp112 ; - int __cil_tmp113 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp114 ; - unsigned int __cil_tmp115 ; - unsigned int __cil_tmp116 ; - UCHAR __cil_tmp117 ; - int __cil_tmp118 ; - int __cil_tmp119 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp120 ; - unsigned int __cil_tmp121 ; - unsigned int __cil_tmp122 ; - UCHAR __cil_tmp123 ; - int __cil_tmp124 ; - int __cil_tmp125 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp126 ; - unsigned int __cil_tmp127 ; - unsigned int __cil_tmp128 ; - UCHAR __cil_tmp129 ; - int __cil_tmp130 ; - int __cil_tmp131 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp132 ; - unsigned int __cil_tmp133 ; - unsigned int __cil_tmp134 ; - UCHAR __cil_tmp135 ; - int __cil_tmp136 ; - unsigned int __cil_tmp137 ; - unsigned int __cil_tmp138 ; - MEDIA_TYPE __cil_tmp139 ; - int __cil_tmp140 ; - int __cil_tmp141 ; - unsigned int __cil_tmp142 ; - unsigned int __cil_tmp143 ; - unsigned int __cil_tmp144 ; - unsigned int __cil_tmp145 ; - USHORT __cil_tmp146 ; - int __cil_tmp147 ; - int __cil_tmp148 ; - int __cil_tmp149 ; - unsigned int __cil_tmp150 ; - unsigned int __cil_tmp151 ; - UCHAR __cil_tmp152 ; - int __cil_tmp153 ; - int __cil_tmp154 ; - unsigned int __cil_tmp155 ; - unsigned int __cil_tmp156 ; - UCHAR __cil_tmp157 ; - int __cil_tmp158 ; - int __cil_tmp159 ; - int __cil_tmp160 ; - unsigned int __cil_tmp161 ; - unsigned int __cil_tmp162 ; - unsigned int __cil_tmp163 ; - unsigned int __cil_tmp164 ; - unsigned int __cil_tmp165 ; - UCHAR __cil_tmp166 ; - int __cil_tmp167 ; - PDRIVE_MEDIA_LIMITS __cil_tmp168 ; - unsigned int __cil_tmp169 ; - unsigned int __cil_tmp170 ; - DRIVE_MEDIA_TYPE __cil_tmp171 ; - unsigned int __cil_tmp172 ; - unsigned int __cil_tmp173 ; - UCHAR __cil_tmp174 ; - int __cil_tmp175 ; - PDRIVE_MEDIA_LIMITS __cil_tmp176 ; - DRIVE_MEDIA_TYPE __cil_tmp177 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp178 ; - MEDIA_TYPE __cil_tmp179 ; - int __cil_tmp180 ; - int __cil_tmp181 ; - unsigned int __cil_tmp182 ; - unsigned int __cil_tmp183 ; - unsigned int __cil_tmp184 ; - unsigned int __cil_tmp185 ; - unsigned int __cil_tmp186 ; - unsigned int __cil_tmp187 ; - int __cil_tmp188 ; - int __cil_tmp189 ; - int __cil_tmp190 ; - unsigned int __cil_tmp191 ; - unsigned int __cil_tmp192 ; - unsigned int __cil_tmp193 ; - unsigned int __cil_tmp194 ; - unsigned int __cil_tmp195 ; - unsigned int __cil_tmp196 ; - unsigned int __cil_tmp197 ; - unsigned int __cil_tmp198 ; - unsigned int __cil_tmp199 ; - unsigned int __cil_tmp200 ; - UCHAR *__cil_tmp201 ; - void const *__cil_tmp202 ; - void const *__cil_tmp203 ; - unsigned int __cil_tmp204 ; - unsigned int __cil_tmp205 ; - UCHAR *mem_206 ; - UCHAR *mem_207 ; - UCHAR *mem_208 ; - UCHAR *mem_209 ; - UCHAR *mem_210 ; - UCHAR *mem_211 ; - UCHAR *mem_212 ; - UCHAR *mem_213 ; - UCHAR *mem_214 ; - UCHAR *mem_215 ; - UCHAR *mem_216 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_217 ; - USHORT *mem_218 ; - UCHAR *mem_219 ; - UCHAR *mem_220 ; - UCHAR *mem_221 ; - UCHAR *mem_222 ; - MEDIA_TYPE *mem_223 ; - UCHAR *mem_224 ; - MEDIA_TYPE *mem_225 ; - USHORT *mem_226 ; - UCHAR *mem_227 ; - UCHAR *mem_228 ; - MEDIA_TYPE *mem_229 ; - UCHAR *mem_230 ; - UCHAR *mem_231 ; - DRIVE_MEDIA_TYPE *mem_232 ; - UCHAR *mem_233 ; - DRIVE_MEDIA_TYPE *mem_234 ; - MEDIA_TYPE *mem_235 ; - DRIVE_MEDIA_TYPE *mem_236 ; - MEDIA_TYPE *mem_237 ; - ULONG *mem_238 ; - UCHAR *mem_239 ; - UCHAR *mem_240 ; - BOOLEAN *mem_241 ; +void FlConsolidateMediaTypeWithBootSector(PDISKETTE_EXTENSION DisketteExtension, + PBOOT_SECTOR_INFO BootSector) { + USHORT bpbNumberOfSectors; + USHORT bpbNumberOfHeads; + USHORT bpbSectorsPerTrack; + USHORT bpbBytesPerSector; + USHORT bpbMediaByte; + USHORT bpbMaximumTrack; + MEDIA_TYPE bpbMediaType; + ULONG i; + ULONG n; + PDRIVE_MEDIA_CONSTANTS readidDriveMediaConstants; + BOOLEAN changeToBpbMedia; + int tmp; + SIZE_T tmp___0; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + UCHAR __cil_tmp20; + int __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + UCHAR __cil_tmp26; + int __cil_tmp27; + unsigned int __cil_tmp28; + unsigned int __cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + UCHAR __cil_tmp32; + int __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + UCHAR __cil_tmp38; + int __cil_tmp39; + int __cil_tmp40; + int __cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + UCHAR __cil_tmp46; + int __cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + unsigned int __cil_tmp51; + UCHAR __cil_tmp52; + int __cil_tmp53; + int __cil_tmp54; + int __cil_tmp55; + unsigned int __cil_tmp56; + unsigned int __cil_tmp57; + unsigned int __cil_tmp58; + unsigned int __cil_tmp59; + UCHAR __cil_tmp60; + int __cil_tmp61; + unsigned int __cil_tmp62; + unsigned int __cil_tmp63; + unsigned int __cil_tmp64; + unsigned int __cil_tmp65; + UCHAR __cil_tmp66; + int __cil_tmp67; + int __cil_tmp68; + int __cil_tmp69; + unsigned int __cil_tmp70; + unsigned int __cil_tmp71; + unsigned int __cil_tmp72; + unsigned int __cil_tmp73; + UCHAR __cil_tmp74; + int __cil_tmp75; + unsigned int __cil_tmp76; + unsigned int __cil_tmp77; + unsigned int __cil_tmp78; + unsigned int __cil_tmp79; + UCHAR __cil_tmp80; + int __cil_tmp81; + int __cil_tmp82; + int __cil_tmp83; + unsigned int __cil_tmp84; + unsigned int __cil_tmp85; + unsigned int __cil_tmp86; + unsigned int __cil_tmp87; + UCHAR __cil_tmp88; + int __cil_tmp89; + int __cil_tmp90; + int __cil_tmp91; + int __cil_tmp92; + int __cil_tmp93; + int __cil_tmp94; + KUSER_SHARED_DATA *__cil_tmp95; + unsigned int __cil_tmp96; + unsigned int __cil_tmp97; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp98; + int __cil_tmp99; + unsigned long __cil_tmp100; + int __cil_tmp101; + PDRIVE_MEDIA_CONSTANTS __cil_tmp102; + unsigned int __cil_tmp103; + unsigned int __cil_tmp104; + USHORT __cil_tmp105; + int __cil_tmp106; + int __cil_tmp107; + PDRIVE_MEDIA_CONSTANTS __cil_tmp108; + unsigned int __cil_tmp109; + unsigned int __cil_tmp110; + UCHAR __cil_tmp111; + int __cil_tmp112; + int __cil_tmp113; + PDRIVE_MEDIA_CONSTANTS __cil_tmp114; + unsigned int __cil_tmp115; + unsigned int __cil_tmp116; + UCHAR __cil_tmp117; + int __cil_tmp118; + int __cil_tmp119; + PDRIVE_MEDIA_CONSTANTS __cil_tmp120; + unsigned int __cil_tmp121; + unsigned int __cil_tmp122; + UCHAR __cil_tmp123; + int __cil_tmp124; + int __cil_tmp125; + PDRIVE_MEDIA_CONSTANTS __cil_tmp126; + unsigned int __cil_tmp127; + unsigned int __cil_tmp128; + UCHAR __cil_tmp129; + int __cil_tmp130; + int __cil_tmp131; + PDRIVE_MEDIA_CONSTANTS __cil_tmp132; + unsigned int __cil_tmp133; + unsigned int __cil_tmp134; + UCHAR __cil_tmp135; + int __cil_tmp136; + unsigned int __cil_tmp137; + unsigned int __cil_tmp138; + MEDIA_TYPE __cil_tmp139; + int __cil_tmp140; + int __cil_tmp141; + unsigned int __cil_tmp142; + unsigned int __cil_tmp143; + unsigned int __cil_tmp144; + unsigned int __cil_tmp145; + USHORT __cil_tmp146; + int __cil_tmp147; + int __cil_tmp148; + int __cil_tmp149; + unsigned int __cil_tmp150; + unsigned int __cil_tmp151; + UCHAR __cil_tmp152; + int __cil_tmp153; + int __cil_tmp154; + unsigned int __cil_tmp155; + unsigned int __cil_tmp156; + UCHAR __cil_tmp157; + int __cil_tmp158; + int __cil_tmp159; + int __cil_tmp160; + unsigned int __cil_tmp161; + unsigned int __cil_tmp162; + unsigned int __cil_tmp163; + unsigned int __cil_tmp164; + unsigned int __cil_tmp165; + UCHAR __cil_tmp166; + int __cil_tmp167; + PDRIVE_MEDIA_LIMITS __cil_tmp168; + unsigned int __cil_tmp169; + unsigned int __cil_tmp170; + DRIVE_MEDIA_TYPE __cil_tmp171; + unsigned int __cil_tmp172; + unsigned int __cil_tmp173; + UCHAR __cil_tmp174; + int __cil_tmp175; + PDRIVE_MEDIA_LIMITS __cil_tmp176; + DRIVE_MEDIA_TYPE __cil_tmp177; + PDRIVE_MEDIA_CONSTANTS __cil_tmp178; + MEDIA_TYPE __cil_tmp179; + int __cil_tmp180; + int __cil_tmp181; + unsigned int __cil_tmp182; + unsigned int __cil_tmp183; + unsigned int __cil_tmp184; + unsigned int __cil_tmp185; + unsigned int __cil_tmp186; + unsigned int __cil_tmp187; + int __cil_tmp188; + int __cil_tmp189; + int __cil_tmp190; + unsigned int __cil_tmp191; + unsigned int __cil_tmp192; + unsigned int __cil_tmp193; + unsigned int __cil_tmp194; + unsigned int __cil_tmp195; + unsigned int __cil_tmp196; + unsigned int __cil_tmp197; + unsigned int __cil_tmp198; + unsigned int __cil_tmp199; + unsigned int __cil_tmp200; + UCHAR *__cil_tmp201; + void const *__cil_tmp202; + void const *__cil_tmp203; + unsigned int __cil_tmp204; + unsigned int __cil_tmp205; + UCHAR *mem_206; + UCHAR *mem_207; + UCHAR *mem_208; + UCHAR *mem_209; + UCHAR *mem_210; + UCHAR *mem_211; + UCHAR *mem_212; + UCHAR *mem_213; + UCHAR *mem_214; + UCHAR *mem_215; + UCHAR *mem_216; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_217; + USHORT *mem_218; + UCHAR *mem_219; + UCHAR *mem_220; + UCHAR *mem_221; + UCHAR *mem_222; + MEDIA_TYPE *mem_223; + UCHAR *mem_224; + MEDIA_TYPE *mem_225; + USHORT *mem_226; + UCHAR *mem_227; + UCHAR *mem_228; + MEDIA_TYPE *mem_229; + UCHAR *mem_230; + UCHAR *mem_231; + DRIVE_MEDIA_TYPE *mem_232; + UCHAR *mem_233; + DRIVE_MEDIA_TYPE *mem_234; + MEDIA_TYPE *mem_235; + DRIVE_MEDIA_TYPE *mem_236; + MEDIA_TYPE *mem_237; + ULONG *mem_238; + UCHAR *mem_239; + UCHAR *mem_240; + BOOLEAN *mem_241; { - { + { #line 4598 - while (1) { - while_135_continue: /* CIL Label */ ; - goto while_135_break; - } - while_135_break: /* CIL Label */ ; - } - { + while (1) { + while_135_continue: /* CIL Label */; + goto while_135_break; + } + while_135_break: /* CIL Label */; + } + { #line 4600 - __cil_tmp16 = 0 * 1U; + __cil_tmp16 = 0 * 1U; #line 4600 - __cil_tmp17 = 0 + __cil_tmp16; + __cil_tmp17 = 0 + __cil_tmp16; #line 4600 - __cil_tmp18 = (unsigned int )BootSector; + __cil_tmp18 = (unsigned int)BootSector; #line 4600 - __cil_tmp19 = __cil_tmp18 + __cil_tmp17; + __cil_tmp19 = __cil_tmp18 + __cil_tmp17; #line 4600 - mem_206 = (UCHAR *)__cil_tmp19; + mem_206 = (UCHAR *)__cil_tmp19; #line 4600 - __cil_tmp20 = *mem_206; + __cil_tmp20 = *mem_206; #line 4600 - __cil_tmp21 = (int )__cil_tmp20; + __cil_tmp21 = (int)__cil_tmp20; #line 4600 - if (__cil_tmp21 != 235) { - { + if (__cil_tmp21 != 235) { + { #line 4600 - __cil_tmp22 = 0 * 1U; + __cil_tmp22 = 0 * 1U; #line 4600 - __cil_tmp23 = 0 + __cil_tmp22; + __cil_tmp23 = 0 + __cil_tmp22; #line 4600 - __cil_tmp24 = (unsigned int )BootSector; + __cil_tmp24 = (unsigned int)BootSector; #line 4600 - __cil_tmp25 = __cil_tmp24 + __cil_tmp23; + __cil_tmp25 = __cil_tmp24 + __cil_tmp23; #line 4600 - mem_207 = (UCHAR *)__cil_tmp25; + mem_207 = (UCHAR *)__cil_tmp25; #line 4600 - __cil_tmp26 = *mem_207; + __cil_tmp26 = *mem_207; #line 4600 - __cil_tmp27 = (int )__cil_tmp26; + __cil_tmp27 = (int)__cil_tmp26; #line 4600 - if (__cil_tmp27 != 233) { + if (__cil_tmp27 != 233) { - } else { - - } + } else { + } + } + } else { + } } - } else { - - } - } #line 4607 - __cil_tmp28 = 0 * 1U; + __cil_tmp28 = 0 * 1U; #line 4607 - __cil_tmp29 = 19 + __cil_tmp28; + __cil_tmp29 = 19 + __cil_tmp28; #line 4607 - __cil_tmp30 = (unsigned int )BootSector; + __cil_tmp30 = (unsigned int)BootSector; #line 4607 - __cil_tmp31 = __cil_tmp30 + __cil_tmp29; + __cil_tmp31 = __cil_tmp30 + __cil_tmp29; #line 4607 - mem_208 = (UCHAR *)__cil_tmp31; + mem_208 = (UCHAR *)__cil_tmp31; #line 4607 - __cil_tmp32 = *mem_208; + __cil_tmp32 = *mem_208; #line 4607 - __cil_tmp33 = (int )__cil_tmp32; + __cil_tmp33 = (int)__cil_tmp32; #line 4607 - __cil_tmp34 = 1 * 1U; + __cil_tmp34 = 1 * 1U; #line 4607 - __cil_tmp35 = 19 + __cil_tmp34; + __cil_tmp35 = 19 + __cil_tmp34; #line 4607 - __cil_tmp36 = (unsigned int )BootSector; + __cil_tmp36 = (unsigned int)BootSector; #line 4607 - __cil_tmp37 = __cil_tmp36 + __cil_tmp35; + __cil_tmp37 = __cil_tmp36 + __cil_tmp35; #line 4607 - mem_209 = (UCHAR *)__cil_tmp37; + mem_209 = (UCHAR *)__cil_tmp37; #line 4607 - __cil_tmp38 = *mem_209; + __cil_tmp38 = *mem_209; #line 4607 - __cil_tmp39 = (int )__cil_tmp38; + __cil_tmp39 = (int)__cil_tmp38; #line 4607 - __cil_tmp40 = __cil_tmp39 * 256; + __cil_tmp40 = __cil_tmp39 * 256; #line 4607 - __cil_tmp41 = __cil_tmp40 + __cil_tmp33; + __cil_tmp41 = __cil_tmp40 + __cil_tmp33; #line 4607 - bpbNumberOfSectors = (unsigned short )__cil_tmp41; + bpbNumberOfSectors = (unsigned short)__cil_tmp41; #line 4609 - __cil_tmp42 = 0 * 1U; + __cil_tmp42 = 0 * 1U; #line 4609 - __cil_tmp43 = 26 + __cil_tmp42; + __cil_tmp43 = 26 + __cil_tmp42; #line 4609 - __cil_tmp44 = (unsigned int )BootSector; + __cil_tmp44 = (unsigned int)BootSector; #line 4609 - __cil_tmp45 = __cil_tmp44 + __cil_tmp43; + __cil_tmp45 = __cil_tmp44 + __cil_tmp43; #line 4609 - mem_210 = (UCHAR *)__cil_tmp45; + mem_210 = (UCHAR *)__cil_tmp45; #line 4609 - __cil_tmp46 = *mem_210; + __cil_tmp46 = *mem_210; #line 4609 - __cil_tmp47 = (int )__cil_tmp46; + __cil_tmp47 = (int)__cil_tmp46; #line 4609 - __cil_tmp48 = 1 * 1U; + __cil_tmp48 = 1 * 1U; #line 4609 - __cil_tmp49 = 26 + __cil_tmp48; + __cil_tmp49 = 26 + __cil_tmp48; #line 4609 - __cil_tmp50 = (unsigned int )BootSector; + __cil_tmp50 = (unsigned int)BootSector; #line 4609 - __cil_tmp51 = __cil_tmp50 + __cil_tmp49; + __cil_tmp51 = __cil_tmp50 + __cil_tmp49; #line 4609 - mem_211 = (UCHAR *)__cil_tmp51; + mem_211 = (UCHAR *)__cil_tmp51; #line 4609 - __cil_tmp52 = *mem_211; + __cil_tmp52 = *mem_211; #line 4609 - __cil_tmp53 = (int )__cil_tmp52; + __cil_tmp53 = (int)__cil_tmp52; #line 4609 - __cil_tmp54 = __cil_tmp53 * 256; + __cil_tmp54 = __cil_tmp53 * 256; #line 4609 - __cil_tmp55 = __cil_tmp54 + __cil_tmp47; + __cil_tmp55 = __cil_tmp54 + __cil_tmp47; #line 4609 - bpbNumberOfHeads = (unsigned short )__cil_tmp55; + bpbNumberOfHeads = (unsigned short)__cil_tmp55; #line 4611 - __cil_tmp56 = 0 * 1U; + __cil_tmp56 = 0 * 1U; #line 4611 - __cil_tmp57 = 24 + __cil_tmp56; + __cil_tmp57 = 24 + __cil_tmp56; #line 4611 - __cil_tmp58 = (unsigned int )BootSector; + __cil_tmp58 = (unsigned int)BootSector; #line 4611 - __cil_tmp59 = __cil_tmp58 + __cil_tmp57; + __cil_tmp59 = __cil_tmp58 + __cil_tmp57; #line 4611 - mem_212 = (UCHAR *)__cil_tmp59; + mem_212 = (UCHAR *)__cil_tmp59; #line 4611 - __cil_tmp60 = *mem_212; + __cil_tmp60 = *mem_212; #line 4611 - __cil_tmp61 = (int )__cil_tmp60; + __cil_tmp61 = (int)__cil_tmp60; #line 4611 - __cil_tmp62 = 1 * 1U; + __cil_tmp62 = 1 * 1U; #line 4611 - __cil_tmp63 = 24 + __cil_tmp62; + __cil_tmp63 = 24 + __cil_tmp62; #line 4611 - __cil_tmp64 = (unsigned int )BootSector; + __cil_tmp64 = (unsigned int)BootSector; #line 4611 - __cil_tmp65 = __cil_tmp64 + __cil_tmp63; + __cil_tmp65 = __cil_tmp64 + __cil_tmp63; #line 4611 - mem_213 = (UCHAR *)__cil_tmp65; + mem_213 = (UCHAR *)__cil_tmp65; #line 4611 - __cil_tmp66 = *mem_213; + __cil_tmp66 = *mem_213; #line 4611 - __cil_tmp67 = (int )__cil_tmp66; + __cil_tmp67 = (int)__cil_tmp66; #line 4611 - __cil_tmp68 = __cil_tmp67 * 256; + __cil_tmp68 = __cil_tmp67 * 256; #line 4611 - __cil_tmp69 = __cil_tmp68 + __cil_tmp61; + __cil_tmp69 = __cil_tmp68 + __cil_tmp61; #line 4611 - bpbSectorsPerTrack = (unsigned short )__cil_tmp69; + bpbSectorsPerTrack = (unsigned short)__cil_tmp69; #line 4613 - __cil_tmp70 = 0 * 1U; + __cil_tmp70 = 0 * 1U; #line 4613 - __cil_tmp71 = 11 + __cil_tmp70; + __cil_tmp71 = 11 + __cil_tmp70; #line 4613 - __cil_tmp72 = (unsigned int )BootSector; + __cil_tmp72 = (unsigned int)BootSector; #line 4613 - __cil_tmp73 = __cil_tmp72 + __cil_tmp71; + __cil_tmp73 = __cil_tmp72 + __cil_tmp71; #line 4613 - mem_214 = (UCHAR *)__cil_tmp73; + mem_214 = (UCHAR *)__cil_tmp73; #line 4613 - __cil_tmp74 = *mem_214; + __cil_tmp74 = *mem_214; #line 4613 - __cil_tmp75 = (int )__cil_tmp74; + __cil_tmp75 = (int)__cil_tmp74; #line 4613 - __cil_tmp76 = 1 * 1U; + __cil_tmp76 = 1 * 1U; #line 4613 - __cil_tmp77 = 11 + __cil_tmp76; + __cil_tmp77 = 11 + __cil_tmp76; #line 4613 - __cil_tmp78 = (unsigned int )BootSector; + __cil_tmp78 = (unsigned int)BootSector; #line 4613 - __cil_tmp79 = __cil_tmp78 + __cil_tmp77; + __cil_tmp79 = __cil_tmp78 + __cil_tmp77; #line 4613 - mem_215 = (UCHAR *)__cil_tmp79; + mem_215 = (UCHAR *)__cil_tmp79; #line 4613 - __cil_tmp80 = *mem_215; + __cil_tmp80 = *mem_215; #line 4613 - __cil_tmp81 = (int )__cil_tmp80; + __cil_tmp81 = (int)__cil_tmp80; #line 4613 - __cil_tmp82 = __cil_tmp81 * 256; + __cil_tmp82 = __cil_tmp81 * 256; #line 4613 - __cil_tmp83 = __cil_tmp82 + __cil_tmp75; + __cil_tmp83 = __cil_tmp82 + __cil_tmp75; #line 4613 - bpbBytesPerSector = (unsigned short )__cil_tmp83; + bpbBytesPerSector = (unsigned short)__cil_tmp83; #line 4615 - __cil_tmp84 = 0 * 1U; + __cil_tmp84 = 0 * 1U; #line 4615 - __cil_tmp85 = 21 + __cil_tmp84; + __cil_tmp85 = 21 + __cil_tmp84; #line 4615 - __cil_tmp86 = (unsigned int )BootSector; + __cil_tmp86 = (unsigned int)BootSector; #line 4615 - __cil_tmp87 = __cil_tmp86 + __cil_tmp85; + __cil_tmp87 = __cil_tmp86 + __cil_tmp85; #line 4615 - mem_216 = (UCHAR *)__cil_tmp87; + mem_216 = (UCHAR *)__cil_tmp87; #line 4615 - __cil_tmp88 = *mem_216; + __cil_tmp88 = *mem_216; #line 4615 - bpbMediaByte = (unsigned short )__cil_tmp88; -#line 4617 - if (! bpbNumberOfHeads) { - - } else { + bpbMediaByte = (unsigned short)__cil_tmp88; #line 4617 - if (! bpbSectorsPerTrack) { + if (!bpbNumberOfHeads) { } else { +#line 4617 + if (!bpbSectorsPerTrack) { + } else { + } } - } #line 4622 - __cil_tmp89 = (int )bpbSectorsPerTrack; + __cil_tmp89 = (int)bpbSectorsPerTrack; #line 4622 - __cil_tmp90 = (int )bpbNumberOfHeads; + __cil_tmp90 = (int)bpbNumberOfHeads; #line 4622 - __cil_tmp91 = (int )bpbNumberOfSectors; + __cil_tmp91 = (int)bpbNumberOfSectors; #line 4622 - __cil_tmp92 = __cil_tmp91 / __cil_tmp90; + __cil_tmp92 = __cil_tmp91 / __cil_tmp90; #line 4622 - __cil_tmp93 = __cil_tmp92 / __cil_tmp89; + __cil_tmp93 = __cil_tmp92 / __cil_tmp89; #line 4622 - __cil_tmp94 = __cil_tmp93 - 1; + __cil_tmp94 = __cil_tmp93 - 1; #line 4622 - bpbMaximumTrack = (unsigned short )__cil_tmp94; + bpbMaximumTrack = (unsigned short)__cil_tmp94; #line 4628 - bpbMediaType = (enum _MEDIA_TYPE )0; -#line 4629 - i = 0UL; - { + bpbMediaType = (enum _MEDIA_TYPE)0; #line 4629 - while (1) { - while_136_continue: /* CIL Label */ ; + i = 0UL; { #line 4629 - __cil_tmp95 = (KUSER_SHARED_DATA * const )4292804608U; + while (1) { + while_136_continue: /* CIL Label */; + { #line 4629 - __cil_tmp96 = (unsigned int )__cil_tmp95; + __cil_tmp95 = (KUSER_SHARED_DATA * const)4292804608U; #line 4629 - __cil_tmp97 = __cil_tmp96 + 732; + __cil_tmp96 = (unsigned int)__cil_tmp95; #line 4629 - mem_217 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp97; + __cil_tmp97 = __cil_tmp96 + 732; #line 4629 - __cil_tmp98 = *mem_217; + mem_217 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp97; #line 4629 - __cil_tmp99 = (int )__cil_tmp98; + __cil_tmp98 = *mem_217; #line 4629 - if (__cil_tmp99 == 1) { + __cil_tmp99 = (int)__cil_tmp98; #line 4629 - tmp = 21; - } else { + if (__cil_tmp99 == 1) { #line 4629 - tmp = 17; - } - } - { + tmp = 21; + } else { #line 4629 - __cil_tmp100 = (unsigned long )tmp; + tmp = 17; + } + } + { #line 4629 - __cil_tmp101 = i < __cil_tmp100; + __cil_tmp100 = (unsigned long)tmp; #line 4629 - if (! __cil_tmp101) { - goto while_136_break; - } else { - - } - } - { + __cil_tmp101 = i < __cil_tmp100; +#line 4629 + if (!__cil_tmp101) { + goto while_136_break; + } else { + } + } + { #line 4631 - __cil_tmp102 = DriveMediaConstants + i; + __cil_tmp102 = DriveMediaConstants + i; #line 4631 - __cil_tmp103 = (unsigned int )__cil_tmp102; + __cil_tmp103 = (unsigned int)__cil_tmp102; #line 4631 - __cil_tmp104 = __cil_tmp103 + 36; + __cil_tmp104 = __cil_tmp103 + 36; #line 4631 - mem_218 = (USHORT *)__cil_tmp104; + mem_218 = (USHORT *)__cil_tmp104; #line 4631 - __cil_tmp105 = *mem_218; + __cil_tmp105 = *mem_218; #line 4631 - __cil_tmp106 = (int )__cil_tmp105; + __cil_tmp106 = (int)__cil_tmp105; #line 4631 - __cil_tmp107 = (int )bpbBytesPerSector; + __cil_tmp107 = (int)bpbBytesPerSector; #line 4631 - if (__cil_tmp107 == __cil_tmp106) { - { + if (__cil_tmp107 == __cil_tmp106) { + { #line 4631 - __cil_tmp108 = DriveMediaConstants + i; + __cil_tmp108 = DriveMediaConstants + i; #line 4631 - __cil_tmp109 = (unsigned int )__cil_tmp108; + __cil_tmp109 = (unsigned int)__cil_tmp108; #line 4631 - __cil_tmp110 = __cil_tmp109 + 38; + __cil_tmp110 = __cil_tmp109 + 38; #line 4631 - mem_219 = (UCHAR *)__cil_tmp110; + mem_219 = (UCHAR *)__cil_tmp110; #line 4631 - __cil_tmp111 = *mem_219; + __cil_tmp111 = *mem_219; #line 4631 - __cil_tmp112 = (int )__cil_tmp111; + __cil_tmp112 = (int)__cil_tmp111; #line 4631 - __cil_tmp113 = (int )bpbSectorsPerTrack; + __cil_tmp113 = (int)bpbSectorsPerTrack; #line 4631 - if (__cil_tmp113 == __cil_tmp112) { - { + if (__cil_tmp113 == __cil_tmp112) { + { #line 4631 - __cil_tmp114 = DriveMediaConstants + i; + __cil_tmp114 = DriveMediaConstants + i; #line 4631 - __cil_tmp115 = (unsigned int )__cil_tmp114; + __cil_tmp115 = (unsigned int)__cil_tmp114; #line 4631 - __cil_tmp116 = __cil_tmp115 + 48; + __cil_tmp116 = __cil_tmp115 + 48; #line 4631 - mem_220 = (UCHAR *)__cil_tmp116; + mem_220 = (UCHAR *)__cil_tmp116; #line 4631 - __cil_tmp117 = *mem_220; + __cil_tmp117 = *mem_220; #line 4631 - __cil_tmp118 = (int )__cil_tmp117; + __cil_tmp118 = (int)__cil_tmp117; #line 4631 - __cil_tmp119 = (int )bpbMaximumTrack; + __cil_tmp119 = (int)bpbMaximumTrack; #line 4631 - if (__cil_tmp119 == __cil_tmp118) { - { + if (__cil_tmp119 == __cil_tmp118) { + { #line 4631 - __cil_tmp120 = DriveMediaConstants + i; + __cil_tmp120 = DriveMediaConstants + i; #line 4631 - __cil_tmp121 = (unsigned int )__cil_tmp120; + __cil_tmp121 = (unsigned int)__cil_tmp120; #line 4631 - __cil_tmp122 = __cil_tmp121 + 51; + __cil_tmp122 = __cil_tmp121 + 51; #line 4631 - mem_221 = (UCHAR *)__cil_tmp122; + mem_221 = (UCHAR *)__cil_tmp122; #line 4631 - __cil_tmp123 = *mem_221; + __cil_tmp123 = *mem_221; #line 4631 - __cil_tmp124 = (int )__cil_tmp123; + __cil_tmp124 = (int)__cil_tmp123; #line 4631 - __cil_tmp125 = (int )bpbNumberOfHeads; + __cil_tmp125 = (int)bpbNumberOfHeads; #line 4631 - if (__cil_tmp125 == __cil_tmp124) { - { + if (__cil_tmp125 == __cil_tmp124) { + { #line 4631 - __cil_tmp126 = DriveMediaConstants + i; + __cil_tmp126 = DriveMediaConstants + i; #line 4631 - __cil_tmp127 = (unsigned int )__cil_tmp126; + __cil_tmp127 = (unsigned int)__cil_tmp126; #line 4631 - __cil_tmp128 = __cil_tmp127 + 53; + __cil_tmp128 = __cil_tmp127 + 53; #line 4631 - mem_222 = (UCHAR *)__cil_tmp128; + mem_222 = (UCHAR *)__cil_tmp128; #line 4631 - __cil_tmp129 = *mem_222; + __cil_tmp129 = *mem_222; #line 4631 - __cil_tmp130 = (int )__cil_tmp129; + __cil_tmp130 = (int)__cil_tmp129; #line 4631 - __cil_tmp131 = (int )bpbMediaByte; + __cil_tmp131 = (int)bpbMediaByte; #line 4631 - if (__cil_tmp131 == __cil_tmp130) { + if (__cil_tmp131 == __cil_tmp130) { #line 4637 - __cil_tmp132 = DriveMediaConstants + i; + __cil_tmp132 = DriveMediaConstants + i; #line 4637 - mem_223 = (MEDIA_TYPE *)__cil_tmp132; + mem_223 = (MEDIA_TYPE *)__cil_tmp132; #line 4637 - bpbMediaType = *mem_223; - goto while_136_break; - } else { - - } + bpbMediaType = *mem_223; + goto while_136_break; + } else { + } + } + } else { + } + } + } else { + } + } + } else { + } } } else { - } - } - } else { - - } } - } else { - - } +#line 4629 + i = i + 1UL; } - } else { - + while_136_break: /* CIL Label */; } - } -#line 4629 - i = i + 1UL; - } - while_136_break: /* CIL Label */ ; - } - { + { #line 4647 - __cil_tmp133 = (unsigned int )DisketteExtension; + __cil_tmp133 = (unsigned int)DisketteExtension; #line 4647 - __cil_tmp134 = __cil_tmp133 + 174; + __cil_tmp134 = __cil_tmp133 + 174; #line 4647 - mem_224 = (UCHAR *)__cil_tmp134; + mem_224 = (UCHAR *)__cil_tmp134; #line 4647 - __cil_tmp135 = *mem_224; + __cil_tmp135 = *mem_224; #line 4647 - __cil_tmp136 = (int )__cil_tmp135; + __cil_tmp136 = (int)__cil_tmp135; #line 4647 - if (__cil_tmp136 == 3) { + if (__cil_tmp136 == 3) { #line 4649 - if ((int )bpbMediaType == 15) { - goto switch_137_15; - } else { + if ((int)bpbMediaType == 15) { + goto switch_137_15; + } else { #line 4650 - if ((int )bpbMediaType == 16) { - goto switch_137_16; - } else { + if ((int)bpbMediaType == 16) { + goto switch_137_16; + } else { #line 4651 - if ((int )bpbMediaType == 1) { - goto switch_137_1; - } else { + if ((int)bpbMediaType == 1) { + goto switch_137_1; + } else { #line 4652 - if ((int )bpbMediaType == 19) { - goto switch_137_19; - } else { - { - goto switch_137_default; + if ((int)bpbMediaType == 19) { + goto switch_137_19; + } else { + { + goto switch_137_default; #line 4648 - if (0) { - switch_137_15: /* CIL Label */ + if (0) { + switch_137_15: /* CIL Label */ #line 4649 - bpbMediaType = (enum _MEDIA_TYPE )14; - goto switch_137_break; - switch_137_16: /* CIL Label */ + bpbMediaType = (enum _MEDIA_TYPE)14; + goto switch_137_break; + switch_137_16: /* CIL Label */ #line 4650 - bpbMediaType = (enum _MEDIA_TYPE )5; - goto switch_137_break; - switch_137_1: /* CIL Label */ + bpbMediaType = (enum _MEDIA_TYPE)5; + goto switch_137_break; + switch_137_1: /* CIL Label */ #line 4651 - bpbMediaType = (enum _MEDIA_TYPE )17; - goto switch_137_break; - switch_137_19: /* CIL Label */ + bpbMediaType = (enum _MEDIA_TYPE)17; + goto switch_137_break; + switch_137_19: /* CIL Label */ #line 4652 - bpbMediaType = (enum _MEDIA_TYPE )18; - goto switch_137_break; - switch_137_default: /* CIL Label */ ; - goto switch_137_break; - } else { - switch_137_break: /* CIL Label */ ; - } + bpbMediaType = (enum _MEDIA_TYPE)18; + goto switch_137_break; + switch_137_default: /* CIL Label */; + goto switch_137_break; + } else { + switch_137_break: /* CIL Label */; + } + } + } } } } + } else { } } - } else { - - } - } - { + { #line 4660 - while (1) { - while_138_continue: /* CIL Label */ ; - goto while_138_break; - } - while_138_break: /* CIL Label */ ; - } - { + while (1) { + while_138_continue: /* CIL Label */; + goto while_138_break; + } + while_138_break: /* CIL Label */; + } + { #line 4665 - while (1) { - while_139_continue: /* CIL Label */ ; - goto while_139_break; - } - while_139_break: /* CIL Label */ ; - } - { + while (1) { + while_139_continue: /* CIL Label */; + goto while_139_break; + } + while_139_break: /* CIL Label */; + } + { #line 4666 - __cil_tmp137 = (unsigned int )DisketteExtension; + __cil_tmp137 = (unsigned int)DisketteExtension; #line 4666 - __cil_tmp138 = __cil_tmp137 + 184; + __cil_tmp138 = __cil_tmp137 + 184; #line 4666 - mem_225 = (MEDIA_TYPE *)__cil_tmp138; + mem_225 = (MEDIA_TYPE *)__cil_tmp138; #line 4666 - __cil_tmp139 = *mem_225; + __cil_tmp139 = *mem_225; #line 4666 - __cil_tmp140 = (int )__cil_tmp139; + __cil_tmp140 = (int)__cil_tmp139; #line 4666 - __cil_tmp141 = (int )bpbMediaType; + __cil_tmp141 = (int)bpbMediaType; #line 4666 - if (__cil_tmp141 == __cil_tmp140) { + if (__cil_tmp141 == __cil_tmp140) { #line 4670 - changeToBpbMedia = (unsigned char)0; - { + changeToBpbMedia = (unsigned char)0; + { #line 4674 - while (1) { - while_140_continue: /* CIL Label */ ; - goto while_140_break; - } - while_140_break: /* CIL Label */ ; - } - } else { + while (1) { + while_140_continue: /* CIL Label */; + goto while_140_break; + } + while_140_break: /* CIL Label */; + } + } else { #line 4682 - __cil_tmp142 = (unsigned int )DisketteExtension; + __cil_tmp142 = (unsigned int)DisketteExtension; #line 4682 - __cil_tmp143 = __cil_tmp142 + 308; + __cil_tmp143 = __cil_tmp142 + 308; #line 4682 - readidDriveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp143; - { + readidDriveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp143; + { #line 4684 - __cil_tmp144 = (unsigned int )readidDriveMediaConstants; + __cil_tmp144 = (unsigned int)readidDriveMediaConstants; #line 4684 - __cil_tmp145 = __cil_tmp144 + 36; + __cil_tmp145 = __cil_tmp144 + 36; #line 4684 - mem_226 = (USHORT *)__cil_tmp145; + mem_226 = (USHORT *)__cil_tmp145; #line 4684 - __cil_tmp146 = *mem_226; + __cil_tmp146 = *mem_226; #line 4684 - __cil_tmp147 = (int )__cil_tmp146; + __cil_tmp147 = (int)__cil_tmp146; #line 4684 - __cil_tmp148 = (int )bpbBytesPerSector; + __cil_tmp148 = (int)bpbBytesPerSector; #line 4684 - if (__cil_tmp148 == __cil_tmp147) { - { + if (__cil_tmp148 == __cil_tmp147) { + { #line 4684 - __cil_tmp149 = (int )bpbSectorsPerTrack; + __cil_tmp149 = (int)bpbSectorsPerTrack; #line 4684 - if (__cil_tmp149 < 256) { - { + if (__cil_tmp149 < 256) { + { #line 4684 - __cil_tmp150 = (unsigned int )readidDriveMediaConstants; + __cil_tmp150 = (unsigned int)readidDriveMediaConstants; #line 4684 - __cil_tmp151 = __cil_tmp150 + 48; + __cil_tmp151 = __cil_tmp150 + 48; #line 4684 - mem_227 = (UCHAR *)__cil_tmp151; + mem_227 = (UCHAR *)__cil_tmp151; #line 4684 - __cil_tmp152 = *mem_227; + __cil_tmp152 = *mem_227; #line 4684 - __cil_tmp153 = (int )__cil_tmp152; + __cil_tmp153 = (int)__cil_tmp152; #line 4684 - __cil_tmp154 = (int )bpbMaximumTrack; + __cil_tmp154 = (int)bpbMaximumTrack; #line 4684 - if (__cil_tmp154 == __cil_tmp153) { - { + if (__cil_tmp154 == __cil_tmp153) { + { #line 4684 - __cil_tmp155 = (unsigned int )readidDriveMediaConstants; + __cil_tmp155 = (unsigned int)readidDriveMediaConstants; #line 4684 - __cil_tmp156 = __cil_tmp155 + 51; + __cil_tmp156 = __cil_tmp155 + 51; #line 4684 - mem_228 = (UCHAR *)__cil_tmp156; + mem_228 = (UCHAR *)__cil_tmp156; #line 4684 - __cil_tmp157 = *mem_228; + __cil_tmp157 = *mem_228; #line 4684 - __cil_tmp158 = (int )__cil_tmp157; + __cil_tmp158 = (int)__cil_tmp157; #line 4684 - __cil_tmp159 = (int )bpbNumberOfHeads; + __cil_tmp159 = (int)bpbNumberOfHeads; #line 4684 - if (__cil_tmp159 <= __cil_tmp158) { + if (__cil_tmp159 <= __cil_tmp158) { #line 4689 - changeToBpbMedia = (unsigned char)1; - } else { + changeToBpbMedia = (unsigned char)1; + } else { #line 4692 - changeToBpbMedia = (unsigned char)0; - } - } - } else { + changeToBpbMedia = (unsigned char)0; + } + } + } else { #line 4692 - changeToBpbMedia = (unsigned char)0; - } - } - } else { + changeToBpbMedia = (unsigned char)0; + } + } + } else { #line 4692 - changeToBpbMedia = (unsigned char)0; - } - } - } else { + changeToBpbMedia = (unsigned char)0; + } + } + } else { #line 4692 - changeToBpbMedia = (unsigned char)0; - } - } - { + changeToBpbMedia = (unsigned char)0; + } + } + { #line 4699 - while (1) { - while_141_continue: /* CIL Label */ ; - goto while_141_break; - } - while_141_break: /* CIL Label */ ; - } - { + while (1) { + while_141_continue: /* CIL Label */; + goto while_141_break; + } + while_141_break: /* CIL Label */; + } + { #line 4706 - __cil_tmp160 = (int )bpbMediaType; + __cil_tmp160 = (int)bpbMediaType; #line 4706 - if (__cil_tmp160 == 0) { + if (__cil_tmp160 == 0) { #line 4707 - mem_229 = (MEDIA_TYPE *)readidDriveMediaConstants; + mem_229 = (MEDIA_TYPE *)readidDriveMediaConstants; #line 4707 - bpbMediaType = *mem_229; + bpbMediaType = *mem_229; #line 4708 - __cil_tmp161 = 308 + 54; + __cil_tmp161 = 308 + 54; #line 4708 - __cil_tmp162 = (unsigned int )DisketteExtension; + __cil_tmp162 = (unsigned int)DisketteExtension; #line 4708 - __cil_tmp163 = __cil_tmp162 + __cil_tmp161; + __cil_tmp163 = __cil_tmp162 + __cil_tmp161; #line 4708 - mem_230 = (UCHAR *)__cil_tmp163; + mem_230 = (UCHAR *)__cil_tmp163; #line 4708 - *mem_230 = (unsigned char)0; - } else { - - } + *mem_230 = (unsigned char)0; + } else { + } + } + } } - } - } #line 4712 - if (changeToBpbMedia) { + if (changeToBpbMedia) { #line 4717 - __cil_tmp164 = (unsigned int )DisketteExtension; + __cil_tmp164 = (unsigned int)DisketteExtension; #line 4717 - __cil_tmp165 = __cil_tmp164 + 174; + __cil_tmp165 = __cil_tmp164 + 174; #line 4717 - mem_231 = (UCHAR *)__cil_tmp165; + mem_231 = (UCHAR *)__cil_tmp165; #line 4717 - __cil_tmp166 = *mem_231; + __cil_tmp166 = *mem_231; #line 4717 - __cil_tmp167 = (int )__cil_tmp166; + __cil_tmp167 = (int)__cil_tmp166; #line 4717 - __cil_tmp168 = DriveMediaLimits + __cil_tmp167; + __cil_tmp168 = DriveMediaLimits + __cil_tmp167; #line 4717 - __cil_tmp169 = (unsigned int )__cil_tmp168; + __cil_tmp169 = (unsigned int)__cil_tmp168; #line 4717 - __cil_tmp170 = __cil_tmp169 + 32; + __cil_tmp170 = __cil_tmp169 + 32; #line 4717 - mem_232 = (DRIVE_MEDIA_TYPE *)__cil_tmp170; + mem_232 = (DRIVE_MEDIA_TYPE *)__cil_tmp170; #line 4717 - __cil_tmp171 = *mem_232; + __cil_tmp171 = *mem_232; #line 4717 - i = (unsigned long )__cil_tmp171; + i = (unsigned long)__cil_tmp171; #line 4718 - __cil_tmp172 = (unsigned int )DisketteExtension; + __cil_tmp172 = (unsigned int)DisketteExtension; #line 4718 - __cil_tmp173 = __cil_tmp172 + 174; + __cil_tmp173 = __cil_tmp172 + 174; #line 4718 - mem_233 = (UCHAR *)__cil_tmp173; + mem_233 = (UCHAR *)__cil_tmp173; #line 4718 - __cil_tmp174 = *mem_233; + __cil_tmp174 = *mem_233; #line 4718 - __cil_tmp175 = (int )__cil_tmp174; + __cil_tmp175 = (int)__cil_tmp174; #line 4718 - __cil_tmp176 = DriveMediaLimits + __cil_tmp175; + __cil_tmp176 = DriveMediaLimits + __cil_tmp175; #line 4718 - mem_234 = (DRIVE_MEDIA_TYPE *)__cil_tmp176; + mem_234 = (DRIVE_MEDIA_TYPE *)__cil_tmp176; #line 4718 - __cil_tmp177 = *mem_234; + __cil_tmp177 = *mem_234; #line 4718 - n = (unsigned long )__cil_tmp177; - { + n = (unsigned long)__cil_tmp177; + { #line 4719 - while (1) { - while_142_continue: /* CIL Label */ ; + while (1) { + while_142_continue: /* CIL Label */; #line 4719 - if (i <= n) { + if (i <= n) { - } else { - goto while_142_break; - } - { + } else { + goto while_142_break; + } + { #line 4721 - __cil_tmp178 = DriveMediaConstants + i; + __cil_tmp178 = DriveMediaConstants + i; #line 4721 - mem_235 = (MEDIA_TYPE *)__cil_tmp178; + mem_235 = (MEDIA_TYPE *)__cil_tmp178; #line 4721 - __cil_tmp179 = *mem_235; + __cil_tmp179 = *mem_235; #line 4721 - __cil_tmp180 = (int )__cil_tmp179; + __cil_tmp180 = (int)__cil_tmp179; #line 4721 - __cil_tmp181 = (int )bpbMediaType; + __cil_tmp181 = (int)bpbMediaType; #line 4721 - if (__cil_tmp181 == __cil_tmp180) { + if (__cil_tmp181 == __cil_tmp180) { #line 4722 - __cil_tmp182 = (unsigned int )DisketteExtension; + __cil_tmp182 = (unsigned int)DisketteExtension; #line 4722 - __cil_tmp183 = __cil_tmp182 + 216; + __cil_tmp183 = __cil_tmp182 + 216; #line 4722 - mem_236 = (DRIVE_MEDIA_TYPE *)__cil_tmp183; + mem_236 = (DRIVE_MEDIA_TYPE *)__cil_tmp183; #line 4722 - *mem_236 = (enum _DRIVE_MEDIA_TYPE )i; - goto while_142_break; - } else { - - } - } + *mem_236 = (enum _DRIVE_MEDIA_TYPE)i; + goto while_142_break; + } else { + } + } #line 4719 - i = i + 1UL; - } - while_142_break: /* CIL Label */ ; - } - { + i = i + 1UL; + } + while_142_break: /* CIL Label */; + } + { #line 4727 - __cil_tmp184 = (unsigned int )DisketteExtension; + __cil_tmp184 = (unsigned int)DisketteExtension; #line 4727 - __cil_tmp185 = __cil_tmp184 + 184; + __cil_tmp185 = __cil_tmp184 + 184; #line 4727 - mem_237 = (MEDIA_TYPE *)__cil_tmp185; + mem_237 = (MEDIA_TYPE *)__cil_tmp185; #line 4727 - *mem_237 = bpbMediaType; + *mem_237 = bpbMediaType; #line 4728 - __cil_tmp186 = (unsigned int )DisketteExtension; + __cil_tmp186 = (unsigned int)DisketteExtension; #line 4728 - __cil_tmp187 = __cil_tmp186 + 180; + __cil_tmp187 = __cil_tmp186 + 180; #line 4728 - __cil_tmp188 = (int )bpbBytesPerSector; + __cil_tmp188 = (int)bpbBytesPerSector; #line 4728 - __cil_tmp189 = (int )bpbNumberOfSectors; + __cil_tmp189 = (int)bpbNumberOfSectors; #line 4728 - __cil_tmp190 = __cil_tmp189 * __cil_tmp188; + __cil_tmp190 = __cil_tmp189 * __cil_tmp188; #line 4728 - mem_238 = (ULONG *)__cil_tmp187; + mem_238 = (ULONG *)__cil_tmp187; #line 4728 - *mem_238 = (unsigned long )__cil_tmp190; + *mem_238 = (unsigned long)__cil_tmp190; #line 4729 - __cil_tmp191 = 308 + 38; + __cil_tmp191 = 308 + 38; #line 4729 - __cil_tmp192 = (unsigned int )DisketteExtension; + __cil_tmp192 = (unsigned int)DisketteExtension; #line 4729 - __cil_tmp193 = __cil_tmp192 + __cil_tmp191; + __cil_tmp193 = __cil_tmp192 + __cil_tmp191; #line 4729 - mem_239 = (UCHAR *)__cil_tmp193; + mem_239 = (UCHAR *)__cil_tmp193; #line 4729 - *mem_239 = (unsigned char )bpbSectorsPerTrack; + *mem_239 = (unsigned char)bpbSectorsPerTrack; #line 4731 - __cil_tmp194 = 308 + 51; + __cil_tmp194 = 308 + 51; #line 4731 - __cil_tmp195 = (unsigned int )DisketteExtension; + __cil_tmp195 = (unsigned int)DisketteExtension; #line 4731 - __cil_tmp196 = __cil_tmp195 + __cil_tmp194; + __cil_tmp196 = __cil_tmp195 + __cil_tmp194; #line 4731 - mem_240 = (UCHAR *)__cil_tmp196; + mem_240 = (UCHAR *)__cil_tmp196; #line 4731 - *mem_240 = (unsigned char )bpbNumberOfHeads; + *mem_240 = (unsigned char)bpbNumberOfHeads; #line 4737 - __cil_tmp197 = 0 * 1U; + __cil_tmp197 = 0 * 1U; #line 4737 - __cil_tmp198 = 3 + __cil_tmp197; + __cil_tmp198 = 3 + __cil_tmp197; #line 4737 - __cil_tmp199 = (unsigned int )BootSector; + __cil_tmp199 = (unsigned int)BootSector; #line 4737 - __cil_tmp200 = __cil_tmp199 + __cil_tmp198; + __cil_tmp200 = __cil_tmp199 + __cil_tmp198; #line 4737 - __cil_tmp201 = (UCHAR *)__cil_tmp200; + __cil_tmp201 = (UCHAR *)__cil_tmp200; #line 4737 - __cil_tmp202 = (void const *)__cil_tmp201; + __cil_tmp202 = (void const *)__cil_tmp201; #line 4737 - __cil_tmp203 = (void const *)"MSDMF3."; + __cil_tmp203 = (void const *)"MSDMF3."; #line 4737 - tmp___0 = RtlCompareMemory(__cil_tmp202, __cil_tmp203, 7UL); - } + tmp___0 = RtlCompareMemory(__cil_tmp202, __cil_tmp203, 7UL); + } #line 4737 - if (tmp___0 == 7UL) { + if (tmp___0 == 7UL) { #line 4738 - __cil_tmp204 = (unsigned int )DisketteExtension; + __cil_tmp204 = (unsigned int)DisketteExtension; #line 4738 - __cil_tmp205 = __cil_tmp204 + 250; + __cil_tmp205 = __cil_tmp204 + 250; #line 4738 - mem_241 = (BOOLEAN *)__cil_tmp205; + mem_241 = (BOOLEAN *)__cil_tmp205; #line 4738 - *mem_241 = (unsigned char)1; + *mem_241 = (unsigned char)1; + } else { + } } else { - } - } else { - - } #line 4743 - return; -} + return; + } } #line 4743 "floppy.c" -void FlCheckBootSector(PDISKETTE_EXTENSION DisketteExtension ) -{ PBOOT_SECTOR_INFO bootSector ; - LARGE_INTEGER offset ; - PIRP irp ; - NTSTATUS status ; - int tmp ; - PVOID tmp___0 ; - int tmp___1 ; - KUSER_SHARED_DATA *__cil_tmp9 ; - unsigned int __cil_tmp10 ; - unsigned int __cil_tmp11 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp12 ; - int __cil_tmp13 ; - enum _POOL_TYPE __cil_tmp14 ; - unsigned long __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - LARGE_INTEGER *__cil_tmp18 ; - unsigned int __cil_tmp19 ; - unsigned int __cil_tmp20 ; - LONG __cil_tmp21 ; - KUSER_SHARED_DATA *__cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp25 ; - int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - PDEVICE_OBJECT __cil_tmp29 ; - void *__cil_tmp30 ; - unsigned long __cil_tmp31 ; - void *__cil_tmp32 ; - struct _IO_STATUS_BLOCK *__cil_tmp33 ; - void *__cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - CHAR __cil_tmp39 ; - int __cil_tmp40 ; - int __cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - unsigned int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - unsigned int __cil_tmp51 ; - struct _IO_STACK_LOCATION *__cil_tmp52 ; - unsigned int __cil_tmp53 ; - unsigned int __cil_tmp54 ; - PMDL __cil_tmp55 ; - unsigned int __cil_tmp56 ; - unsigned int __cil_tmp57 ; - PMDL __cil_tmp58 ; - void *__cil_tmp59 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_60 ; - LONG *mem_61 ; - LONG *mem_62 ; - ULONG *mem_63 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_64 ; - PDEVICE_OBJECT *mem_65 ; - CHAR *mem_66 ; - CHAR *mem_67 ; - struct _IO_STACK_LOCATION **mem_68 ; - struct _IO_STACK_LOCATION **mem_69 ; - PMDL *mem_70 ; - PMDL *mem_71 ; +void FlCheckBootSector(PDISKETTE_EXTENSION DisketteExtension) { + PBOOT_SECTOR_INFO bootSector; + LARGE_INTEGER offset; + PIRP irp; + NTSTATUS status; + int tmp; + PVOID tmp___0; + int tmp___1; + KUSER_SHARED_DATA *__cil_tmp9; + unsigned int __cil_tmp10; + unsigned int __cil_tmp11; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp12; + int __cil_tmp13; + enum _POOL_TYPE __cil_tmp14; + unsigned long __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + LARGE_INTEGER *__cil_tmp18; + unsigned int __cil_tmp19; + unsigned int __cil_tmp20; + LONG __cil_tmp21; + KUSER_SHARED_DATA *__cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp25; + int __cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + PDEVICE_OBJECT __cil_tmp29; + void *__cil_tmp30; + unsigned long __cil_tmp31; + void *__cil_tmp32; + struct _IO_STATUS_BLOCK *__cil_tmp33; + void *__cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + CHAR __cil_tmp39; + int __cil_tmp40; + int __cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + unsigned int __cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + unsigned int __cil_tmp51; + struct _IO_STACK_LOCATION *__cil_tmp52; + unsigned int __cil_tmp53; + unsigned int __cil_tmp54; + PMDL __cil_tmp55; + unsigned int __cil_tmp56; + unsigned int __cil_tmp57; + PMDL __cil_tmp58; + void *__cil_tmp59; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_60; + LONG *mem_61; + LONG *mem_62; + ULONG *mem_63; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_64; + PDEVICE_OBJECT *mem_65; + CHAR *mem_66; + CHAR *mem_67; + struct _IO_STACK_LOCATION **mem_68; + struct _IO_STACK_LOCATION **mem_69; + PMDL *mem_70; + PMDL *mem_71; { - { + { #line 4776 - __cil_tmp9 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp9 = (KUSER_SHARED_DATA * const)4292804608U; #line 4776 - __cil_tmp10 = (unsigned int )__cil_tmp9; + __cil_tmp10 = (unsigned int)__cil_tmp9; #line 4776 - __cil_tmp11 = __cil_tmp10 + 732; + __cil_tmp11 = __cil_tmp10 + 732; #line 4776 - mem_60 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp11; + mem_60 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp11; #line 4776 - __cil_tmp12 = *mem_60; + __cil_tmp12 = *mem_60; #line 4776 - __cil_tmp13 = (int )__cil_tmp12; + __cil_tmp13 = (int)__cil_tmp12; #line 4776 - if (__cil_tmp13 == 1) { + if (__cil_tmp13 == 1) { #line 4776 - tmp = 1024; - } else { + tmp = 1024; + } else { #line 4776 - tmp = 512; - } - } - { + tmp = 512; + } + } + { #line 4776 - __cil_tmp14 = (enum _POOL_TYPE )4; + __cil_tmp14 = (enum _POOL_TYPE)4; #line 4776 - __cil_tmp15 = (unsigned long )tmp; + __cil_tmp15 = (unsigned long)tmp; #line 4776 - tmp___0 = ExAllocatePoolWithTag(__cil_tmp14, __cil_tmp15, 1886350406UL); + tmp___0 = ExAllocatePoolWithTag(__cil_tmp14, __cil_tmp15, 1886350406UL); #line 4776 - bootSector = (struct _BOOT_SECTOR_INFO *)tmp___0; - } + bootSector = (struct _BOOT_SECTOR_INFO *)tmp___0; + } #line 4777 - if (! bootSector) { - - } else { + if (!bootSector) { - } + } else { + } #line 4781 - __cil_tmp16 = 0 + 4; + __cil_tmp16 = 0 + 4; #line 4781 - __cil_tmp17 = (unsigned int )(& offset) + __cil_tmp16; + __cil_tmp17 = (unsigned int)(&offset) + __cil_tmp16; #line 4781 - mem_61 = (LONG *)__cil_tmp17; + mem_61 = (LONG *)__cil_tmp17; #line 4781 - *mem_61 = 0L; + *mem_61 = 0L; #line 4781 - __cil_tmp18 = & offset; + __cil_tmp18 = &offset; #line 4781 - __cil_tmp19 = 0 + 4; + __cil_tmp19 = 0 + 4; #line 4781 - __cil_tmp20 = (unsigned int )(& offset) + __cil_tmp19; + __cil_tmp20 = (unsigned int)(&offset) + __cil_tmp19; #line 4781 - mem_62 = (LONG *)__cil_tmp20; + mem_62 = (LONG *)__cil_tmp20; #line 4781 - __cil_tmp21 = *mem_62; + __cil_tmp21 = *mem_62; #line 4781 - mem_63 = (ULONG *)__cil_tmp18; + mem_63 = (ULONG *)__cil_tmp18; #line 4781 - *mem_63 = (unsigned long )__cil_tmp21; - { + *mem_63 = (unsigned long)__cil_tmp21; + { #line 4782 - __cil_tmp22 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp22 = (KUSER_SHARED_DATA * const)4292804608U; #line 4782 - __cil_tmp23 = (unsigned int )__cil_tmp22; + __cil_tmp23 = (unsigned int)__cil_tmp22; #line 4782 - __cil_tmp24 = __cil_tmp23 + 732; + __cil_tmp24 = __cil_tmp23 + 732; #line 4782 - mem_64 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp24; + mem_64 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp24; #line 4782 - __cil_tmp25 = *mem_64; + __cil_tmp25 = *mem_64; #line 4782 - __cil_tmp26 = (int )__cil_tmp25; + __cil_tmp26 = (int)__cil_tmp25; #line 4782 - if (__cil_tmp26 == 1) { + if (__cil_tmp26 == 1) { #line 4782 - tmp___1 = 1024; - } else { + tmp___1 = 1024; + } else { #line 4782 - tmp___1 = 512; - } - } - { + tmp___1 = 512; + } + } + { #line 4782 - __cil_tmp27 = (unsigned int )DisketteExtension; + __cil_tmp27 = (unsigned int)DisketteExtension; #line 4782 - __cil_tmp28 = __cil_tmp27 + 28; + __cil_tmp28 = __cil_tmp27 + 28; #line 4782 - mem_65 = (PDEVICE_OBJECT *)__cil_tmp28; + mem_65 = (PDEVICE_OBJECT *)__cil_tmp28; #line 4782 - __cil_tmp29 = *mem_65; + __cil_tmp29 = *mem_65; #line 4782 - __cil_tmp30 = (void *)bootSector; + __cil_tmp30 = (void *)bootSector; #line 4782 - __cil_tmp31 = (unsigned long )tmp___1; + __cil_tmp31 = (unsigned long)tmp___1; #line 4782 - __cil_tmp32 = (void *)0; + __cil_tmp32 = (void *)0; #line 4782 - __cil_tmp33 = (struct _IO_STATUS_BLOCK *)__cil_tmp32; + __cil_tmp33 = (struct _IO_STATUS_BLOCK *)__cil_tmp32; #line 4782 - irp = IoBuildAsynchronousFsdRequest(3UL, __cil_tmp29, __cil_tmp30, __cil_tmp31, - & offset, __cil_tmp33); - } + irp = IoBuildAsynchronousFsdRequest(3UL, __cil_tmp29, __cil_tmp30, + __cil_tmp31, &offset, __cil_tmp33); + } #line 4788 - if (! irp) { - { + if (!irp) { + { #line 4789 - __cil_tmp34 = (void *)bootSector; + __cil_tmp34 = (void *)bootSector; #line 4789 - ExFreePool(__cil_tmp34); + ExFreePool(__cil_tmp34); + } + } else { } - } else { - - } - { + { #line 4792 - __cil_tmp35 = (unsigned int )irp; + __cil_tmp35 = (unsigned int)irp; #line 4792 - __cil_tmp36 = __cil_tmp35 + 35; + __cil_tmp36 = __cil_tmp35 + 35; #line 4792 - __cil_tmp37 = (unsigned int )irp; + __cil_tmp37 = (unsigned int)irp; #line 4792 - __cil_tmp38 = __cil_tmp37 + 35; + __cil_tmp38 = __cil_tmp37 + 35; #line 4792 - mem_66 = (CHAR *)__cil_tmp38; + mem_66 = (CHAR *)__cil_tmp38; #line 4792 - __cil_tmp39 = *mem_66; + __cil_tmp39 = *mem_66; #line 4792 - __cil_tmp40 = (int )__cil_tmp39; + __cil_tmp40 = (int)__cil_tmp39; #line 4792 - __cil_tmp41 = __cil_tmp40 - 1; + __cil_tmp41 = __cil_tmp40 - 1; #line 4792 - mem_67 = (CHAR *)__cil_tmp36; + mem_67 = (CHAR *)__cil_tmp36; #line 4792 - *mem_67 = (char )__cil_tmp41; + *mem_67 = (char)__cil_tmp41; #line 4793 - __cil_tmp42 = 24 + 8; + __cil_tmp42 = 24 + 8; #line 4793 - __cil_tmp43 = 0 + __cil_tmp42; + __cil_tmp43 = 0 + __cil_tmp42; #line 4793 - __cil_tmp44 = 64 + __cil_tmp43; + __cil_tmp44 = 64 + __cil_tmp43; #line 4793 - __cil_tmp45 = (unsigned int )irp; + __cil_tmp45 = (unsigned int)irp; #line 4793 - __cil_tmp46 = __cil_tmp45 + __cil_tmp44; + __cil_tmp46 = __cil_tmp45 + __cil_tmp44; #line 4793 - __cil_tmp47 = 24 + 8; + __cil_tmp47 = 24 + 8; #line 4793 - __cil_tmp48 = 0 + __cil_tmp47; + __cil_tmp48 = 0 + __cil_tmp47; #line 4793 - __cil_tmp49 = 64 + __cil_tmp48; + __cil_tmp49 = 64 + __cil_tmp48; #line 4793 - __cil_tmp50 = (unsigned int )irp; + __cil_tmp50 = (unsigned int)irp; #line 4793 - __cil_tmp51 = __cil_tmp50 + __cil_tmp49; + __cil_tmp51 = __cil_tmp50 + __cil_tmp49; #line 4793 - mem_68 = (struct _IO_STACK_LOCATION **)__cil_tmp51; + mem_68 = (struct _IO_STACK_LOCATION **)__cil_tmp51; #line 4793 - __cil_tmp52 = *mem_68; + __cil_tmp52 = *mem_68; #line 4793 - mem_69 = (struct _IO_STACK_LOCATION **)__cil_tmp46; + mem_69 = (struct _IO_STACK_LOCATION **)__cil_tmp46; #line 4793 - *mem_69 = __cil_tmp52 - 1; + *mem_69 = __cil_tmp52 - 1; #line 4798 - status = FlReadWrite(DisketteExtension, irp, (unsigned char)1); + status = FlReadWrite(DisketteExtension, irp, (unsigned char)1); #line 4800 - __cil_tmp53 = (unsigned int )irp; + __cil_tmp53 = (unsigned int)irp; #line 4800 - __cil_tmp54 = __cil_tmp53 + 4; + __cil_tmp54 = __cil_tmp53 + 4; #line 4800 - mem_70 = (PMDL *)__cil_tmp54; + mem_70 = (PMDL *)__cil_tmp54; #line 4800 - __cil_tmp55 = *mem_70; + __cil_tmp55 = *mem_70; #line 4800 - MmUnlockPages(__cil_tmp55); + MmUnlockPages(__cil_tmp55); #line 4801 - __cil_tmp56 = (unsigned int )irp; + __cil_tmp56 = (unsigned int)irp; #line 4801 - __cil_tmp57 = __cil_tmp56 + 4; + __cil_tmp57 = __cil_tmp56 + 4; #line 4801 - mem_71 = (PMDL *)__cil_tmp57; + mem_71 = (PMDL *)__cil_tmp57; #line 4801 - __cil_tmp58 = *mem_71; + __cil_tmp58 = *mem_71; #line 4801 - IoFreeMdl(__cil_tmp58); + IoFreeMdl(__cil_tmp58); #line 4802 - IoFreeIrp(irp); + IoFreeIrp(irp); #line 4803 - __cil_tmp59 = (void *)bootSector; + __cil_tmp59 = (void *)bootSector; #line 4803 - ExFreePool(__cil_tmp59); - } + ExFreePool(__cil_tmp59); + } #line 4806 - return; -} + return; + } } #line 4806 "floppy.c" -NTSTATUS FlReadWriteTrack(PDISKETTE_EXTENSION DisketteExtension , PMDL IoMdl , ULONG IoOffset , - BOOLEAN WriteOperation , UCHAR Cylinder , UCHAR Head , UCHAR Sector , - UCHAR NumberOfSectors , BOOLEAN NeedSeek ) -{ PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - ULONG byteToSectorShift ; - ULONG transferBytes ; - LARGE_INTEGER headSettleTime ; - NTSTATUS status ; - ULONG seekRetry ; - ULONG ioRetry ; - BOOLEAN recalibrateDrive ; - UCHAR i ; - unsigned int __cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - UCHAR __cil_tmp23 ; - int __cil_tmp24 ; - int __cil_tmp25 ; - unsigned long __cil_tmp26 ; - LARGE_INTEGER *__cil_tmp27 ; - unsigned int __cil_tmp28 ; - unsigned int __cil_tmp29 ; - UCHAR __cil_tmp30 ; - int __cil_tmp31 ; - int __cil_tmp32 ; - int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - BOOLEAN __cil_tmp38 ; - unsigned int __cil_tmp39 ; - unsigned int __cil_tmp40 ; - UCHAR __cil_tmp41 ; - int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - unsigned int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - unsigned int __cil_tmp51 ; - unsigned int __cil_tmp52 ; - UCHAR __cil_tmp53 ; - int __cil_tmp54 ; - int __cil_tmp55 ; - int __cil_tmp56 ; - int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - unsigned int __cil_tmp59 ; - unsigned int __cil_tmp60 ; - unsigned int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - unsigned int __cil_tmp63 ; - UCHAR __cil_tmp64 ; - int __cil_tmp65 ; - int __cil_tmp66 ; - int __cil_tmp67 ; - unsigned int __cil_tmp68 ; - unsigned int __cil_tmp69 ; - unsigned int __cil_tmp70 ; - unsigned int __cil_tmp71 ; - UCHAR *__cil_tmp72 ; - unsigned int __cil_tmp73 ; - unsigned int __cil_tmp74 ; - unsigned int __cil_tmp75 ; - unsigned int __cil_tmp76 ; - UCHAR *__cil_tmp77 ; - void *__cil_tmp78 ; - struct _MDL *__cil_tmp79 ; - unsigned int __cil_tmp80 ; - unsigned int __cil_tmp81 ; - unsigned int __cil_tmp82 ; - unsigned int __cil_tmp83 ; - UCHAR __cil_tmp84 ; - int __cil_tmp85 ; - int __cil_tmp86 ; - unsigned int __cil_tmp87 ; - unsigned int __cil_tmp88 ; - unsigned int __cil_tmp89 ; - unsigned int __cil_tmp90 ; - UCHAR __cil_tmp91 ; - int __cil_tmp92 ; - int __cil_tmp93 ; - int __cil_tmp94 ; - unsigned int __cil_tmp95 ; - unsigned int __cil_tmp96 ; - unsigned int __cil_tmp97 ; - unsigned int __cil_tmp98 ; - UCHAR __cil_tmp99 ; - int __cil_tmp100 ; - unsigned int __cil_tmp101 ; - unsigned int __cil_tmp102 ; - unsigned int __cil_tmp103 ; - unsigned int __cil_tmp104 ; - unsigned int __cil_tmp105 ; - unsigned int __cil_tmp106 ; - unsigned int __cil_tmp107 ; - unsigned int __cil_tmp108 ; - unsigned int __cil_tmp109 ; - unsigned int __cil_tmp110 ; - unsigned int __cil_tmp111 ; - unsigned int __cil_tmp112 ; - UCHAR __cil_tmp113 ; - int __cil_tmp114 ; - int __cil_tmp115 ; - int __cil_tmp116 ; - int __cil_tmp117 ; - unsigned int __cil_tmp118 ; - unsigned int __cil_tmp119 ; - unsigned int __cil_tmp120 ; - unsigned int __cil_tmp121 ; - UCHAR *__cil_tmp122 ; - unsigned int __cil_tmp123 ; - unsigned int __cil_tmp124 ; - unsigned int __cil_tmp125 ; - unsigned int __cil_tmp126 ; - UCHAR *__cil_tmp127 ; - void *__cil_tmp128 ; - struct _MDL *__cil_tmp129 ; - KUSER_SHARED_DATA *__cil_tmp130 ; - unsigned int __cil_tmp131 ; - unsigned int __cil_tmp132 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp133 ; - int __cil_tmp134 ; - unsigned int __cil_tmp135 ; - unsigned int __cil_tmp136 ; - unsigned int __cil_tmp137 ; - unsigned int __cil_tmp138 ; - UCHAR __cil_tmp139 ; - int __cil_tmp140 ; - unsigned int __cil_tmp141 ; - unsigned int __cil_tmp142 ; - UCHAR __cil_tmp143 ; - int __cil_tmp144 ; - int __cil_tmp145 ; - int __cil_tmp146 ; - int __cil_tmp147 ; - unsigned int __cil_tmp148 ; - unsigned int __cil_tmp149 ; - unsigned int __cil_tmp150 ; - unsigned int __cil_tmp151 ; - UCHAR __cil_tmp152 ; - int __cil_tmp153 ; - unsigned int __cil_tmp154 ; - unsigned int __cil_tmp155 ; - unsigned int __cil_tmp156 ; - unsigned int __cil_tmp157 ; - unsigned int __cil_tmp158 ; - unsigned int __cil_tmp159 ; - UCHAR __cil_tmp160 ; - unsigned int __cil_tmp161 ; - unsigned int __cil_tmp162 ; - unsigned int __cil_tmp163 ; - unsigned int __cil_tmp164 ; - UCHAR __cil_tmp165 ; - unsigned int __cil_tmp166 ; - unsigned int __cil_tmp167 ; - unsigned int __cil_tmp168 ; - unsigned int __cil_tmp169 ; - UCHAR __cil_tmp170 ; - int __cil_tmp171 ; - unsigned int __cil_tmp172 ; - unsigned int __cil_tmp173 ; - unsigned int __cil_tmp174 ; - unsigned int __cil_tmp175 ; - unsigned int __cil_tmp176 ; - unsigned int __cil_tmp177 ; - UCHAR __cil_tmp178 ; - unsigned int __cil_tmp179 ; - unsigned int __cil_tmp180 ; - unsigned int __cil_tmp181 ; - unsigned int __cil_tmp182 ; - UCHAR __cil_tmp183 ; - unsigned int __cil_tmp184 ; - unsigned int __cil_tmp185 ; - unsigned int __cil_tmp186 ; - unsigned int __cil_tmp187 ; - UCHAR __cil_tmp188 ; - int __cil_tmp189 ; - unsigned int __cil_tmp190 ; - unsigned int __cil_tmp191 ; - unsigned int __cil_tmp192 ; - unsigned int __cil_tmp193 ; - unsigned int __cil_tmp194 ; - unsigned int __cil_tmp195 ; - UCHAR __cil_tmp196 ; - unsigned int __cil_tmp197 ; - unsigned int __cil_tmp198 ; - unsigned int __cil_tmp199 ; - unsigned int __cil_tmp200 ; - UCHAR __cil_tmp201 ; - int __cil_tmp202 ; - unsigned int __cil_tmp203 ; - unsigned int __cil_tmp204 ; - unsigned int __cil_tmp205 ; - unsigned int __cil_tmp206 ; - UCHAR __cil_tmp207 ; - int __cil_tmp208 ; - unsigned int __cil_tmp209 ; - unsigned int __cil_tmp210 ; - unsigned int __cil_tmp211 ; - unsigned int __cil_tmp212 ; - unsigned int __cil_tmp213 ; - unsigned int __cil_tmp214 ; - UCHAR __cil_tmp215 ; - unsigned int __cil_tmp216 ; - unsigned int __cil_tmp217 ; - unsigned int __cil_tmp218 ; - unsigned int __cil_tmp219 ; - UCHAR __cil_tmp220 ; - int __cil_tmp221 ; - unsigned int __cil_tmp222 ; - unsigned int __cil_tmp223 ; - unsigned int __cil_tmp224 ; - unsigned int __cil_tmp225 ; - unsigned int __cil_tmp226 ; - unsigned int __cil_tmp227 ; - UCHAR __cil_tmp228 ; - int __cil_tmp229 ; - int __cil_tmp230 ; - int __cil_tmp231 ; - int __cil_tmp232 ; - unsigned int __cil_tmp233 ; - unsigned int __cil_tmp234 ; - unsigned int __cil_tmp235 ; - unsigned int __cil_tmp236 ; - unsigned int __cil_tmp237 ; - unsigned int __cil_tmp238 ; - unsigned int __cil_tmp239 ; - unsigned int __cil_tmp240 ; - unsigned int __cil_tmp241 ; - unsigned int __cil_tmp242 ; - unsigned int __cil_tmp243 ; - unsigned int __cil_tmp244 ; - int __cil_tmp245 ; - int __cil_tmp246 ; - unsigned int __cil_tmp247 ; - unsigned int __cil_tmp248 ; - unsigned int __cil_tmp249 ; - unsigned int __cil_tmp250 ; - unsigned int __cil_tmp251 ; - unsigned int __cil_tmp252 ; - unsigned int __cil_tmp253 ; - unsigned int __cil_tmp254 ; - unsigned int __cil_tmp255 ; - unsigned int __cil_tmp256 ; - int __cil_tmp257 ; - int __cil_tmp258 ; - int __cil_tmp259 ; - unsigned int __cil_tmp260 ; - unsigned int __cil_tmp261 ; - unsigned int __cil_tmp262 ; - unsigned int __cil_tmp263 ; - unsigned int __cil_tmp264 ; - unsigned int __cil_tmp265 ; - unsigned int __cil_tmp266 ; - unsigned int __cil_tmp267 ; - unsigned int __cil_tmp268 ; - unsigned int __cil_tmp269 ; - unsigned int __cil_tmp270 ; - unsigned int __cil_tmp271 ; - unsigned int __cil_tmp272 ; - unsigned int __cil_tmp273 ; - unsigned int __cil_tmp274 ; - unsigned int __cil_tmp275 ; - unsigned int __cil_tmp276 ; - unsigned int __cil_tmp277 ; - unsigned int __cil_tmp278 ; - unsigned int __cil_tmp279 ; - unsigned int __cil_tmp280 ; - unsigned int __cil_tmp281 ; - unsigned int __cil_tmp282 ; - unsigned int __cil_tmp283 ; - UCHAR *__cil_tmp284 ; - unsigned int __cil_tmp285 ; - unsigned int __cil_tmp286 ; - unsigned int __cil_tmp287 ; - unsigned int __cil_tmp288 ; - UCHAR *__cil_tmp289 ; - KUSER_SHARED_DATA *__cil_tmp290 ; - unsigned int __cil_tmp291 ; - unsigned int __cil_tmp292 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp293 ; - int __cil_tmp294 ; - unsigned int __cil_tmp295 ; - unsigned int __cil_tmp296 ; - unsigned int __cil_tmp297 ; - unsigned int __cil_tmp298 ; - UCHAR __cil_tmp299 ; - int __cil_tmp300 ; - unsigned int __cil_tmp301 ; - unsigned int __cil_tmp302 ; - unsigned int __cil_tmp303 ; - unsigned int __cil_tmp304 ; - UCHAR __cil_tmp305 ; - int __cil_tmp306 ; - int __cil_tmp307 ; - unsigned int __cil_tmp308 ; - unsigned int __cil_tmp309 ; - unsigned int __cil_tmp310 ; - unsigned int __cil_tmp311 ; - UCHAR __cil_tmp312 ; - int __cil_tmp313 ; - int __cil_tmp314 ; - unsigned int __cil_tmp315 ; - unsigned int __cil_tmp316 ; - unsigned int __cil_tmp317 ; - unsigned int __cil_tmp318 ; - unsigned int __cil_tmp319 ; - unsigned int __cil_tmp320 ; - UCHAR __cil_tmp321 ; - unsigned int __cil_tmp322 ; - unsigned int __cil_tmp323 ; - unsigned int __cil_tmp324 ; - unsigned int __cil_tmp325 ; - UCHAR __cil_tmp326 ; - unsigned int __cil_tmp327 ; - unsigned int __cil_tmp328 ; - unsigned int __cil_tmp329 ; - unsigned int __cil_tmp330 ; - UCHAR __cil_tmp331 ; - int __cil_tmp332 ; - unsigned int __cil_tmp333 ; - unsigned int __cil_tmp334 ; - unsigned int __cil_tmp335 ; - unsigned int __cil_tmp336 ; - unsigned int __cil_tmp337 ; - unsigned int __cil_tmp338 ; - UCHAR __cil_tmp339 ; - unsigned int __cil_tmp340 ; - unsigned int __cil_tmp341 ; - unsigned int __cil_tmp342 ; - unsigned int __cil_tmp343 ; - UCHAR __cil_tmp344 ; - unsigned int __cil_tmp345 ; - unsigned int __cil_tmp346 ; - unsigned int __cil_tmp347 ; - unsigned int __cil_tmp348 ; - UCHAR __cil_tmp349 ; - int __cil_tmp350 ; - unsigned int __cil_tmp351 ; - unsigned int __cil_tmp352 ; - unsigned int __cil_tmp353 ; - unsigned int __cil_tmp354 ; - unsigned int __cil_tmp355 ; - unsigned int __cil_tmp356 ; - UCHAR __cil_tmp357 ; - unsigned int __cil_tmp358 ; - unsigned int __cil_tmp359 ; - unsigned int __cil_tmp360 ; - unsigned int __cil_tmp361 ; - UCHAR __cil_tmp362 ; - unsigned int __cil_tmp363 ; - unsigned int __cil_tmp364 ; - unsigned int __cil_tmp365 ; - unsigned int __cil_tmp366 ; - UCHAR __cil_tmp367 ; - int __cil_tmp368 ; - unsigned int __cil_tmp369 ; - unsigned int __cil_tmp370 ; - int __cil_tmp371 ; - int __cil_tmp372 ; - int __cil_tmp373 ; - int __cil_tmp374 ; - unsigned long __cil_tmp375 ; - unsigned long __cil_tmp376 ; - ULONG __cil_tmp377 ; - int __cil_tmp378 ; - int __cil_tmp379 ; - int __cil_tmp380 ; - unsigned char __cil_tmp381 ; - int __cil_tmp382 ; - unsigned int __cil_tmp383 ; - unsigned int __cil_tmp384 ; - int __cil_tmp385 ; - int __cil_tmp386 ; - UCHAR *mem_387 ; - UCHAR *mem_388 ; - ULONG *mem_389 ; - LONG *mem_390 ; - BOOLEAN *mem_391 ; - UCHAR *mem_392 ; - UCHAR *mem_393 ; - UCHAR *mem_394 ; - UCHAR *mem_395 ; - UCHAR *mem_396 ; - UCHAR *mem_397 ; - UCHAR *mem_398 ; - BOOLEAN *mem_399 ; - UCHAR *mem_400 ; - UCHAR *mem_401 ; - BOOLEAN *mem_402 ; - UCHAR *mem_403 ; - UCHAR *mem_404 ; - UCHAR *mem_405 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_406 ; - UCHAR *mem_407 ; - UCHAR *mem_408 ; - UCHAR *mem_409 ; - BOOLEAN *mem_410 ; - UCHAR *mem_411 ; - UCHAR *mem_412 ; - UCHAR *mem_413 ; - BOOLEAN *mem_414 ; - UCHAR *mem_415 ; - UCHAR *mem_416 ; - UCHAR *mem_417 ; - BOOLEAN *mem_418 ; - UCHAR *mem_419 ; - UCHAR *mem_420 ; - UCHAR *mem_421 ; - BOOLEAN *mem_422 ; - UCHAR *mem_423 ; - UCHAR *mem_424 ; - UCHAR *mem_425 ; - UCHAR *mem_426 ; - UCHAR *mem_427 ; - UCHAR *mem_428 ; - UCHAR *mem_429 ; - UCHAR *mem_430 ; - UCHAR *mem_431 ; - UCHAR *mem_432 ; - UCHAR *mem_433 ; - UCHAR *mem_434 ; - UCHAR *mem_435 ; - UCHAR *mem_436 ; - UCHAR *mem_437 ; - UCHAR *mem_438 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_439 ; - UCHAR *mem_440 ; - UCHAR *mem_441 ; - UCHAR *mem_442 ; - BOOLEAN *mem_443 ; - UCHAR *mem_444 ; - UCHAR *mem_445 ; - UCHAR *mem_446 ; - BOOLEAN *mem_447 ; - UCHAR *mem_448 ; - UCHAR *mem_449 ; - UCHAR *mem_450 ; - BOOLEAN *mem_451 ; - UCHAR *mem_452 ; - UCHAR *mem_453 ; - UCHAR *mem_454 ; - BOOLEAN *mem_455 ; - BOOLEAN *mem_456 ; +NTSTATUS FlReadWriteTrack(PDISKETTE_EXTENSION DisketteExtension, PMDL IoMdl, + ULONG IoOffset, BOOLEAN WriteOperation, + UCHAR Cylinder, UCHAR Head, UCHAR Sector, + UCHAR NumberOfSectors, BOOLEAN NeedSeek) { + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + ULONG byteToSectorShift; + ULONG transferBytes; + LARGE_INTEGER headSettleTime; + NTSTATUS status; + ULONG seekRetry; + ULONG ioRetry; + BOOLEAN recalibrateDrive; + UCHAR i; + unsigned int __cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + UCHAR __cil_tmp23; + int __cil_tmp24; + int __cil_tmp25; + unsigned long __cil_tmp26; + LARGE_INTEGER *__cil_tmp27; + unsigned int __cil_tmp28; + unsigned int __cil_tmp29; + UCHAR __cil_tmp30; + int __cil_tmp31; + int __cil_tmp32; + int __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + BOOLEAN __cil_tmp38; + unsigned int __cil_tmp39; + unsigned int __cil_tmp40; + UCHAR __cil_tmp41; + int __cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + unsigned int __cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + unsigned int __cil_tmp51; + unsigned int __cil_tmp52; + UCHAR __cil_tmp53; + int __cil_tmp54; + int __cil_tmp55; + int __cil_tmp56; + int __cil_tmp57; + unsigned int __cil_tmp58; + unsigned int __cil_tmp59; + unsigned int __cil_tmp60; + unsigned int __cil_tmp61; + unsigned int __cil_tmp62; + unsigned int __cil_tmp63; + UCHAR __cil_tmp64; + int __cil_tmp65; + int __cil_tmp66; + int __cil_tmp67; + unsigned int __cil_tmp68; + unsigned int __cil_tmp69; + unsigned int __cil_tmp70; + unsigned int __cil_tmp71; + UCHAR *__cil_tmp72; + unsigned int __cil_tmp73; + unsigned int __cil_tmp74; + unsigned int __cil_tmp75; + unsigned int __cil_tmp76; + UCHAR *__cil_tmp77; + void *__cil_tmp78; + struct _MDL *__cil_tmp79; + unsigned int __cil_tmp80; + unsigned int __cil_tmp81; + unsigned int __cil_tmp82; + unsigned int __cil_tmp83; + UCHAR __cil_tmp84; + int __cil_tmp85; + int __cil_tmp86; + unsigned int __cil_tmp87; + unsigned int __cil_tmp88; + unsigned int __cil_tmp89; + unsigned int __cil_tmp90; + UCHAR __cil_tmp91; + int __cil_tmp92; + int __cil_tmp93; + int __cil_tmp94; + unsigned int __cil_tmp95; + unsigned int __cil_tmp96; + unsigned int __cil_tmp97; + unsigned int __cil_tmp98; + UCHAR __cil_tmp99; + int __cil_tmp100; + unsigned int __cil_tmp101; + unsigned int __cil_tmp102; + unsigned int __cil_tmp103; + unsigned int __cil_tmp104; + unsigned int __cil_tmp105; + unsigned int __cil_tmp106; + unsigned int __cil_tmp107; + unsigned int __cil_tmp108; + unsigned int __cil_tmp109; + unsigned int __cil_tmp110; + unsigned int __cil_tmp111; + unsigned int __cil_tmp112; + UCHAR __cil_tmp113; + int __cil_tmp114; + int __cil_tmp115; + int __cil_tmp116; + int __cil_tmp117; + unsigned int __cil_tmp118; + unsigned int __cil_tmp119; + unsigned int __cil_tmp120; + unsigned int __cil_tmp121; + UCHAR *__cil_tmp122; + unsigned int __cil_tmp123; + unsigned int __cil_tmp124; + unsigned int __cil_tmp125; + unsigned int __cil_tmp126; + UCHAR *__cil_tmp127; + void *__cil_tmp128; + struct _MDL *__cil_tmp129; + KUSER_SHARED_DATA *__cil_tmp130; + unsigned int __cil_tmp131; + unsigned int __cil_tmp132; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp133; + int __cil_tmp134; + unsigned int __cil_tmp135; + unsigned int __cil_tmp136; + unsigned int __cil_tmp137; + unsigned int __cil_tmp138; + UCHAR __cil_tmp139; + int __cil_tmp140; + unsigned int __cil_tmp141; + unsigned int __cil_tmp142; + UCHAR __cil_tmp143; + int __cil_tmp144; + int __cil_tmp145; + int __cil_tmp146; + int __cil_tmp147; + unsigned int __cil_tmp148; + unsigned int __cil_tmp149; + unsigned int __cil_tmp150; + unsigned int __cil_tmp151; + UCHAR __cil_tmp152; + int __cil_tmp153; + unsigned int __cil_tmp154; + unsigned int __cil_tmp155; + unsigned int __cil_tmp156; + unsigned int __cil_tmp157; + unsigned int __cil_tmp158; + unsigned int __cil_tmp159; + UCHAR __cil_tmp160; + unsigned int __cil_tmp161; + unsigned int __cil_tmp162; + unsigned int __cil_tmp163; + unsigned int __cil_tmp164; + UCHAR __cil_tmp165; + unsigned int __cil_tmp166; + unsigned int __cil_tmp167; + unsigned int __cil_tmp168; + unsigned int __cil_tmp169; + UCHAR __cil_tmp170; + int __cil_tmp171; + unsigned int __cil_tmp172; + unsigned int __cil_tmp173; + unsigned int __cil_tmp174; + unsigned int __cil_tmp175; + unsigned int __cil_tmp176; + unsigned int __cil_tmp177; + UCHAR __cil_tmp178; + unsigned int __cil_tmp179; + unsigned int __cil_tmp180; + unsigned int __cil_tmp181; + unsigned int __cil_tmp182; + UCHAR __cil_tmp183; + unsigned int __cil_tmp184; + unsigned int __cil_tmp185; + unsigned int __cil_tmp186; + unsigned int __cil_tmp187; + UCHAR __cil_tmp188; + int __cil_tmp189; + unsigned int __cil_tmp190; + unsigned int __cil_tmp191; + unsigned int __cil_tmp192; + unsigned int __cil_tmp193; + unsigned int __cil_tmp194; + unsigned int __cil_tmp195; + UCHAR __cil_tmp196; + unsigned int __cil_tmp197; + unsigned int __cil_tmp198; + unsigned int __cil_tmp199; + unsigned int __cil_tmp200; + UCHAR __cil_tmp201; + int __cil_tmp202; + unsigned int __cil_tmp203; + unsigned int __cil_tmp204; + unsigned int __cil_tmp205; + unsigned int __cil_tmp206; + UCHAR __cil_tmp207; + int __cil_tmp208; + unsigned int __cil_tmp209; + unsigned int __cil_tmp210; + unsigned int __cil_tmp211; + unsigned int __cil_tmp212; + unsigned int __cil_tmp213; + unsigned int __cil_tmp214; + UCHAR __cil_tmp215; + unsigned int __cil_tmp216; + unsigned int __cil_tmp217; + unsigned int __cil_tmp218; + unsigned int __cil_tmp219; + UCHAR __cil_tmp220; + int __cil_tmp221; + unsigned int __cil_tmp222; + unsigned int __cil_tmp223; + unsigned int __cil_tmp224; + unsigned int __cil_tmp225; + unsigned int __cil_tmp226; + unsigned int __cil_tmp227; + UCHAR __cil_tmp228; + int __cil_tmp229; + int __cil_tmp230; + int __cil_tmp231; + int __cil_tmp232; + unsigned int __cil_tmp233; + unsigned int __cil_tmp234; + unsigned int __cil_tmp235; + unsigned int __cil_tmp236; + unsigned int __cil_tmp237; + unsigned int __cil_tmp238; + unsigned int __cil_tmp239; + unsigned int __cil_tmp240; + unsigned int __cil_tmp241; + unsigned int __cil_tmp242; + unsigned int __cil_tmp243; + unsigned int __cil_tmp244; + int __cil_tmp245; + int __cil_tmp246; + unsigned int __cil_tmp247; + unsigned int __cil_tmp248; + unsigned int __cil_tmp249; + unsigned int __cil_tmp250; + unsigned int __cil_tmp251; + unsigned int __cil_tmp252; + unsigned int __cil_tmp253; + unsigned int __cil_tmp254; + unsigned int __cil_tmp255; + unsigned int __cil_tmp256; + int __cil_tmp257; + int __cil_tmp258; + int __cil_tmp259; + unsigned int __cil_tmp260; + unsigned int __cil_tmp261; + unsigned int __cil_tmp262; + unsigned int __cil_tmp263; + unsigned int __cil_tmp264; + unsigned int __cil_tmp265; + unsigned int __cil_tmp266; + unsigned int __cil_tmp267; + unsigned int __cil_tmp268; + unsigned int __cil_tmp269; + unsigned int __cil_tmp270; + unsigned int __cil_tmp271; + unsigned int __cil_tmp272; + unsigned int __cil_tmp273; + unsigned int __cil_tmp274; + unsigned int __cil_tmp275; + unsigned int __cil_tmp276; + unsigned int __cil_tmp277; + unsigned int __cil_tmp278; + unsigned int __cil_tmp279; + unsigned int __cil_tmp280; + unsigned int __cil_tmp281; + unsigned int __cil_tmp282; + unsigned int __cil_tmp283; + UCHAR *__cil_tmp284; + unsigned int __cil_tmp285; + unsigned int __cil_tmp286; + unsigned int __cil_tmp287; + unsigned int __cil_tmp288; + UCHAR *__cil_tmp289; + KUSER_SHARED_DATA *__cil_tmp290; + unsigned int __cil_tmp291; + unsigned int __cil_tmp292; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp293; + int __cil_tmp294; + unsigned int __cil_tmp295; + unsigned int __cil_tmp296; + unsigned int __cil_tmp297; + unsigned int __cil_tmp298; + UCHAR __cil_tmp299; + int __cil_tmp300; + unsigned int __cil_tmp301; + unsigned int __cil_tmp302; + unsigned int __cil_tmp303; + unsigned int __cil_tmp304; + UCHAR __cil_tmp305; + int __cil_tmp306; + int __cil_tmp307; + unsigned int __cil_tmp308; + unsigned int __cil_tmp309; + unsigned int __cil_tmp310; + unsigned int __cil_tmp311; + UCHAR __cil_tmp312; + int __cil_tmp313; + int __cil_tmp314; + unsigned int __cil_tmp315; + unsigned int __cil_tmp316; + unsigned int __cil_tmp317; + unsigned int __cil_tmp318; + unsigned int __cil_tmp319; + unsigned int __cil_tmp320; + UCHAR __cil_tmp321; + unsigned int __cil_tmp322; + unsigned int __cil_tmp323; + unsigned int __cil_tmp324; + unsigned int __cil_tmp325; + UCHAR __cil_tmp326; + unsigned int __cil_tmp327; + unsigned int __cil_tmp328; + unsigned int __cil_tmp329; + unsigned int __cil_tmp330; + UCHAR __cil_tmp331; + int __cil_tmp332; + unsigned int __cil_tmp333; + unsigned int __cil_tmp334; + unsigned int __cil_tmp335; + unsigned int __cil_tmp336; + unsigned int __cil_tmp337; + unsigned int __cil_tmp338; + UCHAR __cil_tmp339; + unsigned int __cil_tmp340; + unsigned int __cil_tmp341; + unsigned int __cil_tmp342; + unsigned int __cil_tmp343; + UCHAR __cil_tmp344; + unsigned int __cil_tmp345; + unsigned int __cil_tmp346; + unsigned int __cil_tmp347; + unsigned int __cil_tmp348; + UCHAR __cil_tmp349; + int __cil_tmp350; + unsigned int __cil_tmp351; + unsigned int __cil_tmp352; + unsigned int __cil_tmp353; + unsigned int __cil_tmp354; + unsigned int __cil_tmp355; + unsigned int __cil_tmp356; + UCHAR __cil_tmp357; + unsigned int __cil_tmp358; + unsigned int __cil_tmp359; + unsigned int __cil_tmp360; + unsigned int __cil_tmp361; + UCHAR __cil_tmp362; + unsigned int __cil_tmp363; + unsigned int __cil_tmp364; + unsigned int __cil_tmp365; + unsigned int __cil_tmp366; + UCHAR __cil_tmp367; + int __cil_tmp368; + unsigned int __cil_tmp369; + unsigned int __cil_tmp370; + int __cil_tmp371; + int __cil_tmp372; + int __cil_tmp373; + int __cil_tmp374; + unsigned long __cil_tmp375; + unsigned long __cil_tmp376; + ULONG __cil_tmp377; + int __cil_tmp378; + int __cil_tmp379; + int __cil_tmp380; + unsigned char __cil_tmp381; + int __cil_tmp382; + unsigned int __cil_tmp383; + unsigned int __cil_tmp384; + int __cil_tmp385; + int __cil_tmp386; + UCHAR *mem_387; + UCHAR *mem_388; + ULONG *mem_389; + LONG *mem_390; + BOOLEAN *mem_391; + UCHAR *mem_392; + UCHAR *mem_393; + UCHAR *mem_394; + UCHAR *mem_395; + UCHAR *mem_396; + UCHAR *mem_397; + UCHAR *mem_398; + BOOLEAN *mem_399; + UCHAR *mem_400; + UCHAR *mem_401; + BOOLEAN *mem_402; + UCHAR *mem_403; + UCHAR *mem_404; + UCHAR *mem_405; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_406; + UCHAR *mem_407; + UCHAR *mem_408; + UCHAR *mem_409; + BOOLEAN *mem_410; + UCHAR *mem_411; + UCHAR *mem_412; + UCHAR *mem_413; + BOOLEAN *mem_414; + UCHAR *mem_415; + UCHAR *mem_416; + UCHAR *mem_417; + BOOLEAN *mem_418; + UCHAR *mem_419; + UCHAR *mem_420; + UCHAR *mem_421; + BOOLEAN *mem_422; + UCHAR *mem_423; + UCHAR *mem_424; + UCHAR *mem_425; + UCHAR *mem_426; + UCHAR *mem_427; + UCHAR *mem_428; + UCHAR *mem_429; + UCHAR *mem_430; + UCHAR *mem_431; + UCHAR *mem_432; + UCHAR *mem_433; + UCHAR *mem_434; + UCHAR *mem_435; + UCHAR *mem_436; + UCHAR *mem_437; + UCHAR *mem_438; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_439; + UCHAR *mem_440; + UCHAR *mem_441; + UCHAR *mem_442; + BOOLEAN *mem_443; + UCHAR *mem_444; + UCHAR *mem_445; + UCHAR *mem_446; + BOOLEAN *mem_447; + UCHAR *mem_448; + UCHAR *mem_449; + UCHAR *mem_450; + BOOLEAN *mem_451; + UCHAR *mem_452; + UCHAR *mem_453; + UCHAR *mem_454; + BOOLEAN *mem_455; + BOOLEAN *mem_456; { #line 4859 - recalibrateDrive = (unsigned char)0; - { + recalibrateDrive = (unsigned char)0; + { #line 4869 - while (1) { - while_143_continue: /* CIL Label */ ; - goto while_143_break; - } - while_143_break: /* CIL Label */ ; - } + while (1) { + while_143_continue: /* CIL Label */; + goto while_143_break; + } + while_143_break: /* CIL Label */; + } #line 4871 - __cil_tmp19 = (unsigned int )DisketteExtension; + __cil_tmp19 = (unsigned int)DisketteExtension; #line 4871 - __cil_tmp20 = __cil_tmp19 + 308; + __cil_tmp20 = __cil_tmp19 + 308; #line 4871 - driveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp20; + driveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp20; #line 4872 - __cil_tmp21 = (unsigned int )driveMediaConstants; + __cil_tmp21 = (unsigned int)driveMediaConstants; #line 4872 - __cil_tmp22 = __cil_tmp21 + 35; + __cil_tmp22 = __cil_tmp21 + 35; #line 4872 - mem_387 = (UCHAR *)__cil_tmp22; + mem_387 = (UCHAR *)__cil_tmp22; #line 4872 - __cil_tmp23 = *mem_387; + __cil_tmp23 = *mem_387; #line 4872 - __cil_tmp24 = (int )__cil_tmp23; + __cil_tmp24 = (int)__cil_tmp23; #line 4872 - __cil_tmp25 = 7 + __cil_tmp24; + __cil_tmp25 = 7 + __cil_tmp24; #line 4872 - byteToSectorShift = (unsigned long )__cil_tmp25; + byteToSectorShift = (unsigned long)__cil_tmp25; #line 4874 - __cil_tmp26 = (unsigned long )NumberOfSectors; + __cil_tmp26 = (unsigned long)NumberOfSectors; #line 4874 - transferBytes = __cil_tmp26 << byteToSectorShift; + transferBytes = __cil_tmp26 << byteToSectorShift; #line 4876 - __cil_tmp27 = & headSettleTime; + __cil_tmp27 = &headSettleTime; #line 4876 - __cil_tmp28 = (unsigned int )driveMediaConstants; + __cil_tmp28 = (unsigned int)driveMediaConstants; #line 4876 - __cil_tmp29 = __cil_tmp28 + 42; + __cil_tmp29 = __cil_tmp28 + 42; #line 4876 - mem_388 = (UCHAR *)__cil_tmp29; + mem_388 = (UCHAR *)__cil_tmp29; #line 4876 - __cil_tmp30 = *mem_388; + __cil_tmp30 = *mem_388; #line 4876 - __cil_tmp31 = (int )__cil_tmp30; + __cil_tmp31 = (int)__cil_tmp30; #line 4876 - __cil_tmp32 = 10000 * __cil_tmp31; + __cil_tmp32 = 10000 * __cil_tmp31; #line 4876 - __cil_tmp33 = - __cil_tmp32; + __cil_tmp33 = -__cil_tmp32; #line 4876 - mem_389 = (ULONG *)__cil_tmp27; + mem_389 = (ULONG *)__cil_tmp27; #line 4876 - *mem_389 = (unsigned long )__cil_tmp33; + *mem_389 = (unsigned long)__cil_tmp33; #line 4877 - __cil_tmp34 = 0 + 4; + __cil_tmp34 = 0 + 4; #line 4877 - __cil_tmp35 = (unsigned int )(& headSettleTime) + __cil_tmp34; + __cil_tmp35 = (unsigned int)(&headSettleTime) + __cil_tmp34; #line 4877 - mem_390 = (LONG *)__cil_tmp35; + mem_390 = (LONG *)__cil_tmp35; #line 4877 - *mem_390 = -1L; + *mem_390 = -1L; #line 4879 - seekRetry = 0UL; + seekRetry = 0UL; #line 4879 - ioRetry = 0UL; - { + ioRetry = 0UL; + { #line 4879 - while (1) { - while_144_continue: /* CIL Label */ ; + while (1) { + while_144_continue: /* CIL Label */; #line 4879 - if (seekRetry < 3UL) { + if (seekRetry < 3UL) { - } else { - goto while_144_break; - } + } else { + goto while_144_break; + } #line 4881 - if (recalibrateDrive) { - { + if (recalibrateDrive) { + { #line 4888 - while (1) { - while_145_continue: /* CIL Label */ ; - goto while_145_break; - } - while_145_break: /* CIL Label */ ; - } - { + while (1) { + while_145_continue: /* CIL Label */; + goto while_145_break; + } + while_145_break: /* CIL Label */; + } + { #line 4889 - FlRecalibrateDrive(DisketteExtension); - } - } else { - - } + FlRecalibrateDrive(DisketteExtension); + } + } else { + } #line 4894 - if (recalibrateDrive) { - goto _L___0; - } else { + if (recalibrateDrive) { + goto _L___0; + } else { #line 4894 - if (NeedSeek) { - { + if (NeedSeek) { + { #line 4894 - __cil_tmp36 = (unsigned int )DisketteExtension; + __cil_tmp36 = (unsigned int)DisketteExtension; #line 4894 - __cil_tmp37 = __cil_tmp36 + 365; + __cil_tmp37 = __cil_tmp36 + 365; #line 4894 - mem_391 = (BOOLEAN *)__cil_tmp37; + mem_391 = (BOOLEAN *)__cil_tmp37; #line 4894 - __cil_tmp38 = *mem_391; + __cil_tmp38 = *mem_391; #line 4894 - if (! __cil_tmp38) { - goto _L___0; - } else { - { + if (!__cil_tmp38) { + goto _L___0; + } else { + { #line 4894 - __cil_tmp39 = (unsigned int )driveMediaConstants; + __cil_tmp39 = (unsigned int)driveMediaConstants; #line 4894 - __cil_tmp40 = __cil_tmp39 + 49; + __cil_tmp40 = __cil_tmp39 + 49; #line 4894 - mem_392 = (UCHAR *)__cil_tmp40; + mem_392 = (UCHAR *)__cil_tmp40; #line 4894 - __cil_tmp41 = *mem_392; + __cil_tmp41 = *mem_392; #line 4894 - __cil_tmp42 = (int )__cil_tmp41; + __cil_tmp42 = (int)__cil_tmp41; #line 4894 - if (__cil_tmp42 != 0) { - _L___0: - { + if (__cil_tmp42 != 0) { + _L___0 : { #line 4899 - __cil_tmp43 = 0 * 1U; + __cil_tmp43 = 0 * 1U; #line 4899 - __cil_tmp44 = 112 + __cil_tmp43; + __cil_tmp44 = 112 + __cil_tmp43; #line 4899 - __cil_tmp45 = (unsigned int )DisketteExtension; + __cil_tmp45 = (unsigned int)DisketteExtension; #line 4899 - __cil_tmp46 = __cil_tmp45 + __cil_tmp44; + __cil_tmp46 = __cil_tmp45 + __cil_tmp44; #line 4899 - mem_393 = (UCHAR *)__cil_tmp46; + mem_393 = (UCHAR *)__cil_tmp46; #line 4899 - *mem_393 = (unsigned char)16; + *mem_393 = (unsigned char)16; #line 4900 - __cil_tmp47 = 1 * 1U; + __cil_tmp47 = 1 * 1U; #line 4900 - __cil_tmp48 = 112 + __cil_tmp47; + __cil_tmp48 = 112 + __cil_tmp47; #line 4900 - __cil_tmp49 = (unsigned int )DisketteExtension; + __cil_tmp49 = (unsigned int)DisketteExtension; #line 4900 - __cil_tmp50 = __cil_tmp49 + __cil_tmp48; + __cil_tmp50 = __cil_tmp49 + __cil_tmp48; #line 4900 - __cil_tmp51 = (unsigned int )DisketteExtension; + __cil_tmp51 = (unsigned int)DisketteExtension; #line 4900 - __cil_tmp52 = __cil_tmp51 + 248; + __cil_tmp52 = __cil_tmp51 + 248; #line 4900 - mem_394 = (UCHAR *)__cil_tmp52; + mem_394 = (UCHAR *)__cil_tmp52; #line 4900 - __cil_tmp53 = *mem_394; + __cil_tmp53 = *mem_394; #line 4900 - __cil_tmp54 = (int )__cil_tmp53; + __cil_tmp54 = (int)__cil_tmp53; #line 4900 - __cil_tmp55 = (int )Head; + __cil_tmp55 = (int)Head; #line 4900 - __cil_tmp56 = __cil_tmp55 << 2; + __cil_tmp56 = __cil_tmp55 << 2; #line 4900 - __cil_tmp57 = __cil_tmp56 | __cil_tmp54; + __cil_tmp57 = __cil_tmp56 | __cil_tmp54; #line 4900 - mem_395 = (UCHAR *)__cil_tmp50; + mem_395 = (UCHAR *)__cil_tmp50; #line 4900 - *mem_395 = (unsigned char )__cil_tmp57; + *mem_395 = (unsigned char)__cil_tmp57; #line 4902 - __cil_tmp58 = 2 * 1U; + __cil_tmp58 = 2 * 1U; #line 4902 - __cil_tmp59 = 112 + __cil_tmp58; + __cil_tmp59 = 112 + __cil_tmp58; #line 4902 - __cil_tmp60 = (unsigned int )DisketteExtension; + __cil_tmp60 = (unsigned int)DisketteExtension; #line 4902 - __cil_tmp61 = __cil_tmp60 + __cil_tmp59; + __cil_tmp61 = __cil_tmp60 + __cil_tmp59; #line 4902 - __cil_tmp62 = (unsigned int )driveMediaConstants; + __cil_tmp62 = (unsigned int)driveMediaConstants; #line 4902 - __cil_tmp63 = __cil_tmp62 + 49; + __cil_tmp63 = __cil_tmp62 + 49; #line 4902 - mem_396 = (UCHAR *)__cil_tmp63; + mem_396 = (UCHAR *)__cil_tmp63; #line 4902 - __cil_tmp64 = *mem_396; + __cil_tmp64 = *mem_396; #line 4902 - __cil_tmp65 = (int )__cil_tmp64; + __cil_tmp65 = (int)__cil_tmp64; #line 4902 - __cil_tmp66 = (int )Cylinder; + __cil_tmp66 = (int)Cylinder; #line 4902 - __cil_tmp67 = __cil_tmp66 << __cil_tmp65; + __cil_tmp67 = __cil_tmp66 << __cil_tmp65; #line 4902 - mem_397 = (UCHAR *)__cil_tmp61; + mem_397 = (UCHAR *)__cil_tmp61; #line 4902 - *mem_397 = (unsigned char )__cil_tmp67; + *mem_397 = (unsigned char)__cil_tmp67; #line 4905 - __cil_tmp68 = 0 * 1U; + __cil_tmp68 = 0 * 1U; #line 4905 - __cil_tmp69 = 112 + __cil_tmp68; + __cil_tmp69 = 112 + __cil_tmp68; #line 4905 - __cil_tmp70 = (unsigned int )DisketteExtension; + __cil_tmp70 = (unsigned int)DisketteExtension; #line 4905 - __cil_tmp71 = __cil_tmp70 + __cil_tmp69; + __cil_tmp71 = __cil_tmp70 + __cil_tmp69; #line 4905 - __cil_tmp72 = (UCHAR *)__cil_tmp71; + __cil_tmp72 = (UCHAR *)__cil_tmp71; #line 4905 - __cil_tmp73 = 0 * 1U; + __cil_tmp73 = 0 * 1U; #line 4905 - __cil_tmp74 = 112 + __cil_tmp73; + __cil_tmp74 = 112 + __cil_tmp73; #line 4905 - __cil_tmp75 = (unsigned int )DisketteExtension; + __cil_tmp75 = (unsigned int)DisketteExtension; #line 4905 - __cil_tmp76 = __cil_tmp75 + __cil_tmp74; + __cil_tmp76 = __cil_tmp75 + __cil_tmp74; #line 4905 - __cil_tmp77 = (UCHAR *)__cil_tmp76; + __cil_tmp77 = (UCHAR *)__cil_tmp76; #line 4905 - __cil_tmp78 = (void *)0; + __cil_tmp78 = (void *)0; #line 4905 - __cil_tmp79 = (struct _MDL *)__cil_tmp78; + __cil_tmp79 = (struct _MDL *)__cil_tmp78; #line 4905 - status = FlIssueCommand(DisketteExtension, __cil_tmp72, __cil_tmp77, __cil_tmp79, - 0UL, 0UL); - } + status = FlIssueCommand(DisketteExtension, __cil_tmp72, + __cil_tmp77, __cil_tmp79, 0UL, 0UL); + } #line 4912 - if (status >= 0L) { - { + if (status >= 0L) { + { #line 4916 - __cil_tmp80 = 0 * 1U; + __cil_tmp80 = 0 * 1U; #line 4916 - __cil_tmp81 = 112 + __cil_tmp80; + __cil_tmp81 = 112 + __cil_tmp80; #line 4916 - __cil_tmp82 = (unsigned int )DisketteExtension; + __cil_tmp82 = (unsigned int)DisketteExtension; #line 4916 - __cil_tmp83 = __cil_tmp82 + __cil_tmp81; + __cil_tmp83 = __cil_tmp82 + __cil_tmp81; #line 4916 - mem_398 = (UCHAR *)__cil_tmp83; + mem_398 = (UCHAR *)__cil_tmp83; #line 4916 - __cil_tmp84 = *mem_398; + __cil_tmp84 = *mem_398; #line 4916 - __cil_tmp85 = (int )__cil_tmp84; + __cil_tmp85 = (int)__cil_tmp84; #line 4916 - __cil_tmp86 = __cil_tmp85 & 32; + __cil_tmp86 = __cil_tmp85 & 32; #line 4916 - if (! __cil_tmp86) { + if (!__cil_tmp86) { #line 4920 - __cil_tmp87 = (unsigned int )DisketteExtension; + __cil_tmp87 = (unsigned int)DisketteExtension; #line 4920 - __cil_tmp88 = __cil_tmp87 + 104; + __cil_tmp88 = __cil_tmp87 + 104; #line 4920 - mem_399 = (BOOLEAN *)__cil_tmp88; + mem_399 = (BOOLEAN *)__cil_tmp88; #line 4920 - *mem_399 = (unsigned char)1; + *mem_399 = (unsigned char)1; #line 4921 - status = -1073741464L; - } else { - { + status = -1073741464L; + } else { + { #line 4916 - __cil_tmp89 = (unsigned int )driveMediaConstants; + __cil_tmp89 = (unsigned int)driveMediaConstants; #line 4916 - __cil_tmp90 = __cil_tmp89 + 49; + __cil_tmp90 = __cil_tmp89 + 49; #line 4916 - mem_400 = (UCHAR *)__cil_tmp90; + mem_400 = (UCHAR *)__cil_tmp90; #line 4916 - __cil_tmp91 = *mem_400; + __cil_tmp91 = *mem_400; #line 4916 - __cil_tmp92 = (int )__cil_tmp91; + __cil_tmp92 = (int)__cil_tmp91; #line 4916 - __cil_tmp93 = (int )Cylinder; + __cil_tmp93 = (int)Cylinder; #line 4916 - __cil_tmp94 = __cil_tmp93 << __cil_tmp92; + __cil_tmp94 = __cil_tmp93 << __cil_tmp92; #line 4916 - __cil_tmp95 = 1 * 1U; + __cil_tmp95 = 1 * 1U; #line 4916 - __cil_tmp96 = 112 + __cil_tmp95; + __cil_tmp96 = 112 + __cil_tmp95; #line 4916 - __cil_tmp97 = (unsigned int )DisketteExtension; + __cil_tmp97 = (unsigned int)DisketteExtension; #line 4916 - __cil_tmp98 = __cil_tmp97 + __cil_tmp96; + __cil_tmp98 = __cil_tmp97 + __cil_tmp96; #line 4916 - mem_401 = (UCHAR *)__cil_tmp98; + mem_401 = (UCHAR *)__cil_tmp98; #line 4916 - __cil_tmp99 = *mem_401; + __cil_tmp99 = *mem_401; #line 4916 - __cil_tmp100 = (int )__cil_tmp99; + __cil_tmp100 = (int)__cil_tmp99; #line 4916 - if (__cil_tmp100 != __cil_tmp94) { + if (__cil_tmp100 != __cil_tmp94) { #line 4920 - __cil_tmp101 = (unsigned int )DisketteExtension; + __cil_tmp101 = (unsigned int)DisketteExtension; #line 4920 - __cil_tmp102 = __cil_tmp101 + 104; + __cil_tmp102 = __cil_tmp101 + 104; #line 4920 - mem_402 = (BOOLEAN *)__cil_tmp102; + mem_402 = (BOOLEAN *)__cil_tmp102; #line 4920 - *mem_402 = (unsigned char)1; + *mem_402 = (unsigned char)1; #line 4921 - status = -1073741464L; - } else { - - } - } - } - } + status = -1073741464L; + } else { + } + } + } + } #line 4924 - if (status >= 0L) { - { + if (status >= 0L) { + { #line 4928 - KeDelayExecutionThread((char)0, (unsigned char)0, & headSettleTime); + KeDelayExecutionThread((char)0, (unsigned char)0, + &headSettleTime); #line 4932 - __cil_tmp103 = 0 * 1U; + __cil_tmp103 = 0 * 1U; #line 4932 - __cil_tmp104 = 112 + __cil_tmp103; + __cil_tmp104 = 112 + __cil_tmp103; #line 4932 - __cil_tmp105 = (unsigned int )DisketteExtension; + __cil_tmp105 = (unsigned int)DisketteExtension; #line 4932 - __cil_tmp106 = __cil_tmp105 + __cil_tmp104; + __cil_tmp106 = __cil_tmp105 + __cil_tmp104; #line 4932 - mem_403 = (UCHAR *)__cil_tmp106; + mem_403 = (UCHAR *)__cil_tmp106; #line 4932 - *mem_403 = (unsigned char)84; + *mem_403 = (unsigned char)84; #line 4934 - __cil_tmp107 = 1 * 1U; + __cil_tmp107 = 1 * 1U; #line 4934 - __cil_tmp108 = 112 + __cil_tmp107; + __cil_tmp108 = 112 + __cil_tmp107; #line 4934 - __cil_tmp109 = (unsigned int )DisketteExtension; + __cil_tmp109 = (unsigned int)DisketteExtension; #line 4934 - __cil_tmp110 = __cil_tmp109 + __cil_tmp108; + __cil_tmp110 = __cil_tmp109 + __cil_tmp108; #line 4934 - __cil_tmp111 = (unsigned int )DisketteExtension; + __cil_tmp111 = (unsigned int)DisketteExtension; #line 4934 - __cil_tmp112 = __cil_tmp111 + 248; + __cil_tmp112 = __cil_tmp111 + 248; #line 4934 - mem_404 = (UCHAR *)__cil_tmp112; + mem_404 = (UCHAR *)__cil_tmp112; #line 4934 - __cil_tmp113 = *mem_404; + __cil_tmp113 = *mem_404; #line 4934 - __cil_tmp114 = (int )__cil_tmp113; + __cil_tmp114 = (int)__cil_tmp113; #line 4934 - __cil_tmp115 = (int )Head; + __cil_tmp115 = (int)Head; #line 4934 - __cil_tmp116 = __cil_tmp115 << 2; + __cil_tmp116 = __cil_tmp115 << 2; #line 4934 - __cil_tmp117 = __cil_tmp116 | __cil_tmp114; + __cil_tmp117 = __cil_tmp116 | __cil_tmp114; #line 4934 - mem_405 = (UCHAR *)__cil_tmp110; + mem_405 = (UCHAR *)__cil_tmp110; #line 4934 - *mem_405 = (unsigned char )__cil_tmp117; + *mem_405 = (unsigned char)__cil_tmp117; #line 4937 - __cil_tmp118 = 0 * 1U; + __cil_tmp118 = 0 * 1U; #line 4937 - __cil_tmp119 = 112 + __cil_tmp118; + __cil_tmp119 = 112 + __cil_tmp118; #line 4937 - __cil_tmp120 = (unsigned int )DisketteExtension; + __cil_tmp120 = (unsigned int)DisketteExtension; #line 4937 - __cil_tmp121 = __cil_tmp120 + __cil_tmp119; + __cil_tmp121 = __cil_tmp120 + __cil_tmp119; #line 4937 - __cil_tmp122 = (UCHAR *)__cil_tmp121; + __cil_tmp122 = (UCHAR *)__cil_tmp121; #line 4937 - __cil_tmp123 = 0 * 1U; + __cil_tmp123 = 0 * 1U; #line 4937 - __cil_tmp124 = 112 + __cil_tmp123; + __cil_tmp124 = 112 + __cil_tmp123; #line 4937 - __cil_tmp125 = (unsigned int )DisketteExtension; + __cil_tmp125 = (unsigned int)DisketteExtension; #line 4937 - __cil_tmp126 = __cil_tmp125 + __cil_tmp124; + __cil_tmp126 = __cil_tmp125 + __cil_tmp124; #line 4937 - __cil_tmp127 = (UCHAR *)__cil_tmp126; + __cil_tmp127 = (UCHAR *)__cil_tmp126; #line 4937 - __cil_tmp128 = (void *)0; + __cil_tmp128 = (void *)0; #line 4937 - __cil_tmp129 = (struct _MDL *)__cil_tmp128; + __cil_tmp129 = (struct _MDL *)__cil_tmp128; #line 4937 - status = FlIssueCommand(DisketteExtension, __cil_tmp122, __cil_tmp127, - __cil_tmp129, 0UL, 0UL); - } + status = FlIssueCommand(DisketteExtension, + __cil_tmp122, __cil_tmp127, + __cil_tmp129, 0UL, 0UL); + } #line 4944 - if (status >= 0L) { - { + if (status >= 0L) { + { #line 4946 - __cil_tmp130 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp130 = + (KUSER_SHARED_DATA * const)4292804608U; #line 4946 - __cil_tmp131 = (unsigned int )__cil_tmp130; + __cil_tmp131 = (unsigned int)__cil_tmp130; #line 4946 - __cil_tmp132 = __cil_tmp131 + 732; + __cil_tmp132 = __cil_tmp131 + 732; #line 4946 - mem_406 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp132; + mem_406 = + (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp132; #line 4946 - __cil_tmp133 = *mem_406; + __cil_tmp133 = *mem_406; #line 4946 - __cil_tmp134 = (int )__cil_tmp133; + __cil_tmp134 = (int)__cil_tmp133; #line 4946 - if (__cil_tmp134 == 1) { - { + if (__cil_tmp134 == 1) { + { #line 4947 - __cil_tmp135 = 0 * 1U; + __cil_tmp135 = 0 * 1U; #line 4947 - __cil_tmp136 = 112 + __cil_tmp135; + __cil_tmp136 = 112 + __cil_tmp135; #line 4947 - __cil_tmp137 = (unsigned int )DisketteExtension; + __cil_tmp137 = (unsigned int)DisketteExtension; #line 4947 - __cil_tmp138 = __cil_tmp137 + __cil_tmp136; + __cil_tmp138 = __cil_tmp137 + __cil_tmp136; #line 4947 - mem_407 = (UCHAR *)__cil_tmp138; + mem_407 = (UCHAR *)__cil_tmp138; #line 4947 - __cil_tmp139 = *mem_407; + __cil_tmp139 = *mem_407; #line 4947 - __cil_tmp140 = (int )__cil_tmp139; + __cil_tmp140 = (int)__cil_tmp139; #line 4947 - if (__cil_tmp140 & 8) { + if (__cil_tmp140 & 8) { #line 4948 - return (-1073741661L); - } else { - - } - } - } else { - - } - } - { + return (-1073741661L); + } else { + } + } + } else { + } + } + { #line 4952 - __cil_tmp141 = (unsigned int )DisketteExtension; + __cil_tmp141 = (unsigned int)DisketteExtension; #line 4952 - __cil_tmp142 = __cil_tmp141 + 248; + __cil_tmp142 = __cil_tmp141 + 248; #line 4952 - mem_408 = (UCHAR *)__cil_tmp142; + mem_408 = (UCHAR *)__cil_tmp142; #line 4952 - __cil_tmp143 = *mem_408; + __cil_tmp143 = *mem_408; #line 4952 - __cil_tmp144 = (int )__cil_tmp143; + __cil_tmp144 = (int)__cil_tmp143; #line 4952 - __cil_tmp145 = (int )Head; + __cil_tmp145 = (int)Head; #line 4952 - __cil_tmp146 = __cil_tmp145 << 2; + __cil_tmp146 = __cil_tmp145 << 2; #line 4952 - __cil_tmp147 = __cil_tmp146 | __cil_tmp144; + __cil_tmp147 = __cil_tmp146 | __cil_tmp144; #line 4952 - __cil_tmp148 = 0 * 1U; + __cil_tmp148 = 0 * 1U; #line 4952 - __cil_tmp149 = 112 + __cil_tmp148; + __cil_tmp149 = 112 + __cil_tmp148; #line 4952 - __cil_tmp150 = (unsigned int )DisketteExtension; + __cil_tmp150 = (unsigned int)DisketteExtension; #line 4952 - __cil_tmp151 = __cil_tmp150 + __cil_tmp149; + __cil_tmp151 = __cil_tmp150 + __cil_tmp149; #line 4952 - mem_409 = (UCHAR *)__cil_tmp151; + mem_409 = (UCHAR *)__cil_tmp151; #line 4952 - __cil_tmp152 = *mem_409; + __cil_tmp152 = *mem_409; #line 4952 - __cil_tmp153 = (int )__cil_tmp152; + __cil_tmp153 = (int)__cil_tmp152; #line 4952 - if (__cil_tmp153 != __cil_tmp147) { - { + if (__cil_tmp153 != __cil_tmp147) { + { #line 4958 - __cil_tmp154 = (unsigned int )DisketteExtension; + __cil_tmp154 = (unsigned int)DisketteExtension; #line 4958 - __cil_tmp155 = __cil_tmp154 + 104; + __cil_tmp155 = __cil_tmp154 + 104; #line 4958 - mem_410 = (BOOLEAN *)__cil_tmp155; + mem_410 = (BOOLEAN *)__cil_tmp155; #line 4958 - *mem_410 = (unsigned char)1; + *mem_410 = (unsigned char)1; #line 4960 - __cil_tmp156 = 1 * 1U; + __cil_tmp156 = 1 * 1U; #line 4960 - __cil_tmp157 = 112 + __cil_tmp156; + __cil_tmp157 = 112 + __cil_tmp156; #line 4960 - __cil_tmp158 = (unsigned int )DisketteExtension; + __cil_tmp158 = (unsigned int)DisketteExtension; #line 4960 - __cil_tmp159 = __cil_tmp158 + __cil_tmp157; + __cil_tmp159 = __cil_tmp158 + __cil_tmp157; #line 4960 - mem_411 = (UCHAR *)__cil_tmp159; + mem_411 = (UCHAR *)__cil_tmp159; #line 4960 - __cil_tmp160 = *mem_411; + __cil_tmp160 = *mem_411; #line 4960 - __cil_tmp161 = 2 * 1U; + __cil_tmp161 = 2 * 1U; #line 4960 - __cil_tmp162 = 112 + __cil_tmp161; + __cil_tmp162 = 112 + __cil_tmp161; #line 4960 - __cil_tmp163 = (unsigned int )DisketteExtension; + __cil_tmp163 = (unsigned int)DisketteExtension; #line 4960 - __cil_tmp164 = __cil_tmp163 + __cil_tmp162; + __cil_tmp164 = __cil_tmp163 + __cil_tmp162; #line 4960 - mem_412 = (UCHAR *)__cil_tmp164; + mem_412 = (UCHAR *)__cil_tmp164; #line 4960 - __cil_tmp165 = *mem_412; + __cil_tmp165 = *mem_412; #line 4960 - status = FlInterpretError(__cil_tmp160, __cil_tmp165); - } - } else { - { + status = FlInterpretError(__cil_tmp160, + __cil_tmp165); + } + } else { + { #line 4952 - __cil_tmp166 = 1 * 1U; + __cil_tmp166 = 1 * 1U; #line 4952 - __cil_tmp167 = 112 + __cil_tmp166; + __cil_tmp167 = 112 + __cil_tmp166; #line 4952 - __cil_tmp168 = (unsigned int )DisketteExtension; + __cil_tmp168 = (unsigned int)DisketteExtension; #line 4952 - __cil_tmp169 = __cil_tmp168 + __cil_tmp167; + __cil_tmp169 = __cil_tmp168 + __cil_tmp167; #line 4952 - mem_413 = (UCHAR *)__cil_tmp169; + mem_413 = (UCHAR *)__cil_tmp169; #line 4952 - __cil_tmp170 = *mem_413; + __cil_tmp170 = *mem_413; #line 4952 - __cil_tmp171 = (int )__cil_tmp170; + __cil_tmp171 = (int)__cil_tmp170; #line 4952 - if (__cil_tmp171 != 0) { - { + if (__cil_tmp171 != 0) { + { #line 4958 - __cil_tmp172 = (unsigned int )DisketteExtension; + __cil_tmp172 = + (unsigned int)DisketteExtension; #line 4958 - __cil_tmp173 = __cil_tmp172 + 104; + __cil_tmp173 = __cil_tmp172 + 104; #line 4958 - mem_414 = (BOOLEAN *)__cil_tmp173; + mem_414 = (BOOLEAN *)__cil_tmp173; #line 4958 - *mem_414 = (unsigned char)1; + *mem_414 = (unsigned char)1; #line 4960 - __cil_tmp174 = 1 * 1U; + __cil_tmp174 = 1 * 1U; #line 4960 - __cil_tmp175 = 112 + __cil_tmp174; + __cil_tmp175 = 112 + __cil_tmp174; #line 4960 - __cil_tmp176 = (unsigned int )DisketteExtension; + __cil_tmp176 = + (unsigned int)DisketteExtension; #line 4960 - __cil_tmp177 = __cil_tmp176 + __cil_tmp175; + __cil_tmp177 = __cil_tmp176 + __cil_tmp175; #line 4960 - mem_415 = (UCHAR *)__cil_tmp177; + mem_415 = (UCHAR *)__cil_tmp177; #line 4960 - __cil_tmp178 = *mem_415; + __cil_tmp178 = *mem_415; #line 4960 - __cil_tmp179 = 2 * 1U; + __cil_tmp179 = 2 * 1U; #line 4960 - __cil_tmp180 = 112 + __cil_tmp179; + __cil_tmp180 = 112 + __cil_tmp179; #line 4960 - __cil_tmp181 = (unsigned int )DisketteExtension; + __cil_tmp181 = + (unsigned int)DisketteExtension; #line 4960 - __cil_tmp182 = __cil_tmp181 + __cil_tmp180; + __cil_tmp182 = __cil_tmp181 + __cil_tmp180; #line 4960 - mem_416 = (UCHAR *)__cil_tmp182; + mem_416 = (UCHAR *)__cil_tmp182; #line 4960 - __cil_tmp183 = *mem_416; + __cil_tmp183 = *mem_416; #line 4960 - status = FlInterpretError(__cil_tmp178, __cil_tmp183); - } - } else { - { + status = FlInterpretError(__cil_tmp178, + __cil_tmp183); + } + } else { + { #line 4952 - __cil_tmp184 = 2 * 1U; + __cil_tmp184 = 2 * 1U; #line 4952 - __cil_tmp185 = 112 + __cil_tmp184; + __cil_tmp185 = 112 + __cil_tmp184; #line 4952 - __cil_tmp186 = (unsigned int )DisketteExtension; + __cil_tmp186 = + (unsigned int)DisketteExtension; #line 4952 - __cil_tmp187 = __cil_tmp186 + __cil_tmp185; + __cil_tmp187 = __cil_tmp186 + __cil_tmp185; #line 4952 - mem_417 = (UCHAR *)__cil_tmp187; + mem_417 = (UCHAR *)__cil_tmp187; #line 4952 - __cil_tmp188 = *mem_417; + __cil_tmp188 = *mem_417; #line 4952 - __cil_tmp189 = (int )__cil_tmp188; + __cil_tmp189 = (int)__cil_tmp188; #line 4952 - if (__cil_tmp189 != 0) { - { + if (__cil_tmp189 != 0) { + { #line 4958 - __cil_tmp190 = (unsigned int )DisketteExtension; + __cil_tmp190 = + (unsigned int)DisketteExtension; #line 4958 - __cil_tmp191 = __cil_tmp190 + 104; + __cil_tmp191 = __cil_tmp190 + 104; #line 4958 - mem_418 = (BOOLEAN *)__cil_tmp191; + mem_418 = (BOOLEAN *)__cil_tmp191; #line 4958 - *mem_418 = (unsigned char)1; + *mem_418 = (unsigned char)1; #line 4960 - __cil_tmp192 = 1 * 1U; + __cil_tmp192 = 1 * 1U; #line 4960 - __cil_tmp193 = 112 + __cil_tmp192; + __cil_tmp193 = 112 + __cil_tmp192; #line 4960 - __cil_tmp194 = (unsigned int )DisketteExtension; + __cil_tmp194 = + (unsigned int)DisketteExtension; #line 4960 - __cil_tmp195 = __cil_tmp194 + __cil_tmp193; + __cil_tmp195 = + __cil_tmp194 + __cil_tmp193; #line 4960 - mem_419 = (UCHAR *)__cil_tmp195; + mem_419 = (UCHAR *)__cil_tmp195; #line 4960 - __cil_tmp196 = *mem_419; + __cil_tmp196 = *mem_419; #line 4960 - __cil_tmp197 = 2 * 1U; + __cil_tmp197 = 2 * 1U; #line 4960 - __cil_tmp198 = 112 + __cil_tmp197; + __cil_tmp198 = 112 + __cil_tmp197; #line 4960 - __cil_tmp199 = (unsigned int )DisketteExtension; + __cil_tmp199 = + (unsigned int)DisketteExtension; #line 4960 - __cil_tmp200 = __cil_tmp199 + __cil_tmp198; + __cil_tmp200 = + __cil_tmp199 + __cil_tmp198; #line 4960 - mem_420 = (UCHAR *)__cil_tmp200; + mem_420 = (UCHAR *)__cil_tmp200; #line 4960 - __cil_tmp201 = *mem_420; + __cil_tmp201 = *mem_420; #line 4960 - status = FlInterpretError(__cil_tmp196, __cil_tmp201); - } - } else { - { + status = FlInterpretError(__cil_tmp196, + __cil_tmp201); + } + } else { + { #line 4952 - __cil_tmp202 = (int )Cylinder; + __cil_tmp202 = (int)Cylinder; #line 4952 - __cil_tmp203 = 3 * 1U; + __cil_tmp203 = 3 * 1U; #line 4952 - __cil_tmp204 = 112 + __cil_tmp203; + __cil_tmp204 = 112 + __cil_tmp203; #line 4952 - __cil_tmp205 = (unsigned int )DisketteExtension; + __cil_tmp205 = + (unsigned int)DisketteExtension; #line 4952 - __cil_tmp206 = __cil_tmp205 + __cil_tmp204; + __cil_tmp206 = + __cil_tmp205 + __cil_tmp204; #line 4952 - mem_421 = (UCHAR *)__cil_tmp206; + mem_421 = (UCHAR *)__cil_tmp206; #line 4952 - __cil_tmp207 = *mem_421; + __cil_tmp207 = *mem_421; #line 4952 - __cil_tmp208 = (int )__cil_tmp207; + __cil_tmp208 = (int)__cil_tmp207; #line 4952 - if (__cil_tmp208 != __cil_tmp202) { - { + if (__cil_tmp208 != __cil_tmp202) { + { #line 4958 - __cil_tmp209 = (unsigned int )DisketteExtension; + __cil_tmp209 = + (unsigned int)DisketteExtension; #line 4958 - __cil_tmp210 = __cil_tmp209 + 104; + __cil_tmp210 = __cil_tmp209 + 104; #line 4958 - mem_422 = (BOOLEAN *)__cil_tmp210; + mem_422 = (BOOLEAN *)__cil_tmp210; #line 4958 - *mem_422 = (unsigned char)1; + *mem_422 = (unsigned char)1; #line 4960 - __cil_tmp211 = 1 * 1U; + __cil_tmp211 = 1 * 1U; #line 4960 - __cil_tmp212 = 112 + __cil_tmp211; + __cil_tmp212 = 112 + __cil_tmp211; #line 4960 - __cil_tmp213 = (unsigned int )DisketteExtension; + __cil_tmp213 = + (unsigned int)DisketteExtension; #line 4960 - __cil_tmp214 = __cil_tmp213 + __cil_tmp212; + __cil_tmp214 = + __cil_tmp213 + __cil_tmp212; #line 4960 - mem_423 = (UCHAR *)__cil_tmp214; + mem_423 = (UCHAR *)__cil_tmp214; #line 4960 - __cil_tmp215 = *mem_423; + __cil_tmp215 = *mem_423; #line 4960 - __cil_tmp216 = 2 * 1U; + __cil_tmp216 = 2 * 1U; #line 4960 - __cil_tmp217 = 112 + __cil_tmp216; + __cil_tmp217 = 112 + __cil_tmp216; #line 4960 - __cil_tmp218 = (unsigned int )DisketteExtension; + __cil_tmp218 = + (unsigned int)DisketteExtension; #line 4960 - __cil_tmp219 = __cil_tmp218 + __cil_tmp217; + __cil_tmp219 = + __cil_tmp218 + __cil_tmp217; #line 4960 - mem_424 = (UCHAR *)__cil_tmp219; + mem_424 = (UCHAR *)__cil_tmp219; #line 4960 - __cil_tmp220 = *mem_424; + __cil_tmp220 = *mem_424; #line 4960 - status = FlInterpretError(__cil_tmp215, __cil_tmp220); + status = FlInterpretError( + __cil_tmp215, __cil_tmp220); + } + } else { + } + } + } + } + } + } + } } } else { - - } + { +#line 4968 + while (1) { + while_146_continue: /* CIL Label */; + goto while_146_break; + } + while_146_break: /* CIL Label */; + } } + } else { } - } - } - } - } - } - } else { - { -#line 4968 - while (1) { - while_146_continue: /* CIL Label */ ; - goto while_146_break; - } - while_146_break: /* CIL Label */ ; - } - } - } else { - - } - } else { - { + } else { + { #line 4975 - while (1) { - while_147_continue: /* CIL Label */ ; - goto while_147_break; - } - while_147_break: /* CIL Label */ ; + while (1) { + while_147_continue: /* CIL Label */; + goto while_147_break; + } + while_147_break: /* CIL Label */; + } + } + } else { +#line 4980 + status = 0L; + } + } } } } else { #line 4980 status = 0L; } - } } - } - } else { -#line 4980 - status = 0L; - } - } - { + { #line 4983 - __cil_tmp221 = status >= 0L; + __cil_tmp221 = status >= 0L; #line 4983 - if (! __cil_tmp221) { - { + if (!__cil_tmp221) { + { #line 4990 - while (1) { - while_148_continue: /* CIL Label */ ; - goto while_148_break; - } - while_148_break: /* CIL Label */ ; - } + while (1) { + while_148_continue: /* CIL Label */; + goto while_148_break; + } + while_148_break: /* CIL Label */; + } #line 4991 - recalibrateDrive = (unsigned char)1; - goto __Cont; - } else { - - } - } - { + recalibrateDrive = (unsigned char)1; + goto __Cont; + } else { + } + } + { #line 4995 - while (1) { - while_149_continue: /* CIL Label */ ; + while (1) { + while_149_continue: /* CIL Label */; #line 5001 - __cil_tmp222 = 1 * 1U; + __cil_tmp222 = 1 * 1U; #line 5001 - __cil_tmp223 = 112 + __cil_tmp222; + __cil_tmp223 = 112 + __cil_tmp222; #line 5001 - __cil_tmp224 = (unsigned int )DisketteExtension; + __cil_tmp224 = (unsigned int)DisketteExtension; #line 5001 - __cil_tmp225 = __cil_tmp224 + __cil_tmp223; + __cil_tmp225 = __cil_tmp224 + __cil_tmp223; #line 5001 - __cil_tmp226 = (unsigned int )DisketteExtension; + __cil_tmp226 = (unsigned int)DisketteExtension; #line 5001 - __cil_tmp227 = __cil_tmp226 + 248; + __cil_tmp227 = __cil_tmp226 + 248; #line 5001 - mem_425 = (UCHAR *)__cil_tmp227; + mem_425 = (UCHAR *)__cil_tmp227; #line 5001 - __cil_tmp228 = *mem_425; + __cil_tmp228 = *mem_425; #line 5001 - __cil_tmp229 = (int )__cil_tmp228; + __cil_tmp229 = (int)__cil_tmp228; #line 5001 - __cil_tmp230 = (int )Head; + __cil_tmp230 = (int)Head; #line 5001 - __cil_tmp231 = __cil_tmp230 << 2; + __cil_tmp231 = __cil_tmp230 << 2; #line 5001 - __cil_tmp232 = __cil_tmp231 | __cil_tmp229; + __cil_tmp232 = __cil_tmp231 | __cil_tmp229; #line 5001 - mem_426 = (UCHAR *)__cil_tmp225; + mem_426 = (UCHAR *)__cil_tmp225; #line 5001 - *mem_426 = (unsigned char )__cil_tmp232; + *mem_426 = (unsigned char)__cil_tmp232; #line 5003 - __cil_tmp233 = 2 * 1U; + __cil_tmp233 = 2 * 1U; #line 5003 - __cil_tmp234 = 112 + __cil_tmp233; + __cil_tmp234 = 112 + __cil_tmp233; #line 5003 - __cil_tmp235 = (unsigned int )DisketteExtension; + __cil_tmp235 = (unsigned int)DisketteExtension; #line 5003 - __cil_tmp236 = __cil_tmp235 + __cil_tmp234; + __cil_tmp236 = __cil_tmp235 + __cil_tmp234; #line 5003 - mem_427 = (UCHAR *)__cil_tmp236; + mem_427 = (UCHAR *)__cil_tmp236; #line 5003 - *mem_427 = Cylinder; + *mem_427 = Cylinder; #line 5004 - __cil_tmp237 = 3 * 1U; + __cil_tmp237 = 3 * 1U; #line 5004 - __cil_tmp238 = 112 + __cil_tmp237; + __cil_tmp238 = 112 + __cil_tmp237; #line 5004 - __cil_tmp239 = (unsigned int )DisketteExtension; + __cil_tmp239 = (unsigned int)DisketteExtension; #line 5004 - __cil_tmp240 = __cil_tmp239 + __cil_tmp238; + __cil_tmp240 = __cil_tmp239 + __cil_tmp238; #line 5004 - mem_428 = (UCHAR *)__cil_tmp240; + mem_428 = (UCHAR *)__cil_tmp240; #line 5004 - *mem_428 = Head; + *mem_428 = Head; #line 5005 - __cil_tmp241 = 4 * 1U; + __cil_tmp241 = 4 * 1U; #line 5005 - __cil_tmp242 = 112 + __cil_tmp241; + __cil_tmp242 = 112 + __cil_tmp241; #line 5005 - __cil_tmp243 = (unsigned int )DisketteExtension; + __cil_tmp243 = (unsigned int)DisketteExtension; #line 5005 - __cil_tmp244 = __cil_tmp243 + __cil_tmp242; + __cil_tmp244 = __cil_tmp243 + __cil_tmp242; #line 5005 - __cil_tmp245 = (int )Sector; + __cil_tmp245 = (int)Sector; #line 5005 - __cil_tmp246 = __cil_tmp245 + 1; + __cil_tmp246 = __cil_tmp245 + 1; #line 5005 - mem_429 = (UCHAR *)__cil_tmp244; + mem_429 = (UCHAR *)__cil_tmp244; #line 5005 - *mem_429 = (unsigned char )__cil_tmp246; + *mem_429 = (unsigned char)__cil_tmp246; #line 5006 - __cil_tmp247 = 5 * 1U; + __cil_tmp247 = 5 * 1U; #line 5006 - __cil_tmp248 = 112 + __cil_tmp247; + __cil_tmp248 = 112 + __cil_tmp247; #line 5006 - __cil_tmp249 = (unsigned int )DisketteExtension; + __cil_tmp249 = (unsigned int)DisketteExtension; #line 5006 - __cil_tmp250 = __cil_tmp249 + __cil_tmp248; + __cil_tmp250 = __cil_tmp249 + __cil_tmp248; #line 5006 - __cil_tmp251 = (unsigned int )driveMediaConstants; + __cil_tmp251 = (unsigned int)driveMediaConstants; #line 5006 - __cil_tmp252 = __cil_tmp251 + 35; + __cil_tmp252 = __cil_tmp251 + 35; #line 5006 - mem_430 = (UCHAR *)__cil_tmp250; + mem_430 = (UCHAR *)__cil_tmp250; #line 5006 - mem_431 = (UCHAR *)__cil_tmp252; + mem_431 = (UCHAR *)__cil_tmp252; #line 5006 - *mem_430 = *mem_431; + *mem_430 = *mem_431; #line 5008 - __cil_tmp253 = 6 * 1U; + __cil_tmp253 = 6 * 1U; #line 5008 - __cil_tmp254 = 112 + __cil_tmp253; + __cil_tmp254 = 112 + __cil_tmp253; #line 5008 - __cil_tmp255 = (unsigned int )DisketteExtension; + __cil_tmp255 = (unsigned int)DisketteExtension; #line 5008 - __cil_tmp256 = __cil_tmp255 + __cil_tmp254; + __cil_tmp256 = __cil_tmp255 + __cil_tmp254; #line 5008 - __cil_tmp257 = (int )NumberOfSectors; + __cil_tmp257 = (int)NumberOfSectors; #line 5008 - __cil_tmp258 = (int )Sector; + __cil_tmp258 = (int)Sector; #line 5008 - __cil_tmp259 = __cil_tmp258 + __cil_tmp257; + __cil_tmp259 = __cil_tmp258 + __cil_tmp257; #line 5008 - mem_432 = (UCHAR *)__cil_tmp256; + mem_432 = (UCHAR *)__cil_tmp256; #line 5008 - *mem_432 = (unsigned char )__cil_tmp259; + *mem_432 = (unsigned char)__cil_tmp259; #line 5009 - __cil_tmp260 = 7 * 1U; + __cil_tmp260 = 7 * 1U; #line 5009 - __cil_tmp261 = 112 + __cil_tmp260; + __cil_tmp261 = 112 + __cil_tmp260; #line 5009 - __cil_tmp262 = (unsigned int )DisketteExtension; + __cil_tmp262 = (unsigned int)DisketteExtension; #line 5009 - __cil_tmp263 = __cil_tmp262 + __cil_tmp261; + __cil_tmp263 = __cil_tmp262 + __cil_tmp261; #line 5009 - __cil_tmp264 = (unsigned int )driveMediaConstants; + __cil_tmp264 = (unsigned int)driveMediaConstants; #line 5009 - __cil_tmp265 = __cil_tmp264 + 39; + __cil_tmp265 = __cil_tmp264 + 39; #line 5009 - mem_433 = (UCHAR *)__cil_tmp263; + mem_433 = (UCHAR *)__cil_tmp263; #line 5009 - mem_434 = (UCHAR *)__cil_tmp265; + mem_434 = (UCHAR *)__cil_tmp265; #line 5009 - *mem_433 = *mem_434; + *mem_433 = *mem_434; #line 5011 - __cil_tmp266 = 8 * 1U; + __cil_tmp266 = 8 * 1U; #line 5011 - __cil_tmp267 = 112 + __cil_tmp266; + __cil_tmp267 = 112 + __cil_tmp266; #line 5011 - __cil_tmp268 = (unsigned int )DisketteExtension; + __cil_tmp268 = (unsigned int)DisketteExtension; #line 5011 - __cil_tmp269 = __cil_tmp268 + __cil_tmp267; + __cil_tmp269 = __cil_tmp268 + __cil_tmp267; #line 5011 - __cil_tmp270 = (unsigned int )driveMediaConstants; + __cil_tmp270 = (unsigned int)driveMediaConstants; #line 5011 - __cil_tmp271 = __cil_tmp270 + 52; + __cil_tmp271 = __cil_tmp270 + 52; #line 5011 - mem_435 = (UCHAR *)__cil_tmp269; + mem_435 = (UCHAR *)__cil_tmp269; #line 5011 - mem_436 = (UCHAR *)__cil_tmp271; + mem_436 = (UCHAR *)__cil_tmp271; #line 5011 - *mem_435 = *mem_436; + *mem_435 = *mem_436; #line 5013 - if (WriteOperation) { + if (WriteOperation) { #line 5014 - __cil_tmp272 = 0 * 1U; + __cil_tmp272 = 0 * 1U; #line 5014 - __cil_tmp273 = 112 + __cil_tmp272; + __cil_tmp273 = 112 + __cil_tmp272; #line 5014 - __cil_tmp274 = (unsigned int )DisketteExtension; + __cil_tmp274 = (unsigned int)DisketteExtension; #line 5014 - __cil_tmp275 = __cil_tmp274 + __cil_tmp273; + __cil_tmp275 = __cil_tmp274 + __cil_tmp273; #line 5014 - mem_437 = (UCHAR *)__cil_tmp275; + mem_437 = (UCHAR *)__cil_tmp275; #line 5014 - *mem_437 = (unsigned char)66; - } else { + *mem_437 = (unsigned char)66; + } else { #line 5017 - __cil_tmp276 = 0 * 1U; + __cil_tmp276 = 0 * 1U; #line 5017 - __cil_tmp277 = 112 + __cil_tmp276; + __cil_tmp277 = 112 + __cil_tmp276; #line 5017 - __cil_tmp278 = (unsigned int )DisketteExtension; + __cil_tmp278 = (unsigned int)DisketteExtension; #line 5017 - __cil_tmp279 = __cil_tmp278 + __cil_tmp277; + __cil_tmp279 = __cil_tmp278 + __cil_tmp277; #line 5017 - mem_438 = (UCHAR *)__cil_tmp279; + mem_438 = (UCHAR *)__cil_tmp279; #line 5017 - *mem_438 = (unsigned char)64; - } - { + *mem_438 = (unsigned char)64; + } + { #line 5021 - __cil_tmp280 = 0 * 1U; + __cil_tmp280 = 0 * 1U; #line 5021 - __cil_tmp281 = 112 + __cil_tmp280; + __cil_tmp281 = 112 + __cil_tmp280; #line 5021 - __cil_tmp282 = (unsigned int )DisketteExtension; + __cil_tmp282 = (unsigned int)DisketteExtension; #line 5021 - __cil_tmp283 = __cil_tmp282 + __cil_tmp281; + __cil_tmp283 = __cil_tmp282 + __cil_tmp281; #line 5021 - __cil_tmp284 = (UCHAR *)__cil_tmp283; + __cil_tmp284 = (UCHAR *)__cil_tmp283; #line 5021 - __cil_tmp285 = 0 * 1U; + __cil_tmp285 = 0 * 1U; #line 5021 - __cil_tmp286 = 112 + __cil_tmp285; + __cil_tmp286 = 112 + __cil_tmp285; #line 5021 - __cil_tmp287 = (unsigned int )DisketteExtension; + __cil_tmp287 = (unsigned int)DisketteExtension; #line 5021 - __cil_tmp288 = __cil_tmp287 + __cil_tmp286; + __cil_tmp288 = __cil_tmp287 + __cil_tmp286; #line 5021 - __cil_tmp289 = (UCHAR *)__cil_tmp288; + __cil_tmp289 = (UCHAR *)__cil_tmp288; #line 5021 - status = FlIssueCommand(DisketteExtension, __cil_tmp284, __cil_tmp289, IoMdl, - IoOffset, transferBytes); - } + status = + FlIssueCommand(DisketteExtension, __cil_tmp284, __cil_tmp289, + IoMdl, IoOffset, transferBytes); + } #line 5028 - if (status >= 0L) { - { + if (status >= 0L) { + { #line 5030 - __cil_tmp290 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp290 = (KUSER_SHARED_DATA * const)4292804608U; #line 5030 - __cil_tmp291 = (unsigned int )__cil_tmp290; + __cil_tmp291 = (unsigned int)__cil_tmp290; #line 5030 - __cil_tmp292 = __cil_tmp291 + 732; + __cil_tmp292 = __cil_tmp291 + 732; #line 5030 - mem_439 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp292; + mem_439 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp292; #line 5030 - __cil_tmp293 = *mem_439; + __cil_tmp293 = *mem_439; #line 5030 - __cil_tmp294 = (int )__cil_tmp293; + __cil_tmp294 = (int)__cil_tmp293; #line 5030 - if (__cil_tmp294 == 1) { - { + if (__cil_tmp294 == 1) { + { #line 5031 - __cil_tmp295 = 0 * 1U; + __cil_tmp295 = 0 * 1U; #line 5031 - __cil_tmp296 = 112 + __cil_tmp295; + __cil_tmp296 = 112 + __cil_tmp295; #line 5031 - __cil_tmp297 = (unsigned int )DisketteExtension; + __cil_tmp297 = (unsigned int)DisketteExtension; #line 5031 - __cil_tmp298 = __cil_tmp297 + __cil_tmp296; + __cil_tmp298 = __cil_tmp297 + __cil_tmp296; #line 5031 - mem_440 = (UCHAR *)__cil_tmp298; + mem_440 = (UCHAR *)__cil_tmp298; #line 5031 - __cil_tmp299 = *mem_440; + __cil_tmp299 = *mem_440; #line 5031 - __cil_tmp300 = (int )__cil_tmp299; + __cil_tmp300 = (int)__cil_tmp299; #line 5031 - if (__cil_tmp300 & 8) { + if (__cil_tmp300 & 8) { #line 5032 - return (-1073741661L); - } else { - - } - } - } else { - - } - } - { + return (-1073741661L); + } else { + } + } + } else { + } + } + { #line 5036 - __cil_tmp301 = 0 * 1U; + __cil_tmp301 = 0 * 1U; #line 5036 - __cil_tmp302 = 112 + __cil_tmp301; + __cil_tmp302 = 112 + __cil_tmp301; #line 5036 - __cil_tmp303 = (unsigned int )DisketteExtension; + __cil_tmp303 = (unsigned int)DisketteExtension; #line 5036 - __cil_tmp304 = __cil_tmp303 + __cil_tmp302; + __cil_tmp304 = __cil_tmp303 + __cil_tmp302; #line 5036 - mem_441 = (UCHAR *)__cil_tmp304; + mem_441 = (UCHAR *)__cil_tmp304; #line 5036 - __cil_tmp305 = *mem_441; + __cil_tmp305 = *mem_441; #line 5036 - __cil_tmp306 = (int )__cil_tmp305; + __cil_tmp306 = (int)__cil_tmp305; #line 5036 - __cil_tmp307 = __cil_tmp306 & 192; + __cil_tmp307 = __cil_tmp306 & 192; #line 5036 - if (__cil_tmp307 != 0) { - { + if (__cil_tmp307 != 0) { + { #line 5036 - __cil_tmp308 = 0 * 1U; + __cil_tmp308 = 0 * 1U; #line 5036 - __cil_tmp309 = 112 + __cil_tmp308; + __cil_tmp309 = 112 + __cil_tmp308; #line 5036 - __cil_tmp310 = (unsigned int )DisketteExtension; + __cil_tmp310 = (unsigned int)DisketteExtension; #line 5036 - __cil_tmp311 = __cil_tmp310 + __cil_tmp309; + __cil_tmp311 = __cil_tmp310 + __cil_tmp309; #line 5036 - mem_442 = (UCHAR *)__cil_tmp311; + mem_442 = (UCHAR *)__cil_tmp311; #line 5036 - __cil_tmp312 = *mem_442; + __cil_tmp312 = *mem_442; #line 5036 - __cil_tmp313 = (int )__cil_tmp312; + __cil_tmp313 = (int)__cil_tmp312; #line 5036 - __cil_tmp314 = __cil_tmp313 & 192; + __cil_tmp314 = __cil_tmp313 & 192; #line 5036 - if (__cil_tmp314 != 64) { - { + if (__cil_tmp314 != 64) { + { #line 5044 - __cil_tmp315 = (unsigned int )DisketteExtension; + __cil_tmp315 = (unsigned int)DisketteExtension; #line 5044 - __cil_tmp316 = __cil_tmp315 + 104; + __cil_tmp316 = __cil_tmp315 + 104; #line 5044 - mem_443 = (BOOLEAN *)__cil_tmp316; + mem_443 = (BOOLEAN *)__cil_tmp316; #line 5044 - *mem_443 = (unsigned char)1; + *mem_443 = (unsigned char)1; #line 5046 - __cil_tmp317 = 1 * 1U; + __cil_tmp317 = 1 * 1U; #line 5046 - __cil_tmp318 = 112 + __cil_tmp317; + __cil_tmp318 = 112 + __cil_tmp317; #line 5046 - __cil_tmp319 = (unsigned int )DisketteExtension; + __cil_tmp319 = (unsigned int)DisketteExtension; #line 5046 - __cil_tmp320 = __cil_tmp319 + __cil_tmp318; + __cil_tmp320 = __cil_tmp319 + __cil_tmp318; #line 5046 - mem_444 = (UCHAR *)__cil_tmp320; + mem_444 = (UCHAR *)__cil_tmp320; #line 5046 - __cil_tmp321 = *mem_444; + __cil_tmp321 = *mem_444; #line 5046 - __cil_tmp322 = 2 * 1U; + __cil_tmp322 = 2 * 1U; #line 5046 - __cil_tmp323 = 112 + __cil_tmp322; + __cil_tmp323 = 112 + __cil_tmp322; #line 5046 - __cil_tmp324 = (unsigned int )DisketteExtension; + __cil_tmp324 = (unsigned int)DisketteExtension; #line 5046 - __cil_tmp325 = __cil_tmp324 + __cil_tmp323; + __cil_tmp325 = __cil_tmp324 + __cil_tmp323; #line 5046 - mem_445 = (UCHAR *)__cil_tmp325; + mem_445 = (UCHAR *)__cil_tmp325; #line 5046 - __cil_tmp326 = *mem_445; + __cil_tmp326 = *mem_445; #line 5046 - status = FlInterpretError(__cil_tmp321, __cil_tmp326); - } - } else { - { + status = FlInterpretError(__cil_tmp321, __cil_tmp326); + } + } else { + { #line 5036 - __cil_tmp327 = 1 * 1U; + __cil_tmp327 = 1 * 1U; #line 5036 - __cil_tmp328 = 112 + __cil_tmp327; + __cil_tmp328 = 112 + __cil_tmp327; #line 5036 - __cil_tmp329 = (unsigned int )DisketteExtension; + __cil_tmp329 = (unsigned int)DisketteExtension; #line 5036 - __cil_tmp330 = __cil_tmp329 + __cil_tmp328; + __cil_tmp330 = __cil_tmp329 + __cil_tmp328; #line 5036 - mem_446 = (UCHAR *)__cil_tmp330; + mem_446 = (UCHAR *)__cil_tmp330; #line 5036 - __cil_tmp331 = *mem_446; + __cil_tmp331 = *mem_446; #line 5036 - __cil_tmp332 = (int )__cil_tmp331; + __cil_tmp332 = (int)__cil_tmp331; #line 5036 - if (__cil_tmp332 != 128) { - { + if (__cil_tmp332 != 128) { + { #line 5044 - __cil_tmp333 = (unsigned int )DisketteExtension; + __cil_tmp333 = (unsigned int)DisketteExtension; #line 5044 - __cil_tmp334 = __cil_tmp333 + 104; + __cil_tmp334 = __cil_tmp333 + 104; #line 5044 - mem_447 = (BOOLEAN *)__cil_tmp334; + mem_447 = (BOOLEAN *)__cil_tmp334; #line 5044 - *mem_447 = (unsigned char)1; + *mem_447 = (unsigned char)1; #line 5046 - __cil_tmp335 = 1 * 1U; + __cil_tmp335 = 1 * 1U; #line 5046 - __cil_tmp336 = 112 + __cil_tmp335; + __cil_tmp336 = 112 + __cil_tmp335; #line 5046 - __cil_tmp337 = (unsigned int )DisketteExtension; + __cil_tmp337 = (unsigned int)DisketteExtension; #line 5046 - __cil_tmp338 = __cil_tmp337 + __cil_tmp336; + __cil_tmp338 = __cil_tmp337 + __cil_tmp336; #line 5046 - mem_448 = (UCHAR *)__cil_tmp338; + mem_448 = (UCHAR *)__cil_tmp338; #line 5046 - __cil_tmp339 = *mem_448; + __cil_tmp339 = *mem_448; #line 5046 - __cil_tmp340 = 2 * 1U; + __cil_tmp340 = 2 * 1U; #line 5046 - __cil_tmp341 = 112 + __cil_tmp340; + __cil_tmp341 = 112 + __cil_tmp340; #line 5046 - __cil_tmp342 = (unsigned int )DisketteExtension; + __cil_tmp342 = (unsigned int)DisketteExtension; #line 5046 - __cil_tmp343 = __cil_tmp342 + __cil_tmp341; + __cil_tmp343 = __cil_tmp342 + __cil_tmp341; #line 5046 - mem_449 = (UCHAR *)__cil_tmp343; + mem_449 = (UCHAR *)__cil_tmp343; #line 5046 - __cil_tmp344 = *mem_449; + __cil_tmp344 = *mem_449; #line 5046 - status = FlInterpretError(__cil_tmp339, __cil_tmp344); - } - } else { - { + status = + FlInterpretError(__cil_tmp339, __cil_tmp344); + } + } else { + { #line 5036 - __cil_tmp345 = 2 * 1U; + __cil_tmp345 = 2 * 1U; #line 5036 - __cil_tmp346 = 112 + __cil_tmp345; + __cil_tmp346 = 112 + __cil_tmp345; #line 5036 - __cil_tmp347 = (unsigned int )DisketteExtension; + __cil_tmp347 = (unsigned int)DisketteExtension; #line 5036 - __cil_tmp348 = __cil_tmp347 + __cil_tmp346; + __cil_tmp348 = __cil_tmp347 + __cil_tmp346; #line 5036 - mem_450 = (UCHAR *)__cil_tmp348; + mem_450 = (UCHAR *)__cil_tmp348; #line 5036 - __cil_tmp349 = *mem_450; + __cil_tmp349 = *mem_450; #line 5036 - __cil_tmp350 = (int )__cil_tmp349; + __cil_tmp350 = (int)__cil_tmp349; #line 5036 - if (__cil_tmp350 != 0) { - { + if (__cil_tmp350 != 0) { + { #line 5044 - __cil_tmp351 = (unsigned int )DisketteExtension; + __cil_tmp351 = (unsigned int)DisketteExtension; #line 5044 - __cil_tmp352 = __cil_tmp351 + 104; + __cil_tmp352 = __cil_tmp351 + 104; #line 5044 - mem_451 = (BOOLEAN *)__cil_tmp352; + mem_451 = (BOOLEAN *)__cil_tmp352; #line 5044 - *mem_451 = (unsigned char)1; + *mem_451 = (unsigned char)1; #line 5046 - __cil_tmp353 = 1 * 1U; + __cil_tmp353 = 1 * 1U; #line 5046 - __cil_tmp354 = 112 + __cil_tmp353; + __cil_tmp354 = 112 + __cil_tmp353; #line 5046 - __cil_tmp355 = (unsigned int )DisketteExtension; + __cil_tmp355 = (unsigned int)DisketteExtension; #line 5046 - __cil_tmp356 = __cil_tmp355 + __cil_tmp354; + __cil_tmp356 = __cil_tmp355 + __cil_tmp354; #line 5046 - mem_452 = (UCHAR *)__cil_tmp356; + mem_452 = (UCHAR *)__cil_tmp356; #line 5046 - __cil_tmp357 = *mem_452; + __cil_tmp357 = *mem_452; #line 5046 - __cil_tmp358 = 2 * 1U; + __cil_tmp358 = 2 * 1U; #line 5046 - __cil_tmp359 = 112 + __cil_tmp358; + __cil_tmp359 = 112 + __cil_tmp358; #line 5046 - __cil_tmp360 = (unsigned int )DisketteExtension; + __cil_tmp360 = (unsigned int)DisketteExtension; #line 5046 - __cil_tmp361 = __cil_tmp360 + __cil_tmp359; + __cil_tmp361 = __cil_tmp360 + __cil_tmp359; #line 5046 - mem_453 = (UCHAR *)__cil_tmp361; + mem_453 = (UCHAR *)__cil_tmp361; #line 5046 - __cil_tmp362 = *mem_453; + __cil_tmp362 = *mem_453; #line 5046 - status = FlInterpretError(__cil_tmp357, __cil_tmp362); - } - } else { - goto _L___1; - } - } - } - } - } - } - } else { - _L___1: - { + status = FlInterpretError(__cil_tmp357, + __cil_tmp362); + } + } else { + goto _L___1; + } + } + } + } + } + } + } else { + _L___1 : { #line 5054 - __cil_tmp363 = 5 * 1U; + __cil_tmp363 = 5 * 1U; #line 5054 - __cil_tmp364 = 112 + __cil_tmp363; + __cil_tmp364 = 112 + __cil_tmp363; #line 5054 - __cil_tmp365 = (unsigned int )DisketteExtension; + __cil_tmp365 = (unsigned int)DisketteExtension; #line 5054 - __cil_tmp366 = __cil_tmp365 + __cil_tmp364; + __cil_tmp366 = __cil_tmp365 + __cil_tmp364; #line 5054 - mem_454 = (UCHAR *)__cil_tmp366; + mem_454 = (UCHAR *)__cil_tmp366; #line 5054 - __cil_tmp367 = *mem_454; + __cil_tmp367 = *mem_454; #line 5054 - __cil_tmp368 = (int )__cil_tmp367; + __cil_tmp368 = (int)__cil_tmp367; #line 5054 - if (__cil_tmp368 != 1) { + if (__cil_tmp368 != 1) { #line 5056 - __cil_tmp369 = (unsigned int )DisketteExtension; + __cil_tmp369 = (unsigned int)DisketteExtension; #line 5056 - __cil_tmp370 = __cil_tmp369 + 104; + __cil_tmp370 = __cil_tmp369 + 104; #line 5056 - mem_455 = (BOOLEAN *)__cil_tmp370; + mem_455 = (BOOLEAN *)__cil_tmp370; #line 5056 - *mem_455 = (unsigned char)1; + *mem_455 = (unsigned char)1; #line 5057 - status = -1073741465L; - } else { - - } - } - } - } - } else { - { + status = -1073741465L; + } else { + } + } + } + } + } else { + { #line 5064 - while (1) { - while_150_continue: /* CIL Label */ ; - goto while_150_break; - } - while_150_break: /* CIL Label */ ; - } - } + while (1) { + while_150_continue: /* CIL Label */; + goto while_150_break; + } + while_150_break: /* CIL Label */; + } + } #line 5067 - if (status >= 0L) { - goto while_149_break; - } else { - - } + if (status >= 0L) { + goto while_149_break; + } else { + } #line 5071 - if (ioRetry >= 2UL) { - { + if (ioRetry >= 2UL) { + { #line 5073 - while (1) { - while_151_continue: /* CIL Label */ ; - goto while_151_break; - } - while_151_break: /* CIL Label */ ; - } - goto while_149_break; - } else { - - } + while (1) { + while_151_continue: /* CIL Label */; + goto while_151_break; + } + while_151_break: /* CIL Label */; + } + goto while_149_break; + } else { + } #line 4995 - ioRetry = ioRetry + 1UL; - } - while_149_break: /* CIL Label */ ; - } + ioRetry = ioRetry + 1UL; + } + while_149_break: /* CIL Label */; + } #line 5078 - if (status >= 0L) { - goto while_144_break; - } else { - - } + if (status >= 0L) { + goto while_144_break; + } else { + } #line 5083 - recalibrateDrive = (unsigned char)1; - __Cont: + recalibrateDrive = (unsigned char)1; + __Cont: #line 4879 - seekRetry = seekRetry + 1UL; - } - while_144_break: /* CIL Label */ ; - } - { + seekRetry = seekRetry + 1UL; + } + while_144_break: /* CIL Label */; + } + { #line 5086 - __cil_tmp371 = status >= 0L; + __cil_tmp371 = status >= 0L; #line 5086 - if (! __cil_tmp371) { - { + if (!__cil_tmp371) { + { #line 5086 - __cil_tmp372 = (int )NumberOfSectors; + __cil_tmp372 = (int)NumberOfSectors; #line 5086 - if (__cil_tmp372 > 1) { - { + if (__cil_tmp372 > 1) { + { #line 5091 - while (1) { - while_152_continue: /* CIL Label */ ; - goto while_152_break; - } - while_152_break: /* CIL Label */ ; - } + while (1) { + while_152_continue: /* CIL Label */; + goto while_152_break; + } + while_152_break: /* CIL Label */; + } #line 5093 - i = (unsigned char)0; - { + i = (unsigned char)0; + { #line 5093 - while (1) { - while_153_continue: /* CIL Label */ ; - { + while (1) { + while_153_continue: /* CIL Label */; + { #line 5093 - __cil_tmp373 = (int )NumberOfSectors; + __cil_tmp373 = (int)NumberOfSectors; #line 5093 - __cil_tmp374 = (int )i; + __cil_tmp374 = (int)i; #line 5093 - if (__cil_tmp374 < __cil_tmp373) { + if (__cil_tmp374 < __cil_tmp373) { - } else { - goto while_153_break; - } - } - { + } else { + goto while_153_break; + } + } + { #line 5094 - __cil_tmp375 = (unsigned long )i; + __cil_tmp375 = (unsigned long)i; #line 5094 - __cil_tmp376 = __cil_tmp375 << byteToSectorShift; + __cil_tmp376 = __cil_tmp375 << byteToSectorShift; #line 5094 - __cil_tmp377 = IoOffset + __cil_tmp376; + __cil_tmp377 = IoOffset + __cil_tmp376; #line 5094 - __cil_tmp378 = (int )i; + __cil_tmp378 = (int)i; #line 5094 - __cil_tmp379 = (int )Sector; + __cil_tmp379 = (int)Sector; #line 5094 - __cil_tmp380 = __cil_tmp379 + __cil_tmp378; + __cil_tmp380 = __cil_tmp379 + __cil_tmp378; #line 5094 - __cil_tmp381 = (unsigned char )__cil_tmp380; + __cil_tmp381 = (unsigned char)__cil_tmp380; #line 5094 - status = FlReadWriteTrack(DisketteExtension, IoMdl, __cil_tmp377, WriteOperation, - Cylinder, Head, __cil_tmp381, (unsigned char)1, - (unsigned char)0); - } - { + status = FlReadWriteTrack(DisketteExtension, IoMdl, + __cil_tmp377, WriteOperation, + Cylinder, Head, __cil_tmp381, + (unsigned char)1, (unsigned char)0); + } + { #line 5104 - __cil_tmp382 = status >= 0L; + __cil_tmp382 = status >= 0L; #line 5104 - if (! __cil_tmp382) { - { + if (!__cil_tmp382) { + { #line 5108 - while (1) { - while_154_continue: /* CIL Label */ ; - goto while_154_break; - } - while_154_break: /* CIL Label */ ; - } + while (1) { + while_154_continue: /* CIL Label */; + goto while_154_break; + } + while_154_break: /* CIL Label */; + } #line 5110 - __cil_tmp383 = (unsigned int )DisketteExtension; + __cil_tmp383 = (unsigned int)DisketteExtension; #line 5110 - __cil_tmp384 = __cil_tmp383 + 104; + __cil_tmp384 = __cil_tmp383 + 104; #line 5110 - mem_456 = (BOOLEAN *)__cil_tmp384; + mem_456 = (BOOLEAN *)__cil_tmp384; #line 5110 - *mem_456 = (unsigned char)1; - goto while_153_break; - } else { - - } - } + *mem_456 = (unsigned char)1; + goto while_153_break; + } else { + } + } #line 5093 - __cil_tmp385 = (int )i; + __cil_tmp385 = (int)i; #line 5093 - __cil_tmp386 = __cil_tmp385 + 1; + __cil_tmp386 = __cil_tmp385 + 1; #line 5093 - i = (unsigned char )__cil_tmp386; - } - while_153_break: /* CIL Label */ ; + i = (unsigned char)__cil_tmp386; + } + while_153_break: /* CIL Label */; + } + } else { + } + } + } else { } - } else { - - } } - } else { - - } - } #line 5116 - return (status); -} + return (status); + } } #line 5119 "floppy.c" -NTSTATUS FlReadWrite(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp , BOOLEAN DriveStarted ) -{ PIO_STACK_LOCATION irpSp ; - BOOLEAN writeOperation ; - NTSTATUS status ; - PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - ULONG byteToSectorShift ; - ULONG currentSector ; - ULONG firstSector ; - ULONG lastSector ; - ULONG trackSize ; - UCHAR sectorsPerTrack ; - UCHAR numberOfHeads ; - UCHAR currentHead ; - UCHAR currentCylinder ; - UCHAR trackSector ; - PCHAR userBuffer ; - UCHAR skew ; - UCHAR skewDelta ; - UCHAR numTransferSectors ; - PMDL mdl ; - PCHAR ioBuffer ; - ULONG ioOffset ; - PVOID tmp___0 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - unsigned int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - UCHAR __cil_tmp31 ; - int __cil_tmp32 ; - unsigned int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - UCHAR __cil_tmp37 ; - int __cil_tmp38 ; - int __cil_tmp39 ; - int __cil_tmp40 ; - int __cil_tmp41 ; - unsigned char __cil_tmp42 ; - int __cil_tmp43 ; - KUSER_SHARED_DATA *__cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp47 ; - int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - MEDIA_TYPE __cil_tmp51 ; - int __cil_tmp52 ; - unsigned int __cil_tmp53 ; - unsigned int __cil_tmp54 ; - unsigned int __cil_tmp55 ; - unsigned int __cil_tmp56 ; - UCHAR __cil_tmp57 ; - int __cil_tmp58 ; - int __cil_tmp59 ; - unsigned int __cil_tmp60 ; - unsigned int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - unsigned int __cil_tmp63 ; - ULONG __cil_tmp64 ; - unsigned int __cil_tmp65 ; - unsigned int __cil_tmp66 ; - ULONG __cil_tmp67 ; - ULONG __cil_tmp68 ; - unsigned int __cil_tmp69 ; - unsigned int __cil_tmp70 ; - unsigned int __cil_tmp71 ; - unsigned int __cil_tmp72 ; - unsigned int __cil_tmp73 ; - unsigned int __cil_tmp74 ; - PMDL __cil_tmp75 ; - unsigned int __cil_tmp76 ; - unsigned int __cil_tmp77 ; - CSHORT __cil_tmp78 ; - int __cil_tmp79 ; - unsigned int __cil_tmp80 ; - unsigned int __cil_tmp81 ; - PMDL __cil_tmp82 ; - unsigned int __cil_tmp83 ; - unsigned int __cil_tmp84 ; - PVOID __cil_tmp85 ; - unsigned int __cil_tmp86 ; - unsigned int __cil_tmp87 ; - PMDL __cil_tmp88 ; - enum _MEMORY_CACHING_TYPE __cil_tmp89 ; - void *__cil_tmp90 ; - enum _MM_PAGE_PRIORITY __cil_tmp91 ; - void *__cil_tmp92 ; - unsigned int __cil_tmp93 ; - unsigned int __cil_tmp94 ; - unsigned long __cil_tmp95 ; - unsigned int __cil_tmp96 ; - unsigned int __cil_tmp97 ; - unsigned long __cil_tmp98 ; - unsigned long __cil_tmp99 ; - ULONG __cil_tmp100 ; - ULONG __cil_tmp101 ; - unsigned long __cil_tmp102 ; - unsigned long __cil_tmp103 ; - unsigned long __cil_tmp104 ; - unsigned long __cil_tmp105 ; - ULONG __cil_tmp106 ; - unsigned long __cil_tmp107 ; - int __cil_tmp108 ; - int __cil_tmp109 ; - int __cil_tmp110 ; - unsigned long __cil_tmp111 ; - ULONG __cil_tmp112 ; - ULONG __cil_tmp113 ; - unsigned int __cil_tmp114 ; - unsigned int __cil_tmp115 ; - ULONG __cil_tmp116 ; - unsigned int __cil_tmp117 ; - unsigned int __cil_tmp118 ; - PUCHAR __cil_tmp119 ; - unsigned int __cil_tmp120 ; - unsigned int __cil_tmp121 ; - unsigned int __cil_tmp122 ; - unsigned int __cil_tmp123 ; - PUCHAR __cil_tmp124 ; - void *__cil_tmp125 ; - ULONG __cil_tmp126 ; - ULONG __cil_tmp127 ; - PCHAR __cil_tmp128 ; - void const *__cil_tmp129 ; - unsigned long __cil_tmp130 ; - unsigned long __cil_tmp131 ; - unsigned int __cil_tmp132 ; - unsigned int __cil_tmp133 ; - unsigned int __cil_tmp134 ; - ULONG __cil_tmp135 ; - int __cil_tmp136 ; - int __cil_tmp137 ; - int __cil_tmp138 ; - int __cil_tmp139 ; - int __cil_tmp140 ; - int __cil_tmp141 ; - unsigned long __cil_tmp142 ; - unsigned long __cil_tmp143 ; - unsigned long __cil_tmp144 ; - unsigned long __cil_tmp145 ; - ULONG __cil_tmp146 ; - int __cil_tmp147 ; - int __cil_tmp148 ; - int __cil_tmp149 ; - int __cil_tmp150 ; - int __cil_tmp151 ; - unsigned char __cil_tmp152 ; - int __cil_tmp153 ; - int __cil_tmp154 ; - int __cil_tmp155 ; - int __cil_tmp156 ; - int __cil_tmp157 ; - unsigned char __cil_tmp158 ; - int __cil_tmp159 ; - int __cil_tmp160 ; - int __cil_tmp161 ; - int __cil_tmp162 ; - int __cil_tmp163 ; - int __cil_tmp164 ; - int __cil_tmp165 ; - int __cil_tmp166 ; - int __cil_tmp167 ; - int __cil_tmp168 ; - int __cil_tmp169 ; - unsigned int __cil_tmp170 ; - unsigned int __cil_tmp171 ; - ULONG __cil_tmp172 ; - ULONG __cil_tmp173 ; - ULONG __cil_tmp174 ; - PCHAR __cil_tmp175 ; - void *__cil_tmp176 ; - void const *__cil_tmp177 ; - unsigned long __cil_tmp178 ; - unsigned long __cil_tmp179 ; - unsigned int __cil_tmp180 ; - int __cil_tmp181 ; - int __cil_tmp182 ; - int __cil_tmp183 ; - int __cil_tmp184 ; - int __cil_tmp185 ; - unsigned long __cil_tmp186 ; - unsigned int __cil_tmp187 ; - unsigned int __cil_tmp188 ; - unsigned int __cil_tmp189 ; - ULONG __cil_tmp190 ; - struct _BOOT_SECTOR_INFO *__cil_tmp191 ; - struct _IO_STACK_LOCATION **mem_192 ; - UCHAR *mem_193 ; - BOOLEAN *mem_194 ; - UCHAR *mem_195 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_196 ; - MEDIA_TYPE *mem_197 ; - UCHAR *mem_198 ; - ULONG *mem_199 ; - ULONG *mem_200 ; - UCHAR *mem_201 ; - UCHAR *mem_202 ; - PMDL *mem_203 ; - CSHORT *mem_204 ; - PMDL *mem_205 ; - PVOID *mem_206 ; - PMDL *mem_207 ; - UCHAR *mem_208 ; - ULONG *mem_209 ; - PUCHAR *mem_210 ; - PMDL *mem_211 ; - PUCHAR *mem_212 ; - PMDL *mem_213 ; - ULONG *mem_214 ; - ULONG_PTR *mem_215 ; +NTSTATUS FlReadWrite(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp, + BOOLEAN DriveStarted) { + PIO_STACK_LOCATION irpSp; + BOOLEAN writeOperation; + NTSTATUS status; + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + ULONG byteToSectorShift; + ULONG currentSector; + ULONG firstSector; + ULONG lastSector; + ULONG trackSize; + UCHAR sectorsPerTrack; + UCHAR numberOfHeads; + UCHAR currentHead; + UCHAR currentCylinder; + UCHAR trackSector; + PCHAR userBuffer; + UCHAR skew; + UCHAR skewDelta; + UCHAR numTransferSectors; + PMDL mdl; + PCHAR ioBuffer; + ULONG ioOffset; + PVOID tmp___0; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + unsigned int __cil_tmp29; + unsigned int __cil_tmp30; + UCHAR __cil_tmp31; + int __cil_tmp32; + unsigned int __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + UCHAR __cil_tmp37; + int __cil_tmp38; + int __cil_tmp39; + int __cil_tmp40; + int __cil_tmp41; + unsigned char __cil_tmp42; + int __cil_tmp43; + KUSER_SHARED_DATA *__cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp47; + int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + MEDIA_TYPE __cil_tmp51; + int __cil_tmp52; + unsigned int __cil_tmp53; + unsigned int __cil_tmp54; + unsigned int __cil_tmp55; + unsigned int __cil_tmp56; + UCHAR __cil_tmp57; + int __cil_tmp58; + int __cil_tmp59; + unsigned int __cil_tmp60; + unsigned int __cil_tmp61; + unsigned int __cil_tmp62; + unsigned int __cil_tmp63; + ULONG __cil_tmp64; + unsigned int __cil_tmp65; + unsigned int __cil_tmp66; + ULONG __cil_tmp67; + ULONG __cil_tmp68; + unsigned int __cil_tmp69; + unsigned int __cil_tmp70; + unsigned int __cil_tmp71; + unsigned int __cil_tmp72; + unsigned int __cil_tmp73; + unsigned int __cil_tmp74; + PMDL __cil_tmp75; + unsigned int __cil_tmp76; + unsigned int __cil_tmp77; + CSHORT __cil_tmp78; + int __cil_tmp79; + unsigned int __cil_tmp80; + unsigned int __cil_tmp81; + PMDL __cil_tmp82; + unsigned int __cil_tmp83; + unsigned int __cil_tmp84; + PVOID __cil_tmp85; + unsigned int __cil_tmp86; + unsigned int __cil_tmp87; + PMDL __cil_tmp88; + enum _MEMORY_CACHING_TYPE __cil_tmp89; + void *__cil_tmp90; + enum _MM_PAGE_PRIORITY __cil_tmp91; + void *__cil_tmp92; + unsigned int __cil_tmp93; + unsigned int __cil_tmp94; + unsigned long __cil_tmp95; + unsigned int __cil_tmp96; + unsigned int __cil_tmp97; + unsigned long __cil_tmp98; + unsigned long __cil_tmp99; + ULONG __cil_tmp100; + ULONG __cil_tmp101; + unsigned long __cil_tmp102; + unsigned long __cil_tmp103; + unsigned long __cil_tmp104; + unsigned long __cil_tmp105; + ULONG __cil_tmp106; + unsigned long __cil_tmp107; + int __cil_tmp108; + int __cil_tmp109; + int __cil_tmp110; + unsigned long __cil_tmp111; + ULONG __cil_tmp112; + ULONG __cil_tmp113; + unsigned int __cil_tmp114; + unsigned int __cil_tmp115; + ULONG __cil_tmp116; + unsigned int __cil_tmp117; + unsigned int __cil_tmp118; + PUCHAR __cil_tmp119; + unsigned int __cil_tmp120; + unsigned int __cil_tmp121; + unsigned int __cil_tmp122; + unsigned int __cil_tmp123; + PUCHAR __cil_tmp124; + void *__cil_tmp125; + ULONG __cil_tmp126; + ULONG __cil_tmp127; + PCHAR __cil_tmp128; + void const *__cil_tmp129; + unsigned long __cil_tmp130; + unsigned long __cil_tmp131; + unsigned int __cil_tmp132; + unsigned int __cil_tmp133; + unsigned int __cil_tmp134; + ULONG __cil_tmp135; + int __cil_tmp136; + int __cil_tmp137; + int __cil_tmp138; + int __cil_tmp139; + int __cil_tmp140; + int __cil_tmp141; + unsigned long __cil_tmp142; + unsigned long __cil_tmp143; + unsigned long __cil_tmp144; + unsigned long __cil_tmp145; + ULONG __cil_tmp146; + int __cil_tmp147; + int __cil_tmp148; + int __cil_tmp149; + int __cil_tmp150; + int __cil_tmp151; + unsigned char __cil_tmp152; + int __cil_tmp153; + int __cil_tmp154; + int __cil_tmp155; + int __cil_tmp156; + int __cil_tmp157; + unsigned char __cil_tmp158; + int __cil_tmp159; + int __cil_tmp160; + int __cil_tmp161; + int __cil_tmp162; + int __cil_tmp163; + int __cil_tmp164; + int __cil_tmp165; + int __cil_tmp166; + int __cil_tmp167; + int __cil_tmp168; + int __cil_tmp169; + unsigned int __cil_tmp170; + unsigned int __cil_tmp171; + ULONG __cil_tmp172; + ULONG __cil_tmp173; + ULONG __cil_tmp174; + PCHAR __cil_tmp175; + void *__cil_tmp176; + void const *__cil_tmp177; + unsigned long __cil_tmp178; + unsigned long __cil_tmp179; + unsigned int __cil_tmp180; + int __cil_tmp181; + int __cil_tmp182; + int __cil_tmp183; + int __cil_tmp184; + int __cil_tmp185; + unsigned long __cil_tmp186; + unsigned int __cil_tmp187; + unsigned int __cil_tmp188; + unsigned int __cil_tmp189; + ULONG __cil_tmp190; + struct _BOOT_SECTOR_INFO *__cil_tmp191; + struct _IO_STACK_LOCATION **mem_192; + UCHAR *mem_193; + BOOLEAN *mem_194; + UCHAR *mem_195; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_196; + MEDIA_TYPE *mem_197; + UCHAR *mem_198; + ULONG *mem_199; + ULONG *mem_200; + UCHAR *mem_201; + UCHAR *mem_202; + PMDL *mem_203; + CSHORT *mem_204; + PMDL *mem_205; + PVOID *mem_206; + PMDL *mem_207; + UCHAR *mem_208; + ULONG *mem_209; + PUCHAR *mem_210; + PMDL *mem_211; + PUCHAR *mem_212; + PMDL *mem_213; + ULONG *mem_214; + ULONG_PTR *mem_215; { #line 5169 - __cil_tmp26 = 24 + 8; + __cil_tmp26 = 24 + 8; #line 5169 - __cil_tmp27 = 0 + __cil_tmp26; + __cil_tmp27 = 0 + __cil_tmp26; #line 5169 - __cil_tmp28 = 64 + __cil_tmp27; + __cil_tmp28 = 64 + __cil_tmp27; #line 5169 - __cil_tmp29 = (unsigned int )Irp; + __cil_tmp29 = (unsigned int)Irp; #line 5169 - __cil_tmp30 = __cil_tmp29 + __cil_tmp28; + __cil_tmp30 = __cil_tmp29 + __cil_tmp28; #line 5169 - mem_192 = (struct _IO_STACK_LOCATION **)__cil_tmp30; + mem_192 = (struct _IO_STACK_LOCATION **)__cil_tmp30; #line 5169 - irpSp = *mem_192; - { + irpSp = *mem_192; + { #line 5177 - while (1) { - while_155_continue: /* CIL Label */ ; - goto while_155_break; - } - while_155_break: /* CIL Label */ ; - } - { + while (1) { + while_155_continue: /* CIL Label */; + goto while_155_break; + } + while_155_break: /* CIL Label */; + } + { #line 5181 - mem_193 = (UCHAR *)irpSp; + mem_193 = (UCHAR *)irpSp; #line 5181 - __cil_tmp31 = *mem_193; + __cil_tmp31 = *mem_193; #line 5181 - __cil_tmp32 = (int )__cil_tmp31; + __cil_tmp32 = (int)__cil_tmp31; #line 5181 - if (__cil_tmp32 == 4) { - { + if (__cil_tmp32 == 4) { + { #line 5182 - __cil_tmp33 = (unsigned int )DisketteExtension; + __cil_tmp33 = (unsigned int)DisketteExtension; #line 5182 - __cil_tmp34 = __cil_tmp33 + 250; - { + __cil_tmp34 = __cil_tmp33 + 250; + { #line 5182 - mem_194 = (BOOLEAN *)__cil_tmp34; + mem_194 = (BOOLEAN *)__cil_tmp34; #line 5182 - if (*mem_194) { - { + if (*mem_194) { + { #line 5183 - while (1) { - while_156_continue: /* CIL Label */ ; - goto while_156_break; - } - while_156_break: /* CIL Label */ ; - } + while (1) { + while_156_continue: /* CIL Label */; + goto while_156_break; + } + while_156_break: /* CIL Label */; + } #line 5184 - return (-1073741811L); - } else { - - } - } - } + return (-1073741811L); + } else { + } + } + } #line 5186 - writeOperation = (unsigned char)1; - } else { + writeOperation = (unsigned char)1; + } else { #line 5188 - writeOperation = (unsigned char)0; - } - } - { + writeOperation = (unsigned char)0; + } + } + { #line 5191 - while (1) { - while_157_continue: /* CIL Label */ ; - goto while_157_break; - } - while_157_break: /* CIL Label */ ; - } + while (1) { + while_157_continue: /* CIL Label */; + goto while_157_break; + } + while_157_break: /* CIL Label */; + } #line 5195 - if (DriveStarted) { + if (DriveStarted) { #line 5196 - status = 0L; - } else { - { + status = 0L; + } else { + { #line 5198 - __cil_tmp35 = (unsigned int )irpSp; + __cil_tmp35 = (unsigned int)irpSp; #line 5198 - __cil_tmp36 = __cil_tmp35 + 2; + __cil_tmp36 = __cil_tmp35 + 2; #line 5198 - mem_195 = (UCHAR *)__cil_tmp36; + mem_195 = (UCHAR *)__cil_tmp36; #line 5198 - __cil_tmp37 = *mem_195; + __cil_tmp37 = *mem_195; #line 5198 - __cil_tmp38 = (int )__cil_tmp37; + __cil_tmp38 = (int)__cil_tmp37; #line 5198 - __cil_tmp39 = __cil_tmp38 & 2; + __cil_tmp39 = __cil_tmp38 & 2; #line 5198 - __cil_tmp40 = ! __cil_tmp39; + __cil_tmp40 = !__cil_tmp39; #line 5198 - __cil_tmp41 = ! __cil_tmp40; + __cil_tmp41 = !__cil_tmp40; #line 5198 - __cil_tmp42 = (unsigned char )__cil_tmp41; + __cil_tmp42 = (unsigned char)__cil_tmp41; #line 5198 - status = FlStartDrive(DisketteExtension, Irp, writeOperation, (unsigned char)1, - __cil_tmp42); + status = FlStartDrive(DisketteExtension, Irp, writeOperation, + (unsigned char)1, __cil_tmp42); + } } - } - { + { #line 5206 - __cil_tmp43 = status >= 0L; + __cil_tmp43 = status >= 0L; #line 5206 - if (! __cil_tmp43) { - { + if (!__cil_tmp43) { + { #line 5210 - while (1) { - while_158_continue: /* CIL Label */ ; - goto while_158_break; - } - while_158_break: /* CIL Label */ ; - } + while (1) { + while_158_continue: /* CIL Label */; + goto while_158_break; + } + while_158_break: /* CIL Label */; + } #line 5211 - return (status); - } else { - - } - } - { + return (status); + } else { + } + } + { #line 5214 - __cil_tmp44 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp44 = (KUSER_SHARED_DATA * const)4292804608U; #line 5214 - __cil_tmp45 = (unsigned int )__cil_tmp44; + __cil_tmp45 = (unsigned int)__cil_tmp44; #line 5214 - __cil_tmp46 = __cil_tmp45 + 732; + __cil_tmp46 = __cil_tmp45 + 732; #line 5214 - mem_196 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp46; + mem_196 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp46; #line 5214 - __cil_tmp47 = *mem_196; + __cil_tmp47 = *mem_196; #line 5214 - __cil_tmp48 = (int )__cil_tmp47; + __cil_tmp48 = (int)__cil_tmp47; #line 5214 - if (__cil_tmp48 == 1) { - { + if (__cil_tmp48 == 1) { + { #line 5216 - FlHdbit(DisketteExtension); + FlHdbit(DisketteExtension); + } + } else { + } } - } else { - - } - } - { + { #line 5220 - __cil_tmp49 = (unsigned int )DisketteExtension; + __cil_tmp49 = (unsigned int)DisketteExtension; #line 5220 - __cil_tmp50 = __cil_tmp49 + 184; + __cil_tmp50 = __cil_tmp49 + 184; #line 5220 - mem_197 = (MEDIA_TYPE *)__cil_tmp50; + mem_197 = (MEDIA_TYPE *)__cil_tmp50; #line 5220 - __cil_tmp51 = *mem_197; + __cil_tmp51 = *mem_197; #line 5220 - __cil_tmp52 = (int )__cil_tmp51; + __cil_tmp52 = (int)__cil_tmp51; #line 5220 - if (__cil_tmp52 == 0) { - { + if (__cil_tmp52 == 0) { + { #line 5221 - while (1) { - while_159_continue: /* CIL Label */ ; - goto while_159_break; - } - while_159_break: /* CIL Label */ ; - } + while (1) { + while_159_continue: /* CIL Label */; + goto while_159_break; + } + while_159_break: /* CIL Label */; + } #line 5222 - return (-1073741804L); - } else { - - } - } + return (-1073741804L); + } else { + } + } #line 5228 - __cil_tmp53 = (unsigned int )DisketteExtension; + __cil_tmp53 = (unsigned int)DisketteExtension; #line 5228 - __cil_tmp54 = __cil_tmp53 + 308; + __cil_tmp54 = __cil_tmp53 + 308; #line 5228 - driveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp54; + driveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp54; #line 5230 - __cil_tmp55 = (unsigned int )driveMediaConstants; + __cil_tmp55 = (unsigned int)driveMediaConstants; #line 5230 - __cil_tmp56 = __cil_tmp55 + 35; + __cil_tmp56 = __cil_tmp55 + 35; #line 5230 - mem_198 = (UCHAR *)__cil_tmp56; + mem_198 = (UCHAR *)__cil_tmp56; #line 5230 - __cil_tmp57 = *mem_198; + __cil_tmp57 = *mem_198; #line 5230 - __cil_tmp58 = (int )__cil_tmp57; + __cil_tmp58 = (int)__cil_tmp57; #line 5230 - __cil_tmp59 = 7 + __cil_tmp58; + __cil_tmp59 = 7 + __cil_tmp58; #line 5230 - byteToSectorShift = (unsigned long )__cil_tmp59; + byteToSectorShift = (unsigned long)__cil_tmp59; #line 5232 - __cil_tmp60 = 0 + 8; + __cil_tmp60 = 0 + 8; #line 5232 - __cil_tmp61 = 4 + __cil_tmp60; + __cil_tmp61 = 4 + __cil_tmp60; #line 5232 - __cil_tmp62 = (unsigned int )irpSp; + __cil_tmp62 = (unsigned int)irpSp; #line 5232 - __cil_tmp63 = __cil_tmp62 + __cil_tmp61; + __cil_tmp63 = __cil_tmp62 + __cil_tmp61; #line 5232 - mem_199 = (ULONG *)__cil_tmp63; + mem_199 = (ULONG *)__cil_tmp63; #line 5232 - __cil_tmp64 = *mem_199; + __cil_tmp64 = *mem_199; #line 5232 - firstSector = __cil_tmp64 >> byteToSectorShift; + firstSector = __cil_tmp64 >> byteToSectorShift; #line 5234 - __cil_tmp65 = (unsigned int )irpSp; + __cil_tmp65 = (unsigned int)irpSp; #line 5234 - __cil_tmp66 = __cil_tmp65 + 4; + __cil_tmp66 = __cil_tmp65 + 4; #line 5234 - mem_200 = (ULONG *)__cil_tmp66; + mem_200 = (ULONG *)__cil_tmp66; #line 5234 - __cil_tmp67 = *mem_200; + __cil_tmp67 = *mem_200; #line 5234 - __cil_tmp68 = __cil_tmp67 >> byteToSectorShift; + __cil_tmp68 = __cil_tmp67 >> byteToSectorShift; #line 5234 - lastSector = firstSector + __cil_tmp68; + lastSector = firstSector + __cil_tmp68; #line 5236 - __cil_tmp69 = (unsigned int )driveMediaConstants; + __cil_tmp69 = (unsigned int)driveMediaConstants; #line 5236 - __cil_tmp70 = __cil_tmp69 + 38; + __cil_tmp70 = __cil_tmp69 + 38; #line 5236 - mem_201 = (UCHAR *)__cil_tmp70; + mem_201 = (UCHAR *)__cil_tmp70; #line 5236 - sectorsPerTrack = *mem_201; + sectorsPerTrack = *mem_201; #line 5237 - __cil_tmp71 = (unsigned int )driveMediaConstants; + __cil_tmp71 = (unsigned int)driveMediaConstants; #line 5237 - __cil_tmp72 = __cil_tmp71 + 51; + __cil_tmp72 = __cil_tmp71 + 51; #line 5237 - mem_202 = (UCHAR *)__cil_tmp72; + mem_202 = (UCHAR *)__cil_tmp72; #line 5237 - numberOfHeads = *mem_202; - { + numberOfHeads = *mem_202; + { #line 5238 - __cil_tmp73 = (unsigned int )Irp; + __cil_tmp73 = (unsigned int)Irp; #line 5238 - __cil_tmp74 = __cil_tmp73 + 4; + __cil_tmp74 = __cil_tmp73 + 4; #line 5238 - mem_203 = (PMDL *)__cil_tmp74; + mem_203 = (PMDL *)__cil_tmp74; #line 5238 - __cil_tmp75 = *mem_203; + __cil_tmp75 = *mem_203; #line 5238 - __cil_tmp76 = (unsigned int )__cil_tmp75; + __cil_tmp76 = (unsigned int)__cil_tmp75; #line 5238 - __cil_tmp77 = __cil_tmp76 + 6; + __cil_tmp77 = __cil_tmp76 + 6; #line 5238 - mem_204 = (CSHORT *)__cil_tmp77; + mem_204 = (CSHORT *)__cil_tmp77; #line 5238 - __cil_tmp78 = *mem_204; + __cil_tmp78 = *mem_204; #line 5238 - __cil_tmp79 = (int )__cil_tmp78; + __cil_tmp79 = (int)__cil_tmp78; #line 5238 - if (__cil_tmp79 & 5) { + if (__cil_tmp79 & 5) { #line 5238 - __cil_tmp80 = (unsigned int )Irp; + __cil_tmp80 = (unsigned int)Irp; #line 5238 - __cil_tmp81 = __cil_tmp80 + 4; + __cil_tmp81 = __cil_tmp80 + 4; #line 5238 - mem_205 = (PMDL *)__cil_tmp81; + mem_205 = (PMDL *)__cil_tmp81; #line 5238 - __cil_tmp82 = *mem_205; + __cil_tmp82 = *mem_205; #line 5238 - __cil_tmp83 = (unsigned int )__cil_tmp82; + __cil_tmp83 = (unsigned int)__cil_tmp82; #line 5238 - __cil_tmp84 = __cil_tmp83 + 12; + __cil_tmp84 = __cil_tmp83 + 12; #line 5238 - mem_206 = (PVOID *)__cil_tmp84; + mem_206 = (PVOID *)__cil_tmp84; #line 5238 - __cil_tmp85 = *mem_206; + __cil_tmp85 = *mem_206; #line 5238 - userBuffer = (CHAR *)__cil_tmp85; - } else { - { + userBuffer = (CHAR *)__cil_tmp85; + } else { + { #line 5238 - __cil_tmp86 = (unsigned int )Irp; + __cil_tmp86 = (unsigned int)Irp; #line 5238 - __cil_tmp87 = __cil_tmp86 + 4; + __cil_tmp87 = __cil_tmp86 + 4; #line 5238 - mem_207 = (PMDL *)__cil_tmp87; + mem_207 = (PMDL *)__cil_tmp87; #line 5238 - __cil_tmp88 = *mem_207; + __cil_tmp88 = *mem_207; #line 5238 - __cil_tmp89 = (enum _MEMORY_CACHING_TYPE )1; + __cil_tmp89 = (enum _MEMORY_CACHING_TYPE)1; #line 5238 - __cil_tmp90 = (void *)0; + __cil_tmp90 = (void *)0; #line 5238 - __cil_tmp91 = (enum _MM_PAGE_PRIORITY )32; + __cil_tmp91 = (enum _MM_PAGE_PRIORITY)32; #line 5238 - tmp___0 = MmMapLockedPagesSpecifyCache(__cil_tmp88, (char)0, __cil_tmp89, __cil_tmp90, - 0UL, __cil_tmp91); + tmp___0 = MmMapLockedPagesSpecifyCache( + __cil_tmp88, (char)0, __cil_tmp89, __cil_tmp90, 0UL, __cil_tmp91); #line 5238 - userBuffer = (CHAR *)tmp___0; + userBuffer = (CHAR *)tmp___0; + } + } } - } - } - { + { #line 5240 - __cil_tmp92 = (void *)0; + __cil_tmp92 = (void *)0; #line 5240 - __cil_tmp93 = (unsigned int )__cil_tmp92; + __cil_tmp93 = (unsigned int)__cil_tmp92; #line 5240 - __cil_tmp94 = (unsigned int )userBuffer; + __cil_tmp94 = (unsigned int)userBuffer; #line 5240 - if (__cil_tmp94 == __cil_tmp93) { - { + if (__cil_tmp94 == __cil_tmp93) { + { #line 5243 - while (1) { - while_160_continue: /* CIL Label */ ; - goto while_160_break; - } - while_160_break: /* CIL Label */ ; - } + while (1) { + while_160_continue: /* CIL Label */; + goto while_160_break; + } + while_160_break: /* CIL Label */; + } #line 5244 - return (-1073741670L); - } else { - - } - } + return (-1073741670L); + } else { + } + } #line 5247 - __cil_tmp95 = (unsigned long )sectorsPerTrack; + __cil_tmp95 = (unsigned long)sectorsPerTrack; #line 5247 - trackSize = __cil_tmp95 << byteToSectorShift; + trackSize = __cil_tmp95 << byteToSectorShift; #line 5249 - skew = (unsigned char)0; + skew = (unsigned char)0; #line 5250 - __cil_tmp96 = (unsigned int )driveMediaConstants; + __cil_tmp96 = (unsigned int)driveMediaConstants; #line 5250 - __cil_tmp97 = __cil_tmp96 + 54; + __cil_tmp97 = __cil_tmp96 + 54; #line 5250 - mem_208 = (UCHAR *)__cil_tmp97; + mem_208 = (UCHAR *)__cil_tmp97; #line 5250 - skewDelta = *mem_208; + skewDelta = *mem_208; #line 5251 - currentSector = firstSector; - { + currentSector = firstSector; + { #line 5251 - while (1) { - while_161_continue: /* CIL Label */ ; + while (1) { + while_161_continue: /* CIL Label */; #line 5251 - if (currentSector < lastSector) { + if (currentSector < lastSector) { - } else { - goto while_161_break; - } + } else { + goto while_161_break; + } #line 5257 - __cil_tmp98 = (unsigned long )numberOfHeads; + __cil_tmp98 = (unsigned long)numberOfHeads; #line 5257 - __cil_tmp99 = (unsigned long )sectorsPerTrack; + __cil_tmp99 = (unsigned long)sectorsPerTrack; #line 5257 - __cil_tmp100 = currentSector / __cil_tmp99; + __cil_tmp100 = currentSector / __cil_tmp99; #line 5257 - __cil_tmp101 = __cil_tmp100 / __cil_tmp98; + __cil_tmp101 = __cil_tmp100 / __cil_tmp98; #line 5257 - currentCylinder = (unsigned char )__cil_tmp101; + currentCylinder = (unsigned char)__cil_tmp101; #line 5258 - __cil_tmp102 = (unsigned long )sectorsPerTrack; + __cil_tmp102 = (unsigned long)sectorsPerTrack; #line 5258 - __cil_tmp103 = currentSector % __cil_tmp102; + __cil_tmp103 = currentSector % __cil_tmp102; #line 5258 - trackSector = (unsigned char )__cil_tmp103; + trackSector = (unsigned char)__cil_tmp103; #line 5259 - __cil_tmp104 = (unsigned long )numberOfHeads; + __cil_tmp104 = (unsigned long)numberOfHeads; #line 5259 - __cil_tmp105 = (unsigned long )sectorsPerTrack; + __cil_tmp105 = (unsigned long)sectorsPerTrack; #line 5259 - __cil_tmp106 = currentSector / __cil_tmp105; + __cil_tmp106 = currentSector / __cil_tmp105; #line 5259 - __cil_tmp107 = __cil_tmp106 % __cil_tmp104; + __cil_tmp107 = __cil_tmp106 % __cil_tmp104; #line 5259 - currentHead = (unsigned char )__cil_tmp107; + currentHead = (unsigned char)__cil_tmp107; #line 5260 - __cil_tmp108 = (int )trackSector; + __cil_tmp108 = (int)trackSector; #line 5260 - __cil_tmp109 = (int )sectorsPerTrack; + __cil_tmp109 = (int)sectorsPerTrack; #line 5260 - __cil_tmp110 = __cil_tmp109 - __cil_tmp108; + __cil_tmp110 = __cil_tmp109 - __cil_tmp108; #line 5260 - numTransferSectors = (unsigned char )__cil_tmp110; - { + numTransferSectors = (unsigned char)__cil_tmp110; + { #line 5261 - __cil_tmp111 = (unsigned long )numTransferSectors; + __cil_tmp111 = (unsigned long)numTransferSectors; #line 5261 - __cil_tmp112 = lastSector - currentSector; + __cil_tmp112 = lastSector - currentSector; #line 5261 - if (__cil_tmp112 < __cil_tmp111) { + if (__cil_tmp112 < __cil_tmp111) { #line 5262 - __cil_tmp113 = lastSector - currentSector; + __cil_tmp113 = lastSector - currentSector; #line 5262 - numTransferSectors = (unsigned char )__cil_tmp113; - } else { - - } - } - { + numTransferSectors = (unsigned char)__cil_tmp113; + } else { + } + } + { #line 5272 - __cil_tmp114 = (unsigned int )DisketteExtension; + __cil_tmp114 = (unsigned int)DisketteExtension; #line 5272 - __cil_tmp115 = __cil_tmp114 + 108; + __cil_tmp115 = __cil_tmp114 + 108; #line 5272 - mem_209 = (ULONG *)__cil_tmp115; + mem_209 = (ULONG *)__cil_tmp115; #line 5272 - __cil_tmp116 = *mem_209; + __cil_tmp116 = *mem_209; #line 5272 - if (trackSize > __cil_tmp116) { - { + if (trackSize > __cil_tmp116) { + { #line 5276 - while (1) { - while_162_continue: /* CIL Label */ ; - goto while_162_break; - } - while_162_break: /* CIL Label */ ; - } - { + while (1) { + while_162_continue: /* CIL Label */; + goto while_162_break; + } + while_162_break: /* CIL Label */; + } + { #line 5277 - FlAllocateIoBuffer(DisketteExtension, trackSize); - } - { + FlAllocateIoBuffer(DisketteExtension, trackSize); + } + { #line 5278 - __cil_tmp117 = (unsigned int )DisketteExtension; + __cil_tmp117 = (unsigned int)DisketteExtension; #line 5278 - __cil_tmp118 = __cil_tmp117 + 124; + __cil_tmp118 = __cil_tmp117 + 124; #line 5278 - mem_210 = (PUCHAR *)__cil_tmp118; + mem_210 = (PUCHAR *)__cil_tmp118; #line 5278 - __cil_tmp119 = *mem_210; + __cil_tmp119 = *mem_210; #line 5278 - if (! __cil_tmp119) { - { + if (!__cil_tmp119) { + { #line 5282 - while (1) { - while_163_continue: /* CIL Label */ ; - goto while_163_break; - } - while_163_break: /* CIL Label */ ; - } + while (1) { + while_163_continue: /* CIL Label */; + goto while_163_break; + } + while_163_break: /* CIL Label */; + } #line 5283 - return (-1073741670L); - } else { - - } - } + return (-1073741670L); + } else { + } + } #line 5285 - __cil_tmp120 = (unsigned int )DisketteExtension; + __cil_tmp120 = (unsigned int)DisketteExtension; #line 5285 - __cil_tmp121 = __cil_tmp120 + 128; + __cil_tmp121 = __cil_tmp120 + 128; #line 5285 - mem_211 = (PMDL *)__cil_tmp121; + mem_211 = (PMDL *)__cil_tmp121; #line 5285 - mdl = *mem_211; + mdl = *mem_211; #line 5286 - __cil_tmp122 = (unsigned int )DisketteExtension; + __cil_tmp122 = (unsigned int)DisketteExtension; #line 5286 - __cil_tmp123 = __cil_tmp122 + 124; + __cil_tmp123 = __cil_tmp122 + 124; #line 5286 - mem_212 = (PUCHAR *)__cil_tmp123; + mem_212 = (PUCHAR *)__cil_tmp123; #line 5286 - __cil_tmp124 = *mem_212; + __cil_tmp124 = *mem_212; #line 5286 - ioBuffer = (CHAR *)__cil_tmp124; + ioBuffer = (CHAR *)__cil_tmp124; #line 5287 - ioOffset = 0UL; + ioOffset = 0UL; #line 5288 - if (writeOperation) { - { + if (writeOperation) { + { #line 5292 - __cil_tmp125 = (void *)ioBuffer; + __cil_tmp125 = (void *)ioBuffer; #line 5292 - __cil_tmp126 = currentSector - firstSector; + __cil_tmp126 = currentSector - firstSector; #line 5292 - __cil_tmp127 = __cil_tmp126 << byteToSectorShift; + __cil_tmp127 = __cil_tmp126 << byteToSectorShift; #line 5292 - __cil_tmp128 = userBuffer + __cil_tmp127; + __cil_tmp128 = userBuffer + __cil_tmp127; #line 5292 - __cil_tmp129 = (void const *)__cil_tmp128; + __cil_tmp129 = (void const *)__cil_tmp128; #line 5292 - __cil_tmp130 = (unsigned long )numTransferSectors; + __cil_tmp130 = (unsigned long)numTransferSectors; #line 5292 - __cil_tmp131 = __cil_tmp130 << byteToSectorShift; + __cil_tmp131 = __cil_tmp130 << byteToSectorShift; #line 5292 - __cil_tmp132 = (unsigned int )__cil_tmp131; + __cil_tmp132 = (unsigned int)__cil_tmp131; #line 5292 - memmove(__cil_tmp125, __cil_tmp129, __cil_tmp132); - } - } else { - - } - } else { + memmove(__cil_tmp125, __cil_tmp129, __cil_tmp132); + } + } else { + } + } else { #line 5295 - __cil_tmp133 = (unsigned int )Irp; + __cil_tmp133 = (unsigned int)Irp; #line 5295 - __cil_tmp134 = __cil_tmp133 + 4; + __cil_tmp134 = __cil_tmp133 + 4; #line 5295 - mem_213 = (PMDL *)__cil_tmp134; + mem_213 = (PMDL *)__cil_tmp134; #line 5295 - mdl = *mem_213; + mdl = *mem_213; #line 5296 - __cil_tmp135 = currentSector - firstSector; + __cil_tmp135 = currentSector - firstSector; #line 5296 - ioOffset = __cil_tmp135 << byteToSectorShift; - } - } - { + ioOffset = __cil_tmp135 << byteToSectorShift; + } + } + { #line 5307 - __cil_tmp136 = (int )trackSector; + __cil_tmp136 = (int)trackSector; #line 5307 - __cil_tmp137 = (int )numTransferSectors; + __cil_tmp137 = (int)numTransferSectors; #line 5307 - __cil_tmp138 = __cil_tmp137 + __cil_tmp136; + __cil_tmp138 = __cil_tmp137 + __cil_tmp136; #line 5307 - __cil_tmp139 = (int )skew; + __cil_tmp139 = (int)skew; #line 5307 - if (__cil_tmp139 >= __cil_tmp138) { + if (__cil_tmp139 >= __cil_tmp138) { #line 5308 - skew = (unsigned char)0; - } else { - - } - } - { + skew = (unsigned char)0; + } else { + } + } + { #line 5311 - __cil_tmp140 = (int )trackSector; + __cil_tmp140 = (int)trackSector; #line 5311 - __cil_tmp141 = (int )skew; + __cil_tmp141 = (int)skew; #line 5311 - if (__cil_tmp141 < __cil_tmp140) { + if (__cil_tmp141 < __cil_tmp140) { #line 5312 - skew = trackSector; - } else { - - } - } - { + skew = trackSector; + } else { + } + } + { #line 5317 - __cil_tmp142 = (unsigned long )trackSector; + __cil_tmp142 = (unsigned long)trackSector; #line 5317 - __cil_tmp143 = (unsigned long )skew; + __cil_tmp143 = (unsigned long)skew; #line 5317 - __cil_tmp144 = __cil_tmp143 - __cil_tmp142; + __cil_tmp144 = __cil_tmp143 - __cil_tmp142; #line 5317 - __cil_tmp145 = __cil_tmp144 << byteToSectorShift; + __cil_tmp145 = __cil_tmp144 << byteToSectorShift; #line 5317 - __cil_tmp146 = ioOffset + __cil_tmp145; + __cil_tmp146 = ioOffset + __cil_tmp145; #line 5317 - __cil_tmp147 = (int )skew; + __cil_tmp147 = (int)skew; #line 5317 - __cil_tmp148 = (int )trackSector; + __cil_tmp148 = (int)trackSector; #line 5317 - __cil_tmp149 = (int )numTransferSectors; + __cil_tmp149 = (int)numTransferSectors; #line 5317 - __cil_tmp150 = __cil_tmp149 + __cil_tmp148; + __cil_tmp150 = __cil_tmp149 + __cil_tmp148; #line 5317 - __cil_tmp151 = __cil_tmp150 - __cil_tmp147; + __cil_tmp151 = __cil_tmp150 - __cil_tmp147; #line 5317 - __cil_tmp152 = (unsigned char )__cil_tmp151; + __cil_tmp152 = (unsigned char)__cil_tmp151; #line 5317 - status = FlReadWriteTrack(DisketteExtension, mdl, __cil_tmp146, writeOperation, - currentCylinder, currentHead, skew, __cil_tmp152, (unsigned char)1); - } + status = + FlReadWriteTrack(DisketteExtension, mdl, __cil_tmp146, + writeOperation, currentCylinder, currentHead, + skew, __cil_tmp152, (unsigned char)1); + } #line 5330 - if (status >= 0L) { - { + if (status >= 0L) { + { #line 5330 - __cil_tmp153 = (int )trackSector; + __cil_tmp153 = (int)trackSector; #line 5330 - __cil_tmp154 = (int )skew; + __cil_tmp154 = (int)skew; #line 5330 - if (__cil_tmp154 > __cil_tmp153) { - { + if (__cil_tmp154 > __cil_tmp153) { + { #line 5331 - __cil_tmp155 = (int )trackSector; + __cil_tmp155 = (int)trackSector; #line 5331 - __cil_tmp156 = (int )skew; + __cil_tmp156 = (int)skew; #line 5331 - __cil_tmp157 = __cil_tmp156 - __cil_tmp155; + __cil_tmp157 = __cil_tmp156 - __cil_tmp155; #line 5331 - __cil_tmp158 = (unsigned char )__cil_tmp157; + __cil_tmp158 = (unsigned char)__cil_tmp157; #line 5331 - status = FlReadWriteTrack(DisketteExtension, mdl, ioOffset, writeOperation, - currentCylinder, currentHead, trackSector, __cil_tmp158, - (unsigned char)0); - } - } else { + status = FlReadWriteTrack(DisketteExtension, mdl, ioOffset, + writeOperation, currentCylinder, + currentHead, trackSector, + __cil_tmp158, (unsigned char)0); + } + } else { #line 5341 - __cil_tmp159 = (int )sectorsPerTrack; + __cil_tmp159 = (int)sectorsPerTrack; #line 5341 - __cil_tmp160 = (int )trackSector; + __cil_tmp160 = (int)trackSector; #line 5341 - __cil_tmp161 = (int )numTransferSectors; + __cil_tmp161 = (int)numTransferSectors; #line 5341 - __cil_tmp162 = __cil_tmp161 + __cil_tmp160; + __cil_tmp162 = __cil_tmp161 + __cil_tmp160; #line 5341 - __cil_tmp163 = __cil_tmp162 % __cil_tmp159; + __cil_tmp163 = __cil_tmp162 % __cil_tmp159; #line 5341 - skew = (unsigned char )__cil_tmp163; - } - } - } else { + skew = (unsigned char)__cil_tmp163; + } + } + } else { #line 5341 - __cil_tmp164 = (int )sectorsPerTrack; + __cil_tmp164 = (int)sectorsPerTrack; #line 5341 - __cil_tmp165 = (int )trackSector; + __cil_tmp165 = (int)trackSector; #line 5341 - __cil_tmp166 = (int )numTransferSectors; + __cil_tmp166 = (int)numTransferSectors; #line 5341 - __cil_tmp167 = __cil_tmp166 + __cil_tmp165; + __cil_tmp167 = __cil_tmp166 + __cil_tmp165; #line 5341 - __cil_tmp168 = __cil_tmp167 % __cil_tmp164; + __cil_tmp168 = __cil_tmp167 % __cil_tmp164; #line 5341 - skew = (unsigned char )__cil_tmp168; - } - { + skew = (unsigned char)__cil_tmp168; + } + { #line 5344 - __cil_tmp169 = status >= 0L; + __cil_tmp169 = status >= 0L; #line 5344 - if (! __cil_tmp169) { - goto while_161_break; - } else { - - } - } + if (!__cil_tmp169) { + goto while_161_break; + } else { + } + } #line 5353 - if (! writeOperation) { - { + if (!writeOperation) { + { #line 5353 - __cil_tmp170 = (unsigned int )DisketteExtension; + __cil_tmp170 = (unsigned int)DisketteExtension; #line 5353 - __cil_tmp171 = __cil_tmp170 + 108; + __cil_tmp171 = __cil_tmp170 + 108; #line 5353 - mem_214 = (ULONG *)__cil_tmp171; + mem_214 = (ULONG *)__cil_tmp171; #line 5353 - __cil_tmp172 = *mem_214; + __cil_tmp172 = *mem_214; #line 5353 - if (trackSize > __cil_tmp172) { - { + if (trackSize > __cil_tmp172) { + { #line 5359 - __cil_tmp173 = currentSector - firstSector; + __cil_tmp173 = currentSector - firstSector; #line 5359 - __cil_tmp174 = __cil_tmp173 << byteToSectorShift; + __cil_tmp174 = __cil_tmp173 << byteToSectorShift; #line 5359 - __cil_tmp175 = userBuffer + __cil_tmp174; + __cil_tmp175 = userBuffer + __cil_tmp174; #line 5359 - __cil_tmp176 = (void *)__cil_tmp175; + __cil_tmp176 = (void *)__cil_tmp175; #line 5359 - __cil_tmp177 = (void const *)ioBuffer; + __cil_tmp177 = (void const *)ioBuffer; #line 5359 - __cil_tmp178 = (unsigned long )numTransferSectors; + __cil_tmp178 = (unsigned long)numTransferSectors; #line 5359 - __cil_tmp179 = __cil_tmp178 << byteToSectorShift; + __cil_tmp179 = __cil_tmp178 << byteToSectorShift; #line 5359 - __cil_tmp180 = (unsigned int )__cil_tmp179; + __cil_tmp180 = (unsigned int)__cil_tmp179; #line 5359 - memmove(__cil_tmp176, __cil_tmp177, __cil_tmp180); + memmove(__cil_tmp176, __cil_tmp177, __cil_tmp180); + } + } else { + } + } + } else { } - } else { - - } - } - } else { - - } #line 5367 - __cil_tmp181 = (int )sectorsPerTrack; + __cil_tmp181 = (int)sectorsPerTrack; #line 5367 - __cil_tmp182 = (int )skewDelta; + __cil_tmp182 = (int)skewDelta; #line 5367 - __cil_tmp183 = (int )skew; + __cil_tmp183 = (int)skew; #line 5367 - __cil_tmp184 = __cil_tmp183 + __cil_tmp182; + __cil_tmp184 = __cil_tmp183 + __cil_tmp182; #line 5367 - __cil_tmp185 = __cil_tmp184 % __cil_tmp181; + __cil_tmp185 = __cil_tmp184 % __cil_tmp181; #line 5367 - skew = (unsigned char )__cil_tmp185; + skew = (unsigned char)__cil_tmp185; #line 5251 - __cil_tmp186 = (unsigned long )numTransferSectors; + __cil_tmp186 = (unsigned long)numTransferSectors; #line 5251 - currentSector = currentSector + __cil_tmp186; - } - while_161_break: /* CIL Label */ ; - } + currentSector = currentSector + __cil_tmp186; + } + while_161_break: /* CIL Label */; + } #line 5370 - __cil_tmp187 = 24 + 4; + __cil_tmp187 = 24 + 4; #line 5370 - __cil_tmp188 = (unsigned int )Irp; + __cil_tmp188 = (unsigned int)Irp; #line 5370 - __cil_tmp189 = __cil_tmp188 + __cil_tmp187; + __cil_tmp189 = __cil_tmp188 + __cil_tmp187; #line 5370 - __cil_tmp190 = currentSector - firstSector; + __cil_tmp190 = currentSector - firstSector; #line 5370 - mem_215 = (ULONG_PTR *)__cil_tmp189; + mem_215 = (ULONG_PTR *)__cil_tmp189; #line 5370 - *mem_215 = __cil_tmp190 << byteToSectorShift; + *mem_215 = __cil_tmp190 << byteToSectorShift; #line 5377 - if (status >= 0L) { + if (status >= 0L) { #line 5377 - if (firstSector == 0UL) { - { + if (firstSector == 0UL) { + { #line 5378 - __cil_tmp191 = (struct _BOOT_SECTOR_INFO *)userBuffer; + __cil_tmp191 = (struct _BOOT_SECTOR_INFO *)userBuffer; #line 5378 - FlConsolidateMediaTypeWithBootSector(DisketteExtension, __cil_tmp191); + FlConsolidateMediaTypeWithBootSector(DisketteExtension, __cil_tmp191); + } + } else { } } else { - } - } else { - - } - { + { #line 5385 - while (1) { - while_164_continue: /* CIL Label */ ; - goto while_164_break; - } - while_164_break: /* CIL Label */ ; - } + while (1) { + while_164_continue: /* CIL Label */; + goto while_164_break; + } + while_164_break: /* CIL Label */; + } #line 5386 - return (status); -} + return (status); + } } #line 5389 "floppy.c" -NTSTATUS FlFormat(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp ) -{ LARGE_INTEGER headSettleTime ; - PIO_STACK_LOCATION irpSp ; - PBAD_TRACK_NUMBER badTrackBuffer ; - PFORMAT_PARAMETERS formatParameters ; - PFORMAT_EX_PARAMETERS formatExParameters ; - PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - NTSTATUS ntStatus ; - ULONG badTrackBufferLength ; - DRIVE_MEDIA_TYPE driveMediaType ; - UCHAR driveStatus ; - UCHAR numberOfBadTracks ; - UCHAR currentTrack ; - UCHAR endTrack ; - UCHAR whichSector ; - UCHAR retryCount ; - BOOLEAN bufferOverflow ; - FDC_DISK_CHANGE_PARMS fdcDiskChangeParms ; - ULONG length ; - UCHAR tmp ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - PVOID __cil_tmp29 ; - int __cil_tmp30 ; - int __cil_tmp31 ; - int __cil_tmp32 ; - int __cil_tmp33 ; - int __cil_tmp34 ; - unsigned long __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - unsigned int __cil_tmp39 ; - ULONG __cil_tmp40 ; - unsigned int __cil_tmp41 ; - unsigned int __cil_tmp42 ; - PVOID __cil_tmp43 ; - void *__cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - unsigned int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - UCHAR __cil_tmp49 ; - int __cil_tmp50 ; - PDRIVE_MEDIA_LIMITS __cil_tmp51 ; - MEDIA_TYPE __cil_tmp52 ; - int __cil_tmp53 ; - unsigned int __cil_tmp54 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp55 ; - MEDIA_TYPE __cil_tmp56 ; - int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - unsigned int __cil_tmp59 ; - UCHAR __cil_tmp60 ; - int __cil_tmp61 ; - PDRIVE_MEDIA_LIMITS __cil_tmp62 ; - unsigned int __cil_tmp63 ; - unsigned int __cil_tmp64 ; - DRIVE_MEDIA_TYPE __cil_tmp65 ; - int __cil_tmp66 ; - int __cil_tmp67 ; - int __cil_tmp68 ; - int __cil_tmp69 ; - int __cil_tmp70 ; - unsigned int __cil_tmp71 ; - unsigned int __cil_tmp72 ; - unsigned int __cil_tmp73 ; - unsigned int __cil_tmp74 ; - unsigned int __cil_tmp75 ; - unsigned int __cil_tmp76 ; - unsigned int __cil_tmp77 ; - unsigned int __cil_tmp78 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp79 ; - unsigned int __cil_tmp80 ; - unsigned int __cil_tmp81 ; - unsigned int __cil_tmp82 ; - unsigned int __cil_tmp83 ; - unsigned int __cil_tmp84 ; - USHORT __cil_tmp85 ; - unsigned int __cil_tmp86 ; - unsigned int __cil_tmp87 ; - unsigned int __cil_tmp88 ; - unsigned int __cil_tmp89 ; - unsigned int __cil_tmp90 ; - USHORT __cil_tmp91 ; - unsigned int __cil_tmp92 ; - unsigned int __cil_tmp93 ; - unsigned int __cil_tmp94 ; - unsigned int __cil_tmp95 ; - unsigned int __cil_tmp96 ; - unsigned int __cil_tmp97 ; - USHORT __cil_tmp98 ; - unsigned int __cil_tmp99 ; - unsigned int __cil_tmp100 ; - unsigned int __cil_tmp101 ; - unsigned int __cil_tmp102 ; - UCHAR __cil_tmp103 ; - int __cil_tmp104 ; - unsigned int __cil_tmp105 ; - unsigned int __cil_tmp106 ; - UCHAR __cil_tmp107 ; - int __cil_tmp108 ; - int __cil_tmp109 ; - unsigned int __cil_tmp110 ; - unsigned int __cil_tmp111 ; - UCHAR __cil_tmp112 ; - int __cil_tmp113 ; - unsigned int __cil_tmp114 ; - unsigned int __cil_tmp115 ; - USHORT __cil_tmp116 ; - int __cil_tmp117 ; - int __cil_tmp118 ; - int __cil_tmp119 ; - int __cil_tmp120 ; - unsigned int __cil_tmp121 ; - unsigned int __cil_tmp122 ; - ULONG __cil_tmp123 ; - unsigned int __cil_tmp124 ; - unsigned int __cil_tmp125 ; - UCHAR __cil_tmp126 ; - unsigned long __cil_tmp127 ; - unsigned int __cil_tmp128 ; - unsigned int __cil_tmp129 ; - ULONG __cil_tmp130 ; - ULONG __cil_tmp131 ; - ULONG __cil_tmp132 ; - unsigned int __cil_tmp133 ; - unsigned int __cil_tmp134 ; - ULONG __cil_tmp135 ; - unsigned int __cil_tmp136 ; - unsigned int __cil_tmp137 ; - UCHAR __cil_tmp138 ; - unsigned long __cil_tmp139 ; - unsigned int __cil_tmp140 ; - unsigned int __cil_tmp141 ; - ULONG __cil_tmp142 ; - ULONG __cil_tmp143 ; - ULONG __cil_tmp144 ; - KUSER_SHARED_DATA *__cil_tmp145 ; - unsigned int __cil_tmp146 ; - unsigned int __cil_tmp147 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp148 ; - int __cil_tmp149 ; - int __cil_tmp150 ; - unsigned int __cil_tmp151 ; - unsigned int __cil_tmp152 ; - DRIVE_MEDIA_TYPE __cil_tmp153 ; - int __cil_tmp154 ; - int __cil_tmp155 ; - unsigned int __cil_tmp156 ; - unsigned int __cil_tmp157 ; - unsigned int __cil_tmp158 ; - unsigned int __cil_tmp159 ; - unsigned int __cil_tmp160 ; - unsigned int __cil_tmp161 ; - unsigned int __cil_tmp162 ; - unsigned int __cil_tmp163 ; - unsigned int __cil_tmp164 ; - unsigned int __cil_tmp165 ; - unsigned int __cil_tmp166 ; - unsigned int __cil_tmp167 ; - unsigned int __cil_tmp168 ; - unsigned int __cil_tmp169 ; - unsigned int __cil_tmp170 ; - unsigned int __cil_tmp171 ; - unsigned int __cil_tmp172 ; - unsigned int __cil_tmp173 ; - UCHAR __cil_tmp174 ; - int __cil_tmp175 ; - unsigned int __cil_tmp176 ; - unsigned int __cil_tmp177 ; - UCHAR __cil_tmp178 ; - int __cil_tmp179 ; - int __cil_tmp180 ; - int __cil_tmp181 ; - int __cil_tmp182 ; - unsigned int __cil_tmp183 ; - unsigned int __cil_tmp184 ; - unsigned int __cil_tmp185 ; - unsigned int __cil_tmp186 ; - UCHAR *__cil_tmp187 ; - unsigned int __cil_tmp188 ; - unsigned int __cil_tmp189 ; - unsigned int __cil_tmp190 ; - unsigned int __cil_tmp191 ; - UCHAR *__cil_tmp192 ; - void *__cil_tmp193 ; - struct _MDL *__cil_tmp194 ; - unsigned int __cil_tmp195 ; - unsigned int __cil_tmp196 ; - unsigned int __cil_tmp197 ; - unsigned int __cil_tmp198 ; - UCHAR __cil_tmp199 ; - int __cil_tmp200 ; - unsigned int __cil_tmp201 ; - unsigned int __cil_tmp202 ; - UCHAR __cil_tmp203 ; - int __cil_tmp204 ; - unsigned int __cil_tmp205 ; - unsigned int __cil_tmp206 ; - UCHAR __cil_tmp207 ; - int __cil_tmp208 ; - int __cil_tmp209 ; - int __cil_tmp210 ; - int __cil_tmp211 ; - unsigned char __cil_tmp212 ; - int __cil_tmp213 ; - unsigned int __cil_tmp214 ; - unsigned int __cil_tmp215 ; - unsigned int __cil_tmp216 ; - unsigned int __cil_tmp217 ; - UCHAR __cil_tmp218 ; - int __cil_tmp219 ; - LARGE_INTEGER *__cil_tmp220 ; - unsigned int __cil_tmp221 ; - unsigned int __cil_tmp222 ; - UCHAR __cil_tmp223 ; - int __cil_tmp224 ; - int __cil_tmp225 ; - int __cil_tmp226 ; - unsigned int __cil_tmp227 ; - unsigned int __cil_tmp228 ; - KUSER_SHARED_DATA *__cil_tmp229 ; - unsigned int __cil_tmp230 ; - unsigned int __cil_tmp231 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp232 ; - int __cil_tmp233 ; - int __cil_tmp234 ; - unsigned int __cil_tmp235 ; - unsigned int __cil_tmp236 ; - unsigned int __cil_tmp237 ; - unsigned int __cil_tmp238 ; - unsigned int __cil_tmp239 ; - unsigned int __cil_tmp240 ; - unsigned int __cil_tmp241 ; - unsigned int __cil_tmp242 ; - unsigned int __cil_tmp243 ; - unsigned int __cil_tmp244 ; - unsigned int __cil_tmp245 ; - unsigned int __cil_tmp246 ; - unsigned int __cil_tmp247 ; - unsigned int __cil_tmp248 ; - UCHAR *__cil_tmp249 ; - unsigned int __cil_tmp250 ; - unsigned int __cil_tmp251 ; - unsigned int __cil_tmp252 ; - unsigned int __cil_tmp253 ; - UCHAR *__cil_tmp254 ; - void *__cil_tmp255 ; - struct _MDL *__cil_tmp256 ; - unsigned int __cil_tmp257 ; - unsigned int __cil_tmp258 ; - int __cil_tmp259 ; - unsigned int __cil_tmp260 ; - unsigned int __cil_tmp261 ; - UCHAR __cil_tmp262 ; - int __cil_tmp263 ; - int __cil_tmp264 ; - int __cil_tmp265 ; - int __cil_tmp266 ; - unsigned int __cil_tmp267 ; - unsigned int __cil_tmp268 ; - PUCHAR __cil_tmp269 ; - PUCHAR __cil_tmp270 ; - unsigned int __cil_tmp271 ; - unsigned int __cil_tmp272 ; - UCHAR __cil_tmp273 ; - int __cil_tmp274 ; - int __cil_tmp275 ; - int __cil_tmp276 ; - int __cil_tmp277 ; - int __cil_tmp278 ; - int __cil_tmp279 ; - unsigned int __cil_tmp280 ; - unsigned int __cil_tmp281 ; - PUCHAR __cil_tmp282 ; - PUCHAR __cil_tmp283 ; - unsigned int __cil_tmp284 ; - unsigned int __cil_tmp285 ; - UCHAR __cil_tmp286 ; - int __cil_tmp287 ; - int __cil_tmp288 ; - int __cil_tmp289 ; - int __cil_tmp290 ; - int __cil_tmp291 ; - int __cil_tmp292 ; - unsigned int __cil_tmp293 ; - unsigned int __cil_tmp294 ; - PUCHAR __cil_tmp295 ; - PUCHAR __cil_tmp296 ; - unsigned int __cil_tmp297 ; - unsigned int __cil_tmp298 ; - unsigned int __cil_tmp299 ; - unsigned int __cil_tmp300 ; - USHORT __cil_tmp301 ; - int __cil_tmp302 ; - int __cil_tmp303 ; - int __cil_tmp304 ; - unsigned int __cil_tmp305 ; - unsigned int __cil_tmp306 ; - PUCHAR __cil_tmp307 ; - PUCHAR __cil_tmp308 ; - int __cil_tmp309 ; - int __cil_tmp310 ; - int __cil_tmp311 ; - int __cil_tmp312 ; - int __cil_tmp313 ; - unsigned int __cil_tmp314 ; - unsigned int __cil_tmp315 ; - PUCHAR __cil_tmp316 ; - PUCHAR __cil_tmp317 ; - unsigned int __cil_tmp318 ; - unsigned int __cil_tmp319 ; - int __cil_tmp320 ; - int __cil_tmp321 ; - unsigned int __cil_tmp322 ; - unsigned int __cil_tmp323 ; - USHORT __cil_tmp324 ; - unsigned int __cil_tmp325 ; - unsigned int __cil_tmp326 ; - unsigned int __cil_tmp327 ; - unsigned int __cil_tmp328 ; - unsigned int __cil_tmp329 ; - unsigned int __cil_tmp330 ; - unsigned int __cil_tmp331 ; - unsigned int __cil_tmp332 ; - unsigned int __cil_tmp333 ; - unsigned int __cil_tmp334 ; - UCHAR __cil_tmp335 ; - int __cil_tmp336 ; - unsigned int __cil_tmp337 ; - unsigned int __cil_tmp338 ; - UCHAR __cil_tmp339 ; - int __cil_tmp340 ; - int __cil_tmp341 ; - int __cil_tmp342 ; - int __cil_tmp343 ; - int __cil_tmp344 ; - unsigned int __cil_tmp345 ; - unsigned int __cil_tmp346 ; - unsigned int __cil_tmp347 ; - unsigned int __cil_tmp348 ; - unsigned int __cil_tmp349 ; - unsigned int __cil_tmp350 ; - unsigned int __cil_tmp351 ; - unsigned int __cil_tmp352 ; - unsigned int __cil_tmp353 ; - unsigned int __cil_tmp354 ; - unsigned int __cil_tmp355 ; - unsigned int __cil_tmp356 ; - unsigned int __cil_tmp357 ; - unsigned int __cil_tmp358 ; - unsigned int __cil_tmp359 ; - unsigned int __cil_tmp360 ; - unsigned int __cil_tmp361 ; - unsigned int __cil_tmp362 ; - unsigned int __cil_tmp363 ; - unsigned int __cil_tmp364 ; - unsigned int __cil_tmp365 ; - unsigned int __cil_tmp366 ; - unsigned int __cil_tmp367 ; - unsigned int __cil_tmp368 ; - unsigned int __cil_tmp369 ; - unsigned int __cil_tmp370 ; - unsigned int __cil_tmp371 ; - unsigned int __cil_tmp372 ; - UCHAR *__cil_tmp373 ; - unsigned int __cil_tmp374 ; - unsigned int __cil_tmp375 ; - unsigned int __cil_tmp376 ; - unsigned int __cil_tmp377 ; - UCHAR *__cil_tmp378 ; - unsigned int __cil_tmp379 ; - unsigned int __cil_tmp380 ; - PMDL __cil_tmp381 ; - int __cil_tmp382 ; - unsigned int __cil_tmp383 ; - unsigned int __cil_tmp384 ; - unsigned int __cil_tmp385 ; - unsigned int __cil_tmp386 ; - UCHAR __cil_tmp387 ; - int __cil_tmp388 ; - unsigned int __cil_tmp389 ; - unsigned int __cil_tmp390 ; - unsigned int __cil_tmp391 ; - unsigned int __cil_tmp392 ; - UCHAR __cil_tmp393 ; - int __cil_tmp394 ; - unsigned int __cil_tmp395 ; - unsigned int __cil_tmp396 ; - unsigned int __cil_tmp397 ; - unsigned int __cil_tmp398 ; - UCHAR __cil_tmp399 ; - int __cil_tmp400 ; - unsigned int __cil_tmp401 ; - unsigned int __cil_tmp402 ; - unsigned int __cil_tmp403 ; - unsigned int __cil_tmp404 ; - unsigned int __cil_tmp405 ; - unsigned int __cil_tmp406 ; - UCHAR __cil_tmp407 ; - unsigned int __cil_tmp408 ; - unsigned int __cil_tmp409 ; - unsigned int __cil_tmp410 ; - unsigned int __cil_tmp411 ; - UCHAR __cil_tmp412 ; - int __cil_tmp413 ; - int __cil_tmp414 ; - int __cil_tmp415 ; - int __cil_tmp416 ; - int __cil_tmp417 ; - int __cil_tmp418 ; - KUSER_SHARED_DATA *__cil_tmp419 ; - unsigned int __cil_tmp420 ; - unsigned int __cil_tmp421 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp422 ; - int __cil_tmp423 ; - unsigned int __cil_tmp424 ; - unsigned int __cil_tmp425 ; - unsigned int __cil_tmp426 ; - unsigned int __cil_tmp427 ; - unsigned int __cil_tmp428 ; - unsigned int __cil_tmp429 ; - unsigned int __cil_tmp430 ; - unsigned int __cil_tmp431 ; - unsigned int __cil_tmp432 ; - unsigned int __cil_tmp433 ; - unsigned int __cil_tmp434 ; - unsigned int __cil_tmp435 ; - unsigned int __cil_tmp436 ; - unsigned int __cil_tmp437 ; - UCHAR *__cil_tmp438 ; - unsigned int __cil_tmp439 ; - unsigned int __cil_tmp440 ; - unsigned int __cil_tmp441 ; - unsigned int __cil_tmp442 ; - UCHAR *__cil_tmp443 ; - void *__cil_tmp444 ; - struct _MDL *__cil_tmp445 ; - int __cil_tmp446 ; - unsigned int __cil_tmp447 ; - unsigned int __cil_tmp448 ; - unsigned int __cil_tmp449 ; - unsigned int __cil_tmp450 ; - UCHAR __cil_tmp451 ; - int __cil_tmp452 ; - unsigned int __cil_tmp453 ; - unsigned int __cil_tmp454 ; - PDEVICE_OBJECT __cil_tmp455 ; - int __cil_tmp456 ; - int __cil_tmp457 ; - int __cil_tmp458 ; - int __cil_tmp459 ; - unsigned long __cil_tmp460 ; - void *__cil_tmp461 ; - FDC_DISK_CHANGE_PARMS *__cil_tmp462 ; - unsigned int __cil_tmp463 ; - unsigned int __cil_tmp464 ; - UCHAR __cil_tmp465 ; - int __cil_tmp466 ; - int __cil_tmp467 ; - int __cil_tmp468 ; - int __cil_tmp469 ; - unsigned int __cil_tmp470 ; - unsigned int __cil_tmp471 ; - unsigned long __cil_tmp472 ; - unsigned int __cil_tmp473 ; - unsigned int __cil_tmp474 ; - PVOID __cil_tmp475 ; - int __cil_tmp476 ; - PBAD_TRACK_NUMBER __cil_tmp477 ; - int __cil_tmp478 ; - int __cil_tmp479 ; - int __cil_tmp480 ; - int __cil_tmp481 ; - int __cil_tmp482 ; - int __cil_tmp483 ; - int __cil_tmp484 ; - struct _IO_STACK_LOCATION **mem_485 ; - PVOID *mem_486 ; - ULONG *mem_487 ; - PVOID *mem_488 ; - ULONG *mem_489 ; - UCHAR *mem_490 ; - DRIVE_MEDIA_TYPE *mem_491 ; - MEDIA_TYPE *mem_492 ; - MEDIA_TYPE *mem_493 ; - UCHAR *mem_494 ; - DRIVE_MEDIA_TYPE *mem_495 ; - MEDIA_TYPE *mem_496 ; - MEDIA_TYPE *mem_497 ; - DRIVE_MEDIA_TYPE *mem_498 ; - DRIVE_MEDIA_CONSTANTS *mem_499 ; - USHORT *mem_500 ; - UCHAR *mem_501 ; - USHORT *mem_502 ; - UCHAR *mem_503 ; - USHORT *mem_504 ; - ULONG *mem_505 ; - UCHAR *mem_506 ; - UCHAR *mem_507 ; - UCHAR *mem_508 ; - USHORT *mem_509 ; - ULONG *mem_510 ; - ULONG *mem_511 ; - UCHAR *mem_512 ; - ULONG *mem_513 ; - ULONG *mem_514 ; - UCHAR *mem_515 ; - ULONG *mem_516 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_517 ; - DRIVE_MEDIA_TYPE *mem_518 ; - BOOLEAN *mem_519 ; - UCHAR *mem_520 ; - UCHAR *mem_521 ; - UCHAR *mem_522 ; - UCHAR *mem_523 ; - UCHAR *mem_524 ; - UCHAR *mem_525 ; - UCHAR *mem_526 ; - UCHAR *mem_527 ; - UCHAR *mem_528 ; - UCHAR *mem_529 ; - UCHAR *mem_530 ; - ULONG *mem_531 ; - LONG *mem_532 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_533 ; - UCHAR *mem_534 ; - UCHAR *mem_535 ; - UCHAR *mem_536 ; - BOOLEAN *mem_537 ; - UCHAR *mem_538 ; - PUCHAR *mem_539 ; - UCHAR *mem_540 ; - PUCHAR *mem_541 ; - UCHAR *mem_542 ; - PUCHAR *mem_543 ; - USHORT *mem_544 ; - PUCHAR *mem_545 ; - PUCHAR *mem_546 ; - UCHAR *mem_547 ; - USHORT *mem_548 ; - UCHAR *mem_549 ; - UCHAR *mem_550 ; - UCHAR *mem_551 ; - UCHAR *mem_552 ; - UCHAR *mem_553 ; - UCHAR *mem_554 ; - UCHAR *mem_555 ; - UCHAR *mem_556 ; - UCHAR *mem_557 ; - UCHAR *mem_558 ; - UCHAR *mem_559 ; - UCHAR *mem_560 ; - PMDL *mem_561 ; - UCHAR *mem_562 ; - UCHAR *mem_563 ; - UCHAR *mem_564 ; - BOOLEAN *mem_565 ; - UCHAR *mem_566 ; - UCHAR *mem_567 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_568 ; - UCHAR *mem_569 ; - UCHAR *mem_570 ; - UCHAR *mem_571 ; - UCHAR *mem_572 ; - PDEVICE_OBJECT *mem_573 ; - UCHAR *mem_574 ; - UCHAR *mem_575 ; - PVOID *mem_576 ; +NTSTATUS FlFormat(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp) { + LARGE_INTEGER headSettleTime; + PIO_STACK_LOCATION irpSp; + PBAD_TRACK_NUMBER badTrackBuffer; + PFORMAT_PARAMETERS formatParameters; + PFORMAT_EX_PARAMETERS formatExParameters; + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + NTSTATUS ntStatus; + ULONG badTrackBufferLength; + DRIVE_MEDIA_TYPE driveMediaType; + UCHAR driveStatus; + UCHAR numberOfBadTracks; + UCHAR currentTrack; + UCHAR endTrack; + UCHAR whichSector; + UCHAR retryCount; + BOOLEAN bufferOverflow; + FDC_DISK_CHANGE_PARMS fdcDiskChangeParms; + ULONG length; + UCHAR tmp; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + PVOID __cil_tmp29; + int __cil_tmp30; + int __cil_tmp31; + int __cil_tmp32; + int __cil_tmp33; + int __cil_tmp34; + unsigned long __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + unsigned int __cil_tmp39; + ULONG __cil_tmp40; + unsigned int __cil_tmp41; + unsigned int __cil_tmp42; + PVOID __cil_tmp43; + void *__cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + unsigned int __cil_tmp47; + unsigned int __cil_tmp48; + UCHAR __cil_tmp49; + int __cil_tmp50; + PDRIVE_MEDIA_LIMITS __cil_tmp51; + MEDIA_TYPE __cil_tmp52; + int __cil_tmp53; + unsigned int __cil_tmp54; + PDRIVE_MEDIA_CONSTANTS __cil_tmp55; + MEDIA_TYPE __cil_tmp56; + int __cil_tmp57; + unsigned int __cil_tmp58; + unsigned int __cil_tmp59; + UCHAR __cil_tmp60; + int __cil_tmp61; + PDRIVE_MEDIA_LIMITS __cil_tmp62; + unsigned int __cil_tmp63; + unsigned int __cil_tmp64; + DRIVE_MEDIA_TYPE __cil_tmp65; + int __cil_tmp66; + int __cil_tmp67; + int __cil_tmp68; + int __cil_tmp69; + int __cil_tmp70; + unsigned int __cil_tmp71; + unsigned int __cil_tmp72; + unsigned int __cil_tmp73; + unsigned int __cil_tmp74; + unsigned int __cil_tmp75; + unsigned int __cil_tmp76; + unsigned int __cil_tmp77; + unsigned int __cil_tmp78; + PDRIVE_MEDIA_CONSTANTS __cil_tmp79; + unsigned int __cil_tmp80; + unsigned int __cil_tmp81; + unsigned int __cil_tmp82; + unsigned int __cil_tmp83; + unsigned int __cil_tmp84; + USHORT __cil_tmp85; + unsigned int __cil_tmp86; + unsigned int __cil_tmp87; + unsigned int __cil_tmp88; + unsigned int __cil_tmp89; + unsigned int __cil_tmp90; + USHORT __cil_tmp91; + unsigned int __cil_tmp92; + unsigned int __cil_tmp93; + unsigned int __cil_tmp94; + unsigned int __cil_tmp95; + unsigned int __cil_tmp96; + unsigned int __cil_tmp97; + USHORT __cil_tmp98; + unsigned int __cil_tmp99; + unsigned int __cil_tmp100; + unsigned int __cil_tmp101; + unsigned int __cil_tmp102; + UCHAR __cil_tmp103; + int __cil_tmp104; + unsigned int __cil_tmp105; + unsigned int __cil_tmp106; + UCHAR __cil_tmp107; + int __cil_tmp108; + int __cil_tmp109; + unsigned int __cil_tmp110; + unsigned int __cil_tmp111; + UCHAR __cil_tmp112; + int __cil_tmp113; + unsigned int __cil_tmp114; + unsigned int __cil_tmp115; + USHORT __cil_tmp116; + int __cil_tmp117; + int __cil_tmp118; + int __cil_tmp119; + int __cil_tmp120; + unsigned int __cil_tmp121; + unsigned int __cil_tmp122; + ULONG __cil_tmp123; + unsigned int __cil_tmp124; + unsigned int __cil_tmp125; + UCHAR __cil_tmp126; + unsigned long __cil_tmp127; + unsigned int __cil_tmp128; + unsigned int __cil_tmp129; + ULONG __cil_tmp130; + ULONG __cil_tmp131; + ULONG __cil_tmp132; + unsigned int __cil_tmp133; + unsigned int __cil_tmp134; + ULONG __cil_tmp135; + unsigned int __cil_tmp136; + unsigned int __cil_tmp137; + UCHAR __cil_tmp138; + unsigned long __cil_tmp139; + unsigned int __cil_tmp140; + unsigned int __cil_tmp141; + ULONG __cil_tmp142; + ULONG __cil_tmp143; + ULONG __cil_tmp144; + KUSER_SHARED_DATA *__cil_tmp145; + unsigned int __cil_tmp146; + unsigned int __cil_tmp147; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp148; + int __cil_tmp149; + int __cil_tmp150; + unsigned int __cil_tmp151; + unsigned int __cil_tmp152; + DRIVE_MEDIA_TYPE __cil_tmp153; + int __cil_tmp154; + int __cil_tmp155; + unsigned int __cil_tmp156; + unsigned int __cil_tmp157; + unsigned int __cil_tmp158; + unsigned int __cil_tmp159; + unsigned int __cil_tmp160; + unsigned int __cil_tmp161; + unsigned int __cil_tmp162; + unsigned int __cil_tmp163; + unsigned int __cil_tmp164; + unsigned int __cil_tmp165; + unsigned int __cil_tmp166; + unsigned int __cil_tmp167; + unsigned int __cil_tmp168; + unsigned int __cil_tmp169; + unsigned int __cil_tmp170; + unsigned int __cil_tmp171; + unsigned int __cil_tmp172; + unsigned int __cil_tmp173; + UCHAR __cil_tmp174; + int __cil_tmp175; + unsigned int __cil_tmp176; + unsigned int __cil_tmp177; + UCHAR __cil_tmp178; + int __cil_tmp179; + int __cil_tmp180; + int __cil_tmp181; + int __cil_tmp182; + unsigned int __cil_tmp183; + unsigned int __cil_tmp184; + unsigned int __cil_tmp185; + unsigned int __cil_tmp186; + UCHAR *__cil_tmp187; + unsigned int __cil_tmp188; + unsigned int __cil_tmp189; + unsigned int __cil_tmp190; + unsigned int __cil_tmp191; + UCHAR *__cil_tmp192; + void *__cil_tmp193; + struct _MDL *__cil_tmp194; + unsigned int __cil_tmp195; + unsigned int __cil_tmp196; + unsigned int __cil_tmp197; + unsigned int __cil_tmp198; + UCHAR __cil_tmp199; + int __cil_tmp200; + unsigned int __cil_tmp201; + unsigned int __cil_tmp202; + UCHAR __cil_tmp203; + int __cil_tmp204; + unsigned int __cil_tmp205; + unsigned int __cil_tmp206; + UCHAR __cil_tmp207; + int __cil_tmp208; + int __cil_tmp209; + int __cil_tmp210; + int __cil_tmp211; + unsigned char __cil_tmp212; + int __cil_tmp213; + unsigned int __cil_tmp214; + unsigned int __cil_tmp215; + unsigned int __cil_tmp216; + unsigned int __cil_tmp217; + UCHAR __cil_tmp218; + int __cil_tmp219; + LARGE_INTEGER *__cil_tmp220; + unsigned int __cil_tmp221; + unsigned int __cil_tmp222; + UCHAR __cil_tmp223; + int __cil_tmp224; + int __cil_tmp225; + int __cil_tmp226; + unsigned int __cil_tmp227; + unsigned int __cil_tmp228; + KUSER_SHARED_DATA *__cil_tmp229; + unsigned int __cil_tmp230; + unsigned int __cil_tmp231; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp232; + int __cil_tmp233; + int __cil_tmp234; + unsigned int __cil_tmp235; + unsigned int __cil_tmp236; + unsigned int __cil_tmp237; + unsigned int __cil_tmp238; + unsigned int __cil_tmp239; + unsigned int __cil_tmp240; + unsigned int __cil_tmp241; + unsigned int __cil_tmp242; + unsigned int __cil_tmp243; + unsigned int __cil_tmp244; + unsigned int __cil_tmp245; + unsigned int __cil_tmp246; + unsigned int __cil_tmp247; + unsigned int __cil_tmp248; + UCHAR *__cil_tmp249; + unsigned int __cil_tmp250; + unsigned int __cil_tmp251; + unsigned int __cil_tmp252; + unsigned int __cil_tmp253; + UCHAR *__cil_tmp254; + void *__cil_tmp255; + struct _MDL *__cil_tmp256; + unsigned int __cil_tmp257; + unsigned int __cil_tmp258; + int __cil_tmp259; + unsigned int __cil_tmp260; + unsigned int __cil_tmp261; + UCHAR __cil_tmp262; + int __cil_tmp263; + int __cil_tmp264; + int __cil_tmp265; + int __cil_tmp266; + unsigned int __cil_tmp267; + unsigned int __cil_tmp268; + PUCHAR __cil_tmp269; + PUCHAR __cil_tmp270; + unsigned int __cil_tmp271; + unsigned int __cil_tmp272; + UCHAR __cil_tmp273; + int __cil_tmp274; + int __cil_tmp275; + int __cil_tmp276; + int __cil_tmp277; + int __cil_tmp278; + int __cil_tmp279; + unsigned int __cil_tmp280; + unsigned int __cil_tmp281; + PUCHAR __cil_tmp282; + PUCHAR __cil_tmp283; + unsigned int __cil_tmp284; + unsigned int __cil_tmp285; + UCHAR __cil_tmp286; + int __cil_tmp287; + int __cil_tmp288; + int __cil_tmp289; + int __cil_tmp290; + int __cil_tmp291; + int __cil_tmp292; + unsigned int __cil_tmp293; + unsigned int __cil_tmp294; + PUCHAR __cil_tmp295; + PUCHAR __cil_tmp296; + unsigned int __cil_tmp297; + unsigned int __cil_tmp298; + unsigned int __cil_tmp299; + unsigned int __cil_tmp300; + USHORT __cil_tmp301; + int __cil_tmp302; + int __cil_tmp303; + int __cil_tmp304; + unsigned int __cil_tmp305; + unsigned int __cil_tmp306; + PUCHAR __cil_tmp307; + PUCHAR __cil_tmp308; + int __cil_tmp309; + int __cil_tmp310; + int __cil_tmp311; + int __cil_tmp312; + int __cil_tmp313; + unsigned int __cil_tmp314; + unsigned int __cil_tmp315; + PUCHAR __cil_tmp316; + PUCHAR __cil_tmp317; + unsigned int __cil_tmp318; + unsigned int __cil_tmp319; + int __cil_tmp320; + int __cil_tmp321; + unsigned int __cil_tmp322; + unsigned int __cil_tmp323; + USHORT __cil_tmp324; + unsigned int __cil_tmp325; + unsigned int __cil_tmp326; + unsigned int __cil_tmp327; + unsigned int __cil_tmp328; + unsigned int __cil_tmp329; + unsigned int __cil_tmp330; + unsigned int __cil_tmp331; + unsigned int __cil_tmp332; + unsigned int __cil_tmp333; + unsigned int __cil_tmp334; + UCHAR __cil_tmp335; + int __cil_tmp336; + unsigned int __cil_tmp337; + unsigned int __cil_tmp338; + UCHAR __cil_tmp339; + int __cil_tmp340; + int __cil_tmp341; + int __cil_tmp342; + int __cil_tmp343; + int __cil_tmp344; + unsigned int __cil_tmp345; + unsigned int __cil_tmp346; + unsigned int __cil_tmp347; + unsigned int __cil_tmp348; + unsigned int __cil_tmp349; + unsigned int __cil_tmp350; + unsigned int __cil_tmp351; + unsigned int __cil_tmp352; + unsigned int __cil_tmp353; + unsigned int __cil_tmp354; + unsigned int __cil_tmp355; + unsigned int __cil_tmp356; + unsigned int __cil_tmp357; + unsigned int __cil_tmp358; + unsigned int __cil_tmp359; + unsigned int __cil_tmp360; + unsigned int __cil_tmp361; + unsigned int __cil_tmp362; + unsigned int __cil_tmp363; + unsigned int __cil_tmp364; + unsigned int __cil_tmp365; + unsigned int __cil_tmp366; + unsigned int __cil_tmp367; + unsigned int __cil_tmp368; + unsigned int __cil_tmp369; + unsigned int __cil_tmp370; + unsigned int __cil_tmp371; + unsigned int __cil_tmp372; + UCHAR *__cil_tmp373; + unsigned int __cil_tmp374; + unsigned int __cil_tmp375; + unsigned int __cil_tmp376; + unsigned int __cil_tmp377; + UCHAR *__cil_tmp378; + unsigned int __cil_tmp379; + unsigned int __cil_tmp380; + PMDL __cil_tmp381; + int __cil_tmp382; + unsigned int __cil_tmp383; + unsigned int __cil_tmp384; + unsigned int __cil_tmp385; + unsigned int __cil_tmp386; + UCHAR __cil_tmp387; + int __cil_tmp388; + unsigned int __cil_tmp389; + unsigned int __cil_tmp390; + unsigned int __cil_tmp391; + unsigned int __cil_tmp392; + UCHAR __cil_tmp393; + int __cil_tmp394; + unsigned int __cil_tmp395; + unsigned int __cil_tmp396; + unsigned int __cil_tmp397; + unsigned int __cil_tmp398; + UCHAR __cil_tmp399; + int __cil_tmp400; + unsigned int __cil_tmp401; + unsigned int __cil_tmp402; + unsigned int __cil_tmp403; + unsigned int __cil_tmp404; + unsigned int __cil_tmp405; + unsigned int __cil_tmp406; + UCHAR __cil_tmp407; + unsigned int __cil_tmp408; + unsigned int __cil_tmp409; + unsigned int __cil_tmp410; + unsigned int __cil_tmp411; + UCHAR __cil_tmp412; + int __cil_tmp413; + int __cil_tmp414; + int __cil_tmp415; + int __cil_tmp416; + int __cil_tmp417; + int __cil_tmp418; + KUSER_SHARED_DATA *__cil_tmp419; + unsigned int __cil_tmp420; + unsigned int __cil_tmp421; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp422; + int __cil_tmp423; + unsigned int __cil_tmp424; + unsigned int __cil_tmp425; + unsigned int __cil_tmp426; + unsigned int __cil_tmp427; + unsigned int __cil_tmp428; + unsigned int __cil_tmp429; + unsigned int __cil_tmp430; + unsigned int __cil_tmp431; + unsigned int __cil_tmp432; + unsigned int __cil_tmp433; + unsigned int __cil_tmp434; + unsigned int __cil_tmp435; + unsigned int __cil_tmp436; + unsigned int __cil_tmp437; + UCHAR *__cil_tmp438; + unsigned int __cil_tmp439; + unsigned int __cil_tmp440; + unsigned int __cil_tmp441; + unsigned int __cil_tmp442; + UCHAR *__cil_tmp443; + void *__cil_tmp444; + struct _MDL *__cil_tmp445; + int __cil_tmp446; + unsigned int __cil_tmp447; + unsigned int __cil_tmp448; + unsigned int __cil_tmp449; + unsigned int __cil_tmp450; + UCHAR __cil_tmp451; + int __cil_tmp452; + unsigned int __cil_tmp453; + unsigned int __cil_tmp454; + PDEVICE_OBJECT __cil_tmp455; + int __cil_tmp456; + int __cil_tmp457; + int __cil_tmp458; + int __cil_tmp459; + unsigned long __cil_tmp460; + void *__cil_tmp461; + FDC_DISK_CHANGE_PARMS *__cil_tmp462; + unsigned int __cil_tmp463; + unsigned int __cil_tmp464; + UCHAR __cil_tmp465; + int __cil_tmp466; + int __cil_tmp467; + int __cil_tmp468; + int __cil_tmp469; + unsigned int __cil_tmp470; + unsigned int __cil_tmp471; + unsigned long __cil_tmp472; + unsigned int __cil_tmp473; + unsigned int __cil_tmp474; + PVOID __cil_tmp475; + int __cil_tmp476; + PBAD_TRACK_NUMBER __cil_tmp477; + int __cil_tmp478; + int __cil_tmp479; + int __cil_tmp480; + int __cil_tmp481; + int __cil_tmp482; + int __cil_tmp483; + int __cil_tmp484; + struct _IO_STACK_LOCATION **mem_485; + PVOID *mem_486; + ULONG *mem_487; + PVOID *mem_488; + ULONG *mem_489; + UCHAR *mem_490; + DRIVE_MEDIA_TYPE *mem_491; + MEDIA_TYPE *mem_492; + MEDIA_TYPE *mem_493; + UCHAR *mem_494; + DRIVE_MEDIA_TYPE *mem_495; + MEDIA_TYPE *mem_496; + MEDIA_TYPE *mem_497; + DRIVE_MEDIA_TYPE *mem_498; + DRIVE_MEDIA_CONSTANTS *mem_499; + USHORT *mem_500; + UCHAR *mem_501; + USHORT *mem_502; + UCHAR *mem_503; + USHORT *mem_504; + ULONG *mem_505; + UCHAR *mem_506; + UCHAR *mem_507; + UCHAR *mem_508; + USHORT *mem_509; + ULONG *mem_510; + ULONG *mem_511; + UCHAR *mem_512; + ULONG *mem_513; + ULONG *mem_514; + UCHAR *mem_515; + ULONG *mem_516; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_517; + DRIVE_MEDIA_TYPE *mem_518; + BOOLEAN *mem_519; + UCHAR *mem_520; + UCHAR *mem_521; + UCHAR *mem_522; + UCHAR *mem_523; + UCHAR *mem_524; + UCHAR *mem_525; + UCHAR *mem_526; + UCHAR *mem_527; + UCHAR *mem_528; + UCHAR *mem_529; + UCHAR *mem_530; + ULONG *mem_531; + LONG *mem_532; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_533; + UCHAR *mem_534; + UCHAR *mem_535; + UCHAR *mem_536; + BOOLEAN *mem_537; + UCHAR *mem_538; + PUCHAR *mem_539; + UCHAR *mem_540; + PUCHAR *mem_541; + UCHAR *mem_542; + PUCHAR *mem_543; + USHORT *mem_544; + PUCHAR *mem_545; + PUCHAR *mem_546; + UCHAR *mem_547; + USHORT *mem_548; + UCHAR *mem_549; + UCHAR *mem_550; + UCHAR *mem_551; + UCHAR *mem_552; + UCHAR *mem_553; + UCHAR *mem_554; + UCHAR *mem_555; + UCHAR *mem_556; + UCHAR *mem_557; + UCHAR *mem_558; + UCHAR *mem_559; + UCHAR *mem_560; + PMDL *mem_561; + UCHAR *mem_562; + UCHAR *mem_563; + UCHAR *mem_564; + BOOLEAN *mem_565; + UCHAR *mem_566; + UCHAR *mem_567; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_568; + UCHAR *mem_569; + UCHAR *mem_570; + UCHAR *mem_571; + UCHAR *mem_572; + PDEVICE_OBJECT *mem_573; + UCHAR *mem_574; + UCHAR *mem_575; + PVOID *mem_576; { #line 5429 - numberOfBadTracks = (unsigned char)0; + numberOfBadTracks = (unsigned char)0; #line 5434 - bufferOverflow = (unsigned char)0; - { + bufferOverflow = (unsigned char)0; + { #line 5440 - while (1) { - while_165_continue: /* CIL Label */ ; - goto while_165_break; - } - while_165_break: /* CIL Label */ ; - } + while (1) { + while_165_continue: /* CIL Label */; + goto while_165_break; + } + while_165_break: /* CIL Label */; + } #line 5442 - __cil_tmp22 = 24 + 8; + __cil_tmp22 = 24 + 8; #line 5442 - __cil_tmp23 = 0 + __cil_tmp22; + __cil_tmp23 = 0 + __cil_tmp22; #line 5442 - __cil_tmp24 = 64 + __cil_tmp23; + __cil_tmp24 = 64 + __cil_tmp23; #line 5442 - __cil_tmp25 = (unsigned int )Irp; + __cil_tmp25 = (unsigned int)Irp; #line 5442 - __cil_tmp26 = __cil_tmp25 + __cil_tmp24; + __cil_tmp26 = __cil_tmp25 + __cil_tmp24; #line 5442 - mem_485 = (struct _IO_STACK_LOCATION **)__cil_tmp26; + mem_485 = (struct _IO_STACK_LOCATION **)__cil_tmp26; #line 5442 - irpSp = *mem_485; + irpSp = *mem_485; #line 5443 - __cil_tmp27 = (unsigned int )Irp; + __cil_tmp27 = (unsigned int)Irp; #line 5443 - __cil_tmp28 = __cil_tmp27 + 12; + __cil_tmp28 = __cil_tmp27 + 12; #line 5443 - mem_486 = (PVOID *)__cil_tmp28; + mem_486 = (PVOID *)__cil_tmp28; #line 5443 - __cil_tmp29 = *mem_486; + __cil_tmp29 = *mem_486; #line 5443 - formatParameters = (struct _FORMAT_PARAMETERS *)__cil_tmp29; - { + formatParameters = (struct _FORMAT_PARAMETERS *)__cil_tmp29; + { #line 5444 - __cil_tmp30 = 11 << 2; + __cil_tmp30 = 11 << 2; #line 5444 - __cil_tmp31 = 3 << 14; + __cil_tmp31 = 3 << 14; #line 5444 - __cil_tmp32 = 7 << 16; + __cil_tmp32 = 7 << 16; #line 5444 - __cil_tmp33 = __cil_tmp32 | __cil_tmp31; + __cil_tmp33 = __cil_tmp32 | __cil_tmp31; #line 5444 - __cil_tmp34 = __cil_tmp33 | __cil_tmp30; + __cil_tmp34 = __cil_tmp33 | __cil_tmp30; #line 5444 - __cil_tmp35 = (unsigned long )__cil_tmp34; + __cil_tmp35 = (unsigned long)__cil_tmp34; #line 5444 - __cil_tmp36 = 0 + 8; + __cil_tmp36 = 0 + 8; #line 5444 - __cil_tmp37 = 4 + __cil_tmp36; + __cil_tmp37 = 4 + __cil_tmp36; #line 5444 - __cil_tmp38 = (unsigned int )irpSp; + __cil_tmp38 = (unsigned int)irpSp; #line 5444 - __cil_tmp39 = __cil_tmp38 + __cil_tmp37; + __cil_tmp39 = __cil_tmp38 + __cil_tmp37; #line 5444 - mem_487 = (ULONG *)__cil_tmp39; + mem_487 = (ULONG *)__cil_tmp39; #line 5444 - __cil_tmp40 = *mem_487; + __cil_tmp40 = *mem_487; #line 5444 - if (__cil_tmp40 == __cil_tmp35) { + if (__cil_tmp40 == __cil_tmp35) { #line 5446 - __cil_tmp41 = (unsigned int )Irp; + __cil_tmp41 = (unsigned int)Irp; #line 5446 - __cil_tmp42 = __cil_tmp41 + 12; + __cil_tmp42 = __cil_tmp41 + 12; #line 5446 - mem_488 = (PVOID *)__cil_tmp42; + mem_488 = (PVOID *)__cil_tmp42; #line 5446 - __cil_tmp43 = *mem_488; + __cil_tmp43 = *mem_488; #line 5446 - formatExParameters = (struct _FORMAT_EX_PARAMETERS *)__cil_tmp43; - } else { + formatExParameters = (struct _FORMAT_EX_PARAMETERS *)__cil_tmp43; + } else { #line 5449 - __cil_tmp44 = (void *)0; + __cil_tmp44 = (void *)0; #line 5449 - formatExParameters = (struct _FORMAT_EX_PARAMETERS *)__cil_tmp44; - } - } - { + formatExParameters = (struct _FORMAT_EX_PARAMETERS *)__cil_tmp44; + } + } + { #line 5464 - while (1) { - while_166_continue: /* CIL Label */ ; - goto while_166_break; - } - while_166_break: /* CIL Label */ ; - } + while (1) { + while_166_continue: /* CIL Label */; + goto while_166_break; + } + while_166_break: /* CIL Label */; + } #line 5466 - __cil_tmp45 = (unsigned int )irpSp; + __cil_tmp45 = (unsigned int)irpSp; #line 5466 - __cil_tmp46 = __cil_tmp45 + 4; + __cil_tmp46 = __cil_tmp45 + 4; #line 5466 - mem_489 = (ULONG *)__cil_tmp46; + mem_489 = (ULONG *)__cil_tmp46; #line 5466 - badTrackBufferLength = *mem_489; + badTrackBufferLength = *mem_489; #line 5475 - __cil_tmp47 = (unsigned int )DisketteExtension; + __cil_tmp47 = (unsigned int)DisketteExtension; #line 5475 - __cil_tmp48 = __cil_tmp47 + 174; + __cil_tmp48 = __cil_tmp47 + 174; #line 5475 - mem_490 = (UCHAR *)__cil_tmp48; + mem_490 = (UCHAR *)__cil_tmp48; #line 5475 - __cil_tmp49 = *mem_490; + __cil_tmp49 = *mem_490; #line 5475 - __cil_tmp50 = (int )__cil_tmp49; + __cil_tmp50 = (int)__cil_tmp49; #line 5475 - __cil_tmp51 = DriveMediaLimits + __cil_tmp50; + __cil_tmp51 = DriveMediaLimits + __cil_tmp50; #line 5475 - mem_491 = (DRIVE_MEDIA_TYPE *)__cil_tmp51; + mem_491 = (DRIVE_MEDIA_TYPE *)__cil_tmp51; #line 5475 - driveMediaType = *mem_491; - { -#line 5478 - while (1) { - while_167_continue: /* CIL Label */ ; + driveMediaType = *mem_491; { #line 5478 - mem_492 = (MEDIA_TYPE *)formatParameters; + while (1) { + while_167_continue: /* CIL Label */; + { #line 5478 - __cil_tmp52 = *mem_492; + mem_492 = (MEDIA_TYPE *)formatParameters; #line 5478 - __cil_tmp53 = (int )__cil_tmp52; + __cil_tmp52 = *mem_492; #line 5478 - __cil_tmp54 = (unsigned int )driveMediaType; + __cil_tmp53 = (int)__cil_tmp52; #line 5478 - __cil_tmp55 = DriveMediaConstants + __cil_tmp54; + __cil_tmp54 = (unsigned int)driveMediaType; #line 5478 - mem_493 = (MEDIA_TYPE *)__cil_tmp55; + __cil_tmp55 = DriveMediaConstants + __cil_tmp54; #line 5478 - __cil_tmp56 = *mem_493; + mem_493 = (MEDIA_TYPE *)__cil_tmp55; #line 5478 - __cil_tmp57 = (int )__cil_tmp56; + __cil_tmp56 = *mem_493; #line 5478 - if (__cil_tmp57 != __cil_tmp53) { - { + __cil_tmp57 = (int)__cil_tmp56; #line 5478 - __cil_tmp58 = (unsigned int )DisketteExtension; + if (__cil_tmp57 != __cil_tmp53) { + { #line 5478 - __cil_tmp59 = __cil_tmp58 + 174; + __cil_tmp58 = (unsigned int)DisketteExtension; #line 5478 - mem_494 = (UCHAR *)__cil_tmp59; + __cil_tmp59 = __cil_tmp58 + 174; #line 5478 - __cil_tmp60 = *mem_494; + mem_494 = (UCHAR *)__cil_tmp59; #line 5478 - __cil_tmp61 = (int )__cil_tmp60; + __cil_tmp60 = *mem_494; #line 5478 - __cil_tmp62 = DriveMediaLimits + __cil_tmp61; + __cil_tmp61 = (int)__cil_tmp60; #line 5478 - __cil_tmp63 = (unsigned int )__cil_tmp62; + __cil_tmp62 = DriveMediaLimits + __cil_tmp61; #line 5478 - __cil_tmp64 = __cil_tmp63 + 32; + __cil_tmp63 = (unsigned int)__cil_tmp62; #line 5478 - mem_495 = (DRIVE_MEDIA_TYPE *)__cil_tmp64; + __cil_tmp64 = __cil_tmp63 + 32; #line 5478 - __cil_tmp65 = *mem_495; + mem_495 = (DRIVE_MEDIA_TYPE *)__cil_tmp64; #line 5478 - __cil_tmp66 = (int )__cil_tmp65; + __cil_tmp65 = *mem_495; #line 5478 - __cil_tmp67 = (int )driveMediaType; + __cil_tmp66 = (int)__cil_tmp65; #line 5478 - __cil_tmp68 = __cil_tmp67 > __cil_tmp66; + __cil_tmp67 = (int)driveMediaType; #line 5478 - if (! __cil_tmp68) { - goto while_167_break; - } else { - - } - } - } else { - goto while_167_break; - } - } + __cil_tmp68 = __cil_tmp67 > __cil_tmp66; +#line 5478 + if (!__cil_tmp68) { + goto while_167_break; + } else { + } + } + } else { + goto while_167_break; + } + } #line 5483 - __cil_tmp69 = (int )driveMediaType; + __cil_tmp69 = (int)driveMediaType; #line 5483 - __cil_tmp70 = __cil_tmp69 - 1; + __cil_tmp70 = __cil_tmp69 - 1; #line 5483 - driveMediaType = (enum _DRIVE_MEDIA_TYPE )__cil_tmp70; - } - while_167_break: /* CIL Label */ ; - } + driveMediaType = (enum _DRIVE_MEDIA_TYPE)__cil_tmp70; + } + while_167_break: /* CIL Label */; + } #line 5486 - __cil_tmp71 = (unsigned int )driveMediaType; + __cil_tmp71 = (unsigned int)driveMediaType; #line 5486 - driveMediaConstants = DriveMediaConstants + __cil_tmp71; + driveMediaConstants = DriveMediaConstants + __cil_tmp71; #line 5493 - __cil_tmp72 = (unsigned int )DisketteExtension; + __cil_tmp72 = (unsigned int)DisketteExtension; #line 5493 - __cil_tmp73 = __cil_tmp72 + 184; + __cil_tmp73 = __cil_tmp72 + 184; #line 5493 - mem_496 = (MEDIA_TYPE *)__cil_tmp73; + mem_496 = (MEDIA_TYPE *)__cil_tmp73; #line 5493 - mem_497 = (MEDIA_TYPE *)formatParameters; + mem_497 = (MEDIA_TYPE *)formatParameters; #line 5493 - *mem_496 = *mem_497; + *mem_496 = *mem_497; #line 5494 - __cil_tmp74 = (unsigned int )DisketteExtension; + __cil_tmp74 = (unsigned int)DisketteExtension; #line 5494 - __cil_tmp75 = __cil_tmp74 + 216; + __cil_tmp75 = __cil_tmp74 + 216; #line 5494 - mem_498 = (DRIVE_MEDIA_TYPE *)__cil_tmp75; + mem_498 = (DRIVE_MEDIA_TYPE *)__cil_tmp75; #line 5494 - *mem_498 = driveMediaType; + *mem_498 = driveMediaType; #line 5495 - __cil_tmp76 = (unsigned int )DisketteExtension; + __cil_tmp76 = (unsigned int)DisketteExtension; #line 5495 - __cil_tmp77 = __cil_tmp76 + 308; + __cil_tmp77 = __cil_tmp76 + 308; #line 5495 - __cil_tmp78 = (unsigned int )driveMediaType; + __cil_tmp78 = (unsigned int)driveMediaType; #line 5495 - __cil_tmp79 = DriveMediaConstants + __cil_tmp78; + __cil_tmp79 = DriveMediaConstants + __cil_tmp78; #line 5495 - mem_499 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp77; + mem_499 = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp77; #line 5495 - *mem_499 = *__cil_tmp79; + *mem_499 = *__cil_tmp79; #line 5498 - if (formatExParameters) { + if (formatExParameters) { #line 5499 - __cil_tmp80 = 308 + 38; + __cil_tmp80 = 308 + 38; #line 5499 - __cil_tmp81 = (unsigned int )DisketteExtension; + __cil_tmp81 = (unsigned int)DisketteExtension; #line 5499 - __cil_tmp82 = __cil_tmp81 + __cil_tmp80; + __cil_tmp82 = __cil_tmp81 + __cil_tmp80; #line 5499 - __cil_tmp83 = (unsigned int )formatExParameters; + __cil_tmp83 = (unsigned int)formatExParameters; #line 5499 - __cil_tmp84 = __cil_tmp83 + 50; + __cil_tmp84 = __cil_tmp83 + 50; #line 5499 - mem_500 = (USHORT *)__cil_tmp84; + mem_500 = (USHORT *)__cil_tmp84; #line 5499 - __cil_tmp85 = *mem_500; + __cil_tmp85 = *mem_500; #line 5499 - mem_501 = (UCHAR *)__cil_tmp82; + mem_501 = (UCHAR *)__cil_tmp82; #line 5499 - *mem_501 = (unsigned char )__cil_tmp85; + *mem_501 = (unsigned char)__cil_tmp85; #line 5501 - __cil_tmp86 = 308 + 40; + __cil_tmp86 = 308 + 40; #line 5501 - __cil_tmp87 = (unsigned int )DisketteExtension; + __cil_tmp87 = (unsigned int)DisketteExtension; #line 5501 - __cil_tmp88 = __cil_tmp87 + __cil_tmp86; + __cil_tmp88 = __cil_tmp87 + __cil_tmp86; #line 5501 - __cil_tmp89 = (unsigned int )formatExParameters; + __cil_tmp89 = (unsigned int)formatExParameters; #line 5501 - __cil_tmp90 = __cil_tmp89 + 48; + __cil_tmp90 = __cil_tmp89 + 48; #line 5501 - mem_502 = (USHORT *)__cil_tmp90; + mem_502 = (USHORT *)__cil_tmp90; #line 5501 - __cil_tmp91 = *mem_502; + __cil_tmp91 = *mem_502; #line 5501 - mem_503 = (UCHAR *)__cil_tmp88; + mem_503 = (UCHAR *)__cil_tmp88; #line 5501 - *mem_503 = (unsigned char )__cil_tmp91; - } else { - - } + *mem_503 = (unsigned char)__cil_tmp91; + } else { + } #line 5505 - __cil_tmp92 = (unsigned int )DisketteExtension; + __cil_tmp92 = (unsigned int)DisketteExtension; #line 5505 - __cil_tmp93 = __cil_tmp92 + 308; + __cil_tmp93 = __cil_tmp92 + 308; #line 5505 - driveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp93; + driveMediaConstants = (DRIVE_MEDIA_CONSTANTS *)__cil_tmp93; #line 5507 - __cil_tmp94 = (unsigned int )DisketteExtension; + __cil_tmp94 = (unsigned int)DisketteExtension; #line 5507 - __cil_tmp95 = __cil_tmp94 + 176; + __cil_tmp95 = __cil_tmp94 + 176; #line 5507 - __cil_tmp96 = (unsigned int )driveMediaConstants; + __cil_tmp96 = (unsigned int)driveMediaConstants; #line 5507 - __cil_tmp97 = __cil_tmp96 + 36; + __cil_tmp97 = __cil_tmp96 + 36; #line 5507 - mem_504 = (USHORT *)__cil_tmp97; + mem_504 = (USHORT *)__cil_tmp97; #line 5507 - __cil_tmp98 = *mem_504; + __cil_tmp98 = *mem_504; #line 5507 - mem_505 = (ULONG *)__cil_tmp95; + mem_505 = (ULONG *)__cil_tmp95; #line 5507 - *mem_505 = (unsigned long )__cil_tmp98; + *mem_505 = (unsigned long)__cil_tmp98; #line 5509 - __cil_tmp99 = (unsigned int )DisketteExtension; + __cil_tmp99 = (unsigned int)DisketteExtension; #line 5509 - __cil_tmp100 = __cil_tmp99 + 180; + __cil_tmp100 = __cil_tmp99 + 180; #line 5509 - __cil_tmp101 = (unsigned int )driveMediaConstants; + __cil_tmp101 = (unsigned int)driveMediaConstants; #line 5509 - __cil_tmp102 = __cil_tmp101 + 51; + __cil_tmp102 = __cil_tmp101 + 51; #line 5509 - mem_506 = (UCHAR *)__cil_tmp102; + mem_506 = (UCHAR *)__cil_tmp102; #line 5509 - __cil_tmp103 = *mem_506; + __cil_tmp103 = *mem_506; #line 5509 - __cil_tmp104 = (int )__cil_tmp103; + __cil_tmp104 = (int)__cil_tmp103; #line 5509 - __cil_tmp105 = (unsigned int )driveMediaConstants; + __cil_tmp105 = (unsigned int)driveMediaConstants; #line 5509 - __cil_tmp106 = __cil_tmp105 + 48; + __cil_tmp106 = __cil_tmp105 + 48; #line 5509 - mem_507 = (UCHAR *)__cil_tmp106; + mem_507 = (UCHAR *)__cil_tmp106; #line 5509 - __cil_tmp107 = *mem_507; + __cil_tmp107 = *mem_507; #line 5509 - __cil_tmp108 = (int )__cil_tmp107; + __cil_tmp108 = (int)__cil_tmp107; #line 5509 - __cil_tmp109 = 1 + __cil_tmp108; + __cil_tmp109 = 1 + __cil_tmp108; #line 5509 - __cil_tmp110 = (unsigned int )driveMediaConstants; + __cil_tmp110 = (unsigned int)driveMediaConstants; #line 5509 - __cil_tmp111 = __cil_tmp110 + 38; + __cil_tmp111 = __cil_tmp110 + 38; #line 5509 - mem_508 = (UCHAR *)__cil_tmp111; + mem_508 = (UCHAR *)__cil_tmp111; #line 5509 - __cil_tmp112 = *mem_508; + __cil_tmp112 = *mem_508; #line 5509 - __cil_tmp113 = (int )__cil_tmp112; + __cil_tmp113 = (int)__cil_tmp112; #line 5509 - __cil_tmp114 = (unsigned int )driveMediaConstants; + __cil_tmp114 = (unsigned int)driveMediaConstants; #line 5509 - __cil_tmp115 = __cil_tmp114 + 36; + __cil_tmp115 = __cil_tmp114 + 36; #line 5509 - mem_509 = (USHORT *)__cil_tmp115; + mem_509 = (USHORT *)__cil_tmp115; #line 5509 - __cil_tmp116 = *mem_509; + __cil_tmp116 = *mem_509; #line 5509 - __cil_tmp117 = (int )__cil_tmp116; + __cil_tmp117 = (int)__cil_tmp116; #line 5509 - __cil_tmp118 = __cil_tmp117 * __cil_tmp113; + __cil_tmp118 = __cil_tmp117 * __cil_tmp113; #line 5509 - __cil_tmp119 = __cil_tmp118 * __cil_tmp109; + __cil_tmp119 = __cil_tmp118 * __cil_tmp109; #line 5509 - __cil_tmp120 = __cil_tmp119 * __cil_tmp104; + __cil_tmp120 = __cil_tmp119 * __cil_tmp104; #line 5509 - mem_510 = (ULONG *)__cil_tmp100; + mem_510 = (ULONG *)__cil_tmp100; #line 5509 - *mem_510 = (unsigned long )__cil_tmp120; + *mem_510 = (unsigned long)__cil_tmp120; #line 5515 - __cil_tmp121 = (unsigned int )formatParameters; + __cil_tmp121 = (unsigned int)formatParameters; #line 5515 - __cil_tmp122 = __cil_tmp121 + 40; + __cil_tmp122 = __cil_tmp121 + 40; #line 5515 - mem_511 = (ULONG *)__cil_tmp122; + mem_511 = (ULONG *)__cil_tmp122; #line 5515 - __cil_tmp123 = *mem_511; + __cil_tmp123 = *mem_511; #line 5515 - __cil_tmp124 = (unsigned int )driveMediaConstants; + __cil_tmp124 = (unsigned int)driveMediaConstants; #line 5515 - __cil_tmp125 = __cil_tmp124 + 51; + __cil_tmp125 = __cil_tmp124 + 51; #line 5515 - mem_512 = (UCHAR *)__cil_tmp125; + mem_512 = (UCHAR *)__cil_tmp125; #line 5515 - __cil_tmp126 = *mem_512; + __cil_tmp126 = *mem_512; #line 5515 - __cil_tmp127 = (unsigned long )__cil_tmp126; + __cil_tmp127 = (unsigned long)__cil_tmp126; #line 5515 - __cil_tmp128 = (unsigned int )formatParameters; + __cil_tmp128 = (unsigned int)formatParameters; #line 5515 - __cil_tmp129 = __cil_tmp128 + 32; + __cil_tmp129 = __cil_tmp128 + 32; #line 5515 - mem_513 = (ULONG *)__cil_tmp129; + mem_513 = (ULONG *)__cil_tmp129; #line 5515 - __cil_tmp130 = *mem_513; + __cil_tmp130 = *mem_513; #line 5515 - __cil_tmp131 = __cil_tmp130 * __cil_tmp127; + __cil_tmp131 = __cil_tmp130 * __cil_tmp127; #line 5515 - __cil_tmp132 = __cil_tmp131 + __cil_tmp123; + __cil_tmp132 = __cil_tmp131 + __cil_tmp123; #line 5515 - currentTrack = (unsigned char )__cil_tmp132; + currentTrack = (unsigned char)__cil_tmp132; #line 5519 - __cil_tmp133 = (unsigned int )formatParameters; + __cil_tmp133 = (unsigned int)formatParameters; #line 5519 - __cil_tmp134 = __cil_tmp133 + 44; + __cil_tmp134 = __cil_tmp133 + 44; #line 5519 - mem_514 = (ULONG *)__cil_tmp134; + mem_514 = (ULONG *)__cil_tmp134; #line 5519 - __cil_tmp135 = *mem_514; + __cil_tmp135 = *mem_514; #line 5519 - __cil_tmp136 = (unsigned int )driveMediaConstants; + __cil_tmp136 = (unsigned int)driveMediaConstants; #line 5519 - __cil_tmp137 = __cil_tmp136 + 51; + __cil_tmp137 = __cil_tmp136 + 51; #line 5519 - mem_515 = (UCHAR *)__cil_tmp137; + mem_515 = (UCHAR *)__cil_tmp137; #line 5519 - __cil_tmp138 = *mem_515; + __cil_tmp138 = *mem_515; #line 5519 - __cil_tmp139 = (unsigned long )__cil_tmp138; + __cil_tmp139 = (unsigned long)__cil_tmp138; #line 5519 - __cil_tmp140 = (unsigned int )formatParameters; + __cil_tmp140 = (unsigned int)formatParameters; #line 5519 - __cil_tmp141 = __cil_tmp140 + 36; + __cil_tmp141 = __cil_tmp140 + 36; #line 5519 - mem_516 = (ULONG *)__cil_tmp141; + mem_516 = (ULONG *)__cil_tmp141; #line 5519 - __cil_tmp142 = *mem_516; + __cil_tmp142 = *mem_516; #line 5519 - __cil_tmp143 = __cil_tmp142 * __cil_tmp139; + __cil_tmp143 = __cil_tmp142 * __cil_tmp139; #line 5519 - __cil_tmp144 = __cil_tmp143 + __cil_tmp135; + __cil_tmp144 = __cil_tmp143 + __cil_tmp135; #line 5519 - endTrack = (unsigned char )__cil_tmp144; - { + endTrack = (unsigned char)__cil_tmp144; + { #line 5528 - while (1) { - while_168_continue: /* CIL Label */ ; - goto while_168_break; - } - while_168_break: /* CIL Label */ ; - } - { + while (1) { + while_168_continue: /* CIL Label */; + goto while_168_break; + } + while_168_break: /* CIL Label */; + } + { #line 5535 - __cil_tmp145 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp145 = (KUSER_SHARED_DATA * const)4292804608U; #line 5535 - __cil_tmp146 = (unsigned int )__cil_tmp145; + __cil_tmp146 = (unsigned int)__cil_tmp145; #line 5535 - __cil_tmp147 = __cil_tmp146 + 732; + __cil_tmp147 = __cil_tmp146 + 732; #line 5535 - mem_517 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp147; + mem_517 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp147; #line 5535 - __cil_tmp148 = *mem_517; + __cil_tmp148 = *mem_517; #line 5535 - __cil_tmp149 = (int )__cil_tmp148; + __cil_tmp149 = (int)__cil_tmp148; #line 5535 - if (__cil_tmp149 == 1) { - { + if (__cil_tmp149 == 1) { + { #line 5537 - FlHdbit(DisketteExtension); + FlHdbit(DisketteExtension); + } + } else { + } } - } else { - - } - } - { + { #line 5541 - __cil_tmp150 = (int )driveMediaType; + __cil_tmp150 = (int)driveMediaType; #line 5541 - __cil_tmp151 = (unsigned int )DisketteExtension; + __cil_tmp151 = (unsigned int)DisketteExtension; #line 5541 - __cil_tmp152 = __cil_tmp151 + 140; + __cil_tmp152 = __cil_tmp151 + 140; #line 5541 - mem_518 = (DRIVE_MEDIA_TYPE *)__cil_tmp152; + mem_518 = (DRIVE_MEDIA_TYPE *)__cil_tmp152; #line 5541 - __cil_tmp153 = *mem_518; + __cil_tmp153 = *mem_518; #line 5541 - __cil_tmp154 = (int )__cil_tmp153; + __cil_tmp154 = (int)__cil_tmp153; #line 5541 - if (__cil_tmp154 != __cil_tmp150) { - { + if (__cil_tmp154 != __cil_tmp150) { + { #line 5543 - ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); - } - { + ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); + } + { #line 5545 - __cil_tmp155 = ntStatus >= 0L; + __cil_tmp155 = ntStatus >= 0L; #line 5545 - if (! __cil_tmp155) { + if (!__cil_tmp155) { #line 5547 - return (ntStatus); - } else { - - } + return (ntStatus); + } else { + } + } + } else { + } } - } else { - - } - } #line 5555 - __cil_tmp156 = (unsigned int )DisketteExtension; + __cil_tmp156 = (unsigned int)DisketteExtension; #line 5555 - __cil_tmp157 = __cil_tmp156 + 250; + __cil_tmp157 = __cil_tmp156 + 250; #line 5555 - mem_519 = (BOOLEAN *)__cil_tmp157; + mem_519 = (BOOLEAN *)__cil_tmp157; #line 5555 - *mem_519 = (unsigned char)0; - { + *mem_519 = (unsigned char)0; + { #line 5561 - while (1) { - while_169_continue: /* CIL Label */ ; + while (1) { + while_169_continue: /* CIL Label */; #line 5567 - __cil_tmp158 = 0 * 1U; + __cil_tmp158 = 0 * 1U; #line 5567 - __cil_tmp159 = 112 + __cil_tmp158; + __cil_tmp159 = 112 + __cil_tmp158; #line 5567 - __cil_tmp160 = (unsigned int )DisketteExtension; + __cil_tmp160 = (unsigned int)DisketteExtension; #line 5567 - __cil_tmp161 = __cil_tmp160 + __cil_tmp159; + __cil_tmp161 = __cil_tmp160 + __cil_tmp159; #line 5567 - mem_520 = (UCHAR *)__cil_tmp161; + mem_520 = (UCHAR *)__cil_tmp161; #line 5567 - *mem_520 = (unsigned char)16; + *mem_520 = (unsigned char)16; #line 5568 - __cil_tmp162 = 1 * 1U; + __cil_tmp162 = 1 * 1U; #line 5568 - __cil_tmp163 = 112 + __cil_tmp162; + __cil_tmp163 = 112 + __cil_tmp162; #line 5568 - __cil_tmp164 = (unsigned int )DisketteExtension; + __cil_tmp164 = (unsigned int)DisketteExtension; #line 5568 - __cil_tmp165 = __cil_tmp164 + __cil_tmp163; + __cil_tmp165 = __cil_tmp164 + __cil_tmp163; #line 5568 - __cil_tmp166 = (unsigned int )DisketteExtension; + __cil_tmp166 = (unsigned int)DisketteExtension; #line 5568 - __cil_tmp167 = __cil_tmp166 + 248; + __cil_tmp167 = __cil_tmp166 + 248; #line 5568 - mem_521 = (UCHAR *)__cil_tmp165; + mem_521 = (UCHAR *)__cil_tmp165; #line 5568 - mem_522 = (UCHAR *)__cil_tmp167; + mem_522 = (UCHAR *)__cil_tmp167; #line 5568 - *mem_521 = *mem_522; + *mem_521 = *mem_522; #line 5569 - __cil_tmp168 = 2 * 1U; + __cil_tmp168 = 2 * 1U; #line 5569 - __cil_tmp169 = 112 + __cil_tmp168; + __cil_tmp169 = 112 + __cil_tmp168; #line 5569 - __cil_tmp170 = (unsigned int )DisketteExtension; + __cil_tmp170 = (unsigned int)DisketteExtension; #line 5569 - __cil_tmp171 = __cil_tmp170 + __cil_tmp169; + __cil_tmp171 = __cil_tmp170 + __cil_tmp169; #line 5569 - __cil_tmp172 = (unsigned int )driveMediaConstants; + __cil_tmp172 = (unsigned int)driveMediaConstants; #line 5569 - __cil_tmp173 = __cil_tmp172 + 49; + __cil_tmp173 = __cil_tmp172 + 49; #line 5569 - mem_523 = (UCHAR *)__cil_tmp173; + mem_523 = (UCHAR *)__cil_tmp173; #line 5569 - __cil_tmp174 = *mem_523; + __cil_tmp174 = *mem_523; #line 5569 - __cil_tmp175 = (int )__cil_tmp174; + __cil_tmp175 = (int)__cil_tmp174; #line 5569 - __cil_tmp176 = (unsigned int )driveMediaConstants; + __cil_tmp176 = (unsigned int)driveMediaConstants; #line 5569 - __cil_tmp177 = __cil_tmp176 + 51; + __cil_tmp177 = __cil_tmp176 + 51; #line 5569 - mem_524 = (UCHAR *)__cil_tmp177; + mem_524 = (UCHAR *)__cil_tmp177; #line 5569 - __cil_tmp178 = *mem_524; + __cil_tmp178 = *mem_524; #line 5569 - __cil_tmp179 = (int )__cil_tmp178; + __cil_tmp179 = (int)__cil_tmp178; #line 5569 - __cil_tmp180 = (int )currentTrack; + __cil_tmp180 = (int)currentTrack; #line 5569 - __cil_tmp181 = __cil_tmp180 / __cil_tmp179; + __cil_tmp181 = __cil_tmp180 / __cil_tmp179; #line 5569 - __cil_tmp182 = __cil_tmp181 << __cil_tmp175; + __cil_tmp182 = __cil_tmp181 << __cil_tmp175; #line 5569 - mem_525 = (UCHAR *)__cil_tmp171; + mem_525 = (UCHAR *)__cil_tmp171; #line 5569 - *mem_525 = (unsigned char )__cil_tmp182; - { + *mem_525 = (unsigned char)__cil_tmp182; + { #line 5577 - while (1) { - while_170_continue: /* CIL Label */ ; - goto while_170_break; - } - while_170_break: /* CIL Label */ ; - } - { + while (1) { + while_170_continue: /* CIL Label */; + goto while_170_break; + } + while_170_break: /* CIL Label */; + } + { #line 5579 - __cil_tmp183 = 0 * 1U; + __cil_tmp183 = 0 * 1U; #line 5579 - __cil_tmp184 = 112 + __cil_tmp183; + __cil_tmp184 = 112 + __cil_tmp183; #line 5579 - __cil_tmp185 = (unsigned int )DisketteExtension; + __cil_tmp185 = (unsigned int)DisketteExtension; #line 5579 - __cil_tmp186 = __cil_tmp185 + __cil_tmp184; + __cil_tmp186 = __cil_tmp185 + __cil_tmp184; #line 5579 - __cil_tmp187 = (UCHAR *)__cil_tmp186; + __cil_tmp187 = (UCHAR *)__cil_tmp186; #line 5579 - __cil_tmp188 = 0 * 1U; + __cil_tmp188 = 0 * 1U; #line 5579 - __cil_tmp189 = 112 + __cil_tmp188; + __cil_tmp189 = 112 + __cil_tmp188; #line 5579 - __cil_tmp190 = (unsigned int )DisketteExtension; + __cil_tmp190 = (unsigned int)DisketteExtension; #line 5579 - __cil_tmp191 = __cil_tmp190 + __cil_tmp189; + __cil_tmp191 = __cil_tmp190 + __cil_tmp189; #line 5579 - __cil_tmp192 = (UCHAR *)__cil_tmp191; + __cil_tmp192 = (UCHAR *)__cil_tmp191; #line 5579 - __cil_tmp193 = (void *)0; + __cil_tmp193 = (void *)0; #line 5579 - __cil_tmp194 = (struct _MDL *)__cil_tmp193; + __cil_tmp194 = (struct _MDL *)__cil_tmp193; #line 5579 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp187, __cil_tmp192, __cil_tmp194, - 0UL, 0UL); - } + ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp187, + __cil_tmp192, __cil_tmp194, 0UL, 0UL); + } #line 5586 - if (ntStatus >= 0L) { - { + if (ntStatus >= 0L) { + { #line 5588 - __cil_tmp195 = 0 * 1U; + __cil_tmp195 = 0 * 1U; #line 5588 - __cil_tmp196 = 112 + __cil_tmp195; + __cil_tmp196 = 112 + __cil_tmp195; #line 5588 - __cil_tmp197 = (unsigned int )DisketteExtension; + __cil_tmp197 = (unsigned int)DisketteExtension; #line 5588 - __cil_tmp198 = __cil_tmp197 + __cil_tmp196; + __cil_tmp198 = __cil_tmp197 + __cil_tmp196; #line 5588 - mem_526 = (UCHAR *)__cil_tmp198; + mem_526 = (UCHAR *)__cil_tmp198; #line 5588 - __cil_tmp199 = *mem_526; + __cil_tmp199 = *mem_526; #line 5588 - __cil_tmp200 = (int )__cil_tmp199; + __cil_tmp200 = (int)__cil_tmp199; #line 5588 - if (__cil_tmp200 & 32) { - { + if (__cil_tmp200 & 32) { + { #line 5588 - __cil_tmp201 = (unsigned int )driveMediaConstants; + __cil_tmp201 = (unsigned int)driveMediaConstants; #line 5588 - __cil_tmp202 = __cil_tmp201 + 49; + __cil_tmp202 = __cil_tmp201 + 49; #line 5588 - mem_527 = (UCHAR *)__cil_tmp202; + mem_527 = (UCHAR *)__cil_tmp202; #line 5588 - __cil_tmp203 = *mem_527; + __cil_tmp203 = *mem_527; #line 5588 - __cil_tmp204 = (int )__cil_tmp203; + __cil_tmp204 = (int)__cil_tmp203; #line 5588 - __cil_tmp205 = (unsigned int )driveMediaConstants; + __cil_tmp205 = (unsigned int)driveMediaConstants; #line 5588 - __cil_tmp206 = __cil_tmp205 + 51; + __cil_tmp206 = __cil_tmp205 + 51; #line 5588 - mem_528 = (UCHAR *)__cil_tmp206; + mem_528 = (UCHAR *)__cil_tmp206; #line 5588 - __cil_tmp207 = *mem_528; + __cil_tmp207 = *mem_528; #line 5588 - __cil_tmp208 = (int )__cil_tmp207; + __cil_tmp208 = (int)__cil_tmp207; #line 5588 - __cil_tmp209 = (int )currentTrack; + __cil_tmp209 = (int)currentTrack; #line 5588 - __cil_tmp210 = __cil_tmp209 / __cil_tmp208; + __cil_tmp210 = __cil_tmp209 / __cil_tmp208; #line 5588 - __cil_tmp211 = __cil_tmp210 << __cil_tmp204; + __cil_tmp211 = __cil_tmp210 << __cil_tmp204; #line 5588 - __cil_tmp212 = (unsigned char )__cil_tmp211; + __cil_tmp212 = (unsigned char)__cil_tmp211; #line 5588 - __cil_tmp213 = (int )__cil_tmp212; + __cil_tmp213 = (int)__cil_tmp212; #line 5588 - __cil_tmp214 = 1 * 1U; + __cil_tmp214 = 1 * 1U; #line 5588 - __cil_tmp215 = 112 + __cil_tmp214; + __cil_tmp215 = 112 + __cil_tmp214; #line 5588 - __cil_tmp216 = (unsigned int )DisketteExtension; + __cil_tmp216 = (unsigned int)DisketteExtension; #line 5588 - __cil_tmp217 = __cil_tmp216 + __cil_tmp215; + __cil_tmp217 = __cil_tmp216 + __cil_tmp215; #line 5588 - mem_529 = (UCHAR *)__cil_tmp217; + mem_529 = (UCHAR *)__cil_tmp217; #line 5588 - __cil_tmp218 = *mem_529; + __cil_tmp218 = *mem_529; #line 5588 - __cil_tmp219 = (int )__cil_tmp218; + __cil_tmp219 = (int)__cil_tmp218; #line 5588 - if (__cil_tmp219 == __cil_tmp213) { - { + if (__cil_tmp219 == __cil_tmp213) { + { #line 5598 - __cil_tmp220 = & headSettleTime; + __cil_tmp220 = &headSettleTime; #line 5598 - __cil_tmp221 = (unsigned int )driveMediaConstants; + __cil_tmp221 = (unsigned int)driveMediaConstants; #line 5598 - __cil_tmp222 = __cil_tmp221 + 42; + __cil_tmp222 = __cil_tmp221 + 42; #line 5598 - mem_530 = (UCHAR *)__cil_tmp222; + mem_530 = (UCHAR *)__cil_tmp222; #line 5598 - __cil_tmp223 = *mem_530; + __cil_tmp223 = *mem_530; #line 5598 - __cil_tmp224 = (int )__cil_tmp223; + __cil_tmp224 = (int)__cil_tmp223; #line 5598 - __cil_tmp225 = 10000 * __cil_tmp224; + __cil_tmp225 = 10000 * __cil_tmp224; #line 5598 - __cil_tmp226 = - __cil_tmp225; + __cil_tmp226 = -__cil_tmp225; #line 5598 - mem_531 = (ULONG *)__cil_tmp220; + mem_531 = (ULONG *)__cil_tmp220; #line 5598 - *mem_531 = (unsigned long )__cil_tmp226; + *mem_531 = (unsigned long)__cil_tmp226; #line 5600 - __cil_tmp227 = 0 + 4; + __cil_tmp227 = 0 + 4; #line 5600 - __cil_tmp228 = (unsigned int )(& headSettleTime) + __cil_tmp227; + __cil_tmp228 = + (unsigned int)(&headSettleTime) + __cil_tmp227; #line 5600 - mem_532 = (LONG *)__cil_tmp228; + mem_532 = (LONG *)__cil_tmp228; #line 5600 - *mem_532 = -1L; + *mem_532 = -1L; #line 5602 - KeDelayExecutionThread((char)0, (unsigned char)0, & headSettleTime); - } - { + KeDelayExecutionThread((char)0, (unsigned char)0, + &headSettleTime); + } + { #line 5607 - __cil_tmp229 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp229 = (KUSER_SHARED_DATA * const)4292804608U; #line 5607 - __cil_tmp230 = (unsigned int )__cil_tmp229; + __cil_tmp230 = (unsigned int)__cil_tmp229; #line 5607 - __cil_tmp231 = __cil_tmp230 + 732; + __cil_tmp231 = __cil_tmp230 + 732; #line 5607 - mem_533 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp231; + mem_533 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp231; #line 5607 - __cil_tmp232 = *mem_533; + __cil_tmp232 = *mem_533; #line 5607 - __cil_tmp233 = (int )__cil_tmp232; + __cil_tmp233 = (int)__cil_tmp232; #line 5607 - __cil_tmp234 = __cil_tmp233 == 1; + __cil_tmp234 = __cil_tmp233 == 1; #line 5607 - if (! __cil_tmp234) { - { + if (!__cil_tmp234) { + { #line 5619 - __cil_tmp235 = 0 * 1U; + __cil_tmp235 = 0 * 1U; #line 5619 - __cil_tmp236 = 112 + __cil_tmp235; + __cil_tmp236 = 112 + __cil_tmp235; #line 5619 - __cil_tmp237 = (unsigned int )DisketteExtension; + __cil_tmp237 = (unsigned int)DisketteExtension; #line 5619 - __cil_tmp238 = __cil_tmp237 + __cil_tmp236; + __cil_tmp238 = __cil_tmp237 + __cil_tmp236; #line 5619 - mem_534 = (UCHAR *)__cil_tmp238; + mem_534 = (UCHAR *)__cil_tmp238; #line 5619 - *mem_534 = (unsigned char)84; + *mem_534 = (unsigned char)84; #line 5621 - __cil_tmp239 = 1 * 1U; + __cil_tmp239 = 1 * 1U; #line 5621 - __cil_tmp240 = 112 + __cil_tmp239; + __cil_tmp240 = 112 + __cil_tmp239; #line 5621 - __cil_tmp241 = (unsigned int )DisketteExtension; + __cil_tmp241 = (unsigned int)DisketteExtension; #line 5621 - __cil_tmp242 = __cil_tmp241 + __cil_tmp240; + __cil_tmp242 = __cil_tmp241 + __cil_tmp240; #line 5621 - __cil_tmp243 = (unsigned int )DisketteExtension; + __cil_tmp243 = (unsigned int)DisketteExtension; #line 5621 - __cil_tmp244 = __cil_tmp243 + 248; + __cil_tmp244 = __cil_tmp243 + 248; #line 5621 - mem_535 = (UCHAR *)__cil_tmp242; + mem_535 = (UCHAR *)__cil_tmp242; #line 5621 - mem_536 = (UCHAR *)__cil_tmp244; + mem_536 = (UCHAR *)__cil_tmp244; #line 5621 - *mem_535 = *mem_536; + *mem_535 = *mem_536; #line 5624 - __cil_tmp245 = 0 * 1U; + __cil_tmp245 = 0 * 1U; #line 5624 - __cil_tmp246 = 112 + __cil_tmp245; + __cil_tmp246 = 112 + __cil_tmp245; #line 5624 - __cil_tmp247 = (unsigned int )DisketteExtension; + __cil_tmp247 = (unsigned int)DisketteExtension; #line 5624 - __cil_tmp248 = __cil_tmp247 + __cil_tmp246; + __cil_tmp248 = __cil_tmp247 + __cil_tmp246; #line 5624 - __cil_tmp249 = (UCHAR *)__cil_tmp248; + __cil_tmp249 = (UCHAR *)__cil_tmp248; #line 5624 - __cil_tmp250 = 0 * 1U; + __cil_tmp250 = 0 * 1U; #line 5624 - __cil_tmp251 = 112 + __cil_tmp250; + __cil_tmp251 = 112 + __cil_tmp250; #line 5624 - __cil_tmp252 = (unsigned int )DisketteExtension; + __cil_tmp252 = (unsigned int)DisketteExtension; #line 5624 - __cil_tmp253 = __cil_tmp252 + __cil_tmp251; + __cil_tmp253 = __cil_tmp252 + __cil_tmp251; #line 5624 - __cil_tmp254 = (UCHAR *)__cil_tmp253; + __cil_tmp254 = (UCHAR *)__cil_tmp253; #line 5624 - __cil_tmp255 = (void *)0; + __cil_tmp255 = (void *)0; #line 5624 - __cil_tmp256 = (struct _MDL *)__cil_tmp255; + __cil_tmp256 = (struct _MDL *)__cil_tmp255; #line 5624 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp249, __cil_tmp254, - __cil_tmp256, 0UL, 0UL); - } - } else { - - } - } - } else { - goto _L; - } - } - } else { - _L: - { + ntStatus = FlIssueCommand(DisketteExtension, + __cil_tmp249, __cil_tmp254, + __cil_tmp256, 0UL, 0UL); + } + } else { + } + } + } else { + goto _L; + } + } + } else { + _L : { #line 5641 - while (1) { - while_171_continue: /* CIL Label */ ; - goto while_171_break; - } - while_171_break: /* CIL Label */ ; - } + while (1) { + while_171_continue: /* CIL Label */; + goto while_171_break; + } + while_171_break: /* CIL Label */; + } #line 5643 - __cil_tmp257 = (unsigned int )DisketteExtension; + __cil_tmp257 = (unsigned int)DisketteExtension; #line 5643 - __cil_tmp258 = __cil_tmp257 + 104; + __cil_tmp258 = __cil_tmp257 + 104; #line 5643 - mem_537 = (BOOLEAN *)__cil_tmp258; + mem_537 = (BOOLEAN *)__cil_tmp258; #line 5643 - *mem_537 = (unsigned char)1; + *mem_537 = (unsigned char)1; #line 5645 - ntStatus = -1073741464L; - } - } - } else { - - } - { + ntStatus = -1073741464L; + } + } + } else { + } + { #line 5649 - __cil_tmp259 = ntStatus >= 0L; + __cil_tmp259 = ntStatus >= 0L; #line 5649 - if (! __cil_tmp259) { - { + if (!__cil_tmp259) { + { #line 5654 - while (1) { - while_172_continue: /* CIL Label */ ; - goto while_172_break; - } - while_172_break: /* CIL Label */ ; - } + while (1) { + while_172_continue: /* CIL Label */; + goto while_172_break; + } + while_172_break: /* CIL Label */; + } #line 5656 - return (ntStatus); - } else { - - } - } + return (ntStatus); + } else { + } + } #line 5663 - whichSector = (unsigned char)0; - { + whichSector = (unsigned char)0; + { #line 5663 - while (1) { - while_173_continue: /* CIL Label */ ; - { + while (1) { + while_173_continue: /* CIL Label */; + { #line 5663 - __cil_tmp260 = (unsigned int )driveMediaConstants; + __cil_tmp260 = (unsigned int)driveMediaConstants; #line 5663 - __cil_tmp261 = __cil_tmp260 + 38; + __cil_tmp261 = __cil_tmp260 + 38; #line 5663 - mem_538 = (UCHAR *)__cil_tmp261; + mem_538 = (UCHAR *)__cil_tmp261; #line 5663 - __cil_tmp262 = *mem_538; + __cil_tmp262 = *mem_538; #line 5663 - __cil_tmp263 = (int )__cil_tmp262; + __cil_tmp263 = (int)__cil_tmp262; #line 5663 - __cil_tmp264 = (int )whichSector; + __cil_tmp264 = (int)whichSector; #line 5663 - if (__cil_tmp264 < __cil_tmp263) { + if (__cil_tmp264 < __cil_tmp263) { - } else { - goto while_173_break; - } - } + } else { + goto while_173_break; + } + } #line 5667 - __cil_tmp265 = (int )whichSector; + __cil_tmp265 = (int)whichSector; #line 5667 - __cil_tmp266 = __cil_tmp265 * 4; + __cil_tmp266 = __cil_tmp265 * 4; #line 5667 - __cil_tmp267 = (unsigned int )DisketteExtension; + __cil_tmp267 = (unsigned int)DisketteExtension; #line 5667 - __cil_tmp268 = __cil_tmp267 + 124; + __cil_tmp268 = __cil_tmp267 + 124; #line 5667 - mem_539 = (PUCHAR *)__cil_tmp268; + mem_539 = (PUCHAR *)__cil_tmp268; #line 5667 - __cil_tmp269 = *mem_539; + __cil_tmp269 = *mem_539; #line 5667 - __cil_tmp270 = __cil_tmp269 + __cil_tmp266; + __cil_tmp270 = __cil_tmp269 + __cil_tmp266; #line 5667 - __cil_tmp271 = (unsigned int )driveMediaConstants; + __cil_tmp271 = (unsigned int)driveMediaConstants; #line 5667 - __cil_tmp272 = __cil_tmp271 + 51; + __cil_tmp272 = __cil_tmp271 + 51; #line 5667 - mem_540 = (UCHAR *)__cil_tmp272; + mem_540 = (UCHAR *)__cil_tmp272; #line 5667 - __cil_tmp273 = *mem_540; + __cil_tmp273 = *mem_540; #line 5667 - __cil_tmp274 = (int )__cil_tmp273; + __cil_tmp274 = (int)__cil_tmp273; #line 5667 - __cil_tmp275 = (int )currentTrack; + __cil_tmp275 = (int)currentTrack; #line 5667 - __cil_tmp276 = __cil_tmp275 / __cil_tmp274; + __cil_tmp276 = __cil_tmp275 / __cil_tmp274; #line 5667 - *__cil_tmp270 = (unsigned char )__cil_tmp276; + *__cil_tmp270 = (unsigned char)__cil_tmp276; #line 5669 - __cil_tmp277 = (int )whichSector; + __cil_tmp277 = (int)whichSector; #line 5669 - __cil_tmp278 = __cil_tmp277 * 4; + __cil_tmp278 = __cil_tmp277 * 4; #line 5669 - __cil_tmp279 = __cil_tmp278 + 1; + __cil_tmp279 = __cil_tmp278 + 1; #line 5669 - __cil_tmp280 = (unsigned int )DisketteExtension; + __cil_tmp280 = (unsigned int)DisketteExtension; #line 5669 - __cil_tmp281 = __cil_tmp280 + 124; + __cil_tmp281 = __cil_tmp280 + 124; #line 5669 - mem_541 = (PUCHAR *)__cil_tmp281; + mem_541 = (PUCHAR *)__cil_tmp281; #line 5669 - __cil_tmp282 = *mem_541; + __cil_tmp282 = *mem_541; #line 5669 - __cil_tmp283 = __cil_tmp282 + __cil_tmp279; + __cil_tmp283 = __cil_tmp282 + __cil_tmp279; #line 5669 - __cil_tmp284 = (unsigned int )driveMediaConstants; + __cil_tmp284 = (unsigned int)driveMediaConstants; #line 5669 - __cil_tmp285 = __cil_tmp284 + 51; + __cil_tmp285 = __cil_tmp284 + 51; #line 5669 - mem_542 = (UCHAR *)__cil_tmp285; + mem_542 = (UCHAR *)__cil_tmp285; #line 5669 - __cil_tmp286 = *mem_542; + __cil_tmp286 = *mem_542; #line 5669 - __cil_tmp287 = (int )__cil_tmp286; + __cil_tmp287 = (int)__cil_tmp286; #line 5669 - __cil_tmp288 = (int )currentTrack; + __cil_tmp288 = (int)currentTrack; #line 5669 - __cil_tmp289 = __cil_tmp288 % __cil_tmp287; + __cil_tmp289 = __cil_tmp288 % __cil_tmp287; #line 5669 - *__cil_tmp283 = (unsigned char )__cil_tmp289; + *__cil_tmp283 = (unsigned char)__cil_tmp289; #line 5671 - if (formatExParameters) { + if (formatExParameters) { #line 5672 - __cil_tmp290 = (int )whichSector; + __cil_tmp290 = (int)whichSector; #line 5672 - __cil_tmp291 = __cil_tmp290 * 4; + __cil_tmp291 = __cil_tmp290 * 4; #line 5672 - __cil_tmp292 = __cil_tmp291 + 2; + __cil_tmp292 = __cil_tmp291 + 2; #line 5672 - __cil_tmp293 = (unsigned int )DisketteExtension; + __cil_tmp293 = (unsigned int)DisketteExtension; #line 5672 - __cil_tmp294 = __cil_tmp293 + 124; + __cil_tmp294 = __cil_tmp293 + 124; #line 5672 - mem_543 = (PUCHAR *)__cil_tmp294; + mem_543 = (PUCHAR *)__cil_tmp294; #line 5672 - __cil_tmp295 = *mem_543; + __cil_tmp295 = *mem_543; #line 5672 - __cil_tmp296 = __cil_tmp295 + __cil_tmp292; + __cil_tmp296 = __cil_tmp295 + __cil_tmp292; #line 5672 - __cil_tmp297 = whichSector * 2U; + __cil_tmp297 = whichSector * 2U; #line 5672 - __cil_tmp298 = 52 + __cil_tmp297; + __cil_tmp298 = 52 + __cil_tmp297; #line 5672 - __cil_tmp299 = (unsigned int )formatExParameters; + __cil_tmp299 = (unsigned int)formatExParameters; #line 5672 - __cil_tmp300 = __cil_tmp299 + __cil_tmp298; + __cil_tmp300 = __cil_tmp299 + __cil_tmp298; #line 5672 - mem_544 = (USHORT *)__cil_tmp300; + mem_544 = (USHORT *)__cil_tmp300; #line 5672 - __cil_tmp301 = *mem_544; + __cil_tmp301 = *mem_544; #line 5672 - *__cil_tmp296 = (unsigned char )__cil_tmp301; - } else { + *__cil_tmp296 = (unsigned char)__cil_tmp301; + } else { #line 5675 - __cil_tmp302 = (int )whichSector; + __cil_tmp302 = (int)whichSector; #line 5675 - __cil_tmp303 = __cil_tmp302 * 4; + __cil_tmp303 = __cil_tmp302 * 4; #line 5675 - __cil_tmp304 = __cil_tmp303 + 2; + __cil_tmp304 = __cil_tmp303 + 2; #line 5675 - __cil_tmp305 = (unsigned int )DisketteExtension; + __cil_tmp305 = (unsigned int)DisketteExtension; #line 5675 - __cil_tmp306 = __cil_tmp305 + 124; + __cil_tmp306 = __cil_tmp305 + 124; #line 5675 - mem_545 = (PUCHAR *)__cil_tmp306; + mem_545 = (PUCHAR *)__cil_tmp306; #line 5675 - __cil_tmp307 = *mem_545; + __cil_tmp307 = *mem_545; #line 5675 - __cil_tmp308 = __cil_tmp307 + __cil_tmp304; + __cil_tmp308 = __cil_tmp307 + __cil_tmp304; #line 5675 - __cil_tmp309 = (int )whichSector; + __cil_tmp309 = (int)whichSector; #line 5675 - __cil_tmp310 = __cil_tmp309 + 1; + __cil_tmp310 = __cil_tmp309 + 1; #line 5675 - *__cil_tmp308 = (unsigned char )__cil_tmp310; - } + *__cil_tmp308 = (unsigned char)__cil_tmp310; + } #line 5678 - __cil_tmp311 = (int )whichSector; + __cil_tmp311 = (int)whichSector; #line 5678 - __cil_tmp312 = __cil_tmp311 * 4; + __cil_tmp312 = __cil_tmp311 * 4; #line 5678 - __cil_tmp313 = __cil_tmp312 + 3; + __cil_tmp313 = __cil_tmp312 + 3; #line 5678 - __cil_tmp314 = (unsigned int )DisketteExtension; + __cil_tmp314 = (unsigned int)DisketteExtension; #line 5678 - __cil_tmp315 = __cil_tmp314 + 124; + __cil_tmp315 = __cil_tmp314 + 124; #line 5678 - mem_546 = (PUCHAR *)__cil_tmp315; + mem_546 = (PUCHAR *)__cil_tmp315; #line 5678 - __cil_tmp316 = *mem_546; + __cil_tmp316 = *mem_546; #line 5678 - __cil_tmp317 = __cil_tmp316 + __cil_tmp313; + __cil_tmp317 = __cil_tmp316 + __cil_tmp313; #line 5678 - __cil_tmp318 = (unsigned int )driveMediaConstants; + __cil_tmp318 = (unsigned int)driveMediaConstants; #line 5678 - __cil_tmp319 = __cil_tmp318 + 35; + __cil_tmp319 = __cil_tmp318 + 35; #line 5678 - mem_547 = (UCHAR *)__cil_tmp319; + mem_547 = (UCHAR *)__cil_tmp319; #line 5678 - *__cil_tmp317 = *mem_547; - { + *__cil_tmp317 = *mem_547; + { #line 5689 - while (1) { - while_174_continue: /* CIL Label */ ; - goto while_174_break; - } - while_174_break: /* CIL Label */ ; - } + while (1) { + while_174_continue: /* CIL Label */; + goto while_174_break; + } + while_174_break: /* CIL Label */; + } #line 5663 - __cil_tmp320 = (int )whichSector; + __cil_tmp320 = (int)whichSector; #line 5663 - __cil_tmp321 = __cil_tmp320 + 1; + __cil_tmp321 = __cil_tmp320 + 1; #line 5663 - whichSector = (unsigned char )__cil_tmp321; - } - while_173_break: /* CIL Label */ ; - } + whichSector = (unsigned char)__cil_tmp321; + } + while_173_break: /* CIL Label */; + } #line 5696 - retryCount = (unsigned char)0; - { + retryCount = (unsigned char)0; + { #line 5698 - while (1) { - while_175_continue: /* CIL Label */ ; + while (1) { + while_175_continue: /* CIL Label */; #line 5702 - __cil_tmp322 = (unsigned int )driveMediaConstants; + __cil_tmp322 = (unsigned int)driveMediaConstants; #line 5702 - __cil_tmp323 = __cil_tmp322 + 36; + __cil_tmp323 = __cil_tmp322 + 36; #line 5702 - mem_548 = (USHORT *)__cil_tmp323; + mem_548 = (USHORT *)__cil_tmp323; #line 5702 - __cil_tmp324 = *mem_548; + __cil_tmp324 = *mem_548; #line 5702 - length = (unsigned long )__cil_tmp324; + length = (unsigned long)__cil_tmp324; #line 5708 - __cil_tmp325 = 0 * 1U; + __cil_tmp325 = 0 * 1U; #line 5708 - __cil_tmp326 = 112 + __cil_tmp325; + __cil_tmp326 = 112 + __cil_tmp325; #line 5708 - __cil_tmp327 = (unsigned int )DisketteExtension; + __cil_tmp327 = (unsigned int)DisketteExtension; #line 5708 - __cil_tmp328 = __cil_tmp327 + __cil_tmp326; + __cil_tmp328 = __cil_tmp327 + __cil_tmp326; #line 5708 - mem_549 = (UCHAR *)__cil_tmp328; + mem_549 = (UCHAR *)__cil_tmp328; #line 5708 - *mem_549 = (unsigned char)71; + *mem_549 = (unsigned char)71; #line 5710 - __cil_tmp329 = 1 * 1U; + __cil_tmp329 = 1 * 1U; #line 5710 - __cil_tmp330 = 112 + __cil_tmp329; + __cil_tmp330 = 112 + __cil_tmp329; #line 5710 - __cil_tmp331 = (unsigned int )DisketteExtension; + __cil_tmp331 = (unsigned int)DisketteExtension; #line 5710 - __cil_tmp332 = __cil_tmp331 + __cil_tmp330; + __cil_tmp332 = __cil_tmp331 + __cil_tmp330; #line 5710 - __cil_tmp333 = (unsigned int )DisketteExtension; + __cil_tmp333 = (unsigned int)DisketteExtension; #line 5710 - __cil_tmp334 = __cil_tmp333 + 248; + __cil_tmp334 = __cil_tmp333 + 248; #line 5710 - mem_550 = (UCHAR *)__cil_tmp334; + mem_550 = (UCHAR *)__cil_tmp334; #line 5710 - __cil_tmp335 = *mem_550; + __cil_tmp335 = *mem_550; #line 5710 - __cil_tmp336 = (int )__cil_tmp335; + __cil_tmp336 = (int)__cil_tmp335; #line 5710 - __cil_tmp337 = (unsigned int )driveMediaConstants; + __cil_tmp337 = (unsigned int)driveMediaConstants; #line 5710 - __cil_tmp338 = __cil_tmp337 + 51; + __cil_tmp338 = __cil_tmp337 + 51; #line 5710 - mem_551 = (UCHAR *)__cil_tmp338; + mem_551 = (UCHAR *)__cil_tmp338; #line 5710 - __cil_tmp339 = *mem_551; + __cil_tmp339 = *mem_551; #line 5710 - __cil_tmp340 = (int )__cil_tmp339; + __cil_tmp340 = (int)__cil_tmp339; #line 5710 - __cil_tmp341 = (int )currentTrack; + __cil_tmp341 = (int)currentTrack; #line 5710 - __cil_tmp342 = __cil_tmp341 % __cil_tmp340; + __cil_tmp342 = __cil_tmp341 % __cil_tmp340; #line 5710 - __cil_tmp343 = __cil_tmp342 << 2; + __cil_tmp343 = __cil_tmp342 << 2; #line 5710 - __cil_tmp344 = __cil_tmp343 | __cil_tmp336; + __cil_tmp344 = __cil_tmp343 | __cil_tmp336; #line 5710 - mem_552 = (UCHAR *)__cil_tmp332; + mem_552 = (UCHAR *)__cil_tmp332; #line 5710 - *mem_552 = (unsigned char )__cil_tmp344; + *mem_552 = (unsigned char)__cil_tmp344; #line 5713 - __cil_tmp345 = 2 * 1U; + __cil_tmp345 = 2 * 1U; #line 5713 - __cil_tmp346 = 112 + __cil_tmp345; + __cil_tmp346 = 112 + __cil_tmp345; #line 5713 - __cil_tmp347 = (unsigned int )DisketteExtension; + __cil_tmp347 = (unsigned int)DisketteExtension; #line 5713 - __cil_tmp348 = __cil_tmp347 + __cil_tmp346; + __cil_tmp348 = __cil_tmp347 + __cil_tmp346; #line 5713 - __cil_tmp349 = (unsigned int )driveMediaConstants; + __cil_tmp349 = (unsigned int)driveMediaConstants; #line 5713 - __cil_tmp350 = __cil_tmp349 + 35; + __cil_tmp350 = __cil_tmp349 + 35; #line 5713 - mem_553 = (UCHAR *)__cil_tmp348; + mem_553 = (UCHAR *)__cil_tmp348; #line 5713 - mem_554 = (UCHAR *)__cil_tmp350; + mem_554 = (UCHAR *)__cil_tmp350; #line 5713 - *mem_553 = *mem_554; + *mem_553 = *mem_554; #line 5715 - __cil_tmp351 = 3 * 1U; + __cil_tmp351 = 3 * 1U; #line 5715 - __cil_tmp352 = 112 + __cil_tmp351; + __cil_tmp352 = 112 + __cil_tmp351; #line 5715 - __cil_tmp353 = (unsigned int )DisketteExtension; + __cil_tmp353 = (unsigned int)DisketteExtension; #line 5715 - __cil_tmp354 = __cil_tmp353 + __cil_tmp352; + __cil_tmp354 = __cil_tmp353 + __cil_tmp352; #line 5715 - __cil_tmp355 = (unsigned int )driveMediaConstants; + __cil_tmp355 = (unsigned int)driveMediaConstants; #line 5715 - __cil_tmp356 = __cil_tmp355 + 38; + __cil_tmp356 = __cil_tmp355 + 38; #line 5715 - mem_555 = (UCHAR *)__cil_tmp354; + mem_555 = (UCHAR *)__cil_tmp354; #line 5715 - mem_556 = (UCHAR *)__cil_tmp356; + mem_556 = (UCHAR *)__cil_tmp356; #line 5715 - *mem_555 = *mem_556; + *mem_555 = *mem_556; #line 5717 - __cil_tmp357 = 4 * 1U; + __cil_tmp357 = 4 * 1U; #line 5717 - __cil_tmp358 = 112 + __cil_tmp357; + __cil_tmp358 = 112 + __cil_tmp357; #line 5717 - __cil_tmp359 = (unsigned int )DisketteExtension; + __cil_tmp359 = (unsigned int)DisketteExtension; #line 5717 - __cil_tmp360 = __cil_tmp359 + __cil_tmp358; + __cil_tmp360 = __cil_tmp359 + __cil_tmp358; #line 5717 - __cil_tmp361 = (unsigned int )driveMediaConstants; + __cil_tmp361 = (unsigned int)driveMediaConstants; #line 5717 - __cil_tmp362 = __cil_tmp361 + 40; + __cil_tmp362 = __cil_tmp361 + 40; #line 5717 - mem_557 = (UCHAR *)__cil_tmp360; + mem_557 = (UCHAR *)__cil_tmp360; #line 5717 - mem_558 = (UCHAR *)__cil_tmp362; + mem_558 = (UCHAR *)__cil_tmp362; #line 5717 - *mem_557 = *mem_558; + *mem_557 = *mem_558; #line 5719 - __cil_tmp363 = 5 * 1U; + __cil_tmp363 = 5 * 1U; #line 5719 - __cil_tmp364 = 112 + __cil_tmp363; + __cil_tmp364 = 112 + __cil_tmp363; #line 5719 - __cil_tmp365 = (unsigned int )DisketteExtension; + __cil_tmp365 = (unsigned int)DisketteExtension; #line 5719 - __cil_tmp366 = __cil_tmp365 + __cil_tmp364; + __cil_tmp366 = __cil_tmp365 + __cil_tmp364; #line 5719 - __cil_tmp367 = (unsigned int )driveMediaConstants; + __cil_tmp367 = (unsigned int)driveMediaConstants; #line 5719 - __cil_tmp368 = __cil_tmp367 + 41; + __cil_tmp368 = __cil_tmp367 + 41; #line 5719 - mem_559 = (UCHAR *)__cil_tmp366; + mem_559 = (UCHAR *)__cil_tmp366; #line 5719 - mem_560 = (UCHAR *)__cil_tmp368; + mem_560 = (UCHAR *)__cil_tmp368; #line 5719 - *mem_559 = *mem_560; - { + *mem_559 = *mem_560; + { #line 5735 - while (1) { - while_176_continue: /* CIL Label */ ; - goto while_176_break; - } - while_176_break: /* CIL Label */ ; - } - { + while (1) { + while_176_continue: /* CIL Label */; + goto while_176_break; + } + while_176_break: /* CIL Label */; + } + { #line 5736 - __cil_tmp369 = 0 * 1U; + __cil_tmp369 = 0 * 1U; #line 5736 - __cil_tmp370 = 112 + __cil_tmp369; + __cil_tmp370 = 112 + __cil_tmp369; #line 5736 - __cil_tmp371 = (unsigned int )DisketteExtension; + __cil_tmp371 = (unsigned int)DisketteExtension; #line 5736 - __cil_tmp372 = __cil_tmp371 + __cil_tmp370; + __cil_tmp372 = __cil_tmp371 + __cil_tmp370; #line 5736 - __cil_tmp373 = (UCHAR *)__cil_tmp372; + __cil_tmp373 = (UCHAR *)__cil_tmp372; #line 5736 - __cil_tmp374 = 0 * 1U; + __cil_tmp374 = 0 * 1U; #line 5736 - __cil_tmp375 = 112 + __cil_tmp374; + __cil_tmp375 = 112 + __cil_tmp374; #line 5736 - __cil_tmp376 = (unsigned int )DisketteExtension; + __cil_tmp376 = (unsigned int)DisketteExtension; #line 5736 - __cil_tmp377 = __cil_tmp376 + __cil_tmp375; + __cil_tmp377 = __cil_tmp376 + __cil_tmp375; #line 5736 - __cil_tmp378 = (UCHAR *)__cil_tmp377; + __cil_tmp378 = (UCHAR *)__cil_tmp377; #line 5736 - __cil_tmp379 = (unsigned int )DisketteExtension; + __cil_tmp379 = (unsigned int)DisketteExtension; #line 5736 - __cil_tmp380 = __cil_tmp379 + 128; + __cil_tmp380 = __cil_tmp379 + 128; #line 5736 - mem_561 = (PMDL *)__cil_tmp380; + mem_561 = (PMDL *)__cil_tmp380; #line 5736 - __cil_tmp381 = *mem_561; + __cil_tmp381 = *mem_561; #line 5736 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp373, __cil_tmp378, __cil_tmp381, - 0UL, length); - } - { + ntStatus = + FlIssueCommand(DisketteExtension, __cil_tmp373, __cil_tmp378, + __cil_tmp381, 0UL, length); + } + { #line 5743 - __cil_tmp382 = ntStatus >= 0L; + __cil_tmp382 = ntStatus >= 0L; #line 5743 - if (! __cil_tmp382) { - { + if (!__cil_tmp382) { + { #line 5748 - while (1) { - while_177_continue: /* CIL Label */ ; - goto while_177_break; - } - while_177_break: /* CIL Label */ ; - } - } else { - - } - } + while (1) { + while_177_continue: /* CIL Label */; + goto while_177_break; + } + while_177_break: /* CIL Label */; + } + } else { + } + } #line 5751 - if (ntStatus >= 0L) { - { + if (ntStatus >= 0L) { + { #line 5757 - __cil_tmp383 = 0 * 1U; + __cil_tmp383 = 0 * 1U; #line 5757 - __cil_tmp384 = 112 + __cil_tmp383; + __cil_tmp384 = 112 + __cil_tmp383; #line 5757 - __cil_tmp385 = (unsigned int )DisketteExtension; + __cil_tmp385 = (unsigned int)DisketteExtension; #line 5757 - __cil_tmp386 = __cil_tmp385 + __cil_tmp384; + __cil_tmp386 = __cil_tmp385 + __cil_tmp384; #line 5757 - mem_562 = (UCHAR *)__cil_tmp386; + mem_562 = (UCHAR *)__cil_tmp386; #line 5757 - __cil_tmp387 = *mem_562; + __cil_tmp387 = *mem_562; #line 5757 - __cil_tmp388 = (int )__cil_tmp387; + __cil_tmp388 = (int)__cil_tmp387; #line 5757 - if (__cil_tmp388 & 208) { - goto _L___0; - } else { - { + if (__cil_tmp388 & 208) { + goto _L___0; + } else { + { #line 5757 - __cil_tmp389 = 1 * 1U; + __cil_tmp389 = 1 * 1U; #line 5757 - __cil_tmp390 = 112 + __cil_tmp389; + __cil_tmp390 = 112 + __cil_tmp389; #line 5757 - __cil_tmp391 = (unsigned int )DisketteExtension; + __cil_tmp391 = (unsigned int)DisketteExtension; #line 5757 - __cil_tmp392 = __cil_tmp391 + __cil_tmp390; + __cil_tmp392 = __cil_tmp391 + __cil_tmp390; #line 5757 - mem_563 = (UCHAR *)__cil_tmp392; + mem_563 = (UCHAR *)__cil_tmp392; #line 5757 - __cil_tmp393 = *mem_563; + __cil_tmp393 = *mem_563; #line 5757 - __cil_tmp394 = (int )__cil_tmp393; + __cil_tmp394 = (int)__cil_tmp393; #line 5757 - if (__cil_tmp394 & 16) { - goto _L___0; - } else { - { + if (__cil_tmp394 & 16) { + goto _L___0; + } else { + { #line 5757 - __cil_tmp395 = 2 * 1U; + __cil_tmp395 = 2 * 1U; #line 5757 - __cil_tmp396 = 112 + __cil_tmp395; + __cil_tmp396 = 112 + __cil_tmp395; #line 5757 - __cil_tmp397 = (unsigned int )DisketteExtension; + __cil_tmp397 = (unsigned int)DisketteExtension; #line 5757 - __cil_tmp398 = __cil_tmp397 + __cil_tmp396; + __cil_tmp398 = __cil_tmp397 + __cil_tmp396; #line 5757 - mem_564 = (UCHAR *)__cil_tmp398; + mem_564 = (UCHAR *)__cil_tmp398; #line 5757 - __cil_tmp399 = *mem_564; + __cil_tmp399 = *mem_564; #line 5757 - __cil_tmp400 = (int )__cil_tmp399; + __cil_tmp400 = (int)__cil_tmp399; #line 5757 - if (__cil_tmp400 != 0) { - _L___0: - { + if (__cil_tmp400 != 0) { + _L___0 : { #line 5775 - while (1) { - while_178_continue: /* CIL Label */ ; - goto while_178_break; - } - while_178_break: /* CIL Label */ ; - } - { + while (1) { + while_178_continue: /* CIL Label */; + goto while_178_break; + } + while_178_break: /* CIL Label */; + } + { #line 5777 - __cil_tmp401 = (unsigned int )DisketteExtension; + __cil_tmp401 = (unsigned int)DisketteExtension; #line 5777 - __cil_tmp402 = __cil_tmp401 + 104; + __cil_tmp402 = __cil_tmp401 + 104; #line 5777 - mem_565 = (BOOLEAN *)__cil_tmp402; + mem_565 = (BOOLEAN *)__cil_tmp402; #line 5777 - *mem_565 = (unsigned char)1; + *mem_565 = (unsigned char)1; #line 5779 - __cil_tmp403 = 1 * 1U; + __cil_tmp403 = 1 * 1U; #line 5779 - __cil_tmp404 = 112 + __cil_tmp403; + __cil_tmp404 = 112 + __cil_tmp403; #line 5779 - __cil_tmp405 = (unsigned int )DisketteExtension; + __cil_tmp405 = (unsigned int)DisketteExtension; #line 5779 - __cil_tmp406 = __cil_tmp405 + __cil_tmp404; + __cil_tmp406 = __cil_tmp405 + __cil_tmp404; #line 5779 - mem_566 = (UCHAR *)__cil_tmp406; + mem_566 = (UCHAR *)__cil_tmp406; #line 5779 - __cil_tmp407 = *mem_566; + __cil_tmp407 = *mem_566; #line 5779 - __cil_tmp408 = 2 * 1U; + __cil_tmp408 = 2 * 1U; #line 5779 - __cil_tmp409 = 112 + __cil_tmp408; + __cil_tmp409 = 112 + __cil_tmp408; #line 5779 - __cil_tmp410 = (unsigned int )DisketteExtension; + __cil_tmp410 = (unsigned int)DisketteExtension; #line 5779 - __cil_tmp411 = __cil_tmp410 + __cil_tmp409; + __cil_tmp411 = __cil_tmp410 + __cil_tmp409; #line 5779 - mem_567 = (UCHAR *)__cil_tmp411; + mem_567 = (UCHAR *)__cil_tmp411; #line 5779 - __cil_tmp412 = *mem_567; + __cil_tmp412 = *mem_567; #line 5779 - ntStatus = FlInterpretError(__cil_tmp407, __cil_tmp412); + ntStatus = + FlInterpretError(__cil_tmp407, __cil_tmp412); + } + } else { + } + } + } + } + } } } else { - - } } - } - } - } - } - } else { - - } - { + { #line 5698 - __cil_tmp413 = ntStatus >= 0L; + __cil_tmp413 = ntStatus >= 0L; #line 5698 - if (! __cil_tmp413) { + if (!__cil_tmp413) { #line 5698 - tmp = retryCount; + tmp = retryCount; #line 5698 - __cil_tmp414 = (int )retryCount; + __cil_tmp414 = (int)retryCount; #line 5698 - __cil_tmp415 = __cil_tmp414 + 1; + __cil_tmp415 = __cil_tmp414 + 1; #line 5698 - retryCount = (unsigned char )__cil_tmp415; - { + retryCount = (unsigned char)__cil_tmp415; + { #line 5698 - __cil_tmp416 = (int )tmp; + __cil_tmp416 = (int)tmp; #line 5698 - __cil_tmp417 = __cil_tmp416 < 3; + __cil_tmp417 = __cil_tmp416 < 3; #line 5698 - if (! __cil_tmp417) { - goto while_175_break; - } else { - - } + if (!__cil_tmp417) { + goto while_175_break; + } else { + } + } + } else { + goto while_175_break; + } + } + } + while_175_break: /* CIL Label */; } - } else { - goto while_175_break; - } - } - } - while_175_break: /* CIL Label */ ; - } - { + { #line 5788 - __cil_tmp418 = ntStatus >= 0L; + __cil_tmp418 = ntStatus >= 0L; #line 5788 - if (! __cil_tmp418) { - { + if (!__cil_tmp418) { + { #line 5790 - __cil_tmp419 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp419 = (KUSER_SHARED_DATA * const)4292804608U; #line 5790 - __cil_tmp420 = (unsigned int )__cil_tmp419; + __cil_tmp420 = (unsigned int)__cil_tmp419; #line 5790 - __cil_tmp421 = __cil_tmp420 + 732; + __cil_tmp421 = __cil_tmp420 + 732; #line 5790 - mem_568 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp421; + mem_568 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp421; #line 5790 - __cil_tmp422 = *mem_568; + __cil_tmp422 = *mem_568; #line 5790 - __cil_tmp423 = (int )__cil_tmp422; + __cil_tmp423 = (int)__cil_tmp422; #line 5790 - if (__cil_tmp423 == 1) { - { + if (__cil_tmp423 == 1) { + { #line 5791 - __cil_tmp424 = 0 * 1U; + __cil_tmp424 = 0 * 1U; #line 5791 - __cil_tmp425 = 112 + __cil_tmp424; + __cil_tmp425 = 112 + __cil_tmp424; #line 5791 - __cil_tmp426 = (unsigned int )DisketteExtension; + __cil_tmp426 = (unsigned int)DisketteExtension; #line 5791 - __cil_tmp427 = __cil_tmp426 + __cil_tmp425; + __cil_tmp427 = __cil_tmp426 + __cil_tmp425; #line 5791 - mem_569 = (UCHAR *)__cil_tmp427; + mem_569 = (UCHAR *)__cil_tmp427; #line 5791 - *mem_569 = (unsigned char)14; + *mem_569 = (unsigned char)14; #line 5792 - __cil_tmp428 = 1 * 1U; + __cil_tmp428 = 1 * 1U; #line 5792 - __cil_tmp429 = 112 + __cil_tmp428; + __cil_tmp429 = 112 + __cil_tmp428; #line 5792 - __cil_tmp430 = (unsigned int )DisketteExtension; + __cil_tmp430 = (unsigned int)DisketteExtension; #line 5792 - __cil_tmp431 = __cil_tmp430 + __cil_tmp429; + __cil_tmp431 = __cil_tmp430 + __cil_tmp429; #line 5792 - __cil_tmp432 = (unsigned int )DisketteExtension; + __cil_tmp432 = (unsigned int)DisketteExtension; #line 5792 - __cil_tmp433 = __cil_tmp432 + 248; + __cil_tmp433 = __cil_tmp432 + 248; #line 5792 - mem_570 = (UCHAR *)__cil_tmp431; + mem_570 = (UCHAR *)__cil_tmp431; #line 5792 - mem_571 = (UCHAR *)__cil_tmp433; + mem_571 = (UCHAR *)__cil_tmp433; #line 5792 - *mem_570 = *mem_571; + *mem_570 = *mem_571; #line 5794 - __cil_tmp434 = 0 * 1U; + __cil_tmp434 = 0 * 1U; #line 5794 - __cil_tmp435 = 112 + __cil_tmp434; + __cil_tmp435 = 112 + __cil_tmp434; #line 5794 - __cil_tmp436 = (unsigned int )DisketteExtension; + __cil_tmp436 = (unsigned int)DisketteExtension; #line 5794 - __cil_tmp437 = __cil_tmp436 + __cil_tmp435; + __cil_tmp437 = __cil_tmp436 + __cil_tmp435; #line 5794 - __cil_tmp438 = (UCHAR *)__cil_tmp437; + __cil_tmp438 = (UCHAR *)__cil_tmp437; #line 5794 - __cil_tmp439 = 0 * 1U; + __cil_tmp439 = 0 * 1U; #line 5794 - __cil_tmp440 = 112 + __cil_tmp439; + __cil_tmp440 = 112 + __cil_tmp439; #line 5794 - __cil_tmp441 = (unsigned int )DisketteExtension; + __cil_tmp441 = (unsigned int)DisketteExtension; #line 5794 - __cil_tmp442 = __cil_tmp441 + __cil_tmp440; + __cil_tmp442 = __cil_tmp441 + __cil_tmp440; #line 5794 - __cil_tmp443 = (UCHAR *)__cil_tmp442; + __cil_tmp443 = (UCHAR *)__cil_tmp442; #line 5794 - __cil_tmp444 = (void *)0; + __cil_tmp444 = (void *)0; #line 5794 - __cil_tmp445 = (struct _MDL *)__cil_tmp444; + __cil_tmp445 = (struct _MDL *)__cil_tmp444; #line 5794 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp438, __cil_tmp443, __cil_tmp445, - 0UL, 0UL); - } - { + ntStatus = + FlIssueCommand(DisketteExtension, __cil_tmp438, + __cil_tmp443, __cil_tmp445, 0UL, 0UL); + } + { #line 5801 - __cil_tmp446 = ntStatus >= 0L; + __cil_tmp446 = ntStatus >= 0L; #line 5801 - if (! __cil_tmp446) { - { + if (!__cil_tmp446) { + { #line 5806 - while (1) { - while_179_continue: /* CIL Label */ ; - goto while_179_break; - } - while_179_break: /* CIL Label */ ; - } + while (1) { + while_179_continue: /* CIL Label */; + goto while_179_break; + } + while_179_break: /* CIL Label */; + } #line 5808 - return (ntStatus); - } else { - - } - } - { + return (ntStatus); + } else { + } + } + { #line 5811 - __cil_tmp447 = 0 * 1U; + __cil_tmp447 = 0 * 1U; #line 5811 - __cil_tmp448 = 112 + __cil_tmp447; + __cil_tmp448 = 112 + __cil_tmp447; #line 5811 - __cil_tmp449 = (unsigned int )DisketteExtension; + __cil_tmp449 = (unsigned int)DisketteExtension; #line 5811 - __cil_tmp450 = __cil_tmp449 + __cil_tmp448; + __cil_tmp450 = __cil_tmp449 + __cil_tmp448; #line 5811 - mem_572 = (UCHAR *)__cil_tmp450; + mem_572 = (UCHAR *)__cil_tmp450; #line 5811 - __cil_tmp451 = *mem_572; + __cil_tmp451 = *mem_572; #line 5811 - __cil_tmp452 = (int )__cil_tmp451; + __cil_tmp452 = (int)__cil_tmp451; #line 5811 - if (__cil_tmp452 & 32) { + if (__cil_tmp452 & 32) { #line 5813 - driveStatus = (unsigned char)127; - } else { + driveStatus = (unsigned char)127; + } else { #line 5817 - driveStatus = (unsigned char)128; - } - } - } else { - { + driveStatus = (unsigned char)128; + } + } + } else { + { #line 5822 - __cil_tmp453 = (unsigned int )DisketteExtension; + __cil_tmp453 = (unsigned int)DisketteExtension; #line 5822 - __cil_tmp454 = __cil_tmp453 + 8; + __cil_tmp454 = __cil_tmp453 + 8; #line 5822 - mem_573 = (PDEVICE_OBJECT *)__cil_tmp454; + mem_573 = (PDEVICE_OBJECT *)__cil_tmp454; #line 5822 - __cil_tmp455 = *mem_573; + __cil_tmp455 = *mem_573; #line 5822 - __cil_tmp456 = 776 << 2; + __cil_tmp456 = 776 << 2; #line 5822 - __cil_tmp457 = 7 << 16; + __cil_tmp457 = 7 << 16; #line 5822 - __cil_tmp458 = __cil_tmp457 | __cil_tmp456; + __cil_tmp458 = __cil_tmp457 | __cil_tmp456; #line 5822 - __cil_tmp459 = __cil_tmp458 | 3; + __cil_tmp459 = __cil_tmp458 | 3; #line 5822 - __cil_tmp460 = (unsigned long )__cil_tmp459; + __cil_tmp460 = (unsigned long)__cil_tmp459; #line 5822 - __cil_tmp461 = (void *)(& fdcDiskChangeParms); + __cil_tmp461 = (void *)(&fdcDiskChangeParms); #line 5822 - ntStatus = FlFdcDeviceIo(__cil_tmp455, __cil_tmp460, __cil_tmp461); + ntStatus = + FlFdcDeviceIo(__cil_tmp455, __cil_tmp460, __cil_tmp461); #line 5826 - __cil_tmp462 = & fdcDiskChangeParms; + __cil_tmp462 = &fdcDiskChangeParms; #line 5826 - mem_574 = (UCHAR *)__cil_tmp462; + mem_574 = (UCHAR *)__cil_tmp462; #line 5826 - driveStatus = *mem_574; - } - } - } - { + driveStatus = *mem_574; + } + } + } + { #line 5829 - __cil_tmp463 = (unsigned int )DisketteExtension; + __cil_tmp463 = (unsigned int)DisketteExtension; #line 5829 - __cil_tmp464 = __cil_tmp463 + 174; + __cil_tmp464 = __cil_tmp463 + 174; #line 5829 - mem_575 = (UCHAR *)__cil_tmp464; + mem_575 = (UCHAR *)__cil_tmp464; #line 5829 - __cil_tmp465 = *mem_575; + __cil_tmp465 = *mem_575; #line 5829 - __cil_tmp466 = (int )__cil_tmp465; + __cil_tmp466 = (int)__cil_tmp465; #line 5829 - if (__cil_tmp466 != 0) { - { + if (__cil_tmp466 != 0) { + { #line 5829 - __cil_tmp467 = (int )driveStatus; + __cil_tmp467 = (int)driveStatus; #line 5829 - if (__cil_tmp467 & 128) { + if (__cil_tmp467 & 128) { #line 5837 - return (-1073741805L); - } else { - - } - } - } else { - - } - } - { + return (-1073741805L); + } else { + } + } + } else { + } + } + { #line 5847 - while (1) { - while_180_continue: /* CIL Label */ ; - goto while_180_break; - } - while_180_break: /* CIL Label */ ; - } - { + while (1) { + while_180_continue: /* CIL Label */; + goto while_180_break; + } + while_180_break: /* CIL Label */; + } + { #line 5849 - __cil_tmp468 = (int )numberOfBadTracks; + __cil_tmp468 = (int)numberOfBadTracks; #line 5849 - __cil_tmp469 = __cil_tmp468 + 1; + __cil_tmp469 = __cil_tmp468 + 1; #line 5849 - __cil_tmp470 = (unsigned int )__cil_tmp469; + __cil_tmp470 = (unsigned int)__cil_tmp469; #line 5849 - __cil_tmp471 = __cil_tmp470 * 2U; + __cil_tmp471 = __cil_tmp470 * 2U; #line 5849 - __cil_tmp472 = (unsigned long )__cil_tmp471; + __cil_tmp472 = (unsigned long)__cil_tmp471; #line 5849 - if (badTrackBufferLength >= __cil_tmp472) { + if (badTrackBufferLength >= __cil_tmp472) { #line 5852 - __cil_tmp473 = (unsigned int )Irp; + __cil_tmp473 = (unsigned int)Irp; #line 5852 - __cil_tmp474 = __cil_tmp473 + 12; + __cil_tmp474 = __cil_tmp473 + 12; #line 5852 - mem_576 = (PVOID *)__cil_tmp474; + mem_576 = (PVOID *)__cil_tmp474; #line 5852 - __cil_tmp475 = *mem_576; + __cil_tmp475 = *mem_576; #line 5852 - badTrackBuffer = (USHORT *)__cil_tmp475; + badTrackBuffer = (USHORT *)__cil_tmp475; #line 5855 - __cil_tmp476 = (int )numberOfBadTracks; + __cil_tmp476 = (int)numberOfBadTracks; #line 5855 - __cil_tmp477 = badTrackBuffer + __cil_tmp476; + __cil_tmp477 = badTrackBuffer + __cil_tmp476; #line 5855 - *__cil_tmp477 = (unsigned short )currentTrack; - } else { + *__cil_tmp477 = (unsigned short)currentTrack; + } else { #line 5860 - bufferOverflow = (unsigned char)1; - } - } + bufferOverflow = (unsigned char)1; + } + } #line 5863 - __cil_tmp478 = (int )numberOfBadTracks; + __cil_tmp478 = (int)numberOfBadTracks; #line 5863 - __cil_tmp479 = __cil_tmp478 + 1; + __cil_tmp479 = __cil_tmp478 + 1; #line 5863 - numberOfBadTracks = (unsigned char )__cil_tmp479; - } else { - - } - } + numberOfBadTracks = (unsigned char)__cil_tmp479; + } else { + } + } #line 5866 - __cil_tmp480 = (int )currentTrack; + __cil_tmp480 = (int)currentTrack; #line 5866 - __cil_tmp481 = __cil_tmp480 + 1; + __cil_tmp481 = __cil_tmp480 + 1; #line 5866 - currentTrack = (unsigned char )__cil_tmp481; - { + currentTrack = (unsigned char)__cil_tmp481; + { #line 5561 - __cil_tmp482 = (int )endTrack; + __cil_tmp482 = (int)endTrack; #line 5561 - __cil_tmp483 = (int )currentTrack; + __cil_tmp483 = (int)currentTrack; #line 5561 - __cil_tmp484 = __cil_tmp483 <= __cil_tmp482; + __cil_tmp484 = __cil_tmp483 <= __cil_tmp482; #line 5561 - if (! __cil_tmp484) { - goto while_169_break; - } else { - - } + if (!__cil_tmp484) { + goto while_169_break; + } else { + } + } + } + while_169_break: /* CIL Label */; } - } - while_169_break: /* CIL Label */ ; - } #line 5870 - if (ntStatus >= 0L) { + if (ntStatus >= 0L) { #line 5870 - if (bufferOverflow) { + if (bufferOverflow) { #line 5872 - ntStatus = -2147483643L; + ntStatus = -2147483643L; + } else { + } } else { - } - } else { - - } #line 5875 - return (ntStatus); -} + return (ntStatus); + } } #line 5878 "floppy.c" -BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension , PFORMAT_PARAMETERS FormatParameters ) -{ PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - DRIVE_MEDIA_TYPE driveMediaType ; - unsigned int __cil_tmp5 ; - unsigned int __cil_tmp6 ; - UCHAR __cil_tmp7 ; - int __cil_tmp8 ; - PDRIVE_MEDIA_LIMITS __cil_tmp9 ; - MEDIA_TYPE __cil_tmp10 ; - int __cil_tmp11 ; - unsigned int __cil_tmp12 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp13 ; - MEDIA_TYPE __cil_tmp14 ; - int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - UCHAR __cil_tmp18 ; - int __cil_tmp19 ; - PDRIVE_MEDIA_LIMITS __cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - DRIVE_MEDIA_TYPE __cil_tmp23 ; - int __cil_tmp24 ; - int __cil_tmp25 ; - int __cil_tmp26 ; - int __cil_tmp27 ; - int __cil_tmp28 ; - MEDIA_TYPE __cil_tmp29 ; - int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - PDRIVE_MEDIA_CONSTANTS __cil_tmp32 ; - MEDIA_TYPE __cil_tmp33 ; - int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - UCHAR __cil_tmp38 ; - int __cil_tmp39 ; - int __cil_tmp40 ; - unsigned long __cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - ULONG __cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - UCHAR __cil_tmp47 ; - int __cil_tmp48 ; - int __cil_tmp49 ; - unsigned long __cil_tmp50 ; - unsigned int __cil_tmp51 ; - unsigned int __cil_tmp52 ; - ULONG __cil_tmp53 ; - unsigned int __cil_tmp54 ; - unsigned int __cil_tmp55 ; - UCHAR __cil_tmp56 ; - unsigned long __cil_tmp57 ; - unsigned int __cil_tmp58 ; - unsigned int __cil_tmp59 ; - ULONG __cil_tmp60 ; - unsigned int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - UCHAR __cil_tmp63 ; - unsigned long __cil_tmp64 ; - unsigned int __cil_tmp65 ; - unsigned int __cil_tmp66 ; - ULONG __cil_tmp67 ; - unsigned int __cil_tmp68 ; - unsigned int __cil_tmp69 ; - ULONG __cil_tmp70 ; - unsigned int __cil_tmp71 ; - unsigned int __cil_tmp72 ; - ULONG __cil_tmp73 ; - KUSER_SHARED_DATA *__cil_tmp74 ; - unsigned int __cil_tmp75 ; - unsigned int __cil_tmp76 ; - ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp77 ; - int __cil_tmp78 ; - MEDIA_TYPE __cil_tmp79 ; - int __cil_tmp80 ; - MEDIA_TYPE __cil_tmp81 ; - int __cil_tmp82 ; - MEDIA_TYPE __cil_tmp83 ; - int __cil_tmp84 ; - MEDIA_TYPE __cil_tmp85 ; - int __cil_tmp86 ; - MEDIA_TYPE __cil_tmp87 ; - int __cil_tmp88 ; - UCHAR *mem_89 ; - DRIVE_MEDIA_TYPE *mem_90 ; - MEDIA_TYPE *mem_91 ; - MEDIA_TYPE *mem_92 ; - UCHAR *mem_93 ; - DRIVE_MEDIA_TYPE *mem_94 ; - MEDIA_TYPE *mem_95 ; - MEDIA_TYPE *mem_96 ; - UCHAR *mem_97 ; - ULONG *mem_98 ; - UCHAR *mem_99 ; - ULONG *mem_100 ; - UCHAR *mem_101 ; - ULONG *mem_102 ; - UCHAR *mem_103 ; - ULONG *mem_104 ; - ULONG *mem_105 ; - ULONG *mem_106 ; - ALTERNATIVE_ARCHITECTURE_TYPE *mem_107 ; - MEDIA_TYPE *mem_108 ; - MEDIA_TYPE *mem_109 ; - MEDIA_TYPE *mem_110 ; - MEDIA_TYPE *mem_111 ; - MEDIA_TYPE *mem_112 ; +BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension, + PFORMAT_PARAMETERS FormatParameters) { + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + DRIVE_MEDIA_TYPE driveMediaType; + unsigned int __cil_tmp5; + unsigned int __cil_tmp6; + UCHAR __cil_tmp7; + int __cil_tmp8; + PDRIVE_MEDIA_LIMITS __cil_tmp9; + MEDIA_TYPE __cil_tmp10; + int __cil_tmp11; + unsigned int __cil_tmp12; + PDRIVE_MEDIA_CONSTANTS __cil_tmp13; + MEDIA_TYPE __cil_tmp14; + int __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + UCHAR __cil_tmp18; + int __cil_tmp19; + PDRIVE_MEDIA_LIMITS __cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + DRIVE_MEDIA_TYPE __cil_tmp23; + int __cil_tmp24; + int __cil_tmp25; + int __cil_tmp26; + int __cil_tmp27; + int __cil_tmp28; + MEDIA_TYPE __cil_tmp29; + int __cil_tmp30; + unsigned int __cil_tmp31; + PDRIVE_MEDIA_CONSTANTS __cil_tmp32; + MEDIA_TYPE __cil_tmp33; + int __cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + UCHAR __cil_tmp38; + int __cil_tmp39; + int __cil_tmp40; + unsigned long __cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + ULONG __cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + UCHAR __cil_tmp47; + int __cil_tmp48; + int __cil_tmp49; + unsigned long __cil_tmp50; + unsigned int __cil_tmp51; + unsigned int __cil_tmp52; + ULONG __cil_tmp53; + unsigned int __cil_tmp54; + unsigned int __cil_tmp55; + UCHAR __cil_tmp56; + unsigned long __cil_tmp57; + unsigned int __cil_tmp58; + unsigned int __cil_tmp59; + ULONG __cil_tmp60; + unsigned int __cil_tmp61; + unsigned int __cil_tmp62; + UCHAR __cil_tmp63; + unsigned long __cil_tmp64; + unsigned int __cil_tmp65; + unsigned int __cil_tmp66; + ULONG __cil_tmp67; + unsigned int __cil_tmp68; + unsigned int __cil_tmp69; + ULONG __cil_tmp70; + unsigned int __cil_tmp71; + unsigned int __cil_tmp72; + ULONG __cil_tmp73; + KUSER_SHARED_DATA *__cil_tmp74; + unsigned int __cil_tmp75; + unsigned int __cil_tmp76; + ALTERNATIVE_ARCHITECTURE_TYPE __cil_tmp77; + int __cil_tmp78; + MEDIA_TYPE __cil_tmp79; + int __cil_tmp80; + MEDIA_TYPE __cil_tmp81; + int __cil_tmp82; + MEDIA_TYPE __cil_tmp83; + int __cil_tmp84; + MEDIA_TYPE __cil_tmp85; + int __cil_tmp86; + MEDIA_TYPE __cil_tmp87; + int __cil_tmp88; + UCHAR *mem_89; + DRIVE_MEDIA_TYPE *mem_90; + MEDIA_TYPE *mem_91; + MEDIA_TYPE *mem_92; + UCHAR *mem_93; + DRIVE_MEDIA_TYPE *mem_94; + MEDIA_TYPE *mem_95; + MEDIA_TYPE *mem_96; + UCHAR *mem_97; + ULONG *mem_98; + UCHAR *mem_99; + ULONG *mem_100; + UCHAR *mem_101; + ULONG *mem_102; + UCHAR *mem_103; + ULONG *mem_104; + ULONG *mem_105; + ULONG *mem_106; + ALTERNATIVE_ARCHITECTURE_TYPE *mem_107; + MEDIA_TYPE *mem_108; + MEDIA_TYPE *mem_109; + MEDIA_TYPE *mem_110; + MEDIA_TYPE *mem_111; + MEDIA_TYPE *mem_112; { #line 5913 - __cil_tmp5 = (unsigned int )DisketteExtension; + __cil_tmp5 = (unsigned int)DisketteExtension; #line 5913 - __cil_tmp6 = __cil_tmp5 + 174; + __cil_tmp6 = __cil_tmp5 + 174; #line 5913 - mem_89 = (UCHAR *)__cil_tmp6; + mem_89 = (UCHAR *)__cil_tmp6; #line 5913 - __cil_tmp7 = *mem_89; + __cil_tmp7 = *mem_89; #line 5913 - __cil_tmp8 = (int )__cil_tmp7; + __cil_tmp8 = (int)__cil_tmp7; #line 5913 - __cil_tmp9 = DriveMediaLimits + __cil_tmp8; + __cil_tmp9 = DriveMediaLimits + __cil_tmp8; #line 5913 - mem_90 = (DRIVE_MEDIA_TYPE *)__cil_tmp9; + mem_90 = (DRIVE_MEDIA_TYPE *)__cil_tmp9; #line 5913 - driveMediaType = *mem_90; - { -#line 5916 - while (1) { - while_181_continue: /* CIL Label */ ; + driveMediaType = *mem_90; { #line 5916 - mem_91 = (MEDIA_TYPE *)FormatParameters; + while (1) { + while_181_continue: /* CIL Label */; + { #line 5916 - __cil_tmp10 = *mem_91; + mem_91 = (MEDIA_TYPE *)FormatParameters; #line 5916 - __cil_tmp11 = (int )__cil_tmp10; + __cil_tmp10 = *mem_91; #line 5916 - __cil_tmp12 = (unsigned int )driveMediaType; + __cil_tmp11 = (int)__cil_tmp10; #line 5916 - __cil_tmp13 = DriveMediaConstants + __cil_tmp12; + __cil_tmp12 = (unsigned int)driveMediaType; #line 5916 - mem_92 = (MEDIA_TYPE *)__cil_tmp13; + __cil_tmp13 = DriveMediaConstants + __cil_tmp12; #line 5916 - __cil_tmp14 = *mem_92; + mem_92 = (MEDIA_TYPE *)__cil_tmp13; #line 5916 - __cil_tmp15 = (int )__cil_tmp14; + __cil_tmp14 = *mem_92; #line 5916 - if (__cil_tmp15 != __cil_tmp11) { - { + __cil_tmp15 = (int)__cil_tmp14; #line 5916 - __cil_tmp16 = (unsigned int )DisketteExtension; + if (__cil_tmp15 != __cil_tmp11) { + { #line 5916 - __cil_tmp17 = __cil_tmp16 + 174; + __cil_tmp16 = (unsigned int)DisketteExtension; #line 5916 - mem_93 = (UCHAR *)__cil_tmp17; + __cil_tmp17 = __cil_tmp16 + 174; #line 5916 - __cil_tmp18 = *mem_93; + mem_93 = (UCHAR *)__cil_tmp17; #line 5916 - __cil_tmp19 = (int )__cil_tmp18; + __cil_tmp18 = *mem_93; #line 5916 - __cil_tmp20 = DriveMediaLimits + __cil_tmp19; + __cil_tmp19 = (int)__cil_tmp18; #line 5916 - __cil_tmp21 = (unsigned int )__cil_tmp20; + __cil_tmp20 = DriveMediaLimits + __cil_tmp19; #line 5916 - __cil_tmp22 = __cil_tmp21 + 32; + __cil_tmp21 = (unsigned int)__cil_tmp20; #line 5916 - mem_94 = (DRIVE_MEDIA_TYPE *)__cil_tmp22; + __cil_tmp22 = __cil_tmp21 + 32; #line 5916 - __cil_tmp23 = *mem_94; + mem_94 = (DRIVE_MEDIA_TYPE *)__cil_tmp22; #line 5916 - __cil_tmp24 = (int )__cil_tmp23; + __cil_tmp23 = *mem_94; #line 5916 - __cil_tmp25 = (int )driveMediaType; + __cil_tmp24 = (int)__cil_tmp23; #line 5916 - __cil_tmp26 = __cil_tmp25 > __cil_tmp24; + __cil_tmp25 = (int)driveMediaType; #line 5916 - if (! __cil_tmp26) { - goto while_181_break; - } else { - - } - } - } else { - goto while_181_break; - } - } + __cil_tmp26 = __cil_tmp25 > __cil_tmp24; +#line 5916 + if (!__cil_tmp26) { + goto while_181_break; + } else { + } + } + } else { + goto while_181_break; + } + } #line 5921 - __cil_tmp27 = (int )driveMediaType; + __cil_tmp27 = (int)driveMediaType; #line 5921 - __cil_tmp28 = __cil_tmp27 - 1; + __cil_tmp28 = __cil_tmp27 - 1; #line 5921 - driveMediaType = (enum _DRIVE_MEDIA_TYPE )__cil_tmp28; - } - while_181_break: /* CIL Label */ ; - } - { + driveMediaType = (enum _DRIVE_MEDIA_TYPE)__cil_tmp28; + } + while_181_break: /* CIL Label */; + } + { #line 5924 - mem_95 = (MEDIA_TYPE *)FormatParameters; + mem_95 = (MEDIA_TYPE *)FormatParameters; #line 5924 - __cil_tmp29 = *mem_95; + __cil_tmp29 = *mem_95; #line 5924 - __cil_tmp30 = (int )__cil_tmp29; + __cil_tmp30 = (int)__cil_tmp29; #line 5924 - __cil_tmp31 = (unsigned int )driveMediaType; + __cil_tmp31 = (unsigned int)driveMediaType; #line 5924 - __cil_tmp32 = DriveMediaConstants + __cil_tmp31; + __cil_tmp32 = DriveMediaConstants + __cil_tmp31; #line 5924 - mem_96 = (MEDIA_TYPE *)__cil_tmp32; + mem_96 = (MEDIA_TYPE *)__cil_tmp32; #line 5924 - __cil_tmp33 = *mem_96; + __cil_tmp33 = *mem_96; #line 5924 - __cil_tmp34 = (int )__cil_tmp33; + __cil_tmp34 = (int)__cil_tmp33; #line 5924 - if (__cil_tmp34 != __cil_tmp30) { + if (__cil_tmp34 != __cil_tmp30) { #line 5927 - return ((unsigned char)0); - } else { + return ((unsigned char)0); + } else { #line 5931 - __cil_tmp35 = (unsigned int )driveMediaType; + __cil_tmp35 = (unsigned int)driveMediaType; #line 5931 - driveMediaConstants = DriveMediaConstants + __cil_tmp35; - { + driveMediaConstants = DriveMediaConstants + __cil_tmp35; + { #line 5933 - __cil_tmp36 = (unsigned int )driveMediaConstants; + __cil_tmp36 = (unsigned int)driveMediaConstants; #line 5933 - __cil_tmp37 = __cil_tmp36 + 51; + __cil_tmp37 = __cil_tmp36 + 51; #line 5933 - mem_97 = (UCHAR *)__cil_tmp37; + mem_97 = (UCHAR *)__cil_tmp37; #line 5933 - __cil_tmp38 = *mem_97; + __cil_tmp38 = *mem_97; #line 5933 - __cil_tmp39 = (int )__cil_tmp38; + __cil_tmp39 = (int)__cil_tmp38; #line 5933 - __cil_tmp40 = __cil_tmp39 - 1; + __cil_tmp40 = __cil_tmp39 - 1; #line 5933 - __cil_tmp41 = (unsigned long )__cil_tmp40; + __cil_tmp41 = (unsigned long)__cil_tmp40; #line 5933 - __cil_tmp42 = (unsigned int )FormatParameters; + __cil_tmp42 = (unsigned int)FormatParameters; #line 5933 - __cil_tmp43 = __cil_tmp42 + 40; + __cil_tmp43 = __cil_tmp42 + 40; #line 5933 - mem_98 = (ULONG *)__cil_tmp43; + mem_98 = (ULONG *)__cil_tmp43; #line 5933 - __cil_tmp44 = *mem_98; + __cil_tmp44 = *mem_98; #line 5933 - if (__cil_tmp44 > __cil_tmp41) { + if (__cil_tmp44 > __cil_tmp41) { #line 5944 - return ((unsigned char)0); - } else { - { + return ((unsigned char)0); + } else { + { #line 5933 - __cil_tmp45 = (unsigned int )driveMediaConstants; + __cil_tmp45 = (unsigned int)driveMediaConstants; #line 5933 - __cil_tmp46 = __cil_tmp45 + 51; + __cil_tmp46 = __cil_tmp45 + 51; #line 5933 - mem_99 = (UCHAR *)__cil_tmp46; + mem_99 = (UCHAR *)__cil_tmp46; #line 5933 - __cil_tmp47 = *mem_99; + __cil_tmp47 = *mem_99; #line 5933 - __cil_tmp48 = (int )__cil_tmp47; + __cil_tmp48 = (int)__cil_tmp47; #line 5933 - __cil_tmp49 = __cil_tmp48 - 1; + __cil_tmp49 = __cil_tmp48 - 1; #line 5933 - __cil_tmp50 = (unsigned long )__cil_tmp49; + __cil_tmp50 = (unsigned long)__cil_tmp49; #line 5933 - __cil_tmp51 = (unsigned int )FormatParameters; + __cil_tmp51 = (unsigned int)FormatParameters; #line 5933 - __cil_tmp52 = __cil_tmp51 + 44; + __cil_tmp52 = __cil_tmp51 + 44; #line 5933 - mem_100 = (ULONG *)__cil_tmp52; + mem_100 = (ULONG *)__cil_tmp52; #line 5933 - __cil_tmp53 = *mem_100; + __cil_tmp53 = *mem_100; #line 5933 - if (__cil_tmp53 > __cil_tmp50) { + if (__cil_tmp53 > __cil_tmp50) { #line 5944 - return ((unsigned char)0); - } else { - { + return ((unsigned char)0); + } else { + { #line 5933 - __cil_tmp54 = (unsigned int )driveMediaConstants; + __cil_tmp54 = (unsigned int)driveMediaConstants; #line 5933 - __cil_tmp55 = __cil_tmp54 + 48; + __cil_tmp55 = __cil_tmp54 + 48; #line 5933 - mem_101 = (UCHAR *)__cil_tmp55; + mem_101 = (UCHAR *)__cil_tmp55; #line 5933 - __cil_tmp56 = *mem_101; + __cil_tmp56 = *mem_101; #line 5933 - __cil_tmp57 = (unsigned long )__cil_tmp56; + __cil_tmp57 = (unsigned long)__cil_tmp56; #line 5933 - __cil_tmp58 = (unsigned int )FormatParameters; + __cil_tmp58 = (unsigned int)FormatParameters; #line 5933 - __cil_tmp59 = __cil_tmp58 + 32; + __cil_tmp59 = __cil_tmp58 + 32; #line 5933 - mem_102 = (ULONG *)__cil_tmp59; + mem_102 = (ULONG *)__cil_tmp59; #line 5933 - __cil_tmp60 = *mem_102; + __cil_tmp60 = *mem_102; #line 5933 - if (__cil_tmp60 > __cil_tmp57) { + if (__cil_tmp60 > __cil_tmp57) { #line 5944 - return ((unsigned char)0); - } else { - { + return ((unsigned char)0); + } else { + { #line 5933 - __cil_tmp61 = (unsigned int )driveMediaConstants; + __cil_tmp61 = (unsigned int)driveMediaConstants; #line 5933 - __cil_tmp62 = __cil_tmp61 + 48; + __cil_tmp62 = __cil_tmp61 + 48; #line 5933 - mem_103 = (UCHAR *)__cil_tmp62; + mem_103 = (UCHAR *)__cil_tmp62; #line 5933 - __cil_tmp63 = *mem_103; + __cil_tmp63 = *mem_103; #line 5933 - __cil_tmp64 = (unsigned long )__cil_tmp63; + __cil_tmp64 = (unsigned long)__cil_tmp63; #line 5933 - __cil_tmp65 = (unsigned int )FormatParameters; + __cil_tmp65 = (unsigned int)FormatParameters; #line 5933 - __cil_tmp66 = __cil_tmp65 + 36; + __cil_tmp66 = __cil_tmp65 + 36; #line 5933 - mem_104 = (ULONG *)__cil_tmp66; + mem_104 = (ULONG *)__cil_tmp66; #line 5933 - __cil_tmp67 = *mem_104; + __cil_tmp67 = *mem_104; #line 5933 - if (__cil_tmp67 > __cil_tmp64) { + if (__cil_tmp67 > __cil_tmp64) { #line 5944 - return ((unsigned char)0); - } else { - { + return ((unsigned char)0); + } else { + { #line 5933 - __cil_tmp68 = (unsigned int )FormatParameters; + __cil_tmp68 = (unsigned int)FormatParameters; #line 5933 - __cil_tmp69 = __cil_tmp68 + 32; + __cil_tmp69 = __cil_tmp68 + 32; #line 5933 - mem_105 = (ULONG *)__cil_tmp69; + mem_105 = (ULONG *)__cil_tmp69; #line 5933 - __cil_tmp70 = *mem_105; + __cil_tmp70 = *mem_105; #line 5933 - __cil_tmp71 = (unsigned int )FormatParameters; + __cil_tmp71 = (unsigned int)FormatParameters; #line 5933 - __cil_tmp72 = __cil_tmp71 + 36; + __cil_tmp72 = __cil_tmp71 + 36; #line 5933 - mem_106 = (ULONG *)__cil_tmp72; + mem_106 = (ULONG *)__cil_tmp72; #line 5933 - __cil_tmp73 = *mem_106; + __cil_tmp73 = *mem_106; #line 5933 - if (__cil_tmp73 < __cil_tmp70) { + if (__cil_tmp73 < __cil_tmp70) { #line 5944 - return ((unsigned char)0); - } else { - { + return ((unsigned char)0); + } else { + { #line 5948 - __cil_tmp74 = (KUSER_SHARED_DATA * const )4292804608U; + __cil_tmp74 = + (KUSER_SHARED_DATA * const)4292804608U; #line 5948 - __cil_tmp75 = (unsigned int )__cil_tmp74; + __cil_tmp75 = (unsigned int)__cil_tmp74; #line 5948 - __cil_tmp76 = __cil_tmp75 + 732; + __cil_tmp76 = __cil_tmp75 + 732; #line 5948 - mem_107 = (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp76; + mem_107 = + (ALTERNATIVE_ARCHITECTURE_TYPE *)__cil_tmp76; #line 5948 - __cil_tmp77 = *mem_107; + __cil_tmp77 = *mem_107; #line 5948 - __cil_tmp78 = (int )__cil_tmp77; + __cil_tmp78 = (int)__cil_tmp77; #line 5948 - if (__cil_tmp78 == 1) { - { + if (__cil_tmp78 == 1) { + { #line 5949 - mem_108 = (MEDIA_TYPE *)FormatParameters; + mem_108 = (MEDIA_TYPE *)FormatParameters; #line 5949 - __cil_tmp79 = *mem_108; + __cil_tmp79 = *mem_108; #line 5949 - __cil_tmp80 = (int )__cil_tmp79; + __cil_tmp80 = (int)__cil_tmp79; #line 5949 - if (__cil_tmp80 == 6) { + if (__cil_tmp80 == 6) { #line 5955 - return ((unsigned char)0); - } else { - { + return ((unsigned char)0); + } else { + { #line 5949 - mem_109 = (MEDIA_TYPE *)FormatParameters; + mem_109 = (MEDIA_TYPE *)FormatParameters; #line 5949 - __cil_tmp81 = *mem_109; + __cil_tmp81 = *mem_109; #line 5949 - __cil_tmp82 = (int )__cil_tmp81; + __cil_tmp82 = (int)__cil_tmp81; #line 5949 - if (__cil_tmp82 == 7) { + if (__cil_tmp82 == 7) { #line 5955 - return ((unsigned char)0); - } else { - { + return ((unsigned char)0); + } else { + { #line 5949 - mem_110 = (MEDIA_TYPE *)FormatParameters; + mem_110 = + (MEDIA_TYPE *)FormatParameters; #line 5949 - __cil_tmp83 = *mem_110; + __cil_tmp83 = *mem_110; #line 5949 - __cil_tmp84 = (int )__cil_tmp83; + __cil_tmp84 = (int)__cil_tmp83; #line 5949 - if (__cil_tmp84 == 8) { + if (__cil_tmp84 == 8) { #line 5955 - return ((unsigned char)0); - } else { - { + return ((unsigned char)0); + } else { + { #line 5949 - mem_111 = (MEDIA_TYPE *)FormatParameters; + mem_111 = (MEDIA_TYPE *) + FormatParameters; #line 5949 - __cil_tmp85 = *mem_111; + __cil_tmp85 = *mem_111; #line 5949 - __cil_tmp86 = (int )__cil_tmp85; + __cil_tmp86 = (int)__cil_tmp85; #line 5949 - if (__cil_tmp86 == 9) { + if (__cil_tmp86 == 9) { #line 5955 - return ((unsigned char)0); - } else { - { + return ((unsigned char)0); + } else { + { #line 5949 - mem_112 = (MEDIA_TYPE *)FormatParameters; + mem_112 = (MEDIA_TYPE *) + FormatParameters; #line 5949 - __cil_tmp87 = *mem_112; + __cil_tmp87 = *mem_112; #line 5949 - __cil_tmp88 = (int )__cil_tmp87; + __cil_tmp88 = + (int)__cil_tmp87; #line 5949 - if (__cil_tmp88 == 10) { + if (__cil_tmp88 == 10) { #line 5955 - return ((unsigned char)0); - } else { - - } + return ((unsigned char)0); + } else { + } + } + } + } + } + } + } + } + } + } + } else { + } + } +#line 5959 + return ((unsigned char)1); + } } } - } - } } } - } - } } - } else { - } - } -#line 5959 - return ((unsigned char)1); } - } - } } } - } - } } } - } - } } } -} #line 5964 "floppy.c" -NTSTATUS FlIssueCommand(PDISKETTE_EXTENSION DisketteExtension , PUCHAR FifoInBuffer , - PUCHAR FifoOutBuffer , PMDL IoMdl , ULONG IoOffset , ULONG TransferBytes ) -{ NTSTATUS ntStatus ; - ISSUE_FDC_COMMAND_PARMS issueCommandParms ; - ISSUE_FDC_COMMAND_PARMS *__cil_tmp9 ; - unsigned int __cil_tmp10 ; - unsigned int __cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - unsigned int __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - PDEVICE_OBJECT __cil_tmp17 ; - int __cil_tmp18 ; - int __cil_tmp19 ; - int __cil_tmp20 ; - int __cil_tmp21 ; - unsigned long __cil_tmp22 ; - void *__cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - PUCHAR *mem_28 ; - PUCHAR *mem_29 ; - PVOID *mem_30 ; - ULONG *mem_31 ; - ULONG *mem_32 ; - ULONG *mem_33 ; - PDEVICE_OBJECT *mem_34 ; - BOOLEAN *mem_35 ; - BOOLEAN *mem_36 ; +NTSTATUS FlIssueCommand(PDISKETTE_EXTENSION DisketteExtension, + PUCHAR FifoInBuffer, PUCHAR FifoOutBuffer, PMDL IoMdl, + ULONG IoOffset, ULONG TransferBytes) { + NTSTATUS ntStatus; + ISSUE_FDC_COMMAND_PARMS issueCommandParms; + ISSUE_FDC_COMMAND_PARMS *__cil_tmp9; + unsigned int __cil_tmp10; + unsigned int __cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + unsigned int __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + PDEVICE_OBJECT __cil_tmp17; + int __cil_tmp18; + int __cil_tmp19; + int __cil_tmp20; + int __cil_tmp21; + unsigned long __cil_tmp22; + void *__cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + PUCHAR *mem_28; + PUCHAR *mem_29; + PVOID *mem_30; + ULONG *mem_31; + ULONG *mem_32; + ULONG *mem_33; + PDEVICE_OBJECT *mem_34; + BOOLEAN *mem_35; + BOOLEAN *mem_36; { #line 6018 - __cil_tmp9 = & issueCommandParms; + __cil_tmp9 = &issueCommandParms; #line 6018 - mem_28 = (PUCHAR *)__cil_tmp9; + mem_28 = (PUCHAR *)__cil_tmp9; #line 6018 - *mem_28 = FifoInBuffer; + *mem_28 = FifoInBuffer; #line 6019 - __cil_tmp10 = (unsigned int )(& issueCommandParms) + 4; + __cil_tmp10 = (unsigned int)(&issueCommandParms) + 4; #line 6019 - mem_29 = (PUCHAR *)__cil_tmp10; + mem_29 = (PUCHAR *)__cil_tmp10; #line 6019 - *mem_29 = FifoOutBuffer; + *mem_29 = FifoOutBuffer; #line 6020 - __cil_tmp11 = (unsigned int )(& issueCommandParms) + 8; + __cil_tmp11 = (unsigned int)(&issueCommandParms) + 8; #line 6020 - mem_30 = (PVOID *)__cil_tmp11; + mem_30 = (PVOID *)__cil_tmp11; #line 6020 - *mem_30 = (void *)IoMdl; + *mem_30 = (void *)IoMdl; #line 6021 - __cil_tmp12 = (unsigned int )(& issueCommandParms) + 12; + __cil_tmp12 = (unsigned int)(&issueCommandParms) + 12; #line 6021 - mem_31 = (ULONG *)__cil_tmp12; + mem_31 = (ULONG *)__cil_tmp12; #line 6021 - *mem_31 = IoOffset; + *mem_31 = IoOffset; #line 6022 - __cil_tmp13 = (unsigned int )(& issueCommandParms) + 16; + __cil_tmp13 = (unsigned int)(&issueCommandParms) + 16; #line 6022 - mem_32 = (ULONG *)__cil_tmp13; + mem_32 = (ULONG *)__cil_tmp13; #line 6022 - *mem_32 = TransferBytes; + *mem_32 = TransferBytes; #line 6023 - __cil_tmp14 = (unsigned int )(& issueCommandParms) + 20; + __cil_tmp14 = (unsigned int)(&issueCommandParms) + 20; #line 6023 - mem_33 = (ULONG *)__cil_tmp14; + mem_33 = (ULONG *)__cil_tmp14; #line 6023 - *mem_33 = 4UL; - { + *mem_33 = 4UL; + { #line 6028 - while (1) { - while_182_continue: /* CIL Label */ ; - goto while_182_break; - } - while_182_break: /* CIL Label */ ; - } - { + while (1) { + while_182_continue: /* CIL Label */; + goto while_182_break; + } + while_182_break: /* CIL Label */; + } + { #line 6030 - __cil_tmp15 = (unsigned int )DisketteExtension; + __cil_tmp15 = (unsigned int)DisketteExtension; #line 6030 - __cil_tmp16 = __cil_tmp15 + 8; + __cil_tmp16 = __cil_tmp15 + 8; #line 6030 - mem_34 = (PDEVICE_OBJECT *)__cil_tmp16; + mem_34 = (PDEVICE_OBJECT *)__cil_tmp16; #line 6030 - __cil_tmp17 = *mem_34; + __cil_tmp17 = *mem_34; #line 6030 - __cil_tmp18 = 771 << 2; + __cil_tmp18 = 771 << 2; #line 6030 - __cil_tmp19 = 7 << 16; + __cil_tmp19 = 7 << 16; #line 6030 - __cil_tmp20 = __cil_tmp19 | __cil_tmp18; + __cil_tmp20 = __cil_tmp19 | __cil_tmp18; #line 6030 - __cil_tmp21 = __cil_tmp20 | 3; + __cil_tmp21 = __cil_tmp20 | 3; #line 6030 - __cil_tmp22 = (unsigned long )__cil_tmp21; + __cil_tmp22 = (unsigned long)__cil_tmp21; #line 6030 - __cil_tmp23 = (void *)(& issueCommandParms); + __cil_tmp23 = (void *)(&issueCommandParms); #line 6030 - ntStatus = FlFdcDeviceIo(__cil_tmp17, __cil_tmp22, __cil_tmp23); - } + ntStatus = FlFdcDeviceIo(__cil_tmp17, __cil_tmp22, __cil_tmp23); + } #line 6038 - if (ntStatus == -1073741661L) { + if (ntStatus == -1073741661L) { #line 6041 - __cil_tmp24 = (unsigned int )DisketteExtension; + __cil_tmp24 = (unsigned int)DisketteExtension; #line 6041 - __cil_tmp25 = __cil_tmp24 + 104; + __cil_tmp25 = __cil_tmp24 + 104; #line 6041 - mem_35 = (BOOLEAN *)__cil_tmp25; + mem_35 = (BOOLEAN *)__cil_tmp25; #line 6041 - *mem_35 = (unsigned char)1; - } else { + *mem_35 = (unsigned char)1; + } else { #line 6038 - if (ntStatus == -1073741464L) { + if (ntStatus == -1073741464L) { #line 6041 - __cil_tmp26 = (unsigned int )DisketteExtension; + __cil_tmp26 = (unsigned int)DisketteExtension; #line 6041 - __cil_tmp27 = __cil_tmp26 + 104; + __cil_tmp27 = __cil_tmp26 + 104; #line 6041 - mem_36 = (BOOLEAN *)__cil_tmp27; + mem_36 = (BOOLEAN *)__cil_tmp27; #line 6041 - *mem_36 = (unsigned char)1; - } else { - + *mem_36 = (unsigned char)1; + } else { + } } - } #line 6044 - return (ntStatus); -} + return (ntStatus); + } } #line 6047 "floppy.c" -NTSTATUS FlInitializeControllerHardware(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - unsigned int __cil_tmp3 ; - unsigned int __cil_tmp4 ; - PDEVICE_OBJECT __cil_tmp5 ; - int __cil_tmp6 ; - int __cil_tmp7 ; - int __cil_tmp8 ; - int __cil_tmp9 ; - unsigned long __cil_tmp10 ; - void *__cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - UCHAR __cil_tmp14 ; - int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - UCHAR __cil_tmp26 ; - int __cil_tmp27 ; - int __cil_tmp28 ; - int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - unsigned int __cil_tmp32 ; - unsigned int __cil_tmp33 ; - UCHAR *__cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - UCHAR *__cil_tmp39 ; - void *__cil_tmp40 ; - struct _MDL *__cil_tmp41 ; - PDEVICE_OBJECT *mem_42 ; - UCHAR *mem_43 ; - UCHAR *mem_44 ; - UCHAR *mem_45 ; - UCHAR *mem_46 ; +NTSTATUS FlInitializeControllerHardware(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + unsigned int __cil_tmp3; + unsigned int __cil_tmp4; + PDEVICE_OBJECT __cil_tmp5; + int __cil_tmp6; + int __cil_tmp7; + int __cil_tmp8; + int __cil_tmp9; + unsigned long __cil_tmp10; + void *__cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + UCHAR __cil_tmp14; + int __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + UCHAR __cil_tmp26; + int __cil_tmp27; + int __cil_tmp28; + int __cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + unsigned int __cil_tmp32; + unsigned int __cil_tmp33; + UCHAR *__cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + UCHAR *__cil_tmp39; + void *__cil_tmp40; + struct _MDL *__cil_tmp41; + PDEVICE_OBJECT *mem_42; + UCHAR *mem_43; + UCHAR *mem_44; + UCHAR *mem_45; + UCHAR *mem_46; { - { + { #line 6069 - __cil_tmp3 = (unsigned int )DisketteExtension; + __cil_tmp3 = (unsigned int)DisketteExtension; #line 6069 - __cil_tmp4 = __cil_tmp3 + 8; + __cil_tmp4 = __cil_tmp3 + 8; #line 6069 - mem_42 = (PDEVICE_OBJECT *)__cil_tmp4; + mem_42 = (PDEVICE_OBJECT *)__cil_tmp4; #line 6069 - __cil_tmp5 = *mem_42; + __cil_tmp5 = *mem_42; #line 6069 - __cil_tmp6 = 773 << 2; + __cil_tmp6 = 773 << 2; #line 6069 - __cil_tmp7 = 7 << 16; + __cil_tmp7 = 7 << 16; #line 6069 - __cil_tmp8 = __cil_tmp7 | __cil_tmp6; + __cil_tmp8 = __cil_tmp7 | __cil_tmp6; #line 6069 - __cil_tmp9 = __cil_tmp8 | 3; + __cil_tmp9 = __cil_tmp8 | 3; #line 6069 - __cil_tmp10 = (unsigned long )__cil_tmp9; + __cil_tmp10 = (unsigned long)__cil_tmp9; #line 6069 - __cil_tmp11 = (void *)0; + __cil_tmp11 = (void *)0; #line 6069 - ntStatus = FlFdcDeviceIo(__cil_tmp5, __cil_tmp10, __cil_tmp11); - } + ntStatus = FlFdcDeviceIo(__cil_tmp5, __cil_tmp10, __cil_tmp11); + } #line 6073 - if (ntStatus >= 0L) { - { + if (ntStatus >= 0L) { + { #line 6075 - __cil_tmp12 = (unsigned int )DisketteExtension; + __cil_tmp12 = (unsigned int)DisketteExtension; #line 6075 - __cil_tmp13 = __cil_tmp12 + 364; + __cil_tmp13 = __cil_tmp12 + 364; #line 6075 - mem_43 = (UCHAR *)__cil_tmp13; + mem_43 = (UCHAR *)__cil_tmp13; #line 6075 - __cil_tmp14 = *mem_43; + __cil_tmp14 = *mem_43; #line 6075 - __cil_tmp15 = (int )__cil_tmp14; + __cil_tmp15 = (int)__cil_tmp14; #line 6075 - if (__cil_tmp15 != 0) { - { + if (__cil_tmp15 != 0) { + { #line 6077 - __cil_tmp16 = 0 * 1U; + __cil_tmp16 = 0 * 1U; #line 6077 - __cil_tmp17 = 112 + __cil_tmp16; + __cil_tmp17 = 112 + __cil_tmp16; #line 6077 - __cil_tmp18 = (unsigned int )DisketteExtension; + __cil_tmp18 = (unsigned int)DisketteExtension; #line 6077 - __cil_tmp19 = __cil_tmp18 + __cil_tmp17; + __cil_tmp19 = __cil_tmp18 + __cil_tmp17; #line 6077 - mem_44 = (UCHAR *)__cil_tmp19; + mem_44 = (UCHAR *)__cil_tmp19; #line 6077 - *mem_44 = (unsigned char)21; + *mem_44 = (unsigned char)21; #line 6078 - __cil_tmp20 = 1 * 1U; + __cil_tmp20 = 1 * 1U; #line 6078 - __cil_tmp21 = 112 + __cil_tmp20; + __cil_tmp21 = 112 + __cil_tmp20; #line 6078 - __cil_tmp22 = (unsigned int )DisketteExtension; + __cil_tmp22 = (unsigned int)DisketteExtension; #line 6078 - __cil_tmp23 = __cil_tmp22 + __cil_tmp21; + __cil_tmp23 = __cil_tmp22 + __cil_tmp21; #line 6078 - __cil_tmp24 = (unsigned int )DisketteExtension; + __cil_tmp24 = (unsigned int)DisketteExtension; #line 6078 - __cil_tmp25 = __cil_tmp24 + 364; + __cil_tmp25 = __cil_tmp24 + 364; #line 6078 - mem_45 = (UCHAR *)__cil_tmp25; + mem_45 = (UCHAR *)__cil_tmp25; #line 6078 - __cil_tmp26 = *mem_45; + __cil_tmp26 = *mem_45; #line 6078 - __cil_tmp27 = (int )__cil_tmp26; + __cil_tmp27 = (int)__cil_tmp26; #line 6078 - __cil_tmp28 = __cil_tmp27 << 2; + __cil_tmp28 = __cil_tmp27 << 2; #line 6078 - __cil_tmp29 = 128 | __cil_tmp28; + __cil_tmp29 = 128 | __cil_tmp28; #line 6078 - mem_46 = (UCHAR *)__cil_tmp23; + mem_46 = (UCHAR *)__cil_tmp23; #line 6078 - *mem_46 = (unsigned char )__cil_tmp29; + *mem_46 = (unsigned char)__cil_tmp29; #line 6082 - __cil_tmp30 = 0 * 1U; + __cil_tmp30 = 0 * 1U; #line 6082 - __cil_tmp31 = 112 + __cil_tmp30; + __cil_tmp31 = 112 + __cil_tmp30; #line 6082 - __cil_tmp32 = (unsigned int )DisketteExtension; + __cil_tmp32 = (unsigned int)DisketteExtension; #line 6082 - __cil_tmp33 = __cil_tmp32 + __cil_tmp31; + __cil_tmp33 = __cil_tmp32 + __cil_tmp31; #line 6082 - __cil_tmp34 = (UCHAR *)__cil_tmp33; + __cil_tmp34 = (UCHAR *)__cil_tmp33; #line 6082 - __cil_tmp35 = 0 * 1U; + __cil_tmp35 = 0 * 1U; #line 6082 - __cil_tmp36 = 112 + __cil_tmp35; + __cil_tmp36 = 112 + __cil_tmp35; #line 6082 - __cil_tmp37 = (unsigned int )DisketteExtension; + __cil_tmp37 = (unsigned int)DisketteExtension; #line 6082 - __cil_tmp38 = __cil_tmp37 + __cil_tmp36; + __cil_tmp38 = __cil_tmp37 + __cil_tmp36; #line 6082 - __cil_tmp39 = (UCHAR *)__cil_tmp38; + __cil_tmp39 = (UCHAR *)__cil_tmp38; #line 6082 - __cil_tmp40 = (void *)0; + __cil_tmp40 = (void *)0; #line 6082 - __cil_tmp41 = (struct _MDL *)__cil_tmp40; + __cil_tmp41 = (struct _MDL *)__cil_tmp40; #line 6082 - ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp34, __cil_tmp39, __cil_tmp41, - 0UL, 0UL); + ntStatus = FlIssueCommand(DisketteExtension, __cil_tmp34, + __cil_tmp39, __cil_tmp41, 0UL, 0UL); + } + } else { + } } - } else { - - } + } else { } - } else { - - } #line 6092 - return (ntStatus); -} + return (ntStatus); + } } #line 6095 "floppy.c" -NTSTATUS FlFdcDeviceIo(PDEVICE_OBJECT DeviceObject , ULONG Ioctl , PVOID Data ) -{ NTSTATUS ntStatus ; - PIRP irp ; - PIO_STACK_LOCATION irpStack ; - KEVENT doneEvent ; - IO_STATUS_BLOCK ioStatus ; - enum _EVENT_TYPE __cil_tmp9 ; - void *__cil_tmp10 ; - void *__cil_tmp11 ; - void *__cil_tmp12 ; - unsigned int __cil_tmp13 ; - unsigned int __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - struct _IO_STACK_LOCATION *__cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - void *__cil_tmp25 ; - enum _KWAIT_REASON __cil_tmp26 ; - void *__cil_tmp27 ; - LARGE_INTEGER *__cil_tmp28 ; - IO_STATUS_BLOCK *__cil_tmp29 ; - struct _IO_STACK_LOCATION **mem_30 ; - PVOID *mem_31 ; - NTSTATUS *mem_32 ; +NTSTATUS FlFdcDeviceIo(PDEVICE_OBJECT DeviceObject, ULONG Ioctl, PVOID Data) { + NTSTATUS ntStatus; + PIRP irp; + PIO_STACK_LOCATION irpStack; + KEVENT doneEvent; + IO_STATUS_BLOCK ioStatus; + enum _EVENT_TYPE __cil_tmp9; + void *__cil_tmp10; + void *__cil_tmp11; + void *__cil_tmp12; + unsigned int __cil_tmp13; + unsigned int __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + struct _IO_STACK_LOCATION *__cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + void *__cil_tmp25; + enum _KWAIT_REASON __cil_tmp26; + void *__cil_tmp27; + LARGE_INTEGER *__cil_tmp28; + IO_STATUS_BLOCK *__cil_tmp29; + struct _IO_STACK_LOCATION **mem_30; + PVOID *mem_31; + NTSTATUS *mem_32; { - { + { #line 6108 - while (1) { - while_183_continue: /* CIL Label */ ; - goto while_183_break; - } - while_183_break: /* CIL Label */ ; - } - { + while (1) { + while_183_continue: /* CIL Label */; + goto while_183_break; + } + while_183_break: /* CIL Label */; + } + { #line 6110 - __cil_tmp9 = (enum _EVENT_TYPE )0; + __cil_tmp9 = (enum _EVENT_TYPE)0; #line 6110 - KeInitializeEvent(& doneEvent, __cil_tmp9, (unsigned char)0); + KeInitializeEvent(&doneEvent, __cil_tmp9, (unsigned char)0); #line 6117 - __cil_tmp10 = (void *)0; + __cil_tmp10 = (void *)0; #line 6117 - __cil_tmp11 = (void *)0; + __cil_tmp11 = (void *)0; #line 6117 - irp = IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, __cil_tmp10, 0UL, __cil_tmp11, - 0UL, (unsigned char)1, & doneEvent, & ioStatus); - } - { + irp = IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, __cil_tmp10, 0UL, + __cil_tmp11, 0UL, (unsigned char)1, + &doneEvent, &ioStatus); + } + { #line 6127 - __cil_tmp12 = (void *)0; + __cil_tmp12 = (void *)0; #line 6127 - __cil_tmp13 = (unsigned int )__cil_tmp12; + __cil_tmp13 = (unsigned int)__cil_tmp12; #line 6127 - __cil_tmp14 = (unsigned int )irp; + __cil_tmp14 = (unsigned int)irp; #line 6127 - if (__cil_tmp14 == __cil_tmp13) { - { + if (__cil_tmp14 == __cil_tmp13) { + { #line 6129 - while (1) { - while_184_continue: /* CIL Label */ ; - goto while_184_break; - } - while_184_break: /* CIL Label */ ; - } + while (1) { + while_184_continue: /* CIL Label */; + goto while_184_break; + } + while_184_break: /* CIL Label */; + } #line 6135 - return (-1073741670L); - } else { - - } - } - { + return (-1073741670L); + } else { + } + } + { #line 6138 - __cil_tmp15 = 24 + 8; + __cil_tmp15 = 24 + 8; #line 6138 - __cil_tmp16 = 0 + __cil_tmp15; + __cil_tmp16 = 0 + __cil_tmp15; #line 6138 - __cil_tmp17 = 64 + __cil_tmp16; + __cil_tmp17 = 64 + __cil_tmp16; #line 6138 - __cil_tmp18 = (unsigned int )irp; + __cil_tmp18 = (unsigned int)irp; #line 6138 - __cil_tmp19 = __cil_tmp18 + __cil_tmp17; + __cil_tmp19 = __cil_tmp18 + __cil_tmp17; #line 6138 - mem_30 = (struct _IO_STACK_LOCATION **)__cil_tmp19; + mem_30 = (struct _IO_STACK_LOCATION **)__cil_tmp19; #line 6138 - __cil_tmp20 = *mem_30; + __cil_tmp20 = *mem_30; #line 6138 - irpStack = __cil_tmp20 - 1; + irpStack = __cil_tmp20 - 1; #line 6139 - __cil_tmp21 = 0 + 12; + __cil_tmp21 = 0 + 12; #line 6139 - __cil_tmp22 = 4 + __cil_tmp21; + __cil_tmp22 = 4 + __cil_tmp21; #line 6139 - __cil_tmp23 = (unsigned int )irpStack; + __cil_tmp23 = (unsigned int)irpStack; #line 6139 - __cil_tmp24 = __cil_tmp23 + __cil_tmp22; + __cil_tmp24 = __cil_tmp23 + __cil_tmp22; #line 6139 - mem_31 = (PVOID *)__cil_tmp24; + mem_31 = (PVOID *)__cil_tmp24; #line 6139 - *mem_31 = Data; + *mem_31 = Data; #line 6144 - ntStatus = IofCallDriver(DeviceObject, irp); - } + ntStatus = IofCallDriver(DeviceObject, irp); + } #line 6146 - if (ntStatus == 259L) { - { + if (ntStatus == 259L) { + { #line 6152 - __cil_tmp25 = (void *)(& doneEvent); + __cil_tmp25 = (void *)(&doneEvent); #line 6152 - __cil_tmp26 = (enum _KWAIT_REASON )5; + __cil_tmp26 = (enum _KWAIT_REASON)5; #line 6152 - __cil_tmp27 = (void *)0; + __cil_tmp27 = (void *)0; #line 6152 - __cil_tmp28 = (LARGE_INTEGER *)__cil_tmp27; + __cil_tmp28 = (LARGE_INTEGER *)__cil_tmp27; #line 6152 - KeWaitForSingleObject(__cil_tmp25, __cil_tmp26, (char)0, (unsigned char)0, __cil_tmp28); + KeWaitForSingleObject(__cil_tmp25, __cil_tmp26, (char)0, + (unsigned char)0, __cil_tmp28); #line 6158 - __cil_tmp29 = & ioStatus; + __cil_tmp29 = &ioStatus; #line 6158 - mem_32 = (NTSTATUS *)__cil_tmp29; + mem_32 = (NTSTATUS *)__cil_tmp29; #line 6158 - ntStatus = *mem_32; + ntStatus = *mem_32; + } + } else { } - } else { - - } #line 6161 - return (ntStatus); -} + return (ntStatus); + } } #line 6165 "floppy.c" -NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - SHORT st5 ; - BOOLEAN media144MB ; - BOOLEAN mediaUpTo120MB ; - BOOLEAN supportDrive ; - SET_HD_BIT_PARMS setHdBitParameter ; - unsigned int __cil_tmp8 ; - unsigned int __cil_tmp9 ; - DRIVE_MEDIA_TYPE __cil_tmp10 ; - unsigned int __cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - unsigned int __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - UCHAR __cil_tmp18 ; - int __cil_tmp19 ; - SET_HD_BIT_PARMS *__cil_tmp20 ; - SET_HD_BIT_PARMS *__cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - PDEVICE_OBJECT __cil_tmp24 ; - int __cil_tmp25 ; - int __cil_tmp26 ; - int __cil_tmp27 ; - int __cil_tmp28 ; - unsigned long __cil_tmp29 ; - void *__cil_tmp30 ; - int __cil_tmp31 ; - unsigned int __cil_tmp32 ; - DRIVE_MEDIA_TYPE *mem_33 ; - BOOLEAN *mem_34 ; - BOOLEAN *mem_35 ; - UCHAR *mem_36 ; - UCHAR *mem_37 ; - UCHAR *mem_38 ; - BOOLEAN *mem_39 ; - BOOLEAN *mem_40 ; - PDEVICE_OBJECT *mem_41 ; - BOOLEAN *mem_42 ; +NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + SHORT st5; + BOOLEAN media144MB; + BOOLEAN mediaUpTo120MB; + BOOLEAN supportDrive; + SET_HD_BIT_PARMS setHdBitParameter; + unsigned int __cil_tmp8; + unsigned int __cil_tmp9; + DRIVE_MEDIA_TYPE __cil_tmp10; + unsigned int __cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + unsigned int __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + UCHAR __cil_tmp18; + int __cil_tmp19; + SET_HD_BIT_PARMS *__cil_tmp20; + SET_HD_BIT_PARMS *__cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + PDEVICE_OBJECT __cil_tmp24; + int __cil_tmp25; + int __cil_tmp26; + int __cil_tmp27; + int __cil_tmp28; + unsigned long __cil_tmp29; + void *__cil_tmp30; + int __cil_tmp31; + unsigned int __cil_tmp32; + DRIVE_MEDIA_TYPE *mem_33; + BOOLEAN *mem_34; + BOOLEAN *mem_35; + UCHAR *mem_36; + UCHAR *mem_37; + UCHAR *mem_38; + BOOLEAN *mem_39; + BOOLEAN *mem_40; + PDEVICE_OBJECT *mem_41; + BOOLEAN *mem_42; { #line 6195 - st5 = (short)0; + st5 = (short)0; #line 6210 - media144MB = (unsigned char)0; + media144MB = (unsigned char)0; #line 6211 - mediaUpTo120MB = (unsigned char)0; + mediaUpTo120MB = (unsigned char)0; #line 6212 - supportDrive = (unsigned char)1; - { + supportDrive = (unsigned char)1; + { #line 6217 - while (1) { - while_185_continue: /* CIL Label */ ; - goto while_185_break; - } - while_185_break: /* CIL Label */ ; - } - { + while (1) { + while_185_continue: /* CIL Label */; + goto while_185_break; + } + while_185_break: /* CIL Label */; + } + { #line 6219 - __cil_tmp8 = (unsigned int )DisketteExtension; + __cil_tmp8 = (unsigned int)DisketteExtension; #line 6219 - __cil_tmp9 = __cil_tmp8 + 216; + __cil_tmp9 = __cil_tmp8 + 216; #line 6219 - mem_33 = (DRIVE_MEDIA_TYPE *)__cil_tmp9; + mem_33 = (DRIVE_MEDIA_TYPE *)__cil_tmp9; #line 6219 - __cil_tmp10 = *mem_33; + __cil_tmp10 = *mem_33; #line 6220 - if ((int )__cil_tmp10 == 18) { - goto switch_186_18; - } else { + if ((int)__cil_tmp10 == 18) { + goto switch_186_18; + } else { #line 6227 - if ((int )__cil_tmp10 == 16) { - goto switch_186_16; - } else { + if ((int)__cil_tmp10 == 16) { + goto switch_186_16; + } else { #line 6228 - if ((int )__cil_tmp10 == 17) { - goto switch_186_17; - } else { + if ((int)__cil_tmp10 == 17) { + goto switch_186_17; + } else { #line 6229 - if ((int )__cil_tmp10 == 12) { - goto switch_186_12; - } else { + if ((int)__cil_tmp10 == 12) { + goto switch_186_12; + } else { #line 6230 - if ((int )__cil_tmp10 == 13) { - goto switch_186_13; - } else { + if ((int)__cil_tmp10 == 13) { + goto switch_186_13; + } else { #line 6231 - if ((int )__cil_tmp10 == 19) { - goto switch_186_19; - } else { + if ((int)__cil_tmp10 == 19) { + goto switch_186_19; + } else { #line 6232 - if ((int )__cil_tmp10 == 20) { - goto switch_186_20; - } else { + if ((int)__cil_tmp10 == 20) { + goto switch_186_20; + } else { #line 6235 - if ((int )__cil_tmp10 == 0) { - goto switch_186_0; - } else { + if ((int)__cil_tmp10 == 0) { + goto switch_186_0; + } else { #line 6236 - if ((int )__cil_tmp10 == 1) { - goto switch_186_1; - } else { + if ((int)__cil_tmp10 == 1) { + goto switch_186_1; + } else { #line 6237 - if ((int )__cil_tmp10 == 2) { - goto switch_186_2; - } else { + if ((int)__cil_tmp10 == 2) { + goto switch_186_2; + } else { #line 6238 - if ((int )__cil_tmp10 == 3) { - goto switch_186_3; - } else { + if ((int)__cil_tmp10 == 3) { + goto switch_186_3; + } else { #line 6239 - if ((int )__cil_tmp10 == 4) { - goto switch_186_4; - } else { + if ((int)__cil_tmp10 == 4) { + goto switch_186_4; + } else { #line 6240 - if ((int )__cil_tmp10 == 5) { - goto switch_186_5; - } else { + if ((int)__cil_tmp10 == 5) { + goto switch_186_5; + } else { #line 6241 - if ((int )__cil_tmp10 == 6) { - goto switch_186_6; - } else { + if ((int)__cil_tmp10 == 6) { + goto switch_186_6; + } else { #line 6242 - if ((int )__cil_tmp10 == 7) { - goto switch_186_7; - } else { + if ((int)__cil_tmp10 == 7) { + goto switch_186_7; + } else { #line 6243 - if ((int )__cil_tmp10 == 8) { - goto switch_186_8; - } else { + if ((int)__cil_tmp10 == 8) { + goto switch_186_8; + } else { #line 6244 - if ((int )__cil_tmp10 == 9) { - goto switch_186_9; - } else { + if ((int)__cil_tmp10 == 9) { + goto switch_186_9; + } else { #line 6245 - if ((int )__cil_tmp10 == 10) { - goto switch_186_10; - } else { + if ((int)__cil_tmp10 == 10) { + goto switch_186_10; + } else { #line 6246 - if ((int )__cil_tmp10 == 11) { - goto switch_186_11; - } else { + if ((int)__cil_tmp10 == 11) { + goto switch_186_11; + } else { #line 6247 - if ((int )__cil_tmp10 == 14) { - goto switch_186_14; - } else { + if ((int)__cil_tmp10 == 14) { + goto switch_186_14; + } else { #line 6248 - if ((int )__cil_tmp10 == 15) { - goto switch_186_15; - } else { - { - goto switch_186_default; + if ((int)__cil_tmp10 == 15) { + goto switch_186_15; + } else { + { + goto switch_186_default; #line 6219 - if (0) { - switch_186_18: /* CIL Label */ + if (0) { + switch_186_18: /* CIL Label */ #line 6226 - media144MB = (unsigned char)1; - switch_186_16: /* CIL Label */ ; - switch_186_17: /* CIL Label */ ; - switch_186_12: /* CIL Label */ ; - switch_186_13: /* CIL Label */ ; - switch_186_19: /* CIL Label */ ; - switch_186_20: /* CIL Label */ + media144MB = + (unsigned char)1; + switch_186_16 + : /* CIL Label */; + switch_186_17 + : /* CIL Label */; + switch_186_12 + : /* CIL Label */; + switch_186_13 + : /* CIL Label */; + switch_186_19 + : /* CIL Label */; + switch_186_20: /* CIL Label */ #line 6234 - mediaUpTo120MB = (unsigned char)1; - switch_186_0: /* CIL Label */ ; - switch_186_1: /* CIL Label */ ; - switch_186_2: /* CIL Label */ ; - switch_186_3: /* CIL Label */ ; - switch_186_4: /* CIL Label */ ; - switch_186_5: /* CIL Label */ ; - switch_186_6: /* CIL Label */ ; - switch_186_7: /* CIL Label */ ; - switch_186_8: /* CIL Label */ ; - switch_186_9: /* CIL Label */ ; - switch_186_10: /* CIL Label */ ; - switch_186_11: /* CIL Label */ ; - switch_186_14: /* CIL Label */ ; - switch_186_15: /* CIL Label */ ; - goto switch_186_break; - switch_186_default: /* CIL Label */ + mediaUpTo120MB = + (unsigned char)1; + switch_186_0: /* CIL Label */; + switch_186_1: /* CIL Label */; + switch_186_2: /* CIL Label */; + switch_186_3: /* CIL Label */; + switch_186_4: /* CIL Label */; + switch_186_5: /* CIL Label */; + switch_186_6: /* CIL Label */; + switch_186_7: /* CIL Label */; + switch_186_8: /* CIL Label */; + switch_186_9: /* CIL Label */; + switch_186_10 + : /* CIL Label */; + switch_186_11 + : /* CIL Label */; + switch_186_14 + : /* CIL Label */; + switch_186_15 + : /* CIL Label */; + goto switch_186_break; + switch_186_default + : /* CIL Label */ #line 6260 - mediaUpTo120MB = (unsigned char)1; - goto switch_186_break; - } else { - switch_186_break: /* CIL Label */ ; - } + mediaUpTo120MB = + (unsigned char)1; + goto switch_186_break; + } else { + switch_186_break + : /* CIL Label */; + } + } + } } } } @@ -28498,1049 +28899,1040 @@ NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension ) } } } - } - } #line 6265 - __cil_tmp11 = (unsigned int )(& setHdBitParameter) + 1; + __cil_tmp11 = (unsigned int)(&setHdBitParameter) + 1; #line 6265 - mem_34 = (BOOLEAN *)__cil_tmp11; + mem_34 = (BOOLEAN *)__cil_tmp11; #line 6265 - *mem_34 = media144MB; + *mem_34 = media144MB; #line 6266 - __cil_tmp12 = (unsigned int )(& setHdBitParameter) + 2; + __cil_tmp12 = (unsigned int)(&setHdBitParameter) + 2; #line 6266 - mem_35 = (BOOLEAN *)__cil_tmp12; + mem_35 = (BOOLEAN *)__cil_tmp12; #line 6266 - *mem_35 = mediaUpTo120MB; + *mem_35 = mediaUpTo120MB; #line 6267 - __cil_tmp13 = (unsigned int )(& setHdBitParameter) + 3; + __cil_tmp13 = (unsigned int)(&setHdBitParameter) + 3; #line 6267 - __cil_tmp14 = (unsigned int )DisketteExtension; + __cil_tmp14 = (unsigned int)DisketteExtension; #line 6267 - __cil_tmp15 = __cil_tmp14 + 248; + __cil_tmp15 = __cil_tmp14 + 248; #line 6267 - mem_36 = (UCHAR *)__cil_tmp13; + mem_36 = (UCHAR *)__cil_tmp13; #line 6267 - mem_37 = (UCHAR *)__cil_tmp15; + mem_37 = (UCHAR *)__cil_tmp15; #line 6267 - *mem_36 = *mem_37; - { + *mem_36 = *mem_37; + { #line 6268 - __cil_tmp16 = (unsigned int )DisketteExtension; + __cil_tmp16 = (unsigned int)DisketteExtension; #line 6268 - __cil_tmp17 = __cil_tmp16 + 174; + __cil_tmp17 = __cil_tmp16 + 174; #line 6268 - mem_38 = (UCHAR *)__cil_tmp17; + mem_38 = (UCHAR *)__cil_tmp17; #line 6268 - __cil_tmp18 = *mem_38; + __cil_tmp18 = *mem_38; #line 6268 - __cil_tmp19 = (int )__cil_tmp18; + __cil_tmp19 = (int)__cil_tmp18; #line 6268 - if (__cil_tmp19 == 3) { + if (__cil_tmp19 == 3) { #line 6268 - __cil_tmp20 = & setHdBitParameter; + __cil_tmp20 = &setHdBitParameter; #line 6268 - mem_39 = (BOOLEAN *)__cil_tmp20; + mem_39 = (BOOLEAN *)__cil_tmp20; #line 6268 - *mem_39 = (unsigned char)1; - } else { + *mem_39 = (unsigned char)1; + } else { #line 6268 - __cil_tmp21 = & setHdBitParameter; + __cil_tmp21 = &setHdBitParameter; #line 6268 - mem_40 = (BOOLEAN *)__cil_tmp21; + mem_40 = (BOOLEAN *)__cil_tmp21; #line 6268 - *mem_40 = (unsigned char)0; - } - } - { + *mem_40 = (unsigned char)0; + } + } + { #line 6271 - __cil_tmp22 = (unsigned int )DisketteExtension; + __cil_tmp22 = (unsigned int)DisketteExtension; #line 6271 - __cil_tmp23 = __cil_tmp22 + 8; + __cil_tmp23 = __cil_tmp22 + 8; #line 6271 - mem_41 = (PDEVICE_OBJECT *)__cil_tmp23; + mem_41 = (PDEVICE_OBJECT *)__cil_tmp23; #line 6271 - __cil_tmp24 = *mem_41; + __cil_tmp24 = *mem_41; #line 6271 - __cil_tmp25 = 785 << 2; + __cil_tmp25 = 785 << 2; #line 6271 - __cil_tmp26 = 7 << 16; + __cil_tmp26 = 7 << 16; #line 6271 - __cil_tmp27 = __cil_tmp26 | __cil_tmp25; + __cil_tmp27 = __cil_tmp26 | __cil_tmp25; #line 6271 - __cil_tmp28 = __cil_tmp27 | 3; + __cil_tmp28 = __cil_tmp27 | 3; #line 6271 - __cil_tmp29 = (unsigned long )__cil_tmp28; + __cil_tmp29 = (unsigned long)__cil_tmp28; #line 6271 - __cil_tmp30 = (void *)(& setHdBitParameter); + __cil_tmp30 = (void *)(&setHdBitParameter); #line 6271 - ntStatus = FlFdcDeviceIo(__cil_tmp24, __cil_tmp29, __cil_tmp30); - } - { + ntStatus = FlFdcDeviceIo(__cil_tmp24, __cil_tmp29, __cil_tmp30); + } + { #line 6275 - __cil_tmp31 = ntStatus >= 0L; + __cil_tmp31 = ntStatus >= 0L; #line 6275 - if (! __cil_tmp31) { + if (!__cil_tmp31) { #line 6276 - return (ntStatus); - } else { - - } - } - { + return (ntStatus); + } else { + } + } + { #line 6279 - __cil_tmp32 = (unsigned int )(& setHdBitParameter) + 4; - { + __cil_tmp32 = (unsigned int)(&setHdBitParameter) + 4; + { #line 6279 - mem_42 = (BOOLEAN *)__cil_tmp32; + mem_42 = (BOOLEAN *)__cil_tmp32; #line 6279 - if (*mem_42) { - { + if (*mem_42) { + { #line 6281 - ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); + ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); + } + } else { + } + } } - } else { - - } - } - } #line 6284 - return (ntStatus); -} + return (ntStatus); + } } #line 6286 "floppy.c" -NTSTATUS FloppyQueueRequest(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp ) -{ KIRQL oldIrql ; - NTSTATUS ntStatus ; - LONG tmp ; - void *__cil_tmp6 ; - KSPIN_LOCK *__cil_tmp7 ; - unsigned int __cil_tmp8 ; - unsigned int __cil_tmp9 ; - void (**__cil_tmp10)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - PVOID *__cil_tmp11 ; - LONG *__cil_tmp12 ; - void *__cil_tmp13 ; - long __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - void (**__cil_tmp19)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - PVOID *__cil_tmp20 ; - LONG *__cil_tmp21 ; - void *__cil_tmp22 ; - long __cil_tmp23 ; - void *__cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - unsigned int __cil_tmp29 ; - KSPIN_LOCK *__cil_tmp30 ; - void *__cil_tmp31 ; - unsigned int __cil_tmp32 ; - unsigned int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - struct _IO_STACK_LOCATION *__cil_tmp39 ; - unsigned int __cil_tmp40 ; - unsigned int __cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - unsigned int __cil_tmp44 ; - unsigned int __cil_tmp45 ; - unsigned int __cil_tmp46 ; - struct _IO_STACK_LOCATION *__cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - UCHAR __cil_tmp50 ; - int __cil_tmp51 ; - int __cil_tmp52 ; - unsigned int __cil_tmp53 ; - unsigned int __cil_tmp54 ; - LIST_ENTRY *__cil_tmp55 ; - unsigned int __cil_tmp56 ; - unsigned int __cil_tmp57 ; - unsigned int __cil_tmp58 ; - unsigned int __cil_tmp59 ; - LIST_ENTRY *__cil_tmp60 ; - unsigned int __cil_tmp61 ; - unsigned int __cil_tmp62 ; - KSPIN_LOCK *__cil_tmp63 ; - KSPIN_LOCK *__cil_tmp64 ; - BOOLEAN *mem_65 ; - NTSTATUS *mem_66 ; - ULONG_PTR *mem_67 ; - NTSTATUS *mem_68 ; - struct _IO_STACK_LOCATION **mem_69 ; - struct _IO_STACK_LOCATION **mem_70 ; - UCHAR *mem_71 ; - UCHAR *mem_72 ; +NTSTATUS FloppyQueueRequest(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp) { + KIRQL oldIrql; + NTSTATUS ntStatus; + LONG tmp; + void *__cil_tmp6; + KSPIN_LOCK *__cil_tmp7; + unsigned int __cil_tmp8; + unsigned int __cil_tmp9; + void (**__cil_tmp10)(struct _DEVICE_OBJECT * DeviceObject, struct _IRP * Irp); + PVOID *__cil_tmp11; + LONG *__cil_tmp12; + void *__cil_tmp13; + long __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + void (**__cil_tmp19)(struct _DEVICE_OBJECT * DeviceObject, struct _IRP * Irp); + PVOID *__cil_tmp20; + LONG *__cil_tmp21; + void *__cil_tmp22; + long __cil_tmp23; + void *__cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + unsigned int __cil_tmp29; + KSPIN_LOCK *__cil_tmp30; + void *__cil_tmp31; + unsigned int __cil_tmp32; + unsigned int __cil_tmp33; + unsigned int __cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + struct _IO_STACK_LOCATION *__cil_tmp39; + unsigned int __cil_tmp40; + unsigned int __cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + unsigned int __cil_tmp44; + unsigned int __cil_tmp45; + unsigned int __cil_tmp46; + struct _IO_STACK_LOCATION *__cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + UCHAR __cil_tmp50; + int __cil_tmp51; + int __cil_tmp52; + unsigned int __cil_tmp53; + unsigned int __cil_tmp54; + LIST_ENTRY *__cil_tmp55; + unsigned int __cil_tmp56; + unsigned int __cil_tmp57; + unsigned int __cil_tmp58; + unsigned int __cil_tmp59; + LIST_ENTRY *__cil_tmp60; + unsigned int __cil_tmp61; + unsigned int __cil_tmp62; + KSPIN_LOCK *__cil_tmp63; + KSPIN_LOCK *__cil_tmp64; + BOOLEAN *mem_65; + NTSTATUS *mem_66; + ULONG_PTR *mem_67; + NTSTATUS *mem_68; + struct _IO_STACK_LOCATION **mem_69; + struct _IO_STACK_LOCATION **mem_70; + UCHAR *mem_71; + UCHAR *mem_72; { - { + { #line 6318 - ExAcquireFastMutex(PagingMutex); + ExAcquireFastMutex(PagingMutex); #line 6318 - PagingReferenceCount = PagingReferenceCount + 1UL; - } + PagingReferenceCount = PagingReferenceCount + 1UL; + } #line 6318 - if (PagingReferenceCount == 1UL) { - { + if (PagingReferenceCount == 1UL) { + { #line 6318 - __cil_tmp6 = (void *)(& DriverEntry); + __cil_tmp6 = (void *)(&DriverEntry); #line 6318 - MmResetDriverPaging(__cil_tmp6); + MmResetDriverPaging(__cil_tmp6); + } + } else { } - } else { - - } - { + { #line 6318 - ExReleaseFastMutex(PagingMutex); + ExReleaseFastMutex(PagingMutex); #line 6333 - __cil_tmp7 = (KSPIN_LOCK *)DisketteExtension; + __cil_tmp7 = (KSPIN_LOCK *)DisketteExtension; #line 6333 - oldIrql = KfAcquireSpinLock(__cil_tmp7); + oldIrql = KfAcquireSpinLock(__cil_tmp7); #line 6335 - __cil_tmp8 = (unsigned int )Irp; + __cil_tmp8 = (unsigned int)Irp; #line 6335 - __cil_tmp9 = __cil_tmp8 + 56; + __cil_tmp9 = __cil_tmp8 + 56; #line 6335 - __cil_tmp10 = (void (**)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ))__cil_tmp9; + __cil_tmp10 = + (void (**)(struct _DEVICE_OBJECT * DeviceObject, struct _IRP * Irp)) + __cil_tmp9; #line 6335 - __cil_tmp11 = (PVOID *)__cil_tmp10; + __cil_tmp11 = (PVOID *)__cil_tmp10; #line 6335 - __cil_tmp12 = (LONG *)__cil_tmp11; + __cil_tmp12 = (LONG *)__cil_tmp11; #line 6335 - __cil_tmp13 = (void *)(& FloppyCancelQueuedRequest); + __cil_tmp13 = (void *)(&FloppyCancelQueuedRequest); #line 6335 - __cil_tmp14 = (long )__cil_tmp13; + __cil_tmp14 = (long)__cil_tmp13; #line 6335 - InterlockedExchange(__cil_tmp12, __cil_tmp14); - } - { + InterlockedExchange(__cil_tmp12, __cil_tmp14); + } + { #line 6340 - __cil_tmp15 = (unsigned int )Irp; + __cil_tmp15 = (unsigned int)Irp; #line 6340 - __cil_tmp16 = __cil_tmp15 + 36; - { + __cil_tmp16 = __cil_tmp15 + 36; + { #line 6340 - mem_65 = (BOOLEAN *)__cil_tmp16; + mem_65 = (BOOLEAN *)__cil_tmp16; #line 6340 - if (*mem_65) { - { + if (*mem_65) { + { #line 6340 - __cil_tmp17 = (unsigned int )Irp; + __cil_tmp17 = (unsigned int)Irp; #line 6340 - __cil_tmp18 = __cil_tmp17 + 56; + __cil_tmp18 = __cil_tmp17 + 56; #line 6340 - __cil_tmp19 = (void (**)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ))__cil_tmp18; + __cil_tmp19 = (void (**)(struct _DEVICE_OBJECT * DeviceObject, + struct _IRP * Irp)) __cil_tmp18; #line 6340 - __cil_tmp20 = (PVOID *)__cil_tmp19; + __cil_tmp20 = (PVOID *)__cil_tmp19; #line 6340 - __cil_tmp21 = (LONG *)__cil_tmp20; + __cil_tmp21 = (LONG *)__cil_tmp20; #line 6340 - __cil_tmp22 = (void *)0; + __cil_tmp22 = (void *)0; #line 6340 - __cil_tmp23 = (long )__cil_tmp22; + __cil_tmp23 = (long)__cil_tmp22; #line 6340 - tmp = InterlockedExchange(__cil_tmp21, __cil_tmp23); - } - { + tmp = InterlockedExchange(__cil_tmp21, __cil_tmp23); + } + { #line 6340 - __cil_tmp24 = (void *)tmp; + __cil_tmp24 = (void *)tmp; #line 6340 - if ((void (*)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ))__cil_tmp24) { - { + if ((void (*)(struct _DEVICE_OBJECT * DeviceObject, + struct _IRP * Irp)) __cil_tmp24) { + { #line 6345 - __cil_tmp25 = (unsigned int )Irp; + __cil_tmp25 = (unsigned int)Irp; #line 6345 - __cil_tmp26 = __cil_tmp25 + 24; + __cil_tmp26 = __cil_tmp25 + 24; #line 6345 - mem_66 = (NTSTATUS *)__cil_tmp26; + mem_66 = (NTSTATUS *)__cil_tmp26; #line 6345 - *mem_66 = -1073741536L; + *mem_66 = -1073741536L; #line 6346 - myStatus = -1073741536L; + myStatus = -1073741536L; #line 6347 - __cil_tmp27 = 24 + 4; + __cil_tmp27 = 24 + 4; #line 6347 - __cil_tmp28 = (unsigned int )Irp; + __cil_tmp28 = (unsigned int)Irp; #line 6347 - __cil_tmp29 = __cil_tmp28 + __cil_tmp27; + __cil_tmp29 = __cil_tmp28 + __cil_tmp27; #line 6347 - mem_67 = (ULONG_PTR *)__cil_tmp29; + mem_67 = (ULONG_PTR *)__cil_tmp29; #line 6347 - *mem_67 = 0UL; + *mem_67 = 0UL; #line 6348 - __cil_tmp30 = (KSPIN_LOCK *)DisketteExtension; + __cil_tmp30 = (KSPIN_LOCK *)DisketteExtension; #line 6348 - KfReleaseSpinLock(__cil_tmp30, oldIrql); + KfReleaseSpinLock(__cil_tmp30, oldIrql); #line 6349 - IofCompleteRequest(Irp, (char)0); + IofCompleteRequest(Irp, (char)0); #line 6351 - ExAcquireFastMutex(PagingMutex); + ExAcquireFastMutex(PagingMutex); #line 6351 - PagingReferenceCount = PagingReferenceCount - 1UL; - } + PagingReferenceCount = PagingReferenceCount - 1UL; + } #line 6351 - if (PagingReferenceCount == 0UL) { - { + if (PagingReferenceCount == 0UL) { + { #line 6351 - __cil_tmp31 = (void *)(& DriverEntry); + __cil_tmp31 = (void *)(&DriverEntry); #line 6351 - MmPageEntireDriver(__cil_tmp31); - } - } else { - - } - { + MmPageEntireDriver(__cil_tmp31); + } + } else { + } + { #line 6351 - ExReleaseFastMutex(PagingMutex); + ExReleaseFastMutex(PagingMutex); #line 6353 - ntStatus = -1073741536L; - } - } else { - goto _L; - } - } - } else { - _L: + ntStatus = -1073741536L; + } + } else { + goto _L; + } + } + } else { + _L: #line 6359 - __cil_tmp32 = (unsigned int )Irp; + __cil_tmp32 = (unsigned int)Irp; #line 6359 - __cil_tmp33 = __cil_tmp32 + 24; + __cil_tmp33 = __cil_tmp32 + 24; #line 6359 - mem_68 = (NTSTATUS *)__cil_tmp33; + mem_68 = (NTSTATUS *)__cil_tmp33; #line 6359 - *mem_68 = 259L; + *mem_68 = 259L; #line 6360 - myStatus = 259L; + myStatus = 259L; #line 6361 - __cil_tmp34 = 24 + 8; + __cil_tmp34 = 24 + 8; #line 6361 - __cil_tmp35 = 0 + __cil_tmp34; + __cil_tmp35 = 0 + __cil_tmp34; #line 6361 - __cil_tmp36 = 64 + __cil_tmp35; + __cil_tmp36 = 64 + __cil_tmp35; #line 6361 - __cil_tmp37 = (unsigned int )Irp; + __cil_tmp37 = (unsigned int)Irp; #line 6361 - __cil_tmp38 = __cil_tmp37 + __cil_tmp36; + __cil_tmp38 = __cil_tmp37 + __cil_tmp36; #line 6361 - mem_69 = (struct _IO_STACK_LOCATION **)__cil_tmp38; + mem_69 = (struct _IO_STACK_LOCATION **)__cil_tmp38; #line 6361 - __cil_tmp39 = *mem_69; + __cil_tmp39 = *mem_69; #line 6361 - __cil_tmp40 = (unsigned int )__cil_tmp39; + __cil_tmp40 = (unsigned int)__cil_tmp39; #line 6361 - __cil_tmp41 = __cil_tmp40 + 3; + __cil_tmp41 = __cil_tmp40 + 3; #line 6361 - __cil_tmp42 = 24 + 8; + __cil_tmp42 = 24 + 8; #line 6361 - __cil_tmp43 = 0 + __cil_tmp42; + __cil_tmp43 = 0 + __cil_tmp42; #line 6361 - __cil_tmp44 = 64 + __cil_tmp43; + __cil_tmp44 = 64 + __cil_tmp43; #line 6361 - __cil_tmp45 = (unsigned int )Irp; + __cil_tmp45 = (unsigned int)Irp; #line 6361 - __cil_tmp46 = __cil_tmp45 + __cil_tmp44; + __cil_tmp46 = __cil_tmp45 + __cil_tmp44; #line 6361 - mem_70 = (struct _IO_STACK_LOCATION **)__cil_tmp46; + mem_70 = (struct _IO_STACK_LOCATION **)__cil_tmp46; #line 6361 - __cil_tmp47 = *mem_70; + __cil_tmp47 = *mem_70; #line 6361 - __cil_tmp48 = (unsigned int )__cil_tmp47; + __cil_tmp48 = (unsigned int)__cil_tmp47; #line 6361 - __cil_tmp49 = __cil_tmp48 + 3; + __cil_tmp49 = __cil_tmp48 + 3; #line 6361 - mem_71 = (UCHAR *)__cil_tmp49; + mem_71 = (UCHAR *)__cil_tmp49; #line 6361 - __cil_tmp50 = *mem_71; + __cil_tmp50 = *mem_71; #line 6361 - __cil_tmp51 = (int )__cil_tmp50; + __cil_tmp51 = (int)__cil_tmp50; #line 6361 - __cil_tmp52 = __cil_tmp51 | 1; + __cil_tmp52 = __cil_tmp51 | 1; #line 6361 - mem_72 = (UCHAR *)__cil_tmp41; + mem_72 = (UCHAR *)__cil_tmp41; #line 6361 - *mem_72 = (unsigned char )__cil_tmp52; + *mem_72 = (unsigned char)__cil_tmp52; #line 6362 - if (pended == 0) { + if (pended == 0) { #line 6362 - pended = 1; - } else { - { + pended = 1; + } else { + { #line 6362 - __VERIFIER_assert(0); - } - } - { + __VERIFIER_assert(0); + } + } + { #line 6363 - __cil_tmp53 = (unsigned int )DisketteExtension; + __cil_tmp53 = (unsigned int)DisketteExtension; #line 6363 - __cil_tmp54 = __cil_tmp53 + 16; + __cil_tmp54 = __cil_tmp53 + 16; #line 6363 - __cil_tmp55 = (LIST_ENTRY *)__cil_tmp54; + __cil_tmp55 = (LIST_ENTRY *)__cil_tmp54; #line 6363 - __cil_tmp56 = 0 + 24; + __cil_tmp56 = 0 + 24; #line 6363 - __cil_tmp57 = 64 + __cil_tmp56; + __cil_tmp57 = 64 + __cil_tmp56; #line 6363 - __cil_tmp58 = (unsigned int )Irp; + __cil_tmp58 = (unsigned int)Irp; #line 6363 - __cil_tmp59 = __cil_tmp58 + __cil_tmp57; + __cil_tmp59 = __cil_tmp58 + __cil_tmp57; #line 6363 - __cil_tmp60 = (LIST_ENTRY *)__cil_tmp59; + __cil_tmp60 = (LIST_ENTRY *)__cil_tmp59; #line 6363 - __cil_tmp61 = (unsigned int )DisketteExtension; + __cil_tmp61 = (unsigned int)DisketteExtension; #line 6363 - __cil_tmp62 = __cil_tmp61 + 24; + __cil_tmp62 = __cil_tmp61 + 24; #line 6363 - __cil_tmp63 = (KSPIN_LOCK *)__cil_tmp62; + __cil_tmp63 = (KSPIN_LOCK *)__cil_tmp62; #line 6363 - ExfInterlockedInsertTailList(__cil_tmp55, __cil_tmp60, __cil_tmp63); + ExfInterlockedInsertTailList(__cil_tmp55, __cil_tmp60, __cil_tmp63); #line 6368 - __cil_tmp64 = (KSPIN_LOCK *)DisketteExtension; + __cil_tmp64 = (KSPIN_LOCK *)DisketteExtension; #line 6368 - KfReleaseSpinLock(__cil_tmp64, oldIrql); + KfReleaseSpinLock(__cil_tmp64, oldIrql); #line 6370 - ntStatus = 259L; + ntStatus = 259L; + } + } + } } - } - } - } #line 6373 - return (ntStatus); -} + return (ntStatus); + } } #line 6375 "floppy.c" -void FloppyCancelQueuedRequest(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDISKETTE_EXTENSION disketteExtension ; - KIRQL oldIrql ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; - unsigned int __cil_tmp7 ; - unsigned int __cil_tmp8 ; - PVOID __cil_tmp9 ; - KSPIN_LOCK *__cil_tmp10 ; - unsigned int __cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - unsigned int __cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - unsigned int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - unsigned int __cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - unsigned int __cil_tmp23 ; - unsigned int __cil_tmp24 ; - unsigned int __cil_tmp25 ; - unsigned int __cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - unsigned int __cil_tmp29 ; - unsigned int __cil_tmp30 ; - unsigned int __cil_tmp31 ; - KSPIN_LOCK *__cil_tmp32 ; - unsigned int __cil_tmp33 ; - unsigned int __cil_tmp34 ; - KIRQL __cil_tmp35 ; - void *__cil_tmp36 ; - PVOID *mem_37 ; - NTSTATUS *mem_38 ; - ULONG_PTR *mem_39 ; - struct _LIST_ENTRY **mem_40 ; - struct _LIST_ENTRY **mem_41 ; - struct _LIST_ENTRY **mem_42 ; - struct _LIST_ENTRY **mem_43 ; - struct _LIST_ENTRY **mem_44 ; - KIRQL *mem_45 ; +void FloppyCancelQueuedRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDISKETTE_EXTENSION disketteExtension; + KIRQL oldIrql; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; + unsigned int __cil_tmp7; + unsigned int __cil_tmp8; + PVOID __cil_tmp9; + KSPIN_LOCK *__cil_tmp10; + unsigned int __cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + unsigned int __cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + unsigned int __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + unsigned int __cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + unsigned int __cil_tmp23; + unsigned int __cil_tmp24; + unsigned int __cil_tmp25; + unsigned int __cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + unsigned int __cil_tmp29; + unsigned int __cil_tmp30; + unsigned int __cil_tmp31; + KSPIN_LOCK *__cil_tmp32; + unsigned int __cil_tmp33; + unsigned int __cil_tmp34; + KIRQL __cil_tmp35; + void *__cil_tmp36; + PVOID *mem_37; + NTSTATUS *mem_38; + ULONG_PTR *mem_39; + struct _LIST_ENTRY **mem_40; + struct _LIST_ENTRY **mem_41; + struct _LIST_ENTRY **mem_42; + struct _LIST_ENTRY **mem_43; + struct _LIST_ENTRY **mem_44; + KIRQL *mem_45; { #line 6402 - __cil_tmp7 = (unsigned int )DeviceObject; + __cil_tmp7 = (unsigned int)DeviceObject; #line 6402 - __cil_tmp8 = __cil_tmp7 + 40; + __cil_tmp8 = __cil_tmp7 + 40; #line 6402 - mem_37 = (PVOID *)__cil_tmp8; + mem_37 = (PVOID *)__cil_tmp8; #line 6402 - __cil_tmp9 = *mem_37; + __cil_tmp9 = *mem_37; #line 6402 - disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp9; - { + disketteExtension = (DISKETTE_EXTENSION *)__cil_tmp9; + { #line 6406 - while (1) { - while_187_continue: /* CIL Label */ ; - goto while_187_break; - } - while_187_break: /* CIL Label */ ; - } - { + while (1) { + while_187_continue: /* CIL Label */; + goto while_187_break; + } + while_187_break: /* CIL Label */; + } + { #line 6409 - __cil_tmp10 = (KSPIN_LOCK *)disketteExtension; + __cil_tmp10 = (KSPIN_LOCK *)disketteExtension; #line 6409 - oldIrql = KfAcquireSpinLock(__cil_tmp10); + oldIrql = KfAcquireSpinLock(__cil_tmp10); #line 6411 - __cil_tmp11 = (unsigned int )Irp; + __cil_tmp11 = (unsigned int)Irp; #line 6411 - __cil_tmp12 = __cil_tmp11 + 24; + __cil_tmp12 = __cil_tmp11 + 24; #line 6411 - mem_38 = (NTSTATUS *)__cil_tmp12; + mem_38 = (NTSTATUS *)__cil_tmp12; #line 6411 - *mem_38 = -1073741536L; + *mem_38 = -1073741536L; #line 6412 - myStatus = -1073741536L; + myStatus = -1073741536L; #line 6413 - __cil_tmp13 = 24 + 4; + __cil_tmp13 = 24 + 4; #line 6413 - __cil_tmp14 = (unsigned int )Irp; + __cil_tmp14 = (unsigned int)Irp; #line 6413 - __cil_tmp15 = __cil_tmp14 + __cil_tmp13; + __cil_tmp15 = __cil_tmp14 + __cil_tmp13; #line 6413 - mem_39 = (ULONG_PTR *)__cil_tmp15; + mem_39 = (ULONG_PTR *)__cil_tmp15; #line 6413 - *mem_39 = 0UL; - } - { + *mem_39 = 0UL; + } + { #line 6417 - __cil_tmp16 = 0 + 24; + __cil_tmp16 = 0 + 24; #line 6417 - __cil_tmp17 = 64 + __cil_tmp16; + __cil_tmp17 = 64 + __cil_tmp16; #line 6417 - __cil_tmp18 = (unsigned int )Irp; + __cil_tmp18 = (unsigned int)Irp; #line 6417 - __cil_tmp19 = __cil_tmp18 + __cil_tmp17; - { + __cil_tmp19 = __cil_tmp18 + __cil_tmp17; + { #line 6417 - mem_40 = (struct _LIST_ENTRY **)__cil_tmp19; + mem_40 = (struct _LIST_ENTRY **)__cil_tmp19; #line 6417 - if (*mem_40) { + if (*mem_40) { #line 6418 - __cil_tmp20 = 0 + 24; + __cil_tmp20 = 0 + 24; #line 6418 - __cil_tmp21 = 64 + __cil_tmp20; + __cil_tmp21 = 64 + __cil_tmp20; #line 6418 - __cil_tmp22 = (unsigned int )Irp; + __cil_tmp22 = (unsigned int)Irp; #line 6418 - __cil_tmp23 = __cil_tmp22 + __cil_tmp21; + __cil_tmp23 = __cil_tmp22 + __cil_tmp21; #line 6418 - mem_41 = (struct _LIST_ENTRY **)__cil_tmp23; + mem_41 = (struct _LIST_ENTRY **)__cil_tmp23; #line 6418 - _EX_Flink = *mem_41; + _EX_Flink = *mem_41; #line 6418 - __cil_tmp24 = 0 + 4; + __cil_tmp24 = 0 + 4; #line 6418 - __cil_tmp25 = 24 + __cil_tmp24; + __cil_tmp25 = 24 + __cil_tmp24; #line 6418 - __cil_tmp26 = 0 + __cil_tmp25; + __cil_tmp26 = 0 + __cil_tmp25; #line 6418 - __cil_tmp27 = 64 + __cil_tmp26; + __cil_tmp27 = 64 + __cil_tmp26; #line 6418 - __cil_tmp28 = (unsigned int )Irp; + __cil_tmp28 = (unsigned int)Irp; #line 6418 - __cil_tmp29 = __cil_tmp28 + __cil_tmp27; + __cil_tmp29 = __cil_tmp28 + __cil_tmp27; #line 6418 - mem_42 = (struct _LIST_ENTRY **)__cil_tmp29; + mem_42 = (struct _LIST_ENTRY **)__cil_tmp29; #line 6418 - _EX_Blink = *mem_42; + _EX_Blink = *mem_42; #line 6418 - mem_43 = (struct _LIST_ENTRY **)_EX_Blink; + mem_43 = (struct _LIST_ENTRY **)_EX_Blink; #line 6418 - *mem_43 = _EX_Flink; + *mem_43 = _EX_Flink; #line 6418 - __cil_tmp30 = (unsigned int )_EX_Flink; + __cil_tmp30 = (unsigned int)_EX_Flink; #line 6418 - __cil_tmp31 = __cil_tmp30 + 4; + __cil_tmp31 = __cil_tmp30 + 4; #line 6418 - mem_44 = (struct _LIST_ENTRY **)__cil_tmp31; + mem_44 = (struct _LIST_ENTRY **)__cil_tmp31; #line 6418 - *mem_44 = _EX_Blink; - } else { - - } - } - } - { + *mem_44 = _EX_Blink; + } else { + } + } + } + { #line 6422 - __cil_tmp32 = (KSPIN_LOCK *)disketteExtension; + __cil_tmp32 = (KSPIN_LOCK *)disketteExtension; #line 6422 - KfReleaseSpinLock(__cil_tmp32, oldIrql); + KfReleaseSpinLock(__cil_tmp32, oldIrql); #line 6424 - __cil_tmp33 = (unsigned int )Irp; + __cil_tmp33 = (unsigned int)Irp; #line 6424 - __cil_tmp34 = __cil_tmp33 + 37; + __cil_tmp34 = __cil_tmp33 + 37; #line 6424 - mem_45 = (KIRQL *)__cil_tmp34; + mem_45 = (KIRQL *)__cil_tmp34; #line 6424 - __cil_tmp35 = *mem_45; + __cil_tmp35 = *mem_45; #line 6424 - IoReleaseCancelSpinLock(__cil_tmp35); + IoReleaseCancelSpinLock(__cil_tmp35); #line 6426 - IofCompleteRequest(Irp, (char)0); + IofCompleteRequest(Irp, (char)0); #line 6428 - ExAcquireFastMutex(PagingMutex); + ExAcquireFastMutex(PagingMutex); #line 6428 - PagingReferenceCount = PagingReferenceCount - 1UL; - } + PagingReferenceCount = PagingReferenceCount - 1UL; + } #line 6428 - if (PagingReferenceCount == 0UL) { - { + if (PagingReferenceCount == 0UL) { + { #line 6428 - __cil_tmp36 = (void *)(& DriverEntry); + __cil_tmp36 = (void *)(&DriverEntry); #line 6428 - MmPageEntireDriver(__cil_tmp36); + MmPageEntireDriver(__cil_tmp36); + } + } else { } - } else { - - } - { + { #line 6428 - ExReleaseFastMutex(PagingMutex); - } + ExReleaseFastMutex(PagingMutex); + } #line 6432 - return; -} + return; + } } #line 6432 "floppy.c" -void FloppyProcessQueuedRequests(PDISKETTE_EXTENSION DisketteExtension ) -{ KIRQL oldIrql ; - PLIST_ENTRY headOfList ; - PIRP currentIrp ; - PIO_STACK_LOCATION irpSp ; - LONG tmp ; - KSPIN_LOCK *__cil_tmp7 ; - unsigned int __cil_tmp8 ; - unsigned int __cil_tmp9 ; - LIST_ENTRY *__cil_tmp10 ; - unsigned int __cil_tmp11 ; - unsigned int __cil_tmp12 ; - KSPIN_LOCK *__cil_tmp13 ; - void *__cil_tmp14 ; - unsigned int __cil_tmp15 ; - unsigned int __cil_tmp16 ; - int __cil_tmp17 ; - unsigned int __cil_tmp18 ; - unsigned int __cil_tmp19 ; - IRP *__cil_tmp20 ; - unsigned int __cil_tmp21 ; - unsigned int __cil_tmp22 ; - LIST_ENTRY *__cil_tmp23 ; - unsigned long __cil_tmp24 ; - CHAR *__cil_tmp25 ; - CHAR *__cil_tmp26 ; - unsigned int __cil_tmp27 ; - unsigned int __cil_tmp28 ; - void (**__cil_tmp29)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - PVOID *__cil_tmp30 ; - LONG *__cil_tmp31 ; - void *__cil_tmp32 ; - long __cil_tmp33 ; - void *__cil_tmp34 ; - unsigned int __cil_tmp35 ; - unsigned int __cil_tmp36 ; - unsigned int __cil_tmp37 ; - unsigned int __cil_tmp38 ; - unsigned int __cil_tmp39 ; - unsigned int __cil_tmp40 ; - unsigned int __cil_tmp41 ; - unsigned int __cil_tmp42 ; - unsigned int __cil_tmp43 ; - void *__cil_tmp44 ; - void *__cil_tmp45 ; - KSPIN_LOCK *__cil_tmp46 ; - unsigned int __cil_tmp47 ; - unsigned int __cil_tmp48 ; - unsigned int __cil_tmp49 ; - unsigned int __cil_tmp50 ; - unsigned int __cil_tmp51 ; - unsigned int __cil_tmp52 ; - unsigned int __cil_tmp53 ; - UCHAR __cil_tmp54 ; - NTSTATUS (*__cil_tmp55)(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; - unsigned int __cil_tmp56 ; - unsigned int __cil_tmp57 ; - PDEVICE_OBJECT __cil_tmp58 ; - NTSTATUS (*__cil_tmp59)(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; - unsigned int __cil_tmp60 ; - unsigned int __cil_tmp61 ; - PDEVICE_OBJECT __cil_tmp62 ; - unsigned int __cil_tmp63 ; - unsigned int __cil_tmp64 ; - unsigned int __cil_tmp65 ; - unsigned int __cil_tmp66 ; - unsigned int __cil_tmp67 ; - void *__cil_tmp68 ; - KSPIN_LOCK *__cil_tmp69 ; - KSPIN_LOCK *__cil_tmp70 ; - struct _IO_STACK_LOCATION **mem_71 ; - struct _LIST_ENTRY **mem_72 ; - BOOLEAN *mem_73 ; - ULONG_PTR *mem_74 ; - NTSTATUS *mem_75 ; - UCHAR *mem_76 ; - PDEVICE_OBJECT *mem_77 ; - PDEVICE_OBJECT *mem_78 ; - ULONG_PTR *mem_79 ; - NTSTATUS *mem_80 ; +void FloppyProcessQueuedRequests(PDISKETTE_EXTENSION DisketteExtension) { + KIRQL oldIrql; + PLIST_ENTRY headOfList; + PIRP currentIrp; + PIO_STACK_LOCATION irpSp; + LONG tmp; + KSPIN_LOCK *__cil_tmp7; + unsigned int __cil_tmp8; + unsigned int __cil_tmp9; + LIST_ENTRY *__cil_tmp10; + unsigned int __cil_tmp11; + unsigned int __cil_tmp12; + KSPIN_LOCK *__cil_tmp13; + void *__cil_tmp14; + unsigned int __cil_tmp15; + unsigned int __cil_tmp16; + int __cil_tmp17; + unsigned int __cil_tmp18; + unsigned int __cil_tmp19; + IRP *__cil_tmp20; + unsigned int __cil_tmp21; + unsigned int __cil_tmp22; + LIST_ENTRY *__cil_tmp23; + unsigned long __cil_tmp24; + CHAR *__cil_tmp25; + CHAR *__cil_tmp26; + unsigned int __cil_tmp27; + unsigned int __cil_tmp28; + void (**__cil_tmp29)(struct _DEVICE_OBJECT * DeviceObject, struct _IRP * Irp); + PVOID *__cil_tmp30; + LONG *__cil_tmp31; + void *__cil_tmp32; + long __cil_tmp33; + void *__cil_tmp34; + unsigned int __cil_tmp35; + unsigned int __cil_tmp36; + unsigned int __cil_tmp37; + unsigned int __cil_tmp38; + unsigned int __cil_tmp39; + unsigned int __cil_tmp40; + unsigned int __cil_tmp41; + unsigned int __cil_tmp42; + unsigned int __cil_tmp43; + void *__cil_tmp44; + void *__cil_tmp45; + KSPIN_LOCK *__cil_tmp46; + unsigned int __cil_tmp47; + unsigned int __cil_tmp48; + unsigned int __cil_tmp49; + unsigned int __cil_tmp50; + unsigned int __cil_tmp51; + unsigned int __cil_tmp52; + unsigned int __cil_tmp53; + UCHAR __cil_tmp54; + NTSTATUS (*__cil_tmp55)(PDEVICE_OBJECT DeviceObject, PIRP Irp); + unsigned int __cil_tmp56; + unsigned int __cil_tmp57; + PDEVICE_OBJECT __cil_tmp58; + NTSTATUS (*__cil_tmp59)(PDEVICE_OBJECT DeviceObject, PIRP Irp); + unsigned int __cil_tmp60; + unsigned int __cil_tmp61; + PDEVICE_OBJECT __cil_tmp62; + unsigned int __cil_tmp63; + unsigned int __cil_tmp64; + unsigned int __cil_tmp65; + unsigned int __cil_tmp66; + unsigned int __cil_tmp67; + void *__cil_tmp68; + KSPIN_LOCK *__cil_tmp69; + KSPIN_LOCK *__cil_tmp70; + struct _IO_STACK_LOCATION **mem_71; + struct _LIST_ENTRY **mem_72; + BOOLEAN *mem_73; + ULONG_PTR *mem_74; + NTSTATUS *mem_75; + UCHAR *mem_76; + PDEVICE_OBJECT *mem_77; + PDEVICE_OBJECT *mem_78; + ULONG_PTR *mem_79; + NTSTATUS *mem_80; { - { + { #line 6470 - __cil_tmp7 = (KSPIN_LOCK *)DisketteExtension; + __cil_tmp7 = (KSPIN_LOCK *)DisketteExtension; #line 6470 - oldIrql = KfAcquireSpinLock(__cil_tmp7); - } - { -#line 6471 - while (1) { - while_188_continue: /* CIL Label */ ; + oldIrql = KfAcquireSpinLock(__cil_tmp7); + } { #line 6471 - __cil_tmp8 = (unsigned int )DisketteExtension; + while (1) { + while_188_continue: /* CIL Label */; + { +#line 6471 + __cil_tmp8 = (unsigned int)DisketteExtension; #line 6471 - __cil_tmp9 = __cil_tmp8 + 16; + __cil_tmp9 = __cil_tmp8 + 16; #line 6471 - __cil_tmp10 = (LIST_ENTRY *)__cil_tmp9; + __cil_tmp10 = (LIST_ENTRY *)__cil_tmp9; #line 6471 - __cil_tmp11 = (unsigned int )DisketteExtension; + __cil_tmp11 = (unsigned int)DisketteExtension; #line 6471 - __cil_tmp12 = __cil_tmp11 + 24; + __cil_tmp12 = __cil_tmp11 + 24; #line 6471 - __cil_tmp13 = (KSPIN_LOCK *)__cil_tmp12; + __cil_tmp13 = (KSPIN_LOCK *)__cil_tmp12; #line 6471 - headOfList = ExfInterlockedRemoveHeadList(__cil_tmp10, __cil_tmp13); - } - { + headOfList = ExfInterlockedRemoveHeadList(__cil_tmp10, __cil_tmp13); + } + { #line 6471 - __cil_tmp14 = (void *)0; + __cil_tmp14 = (void *)0; #line 6471 - __cil_tmp15 = (unsigned int )__cil_tmp14; + __cil_tmp15 = (unsigned int)__cil_tmp14; #line 6471 - __cil_tmp16 = (unsigned int )headOfList; + __cil_tmp16 = (unsigned int)headOfList; #line 6471 - __cil_tmp17 = __cil_tmp16 != __cil_tmp15; + __cil_tmp17 = __cil_tmp16 != __cil_tmp15; #line 6471 - if (! __cil_tmp17) { - goto while_188_break; - } else { - - } - } - { + if (!__cil_tmp17) { + goto while_188_break; + } else { + } + } + { #line 6475 - __cil_tmp18 = 0 + 24; + __cil_tmp18 = 0 + 24; #line 6475 - __cil_tmp19 = 64 + __cil_tmp18; + __cil_tmp19 = 64 + __cil_tmp18; #line 6475 - __cil_tmp20 = (IRP *)0; + __cil_tmp20 = (IRP *)0; #line 6475 - __cil_tmp21 = (unsigned int )__cil_tmp20; + __cil_tmp21 = (unsigned int)__cil_tmp20; #line 6475 - __cil_tmp22 = __cil_tmp21 + __cil_tmp19; + __cil_tmp22 = __cil_tmp21 + __cil_tmp19; #line 6475 - __cil_tmp23 = (LIST_ENTRY *)__cil_tmp22; + __cil_tmp23 = (LIST_ENTRY *)__cil_tmp22; #line 6475 - __cil_tmp24 = (unsigned long )__cil_tmp23; + __cil_tmp24 = (unsigned long)__cil_tmp23; #line 6475 - __cil_tmp25 = (CHAR *)headOfList; + __cil_tmp25 = (CHAR *)headOfList; #line 6475 - __cil_tmp26 = __cil_tmp25 - __cil_tmp24; + __cil_tmp26 = __cil_tmp25 - __cil_tmp24; #line 6475 - currentIrp = (IRP *)__cil_tmp26; + currentIrp = (IRP *)__cil_tmp26; #line 6479 - __cil_tmp27 = (unsigned int )currentIrp; + __cil_tmp27 = (unsigned int)currentIrp; #line 6479 - __cil_tmp28 = __cil_tmp27 + 56; + __cil_tmp28 = __cil_tmp27 + 56; #line 6479 - __cil_tmp29 = (void (**)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ))__cil_tmp28; + __cil_tmp29 = (void (**)(struct _DEVICE_OBJECT * DeviceObject, + struct _IRP * Irp)) __cil_tmp28; #line 6479 - __cil_tmp30 = (PVOID *)__cil_tmp29; + __cil_tmp30 = (PVOID *)__cil_tmp29; #line 6479 - __cil_tmp31 = (LONG *)__cil_tmp30; + __cil_tmp31 = (LONG *)__cil_tmp30; #line 6479 - __cil_tmp32 = (void *)0; + __cil_tmp32 = (void *)0; #line 6479 - __cil_tmp33 = (long )__cil_tmp32; + __cil_tmp33 = (long)__cil_tmp32; #line 6479 - tmp = InterlockedExchange(__cil_tmp31, __cil_tmp33); - } - { + tmp = InterlockedExchange(__cil_tmp31, __cil_tmp33); + } + { #line 6479 - __cil_tmp34 = (void *)tmp; + __cil_tmp34 = (void *)tmp; #line 6479 - if ((void (*)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ))__cil_tmp34) { + if ((void (*)(struct _DEVICE_OBJECT * DeviceObject, + struct _IRP * Irp)) __cil_tmp34) { #line 6480 - __cil_tmp35 = 24 + 8; + __cil_tmp35 = 24 + 8; #line 6480 - __cil_tmp36 = 0 + __cil_tmp35; + __cil_tmp36 = 0 + __cil_tmp35; #line 6480 - __cil_tmp37 = 64 + __cil_tmp36; + __cil_tmp37 = 64 + __cil_tmp36; #line 6480 - __cil_tmp38 = (unsigned int )currentIrp; + __cil_tmp38 = (unsigned int)currentIrp; #line 6480 - __cil_tmp39 = __cil_tmp38 + __cil_tmp37; + __cil_tmp39 = __cil_tmp38 + __cil_tmp37; #line 6480 - mem_71 = (struct _IO_STACK_LOCATION **)__cil_tmp39; + mem_71 = (struct _IO_STACK_LOCATION **)__cil_tmp39; #line 6480 - irpSp = *mem_71; - } else { + irpSp = *mem_71; + } else { #line 6487 - __cil_tmp40 = 0 + 24; + __cil_tmp40 = 0 + 24; #line 6487 - __cil_tmp41 = 64 + __cil_tmp40; + __cil_tmp41 = 64 + __cil_tmp40; #line 6487 - __cil_tmp42 = (unsigned int )currentIrp; + __cil_tmp42 = (unsigned int)currentIrp; #line 6487 - __cil_tmp43 = __cil_tmp42 + __cil_tmp41; + __cil_tmp43 = __cil_tmp42 + __cil_tmp41; #line 6487 - __cil_tmp44 = (void *)0; + __cil_tmp44 = (void *)0; #line 6487 - mem_72 = (struct _LIST_ENTRY **)__cil_tmp43; + mem_72 = (struct _LIST_ENTRY **)__cil_tmp43; #line 6487 - *mem_72 = (struct _LIST_ENTRY *)__cil_tmp44; + *mem_72 = (struct _LIST_ENTRY *)__cil_tmp44; #line 6488 - __cil_tmp45 = (void *)0; + __cil_tmp45 = (void *)0; #line 6488 - currentIrp = (struct _IRP *)__cil_tmp45; - } - } - { + currentIrp = (struct _IRP *)__cil_tmp45; + } + } + { #line 6492 - __cil_tmp46 = (KSPIN_LOCK *)DisketteExtension; + __cil_tmp46 = (KSPIN_LOCK *)DisketteExtension; #line 6492 - KfReleaseSpinLock(__cil_tmp46, oldIrql); - } + KfReleaseSpinLock(__cil_tmp46, oldIrql); + } #line 6494 - if (currentIrp) { - { + if (currentIrp) { + { #line 6495 - __cil_tmp47 = (unsigned int )DisketteExtension; + __cil_tmp47 = (unsigned int)DisketteExtension; #line 6495 - __cil_tmp48 = __cil_tmp47 + 13; - { + __cil_tmp48 = __cil_tmp47 + 13; + { #line 6495 - mem_73 = (BOOLEAN *)__cil_tmp48; + mem_73 = (BOOLEAN *)__cil_tmp48; #line 6495 - if (*mem_73) { - { + if (*mem_73) { + { #line 6499 - __cil_tmp49 = 24 + 4; + __cil_tmp49 = 24 + 4; #line 6499 - __cil_tmp50 = (unsigned int )currentIrp; + __cil_tmp50 = (unsigned int)currentIrp; #line 6499 - __cil_tmp51 = __cil_tmp50 + __cil_tmp49; + __cil_tmp51 = __cil_tmp50 + __cil_tmp49; #line 6499 - mem_74 = (ULONG_PTR *)__cil_tmp51; + mem_74 = (ULONG_PTR *)__cil_tmp51; #line 6499 - *mem_74 = 0UL; + *mem_74 = 0UL; #line 6500 - __cil_tmp52 = (unsigned int )currentIrp; + __cil_tmp52 = (unsigned int)currentIrp; #line 6500 - __cil_tmp53 = __cil_tmp52 + 24; + __cil_tmp53 = __cil_tmp52 + 24; #line 6500 - mem_75 = (NTSTATUS *)__cil_tmp53; + mem_75 = (NTSTATUS *)__cil_tmp53; #line 6500 - *mem_75 = -1073741738L; + *mem_75 = -1073741738L; #line 6501 - IofCompleteRequest(currentIrp, (char)0); - } - } else { - { + IofCompleteRequest(currentIrp, (char)0); + } + } else { + { #line 6505 - mem_76 = (UCHAR *)irpSp; + mem_76 = (UCHAR *)irpSp; #line 6505 - __cil_tmp54 = *mem_76; + __cil_tmp54 = *mem_76; #line 6506 - if ((int )__cil_tmp54 == 3) { - goto switch_189_3; - } else { + if ((int)__cil_tmp54 == 3) { + goto switch_189_3; + } else { #line 6507 - if ((int )__cil_tmp54 == 4) { - goto switch_189_4; - } else { + if ((int)__cil_tmp54 == 4) { + goto switch_189_4; + } else { #line 6512 - if ((int )__cil_tmp54 == 14) { - goto switch_189_14; - } else { - { - goto switch_189_default; + if ((int)__cil_tmp54 == 14) { + goto switch_189_14; + } else { + { + goto switch_189_default; #line 6505 - if (0) { - switch_189_3: /* CIL Label */ ; - switch_189_4: /* CIL Label */ - { + if (0) { + switch_189_3: /* CIL Label */; + switch_189_4 : /* CIL Label */ + { #line 6510 - __cil_tmp55 = & FloppyReadWrite; + __cil_tmp55 = &FloppyReadWrite; #line 6510 - __cil_tmp56 = (unsigned int )DisketteExtension; + __cil_tmp56 = (unsigned int)DisketteExtension; #line 6510 - __cil_tmp57 = __cil_tmp56 + 28; + __cil_tmp57 = __cil_tmp56 + 28; #line 6510 - mem_77 = (PDEVICE_OBJECT *)__cil_tmp57; + mem_77 = (PDEVICE_OBJECT *)__cil_tmp57; #line 6510 - __cil_tmp58 = *mem_77; + __cil_tmp58 = *mem_77; #line 6510 - (*__cil_tmp55)(__cil_tmp58, currentIrp); - } - goto switch_189_break; - switch_189_14: /* CIL Label */ - { + (*__cil_tmp55)(__cil_tmp58, currentIrp); + } + goto switch_189_break; + switch_189_14 : /* CIL Label */ + { #line 6515 - __cil_tmp59 = & FloppyDeviceControl; + __cil_tmp59 = &FloppyDeviceControl; #line 6515 - __cil_tmp60 = (unsigned int )DisketteExtension; + __cil_tmp60 = (unsigned int)DisketteExtension; #line 6515 - __cil_tmp61 = __cil_tmp60 + 28; + __cil_tmp61 = __cil_tmp60 + 28; #line 6515 - mem_78 = (PDEVICE_OBJECT *)__cil_tmp61; + mem_78 = (PDEVICE_OBJECT *)__cil_tmp61; #line 6515 - __cil_tmp62 = *mem_78; + __cil_tmp62 = *mem_78; #line 6515 - (*__cil_tmp59)(__cil_tmp62, currentIrp); - } - goto switch_189_break; - switch_189_default: /* CIL Label */ - { + (*__cil_tmp59)(__cil_tmp62, currentIrp); + } + goto switch_189_break; + switch_189_default : /* CIL Label */ + { #line 6520 - __cil_tmp63 = 24 + 4; + __cil_tmp63 = 24 + 4; #line 6520 - __cil_tmp64 = (unsigned int )currentIrp; + __cil_tmp64 = (unsigned int)currentIrp; #line 6520 - __cil_tmp65 = __cil_tmp64 + __cil_tmp63; + __cil_tmp65 = __cil_tmp64 + __cil_tmp63; #line 6520 - mem_79 = (ULONG_PTR *)__cil_tmp65; + mem_79 = (ULONG_PTR *)__cil_tmp65; #line 6520 - *mem_79 = 0UL; + *mem_79 = 0UL; #line 6521 - __cil_tmp66 = (unsigned int )currentIrp; + __cil_tmp66 = (unsigned int)currentIrp; #line 6521 - __cil_tmp67 = __cil_tmp66 + 24; + __cil_tmp67 = __cil_tmp66 + 24; #line 6521 - mem_80 = (NTSTATUS *)__cil_tmp67; + mem_80 = (NTSTATUS *)__cil_tmp67; #line 6521 - *mem_80 = -1073741823L; + *mem_80 = -1073741823L; #line 6522 - IofCompleteRequest(currentIrp, (char)0); + IofCompleteRequest(currentIrp, (char)0); + } + } else { + switch_189_break: /* CIL Label */; + } + } + } + } + } } - } else { - switch_189_break: /* CIL Label */ ; - } } } } + } else { } - } - } - } - } - } else { - - } #line 6527 - if (currentIrp) { - { + if (currentIrp) { + { #line 6531 - ExAcquireFastMutex(PagingMutex); + ExAcquireFastMutex(PagingMutex); #line 6531 - PagingReferenceCount = PagingReferenceCount - 1UL; - } + PagingReferenceCount = PagingReferenceCount - 1UL; + } #line 6531 - if (PagingReferenceCount == 0UL) { - { + if (PagingReferenceCount == 0UL) { + { #line 6531 - __cil_tmp68 = (void *)(& DriverEntry); + __cil_tmp68 = (void *)(&DriverEntry); #line 6531 - MmPageEntireDriver(__cil_tmp68); - } - } else { - - } - { + MmPageEntireDriver(__cil_tmp68); + } + } else { + } + { #line 6531 - ExReleaseFastMutex(PagingMutex); - } - } else { - - } - { + ExReleaseFastMutex(PagingMutex); + } + } else { + } + { #line 6535 - __cil_tmp69 = (KSPIN_LOCK *)DisketteExtension; + __cil_tmp69 = (KSPIN_LOCK *)DisketteExtension; #line 6535 - oldIrql = KfAcquireSpinLock(__cil_tmp69); + oldIrql = KfAcquireSpinLock(__cil_tmp69); + } + } + while_188_break: /* CIL Label */; } - } - while_188_break: /* CIL Label */ ; - } - { + { #line 6540 - __cil_tmp70 = (KSPIN_LOCK *)DisketteExtension; + __cil_tmp70 = (KSPIN_LOCK *)DisketteExtension; #line 6540 - KfReleaseSpinLock(__cil_tmp70, oldIrql); - } + KfReleaseSpinLock(__cil_tmp70, oldIrql); + } #line 6544 - return; -} + return; + } } #line 832 "C:/NTDDK/inc/ntdef.h" #pragma warning(push) #line 834 -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #line 835 "C:/NTDDK/inc/ntdef.h" -__inline ULONGLONG ( __attribute__((__stdcall__)) Int64ShllMod32___1)(ULONGLONG Value , - ULONG ShiftCount ) -{ +__inline ULONGLONG(__attribute__((__stdcall__)) + Int64ShllMod32___1)(ULONGLONG Value, ULONG ShiftCount) { { #line 850 - return (0ULL); -} + return (0ULL); + } } #line 845 "C:/NTDDK/inc/ntdef.h" -__inline LONGLONG ( __attribute__((__stdcall__)) Int64ShraMod32___1)(LONGLONG Value , - ULONG ShiftCount ) -{ +__inline LONGLONG(__attribute__((__stdcall__)) + Int64ShraMod32___1)(LONGLONG Value, ULONG ShiftCount) { { #line 860 - return (0LL); -} + return (0LL); + } } #line 855 "C:/NTDDK/inc/ntdef.h" -__inline ULONGLONG ( __attribute__((__stdcall__)) Int64ShrlMod32___1)(ULONGLONG Value , - ULONG ShiftCount ) -{ +__inline ULONGLONG(__attribute__((__stdcall__)) + Int64ShrlMod32___1)(ULONGLONG Value, ULONG ShiftCount) { { #line 870 - return (0ULL); -} + return (0ULL); + } } #line 873 #pragma warning(pop) #line 25 "C:/NTDDK/inc/pshpack4.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 28 "C:/NTDDK/inc/poppack.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 1953 "C:/NTDDK/inc/ddk/ntddk.h" #pragma warning(push) #line 1955 -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #line 2020 #pragma warning(pop) #line 5253 -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #line 7015 #pragma warning(push) #line 7017 -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #line 7020 #pragma function(_enable) #line 7021 @@ -29548,1813 +29940,1753 @@ __inline ULONGLONG ( __attribute__((__stdcall__)) Int64ShrlMod32___1)(ULONGLONG #line 7025 #pragma warning(pop) #line 25 "C:/NTDDK/inc/pshpack4.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 28 "C:/NTDDK/inc/poppack.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 25 "C:/NTDDK/inc/pshpack1.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 28 "C:/NTDDK/inc/poppack.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 25 "C:/NTDDK/inc/pshpack4.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 28 "C:/NTDDK/inc/poppack.h" -#pragma warning(disable:4103) +#pragma warning(disable : 4103) #line 17779 "C:/NTDDK/inc/ddk/ntddk.h" -#pragma warning(disable:4200) +#pragma warning(disable : 4200) #line 17785 -#pragma warning(default:4200) +#pragma warning(default : 4200) #line 37 "../slam-kernel.c" -IRP *pirp ; +IRP *pirp; #line 39 "../slam-kernel.c" -void stub_driver_init(void) -{ +void stub_driver_init(void) { { #line 41 - s = 1; + s = 1; #line 46 - pended = 0; + pended = 0; #line 47 - compFptr = (NTSTATUS (*)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ))0; + compFptr = + (NTSTATUS(*)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context))0; #line 48 - compRegistered = 0; + compRegistered = 0; #line 49 - lowerDriverReturn = 0; + lowerDriverReturn = 0; #line 50 - setEventCalled = 0; + setEventCalled = 0; #line 51 - customIrp = 0; + customIrp = 0; #line 54 - return; -} + return; + } } #line 48 "../slam-kernel.c" -int main(void) -{ DRIVER_OBJECT d ; - UNICODE_STRING u ; - NTSTATUS status ; - int we_should_unload ; - IRP irp ; - int __BLAST_NONDET = __VERIFIER_nondet_int() ; - int irp_choice = __VERIFIER_nondet_int() ; - DEVICE_OBJECT devobj ; - NTSTATUS (*__cil_tmp9)(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) ; - unsigned int __cil_tmp10 ; - unsigned int __cil_tmp11 ; - unsigned int __cil_tmp12 ; - unsigned int __cil_tmp13 ; - int __cil_tmp14 ; - NTSTATUS (*__cil_tmp15)(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; - NTSTATUS (*__cil_tmp16)(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; - NTSTATUS (*__cil_tmp17)(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; - NTSTATUS (*__cil_tmp18)(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; - NTSTATUS (*__cil_tmp19)(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; - void (*__cil_tmp20)(PDRIVER_OBJECT DriverObject ) ; - int __cil_tmp21 ; - int __cil_tmp22 ; - long __cil_tmp23 ; - NTSTATUS *mem_24 ; - NTSTATUS *mem_25 ; +int main(void) { + DRIVER_OBJECT d; + UNICODE_STRING u; + NTSTATUS status; + int we_should_unload; + IRP irp; + int __BLAST_NONDET = __VERIFIER_nondet_int(); + int irp_choice = __VERIFIER_nondet_int(); + DEVICE_OBJECT devobj; + NTSTATUS(*__cil_tmp9) + (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath); + unsigned int __cil_tmp10; + unsigned int __cil_tmp11; + unsigned int __cil_tmp12; + unsigned int __cil_tmp13; + int __cil_tmp14; + NTSTATUS (*__cil_tmp15)(PDEVICE_OBJECT DeviceObject, PIRP Irp); + NTSTATUS (*__cil_tmp16)(PDEVICE_OBJECT DeviceObject, PIRP Irp); + NTSTATUS (*__cil_tmp17)(PDEVICE_OBJECT DeviceObject, PIRP Irp); + NTSTATUS (*__cil_tmp18)(PDEVICE_OBJECT DeviceObject, PIRP Irp); + NTSTATUS (*__cil_tmp19)(PDEVICE_OBJECT DeviceObject, PIRP Irp); + void (*__cil_tmp20)(PDRIVER_OBJECT DriverObject); + int __cil_tmp21; + int __cil_tmp22; + long __cil_tmp23; + NTSTATUS *mem_24; + NTSTATUS *mem_25; { - { + { #line 51 - status = 0L; + status = 0L; #line 54 - pirp = & irp; + pirp = &irp; #line 56 - __cil_tmp9 = & DriverEntry; + __cil_tmp9 = &DriverEntry; #line 56 - status = (*__cil_tmp9)(& d, & u); - } + status = (*__cil_tmp9)(&d, &u); + } #line 58 - if (status >= 0L) { + if (status >= 0L) { #line 71 - s = 1; + s = 1; #line 72 - customIrp = 0; + customIrp = 0; #line 72 - setEventCalled = customIrp; + setEventCalled = customIrp; #line 72 - lowerDriverReturn = setEventCalled; + lowerDriverReturn = setEventCalled; #line 72 - compRegistered = lowerDriverReturn; + compRegistered = lowerDriverReturn; #line 72 - compFptr = (NTSTATUS (*)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ))compRegistered; + compFptr = (NTSTATUS(*)(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context))compRegistered; #line 72 - pended = (int )compFptr; + pended = (int)compFptr; #line 75 - __cil_tmp10 = (unsigned int )pirp; + __cil_tmp10 = (unsigned int)pirp; #line 75 - __cil_tmp11 = __cil_tmp10 + 24; + __cil_tmp11 = __cil_tmp10 + 24; #line 75 - mem_24 = (NTSTATUS *)__cil_tmp11; + mem_24 = (NTSTATUS *)__cil_tmp11; #line 75 - *mem_24 = 0L; + *mem_24 = 0L; #line 76 - myStatus = 0L; + myStatus = 0L; #line 77 - if (irp_choice == 0) { + if (irp_choice == 0) { #line 77 - __cil_tmp12 = (unsigned int )pirp; + __cil_tmp12 = (unsigned int)pirp; #line 77 - __cil_tmp13 = __cil_tmp12 + 24; + __cil_tmp13 = __cil_tmp12 + 24; #line 77 - mem_25 = (NTSTATUS *)__cil_tmp13; + mem_25 = (NTSTATUS *)__cil_tmp13; #line 77 - *mem_25 = -1073741637L; + *mem_25 = -1073741637L; #line 78 - myStatus = -1073741637L; - } else { - - } - { + myStatus = -1073741637L; + } else { + } + { #line 82 - stub_driver_init(); - } - { + stub_driver_init(); + } + { #line 84 - __cil_tmp14 = status >= 0L; + __cil_tmp14 = status >= 0L; #line 84 - if (! __cil_tmp14) { + if (!__cil_tmp14) { #line 84 - return (-1); - } else { - - } - } + return (-1); + } else { + } + } #line 89 - if (__BLAST_NONDET == 0) { - goto switch_190_0; - } else { -#line 94 - if (__BLAST_NONDET == 1) { - goto switch_190_1; + if (__BLAST_NONDET == 0) { + goto switch_190_0; } else { -#line 100 - if (__BLAST_NONDET == 2) { - goto switch_190_2; +#line 94 + if (__BLAST_NONDET == 1) { + goto switch_190_1; } else { -#line 106 - if (__BLAST_NONDET == 3) { - goto switch_190_3; +#line 100 + if (__BLAST_NONDET == 2) { + goto switch_190_2; } else { -#line 112 - if (__BLAST_NONDET == 4) { - goto switch_190_4; +#line 106 + if (__BLAST_NONDET == 3) { + goto switch_190_3; } else { - { - goto switch_190_default; -#line 88 - if (0) { - switch_190_0: /* CIL Label */ +#line 112 + if (__BLAST_NONDET == 4) { + goto switch_190_4; + } else { { + goto switch_190_default; +#line 88 + if (0) { + switch_190_0 : /* CIL Label */ + { #line 92 - __cil_tmp15 = & FloppyCreateClose; + __cil_tmp15 = &FloppyCreateClose; #line 92 - status = (*__cil_tmp15)(& devobj, pirp); - } - goto switch_190_break; - switch_190_1: /* CIL Label */ - { + status = (*__cil_tmp15)(&devobj, pirp); + } + goto switch_190_break; + switch_190_1 : /* CIL Label */ + { #line 98 - __cil_tmp16 = & FloppyCreateClose; + __cil_tmp16 = &FloppyCreateClose; #line 98 - status = (*__cil_tmp16)(& devobj, pirp); - } - goto switch_190_break; - switch_190_2: /* CIL Label */ - { + status = (*__cil_tmp16)(&devobj, pirp); + } + goto switch_190_break; + switch_190_2 : /* CIL Label */ + { #line 104 - __cil_tmp17 = & FloppyDeviceControl; + __cil_tmp17 = &FloppyDeviceControl; #line 104 - status = (*__cil_tmp17)(& devobj, pirp); - } - goto switch_190_break; - switch_190_3: /* CIL Label */ - { + status = (*__cil_tmp17)(&devobj, pirp); + } + goto switch_190_break; + switch_190_3 : /* CIL Label */ + { #line 110 - __cil_tmp18 = & FloppyPnp; + __cil_tmp18 = &FloppyPnp; #line 110 - status = (*__cil_tmp18)(& devobj, pirp); - } - goto switch_190_break; - switch_190_4: /* CIL Label */ - { + status = (*__cil_tmp18)(&devobj, pirp); + } + goto switch_190_break; + switch_190_4 : /* CIL Label */ + { #line 116 - __cil_tmp19 = & FloppyPower; + __cil_tmp19 = &FloppyPower; #line 116 - status = (*__cil_tmp19)(& devobj, pirp); - } - goto switch_190_break; - switch_190_default: /* CIL Label */ ; + status = (*__cil_tmp19)(&devobj, pirp); + } + goto switch_190_break; + switch_190_default: /* CIL Label */; #line 180 - return (-1); - } else { - switch_190_break: /* CIL Label */ ; - } + return (-1); + } else { + switch_190_break: /* CIL Label */; + } + } } } } } } - } #line 185 - if (we_should_unload) { - { + if (we_should_unload) { + { #line 187 - __cil_tmp20 = & FloppyUnload; + __cil_tmp20 = &FloppyUnload; #line 187 - (*__cil_tmp20)(& d); + (*__cil_tmp20)(&d); + } + } else { } } else { - } - } else { - - } #line 192 - if (pended == 1) { + if (pended == 1) { #line 192 - if (s == 1) { + if (s == 1) { #line 193 - s = 1; + s = 1; + } else { + goto _L___2; + } } else { - goto _L___2; - } - } else { - _L___2: + _L___2: #line 195 - if (pended == 1) { + if (pended == 1) { #line 195 - if (s == 6) { + if (s == 6) { #line 196 - s = 6; + s = 6; + } else { + goto _L___1; + } } else { - goto _L___1; - } - } else { - _L___1: - { + _L___1 : { #line 198 - __cil_tmp21 = s == 0; + __cil_tmp21 = s == 0; #line 198 - if (! __cil_tmp21) { - { + if (!__cil_tmp21) { + { #line 198 - __cil_tmp22 = status == -1L; + __cil_tmp22 = status == -1L; #line 198 - if (! __cil_tmp22) { + if (!__cil_tmp22) { #line 201 - if (s != 4) { + if (s != 4) { #line 201 - if (s != 7) { + if (s != 7) { #line 201 - if (s != 2) { - - } else { - goto _L___0; - } - } else { - goto _L___0; - } - } else { - _L___0: -#line 203 - if (pended == 1) { -#line 204 - if (status != 259L) { -#line 204 - status = 0L; - } else { + if (s != 2) { - } - } else { -#line 206 - if (s == 2) { -#line 207 - if (status == 259L) { - { -#line 207 - __VERIFIER_assert(0); + } else { + goto _L___0; } } else { - + goto _L___0; } } else { - { + _L___0: +#line 203 + if (pended == 1) { +#line 204 + if (status != 259L) { +#line 204 + status = 0L; + } else { + } + } else { +#line 206 + if (s == 2) { +#line 207 + if (status == 259L) { + { +#line 207 + __VERIFIER_assert(0); + } + } else { + } + } else { + { #line 209 - __cil_tmp23 = (long )lowerDriverReturn; + __cil_tmp23 = (long)lowerDriverReturn; #line 209 - if (status != __cil_tmp23) { - { + if (status != __cil_tmp23) { + { #line 209 - __VERIFIER_assert(0); + __VERIFIER_assert(0); + } + } else { + } + } } - } else { - - } } } + } else { } } } else { - } - } - } else { - } } } - } #line 216 - status = 0L; + status = 0L; #line 217 - return ((int )status); -} -} -#line 220 "../slam-kernel.c" -char _SLAM_alloc_dummy ; -#line 222 "../slam-kernel.c" -char *malloc(int i ) -{ - - { -#line 222 - return (& _SLAM_alloc_dummy); -} + return ((int)status); + } } #line 230 -void ( __attribute__((__fastcall__)) ExAcquireFastMutex)(PFAST_MUTEX FastMutex ) ; +void(__attribute__((__fastcall__)) ExAcquireFastMutex)(PFAST_MUTEX FastMutex); #line 230 "../slam-kernel.c" -void ( __attribute__((__fastcall__)) ExAcquireFastMutex)(PFAST_MUTEX FastMutex ) -{ +void(__attribute__((__fastcall__)) ExAcquireFastMutex)(PFAST_MUTEX FastMutex) { { #line 239 - return; -} + return; + } } #line 240 -void ( __attribute__((__fastcall__)) ExReleaseFastMutex)(PFAST_MUTEX FastMutex ) ; +void(__attribute__((__fastcall__)) ExReleaseFastMutex)(PFAST_MUTEX FastMutex); #line 240 "../slam-kernel.c" -void ( __attribute__((__fastcall__)) ExReleaseFastMutex)(PFAST_MUTEX FastMutex ) -{ +void(__attribute__((__fastcall__)) ExReleaseFastMutex)(PFAST_MUTEX FastMutex) { { #line 249 - return; -} + return; + } } #line 264 -PVOID ( __attribute__((__stdcall__)) ExAllocatePoolWithTag)(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; +PVOID(__attribute__((__stdcall__)) ExAllocatePoolWithTag) +(POOL_TYPE PoolType, SIZE_T NumberOfBytes, ULONG Tag); #line 264 "../slam-kernel.c" -PVOID ( __attribute__((__stdcall__)) ExAllocatePoolWithTag)(POOL_TYPE PoolType , SIZE_T NumberOfBytes , - ULONG Tag ) -{ PVOID x ; - char *tmp ; - int __cil_tmp6 ; +PVOID(__attribute__((__stdcall__)) ExAllocatePoolWithTag) +(POOL_TYPE PoolType, SIZE_T NumberOfBytes, ULONG Tag) { + PVOID x; + char *tmp; + int __cil_tmp6; { - { + { #line 274 - __cil_tmp6 = (int )NumberOfBytes; + __cil_tmp6 = (int)NumberOfBytes; #line 274 - tmp = malloc(__cil_tmp6); + tmp = malloc(__cil_tmp6); #line 274 - x = (void *)tmp; - } + x = (void *)tmp; + } #line 275 - return (x); -} + return (x); + } } #line 279 -void ( __attribute__((__stdcall__)) ExFreePool)(PVOID P ) ; +void(__attribute__((__stdcall__)) ExFreePool)(PVOID P); #line 279 "../slam-kernel.c" -void ( __attribute__((__stdcall__)) ExFreePool)(PVOID P ) -{ +void(__attribute__((__stdcall__)) ExFreePool)(PVOID P) { { #line 287 - return; -} + return; + } } #line 288 -PLIST_ENTRY ( __attribute__((__fastcall__)) ExfInterlockedInsertHeadList)(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; +PLIST_ENTRY(__attribute__((__fastcall__)) ExfInterlockedInsertHeadList) +(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry, PKSPIN_LOCK Lock); #line 288 "../slam-kernel.c" -PLIST_ENTRY ( __attribute__((__fastcall__)) ExfInterlockedInsertHeadList)(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ void *__cil_tmp4 ; +PLIST_ENTRY(__attribute__((__fastcall__)) ExfInterlockedInsertHeadList) +(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry, PKSPIN_LOCK Lock) { + void *__cil_tmp4; { - { + { #line 296 - __cil_tmp4 = (void *)0; + __cil_tmp4 = (void *)0; #line 296 - return ((struct _LIST_ENTRY *)__cil_tmp4); + return ((struct _LIST_ENTRY *)__cil_tmp4); + } } } -} #line 299 -PLIST_ENTRY ( __attribute__((__fastcall__)) ExfInterlockedInsertTailList)(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; +PLIST_ENTRY(__attribute__((__fastcall__)) ExfInterlockedInsertTailList) +(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry, PKSPIN_LOCK Lock); #line 299 "../slam-kernel.c" -PLIST_ENTRY ( __attribute__((__fastcall__)) ExfInterlockedInsertTailList)(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ void *__cil_tmp4 ; +PLIST_ENTRY(__attribute__((__fastcall__)) ExfInterlockedInsertTailList) +(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry, PKSPIN_LOCK Lock) { + void *__cil_tmp4; { - { + { #line 308 - __cil_tmp4 = (void *)0; + __cil_tmp4 = (void *)0; #line 308 - return ((struct _LIST_ENTRY *)__cil_tmp4); + return ((struct _LIST_ENTRY *)__cil_tmp4); + } } } -} #line 311 -PLIST_ENTRY ( __attribute__((__fastcall__)) ExfInterlockedRemoveHeadList)(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; +PLIST_ENTRY(__attribute__((__fastcall__)) ExfInterlockedRemoveHeadList) +(PLIST_ENTRY ListHead, PKSPIN_LOCK Lock); #line 311 "../slam-kernel.c" -PLIST_ENTRY ( __attribute__((__fastcall__)) ExfInterlockedRemoveHeadList)(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) -{ void *__cil_tmp3 ; +PLIST_ENTRY(__attribute__((__fastcall__)) ExfInterlockedRemoveHeadList) +(PLIST_ENTRY ListHead, PKSPIN_LOCK Lock) { + void *__cil_tmp3; { - { + { #line 319 - __cil_tmp3 = (void *)0; + __cil_tmp3 = (void *)0; #line 319 - return ((struct _LIST_ENTRY *)__cil_tmp3); + return ((struct _LIST_ENTRY *)__cil_tmp3); + } } } -} #line 335 -PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); #line 335 "../slam-kernel.c" -PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , BOOLEAN SecondaryBuffer , - BOOLEAN ChargeQuota , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; - int __cil_tmp8 ; - void *__cil_tmp9 ; - void *__cil_tmp10 ; +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; + int __cil_tmp8; + void *__cil_tmp9; + void *__cil_tmp10; { #line 347 - if (__BLAST_NONDET == 0) { - goto switch_191_0; - } else { - { - goto switch_191_default; -#line 346 - if (0) { - switch_191_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_191_0; + } else { { + goto switch_191_default; +#line 346 + if (0) { + switch_191_0 : /* CIL Label */ + { #line 347 - __cil_tmp8 = (int )28U; + __cil_tmp8 = (int)28U; #line 347 - tmp = malloc(__cil_tmp8); - } - { + tmp = malloc(__cil_tmp8); + } + { #line 347 - __cil_tmp9 = (void *)tmp; + __cil_tmp9 = (void *)tmp; #line 347 - return ((struct _MDL *)__cil_tmp9); - } - switch_191_default: /* CIL Label */ ; - { + return ((struct _MDL *)__cil_tmp9); + } + switch_191_default: /* CIL Label */; + { #line 348 - __cil_tmp10 = (void *)0; + __cil_tmp10 = (void *)0; #line 348 - return ((struct _MDL *)__cil_tmp10); + return ((struct _MDL *)__cil_tmp10); + } + } else { + switch_191_break: /* CIL Label */; + } } - } else { - switch_191_break: /* CIL Label */ ; - } } } } -} #line 352 -PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); #line 352 "../slam-kernel.c" -PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , PDEVICE_OBJECT TargetDevice ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - void *__cil_tmp4 ; +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + void *__cil_tmp4; { #line 361 - if (__BLAST_NONDET == 0) { - goto switch_192_0; - } else { - { - goto switch_192_default; + if (__BLAST_NONDET == 0) { + goto switch_192_0; + } else { + { + goto switch_192_default; #line 360 - if (0) { - switch_192_0: /* CIL Label */ ; + if (0) { + switch_192_0: /* CIL Label */; #line 361 - return (TargetDevice); - switch_192_default: /* CIL Label */ ; - { + return (TargetDevice); + switch_192_default: /* CIL Label */; + { #line 362 - __cil_tmp4 = (void *)0; + __cil_tmp4 = (void *)0; #line 362 - return ((struct _DEVICE_OBJECT *)__cil_tmp4); + return ((struct _DEVICE_OBJECT *)__cil_tmp4); + } + } else { + switch_192_break: /* CIL Label */; + } } - } else { - switch_192_break: /* CIL Label */ ; - } } } } -} #line 366 -PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); #line 366 "../slam-kernel.c" -PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , PDEVICE_OBJECT DeviceObject , - PVOID Buffer , ULONG Length , PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; - int __cil_tmp9 ; - void *__cil_tmp10 ; - void *__cil_tmp11 ; +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; + int __cil_tmp9; + void *__cil_tmp10; + void *__cil_tmp11; { #line 378 - customIrp = 1; + customIrp = 1; #line 381 - if (__BLAST_NONDET == 0) { - goto switch_193_0; - } else { - { - goto switch_193_default; -#line 380 - if (0) { - switch_193_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_193_0; + } else { { + goto switch_193_default; +#line 380 + if (0) { + switch_193_0 : /* CIL Label */ + { #line 381 - __cil_tmp9 = (int )112U; + __cil_tmp9 = (int)112U; #line 381 - tmp = malloc(__cil_tmp9); - } - { + tmp = malloc(__cil_tmp9); + } + { #line 381 - __cil_tmp10 = (void *)tmp; + __cil_tmp10 = (void *)tmp; #line 381 - return ((struct _IRP *)__cil_tmp10); - } - switch_193_default: /* CIL Label */ ; - { + return ((struct _IRP *)__cil_tmp10); + } + switch_193_default: /* CIL Label */; + { #line 382 - __cil_tmp11 = (void *)0; + __cil_tmp11 = (void *)0; #line 382 - return ((struct _IRP *)__cil_tmp11); + return ((struct _IRP *)__cil_tmp11); + } + } else { + switch_193_break: /* CIL Label */; + } } - } else { - switch_193_break: /* CIL Label */ ; - } } } } -} #line 397 -PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); #line 397 "../slam-kernel.c" -PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , BOOLEAN InternalDeviceIoControl , - PKEVENT Event , PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; - int __cil_tmp12 ; - void *__cil_tmp13 ; - void *__cil_tmp14 ; +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; + int __cil_tmp12; + void *__cil_tmp13; + void *__cil_tmp14; { #line 412 - customIrp = 1; + customIrp = 1; #line 415 - if (__BLAST_NONDET == 0) { - goto switch_194_0; - } else { - { - goto switch_194_default; -#line 414 - if (0) { - switch_194_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_194_0; + } else { { + goto switch_194_default; +#line 414 + if (0) { + switch_194_0 : /* CIL Label */ + { #line 415 - __cil_tmp12 = (int )112U; + __cil_tmp12 = (int)112U; #line 415 - tmp = malloc(__cil_tmp12); - } - { + tmp = malloc(__cil_tmp12); + } + { #line 415 - __cil_tmp13 = (void *)tmp; + __cil_tmp13 = (void *)tmp; #line 415 - return ((struct _IRP *)__cil_tmp13); - } - switch_194_default: /* CIL Label */ ; - { + return ((struct _IRP *)__cil_tmp13); + } + switch_194_default: /* CIL Label */; + { #line 416 - __cil_tmp14 = (void *)0; + __cil_tmp14 = (void *)0; #line 416 - return ((struct _IRP *)__cil_tmp14); + return ((struct _IRP *)__cil_tmp14); + } + } else { + switch_194_break: /* CIL Label */; + } } - } else { - switch_194_break: /* CIL Label */ ; - } } } } -} #line 420 -NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); #line 420 "../slam-kernel.c" -NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; - int __cil_tmp10 ; - void *__cil_tmp11 ; +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; + int __cil_tmp10; + void *__cil_tmp11; { #line 434 - if (__BLAST_NONDET == 0) { - goto switch_195_0; - } else { - { - goto switch_195_default; -#line 433 - if (0) { - switch_195_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_195_0; + } else { { + goto switch_195_default; +#line 433 + if (0) { + switch_195_0 : /* CIL Label */ + { #line 434 - __cil_tmp10 = (int )184U; + __cil_tmp10 = (int)184U; #line 434 - tmp = malloc(__cil_tmp10); + tmp = malloc(__cil_tmp10); #line 434 - __cil_tmp11 = (void *)tmp; + __cil_tmp11 = (void *)tmp; #line 434 - *DeviceObject = (struct _DEVICE_OBJECT *)__cil_tmp11; - } + *DeviceObject = (struct _DEVICE_OBJECT *)__cil_tmp11; + } #line 435 - return (0L); - switch_195_default: /* CIL Label */ ; + return (0L); + switch_195_default: /* CIL Label */; #line 441 - return (-1073741823L); - } else { - switch_195_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_195_break: /* CIL Label */; + } + } } } } -} #line 446 -NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); #line 446 "../slam-kernel.c" -NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , PUNICODE_STRING DeviceName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 455 - if (__BLAST_NONDET == 0) { - goto switch_196_0; - } else { - { - goto switch_196_default; + if (__BLAST_NONDET == 0) { + goto switch_196_0; + } else { + { + goto switch_196_default; #line 454 - if (0) { - switch_196_0: /* CIL Label */ ; + if (0) { + switch_196_0: /* CIL Label */; #line 455 - return (0L); - switch_196_default: /* CIL Label */ ; + return (0L); + switch_196_default: /* CIL Label */; #line 456 - return (-1073741823L); - } else { - switch_196_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_196_break: /* CIL Label */; + } + } } } } -} #line 460 -void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); #line 460 "../slam-kernel.c" -void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) -{ +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject) { { #line 464 - return; -} + return; + } } #line 469 -NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); #line 469 "../slam-kernel.c" -NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 477 - if (__BLAST_NONDET == 0) { - goto switch_197_0; - } else { - { - goto switch_197_default; + if (__BLAST_NONDET == 0) { + goto switch_197_0; + } else { + { + goto switch_197_default; #line 476 - if (0) { - switch_197_0: /* CIL Label */ ; + if (0) { + switch_197_0: /* CIL Label */; #line 477 - return (0L); - switch_197_default: /* CIL Label */ ; + return (0L); + switch_197_default: /* CIL Label */; #line 478 - return (-1073741823L); - } else { - switch_197_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_197_break: /* CIL Label */; + } + } } } } -} #line 482 -void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); #line 482 "../slam-kernel.c" -void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) -{ +void IoDetachDevice(PDEVICE_OBJECT TargetDevice) { { #line 486 - return; -} + return; + } } #line 491 -void IoFreeIrp(PIRP Irp ) ; +void IoFreeIrp(PIRP Irp); #line 491 "../slam-kernel.c" -void IoFreeIrp(PIRP Irp ) -{ +void IoFreeIrp(PIRP Irp) { { #line 495 - return; -} + return; + } } #line 500 -void IoFreeMdl(PMDL Mdl ) ; +void IoFreeMdl(PMDL Mdl); #line 500 "../slam-kernel.c" -void IoFreeMdl(PMDL Mdl ) -{ +void IoFreeMdl(PMDL Mdl) { { #line 504 - return; -} + return; + } } #line 509 -PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); #line 509 "../slam-kernel.c" -PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) -{ char *tmp ; - int __cil_tmp2 ; - void *__cil_tmp3 ; +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) { + char *tmp; + int __cil_tmp2; + void *__cil_tmp3; { - { + { #line 514 - __cil_tmp2 = (int )40U; + __cil_tmp2 = (int)40U; #line 514 - tmp = malloc(__cil_tmp2); - } - { + tmp = malloc(__cil_tmp2); + } + { #line 514 - __cil_tmp3 = (void *)tmp; + __cil_tmp3 = (void *)tmp; #line 514 - return ((struct _CONFIGURATION_INFORMATION *)__cil_tmp3); + return ((struct _CONFIGURATION_INFORMATION *)__cil_tmp3); + } } } -} #line 517 -NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); #line 517 "../slam-kernel.c" -NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , PULONG BusNumber , PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 532 - if (__BLAST_NONDET == 0) { - goto switch_198_0; - } else { - { - goto switch_198_default; + if (__BLAST_NONDET == 0) { + goto switch_198_0; + } else { + { + goto switch_198_default; #line 531 - if (0) { - switch_198_0: /* CIL Label */ ; + if (0) { + switch_198_0: /* CIL Label */; #line 532 - return (0L); - switch_198_default: /* CIL Label */ ; + return (0L); + switch_198_default: /* CIL Label */; #line 533 - return (-1073741823L); - } else { - switch_198_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_198_break: /* CIL Label */; + } + } } } } -} #line 537 -NTSTATUS ( __attribute__((__stdcall__)) IoRegisterDeviceInterface)(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; +NTSTATUS(__attribute__((__stdcall__)) IoRegisterDeviceInterface) +(PDEVICE_OBJECT PhysicalDeviceObject, GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, PUNICODE_STRING SymbolicLinkName); #line 537 "../slam-kernel.c" -NTSTATUS ( __attribute__((__stdcall__)) IoRegisterDeviceInterface)(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS(__attribute__((__stdcall__)) IoRegisterDeviceInterface) +(PDEVICE_OBJECT PhysicalDeviceObject, GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 549 - if (__BLAST_NONDET == 0) { - goto switch_199_0; - } else { - { - goto switch_199_default; + if (__BLAST_NONDET == 0) { + goto switch_199_0; + } else { + { + goto switch_199_default; #line 548 - if (0) { - switch_199_0: /* CIL Label */ ; + if (0) { + switch_199_0: /* CIL Label */; #line 549 - return (0L); - switch_199_default: /* CIL Label */ ; + return (0L); + switch_199_default: /* CIL Label */; #line 550 - return (-1073741808L); - } else { - switch_199_break: /* CIL Label */ ; - } + return (-1073741808L); + } else { + switch_199_break: /* CIL Label */; + } + } } } } -} #line 554 -void IoReleaseCancelSpinLock(KIRQL Irql ) ; +void IoReleaseCancelSpinLock(KIRQL Irql); #line 554 "../slam-kernel.c" -void IoReleaseCancelSpinLock(KIRQL Irql ) -{ +void IoReleaseCancelSpinLock(KIRQL Irql) { { #line 558 - return; -} + return; + } } #line 563 -NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); #line 563 "../slam-kernel.c" -NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , BOOLEAN Enable ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 572 - if (__BLAST_NONDET == 0) { - goto switch_200_0; - } else { - { - goto switch_200_default; + if (__BLAST_NONDET == 0) { + goto switch_200_0; + } else { + { + goto switch_200_default; #line 571 - if (0) { - switch_200_0: /* CIL Label */ ; + if (0) { + switch_200_0: /* CIL Label */; #line 572 - return (0L); - switch_200_default: /* CIL Label */ ; + return (0L); + switch_200_default: /* CIL Label */; #line 577 - return (-1073741823L); - } else { - switch_200_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_200_break: /* CIL Label */; + } + } } } } -} #line 582 -void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); #line 582 "../slam-kernel.c" -void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) -{ +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject) { { #line 587 - return; -} + return; + } } #line 595 "../slam-kernel.c" -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { #line 598 - if (s == 1) { + if (s == 1) { #line 598 - s = 5; - } else { - { + s = 5; + } else { + { #line 599 - __VERIFIER_assert(0); + __VERIFIER_assert(0); + } } - } #line 602 - return; -} + return; + } } #line 602 -NTSTATUS ( __attribute__((__fastcall__)) IofCallDriver)(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; +NTSTATUS(__attribute__((__fastcall__)) IofCallDriver) +(PDEVICE_OBJECT DeviceObject, PIRP Irp); #line 602 "../slam-kernel.c" -NTSTATUS ( __attribute__((__fastcall__)) IofCallDriver)(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - NTSTATUS returnVal2 ; - int compRetStatus1 ; - PVOID lcontext ; - NTSTATUS tmp ; - NTSTATUS (*__cil_tmp8)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - long __cil_tmp9 ; +NTSTATUS(__attribute__((__fastcall__)) IofCallDriver) +(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + NTSTATUS returnVal2; + int compRetStatus1; + PVOID lcontext; + NTSTATUS tmp; + NTSTATUS (*__cil_tmp8)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + long __cil_tmp9; { #line 615 - if (compRegistered) { - { + if (compRegistered) { + { #line 619 - __cil_tmp8 = & FloppyPnpComplete; + __cil_tmp8 = &FloppyPnpComplete; #line 619 - tmp = (*__cil_tmp8)(DeviceObject, Irp, lcontext); + tmp = (*__cil_tmp8)(DeviceObject, Irp, lcontext); #line 619 - compRetStatus1 = (int )tmp; - } - { + compRetStatus1 = (int)tmp; + } + { #line 621 - __cil_tmp9 = (long )compRetStatus1; + __cil_tmp9 = (long)compRetStatus1; #line 621 - if (__cil_tmp9 == -1073741802L) { - { + if (__cil_tmp9 == -1073741802L) { + { #line 617 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } else { + } } - } else { - - } + } else { } - } else { - - } #line 623 - if (__BLAST_NONDET == 0) { - goto switch_201_0; - } else { -#line 624 - if (__BLAST_NONDET == 1) { - goto switch_201_1; + if (__BLAST_NONDET == 0) { + goto switch_201_0; } else { - { - goto switch_201_default; +#line 624 + if (__BLAST_NONDET == 1) { + goto switch_201_1; + } else { + { + goto switch_201_default; #line 622 - if (0) { - switch_201_0: /* CIL Label */ + if (0) { + switch_201_0: /* CIL Label */ #line 623 - returnVal2 = 0L; - goto switch_201_break; - switch_201_1: /* CIL Label */ + returnVal2 = 0L; + goto switch_201_break; + switch_201_1: /* CIL Label */ #line 625 - returnVal2 = -1073741823L; - goto switch_201_break; - switch_201_default: /* CIL Label */ + returnVal2 = -1073741823L; + goto switch_201_break; + switch_201_default: /* CIL Label */ #line 627 - returnVal2 = 259L; - goto switch_201_break; - } else { - switch_201_break: /* CIL Label */ ; - } + returnVal2 = 259L; + goto switch_201_break; + } else { + switch_201_break: /* CIL Label */; + } + } } } - } #line 629 - if (s == 1) { + if (s == 1) { #line 630 - s = 7; + s = 7; #line 630 - lowerDriverReturn = (int )returnVal2; - } else { + lowerDriverReturn = (int)returnVal2; + } else { #line 632 - if (s == 5) { + if (s == 5) { #line 633 - if (returnVal2 == 259L) { + if (returnVal2 == 259L) { #line 634 - s = 6; + s = 6; #line 634 - lowerDriverReturn = (int )returnVal2; - } else { + lowerDriverReturn = (int)returnVal2; + } else { #line 636 - s = 1; + s = 1; #line 636 - lowerDriverReturn = (int )returnVal2; - } - } else { + lowerDriverReturn = (int)returnVal2; + } + } else { #line 639 - if (s == 3) { + if (s == 3) { #line 639 - s = 4; + s = 4; #line 639 - lowerDriverReturn = (int )returnVal2; - } else { - { + lowerDriverReturn = (int)returnVal2; + } else { + { #line 640 - __VERIFIER_assert(0); + __VERIFIER_assert(0); + } } } } - } #line 643 - return (returnVal2); -} + return (returnVal2); + } } #line 665 -void ( __attribute__((__fastcall__)) IofCompleteRequest)(PIRP Irp , - CCHAR PriorityBoost ) ; +void(__attribute__((__fastcall__)) IofCompleteRequest)(PIRP Irp, + CCHAR PriorityBoost); #line 665 "../slam-kernel.c" -void ( __attribute__((__fastcall__)) IofCompleteRequest)(PIRP Irp , CCHAR PriorityBoost ) -{ +void(__attribute__((__fastcall__)) IofCompleteRequest)(PIRP Irp, + CCHAR PriorityBoost) { { #line 673 - if (s == 1) { + if (s == 1) { #line 673 - s = 2; - } else { - { + s = 2; + } else { + { #line 674 - __VERIFIER_assert(0); + __VERIFIER_assert(0); + } } - } #line 677 - return; -} + return; + } } #line 677 -KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ; +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock); #line 677 -KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ; +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock); #line 677 "../slam-kernel.c" -KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) -{ +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock) { { #line 679 - return ((unsigned char)0); -} + return ((unsigned char)0); + } } #line 686 -NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); #line 686 "../slam-kernel.c" -NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , BOOLEAN Alertable , PLARGE_INTEGER Interval ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 696 - if (__BLAST_NONDET == 0) { - goto switch_202_0; - } else { - { - goto switch_202_default; + if (__BLAST_NONDET == 0) { + goto switch_202_0; + } else { + { + goto switch_202_default; #line 695 - if (0) { - switch_202_0: /* CIL Label */ ; + if (0) { + switch_202_0: /* CIL Label */; #line 696 - return (0L); - switch_202_default: /* CIL Label */ ; + return (0L); + switch_202_default: /* CIL Label */; #line 701 - return (-1073741823L); - } else { - switch_202_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_202_break: /* CIL Label */; + } + } } } } -} #line 706 -void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); #line 706 "../slam-kernel.c" -void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , BOOLEAN State ) -{ +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State) { { #line 711 - return; -} + return; + } } #line 717 -void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); #line 717 "../slam-kernel.c" -void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , LONG Count , LONG Limit ) -{ +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit) { { #line 722 - return; -} + return; + } } #line 728 -void ( __attribute__((__stdcall__)) KeInitializeSpinLock)(PKSPIN_LOCK SpinLock ) ; +void(__attribute__((__stdcall__)) KeInitializeSpinLock)(PKSPIN_LOCK SpinLock); #line 728 "../slam-kernel.c" -void ( __attribute__((__stdcall__)) KeInitializeSpinLock)(PKSPIN_LOCK SpinLock ) -{ +void(__attribute__((__stdcall__)) KeInitializeSpinLock)(PKSPIN_LOCK SpinLock) { { #line 732 - return; -} + return; + } } #line 738 -LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); #line 738 "../slam-kernel.c" -LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , LONG Adjustment , - BOOLEAN Wait ) -{ LONG r ; +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait) { + LONG r; { #line 748 - return (r); -} + return (r); + } } #line 751 -void ( __attribute__((__fastcall__)) KfReleaseSpinLock)(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; +void(__attribute__((__fastcall__)) KfReleaseSpinLock)(PKSPIN_LOCK SpinLock, + KIRQL NewIrql); #line 751 "../slam-kernel.c" -void ( __attribute__((__fastcall__)) KfReleaseSpinLock)(PKSPIN_LOCK SpinLock , KIRQL NewIrql ) -{ +void(__attribute__((__fastcall__)) KfReleaseSpinLock)(PKSPIN_LOCK SpinLock, + KIRQL NewIrql) { { #line 756 - return; -} + return; + } } #line 762 -LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); #line 762 "../slam-kernel.c" -LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , BOOLEAN Wait ) -{ LONG l ; +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait) { + LONG l; { #line 772 - setEventCalled = 1; + setEventCalled = 1; #line 774 - return (l); -} + return (l); + } } #line 777 -NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); #line 777 "../slam-kernel.c" -NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , PLARGE_INTEGER Timeout ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 788 - if (s == 6) { + if (s == 6) { #line 788 - if (setEventCalled == 1) { + if (setEventCalled == 1) { #line 789 - s = 1; + s = 1; #line 789 - setEventCalled = 0; + setEventCalled = 0; + } else { + goto _L; + } } else { - goto _L; - } - } else { - _L: + _L: #line 791 - if (customIrp == 1) { + if (customIrp == 1) { #line 792 - s = 1; + s = 1; #line 792 - customIrp = 0; - } else { + customIrp = 0; + } else { #line 794 - if (s == 6) { - { + if (s == 6) { + { #line 794 - __VERIFIER_assert(0); + __VERIFIER_assert(0); + } + } else { } - } else { - } } - } #line 799 - if (__BLAST_NONDET == 0) { - goto switch_203_0; - } else { - { - goto switch_203_default; + if (__BLAST_NONDET == 0) { + goto switch_203_0; + } else { + { + goto switch_203_default; #line 798 - if (0) { - switch_203_0: /* CIL Label */ ; + if (0) { + switch_203_0: /* CIL Label */; #line 799 - return (0L); - switch_203_default: /* CIL Label */ ; + return (0L); + switch_203_default: /* CIL Label */; #line 805 - return (-1073741823L); - } else { - switch_203_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_203_break: /* CIL Label */; + } + } } } } -} #line 810 -PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); #line 810 "../slam-kernel.c" -PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , PHYSICAL_ADDRESS HighestAcceptableAddress ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; - int __cil_tmp5 ; +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; + int __cil_tmp5; { #line 818 - if (__BLAST_NONDET == 0) { - goto switch_204_0; - } else { -#line 819 - if (__BLAST_NONDET == 1) { - goto switch_204_1; + if (__BLAST_NONDET == 0) { + goto switch_204_0; } else { +#line 819 + if (__BLAST_NONDET == 1) { + goto switch_204_1; + } else { #line 817 - if (0) { - switch_204_0: /* CIL Label */ + if (0) { + switch_204_0 : /* CIL Label */ { #line 818 - __cil_tmp5 = (int )NumberOfBytes; + __cil_tmp5 = (int)NumberOfBytes; #line 818 - tmp = malloc(__cil_tmp5); + tmp = malloc(__cil_tmp5); } #line 818 - return ((void *)tmp); - switch_204_1: /* CIL Label */ ; + return ((void *)tmp); + switch_204_1: /* CIL Label */; #line 819 - return ((void *)0); - } else { - switch_204_break: /* CIL Label */ ; + return ((void *)0); + } else { + switch_204_break: /* CIL Label */; + } } } - } #line 821 - return ((void *)0); -} + return ((void *)0); + } } #line 823 -void MmFreeContiguousMemory(PVOID BaseAddress ) ; +void MmFreeContiguousMemory(PVOID BaseAddress); #line 823 "../slam-kernel.c" -void MmFreeContiguousMemory(PVOID BaseAddress ) -{ +void MmFreeContiguousMemory(PVOID BaseAddress) { { #line 827 - return; -} + return; + } } #line 832 -PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); #line 832 "../slam-kernel.c" -PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , PVOID BaseAddress , - ULONG BugCheckOnFailure , MM_PAGE_PRIORITY Priority ) -{ +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority) { { #line 843 - return ((void *)0); -} + return ((void *)0); + } } #line 846 -PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; +PVOID MmPageEntireDriver(PVOID AddressWithinSection); #line 846 "../slam-kernel.c" -PVOID MmPageEntireDriver(PVOID AddressWithinSection ) -{ +PVOID MmPageEntireDriver(PVOID AddressWithinSection) { { #line 852 - return ((void *)0); -} + return ((void *)0); + } } #line 855 -void MmResetDriverPaging(PVOID AddressWithinSection ) ; +void MmResetDriverPaging(PVOID AddressWithinSection); #line 855 "../slam-kernel.c" -void MmResetDriverPaging(PVOID AddressWithinSection ) -{ +void MmResetDriverPaging(PVOID AddressWithinSection) { { #line 859 - return; -} + return; + } } #line 865 -void MmUnlockPages(PMDL MemoryDescriptorList ) ; +void MmUnlockPages(PMDL MemoryDescriptorList); #line 865 "../slam-kernel.c" -void MmUnlockPages(PMDL MemoryDescriptorList ) -{ +void MmUnlockPages(PMDL MemoryDescriptorList) { { #line 869 - return; -} + return; + } } #line 874 -NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); #line 874 "../slam-kernel.c" -NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , ACCESS_MASK DesiredAccess , POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , PVOID *Object , POBJECT_HANDLE_INFORMATION HandleInformation ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 887 - if (__BLAST_NONDET == 0) { - goto switch_205_0; - } else { - { - goto switch_205_default; + if (__BLAST_NONDET == 0) { + goto switch_205_0; + } else { + { + goto switch_205_default; #line 886 - if (0) { - switch_205_0: /* CIL Label */ ; + if (0) { + switch_205_0: /* CIL Label */; #line 887 - return (0L); - switch_205_default: /* CIL Label */ ; + return (0L); + switch_205_default: /* CIL Label */; #line 893 - return (-1073741823L); - } else { - switch_205_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_205_break: /* CIL Label */; + } + } } } } -} #line 899 -void ( __attribute__((__fastcall__)) ObfDereferenceObject)(PVOID Object ) ; +void(__attribute__((__fastcall__)) ObfDereferenceObject)(PVOID Object); #line 899 "../slam-kernel.c" -void ( __attribute__((__fastcall__)) ObfDereferenceObject)(PVOID Object ) -{ +void(__attribute__((__fastcall__)) ObfDereferenceObject)(PVOID Object) { { #line 903 - return; -} + return; + } } #line 909 -NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); #line 909 "../slam-kernel.c" -NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - int compRetStatus ; - NTSTATUS returnVal ; - PVOID lcontext ; - NTSTATUS tmp ; - NTSTATUS (*__cil_tmp8)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - long __cil_tmp9 ; +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + int compRetStatus; + NTSTATUS returnVal; + PVOID lcontext; + NTSTATUS tmp; + NTSTATUS (*__cil_tmp8)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + long __cil_tmp9; { #line 922 - if (compRegistered) { - { + if (compRegistered) { + { #line 926 - __cil_tmp8 = & FloppyPnpComplete; + __cil_tmp8 = &FloppyPnpComplete; #line 926 - tmp = (*__cil_tmp8)(DeviceObject, Irp, lcontext); + tmp = (*__cil_tmp8)(DeviceObject, Irp, lcontext); #line 926 - compRetStatus = (int )tmp; - } - { + compRetStatus = (int)tmp; + } + { #line 927 - __cil_tmp9 = (long )compRetStatus; + __cil_tmp9 = (long)compRetStatus; #line 927 - if (__cil_tmp9 == -1073741802L) { - { + if (__cil_tmp9 == -1073741802L) { + { #line 924 - stubMoreProcessingRequired(); + stubMoreProcessingRequired(); + } + } else { + } } } else { - } - } - } else { - - } #line 930 - if (__BLAST_NONDET == 0) { - goto switch_206_0; - } else { -#line 933 - if (__BLAST_NONDET == 1) { - goto switch_206_1; + if (__BLAST_NONDET == 0) { + goto switch_206_0; } else { - { - goto switch_206_default; +#line 933 + if (__BLAST_NONDET == 1) { + goto switch_206_1; + } else { + { + goto switch_206_default; #line 929 - if (0) { - switch_206_0: /* CIL Label */ + if (0) { + switch_206_0: /* CIL Label */ #line 931 - returnVal = 0L; - goto switch_206_break; - switch_206_1: /* CIL Label */ + returnVal = 0L; + goto switch_206_break; + switch_206_1: /* CIL Label */ #line 934 - returnVal = -1073741823L; - goto switch_206_break; - switch_206_default: /* CIL Label */ + returnVal = -1073741823L; + goto switch_206_break; + switch_206_default: /* CIL Label */ #line 937 - returnVal = 259L; - goto switch_206_break; - } else { - switch_206_break: /* CIL Label */ ; - } + returnVal = 259L; + goto switch_206_break; + } else { + switch_206_break: /* CIL Label */; + } + } } } - } #line 939 - if (s == 1) { + if (s == 1) { #line 940 - s = 7; + s = 7; #line 940 - lowerDriverReturn = (int )returnVal; - } else { + lowerDriverReturn = (int)returnVal; + } else { #line 942 - if (s == 5) { + if (s == 5) { #line 943 - if (returnVal == 259L) { + if (returnVal == 259L) { #line 944 - s = 6; + s = 6; #line 944 - lowerDriverReturn = (int )returnVal; - } else { + lowerDriverReturn = (int)returnVal; + } else { #line 946 - s = 1; + s = 1; #line 946 - lowerDriverReturn = (int )returnVal; - } - } else { + lowerDriverReturn = (int)returnVal; + } + } else { #line 949 - if (s == 3) { + if (s == 3) { #line 949 - s = 4; + s = 4; #line 949 - lowerDriverReturn = (int )returnVal; - } else { - + lowerDriverReturn = (int)returnVal; + } else { + } } } - } #line 953 - return (returnVal); -} + return (returnVal); + } } #line 956 -void PoStartNextPowerIrp(PIRP Irp ) ; +void PoStartNextPowerIrp(PIRP Irp); #line 956 "../slam-kernel.c" -void PoStartNextPowerIrp(PIRP Irp ) -{ +void PoStartNextPowerIrp(PIRP Irp) { { #line 960 - return; -} + return; + } } #line 965 -NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); #line 965 "../slam-kernel.c" -NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , ULONG DesiredAccess , POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , PCLIENT_ID ClientId , void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 979 - if (__BLAST_NONDET == 0) { - goto switch_207_0; - } else { - { - goto switch_207_default; + if (__BLAST_NONDET == 0) { + goto switch_207_0; + } else { + { + goto switch_207_default; #line 978 - if (0) { - switch_207_0: /* CIL Label */ ; + if (0) { + switch_207_0: /* CIL Label */; #line 979 - return (0L); - switch_207_default: /* CIL Label */ ; + return (0L); + switch_207_default: /* CIL Label */; #line 980 - return (-1073741823L); - } else { - switch_207_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_207_break: /* CIL Label */; + } + } } } } -} #line 984 -NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); #line 984 "../slam-kernel.c" -NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 992 - if (__BLAST_NONDET == 0) { - goto switch_208_0; - } else { - { - goto switch_208_default; + if (__BLAST_NONDET == 0) { + goto switch_208_0; + } else { + { + goto switch_208_default; #line 991 - if (0) { - switch_208_0: /* CIL Label */ ; + if (0) { + switch_208_0: /* CIL Label */; #line 992 - return (0L); - switch_208_default: /* CIL Label */ ; + return (0L); + switch_208_default: /* CIL Label */; #line 993 - return (-1073741823L); - } else { - switch_208_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_208_break: /* CIL Label */; + } + } } } } -} #line 998 -NTSTATUS ( __attribute__((__stdcall__)) RtlAnsiStringToUnicodeString)(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; +NTSTATUS(__attribute__((__stdcall__)) RtlAnsiStringToUnicodeString) +(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); #line 998 "../slam-kernel.c" -NTSTATUS ( __attribute__((__stdcall__)) RtlAnsiStringToUnicodeString)(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS(__attribute__((__stdcall__)) RtlAnsiStringToUnicodeString) +(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 1009 - if (__BLAST_NONDET == 0) { - goto switch_209_0; - } else { - { - goto switch_209_default; + if (__BLAST_NONDET == 0) { + goto switch_209_0; + } else { + { + goto switch_209_default; #line 1008 - if (0) { - switch_209_0: /* CIL Label */ ; + if (0) { + switch_209_0: /* CIL Label */; #line 1009 - return (0L); - switch_209_default: /* CIL Label */ ; + return (0L); + switch_209_default: /* CIL Label */; #line 1010 - return (-1073741823L); - } else { - switch_209_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_209_break: /* CIL Label */; + } + } } } } -} #line 1014 -SIZE_T ( __attribute__((__stdcall__)) RtlCompareMemory)(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; +SIZE_T(__attribute__((__stdcall__)) RtlCompareMemory) +(void const *Source1, void const *Source2, SIZE_T Length); #line 1014 "../slam-kernel.c" -SIZE_T ( __attribute__((__stdcall__)) RtlCompareMemory)(void const *Source1 , void const *Source2 , - SIZE_T Length ) -{ SIZE_T r ; +SIZE_T(__attribute__((__stdcall__)) RtlCompareMemory) +(void const *Source1, void const *Source2, SIZE_T Length) { + SIZE_T r; { #line 1024 - return (r); -} + return (r); + } } #line 1027 -void ( __attribute__((__stdcall__)) RtlCopyUnicodeString)(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; +void(__attribute__((__stdcall__)) + RtlCopyUnicodeString)(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); #line 1027 "../slam-kernel.c" -void ( __attribute__((__stdcall__)) RtlCopyUnicodeString)(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) -{ +void(__attribute__((__stdcall__)) + RtlCopyUnicodeString)(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString) { { #line 1032 - return; -} + return; + } } #line 1038 -NTSTATUS ( __attribute__((__stdcall__)) RtlDeleteRegistryValue)(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; +NTSTATUS(__attribute__((__stdcall__)) RtlDeleteRegistryValue) +(ULONG RelativeTo, PCWSTR Path, PCWSTR ValueName); #line 1038 "../slam-kernel.c" -NTSTATUS ( __attribute__((__stdcall__)) RtlDeleteRegistryValue)(ULONG RelativeTo , - PCWSTR Path , PCWSTR ValueName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS(__attribute__((__stdcall__)) RtlDeleteRegistryValue) +(ULONG RelativeTo, PCWSTR Path, PCWSTR ValueName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 1049 - if (__BLAST_NONDET == 0) { - goto switch_210_0; - } else { - { - goto switch_210_default; + if (__BLAST_NONDET == 0) { + goto switch_210_0; + } else { + { + goto switch_210_default; #line 1048 - if (0) { - switch_210_0: /* CIL Label */ ; + if (0) { + switch_210_0: /* CIL Label */; #line 1049 - return (0L); - switch_210_default: /* CIL Label */ ; + return (0L); + switch_210_default: /* CIL Label */; #line 1050 - return (-1073741823L); - } else { - switch_210_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_210_break: /* CIL Label */; + } + } } } } -} #line 1054 -void ( __attribute__((__stdcall__)) RtlFreeUnicodeString)(PUNICODE_STRING UnicodeString ) ; +void(__attribute__((__stdcall__)) + RtlFreeUnicodeString)(PUNICODE_STRING UnicodeString); #line 1054 "../slam-kernel.c" -void ( __attribute__((__stdcall__)) RtlFreeUnicodeString)(PUNICODE_STRING UnicodeString ) -{ +void(__attribute__((__stdcall__)) + RtlFreeUnicodeString)(PUNICODE_STRING UnicodeString) { { #line 1059 - return; -} + return; + } } #line 1064 -void ( __attribute__((__stdcall__)) RtlInitString)(PSTRING DestinationString , - PCSZ SourceString ) ; +void(__attribute__((__stdcall__)) RtlInitString)(PSTRING DestinationString, + PCSZ SourceString); #line 1064 "../slam-kernel.c" -void ( __attribute__((__stdcall__)) RtlInitString)(PSTRING DestinationString , PCSZ SourceString ) -{ +void(__attribute__((__stdcall__)) RtlInitString)(PSTRING DestinationString, + PCSZ SourceString) { { #line 1069 - return; -} + return; + } } #line 1075 -void ( __attribute__((__stdcall__)) RtlInitUnicodeString)(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; +void(__attribute__((__stdcall__)) + RtlInitUnicodeString)(PUNICODE_STRING DestinationString, + PCWSTR SourceString); #line 1075 "../slam-kernel.c" -void ( __attribute__((__stdcall__)) RtlInitUnicodeString)(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) -{ +void(__attribute__((__stdcall__)) + RtlInitUnicodeString)(PUNICODE_STRING DestinationString, + PCWSTR SourceString) { { #line 1080 - return; -} + return; + } } #line 1087 -NTSTATUS ( __attribute__((__stdcall__)) RtlQueryRegistryValues)(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; +NTSTATUS(__attribute__((__stdcall__)) RtlQueryRegistryValues) +(ULONG RelativeTo, PCWSTR Path, PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); #line 1087 "../slam-kernel.c" -NTSTATUS ( __attribute__((__stdcall__)) RtlQueryRegistryValues)(ULONG RelativeTo , - PCWSTR Path , PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , PVOID Environment ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS(__attribute__((__stdcall__)) RtlQueryRegistryValues) +(ULONG RelativeTo, PCWSTR Path, PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 1100 - if (__BLAST_NONDET == 0) { - goto switch_211_0; - } else { - { - goto switch_211_default; + if (__BLAST_NONDET == 0) { + goto switch_211_0; + } else { + { + goto switch_211_default; #line 1099 - if (0) { - switch_211_0: /* CIL Label */ ; + if (0) { + switch_211_0: /* CIL Label */; #line 1100 - return (0L); - switch_211_default: /* CIL Label */ ; + return (0L); + switch_211_default: /* CIL Label */; #line 1105 - return (-1073741823L); - } else { - switch_211_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_211_break: /* CIL Label */; + } + } } } } -} #line 1109 -NTSTATUS ( __attribute__((__stdcall__)) ZwClose)(HANDLE Handle ) ; +NTSTATUS(__attribute__((__stdcall__)) ZwClose)(HANDLE Handle); #line 1109 "../slam-kernel.c" -NTSTATUS ( __attribute__((__stdcall__)) ZwClose)(HANDLE Handle ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS(__attribute__((__stdcall__)) ZwClose)(HANDLE Handle) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { #line 1118 - if (__BLAST_NONDET == 0) { - goto switch_212_0; - } else { - { - goto switch_212_default; + if (__BLAST_NONDET == 0) { + goto switch_212_0; + } else { + { + goto switch_212_default; #line 1117 - if (0) { - switch_212_0: /* CIL Label */ ; + if (0) { + switch_212_0: /* CIL Label */; #line 1118 - return (0L); - switch_212_default: /* CIL Label */ ; + return (0L); + switch_212_default: /* CIL Label */; #line 1124 - return (-1073741823L); - } else { - switch_212_break: /* CIL Label */ ; - } + return (-1073741823L); + } else { + switch_212_break: /* CIL Label */; + } + } } } } -} diff --git a/test/ntdrivers/floppy_false.i.cil.c b/test/ntdrivers/floppy_false.i.cil.c index d5960fff6..f3b75b3c3 100644 --- a/test/ntdrivers/floppy_false.i.cil.c +++ b/test/ntdrivers/floppy_false.i.cil.c @@ -9,11 +9,11 @@ extern void *__VERIFIER_nondet_pointer(void); /* Generated by CIL v. 1.3.6 */ /* print_CIL_Input is true */ -#pragma pack(push,8) +#pragma pack(push, 8) typedef unsigned int size_t; typedef unsigned short wchar_t; #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) typedef unsigned long ULONG_PTR; typedef unsigned long *PULONG_PTR; @@ -24,7 +24,7 @@ typedef short SHORT; typedef long LONG; typedef wchar_t WCHAR; typedef WCHAR *PWSTR; -typedef WCHAR const *PCWSTR; +typedef WCHAR const *PCWSTR; typedef CHAR *PCHAR; typedef LONG *PLONG; typedef unsigned char UCHAR; @@ -40,77 +40,74 @@ typedef ULONG LCID; typedef LONG NTSTATUS; typedef long long LONGLONG; struct __anonstruct____missing_field_name_1 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; struct __anonstruct_u_2 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; union _LARGE_INTEGER { - struct __anonstruct____missing_field_name_1 __annonCompField1 ; - struct __anonstruct_u_2 u ; - LONGLONG QuadPart ; + struct __anonstruct____missing_field_name_1 __annonCompField1; + struct __anonstruct_u_2 u; + LONGLONG QuadPart; }; typedef union _LARGE_INTEGER LARGE_INTEGER; typedef LARGE_INTEGER *PLARGE_INTEGER; struct _LUID { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; typedef struct _LUID LUID; typedef LARGE_INTEGER PHYSICAL_ADDRESS; -enum _EVENT_TYPE { - NotificationEvent = 0, - SynchronizationEvent = 1 -} ; +enum _EVENT_TYPE { NotificationEvent = 0, SynchronizationEvent = 1 }; typedef enum _EVENT_TYPE EVENT_TYPE; -typedef char const *PCSZ; +typedef char const *PCSZ; struct _STRING { - USHORT Length ; - USHORT MaximumLength ; - PCHAR Buffer ; + USHORT Length; + USHORT MaximumLength; + PCHAR Buffer; }; typedef struct _STRING STRING; typedef STRING *PSTRING; typedef PSTRING PANSI_STRING; struct _UNICODE_STRING { - USHORT Length ; - USHORT MaximumLength ; - PWSTR Buffer ; + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; }; typedef struct _UNICODE_STRING UNICODE_STRING; typedef UNICODE_STRING *PUNICODE_STRING; typedef UCHAR BOOLEAN; struct _LIST_ENTRY { - struct _LIST_ENTRY *Flink ; - struct _LIST_ENTRY *Blink ; + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; }; typedef struct _LIST_ENTRY LIST_ENTRY; typedef struct _LIST_ENTRY *PLIST_ENTRY; struct _OBJECT_ATTRIBUTES { - ULONG Length ; - HANDLE RootDirectory ; - PUNICODE_STRING ObjectName ; - ULONG Attributes ; - PVOID SecurityDescriptor ; - PVOID SecurityQualityOfService ; + ULONG Length; + HANDLE RootDirectory; + PUNICODE_STRING ObjectName; + ULONG Attributes; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; }; typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES; typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; struct _GUID { - unsigned long Data1 ; - unsigned short Data2 ; - unsigned short Data3 ; - unsigned char Data4[8] ; + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; }; typedef struct _GUID GUID; typedef UCHAR KIRQL; enum _NT_PRODUCT_TYPE { - NtProductWinNt = 1, - NtProductLanManNt = 2, - NtProductServer = 3 -} ; + NtProductWinNt = 1, + NtProductLanManNt = 2, + NtProductServer = 3 +}; typedef enum _NT_PRODUCT_TYPE NT_PRODUCT_TYPE; struct _KTHREAD; typedef struct _KTHREAD *PKTHREAD; @@ -125,82 +122,85 @@ typedef struct _OBJECT_TYPE *POBJECT_TYPE; typedef CCHAR KPROCESSOR_MODE; struct _KAPC; struct _KAPC; -typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ); +typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); struct _KAPC { - CSHORT Type ; - CSHORT Size ; - ULONG Spare0 ; - struct _KTHREAD *Thread ; - LIST_ENTRY ApcListEntry ; - void (*KernelRoutine)(struct _KAPC *Apc , PKNORMAL_ROUTINE *NormalRoutine , PVOID *NormalContext , - PVOID *SystemArgument1 , PVOID *SystemArgument2 ) ; - void (*RundownRoutine)(struct _KAPC *Apc ) ; - void (*NormalRoutine)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ) ; - PVOID NormalContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - CCHAR ApcStateIndex ; - KPROCESSOR_MODE ApcMode ; - BOOLEAN Inserted ; + CSHORT Type; + CSHORT Size; + ULONG Spare0; + struct _KTHREAD *Thread; + LIST_ENTRY ApcListEntry; + void (*KernelRoutine)(struct _KAPC *Apc, PKNORMAL_ROUTINE *NormalRoutine, + PVOID *NormalContext, PVOID *SystemArgument1, + PVOID *SystemArgument2); + void (*RundownRoutine)(struct _KAPC *Apc); + void (*NormalRoutine)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); + PVOID NormalContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + CCHAR ApcStateIndex; + KPROCESSOR_MODE ApcMode; + BOOLEAN Inserted; }; typedef struct _KAPC KAPC; struct _KDPC; struct _KDPC; struct _KDPC { - CSHORT Type ; - UCHAR Number ; - UCHAR Importance ; - LIST_ENTRY DpcListEntry ; - void (*DeferredRoutine)(struct _KDPC *Dpc , PVOID DeferredContext , PVOID SystemArgument1 , - PVOID SystemArgument2 ) ; - PVOID DeferredContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - PULONG_PTR Lock ; + CSHORT Type; + UCHAR Number; + UCHAR Importance; + LIST_ENTRY DpcListEntry; + void (*DeferredRoutine)(struct _KDPC *Dpc, PVOID DeferredContext, + PVOID SystemArgument1, PVOID SystemArgument2); + PVOID DeferredContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + PULONG_PTR Lock; }; typedef struct _KDPC KDPC; typedef struct _KDPC *PKDPC; struct _MDL { - struct _MDL *Next ; - CSHORT Size ; - CSHORT MdlFlags ; - struct _EPROCESS *Process ; - PVOID MappedSystemVa ; - PVOID StartVa ; - ULONG ByteCount ; - ULONG ByteOffset ; + struct _MDL *Next; + CSHORT Size; + CSHORT MdlFlags; + struct _EPROCESS *Process; + PVOID MappedSystemVa; + PVOID StartVa; + ULONG ByteCount; + ULONG ByteOffset; }; typedef struct _MDL MDL; typedef struct _MDL *PMDL; typedef PVOID PACCESS_TOKEN; typedef PVOID PSECURITY_DESCRIPTOR; typedef ULONG ACCESS_MASK; -#pragma pack(push,4) +#pragma pack(push, 4) struct _LUID_AND_ATTRIBUTES { - LUID Luid ; - ULONG Attributes ; + LUID Luid; + ULONG Attributes; }; typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES; #pragma pack(pop) struct _PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[1] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[1]; }; typedef struct _PRIVILEGE_SET PRIVILEGE_SET; enum _SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous = 0, - SecurityIdentification = 1, - SecurityImpersonation = 2, - SecurityDelegation = 3 -} ; + SecurityAnonymous = 0, + SecurityIdentification = 1, + SecurityImpersonation = 2, + SecurityDelegation = 3 +}; typedef enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL; typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE; struct _SECURITY_QUALITY_OF_SERVICE { - ULONG Length ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode ; - BOOLEAN EffectiveOnly ; + ULONG Length; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; + BOOLEAN EffectiveOnly; }; typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE; typedef ULONG SECURITY_INFORMATION; @@ -208,635 +208,632 @@ typedef LONG KPRIORITY; typedef ULONG_PTR KSPIN_LOCK; typedef KSPIN_LOCK *PKSPIN_LOCK; struct _RTL_QUERY_REGISTRY_TABLE { - NTSTATUS (*QueryRoutine)(PWSTR ValueName , ULONG ValueType , - PVOID ValueData , ULONG ValueLength , - PVOID Context , PVOID EntryContext ) ; - ULONG Flags ; - PWSTR Name ; - PVOID EntryContext ; - ULONG DefaultType ; - PVOID DefaultData ; - ULONG DefaultLength ; + NTSTATUS(*QueryRoutine) + (PWSTR ValueName, ULONG ValueType, PVOID ValueData, ULONG ValueLength, + PVOID Context, PVOID EntryContext); + ULONG Flags; + PWSTR Name; + PVOID EntryContext; + ULONG DefaultType; + PVOID DefaultData; + ULONG DefaultLength; }; typedef struct _RTL_QUERY_REGISTRY_TABLE RTL_QUERY_REGISTRY_TABLE; typedef struct _RTL_QUERY_REGISTRY_TABLE *PRTL_QUERY_REGISTRY_TABLE; union __anonunion____missing_field_name_6 { - NTSTATUS Status ; - PVOID Pointer ; + NTSTATUS Status; + PVOID Pointer; }; struct _IO_STATUS_BLOCK { - union __anonunion____missing_field_name_6 __annonCompField4 ; - ULONG_PTR Information ; + union __anonunion____missing_field_name_6 __annonCompField4; + ULONG_PTR Information; }; typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK; typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK; enum _FILE_INFORMATION_CLASS { - FileDirectoryInformation = 1, - FileFullDirectoryInformation = 2, - FileBothDirectoryInformation = 3, - FileBasicInformation = 4, - FileStandardInformation = 5, - FileInternalInformation = 6, - FileEaInformation = 7, - FileAccessInformation = 8, - FileNameInformation = 9, - FileRenameInformation = 10, - FileLinkInformation = 11, - FileNamesInformation = 12, - FileDispositionInformation = 13, - FilePositionInformation = 14, - FileFullEaInformation = 15, - FileModeInformation = 16, - FileAlignmentInformation = 17, - FileAllInformation = 18, - FileAllocationInformation = 19, - FileEndOfFileInformation = 20, - FileAlternateNameInformation = 21, - FileStreamInformation = 22, - FilePipeInformation = 23, - FilePipeLocalInformation = 24, - FilePipeRemoteInformation = 25, - FileMailslotQueryInformation = 26, - FileMailslotSetInformation = 27, - FileCompressionInformation = 28, - FileObjectIdInformation = 29, - FileCompletionInformation = 30, - FileMoveClusterInformation = 31, - FileQuotaInformation = 32, - FileReparsePointInformation = 33, - FileNetworkOpenInformation = 34, - FileAttributeTagInformation = 35, - FileTrackingInformation = 36, - FileMaximumInformation = 37 -} ; + FileDirectoryInformation = 1, + FileFullDirectoryInformation = 2, + FileBothDirectoryInformation = 3, + FileBasicInformation = 4, + FileStandardInformation = 5, + FileInternalInformation = 6, + FileEaInformation = 7, + FileAccessInformation = 8, + FileNameInformation = 9, + FileRenameInformation = 10, + FileLinkInformation = 11, + FileNamesInformation = 12, + FileDispositionInformation = 13, + FilePositionInformation = 14, + FileFullEaInformation = 15, + FileModeInformation = 16, + FileAlignmentInformation = 17, + FileAllInformation = 18, + FileAllocationInformation = 19, + FileEndOfFileInformation = 20, + FileAlternateNameInformation = 21, + FileStreamInformation = 22, + FilePipeInformation = 23, + FilePipeLocalInformation = 24, + FilePipeRemoteInformation = 25, + FileMailslotQueryInformation = 26, + FileMailslotSetInformation = 27, + FileCompressionInformation = 28, + FileObjectIdInformation = 29, + FileCompletionInformation = 30, + FileMoveClusterInformation = 31, + FileQuotaInformation = 32, + FileReparsePointInformation = 33, + FileNetworkOpenInformation = 34, + FileAttributeTagInformation = 35, + FileTrackingInformation = 36, + FileMaximumInformation = 37 +}; typedef enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS; struct _FILE_BASIC_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + ULONG FileAttributes; }; typedef struct _FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION; struct _FILE_STANDARD_INFORMATION { - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG NumberOfLinks ; - BOOLEAN DeletePending ; - BOOLEAN Directory ; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG NumberOfLinks; + BOOLEAN DeletePending; + BOOLEAN Directory; }; typedef struct _FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION; struct _FILE_NETWORK_OPEN_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG FileAttributes; }; typedef struct _FILE_NETWORK_OPEN_INFORMATION *PFILE_NETWORK_OPEN_INFORMATION; enum _FSINFOCLASS { - FileFsVolumeInformation = 1, - FileFsLabelInformation = 2, - FileFsSizeInformation = 3, - FileFsDeviceInformation = 4, - FileFsAttributeInformation = 5, - FileFsControlInformation = 6, - FileFsFullSizeInformation = 7, - FileFsObjectIdInformation = 8, - FileFsMaximumInformation = 9 -} ; + FileFsVolumeInformation = 1, + FileFsLabelInformation = 2, + FileFsSizeInformation = 3, + FileFsDeviceInformation = 4, + FileFsAttributeInformation = 5, + FileFsControlInformation = 6, + FileFsFullSizeInformation = 7, + FileFsObjectIdInformation = 8, + FileFsMaximumInformation = 9 +}; typedef enum _FSINFOCLASS FS_INFORMATION_CLASS; enum _INTERFACE_TYPE { - InterfaceTypeUndefined = -1, - Internal = 0, - Isa = 1, - Eisa = 2, - MicroChannel = 3, - TurboChannel = 4, - PCIBus = 5, - VMEBus = 6, - NuBus = 7, - PCMCIABus = 8, - CBus = 9, - MPIBus = 10, - MPSABus = 11, - ProcessorInternal = 12, - InternalPowerBus = 13, - PNPISABus = 14, - PNPBus = 15, - MaximumInterfaceType = 16 -} ; + InterfaceTypeUndefined = -1, + Internal = 0, + Isa = 1, + Eisa = 2, + MicroChannel = 3, + TurboChannel = 4, + PCIBus = 5, + VMEBus = 6, + NuBus = 7, + PCMCIABus = 8, + CBus = 9, + MPIBus = 10, + MPSABus = 11, + ProcessorInternal = 12, + InternalPowerBus = 13, + PNPISABus = 14, + PNPBus = 15, + MaximumInterfaceType = 16 +}; typedef enum _INTERFACE_TYPE INTERFACE_TYPE; typedef enum _INTERFACE_TYPE *PINTERFACE_TYPE; struct _KEY_VALUE_FULL_INFORMATION { - ULONG TitleIndex ; - ULONG Type ; - ULONG DataOffset ; - ULONG DataLength ; - ULONG NameLength ; - WCHAR Name[1] ; + ULONG TitleIndex; + ULONG Type; + ULONG DataOffset; + ULONG DataLength; + ULONG NameLength; + WCHAR Name[1]; }; typedef struct _KEY_VALUE_FULL_INFORMATION *PKEY_VALUE_FULL_INFORMATION; struct _CLIENT_ID { - HANDLE UniqueProcess ; - HANDLE UniqueThread ; + HANDLE UniqueProcess; + HANDLE UniqueThread; }; typedef struct _CLIENT_ID CLIENT_ID; typedef CLIENT_ID *PCLIENT_ID; enum _SYSTEM_POWER_STATE { - PowerSystemUnspecified = 0, - PowerSystemWorking = 1, - PowerSystemSleeping1 = 2, - PowerSystemSleeping2 = 3, - PowerSystemSleeping3 = 4, - PowerSystemHibernate = 5, - PowerSystemShutdown = 6, - PowerSystemMaximum = 7 -} ; + PowerSystemUnspecified = 0, + PowerSystemWorking = 1, + PowerSystemSleeping1 = 2, + PowerSystemSleeping2 = 3, + PowerSystemSleeping3 = 4, + PowerSystemHibernate = 5, + PowerSystemShutdown = 6, + PowerSystemMaximum = 7 +}; typedef enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE; enum __anonenum_POWER_ACTION_11 { - PowerActionNone = 0, - PowerActionReserved = 1, - PowerActionSleep = 2, - PowerActionHibernate = 3, - PowerActionShutdown = 4, - PowerActionShutdownReset = 5, - PowerActionShutdownOff = 6, - PowerActionWarmEject = 7 -} ; + PowerActionNone = 0, + PowerActionReserved = 1, + PowerActionSleep = 2, + PowerActionHibernate = 3, + PowerActionShutdown = 4, + PowerActionShutdownReset = 5, + PowerActionShutdownOff = 6, + PowerActionWarmEject = 7 +}; typedef enum __anonenum_POWER_ACTION_11 POWER_ACTION; enum _DEVICE_POWER_STATE { - PowerDeviceUnspecified = 0, - PowerDeviceD0 = 1, - PowerDeviceD1 = 2, - PowerDeviceD2 = 3, - PowerDeviceD3 = 4, - PowerDeviceMaximum = 5 -} ; + PowerDeviceUnspecified = 0, + PowerDeviceD0 = 1, + PowerDeviceD1 = 2, + PowerDeviceD2 = 3, + PowerDeviceD3 = 4, + PowerDeviceMaximum = 5 +}; typedef enum _DEVICE_POWER_STATE DEVICE_POWER_STATE; union _POWER_STATE { - SYSTEM_POWER_STATE SystemState ; - DEVICE_POWER_STATE DeviceState ; + SYSTEM_POWER_STATE SystemState; + DEVICE_POWER_STATE DeviceState; }; typedef union _POWER_STATE POWER_STATE; -enum _POWER_STATE_TYPE { - SystemPowerState = 0, - DevicePowerState = 1 -} ; +enum _POWER_STATE_TYPE { SystemPowerState = 0, DevicePowerState = 1 }; typedef enum _POWER_STATE_TYPE POWER_STATE_TYPE; struct _KSYSTEM_TIME { - ULONG LowPart ; - LONG High1Time ; - LONG High2Time ; + ULONG LowPart; + LONG High1Time; + LONG High2Time; }; typedef struct _KSYSTEM_TIME KSYSTEM_TIME; enum _ALTERNATIVE_ARCHITECTURE_TYPE { - StandardDesign = 0, - NEC98x86 = 1, - EndAlternatives = 2 -} ; + StandardDesign = 0, + NEC98x86 = 1, + EndAlternatives = 2 +}; typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE ALTERNATIVE_ARCHITECTURE_TYPE; struct _KUSER_SHARED_DATA { - ULONG volatile TickCountLow ; - ULONG TickCountMultiplier ; - KSYSTEM_TIME volatile InterruptTime ; - KSYSTEM_TIME volatile SystemTime ; - KSYSTEM_TIME volatile TimeZoneBias ; - USHORT ImageNumberLow ; - USHORT ImageNumberHigh ; - WCHAR NtSystemRoot[260] ; - ULONG MaxStackTraceDepth ; - ULONG CryptoExponent ; - ULONG TimeZoneId ; - ULONG Reserved2[8] ; - NT_PRODUCT_TYPE NtProductType ; - BOOLEAN ProductTypeIsValid ; - ULONG NtMajorVersion ; - ULONG NtMinorVersion ; - BOOLEAN ProcessorFeatures[64] ; - ULONG Reserved1 ; - ULONG Reserved3 ; - ULONG volatile TimeSlip ; - ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture ; - LARGE_INTEGER SystemExpirationDate ; - ULONG SuiteMask ; - BOOLEAN KdDebuggerEnabled ; + ULONG volatile TickCountLow; + ULONG TickCountMultiplier; + KSYSTEM_TIME volatile InterruptTime; + KSYSTEM_TIME volatile SystemTime; + KSYSTEM_TIME volatile TimeZoneBias; + USHORT ImageNumberLow; + USHORT ImageNumberHigh; + WCHAR NtSystemRoot[260]; + ULONG MaxStackTraceDepth; + ULONG CryptoExponent; + ULONG TimeZoneId; + ULONG Reserved2[8]; + NT_PRODUCT_TYPE NtProductType; + BOOLEAN ProductTypeIsValid; + ULONG NtMajorVersion; + ULONG NtMinorVersion; + BOOLEAN ProcessorFeatures[64]; + ULONG Reserved1; + ULONG Reserved3; + ULONG volatile TimeSlip; + ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture; + LARGE_INTEGER SystemExpirationDate; + ULONG SuiteMask; + BOOLEAN KdDebuggerEnabled; }; typedef struct _KUSER_SHARED_DATA KUSER_SHARED_DATA; typedef PVOID PASSIGNED_RESOURCE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Generic_16 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Port_17 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Interrupt_18 { - ULONG Level ; - ULONG Vector ; - ULONG Affinity ; + ULONG Level; + ULONG Vector; + ULONG Affinity; }; struct __anonstruct_Memory_19 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Dma_20 { - ULONG Channel ; - ULONG Port ; - ULONG Reserved1 ; + ULONG Channel; + ULONG Port; + ULONG Reserved1; }; struct __anonstruct_DevicePrivate_21 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_22 { - ULONG Start ; - ULONG Length ; - ULONG Reserved ; + ULONG Start; + ULONG Length; + ULONG Reserved; }; struct __anonstruct_DeviceSpecificData_23 { - ULONG DataSize ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG DataSize; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_15 { - struct __anonstruct_Generic_16 Generic ; - struct __anonstruct_Port_17 Port ; - struct __anonstruct_Interrupt_18 Interrupt ; - struct __anonstruct_Memory_19 Memory ; - struct __anonstruct_Dma_20 Dma ; - struct __anonstruct_DevicePrivate_21 DevicePrivate ; - struct __anonstruct_BusNumber_22 BusNumber ; - struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData ; + struct __anonstruct_Generic_16 Generic; + struct __anonstruct_Port_17 Port; + struct __anonstruct_Interrupt_18 Interrupt; + struct __anonstruct_Memory_19 Memory; + struct __anonstruct_Dma_20 Dma; + struct __anonstruct_DevicePrivate_21 DevicePrivate; + struct __anonstruct_BusNumber_22 BusNumber; + struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData; }; struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { - UCHAR Type ; - UCHAR ShareDisposition ; - USHORT Flags ; - union __anonunion_u_15 u ; + UCHAR Type; + UCHAR ShareDisposition; + USHORT Flags; + union __anonunion_u_15 u; }; typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR; typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR *PCM_PARTIAL_RESOURCE_DESCRIPTOR; #pragma pack(pop) struct _CM_PARTIAL_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; }; typedef struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST; struct _CM_FULL_RESOURCE_DESCRIPTOR { - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - CM_PARTIAL_RESOURCE_LIST PartialResourceList ; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; }; typedef struct _CM_FULL_RESOURCE_DESCRIPTOR CM_FULL_RESOURCE_DESCRIPTOR; typedef struct _CM_FULL_RESOURCE_DESCRIPTOR *PCM_FULL_RESOURCE_DESCRIPTOR; struct _CM_RESOURCE_LIST { - ULONG Count ; - CM_FULL_RESOURCE_DESCRIPTOR List[1] ; + ULONG Count; + CM_FULL_RESOURCE_DESCRIPTOR List[1]; }; typedef struct _CM_RESOURCE_LIST *PCM_RESOURCE_LIST; -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _CM_FLOPPY_DEVICE_DATA { - USHORT Version ; - USHORT Revision ; - CHAR Size[8] ; - ULONG MaxDensity ; - ULONG MountDensity ; - UCHAR StepRateHeadUnloadTime ; - UCHAR HeadLoadTime ; - UCHAR MotorOffTime ; - UCHAR SectorLengthCode ; - UCHAR SectorPerTrack ; - UCHAR ReadWriteGapLength ; - UCHAR DataTransferLength ; - UCHAR FormatGapLength ; - UCHAR FormatFillCharacter ; - UCHAR HeadSettleTime ; - UCHAR MotorSettleTime ; - UCHAR MaximumTrackValue ; - UCHAR DataTransferRate ; + USHORT Version; + USHORT Revision; + CHAR Size[8]; + ULONG MaxDensity; + ULONG MountDensity; + UCHAR StepRateHeadUnloadTime; + UCHAR HeadLoadTime; + UCHAR MotorOffTime; + UCHAR SectorLengthCode; + UCHAR SectorPerTrack; + UCHAR ReadWriteGapLength; + UCHAR DataTransferLength; + UCHAR FormatGapLength; + UCHAR FormatFillCharacter; + UCHAR HeadSettleTime; + UCHAR MotorSettleTime; + UCHAR MaximumTrackValue; + UCHAR DataTransferRate; }; typedef struct _CM_FLOPPY_DEVICE_DATA *PCM_FLOPPY_DEVICE_DATA; struct __anonstruct_Port_25 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Memory_26 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Interrupt_27 { - ULONG MinimumVector ; - ULONG MaximumVector ; + ULONG MinimumVector; + ULONG MaximumVector; }; struct __anonstruct_Dma_28 { - ULONG MinimumChannel ; - ULONG MaximumChannel ; + ULONG MinimumChannel; + ULONG MaximumChannel; }; struct __anonstruct_Generic_29 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_DevicePrivate_30 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_31 { - ULONG Length ; - ULONG MinBusNumber ; - ULONG MaxBusNumber ; - ULONG Reserved ; + ULONG Length; + ULONG MinBusNumber; + ULONG MaxBusNumber; + ULONG Reserved; }; struct __anonstruct_AssignedResource_32 { - PASSIGNED_RESOURCE AssignedResource ; + PASSIGNED_RESOURCE AssignedResource; }; struct __anonstruct_SubAllocateFrom_33 { - UCHAR Type ; - UCHAR Reserved[3] ; - PASSIGNED_RESOURCE AssignedResource ; - PHYSICAL_ADDRESS Transformation ; + UCHAR Type; + UCHAR Reserved[3]; + PASSIGNED_RESOURCE AssignedResource; + PHYSICAL_ADDRESS Transformation; }; struct __anonstruct_ConfigData_34 { - ULONG Priority ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG Priority; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_24 { - struct __anonstruct_Port_25 Port ; - struct __anonstruct_Memory_26 Memory ; - struct __anonstruct_Interrupt_27 Interrupt ; - struct __anonstruct_Dma_28 Dma ; - struct __anonstruct_Generic_29 Generic ; - struct __anonstruct_DevicePrivate_30 DevicePrivate ; - struct __anonstruct_BusNumber_31 BusNumber ; - struct __anonstruct_AssignedResource_32 AssignedResource ; - struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom ; - struct __anonstruct_ConfigData_34 ConfigData ; + struct __anonstruct_Port_25 Port; + struct __anonstruct_Memory_26 Memory; + struct __anonstruct_Interrupt_27 Interrupt; + struct __anonstruct_Dma_28 Dma; + struct __anonstruct_Generic_29 Generic; + struct __anonstruct_DevicePrivate_30 DevicePrivate; + struct __anonstruct_BusNumber_31 BusNumber; + struct __anonstruct_AssignedResource_32 AssignedResource; + struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom; + struct __anonstruct_ConfigData_34 ConfigData; }; struct _IO_RESOURCE_DESCRIPTOR { - UCHAR Option ; - UCHAR Type ; - UCHAR ShareDisposition ; - UCHAR Spare1 ; - USHORT Flags ; - USHORT Spare2 ; - union __anonunion_u_24 u ; + UCHAR Option; + UCHAR Type; + UCHAR ShareDisposition; + UCHAR Spare1; + USHORT Flags; + USHORT Spare2; + union __anonunion_u_24 u; }; typedef struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR; struct _IO_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - IO_RESOURCE_DESCRIPTOR Descriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + IO_RESOURCE_DESCRIPTOR Descriptors[1]; }; typedef struct _IO_RESOURCE_LIST IO_RESOURCE_LIST; struct _IO_RESOURCE_REQUIREMENTS_LIST { - ULONG ListSize ; - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - ULONG SlotNumber ; - ULONG Reserved[3] ; - ULONG AlternativeLists ; - IO_RESOURCE_LIST List[1] ; + ULONG ListSize; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + ULONG SlotNumber; + ULONG Reserved[3]; + ULONG AlternativeLists; + IO_RESOURCE_LIST List[1]; }; typedef struct _IO_RESOURCE_REQUIREMENTS_LIST *PIO_RESOURCE_REQUIREMENTS_LIST; enum _CONFIGURATION_TYPE { - ArcSystem = 0, - CentralProcessor = 1, - FloatingPointProcessor = 2, - PrimaryIcache = 3, - PrimaryDcache = 4, - SecondaryIcache = 5, - SecondaryDcache = 6, - SecondaryCache = 7, - EisaAdapter = 8, - TcAdapter = 9, - ScsiAdapter = 10, - DtiAdapter = 11, - MultiFunctionAdapter = 12, - DiskController = 13, - TapeController = 14, - CdromController = 15, - WormController = 16, - SerialController = 17, - NetworkController = 18, - DisplayController = 19, - ParallelController = 20, - PointerController = 21, - KeyboardController = 22, - AudioController = 23, - OtherController = 24, - DiskPeripheral = 25, - FloppyDiskPeripheral = 26, - TapePeripheral = 27, - ModemPeripheral = 28, - MonitorPeripheral = 29, - PrinterPeripheral = 30, - PointerPeripheral = 31, - KeyboardPeripheral = 32, - TerminalPeripheral = 33, - OtherPeripheral = 34, - LinePeripheral = 35, - NetworkPeripheral = 36, - SystemMemory = 37, - DockingInformation = 38, - RealModeIrqRoutingTable = 39, - MaximumType = 40 -} ; + ArcSystem = 0, + CentralProcessor = 1, + FloatingPointProcessor = 2, + PrimaryIcache = 3, + PrimaryDcache = 4, + SecondaryIcache = 5, + SecondaryDcache = 6, + SecondaryCache = 7, + EisaAdapter = 8, + TcAdapter = 9, + ScsiAdapter = 10, + DtiAdapter = 11, + MultiFunctionAdapter = 12, + DiskController = 13, + TapeController = 14, + CdromController = 15, + WormController = 16, + SerialController = 17, + NetworkController = 18, + DisplayController = 19, + ParallelController = 20, + PointerController = 21, + KeyboardController = 22, + AudioController = 23, + OtherController = 24, + DiskPeripheral = 25, + FloppyDiskPeripheral = 26, + TapePeripheral = 27, + ModemPeripheral = 28, + MonitorPeripheral = 29, + PrinterPeripheral = 30, + PointerPeripheral = 31, + KeyboardPeripheral = 32, + TerminalPeripheral = 33, + OtherPeripheral = 34, + LinePeripheral = 35, + NetworkPeripheral = 36, + SystemMemory = 37, + DockingInformation = 38, + RealModeIrqRoutingTable = 39, + MaximumType = 40 +}; typedef enum _CONFIGURATION_TYPE CONFIGURATION_TYPE; typedef enum _CONFIGURATION_TYPE *PCONFIGURATION_TYPE; enum _KWAIT_REASON { - Executive = 0, - FreePage = 1, - PageIn = 2, - PoolAllocation = 3, - DelayExecution = 4, - Suspended = 5, - UserRequest = 6, - WrExecutive = 7, - WrFreePage = 8, - WrPageIn = 9, - WrPoolAllocation = 10, - WrDelayExecution = 11, - WrSuspended = 12, - WrUserRequest = 13, - WrEventPair = 14, - WrQueue = 15, - WrLpcReceive = 16, - WrLpcReply = 17, - WrVirtualMemory = 18, - WrPageOut = 19, - WrRendezvous = 20, - Spare2 = 21, - Spare3 = 22, - Spare4 = 23, - Spare5 = 24, - Spare6 = 25, - WrKernel = 26, - MaximumWaitReason = 27 -} ; + Executive = 0, + FreePage = 1, + PageIn = 2, + PoolAllocation = 3, + DelayExecution = 4, + Suspended = 5, + UserRequest = 6, + WrExecutive = 7, + WrFreePage = 8, + WrPageIn = 9, + WrPoolAllocation = 10, + WrDelayExecution = 11, + WrSuspended = 12, + WrUserRequest = 13, + WrEventPair = 14, + WrQueue = 15, + WrLpcReceive = 16, + WrLpcReply = 17, + WrVirtualMemory = 18, + WrPageOut = 19, + WrRendezvous = 20, + Spare2 = 21, + Spare3 = 22, + Spare4 = 23, + Spare5 = 24, + Spare6 = 25, + WrKernel = 26, + MaximumWaitReason = 27 +}; typedef enum _KWAIT_REASON KWAIT_REASON; struct _DISPATCHER_HEADER { - UCHAR Type ; - UCHAR Absolute ; - UCHAR Size ; - UCHAR Inserted ; - LONG SignalState ; - LIST_ENTRY WaitListHead ; + UCHAR Type; + UCHAR Absolute; + UCHAR Size; + UCHAR Inserted; + LONG SignalState; + LIST_ENTRY WaitListHead; }; typedef struct _DISPATCHER_HEADER DISPATCHER_HEADER; struct _KDEVICE_QUEUE { - CSHORT Type ; - CSHORT Size ; - LIST_ENTRY DeviceListHead ; - KSPIN_LOCK Lock ; - BOOLEAN Busy ; + CSHORT Type; + CSHORT Size; + LIST_ENTRY DeviceListHead; + KSPIN_LOCK Lock; + BOOLEAN Busy; }; typedef struct _KDEVICE_QUEUE KDEVICE_QUEUE; struct _KDEVICE_QUEUE_ENTRY { - LIST_ENTRY DeviceListEntry ; - ULONG SortKey ; - BOOLEAN Inserted ; + LIST_ENTRY DeviceListEntry; + ULONG SortKey; + BOOLEAN Inserted; }; typedef struct _KDEVICE_QUEUE_ENTRY KDEVICE_QUEUE_ENTRY; struct _KEVENT { - DISPATCHER_HEADER Header ; + DISPATCHER_HEADER Header; }; typedef struct _KEVENT KEVENT; typedef struct _KEVENT *PKEVENT; typedef struct _KEVENT *PRKEVENT; struct _KSEMAPHORE { - DISPATCHER_HEADER Header ; - LONG Limit ; + DISPATCHER_HEADER Header; + LONG Limit; }; typedef struct _KSEMAPHORE KSEMAPHORE; typedef struct _KSEMAPHORE *PKSEMAPHORE; typedef struct _KSEMAPHORE *PRKSEMAPHORE; enum _MEMORY_CACHING_TYPE { - MmNonCached = 0, - MmCached = 1, - MmWriteCombined = 2, - MmHardwareCoherentCached = 3, - MmNonCachedUnordered = 4, - MmUSWCCached = 5, - MmMaximumCacheType = 6 -} ; + MmNonCached = 0, + MmCached = 1, + MmWriteCombined = 2, + MmHardwareCoherentCached = 3, + MmNonCachedUnordered = 4, + MmUSWCCached = 5, + MmMaximumCacheType = 6 +}; typedef enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE; enum _POOL_TYPE { - NonPagedPool = 0, - PagedPool = 1, - NonPagedPoolMustSucceed = 2, - DontUseThisType = 3, - NonPagedPoolCacheAligned = 4, - PagedPoolCacheAligned = 5, - NonPagedPoolCacheAlignedMustS = 6, - MaxPoolType = 7, - NonPagedPoolSession = 32, - PagedPoolSession = 33, - NonPagedPoolMustSucceedSession = 34, - DontUseThisTypeSession = 35, - NonPagedPoolCacheAlignedSession = 36, - PagedPoolCacheAlignedSession = 37, - NonPagedPoolCacheAlignedMustSSession = 38 -} ; + NonPagedPool = 0, + PagedPool = 1, + NonPagedPoolMustSucceed = 2, + DontUseThisType = 3, + NonPagedPoolCacheAligned = 4, + PagedPoolCacheAligned = 5, + NonPagedPoolCacheAlignedMustS = 6, + MaxPoolType = 7, + NonPagedPoolSession = 32, + PagedPoolSession = 33, + NonPagedPoolMustSucceedSession = 34, + DontUseThisTypeSession = 35, + NonPagedPoolCacheAlignedSession = 36, + PagedPoolCacheAlignedSession = 37, + NonPagedPoolCacheAlignedMustSSession = 38 +}; typedef enum _POOL_TYPE POOL_TYPE; struct _FAST_MUTEX { - LONG Count ; - PKTHREAD Owner ; - ULONG Contention ; - KEVENT Event ; - ULONG OldIrql ; + LONG Count; + PKTHREAD Owner; + ULONG Contention; + KEVENT Event; + ULONG OldIrql; }; typedef struct _FAST_MUTEX FAST_MUTEX; typedef struct _FAST_MUTEX *PFAST_MUTEX; typedef ULONG_PTR ERESOURCE_THREAD; union __anonunion____missing_field_name_38 { - LONG OwnerCount ; - ULONG TableSize ; + LONG OwnerCount; + ULONG TableSize; }; struct _OWNER_ENTRY { - ERESOURCE_THREAD OwnerThread ; - union __anonunion____missing_field_name_38 __annonCompField10 ; + ERESOURCE_THREAD OwnerThread; + union __anonunion____missing_field_name_38 __annonCompField10; }; typedef struct _OWNER_ENTRY OWNER_ENTRY; typedef struct _OWNER_ENTRY *POWNER_ENTRY; union __anonunion____missing_field_name_39 { - PVOID Address ; - ULONG_PTR CreatorBackTraceIndex ; + PVOID Address; + ULONG_PTR CreatorBackTraceIndex; }; struct _ERESOURCE { - LIST_ENTRY SystemResourcesList ; - POWNER_ENTRY OwnerTable ; - SHORT ActiveCount ; - USHORT Flag ; - PKSEMAPHORE SharedWaiters ; - PKEVENT ExclusiveWaiters ; - OWNER_ENTRY OwnerThreads[2] ; - ULONG ContentionCount ; - USHORT NumberOfSharedWaiters ; - USHORT NumberOfExclusiveWaiters ; - union __anonunion____missing_field_name_39 __annonCompField11 ; - KSPIN_LOCK SpinLock ; + LIST_ENTRY SystemResourcesList; + POWNER_ENTRY OwnerTable; + SHORT ActiveCount; + USHORT Flag; + PKSEMAPHORE SharedWaiters; + PKEVENT ExclusiveWaiters; + OWNER_ENTRY OwnerThreads[2]; + ULONG ContentionCount; + USHORT NumberOfSharedWaiters; + USHORT NumberOfExclusiveWaiters; + union __anonunion____missing_field_name_39 __annonCompField11; + KSPIN_LOCK SpinLock; }; enum _LOCK_OPERATION { - IoReadAccess = 0, - IoWriteAccess = 1, - IoModifyAccess = 2 -} ; + IoReadAccess = 0, + IoWriteAccess = 1, + IoModifyAccess = 2 +}; typedef enum _LOCK_OPERATION LOCK_OPERATION; enum _MM_PAGE_PRIORITY { - LowPagePriority = 0, - NormalPagePriority = 16, - HighPagePriority = 32 -} ; + LowPagePriority = 0, + NormalPagePriority = 16, + HighPagePriority = 32 +}; typedef enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY; struct _DRIVER_OBJECT; struct _DRIVER_OBJECT; struct _SECURITY_SUBJECT_CONTEXT { - PACCESS_TOKEN ClientToken ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - PACCESS_TOKEN PrimaryToken ; - PVOID ProcessAuditId ; + PACCESS_TOKEN ClientToken; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + PACCESS_TOKEN PrimaryToken; + PVOID ProcessAuditId; }; typedef struct _SECURITY_SUBJECT_CONTEXT SECURITY_SUBJECT_CONTEXT; struct _INITIAL_PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[3] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[3]; }; typedef struct _INITIAL_PRIVILEGE_SET INITIAL_PRIVILEGE_SET; union __anonunion_Privileges_40 { - INITIAL_PRIVILEGE_SET InitialPrivilegeSet ; - PRIVILEGE_SET PrivilegeSet ; + INITIAL_PRIVILEGE_SET InitialPrivilegeSet; + PRIVILEGE_SET PrivilegeSet; }; struct _ACCESS_STATE { - LUID OperationID ; - BOOLEAN SecurityEvaluated ; - BOOLEAN GenerateAudit ; - BOOLEAN GenerateOnClose ; - BOOLEAN PrivilegesAllocated ; - ULONG Flags ; - ACCESS_MASK RemainingDesiredAccess ; - ACCESS_MASK PreviouslyGrantedAccess ; - ACCESS_MASK OriginalDesiredAccess ; - SECURITY_SUBJECT_CONTEXT SubjectSecurityContext ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - PVOID AuxData ; - union __anonunion_Privileges_40 Privileges ; - BOOLEAN AuditPrivileges ; - UNICODE_STRING ObjectName ; - UNICODE_STRING ObjectTypeName ; + LUID OperationID; + BOOLEAN SecurityEvaluated; + BOOLEAN GenerateAudit; + BOOLEAN GenerateOnClose; + BOOLEAN PrivilegesAllocated; + ULONG Flags; + ACCESS_MASK RemainingDesiredAccess; + ACCESS_MASK PreviouslyGrantedAccess; + ACCESS_MASK OriginalDesiredAccess; + SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PVOID AuxData; + union __anonunion_Privileges_40 Privileges; + BOOLEAN AuditPrivileges; + UNICODE_STRING ObjectName; + UNICODE_STRING ObjectTypeName; }; typedef struct _ACCESS_STATE *PACCESS_STATE; struct _DEVICE_OBJECT; @@ -848,876 +845,907 @@ struct _IRP; struct _IRP; struct _SCSI_REQUEST_BLOCK; struct _SCSI_REQUEST_BLOCK; -typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ); +typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp); struct _COMPRESSED_DATA_INFO; struct _FAST_IO_DISPATCH { - ULONG SizeOfFastIoDispatch ; - BOOLEAN (*FastIoCheckIfPossible)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , - BOOLEAN CheckForReadOperation , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryBasicInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_BASIC_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryStandardInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_STANDARD_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoLock)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - BOOLEAN FailImmediately , BOOLEAN ExclusiveLock , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockSingle)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAll)(struct _FILE_OBJECT *FileObject , PEPROCESS ProcessId , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAllByKey)(struct _FILE_OBJECT *FileObject , PVOID ProcessId , - ULONG Key , PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoDeviceControl)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , ULONG IoControlCode , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice , struct _DEVICE_OBJECT *TargetDevice ) ; - BOOLEAN (*FastIoQueryNetworkOpenInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - struct _FILE_NETWORK_OPEN_INFORMATION *Buffer , - struct _IO_STATUS_BLOCK *IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForModWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER EndingOffset , - struct _ERESOURCE **ResourceToRelease , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadComplete)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*PrepareMdlWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteComplete)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoReadCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , PMDL *MdlChain , - PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWriteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , - PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadCompleteCompressed)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteCompleteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryOpen)(struct _IRP *Irp , PFILE_NETWORK_OPEN_INFORMATION NetworkInformation , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForModWrite)(struct _FILE_OBJECT *FileObject , struct _ERESOURCE *ResourceToRelease , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; + ULONG SizeOfFastIoDispatch; + BOOLEAN(*FastIoCheckIfPossible) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, BOOLEAN CheckForReadOperation, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryBasicInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_BASIC_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryStandardInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_STANDARD_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoLock) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + BOOLEAN FailImmediately, BOOLEAN ExclusiveLock, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockSingle) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAll) + (struct _FILE_OBJECT *FileObject, PEPROCESS ProcessId, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAllByKey) + (struct _FILE_OBJECT *FileObject, PVOID ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoDeviceControl) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, PVOID InputBuffer, + ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength, + ULONG IoControlCode, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice, + struct _DEVICE_OBJECT *TargetDevice); + BOOLEAN(*FastIoQueryNetworkOpenInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + struct _FILE_NETWORK_OPEN_INFORMATION *Buffer, + struct _IO_STATUS_BLOCK *IoStatus, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForModWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER EndingOffset, + struct _ERESOURCE **ResourceToRelease, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadComplete) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*PrepareMdlWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteComplete) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoReadCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWriteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryOpen) + (struct _IRP *Irp, PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForModWrite) + (struct _FILE_OBJECT *FileObject, struct _ERESOURCE *ResourceToRelease, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); }; typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH; enum _IO_ALLOCATION_ACTION { - KeepObject = 1, - DeallocateObject = 2, - DeallocateObjectKeepRegisters = 3 -} ; + KeepObject = 1, + DeallocateObject = 2, + DeallocateObjectKeepRegisters = 3 +}; typedef enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION; struct _IO_SECURITY_CONTEXT { - PSECURITY_QUALITY_OF_SERVICE SecurityQos ; - PACCESS_STATE AccessState ; - ACCESS_MASK DesiredAccess ; - ULONG FullCreateOptions ; + PSECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_STATE AccessState; + ACCESS_MASK DesiredAccess; + ULONG FullCreateOptions; }; typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT; struct _VPB { - CSHORT Type ; - CSHORT Size ; - USHORT Flags ; - USHORT VolumeLabelLength ; - struct _DEVICE_OBJECT *DeviceObject ; - struct _DEVICE_OBJECT *RealDevice ; - ULONG SerialNumber ; - ULONG ReferenceCount ; - WCHAR VolumeLabel[(32U * sizeof(WCHAR )) / sizeof(WCHAR )] ; + CSHORT Type; + CSHORT Size; + USHORT Flags; + USHORT VolumeLabelLength; + struct _DEVICE_OBJECT *DeviceObject; + struct _DEVICE_OBJECT *RealDevice; + ULONG SerialNumber; + ULONG ReferenceCount; + WCHAR VolumeLabel[(32U * sizeof(WCHAR)) / sizeof(WCHAR)]; }; typedef struct _VPB *PVPB; struct _WAIT_CONTEXT_BLOCK { - KDEVICE_QUEUE_ENTRY WaitQueueEntry ; - IO_ALLOCATION_ACTION (*DeviceRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp , - PVOID MapRegisterBase , PVOID Context ) ; - PVOID DeviceContext ; - ULONG NumberOfMapRegisters ; - PVOID DeviceObject ; - PVOID CurrentIrp ; - PKDPC BufferChainingDpc ; + KDEVICE_QUEUE_ENTRY WaitQueueEntry; + IO_ALLOCATION_ACTION(*DeviceRoutine) + (struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp, PVOID MapRegisterBase, + PVOID Context); + PVOID DeviceContext; + ULONG NumberOfMapRegisters; + PVOID DeviceObject; + PVOID CurrentIrp; + PKDPC BufferChainingDpc; }; typedef struct _WAIT_CONTEXT_BLOCK WAIT_CONTEXT_BLOCK; union __anonunion_Queue_43 { - LIST_ENTRY ListEntry ; - WAIT_CONTEXT_BLOCK Wcb ; + LIST_ENTRY ListEntry; + WAIT_CONTEXT_BLOCK Wcb; }; struct _DEVOBJ_EXTENSION; struct _DEVICE_OBJECT { - CSHORT Type ; - USHORT Size ; - LONG ReferenceCount ; - struct _DRIVER_OBJECT *DriverObject ; - struct _DEVICE_OBJECT *NextDevice ; - struct _DEVICE_OBJECT *AttachedDevice ; - struct _IRP *CurrentIrp ; - PIO_TIMER Timer ; - ULONG Flags ; - ULONG Characteristics ; - PVPB Vpb ; - PVOID DeviceExtension ; - ULONG DeviceType ; - CCHAR StackSize ; - union __anonunion_Queue_43 Queue ; - ULONG AlignmentRequirement ; - KDEVICE_QUEUE DeviceQueue ; - KDPC Dpc ; - ULONG ActiveThreadCount ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - KEVENT DeviceLock ; - USHORT SectorSize ; - USHORT Spare1 ; - struct _DEVOBJ_EXTENSION *DeviceObjectExtension ; - PVOID Reserved ; + CSHORT Type; + USHORT Size; + LONG ReferenceCount; + struct _DRIVER_OBJECT *DriverObject; + struct _DEVICE_OBJECT *NextDevice; + struct _DEVICE_OBJECT *AttachedDevice; + struct _IRP *CurrentIrp; + PIO_TIMER Timer; + ULONG Flags; + ULONG Characteristics; + PVPB Vpb; + PVOID DeviceExtension; + ULONG DeviceType; + CCHAR StackSize; + union __anonunion_Queue_43 Queue; + ULONG AlignmentRequirement; + KDEVICE_QUEUE DeviceQueue; + KDPC Dpc; + ULONG ActiveThreadCount; + PSECURITY_DESCRIPTOR SecurityDescriptor; + KEVENT DeviceLock; + USHORT SectorSize; + USHORT Spare1; + struct _DEVOBJ_EXTENSION *DeviceObjectExtension; + PVOID Reserved; }; typedef struct _DEVICE_OBJECT DEVICE_OBJECT; typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; struct _DEVOBJ_EXTENSION { - CSHORT Type ; - USHORT Size ; - PDEVICE_OBJECT DeviceObject ; + CSHORT Type; + USHORT Size; + PDEVICE_OBJECT DeviceObject; }; struct _DRIVER_EXTENSION { - struct _DRIVER_OBJECT *DriverObject ; - NTSTATUS (*AddDevice)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ; - ULONG Count ; - UNICODE_STRING ServiceKeyName ; + struct _DRIVER_OBJECT *DriverObject; + NTSTATUS(*AddDevice) + (struct _DRIVER_OBJECT *DriverObject, + struct _DEVICE_OBJECT *PhysicalDeviceObject); + ULONG Count; + UNICODE_STRING ServiceKeyName; }; typedef struct _DRIVER_EXTENSION *PDRIVER_EXTENSION; struct _DRIVER_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - ULONG Flags ; - PVOID DriverStart ; - ULONG DriverSize ; - PVOID DriverSection ; - PDRIVER_EXTENSION DriverExtension ; - UNICODE_STRING DriverName ; - PUNICODE_STRING HardwareDatabase ; - PFAST_IO_DISPATCH FastIoDispatch ; - NTSTATUS (*DriverInit)(struct _DRIVER_OBJECT *DriverObject , PUNICODE_STRING RegistryPath ) ; - void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject ) ; - PDRIVER_DISPATCH MajorFunction[28] ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + PVOID DriverStart; + ULONG DriverSize; + PVOID DriverSection; + PDRIVER_EXTENSION DriverExtension; + UNICODE_STRING DriverName; + PUNICODE_STRING HardwareDatabase; + PFAST_IO_DISPATCH FastIoDispatch; + NTSTATUS(*DriverInit) + (struct _DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath); + void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject); + PDRIVER_DISPATCH MajorFunction[28]; }; typedef struct _DRIVER_OBJECT DRIVER_OBJECT; typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; struct _SECTION_OBJECT_POINTERS { - PVOID DataSectionObject ; - PVOID SharedCacheMap ; - PVOID ImageSectionObject ; + PVOID DataSectionObject; + PVOID SharedCacheMap; + PVOID ImageSectionObject; }; typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS; typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS; struct _IO_COMPLETION_CONTEXT { - PVOID Port ; - PVOID Key ; + PVOID Port; + PVOID Key; }; typedef struct _IO_COMPLETION_CONTEXT *PIO_COMPLETION_CONTEXT; struct _FILE_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - PVPB Vpb ; - PVOID FsContext ; - PVOID FsContext2 ; - PSECTION_OBJECT_POINTERS SectionObjectPointer ; - PVOID PrivateCacheMap ; - NTSTATUS FinalStatus ; - struct _FILE_OBJECT *RelatedFileObject ; - BOOLEAN LockOperation ; - BOOLEAN DeletePending ; - BOOLEAN ReadAccess ; - BOOLEAN WriteAccess ; - BOOLEAN DeleteAccess ; - BOOLEAN SharedRead ; - BOOLEAN SharedWrite ; - BOOLEAN SharedDelete ; - ULONG Flags ; - UNICODE_STRING FileName ; - LARGE_INTEGER CurrentByteOffset ; - ULONG Waiters ; - ULONG Busy ; - PVOID LastLock ; - KEVENT Lock ; - KEVENT Event ; - PIO_COMPLETION_CONTEXT CompletionContext ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + PVPB Vpb; + PVOID FsContext; + PVOID FsContext2; + PSECTION_OBJECT_POINTERS SectionObjectPointer; + PVOID PrivateCacheMap; + NTSTATUS FinalStatus; + struct _FILE_OBJECT *RelatedFileObject; + BOOLEAN LockOperation; + BOOLEAN DeletePending; + BOOLEAN ReadAccess; + BOOLEAN WriteAccess; + BOOLEAN DeleteAccess; + BOOLEAN SharedRead; + BOOLEAN SharedWrite; + BOOLEAN SharedDelete; + ULONG Flags; + UNICODE_STRING FileName; + LARGE_INTEGER CurrentByteOffset; + ULONG Waiters; + ULONG Busy; + PVOID LastLock; + KEVENT Lock; + KEVENT Event; + PIO_COMPLETION_CONTEXT CompletionContext; }; typedef struct _FILE_OBJECT *PFILE_OBJECT; union __anonunion_AssociatedIrp_44 { - struct _IRP *MasterIrp ; - LONG IrpCount ; - PVOID SystemBuffer ; + struct _IRP *MasterIrp; + LONG IrpCount; + PVOID SystemBuffer; }; struct __anonstruct_AsynchronousParameters_46 { - void (*UserApcRoutine)(PVOID ApcContext , PIO_STATUS_BLOCK IoStatusBlock , - ULONG Reserved ) ; - PVOID UserApcContext ; + void (*UserApcRoutine)(PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, + ULONG Reserved); + PVOID UserApcContext; }; union __anonunion_Overlay_45 { - struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters ; - LARGE_INTEGER AllocationSize ; + struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters; + LARGE_INTEGER AllocationSize; }; struct __anonstruct____missing_field_name_50 { - PVOID DriverContext[4] ; + PVOID DriverContext[4]; }; union __anonunion____missing_field_name_49 { - KDEVICE_QUEUE_ENTRY DeviceQueueEntry ; - struct __anonstruct____missing_field_name_50 __annonCompField14 ; + KDEVICE_QUEUE_ENTRY DeviceQueueEntry; + struct __anonstruct____missing_field_name_50 __annonCompField14; }; struct _IO_STACK_LOCATION; union __anonunion____missing_field_name_52 { - struct _IO_STACK_LOCATION *CurrentStackLocation ; - ULONG PacketType ; + struct _IO_STACK_LOCATION *CurrentStackLocation; + ULONG PacketType; }; struct __anonstruct____missing_field_name_51 { - LIST_ENTRY ListEntry ; - union __anonunion____missing_field_name_52 __annonCompField16 ; + LIST_ENTRY ListEntry; + union __anonunion____missing_field_name_52 __annonCompField16; }; struct __anonstruct_Overlay_48 { - union __anonunion____missing_field_name_49 __annonCompField15 ; - PETHREAD Thread ; - PCHAR AuxiliaryBuffer ; - struct __anonstruct____missing_field_name_51 __annonCompField17 ; - PFILE_OBJECT OriginalFileObject ; + union __anonunion____missing_field_name_49 __annonCompField15; + PETHREAD Thread; + PCHAR AuxiliaryBuffer; + struct __anonstruct____missing_field_name_51 __annonCompField17; + PFILE_OBJECT OriginalFileObject; }; union __anonunion_Tail_47 { - struct __anonstruct_Overlay_48 Overlay ; - KAPC Apc ; - PVOID CompletionKey ; + struct __anonstruct_Overlay_48 Overlay; + KAPC Apc; + PVOID CompletionKey; }; struct _IRP { - CSHORT Type ; - USHORT Size ; - PMDL MdlAddress ; - ULONG Flags ; - union __anonunion_AssociatedIrp_44 AssociatedIrp ; - LIST_ENTRY ThreadListEntry ; - IO_STATUS_BLOCK IoStatus ; - KPROCESSOR_MODE RequestorMode ; - BOOLEAN PendingReturned ; - CHAR StackCount ; - CHAR CurrentLocation ; - BOOLEAN Cancel ; - KIRQL CancelIrql ; - CCHAR ApcEnvironment ; - UCHAR AllocationFlags ; - PIO_STATUS_BLOCK UserIosb ; - PKEVENT UserEvent ; - union __anonunion_Overlay_45 Overlay ; - void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - PVOID UserBuffer ; - union __anonunion_Tail_47 Tail ; + CSHORT Type; + USHORT Size; + PMDL MdlAddress; + ULONG Flags; + union __anonunion_AssociatedIrp_44 AssociatedIrp; + LIST_ENTRY ThreadListEntry; + IO_STATUS_BLOCK IoStatus; + KPROCESSOR_MODE RequestorMode; + BOOLEAN PendingReturned; + CHAR StackCount; + CHAR CurrentLocation; + BOOLEAN Cancel; + KIRQL CancelIrql; + CCHAR ApcEnvironment; + UCHAR AllocationFlags; + PIO_STATUS_BLOCK UserIosb; + PKEVENT UserEvent; + union __anonunion_Overlay_45 Overlay; + void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + PVOID UserBuffer; + union __anonunion_Tail_47 Tail; }; typedef struct _IRP IRP; typedef struct _IRP *PIRP; enum _DEVICE_RELATION_TYPE { - BusRelations = 0, - EjectionRelations = 1, - PowerRelations = 2, - RemovalRelations = 3, - TargetDeviceRelation = 4 -} ; + BusRelations = 0, + EjectionRelations = 1, + PowerRelations = 2, + RemovalRelations = 3, + TargetDeviceRelation = 4 +}; typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE; enum _DEVICE_USAGE_NOTIFICATION_TYPE { - DeviceUsageTypeUndefined = 0, - DeviceUsageTypePaging = 1, - DeviceUsageTypeHibernation = 2, - DeviceUsageTypeDumpFile = 3 -} ; + DeviceUsageTypeUndefined = 0, + DeviceUsageTypePaging = 1, + DeviceUsageTypeHibernation = 2, + DeviceUsageTypeDumpFile = 3 +}; typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE; struct _INTERFACE { - USHORT Size ; - USHORT Version ; - PVOID Context ; - void (*InterfaceReference)(PVOID Context ) ; - void (*InterfaceDereference)(PVOID Context ) ; + USHORT Size; + USHORT Version; + PVOID Context; + void (*InterfaceReference)(PVOID Context); + void (*InterfaceDereference)(PVOID Context); }; typedef struct _INTERFACE *PINTERFACE; struct _DEVICE_CAPABILITIES { - USHORT Size ; - USHORT Version ; - ULONG DeviceD1 : 1 ; - ULONG DeviceD2 : 1 ; - ULONG LockSupported : 1 ; - ULONG EjectSupported : 1 ; - ULONG Removable : 1 ; - ULONG DockDevice : 1 ; - ULONG UniqueID : 1 ; - ULONG SilentInstall : 1 ; - ULONG RawDeviceOK : 1 ; - ULONG SurpriseRemovalOK : 1 ; - ULONG WakeFromD0 : 1 ; - ULONG WakeFromD1 : 1 ; - ULONG WakeFromD2 : 1 ; - ULONG WakeFromD3 : 1 ; - ULONG HardwareDisabled : 1 ; - ULONG NonDynamic : 1 ; - ULONG WarmEjectSupported : 1 ; - ULONG Reserved : 15 ; - ULONG Address ; - ULONG UINumber ; - DEVICE_POWER_STATE DeviceState[7] ; - SYSTEM_POWER_STATE SystemWake ; - DEVICE_POWER_STATE DeviceWake ; - ULONG D1Latency ; - ULONG D2Latency ; - ULONG D3Latency ; + USHORT Size; + USHORT Version; + ULONG DeviceD1 : 1; + ULONG DeviceD2 : 1; + ULONG LockSupported : 1; + ULONG EjectSupported : 1; + ULONG Removable : 1; + ULONG DockDevice : 1; + ULONG UniqueID : 1; + ULONG SilentInstall : 1; + ULONG RawDeviceOK : 1; + ULONG SurpriseRemovalOK : 1; + ULONG WakeFromD0 : 1; + ULONG WakeFromD1 : 1; + ULONG WakeFromD2 : 1; + ULONG WakeFromD3 : 1; + ULONG HardwareDisabled : 1; + ULONG NonDynamic : 1; + ULONG WarmEjectSupported : 1; + ULONG Reserved : 15; + ULONG Address; + ULONG UINumber; + DEVICE_POWER_STATE DeviceState[7]; + SYSTEM_POWER_STATE SystemWake; + DEVICE_POWER_STATE DeviceWake; + ULONG D1Latency; + ULONG D2Latency; + ULONG D3Latency; }; typedef struct _DEVICE_CAPABILITIES *PDEVICE_CAPABILITIES; struct _POWER_SEQUENCE { - ULONG SequenceD1 ; - ULONG SequenceD2 ; - ULONG SequenceD3 ; + ULONG SequenceD1; + ULONG SequenceD2; + ULONG SequenceD3; }; typedef struct _POWER_SEQUENCE *PPOWER_SEQUENCE; enum __anonenum_BUS_QUERY_ID_TYPE_53 { - BusQueryDeviceID = 0, - BusQueryHardwareIDs = 1, - BusQueryCompatibleIDs = 2, - BusQueryInstanceID = 3, - BusQueryDeviceSerialNumber = 4 -} ; + BusQueryDeviceID = 0, + BusQueryHardwareIDs = 1, + BusQueryCompatibleIDs = 2, + BusQueryInstanceID = 3, + BusQueryDeviceSerialNumber = 4 +}; typedef enum __anonenum_BUS_QUERY_ID_TYPE_53 BUS_QUERY_ID_TYPE; enum __anonenum_DEVICE_TEXT_TYPE_54 { - DeviceTextDescription = 0, - DeviceTextLocationInformation = 1 -} ; + DeviceTextDescription = 0, + DeviceTextLocationInformation = 1 +}; typedef enum __anonenum_DEVICE_TEXT_TYPE_54 DEVICE_TEXT_TYPE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Create_56 { - PIO_SECURITY_CONTEXT SecurityContext ; - ULONG Options ; - USHORT FileAttributes ; - USHORT ShareAccess ; - ULONG EaLength ; + PIO_SECURITY_CONTEXT SecurityContext; + ULONG Options; + USHORT FileAttributes; + USHORT ShareAccess; + ULONG EaLength; }; struct __anonstruct_Read_57 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_Write_58 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_QueryFile_59 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; }; struct __anonstruct____missing_field_name_62 { - BOOLEAN ReplaceIfExists ; - BOOLEAN AdvanceOnly ; + BOOLEAN ReplaceIfExists; + BOOLEAN AdvanceOnly; }; union __anonunion____missing_field_name_61 { - struct __anonstruct____missing_field_name_62 __annonCompField18 ; - ULONG ClusterCount ; - HANDLE DeleteHandle ; + struct __anonstruct____missing_field_name_62 __annonCompField18; + ULONG ClusterCount; + HANDLE DeleteHandle; }; struct __anonstruct_SetFile_60 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; - PFILE_OBJECT FileObject ; - union __anonunion____missing_field_name_61 __annonCompField19 ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; + PFILE_OBJECT FileObject; + union __anonunion____missing_field_name_61 __annonCompField19; }; struct __anonstruct_QueryVolume_63 { - ULONG Length ; - FS_INFORMATION_CLASS FsInformationClass ; + ULONG Length; + FS_INFORMATION_CLASS FsInformationClass; }; struct __anonstruct_DeviceIoControl_64 { - ULONG OutputBufferLength ; - ULONG InputBufferLength ; - ULONG IoControlCode ; - PVOID Type3InputBuffer ; + ULONG OutputBufferLength; + ULONG InputBufferLength; + ULONG IoControlCode; + PVOID Type3InputBuffer; }; struct __anonstruct_QuerySecurity_65 { - SECURITY_INFORMATION SecurityInformation ; - ULONG Length ; + SECURITY_INFORMATION SecurityInformation; + ULONG Length; }; struct __anonstruct_SetSecurity_66 { - SECURITY_INFORMATION SecurityInformation ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; + SECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; }; struct __anonstruct_MountVolume_67 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_VerifyVolume_68 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_Scsi_69 { - struct _SCSI_REQUEST_BLOCK *Srb ; + struct _SCSI_REQUEST_BLOCK *Srb; }; struct __anonstruct_QueryDeviceRelations_70 { - DEVICE_RELATION_TYPE Type ; + DEVICE_RELATION_TYPE Type; }; struct __anonstruct_QueryInterface_71 { - GUID const *InterfaceType ; - USHORT Size ; - USHORT Version ; - PINTERFACE Interface ; - PVOID InterfaceSpecificData ; + GUID const *InterfaceType; + USHORT Size; + USHORT Version; + PINTERFACE Interface; + PVOID InterfaceSpecificData; }; struct __anonstruct_DeviceCapabilities_72 { - PDEVICE_CAPABILITIES Capabilities ; + PDEVICE_CAPABILITIES Capabilities; }; struct __anonstruct_FilterResourceRequirements_73 { - PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList ; + PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; }; struct __anonstruct_ReadWriteConfig_74 { - ULONG WhichSpace ; - PVOID Buffer ; - ULONG Offset ; - ULONG Length ; + ULONG WhichSpace; + PVOID Buffer; + ULONG Offset; + ULONG Length; }; struct __anonstruct_SetLock_75 { - BOOLEAN Lock ; + BOOLEAN Lock; }; struct __anonstruct_QueryId_76 { - BUS_QUERY_ID_TYPE IdType ; + BUS_QUERY_ID_TYPE IdType; }; struct __anonstruct_QueryDeviceText_77 { - DEVICE_TEXT_TYPE DeviceTextType ; - LCID LocaleId ; + DEVICE_TEXT_TYPE DeviceTextType; + LCID LocaleId; }; struct __anonstruct_UsageNotification_78 { - BOOLEAN InPath ; - BOOLEAN Reserved[3] ; - DEVICE_USAGE_NOTIFICATION_TYPE Type ; + BOOLEAN InPath; + BOOLEAN Reserved[3]; + DEVICE_USAGE_NOTIFICATION_TYPE Type; }; struct __anonstruct_WaitWake_79 { - SYSTEM_POWER_STATE PowerState ; + SYSTEM_POWER_STATE PowerState; }; struct __anonstruct_PowerSequence_80 { - PPOWER_SEQUENCE PowerSequence ; + PPOWER_SEQUENCE PowerSequence; }; struct __anonstruct_Power_81 { - ULONG SystemContext ; - POWER_STATE_TYPE Type ; - POWER_STATE State ; - POWER_ACTION ShutdownType ; + ULONG SystemContext; + POWER_STATE_TYPE Type; + POWER_STATE State; + POWER_ACTION ShutdownType; }; struct __anonstruct_StartDevice_82 { - PCM_RESOURCE_LIST AllocatedResources ; - PCM_RESOURCE_LIST AllocatedResourcesTranslated ; + PCM_RESOURCE_LIST AllocatedResources; + PCM_RESOURCE_LIST AllocatedResourcesTranslated; }; struct __anonstruct_WMI_83 { - ULONG_PTR ProviderId ; - PVOID DataPath ; - ULONG BufferSize ; - PVOID Buffer ; + ULONG_PTR ProviderId; + PVOID DataPath; + ULONG BufferSize; + PVOID Buffer; }; struct __anonstruct_Others_84 { - PVOID Argument1 ; - PVOID Argument2 ; - PVOID Argument3 ; - PVOID Argument4 ; + PVOID Argument1; + PVOID Argument2; + PVOID Argument3; + PVOID Argument4; }; union __anonunion_Parameters_55 { - struct __anonstruct_Create_56 Create ; - struct __anonstruct_Read_57 Read ; - struct __anonstruct_Write_58 Write ; - struct __anonstruct_QueryFile_59 QueryFile ; - struct __anonstruct_SetFile_60 SetFile ; - struct __anonstruct_QueryVolume_63 QueryVolume ; - struct __anonstruct_DeviceIoControl_64 DeviceIoControl ; - struct __anonstruct_QuerySecurity_65 QuerySecurity ; - struct __anonstruct_SetSecurity_66 SetSecurity ; - struct __anonstruct_MountVolume_67 MountVolume ; - struct __anonstruct_VerifyVolume_68 VerifyVolume ; - struct __anonstruct_Scsi_69 Scsi ; - struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations ; - struct __anonstruct_QueryInterface_71 QueryInterface ; - struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities ; - struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements ; - struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig ; - struct __anonstruct_SetLock_75 SetLock ; - struct __anonstruct_QueryId_76 QueryId ; - struct __anonstruct_QueryDeviceText_77 QueryDeviceText ; - struct __anonstruct_UsageNotification_78 UsageNotification ; - struct __anonstruct_WaitWake_79 WaitWake ; - struct __anonstruct_PowerSequence_80 PowerSequence ; - struct __anonstruct_Power_81 Power ; - struct __anonstruct_StartDevice_82 StartDevice ; - struct __anonstruct_WMI_83 WMI ; - struct __anonstruct_Others_84 Others ; + struct __anonstruct_Create_56 Create; + struct __anonstruct_Read_57 Read; + struct __anonstruct_Write_58 Write; + struct __anonstruct_QueryFile_59 QueryFile; + struct __anonstruct_SetFile_60 SetFile; + struct __anonstruct_QueryVolume_63 QueryVolume; + struct __anonstruct_DeviceIoControl_64 DeviceIoControl; + struct __anonstruct_QuerySecurity_65 QuerySecurity; + struct __anonstruct_SetSecurity_66 SetSecurity; + struct __anonstruct_MountVolume_67 MountVolume; + struct __anonstruct_VerifyVolume_68 VerifyVolume; + struct __anonstruct_Scsi_69 Scsi; + struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations; + struct __anonstruct_QueryInterface_71 QueryInterface; + struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities; + struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements; + struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig; + struct __anonstruct_SetLock_75 SetLock; + struct __anonstruct_QueryId_76 QueryId; + struct __anonstruct_QueryDeviceText_77 QueryDeviceText; + struct __anonstruct_UsageNotification_78 UsageNotification; + struct __anonstruct_WaitWake_79 WaitWake; + struct __anonstruct_PowerSequence_80 PowerSequence; + struct __anonstruct_Power_81 Power; + struct __anonstruct_StartDevice_82 StartDevice; + struct __anonstruct_WMI_83 WMI; + struct __anonstruct_Others_84 Others; }; struct _IO_STACK_LOCATION { - UCHAR MajorFunction ; - UCHAR MinorFunction ; - UCHAR Flags ; - UCHAR Control ; - union __anonunion_Parameters_55 Parameters ; - PDEVICE_OBJECT DeviceObject ; - PFILE_OBJECT FileObject ; - NTSTATUS (*CompletionRoutine)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - PVOID Context ; + UCHAR MajorFunction; + UCHAR MinorFunction; + UCHAR Flags; + UCHAR Control; + union __anonunion_Parameters_55 Parameters; + PDEVICE_OBJECT DeviceObject; + PFILE_OBJECT FileObject; + NTSTATUS(*CompletionRoutine) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + PVOID Context; }; typedef struct _IO_STACK_LOCATION IO_STACK_LOCATION; typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION; #pragma pack(pop) struct _CONFIGURATION_INFORMATION { - ULONG DiskCount ; - ULONG FloppyCount ; - ULONG CdRomCount ; - ULONG TapeCount ; - ULONG ScsiPortCount ; - ULONG SerialCount ; - ULONG ParallelCount ; - BOOLEAN AtDiskPrimaryAddressClaimed ; - BOOLEAN AtDiskSecondaryAddressClaimed ; - ULONG Version ; - ULONG MediumChangerCount ; + ULONG DiskCount; + ULONG FloppyCount; + ULONG CdRomCount; + ULONG TapeCount; + ULONG ScsiPortCount; + ULONG SerialCount; + ULONG ParallelCount; + BOOLEAN AtDiskPrimaryAddressClaimed; + BOOLEAN AtDiskSecondaryAddressClaimed; + ULONG Version; + ULONG MediumChangerCount; }; typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION; typedef struct _CONFIGURATION_INFORMATION *PCONFIGURATION_INFORMATION; struct _OBJECT_HANDLE_INFORMATION { - ULONG HandleAttributes ; - ACCESS_MASK GrantedAccess ; + ULONG HandleAttributes; + ACCESS_MASK GrantedAccess; }; typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION; enum _MEDIA_TYPE { - Unknown = 0, - F5_1Pt2_512 = 1, - F3_1Pt44_512 = 2, - F3_2Pt88_512 = 3, - F3_20Pt8_512 = 4, - F3_720_512 = 5, - F5_360_512 = 6, - F5_320_512 = 7, - F5_320_1024 = 8, - F5_180_512 = 9, - F5_160_512 = 10, - RemovableMedia = 11, - FixedMedia = 12, - F3_120M_512 = 13, - F3_640_512 = 14, - F5_640_512 = 15, - F5_720_512 = 16, - F3_1Pt2_512 = 17, - F3_1Pt23_1024 = 18, - F5_1Pt23_1024 = 19, - F3_128Mb_512 = 20, - F3_230Mb_512 = 21, - F8_256_128 = 22 -} ; + Unknown = 0, + F5_1Pt2_512 = 1, + F3_1Pt44_512 = 2, + F3_2Pt88_512 = 3, + F3_20Pt8_512 = 4, + F3_720_512 = 5, + F5_360_512 = 6, + F5_320_512 = 7, + F5_320_1024 = 8, + F5_180_512 = 9, + F5_160_512 = 10, + RemovableMedia = 11, + FixedMedia = 12, + F3_120M_512 = 13, + F3_640_512 = 14, + F5_640_512 = 15, + F5_720_512 = 16, + F3_1Pt2_512 = 17, + F3_1Pt23_1024 = 18, + F5_1Pt23_1024 = 19, + F3_128Mb_512 = 20, + F3_230Mb_512 = 21, + F8_256_128 = 22 +}; typedef enum _MEDIA_TYPE MEDIA_TYPE; struct _FORMAT_PARAMETERS { - MEDIA_TYPE MediaType ; - ULONG StartCylinderNumber ; - ULONG EndCylinderNumber ; - ULONG StartHeadNumber ; - ULONG EndHeadNumber ; + MEDIA_TYPE MediaType; + ULONG StartCylinderNumber; + ULONG EndCylinderNumber; + ULONG StartHeadNumber; + ULONG EndHeadNumber; }; typedef struct _FORMAT_PARAMETERS FORMAT_PARAMETERS; typedef struct _FORMAT_PARAMETERS *PFORMAT_PARAMETERS; typedef USHORT BAD_TRACK_NUMBER; typedef USHORT *PBAD_TRACK_NUMBER; struct _FORMAT_EX_PARAMETERS { - MEDIA_TYPE MediaType ; - ULONG StartCylinderNumber ; - ULONG EndCylinderNumber ; - ULONG StartHeadNumber ; - ULONG EndHeadNumber ; - USHORT FormatGapLength ; - USHORT SectorsPerTrack ; - USHORT SectorNumber[1] ; + MEDIA_TYPE MediaType; + ULONG StartCylinderNumber; + ULONG EndCylinderNumber; + ULONG StartHeadNumber; + ULONG EndHeadNumber; + USHORT FormatGapLength; + USHORT SectorsPerTrack; + USHORT SectorNumber[1]; }; typedef struct _FORMAT_EX_PARAMETERS FORMAT_EX_PARAMETERS; typedef struct _FORMAT_EX_PARAMETERS *PFORMAT_EX_PARAMETERS; struct _DISK_GEOMETRY { - LARGE_INTEGER Cylinders ; - MEDIA_TYPE MediaType ; - ULONG TracksPerCylinder ; - ULONG SectorsPerTrack ; - ULONG BytesPerSector ; + LARGE_INTEGER Cylinders; + MEDIA_TYPE MediaType; + ULONG TracksPerCylinder; + ULONG SectorsPerTrack; + ULONG BytesPerSector; }; typedef struct _DISK_GEOMETRY DISK_GEOMETRY; typedef struct _DISK_GEOMETRY *PDISK_GEOMETRY; -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _TRANSFER_BUFFER { - PHYSICAL_ADDRESS Logical ; - PVOID Virtual ; + PHYSICAL_ADDRESS Logical; + PVOID Virtual; }; typedef struct _TRANSFER_BUFFER TRANSFER_BUFFER; struct _ACPI_FDI_DATA { - ULONG DriveNumber ; - ULONG DeviceType ; - ULONG MaxCylinderNumber ; - ULONG MaxSectorNumber ; - ULONG MaxHeadNumber ; - ULONG StepRateHeadUnloadTime ; - ULONG HeadLoadTime ; - ULONG MotorOffTime ; - ULONG SectorLengthCode ; - ULONG SectorPerTrack ; - ULONG ReadWriteGapLength ; - ULONG DataTransferLength ; - ULONG FormatGapLength ; - ULONG FormatFillCharacter ; - ULONG HeadSettleTime ; - ULONG MotorSettleTime ; + ULONG DriveNumber; + ULONG DeviceType; + ULONG MaxCylinderNumber; + ULONG MaxSectorNumber; + ULONG MaxHeadNumber; + ULONG StepRateHeadUnloadTime; + ULONG HeadLoadTime; + ULONG MotorOffTime; + ULONG SectorLengthCode; + ULONG SectorPerTrack; + ULONG ReadWriteGapLength; + ULONG DataTransferLength; + ULONG FormatGapLength; + ULONG FormatFillCharacter; + ULONG HeadSettleTime; + ULONG MotorSettleTime; }; typedef struct _ACPI_FDI_DATA ACPI_FDI_DATA; enum _ACPI_FDI_DEVICE_TYPE { - CmosProblem = 0, - Form525Capacity360 = 1, - Form525Capacity1200 = 2, - Form35Capacity720 = 3, - Form35Capacity1440 = 4, - Form35Capacity2880 = 5 -} ; + CmosProblem = 0, + Form525Capacity360 = 1, + Form525Capacity1200 = 2, + Form35Capacity720 = 3, + Form35Capacity1440 = 4, + Form35Capacity2880 = 5 +}; struct _FDC_INFO { - UCHAR FloppyControllerType ; - UCHAR SpeedsAvailable ; - ULONG AdapterBufferSize ; - INTERFACE_TYPE BusType ; - ULONG BusNumber ; - ULONG ControllerNumber ; - ULONG PeripheralNumber ; - ULONG UnitNumber ; - ULONG MaxTransferSize ; - BOOLEAN AcpiBios ; - BOOLEAN AcpiFdiSupported ; - ACPI_FDI_DATA AcpiFdiData ; - ULONG BufferCount ; - ULONG BufferSize ; - TRANSFER_BUFFER BufferAddress[] ; + UCHAR FloppyControllerType; + UCHAR SpeedsAvailable; + ULONG AdapterBufferSize; + INTERFACE_TYPE BusType; + ULONG BusNumber; + ULONG ControllerNumber; + ULONG PeripheralNumber; + ULONG UnitNumber; + ULONG MaxTransferSize; + BOOLEAN AcpiBios; + BOOLEAN AcpiFdiSupported; + ACPI_FDI_DATA AcpiFdiData; + ULONG BufferCount; + ULONG BufferSize; + TRANSFER_BUFFER BufferAddress[]; }; typedef struct _FDC_INFO FDC_INFO; typedef struct _FDC_INFO *PFDC_INFO; struct _FDC_ENABLE_PARMS { - UCHAR DriveOnValue ; - USHORT TimeToWait ; - BOOLEAN MotorStarted ; + UCHAR DriveOnValue; + USHORT TimeToWait; + BOOLEAN MotorStarted; }; typedef struct _FDC_ENABLE_PARMS FDC_ENABLE_PARMS; struct _FDC_DISK_CHANGE_PARMS { - UCHAR DriveStatus ; - UCHAR DriveOnValue ; + UCHAR DriveStatus; + UCHAR DriveOnValue; }; typedef struct _FDC_DISK_CHANGE_PARMS FDC_DISK_CHANGE_PARMS; struct _ISSUE_FDC_COMMAND_PARMS { - PUCHAR FifoInBuffer ; - PUCHAR FifoOutBuffer ; - PVOID IoHandle ; - ULONG IoOffset ; - ULONG TransferBytes ; - ULONG TimeOut ; + PUCHAR FifoInBuffer; + PUCHAR FifoOutBuffer; + PVOID IoHandle; + ULONG IoOffset; + ULONG TransferBytes; + ULONG TimeOut; }; typedef struct _ISSUE_FDC_COMMAND_PARMS ISSUE_FDC_COMMAND_PARMS; struct _SET_HD_BIT_PARMS { - BOOLEAN DriveType144MB ; - BOOLEAN Media144MB ; - BOOLEAN More120MB ; - UCHAR DeviceUnit ; - BOOLEAN ChangedHdBit ; + BOOLEAN DriveType144MB; + BOOLEAN Media144MB; + BOOLEAN More120MB; + UCHAR DeviceUnit; + BOOLEAN ChangedHdBit; }; typedef struct _SET_HD_BIT_PARMS SET_HD_BIT_PARMS; struct _MOUNTDEV_NAME { - USHORT NameLength ; - WCHAR Name[1] ; + USHORT NameLength; + WCHAR Name[1]; }; typedef struct _MOUNTDEV_NAME MOUNTDEV_NAME; typedef struct _MOUNTDEV_NAME *PMOUNTDEV_NAME; struct _MOUNTDEV_UNIQUE_ID { - USHORT UniqueIdLength ; - UCHAR UniqueId[1] ; + USHORT UniqueIdLength; + UCHAR UniqueId[1]; }; typedef struct _MOUNTDEV_UNIQUE_ID MOUNTDEV_UNIQUE_ID; typedef struct _MOUNTDEV_UNIQUE_ID *PMOUNTDEV_UNIQUE_ID; struct _MOUNTDEV_SUGGESTED_LINK_NAME { - BOOLEAN UseOnlyIfThereAreNoOtherLinks ; - USHORT NameLength ; - WCHAR Name[1] ; + BOOLEAN UseOnlyIfThereAreNoOtherLinks; + USHORT NameLength; + WCHAR Name[1]; }; typedef struct _MOUNTDEV_SUGGESTED_LINK_NAME MOUNTDEV_SUGGESTED_LINK_NAME; typedef struct _MOUNTDEV_SUGGESTED_LINK_NAME *PMOUNTDEV_SUGGESTED_LINK_NAME; struct _BOOT_SECTOR_INFO { - UCHAR JumpByte[1] ; - UCHAR Ignore1[2] ; - UCHAR OemData[8] ; - UCHAR BytesPerSector[2] ; - UCHAR Ignore2[6] ; - UCHAR NumberOfSectors[2] ; - UCHAR MediaByte[1] ; - UCHAR Ignore3[2] ; - UCHAR SectorsPerTrack[2] ; - UCHAR NumberOfHeads[2] ; + UCHAR JumpByte[1]; + UCHAR Ignore1[2]; + UCHAR OemData[8]; + UCHAR BytesPerSector[2]; + UCHAR Ignore2[6]; + UCHAR NumberOfSectors[2]; + UCHAR MediaByte[1]; + UCHAR Ignore3[2]; + UCHAR SectorsPerTrack[2]; + UCHAR NumberOfHeads[2]; }; typedef struct _BOOT_SECTOR_INFO *PBOOT_SECTOR_INFO; enum _DRIVE_MEDIA_TYPE { - Drive360Media160 = 0, - Drive360Media180 = 1, - Drive360Media320 = 2, - Drive360Media32X = 3, - Drive360Media360 = 4, - Drive720Media720 = 5, - Drive120Media160 = 6, - Drive120Media180 = 7, - Drive120Media320 = 8, - Drive120Media32X = 9, - Drive120Media360 = 10, - Drive120Media120 = 11, - Drive144Media720 = 12, - Drive144Media144 = 13, - Drive288Media720 = 14, - Drive288Media144 = 15, - Drive288Media288 = 16 -} ; + Drive360Media160 = 0, + Drive360Media180 = 1, + Drive360Media320 = 2, + Drive360Media32X = 3, + Drive360Media360 = 4, + Drive720Media720 = 5, + Drive120Media160 = 6, + Drive120Media180 = 7, + Drive120Media320 = 8, + Drive120Media32X = 9, + Drive120Media360 = 10, + Drive120Media120 = 11, + Drive144Media720 = 12, + Drive144Media144 = 13, + Drive288Media720 = 14, + Drive288Media144 = 15, + Drive288Media288 = 16 +}; typedef enum _DRIVE_MEDIA_TYPE DRIVE_MEDIA_TYPE; enum _DRIVE_MEDIA_TYPE_NEC98 { - Drive360Media160Nec98 = 0, - Drive360Media180Nec98 = 1, - Drive360Media320Nec98 = 2, - Drive360Media32XNec98 = 3, - Drive360Media360Nec98 = 4, - Drive120Media160Nec98 = 5, - Drive120Media180Nec98 = 6, - Drive120Media320Nec98 = 7, - Drive120Media32XNec98 = 8, - Drive120Media360Nec98 = 9, - Drive120Media640Nec98 = 10, - Drive120Media720Nec98 = 11, - Drive120Media120Nec98 = 12, - Drive120Media123Nec98 = 13, - Drive144Media640Nec98 = 14, - Drive144Media720Nec98 = 15, - Drive144Media120Nec98 = 16, - Drive144Media123Nec98 = 17, - Drive144Media144Nec98 = 18, - Drive12EMedia120Nec98 = 19, - Drive12EMedia123Nec98 = 20 -} ; + Drive360Media160Nec98 = 0, + Drive360Media180Nec98 = 1, + Drive360Media320Nec98 = 2, + Drive360Media32XNec98 = 3, + Drive360Media360Nec98 = 4, + Drive120Media160Nec98 = 5, + Drive120Media180Nec98 = 6, + Drive120Media320Nec98 = 7, + Drive120Media32XNec98 = 8, + Drive120Media360Nec98 = 9, + Drive120Media640Nec98 = 10, + Drive120Media720Nec98 = 11, + Drive120Media120Nec98 = 12, + Drive120Media123Nec98 = 13, + Drive144Media640Nec98 = 14, + Drive144Media720Nec98 = 15, + Drive144Media120Nec98 = 16, + Drive144Media123Nec98 = 17, + Drive144Media144Nec98 = 18, + Drive12EMedia120Nec98 = 19, + Drive12EMedia123Nec98 = 20 +}; typedef enum _DRIVE_MEDIA_TYPE_NEC98 DRIVE_MEDIA_TYPE_NEC98; struct _DRIVE_MEDIA_LIMITS { - DRIVE_MEDIA_TYPE HighestDriveMediaType ; - DRIVE_MEDIA_TYPE LowestDriveMediaType ; + DRIVE_MEDIA_TYPE HighestDriveMediaType; + DRIVE_MEDIA_TYPE LowestDriveMediaType; }; typedef struct _DRIVE_MEDIA_LIMITS DRIVE_MEDIA_LIMITS; typedef struct _DRIVE_MEDIA_LIMITS *PDRIVE_MEDIA_LIMITS; struct _DRIVE_MEDIA_LIMITS_NEC98 { - DRIVE_MEDIA_TYPE_NEC98 HighestDriveMediaType ; - DRIVE_MEDIA_TYPE_NEC98 LowestDriveMediaType ; + DRIVE_MEDIA_TYPE_NEC98 HighestDriveMediaType; + DRIVE_MEDIA_TYPE_NEC98 LowestDriveMediaType; }; typedef struct _DRIVE_MEDIA_LIMITS_NEC98 DRIVE_MEDIA_LIMITS_NEC98; struct _DRIVE_MEDIA_CONSTANTS { - MEDIA_TYPE MediaType ; - UCHAR StepRateHeadUnloadTime ; - UCHAR HeadLoadTime ; - UCHAR MotorOffTime ; - UCHAR SectorLengthCode ; - USHORT BytesPerSector ; - UCHAR SectorsPerTrack ; - UCHAR ReadWriteGapLength ; - UCHAR FormatGapLength ; - UCHAR FormatFillCharacter ; - UCHAR HeadSettleTime ; - USHORT MotorSettleTimeRead ; - USHORT MotorSettleTimeWrite ; - UCHAR MaximumTrack ; - UCHAR CylinderShift ; - UCHAR DataTransferRate ; - UCHAR NumberOfHeads ; - UCHAR DataLength ; - UCHAR MediaByte ; - UCHAR SkewDelta ; + MEDIA_TYPE MediaType; + UCHAR StepRateHeadUnloadTime; + UCHAR HeadLoadTime; + UCHAR MotorOffTime; + UCHAR SectorLengthCode; + USHORT BytesPerSector; + UCHAR SectorsPerTrack; + UCHAR ReadWriteGapLength; + UCHAR FormatGapLength; + UCHAR FormatFillCharacter; + UCHAR HeadSettleTime; + USHORT MotorSettleTimeRead; + USHORT MotorSettleTimeWrite; + UCHAR MaximumTrack; + UCHAR CylinderShift; + UCHAR DataTransferRate; + UCHAR NumberOfHeads; + UCHAR DataLength; + UCHAR MediaByte; + UCHAR SkewDelta; }; typedef struct _DRIVE_MEDIA_CONSTANTS DRIVE_MEDIA_CONSTANTS; typedef struct _DRIVE_MEDIA_CONSTANTS *PDRIVE_MEDIA_CONSTANTS; struct _DISKETTE_EXTENSION { - KSPIN_LOCK FlCancelSpinLock ; - PDEVICE_OBJECT UnderlyingPDO ; - PDEVICE_OBJECT TargetObject ; - BOOLEAN IsStarted ; - BOOLEAN IsRemoved ; - BOOLEAN HoldNewRequests ; - LIST_ENTRY NewRequestQueue ; - KSPIN_LOCK NewRequestQueueSpinLock ; - PDEVICE_OBJECT DeviceObject ; - KSEMAPHORE RequestSemaphore ; - KSPIN_LOCK ListSpinLock ; - FAST_MUTEX ThreadReferenceMutex ; - LONG ThreadReferenceCount ; - PKTHREAD FloppyThread ; - LIST_ENTRY ListEntry ; - BOOLEAN HardwareFailed ; - UCHAR HardwareFailCount ; - ULONG MaxTransferSize ; - UCHAR FifoBuffer[10] ; - PUCHAR IoBuffer ; - PMDL IoBufferMdl ; - ULONG IoBufferSize ; - PDRIVER_OBJECT DriverObject ; - DRIVE_MEDIA_TYPE LastDriveMediaType ; - BOOLEAN FloppyControllerAllocated ; - BOOLEAN ACPI_BIOS ; - UCHAR DriveType ; - ULONG BytesPerSector ; - ULONG ByteCapacity ; - MEDIA_TYPE MediaType ; - DRIVE_MEDIA_TYPE DriveMediaType ; - UCHAR DeviceUnit ; - UCHAR DriveOnValue ; - BOOLEAN IsReadOnly ; - DRIVE_MEDIA_CONSTANTS BiosDriveMediaConstants ; - DRIVE_MEDIA_CONSTANTS DriveMediaConstants ; - UCHAR PerpendicularMode ; - BOOLEAN ControllerConfigurable ; - UNICODE_STRING DeviceName ; - UNICODE_STRING InterfaceString ; - UNICODE_STRING ArcName ; - BOOLEAN ReleaseFdcWithMotorRunning ; - BOOLEAN PoweringDown ; - FAST_MUTEX PowerDownMutex ; - FAST_MUTEX HoldNewReqMutex ; + KSPIN_LOCK FlCancelSpinLock; + PDEVICE_OBJECT UnderlyingPDO; + PDEVICE_OBJECT TargetObject; + BOOLEAN IsStarted; + BOOLEAN IsRemoved; + BOOLEAN HoldNewRequests; + LIST_ENTRY NewRequestQueue; + KSPIN_LOCK NewRequestQueueSpinLock; + PDEVICE_OBJECT DeviceObject; + KSEMAPHORE RequestSemaphore; + KSPIN_LOCK ListSpinLock; + FAST_MUTEX ThreadReferenceMutex; + LONG ThreadReferenceCount; + PKTHREAD FloppyThread; + LIST_ENTRY ListEntry; + BOOLEAN HardwareFailed; + UCHAR HardwareFailCount; + ULONG MaxTransferSize; + UCHAR FifoBuffer[10]; + PUCHAR IoBuffer; + PMDL IoBufferMdl; + ULONG IoBufferSize; + PDRIVER_OBJECT DriverObject; + DRIVE_MEDIA_TYPE LastDriveMediaType; + BOOLEAN FloppyControllerAllocated; + BOOLEAN ACPI_BIOS; + UCHAR DriveType; + ULONG BytesPerSector; + ULONG ByteCapacity; + MEDIA_TYPE MediaType; + DRIVE_MEDIA_TYPE DriveMediaType; + UCHAR DeviceUnit; + UCHAR DriveOnValue; + BOOLEAN IsReadOnly; + DRIVE_MEDIA_CONSTANTS BiosDriveMediaConstants; + DRIVE_MEDIA_CONSTANTS DriveMediaConstants; + UCHAR PerpendicularMode; + BOOLEAN ControllerConfigurable; + UNICODE_STRING DeviceName; + UNICODE_STRING InterfaceString; + UNICODE_STRING ArcName; + BOOLEAN ReleaseFdcWithMotorRunning; + BOOLEAN PoweringDown; + FAST_MUTEX PowerDownMutex; + FAST_MUTEX HoldNewReqMutex; }; typedef struct _DISKETTE_EXTENSION DISKETTE_EXTENSION; typedef DISKETTE_EXTENSION *PDISKETTE_EXTENSION; struct _SENSE_DEVISE_STATUS_PTOS { - UCHAR ST3_PTOS ; + UCHAR ST3_PTOS; }; typedef struct _SENSE_DEVISE_STATUS_PTOS SENSE_DEVISE_STATUS_PTOS; typedef struct _SENSE_DEVISE_STATUS_PTOS *PSENSE_DEVISE_STATUS_PTOS; -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1725,1390 +1753,1481 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) #pragma once -extern int sprintf(char * , char const * , ...) ; -extern int swprintf(wchar_t * , wchar_t const * , ...) ; +extern int sprintf(char *, char const *, ...); +extern int swprintf(wchar_t *, wchar_t const *, ...); #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -extern void *memcpy(void * , void const * , size_t ) ; -extern void *memset(void * , int , size_t ) ; -extern void *memmove(void * , void const * , size_t ) ; -extern PKTHREAD KeGetCurrentThread() ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; +extern void *memcpy(void *, void const *, size_t); +extern void *memset(void *, int, size_t); +extern void *memmove(void *, void const *, size_t); +extern PKTHREAD KeGetCurrentThread(); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -extern LONG InterlockedExchange(PLONG Target , - LONG Value ) ; -#pragma warning(disable:4035) +extern LONG InterlockedExchange(PLONG Target, LONG Value); +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; -extern KPRIORITY KeSetPriorityThread(PKTHREAD Thread , - KPRIORITY Priority ) ; - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; -extern KIRQL KfAcquireSpinLock(PKSPIN_LOCK SpinLock ) ; - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; - void ExFreePool(PVOID P ) ; - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; -extern void MmProbeAndLockPages(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - LOCK_OPERATION Operation ) ; - void MmUnlockPages(PMDL MemoryDescriptorList ) ; - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; - void MmFreeContiguousMemory(PVOID BaseAddress ) ; - void MmResetDriverPaging(PVOID AddressWithinSection ) ; - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; - void IoFreeIrp(PIRP Irp ) ; - void IoFreeMdl(PMDL Mdl ) ; - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; - void IoReleaseCancelSpinLock(KIRQL Irql ) ; - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -#pragma warning(disable:4200) -#pragma warning(default:4200) - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void PoStartNextPowerIrp(PIRP Irp ) ; - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; - void ObfDereferenceObject(PVOID Object ) ; - NTSTATUS ZwClose(HANDLE Handle ) ; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +extern KPRIORITY KeSetPriorityThread(PKTHREAD Thread, KPRIORITY Priority); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +extern KIRQL KfAcquireSpinLock(PKSPIN_LOCK SpinLock); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +void ExFreePool(PVOID P); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +extern void MmProbeAndLockPages(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + LOCK_OPERATION Operation); +void MmUnlockPages(PMDL MemoryDescriptorList); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmResetDriverPaging(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoFreeIrp(PIRP Irp); +void IoFreeMdl(PMDL Mdl); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +void ObfDereferenceObject(PVOID Object); +NTSTATUS ZwClose(HANDLE Handle); #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma once #pragma once - struct _GUID const MOUNTDEV_MOUNTED_DEVICE_GUID = {1408590605, - 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const MOUNTDEV_MOUNTED_DEVICE_GUID = { + 1408590605, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; #pragma once -DRIVE_MEDIA_LIMITS _DriveMediaLimits[5] = { {4, 0}, - {11, 6}, - {5, 5}, - {13, 12}, - {16, 14}}; -DRIVE_MEDIA_LIMITS_NEC98 _DriveMediaLimits_NEC98[6] = { {4, 0}, - {13, 5}, - {11, 5}, - {18, 14}, - {18, 14}, - {20, 19}}; -PDRIVE_MEDIA_LIMITS DriveMediaLimits ; -DRIVE_MEDIA_CONSTANTS _DriveMediaConstants[17] = - { {10, 223, 2, 37, 2, 512, 8, 42, 80, 246, 15, 1000, 1000, 39, 0, 2, 1, 255, 254, - 0}, - {9, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 1000, 1000, 39, 0, 2, 1, 255, 252, - 0}, - {7, 223, 2, 37, 2, 512, 8, 42, 80, 246, 15, 1000, 1000, 39, 0, 2, 2, 255, 255, - 0}, - {8, 223, 2, 37, 3, 1024, 4, 128, 240, 246, 15, 1000, 1000, 39, 0, 2, 2, 255, - 255, 0}, - {6, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 250, 1000, 39, 0, 2, 2, 255, 253, - 0}, - {5, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 500, 1000, 79, 0, 2, 2, 255, 249, - 2}, - {10, 223, 2, 37, 2, 512, 8, 42, 80, 246, 15, 1000, 1000, 39, 1, 1, 1, 255, 254, - 0}, - {9, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 1000, 1000, 39, 1, 1, 1, 255, 252, - 0}, - {7, 223, 2, 37, 2, 512, 8, 42, 80, 246, 15, 1000, 1000, 39, 1, 1, 2, 255, 255, - 0}, - {8, 223, 2, 37, 3, 1024, 4, 128, 240, 246, 15, 1000, 1000, 39, 1, 1, 2, 255, - 255, 0}, - {6, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 625, 1000, 39, 1, 1, 2, 255, 253, - 0}, - {1, 223, 2, 37, 2, 512, 15, 27, 84, 246, 15, 625, 1000, 79, 0, 0, 2, 255, 249, - 0}, - {5, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 500, 1000, 79, 0, 2, 2, 255, 249, - 2}, - {2, 175, 2, 37, 2, 512, 18, 27, 101, 246, 15, 500, 1000, 79, 0, 0, 2, 255, 240, - 3}, - {5, 225, 2, 37, 2, 512, 9, 42, 80, 246, 15, 500, 1000, 79, 0, 2, 2, 255, 249, - 2}, - {2, 209, 2, 37, 2, 512, 18, 27, 101, 246, 15, 500, 1000, 79, 0, 0, 2, 255, 240, - 3}, - {3, 161, 2, 37, 2, 512, 36, 56, 83, 246, 15, 500, 1000, 79, 0, 3, 2, 255, 240, - 6}}; -DRIVE_MEDIA_CONSTANTS _DriveMediaConstants_NEC98[21] = - { {10, 223, 2, 37, 2, 512, 8, 42, 80, 246, 15, 1000, 1000, 39, 0, 2, 1, 255, 254, - 0}, - {9, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 1000, 1000, 39, 0, 2, 1, 255, 252, - 0}, - {7, 223, 2, 37, 2, 512, 8, 42, 80, 246, 15, 1000, 1000, 39, 0, 2, 2, 255, 255, - 0}, - {8, 223, 2, 37, 3, 1024, 4, 128, 240, 246, 15, 1000, 1000, 39, 0, 2, 2, 255, - 255, 0}, - {6, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 250, 1000, 39, 0, 2, 2, 255, 253, - 0}, - {10, 223, 22, 37, 2, 512, 8, 42, 80, 229, 15, 1000, 1000, 39, 1, 2, 1, 255, 254, - 0}, - {9, 223, 22, 37, 2, 512, 9, 42, 80, 229, 15, 1000, 1000, 39, 1, 2, 1, 255, 252, - 0}, - {7, 223, 22, 37, 2, 512, 8, 42, 80, 229, 15, 1000, 1000, 39, 1, 2, 2, 255, 255, - 0}, - {8, 223, 22, 37, 3, 1024, 4, 128, 240, 229, 15, 1000, 1000, 39, 1, 2, 2, 255, - 255, 0}, - {6, 223, 22, 37, 2, 512, 9, 42, 80, 229, 15, 1000, 1000, 39, 1, 2, 2, 255, 253, - 0}, - {15, 223, 22, 37, 2, 512, 8, 42, 80, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, 251, - 0}, - {16, 223, 22, 37, 2, 512, 9, 42, 80, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, 249, - 2}, - {1, 207, 36, 37, 2, 512, 15, 27, 84, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, 249, - 0}, - {19, 207, 36, 37, 3, 1024, 8, 53, 116, 229, 15, 1000, 1000, 76, 0, 0, 2, 255, - 254, 0}, - {14, 223, 22, 37, 2, 512, 8, 42, 80, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, 251, - 0}, - {5, 223, 22, 37, 2, 512, 9, 42, 80, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, 249, - 2}, - {17, 207, 36, 37, 2, 512, 15, 27, 84, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, - 249, 0}, - {18, 207, 36, 37, 3, 1024, 8, 53, 116, 229, 15, 1000, 1000, 76, 0, 0, 2, 255, - 254, 0}, - {2, 223, 36, 37, 2, 512, 18, 27, 108, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, - 240, 3}, - {1, 191, 50, 37, 2, 512, 15, 27, 84, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, 249, - 0}, - {19, 191, 50, 37, 3, 1024, 8, 53, 116, 229, 15, 1000, 1000, 76, 0, 0, 2, 255, - 254, 0}}; -PDRIVE_MEDIA_CONSTANTS DriveMediaConstants ; -SENSE_DEVISE_STATUS_PTOS Result_Status3_PTOS[4] ; -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) ; -void FloppyUnload(PDRIVER_OBJECT DriverObject ) ; -NTSTATUS FlConfigCallBack(PVOID Context , PUNICODE_STRING PathName , INTERFACE_TYPE BusType , - ULONG BusNumber , PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ; -NTSTATUS FlInitializeControllerHardware(PDISKETTE_EXTENSION DisketteExtension ) ; -NTSTATUS FloppyCreateClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS FloppyReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS FlRecalibrateDrive(PDISKETTE_EXTENSION DisketteExtension ) ; -NTSTATUS FlDatarateSpecifyConfigure(PDISKETTE_EXTENSION DisketteExtension ) ; -NTSTATUS FlStartDrive(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp , BOOLEAN WriteOperation , - BOOLEAN SetUpMedia , BOOLEAN IgnoreChange ) ; -void FlFinishOperation(PIRP Irp , PDISKETTE_EXTENSION DisketteExtension ) ; -NTSTATUS FlDetermineMediaType(PDISKETTE_EXTENSION DisketteExtension ) ; -void FloppyThread(PVOID Context ) ; -NTSTATUS FlReadWrite(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp , BOOLEAN DriveStarted ) ; -NTSTATUS FlFormat(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp ) ; -NTSTATUS FlIssueCommand(PDISKETTE_EXTENSION DisketteExtension , PUCHAR FifoInBuffer , - PUCHAR FifoOutBuffer , PMDL IoMdl , ULONG IoOffset , ULONG TransferBytes ) ; -BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension , PFORMAT_PARAMETERS FormatParameters ) ; -NTSTATUS FlQueueIrpToThread(PIRP Irp , PDISKETTE_EXTENSION DisketteExtension ) ; -NTSTATUS FlInterpretError(UCHAR StatusRegister1 , UCHAR StatusRegister2 ) ; -void FlAllocateIoBuffer(PDISKETTE_EXTENSION DisketteExtension , ULONG BufferSize ) ; -void FlFreeIoBuffer(PDISKETTE_EXTENSION DisketteExtension ) ; -void FlConsolidateMediaTypeWithBootSector(PDISKETTE_EXTENSION DisketteExtension , - PBOOT_SECTOR_INFO BootSector ) ; -void FlCheckBootSector(PDISKETTE_EXTENSION DisketteExtension ) ; -NTSTATUS FlReadWriteTrack(PDISKETTE_EXTENSION DisketteExtension , PMDL IoMdl , ULONG IoOffset , - BOOLEAN WriteOperation , UCHAR Cylinder , UCHAR Head , UCHAR Sector , - UCHAR NumberOfSectors , BOOLEAN NeedSeek ) ; -NTSTATUS FlFdcDeviceIo(PDEVICE_OBJECT DeviceObject , ULONG Ioctl , PVOID Data ) ; -NTSTATUS FloppyAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) ; -NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS FloppyPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS FloppyPnpComplete(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -NTSTATUS FloppyQueueRequest(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp ) ; -NTSTATUS FloppyStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void FloppyProcessQueuedRequests(PDISKETTE_EXTENSION DisketteExtension ) ; -void FloppyCancelQueuedRequest(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS FlAcpiConfigureFloppy(PDISKETTE_EXTENSION DisketteExtension , PFDC_INFO FdcInfo ) ; -NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension ) ; -#pragma alloc_text(INIT,DriverEntry) -#pragma alloc_text(PAGE,FloppyAddDevice) -#pragma alloc_text(PAGE,FloppyPnp) -#pragma alloc_text(PAGE,FloppyPower) -#pragma alloc_text(PAGE,FlConfigCallBack) -#pragma alloc_text(PAGE,FlInitializeControllerHardware) -#pragma alloc_text(PAGE,FlInterpretError) -#pragma alloc_text(PAGE,FlDatarateSpecifyConfigure) -#pragma alloc_text(PAGE,FlRecalibrateDrive) -#pragma alloc_text(PAGE,FlDetermineMediaType) -#pragma alloc_text(PAGE,FlCheckBootSector) -#pragma alloc_text(PAGE,FlConsolidateMediaTypeWithBootSector) -#pragma alloc_text(PAGE,FlIssueCommand) -#pragma alloc_text(PAGE,FlReadWriteTrack) -#pragma alloc_text(PAGE,FlReadWrite) -#pragma alloc_text(PAGE,FlFormat) -#pragma alloc_text(PAGE,FlFinishOperation) -#pragma alloc_text(PAGE,FlStartDrive) -#pragma alloc_text(PAGE,FloppyThread) -#pragma alloc_text(PAGE,FlAllocateIoBuffer) -#pragma alloc_text(PAGE,FlFreeIoBuffer) -#pragma alloc_text(PAGE,FloppyCreateClose) -#pragma alloc_text(PAGE,FloppyDeviceControl) -#pragma alloc_text(PAGE,FloppyReadWrite) -#pragma alloc_text(PAGE,FlCheckFormatParameters) -#pragma alloc_text(PAGE,FlFdcDeviceIo) -#pragma alloc_text(PAGE,FlHdbit) -void errorFn(void) -{ - - { - ERROR: assert(0); - goto ERROR; -} -} -NTSTATUS myStatus ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -void _BLAST_init(void) -{ - - { - UNLOADED = 0; - NP = 1; - DC = 2; - SKIP1 = 3; - SKIP2 = 4; - MPR1 = 5; - MPR3 = 6; - IPC = 7; - s = UNLOADED; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - return; -} -} -ULONG PagingReferenceCount = 0; -PFAST_MUTEX PagingMutex = (void *)0; -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) -{ NTSTATUS ntStatus ; - PVOID tmp ; - - { - ntStatus = 0L; - { - } - { - DriverObject->MajorFunction[0] = & FloppyCreateClose; - DriverObject->MajorFunction[2] = & FloppyCreateClose; - DriverObject->MajorFunction[3] = & FloppyReadWrite; - DriverObject->MajorFunction[4] = & FloppyReadWrite; - DriverObject->MajorFunction[14] = & FloppyDeviceControl; - DriverObject->MajorFunction[27] = & FloppyPnp; - DriverObject->MajorFunction[22] = & FloppyPower; - DriverObject->DriverUnload = & FloppyUnload; - (DriverObject->DriverExtension)->AddDevice = & FloppyAddDevice; - tmp = ExAllocatePoolWithTag(0, sizeof(FAST_MUTEX ), 1886350406UL); - PagingMutex = tmp; - } - if ((unsigned int )PagingMutex == (unsigned int )((void *)0)) { - return (-1073741670L); - } else { - - } - { - PagingMutex->Count = 1; - PagingMutex->Contention = 0; -/* KeInitializeEvent(& PagingMutex->Event, 1, 0); */ /* INLINED */ -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - DriveMediaLimits = (struct _DRIVE_MEDIA_LIMITS *)(_DriveMediaLimits_NEC98); - } else { - DriveMediaLimits = _DriveMediaLimits; - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - DriveMediaConstants = _DriveMediaConstants_NEC98; - } else { - DriveMediaConstants = _DriveMediaConstants; +DRIVE_MEDIA_LIMITS _DriveMediaLimits[5] = { + {4, 0}, {11, 6}, {5, 5}, {13, 12}, {16, 14}}; +DRIVE_MEDIA_LIMITS_NEC98 _DriveMediaLimits_NEC98[6] = { + {4, 0}, {13, 5}, {11, 5}, {18, 14}, {18, 14}, {20, 19}}; +PDRIVE_MEDIA_LIMITS DriveMediaLimits; +DRIVE_MEDIA_CONSTANTS _DriveMediaConstants[17] = { + {10, 223, 2, 37, 2, 512, 8, 42, 80, 246, + 15, 1000, 1000, 39, 0, 2, 1, 255, 254, 0}, + {9, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 1000, 1000, 39, 0, 2, 1, 255, 252, 0}, + {7, 223, 2, 37, 2, 512, 8, 42, 80, 246, + 15, 1000, 1000, 39, 0, 2, 2, 255, 255, 0}, + {8, 223, 2, 37, 3, 1024, 4, 128, 240, 246, + 15, 1000, 1000, 39, 0, 2, 2, 255, 255, 0}, + {6, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 250, 1000, 39, 0, 2, 2, 255, 253, 0}, + {5, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 500, 1000, 79, 0, 2, 2, 255, 249, 2}, + {10, 223, 2, 37, 2, 512, 8, 42, 80, 246, + 15, 1000, 1000, 39, 1, 1, 1, 255, 254, 0}, + {9, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 1000, 1000, 39, 1, 1, 1, 255, 252, 0}, + {7, 223, 2, 37, 2, 512, 8, 42, 80, 246, + 15, 1000, 1000, 39, 1, 1, 2, 255, 255, 0}, + {8, 223, 2, 37, 3, 1024, 4, 128, 240, 246, + 15, 1000, 1000, 39, 1, 1, 2, 255, 255, 0}, + {6, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 625, 1000, 39, 1, 1, 2, 255, 253, 0}, + {1, 223, 2, 37, 2, 512, 15, 27, 84, 246, + 15, 625, 1000, 79, 0, 0, 2, 255, 249, 0}, + {5, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 500, 1000, 79, 0, 2, 2, 255, 249, 2}, + {2, 175, 2, 37, 2, 512, 18, 27, 101, 246, + 15, 500, 1000, 79, 0, 0, 2, 255, 240, 3}, + {5, 225, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 500, 1000, 79, 0, 2, 2, 255, 249, 2}, + {2, 209, 2, 37, 2, 512, 18, 27, 101, 246, + 15, 500, 1000, 79, 0, 0, 2, 255, 240, 3}, + {3, 161, 2, 37, 2, 512, 36, 56, 83, 246, + 15, 500, 1000, 79, 0, 3, 2, 255, 240, 6}}; +DRIVE_MEDIA_CONSTANTS _DriveMediaConstants_NEC98[21] = { + {10, 223, 2, 37, 2, 512, 8, 42, 80, 246, + 15, 1000, 1000, 39, 0, 2, 1, 255, 254, 0}, + {9, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 1000, 1000, 39, 0, 2, 1, 255, 252, 0}, + {7, 223, 2, 37, 2, 512, 8, 42, 80, 246, + 15, 1000, 1000, 39, 0, 2, 2, 255, 255, 0}, + {8, 223, 2, 37, 3, 1024, 4, 128, 240, 246, + 15, 1000, 1000, 39, 0, 2, 2, 255, 255, 0}, + {6, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 250, 1000, 39, 0, 2, 2, 255, 253, 0}, + {10, 223, 22, 37, 2, 512, 8, 42, 80, 229, + 15, 1000, 1000, 39, 1, 2, 1, 255, 254, 0}, + {9, 223, 22, 37, 2, 512, 9, 42, 80, 229, + 15, 1000, 1000, 39, 1, 2, 1, 255, 252, 0}, + {7, 223, 22, 37, 2, 512, 8, 42, 80, 229, + 15, 1000, 1000, 39, 1, 2, 2, 255, 255, 0}, + {8, 223, 22, 37, 3, 1024, 4, 128, 240, 229, + 15, 1000, 1000, 39, 1, 2, 2, 255, 255, 0}, + {6, 223, 22, 37, 2, 512, 9, 42, 80, 229, + 15, 1000, 1000, 39, 1, 2, 2, 255, 253, 0}, + {15, 223, 22, 37, 2, 512, 8, 42, 80, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 251, 0}, + {16, 223, 22, 37, 2, 512, 9, 42, 80, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 249, 2}, + {1, 207, 36, 37, 2, 512, 15, 27, 84, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 249, 0}, + {19, 207, 36, 37, 3, 1024, 8, 53, 116, 229, + 15, 1000, 1000, 76, 0, 0, 2, 255, 254, 0}, + {14, 223, 22, 37, 2, 512, 8, 42, 80, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 251, 0}, + {5, 223, 22, 37, 2, 512, 9, 42, 80, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 249, 2}, + {17, 207, 36, 37, 2, 512, 15, 27, 84, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 249, 0}, + {18, 207, 36, 37, 3, 1024, 8, 53, 116, 229, + 15, 1000, 1000, 76, 0, 0, 2, 255, 254, 0}, + {2, 223, 36, 37, 2, 512, 18, 27, 108, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 240, 3}, + {1, 191, 50, 37, 2, 512, 15, 27, 84, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 249, 0}, + {19, 191, 50, 37, 3, 1024, 8, 53, 116, 229, + 15, 1000, 1000, 76, 0, 0, 2, 255, 254, 0}}; +PDRIVE_MEDIA_CONSTANTS DriveMediaConstants; +SENSE_DEVISE_STATUS_PTOS Result_Status3_PTOS[4]; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath); +void FloppyUnload(PDRIVER_OBJECT DriverObject); +NTSTATUS FlConfigCallBack(PVOID Context, PUNICODE_STRING PathName, + INTERFACE_TYPE BusType, ULONG BusNumber, + PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, + ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, + ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation); +NTSTATUS FlInitializeControllerHardware(PDISKETTE_EXTENSION DisketteExtension); +NTSTATUS FloppyCreateClose(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS FloppyReadWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS FlRecalibrateDrive(PDISKETTE_EXTENSION DisketteExtension); +NTSTATUS FlDatarateSpecifyConfigure(PDISKETTE_EXTENSION DisketteExtension); +NTSTATUS FlStartDrive(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp, + BOOLEAN WriteOperation, BOOLEAN SetUpMedia, + BOOLEAN IgnoreChange); +void FlFinishOperation(PIRP Irp, PDISKETTE_EXTENSION DisketteExtension); +NTSTATUS FlDetermineMediaType(PDISKETTE_EXTENSION DisketteExtension); +void FloppyThread(PVOID Context); +NTSTATUS FlReadWrite(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp, + BOOLEAN DriveStarted); +NTSTATUS FlFormat(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp); +NTSTATUS FlIssueCommand(PDISKETTE_EXTENSION DisketteExtension, + PUCHAR FifoInBuffer, PUCHAR FifoOutBuffer, PMDL IoMdl, + ULONG IoOffset, ULONG TransferBytes); +BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension, + PFORMAT_PARAMETERS FormatParameters); +NTSTATUS FlQueueIrpToThread(PIRP Irp, PDISKETTE_EXTENSION DisketteExtension); +NTSTATUS FlInterpretError(UCHAR StatusRegister1, UCHAR StatusRegister2); +void FlAllocateIoBuffer(PDISKETTE_EXTENSION DisketteExtension, + ULONG BufferSize); +void FlFreeIoBuffer(PDISKETTE_EXTENSION DisketteExtension); +void FlConsolidateMediaTypeWithBootSector(PDISKETTE_EXTENSION DisketteExtension, + PBOOT_SECTOR_INFO BootSector); +void FlCheckBootSector(PDISKETTE_EXTENSION DisketteExtension); +NTSTATUS FlReadWriteTrack(PDISKETTE_EXTENSION DisketteExtension, PMDL IoMdl, + ULONG IoOffset, BOOLEAN WriteOperation, + UCHAR Cylinder, UCHAR Head, UCHAR Sector, + UCHAR NumberOfSectors, BOOLEAN NeedSeek); +NTSTATUS FlFdcDeviceIo(PDEVICE_OBJECT DeviceObject, ULONG Ioctl, PVOID Data); +NTSTATUS FloppyAddDevice(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject); +NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS FloppyPower(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS FloppyPnpComplete(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context); +NTSTATUS FloppyQueueRequest(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp); +NTSTATUS FloppyStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void FloppyProcessQueuedRequests(PDISKETTE_EXTENSION DisketteExtension); +void FloppyCancelQueuedRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS FlAcpiConfigureFloppy(PDISKETTE_EXTENSION DisketteExtension, + PFDC_INFO FdcInfo); +NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension); +#pragma alloc_text(INIT, DriverEntry) +#pragma alloc_text(PAGE, FloppyAddDevice) +#pragma alloc_text(PAGE, FloppyPnp) +#pragma alloc_text(PAGE, FloppyPower) +#pragma alloc_text(PAGE, FlConfigCallBack) +#pragma alloc_text(PAGE, FlInitializeControllerHardware) +#pragma alloc_text(PAGE, FlInterpretError) +#pragma alloc_text(PAGE, FlDatarateSpecifyConfigure) +#pragma alloc_text(PAGE, FlRecalibrateDrive) +#pragma alloc_text(PAGE, FlDetermineMediaType) +#pragma alloc_text(PAGE, FlCheckBootSector) +#pragma alloc_text(PAGE, FlConsolidateMediaTypeWithBootSector) +#pragma alloc_text(PAGE, FlIssueCommand) +#pragma alloc_text(PAGE, FlReadWriteTrack) +#pragma alloc_text(PAGE, FlReadWrite) +#pragma alloc_text(PAGE, FlFormat) +#pragma alloc_text(PAGE, FlFinishOperation) +#pragma alloc_text(PAGE, FlStartDrive) +#pragma alloc_text(PAGE, FloppyThread) +#pragma alloc_text(PAGE, FlAllocateIoBuffer) +#pragma alloc_text(PAGE, FlFreeIoBuffer) +#pragma alloc_text(PAGE, FloppyCreateClose) +#pragma alloc_text(PAGE, FloppyDeviceControl) +#pragma alloc_text(PAGE, FloppyReadWrite) +#pragma alloc_text(PAGE, FlCheckFormatParameters) +#pragma alloc_text(PAGE, FlFdcDeviceIo) +#pragma alloc_text(PAGE, FlHdbit) +void errorFn(void) { + + { + ERROR: + assert(0); + goto ERROR; + } +} +NTSTATUS myStatus; +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +void _BLAST_init(void) { + + { + UNLOADED = 0; + NP = 1; + DC = 2; + SKIP1 = 3; + SKIP2 = 4; + MPR1 = 5; + MPR3 = 6; + IPC = 7; + s = UNLOADED; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + return; } - return (ntStatus); -} } -void FloppyUnload(PDRIVER_OBJECT DriverObject ) -{ - - { - { - } - { -/* ExFreePool(PagingMutex); */ /* INLINED */ +ULONG PagingReferenceCount = 0; +PFAST_MUTEX PagingMutex = (void *)0; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, + PUNICODE_STRING RegistryPath) { + NTSTATUS ntStatus; + PVOID tmp; + + { + ntStatus = 0L; + {} { + DriverObject->MajorFunction[0] = &FloppyCreateClose; + DriverObject->MajorFunction[2] = &FloppyCreateClose; + DriverObject->MajorFunction[3] = &FloppyReadWrite; + DriverObject->MajorFunction[4] = &FloppyReadWrite; + DriverObject->MajorFunction[14] = &FloppyDeviceControl; + DriverObject->MajorFunction[27] = &FloppyPnp; + DriverObject->MajorFunction[22] = &FloppyPower; + DriverObject->DriverUnload = &FloppyUnload; + (DriverObject->DriverExtension)->AddDevice = &FloppyAddDevice; + tmp = ExAllocatePoolWithTag(0, sizeof(FAST_MUTEX), 1886350406UL); + PagingMutex = tmp; + } + if ((unsigned int)PagingMutex == (unsigned int)((void *)0)) { + return (-1073741670L); + } else { + } + { + PagingMutex->Count = 1; + PagingMutex->Contention = 0; + /* KeInitializeEvent(& PagingMutex->Event, 1, 0); */ /* INLINED */ + /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + DriveMediaLimits = + (struct _DRIVE_MEDIA_LIMITS *)(_DriveMediaLimits_NEC98); + } else { + DriveMediaLimits = _DriveMediaLimits; + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + DriveMediaConstants = _DriveMediaConstants_NEC98; + } else { + DriveMediaConstants = _DriveMediaConstants; + } + return (ntStatus); } - return; -} } -NTSTATUS FloppyAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) -{ NTSTATUS ntStatus ; - PDEVICE_OBJECT deviceObject ; - PDISKETTE_EXTENSION disketteExtension ; - FDC_INFO fdcInfo ; - UCHAR arcNameBuffer[256] ; - STRING arcNameString ; - WCHAR deviceNameBuffer[20] ; - UNICODE_STRING deviceName ; - USHORT i ; - USHORT tmp ; - PVOID tmp___0 ; - PCONFIGURATION_INFORMATION tmp___1 ; +void FloppyUnload(PDRIVER_OBJECT DriverObject) { { - ntStatus = 0L; - { - } - { - fdcInfo.BufferCount = 0; - fdcInfo.BufferSize = 0; - ntStatus = FlFdcDeviceIo(PhysicalDeviceObject, ((7 << 16) | (770 << 2)) | 3, & fdcInfo); - } - if (ntStatus >= 0L) { - i = 0; - { - while (1) { - while_3_continue: /* CIL Label */ ; - { - tmp = i; - i = (USHORT )((int )i + 1); - swprintf(deviceNameBuffer, "\\\000D\000e\000v\000i\000c\000e\000\\\000F\000l\000o\000p\000p\000y\000%\000d\000", - tmp); -/* RtlInitUnicodeString(& deviceName, deviceNameBuffer); */ /* INLINED */ - ntStatus = IoCreateDevice(DriverObject, sizeof(DISKETTE_EXTENSION ), & deviceName, - 7, 261, 0, & deviceObject); - } - if (ntStatus == -1073741771L) { - - } else { - goto while_3_break; - } + {} { /* ExFreePool(PagingMutex); */ /* INLINED */ } - while_3_break: /* CIL Label */ ; + return; + } +} +NTSTATUS FloppyAddDevice(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject) { + NTSTATUS ntStatus; + PDEVICE_OBJECT deviceObject; + PDISKETTE_EXTENSION disketteExtension; + FDC_INFO fdcInfo; + UCHAR arcNameBuffer[256]; + STRING arcNameString; + WCHAR deviceNameBuffer[20]; + UNICODE_STRING deviceName; + USHORT i; + USHORT tmp; + PVOID tmp___0; + PCONFIGURATION_INFORMATION tmp___1; + + { + ntStatus = 0L; + {} { + fdcInfo.BufferCount = 0; + fdcInfo.BufferSize = 0; + ntStatus = FlFdcDeviceIo(PhysicalDeviceObject, + ((7 << 16) | (770 << 2)) | 3, &fdcInfo); } if (ntStatus >= 0L) { - disketteExtension = (DISKETTE_EXTENSION *)deviceObject->DeviceExtension; - { - } + i = 0; { - tmp___0 = ExAllocatePoolWithTag(1, deviceName.Length, 1886350406UL); - disketteExtension->DeviceName.Buffer = tmp___0; - } - if ((unsigned int )disketteExtension->DeviceName.Buffer == (unsigned int )((void *)0)) { - { -/* IoDeleteDevice(deviceObject); */ /* INLINED */ - } - return (-1073741670L); - } else { + while (1) { + while_3_continue: /* CIL Label */; + { + tmp = i; + i = (USHORT)((int)i + 1); + swprintf(deviceNameBuffer, "\\\000D\000e\000v\000i\000c\000e\000\\" + "\000F\000l\000o\000p\000p\000y\000%" + "\000d\000", + tmp); + /* RtlInitUnicodeString(& deviceName, deviceNameBuffer); */ /* INLINED */ + ntStatus = IoCreateDevice(DriverObject, sizeof(DISKETTE_EXTENSION), + &deviceName, 7, 261, 0, &deviceObject); + } + if (ntStatus == -1073741771L) { - } - { - disketteExtension->DeviceName.Length = 0; - disketteExtension->DeviceName.MaximumLength = deviceName.Length; -/* RtlCopyUnicodeString(& disketteExtension->DeviceName, & deviceName); */ /* INLINED */ - tmp___1 = IoGetConfigurationInformation(); - tmp___1->FloppyCount += 1UL; - sprintf(arcNameBuffer, "%s(%d)disk(%d)fdisk(%d)", "\\ArcName\\multi", fdcInfo.BusNumber, - fdcInfo.ControllerNumber, fdcInfo.PeripheralNumber); -/* RtlInitString(& arcNameString, arcNameBuffer); */ /* INLINED */ - ntStatus = RtlAnsiStringToUnicodeString(& disketteExtension->ArcName, & arcNameString, - 1); + } else { + goto while_3_break; + } + } + while_3_break: /* CIL Label */; } if (ntStatus >= 0L) { + disketteExtension = (DISKETTE_EXTENSION *)deviceObject->DeviceExtension; + {} { + tmp___0 = ExAllocatePoolWithTag(1, deviceName.Length, 1886350406UL); + disketteExtension->DeviceName.Buffer = tmp___0; + } + if ((unsigned int)disketteExtension->DeviceName.Buffer == + (unsigned int)((void *)0)) { + { /* IoDeleteDevice(deviceObject); */ /* INLINED */ + } + return (-1073741670L); + } else { + } { - IoCreateSymbolicLink(& disketteExtension->ArcName, & deviceName); + disketteExtension->DeviceName.Length = 0; + disketteExtension->DeviceName.MaximumLength = deviceName.Length; + /* RtlCopyUnicodeString(& disketteExtension->DeviceName, & deviceName); */ /* INLINED */ + tmp___1 = IoGetConfigurationInformation(); + tmp___1->FloppyCount += 1UL; + sprintf(arcNameBuffer, "%s(%d)disk(%d)fdisk(%d)", "\\ArcName\\multi", + fdcInfo.BusNumber, fdcInfo.ControllerNumber, + fdcInfo.PeripheralNumber); + /* RtlInitString(& arcNameString, arcNameBuffer); */ /* INLINED + */ + ntStatus = RtlAnsiStringToUnicodeString(&disketteExtension->ArcName, + &arcNameString, 1); + } + if (ntStatus >= 0L) { + { IoCreateSymbolicLink(&disketteExtension->ArcName, &deviceName); } + } else { + } + deviceObject->Flags |= 8208UL; + if (deviceObject->AlignmentRequirement < 1UL) { + deviceObject->AlignmentRequirement = 1; + } else { + } + deviceObject->Flags &= 4294967167UL; + disketteExtension->DriverObject = DriverObject; + disketteExtension->UnderlyingPDO = PhysicalDeviceObject; + {} { + disketteExtension->TargetObject = + IoAttachDeviceToDeviceStack(deviceObject, PhysicalDeviceObject); + } + {} { + /* KeInitializeSemaphore(& disketteExtension->RequestSemaphore, 0L, 2147483647); */ /* INLINED */ + disketteExtension->PowerDownMutex.Count = 1; + disketteExtension->PowerDownMutex.Contention = 0; + /* KeInitializeEvent(& disketteExtension->PowerDownMutex.Event, 1, 0); */ /* INLINED */ + /* KeInitializeSpinLock(& disketteExtension->ListSpinLock); */ /* INLINED */ + disketteExtension->ThreadReferenceMutex.Count = 1; + disketteExtension->ThreadReferenceMutex.Contention = 0; + /* KeInitializeEvent(& disketteExtension->ThreadReferenceMutex.Event, 1, 0); */ /* INLINED */ + disketteExtension->HoldNewReqMutex.Count = 1; + disketteExtension->HoldNewReqMutex.Contention = 0; + /* KeInitializeEvent(& disketteExtension->HoldNewReqMutex.Event, 1, 0); */ /* INLINED */ + disketteExtension->ListEntry.Blink = &disketteExtension->ListEntry; + disketteExtension->ListEntry.Flink = + disketteExtension->ListEntry.Blink; + disketteExtension->ThreadReferenceCount = -1; + disketteExtension->IsStarted = 0; + disketteExtension->IsRemoved = 0; + disketteExtension->HoldNewRequests = 0; + disketteExtension->NewRequestQueue.Blink = + &disketteExtension->NewRequestQueue; + disketteExtension->NewRequestQueue.Flink = + disketteExtension->NewRequestQueue.Blink; + /* KeInitializeSpinLock(& disketteExtension->NewRequestQueueSpinLock); */ /* INLINED */ + /* KeInitializeSpinLock(& disketteExtension->FlCancelSpinLock); */ /* INLINED */ + disketteExtension->FloppyControllerAllocated = 0; + disketteExtension->ReleaseFdcWithMotorRunning = 0; + disketteExtension->DeviceObject = deviceObject; + disketteExtension->IsReadOnly = 0; + disketteExtension->MediaType = -1; + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + disketteExtension->ControllerConfigurable = 0; + } else { + disketteExtension->ControllerConfigurable = 1; } } else { - - } - deviceObject->Flags |= 8208UL; - if (deviceObject->AlignmentRequirement < 1UL) { - deviceObject->AlignmentRequirement = 1; - } else { - - } - deviceObject->Flags &= 4294967167UL; - disketteExtension->DriverObject = DriverObject; - disketteExtension->UnderlyingPDO = PhysicalDeviceObject; - { - } - { - disketteExtension->TargetObject = IoAttachDeviceToDeviceStack(deviceObject, - PhysicalDeviceObject); - } - { - } - { -/* KeInitializeSemaphore(& disketteExtension->RequestSemaphore, 0L, 2147483647); */ /* INLINED */ - disketteExtension->PowerDownMutex.Count = 1; - disketteExtension->PowerDownMutex.Contention = 0; -/* KeInitializeEvent(& disketteExtension->PowerDownMutex.Event, 1, 0); */ /* INLINED */ -/* KeInitializeSpinLock(& disketteExtension->ListSpinLock); */ /* INLINED */ - disketteExtension->ThreadReferenceMutex.Count = 1; - disketteExtension->ThreadReferenceMutex.Contention = 0; -/* KeInitializeEvent(& disketteExtension->ThreadReferenceMutex.Event, 1, 0); */ /* INLINED */ - disketteExtension->HoldNewReqMutex.Count = 1; - disketteExtension->HoldNewReqMutex.Contention = 0; -/* KeInitializeEvent(& disketteExtension->HoldNewReqMutex.Event, 1, 0); */ /* INLINED */ - disketteExtension->ListEntry.Blink = & disketteExtension->ListEntry; - disketteExtension->ListEntry.Flink = disketteExtension->ListEntry.Blink; - disketteExtension->ThreadReferenceCount = -1; - disketteExtension->IsStarted = 0; - disketteExtension->IsRemoved = 0; - disketteExtension->HoldNewRequests = 0; - disketteExtension->NewRequestQueue.Blink = & disketteExtension->NewRequestQueue; - disketteExtension->NewRequestQueue.Flink = disketteExtension->NewRequestQueue.Blink; -/* KeInitializeSpinLock(& disketteExtension->NewRequestQueueSpinLock); */ /* INLINED */ -/* KeInitializeSpinLock(& disketteExtension->FlCancelSpinLock); */ /* INLINED */ - disketteExtension->FloppyControllerAllocated = 0; - disketteExtension->ReleaseFdcWithMotorRunning = 0; - disketteExtension->DeviceObject = deviceObject; - disketteExtension->IsReadOnly = 0; - disketteExtension->MediaType = -1; - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - disketteExtension->ControllerConfigurable = 0; - } else { - disketteExtension->ControllerConfigurable = 1; } } else { - } - } else { - + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FlConfigCallBack(PVOID Context , PUNICODE_STRING PathName , INTERFACE_TYPE BusType , - ULONG BusNumber , PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) -{ PDISKETTE_EXTENSION disketteExtension ; - ULONG i ; - PCM_FULL_RESOURCE_DESCRIPTOR peripheralData ; - PCM_PARTIAL_RESOURCE_DESCRIPTOR partial ; - PCM_FLOPPY_DEVICE_DATA fDeviceData ; - UCHAR driveType ; - PDRIVE_MEDIA_CONSTANTS biosDriveMediaConstants ; - - { - disketteExtension = Context; - if (! ((UCHAR *)*(PeripheralInformation + 1) + (*(PeripheralInformation + 1))->DataLength)) { - return (-1073741811L); - } else { - - } - peripheralData = (struct _CM_FULL_RESOURCE_DESCRIPTOR *)((UCHAR *)*(PeripheralInformation + 1) + (*(PeripheralInformation + 1))->DataOffset); - i = 0; - { - while (1) { - while_7_continue: /* CIL Label */ ; - if (i < peripheralData->PartialResourceList.Count) { - +NTSTATUS FlConfigCallBack(PVOID Context, PUNICODE_STRING PathName, + INTERFACE_TYPE BusType, ULONG BusNumber, + PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, + ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, + ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation) { + PDISKETTE_EXTENSION disketteExtension; + ULONG i; + PCM_FULL_RESOURCE_DESCRIPTOR peripheralData; + PCM_PARTIAL_RESOURCE_DESCRIPTOR partial; + PCM_FLOPPY_DEVICE_DATA fDeviceData; + UCHAR driveType; + PDRIVE_MEDIA_CONSTANTS biosDriveMediaConstants; + + { + disketteExtension = Context; + if (!((UCHAR *)*(PeripheralInformation + 1) + + (*(PeripheralInformation + 1))->DataLength)) { + return (-1073741811L); } else { - goto while_7_break; - } - partial = & peripheralData->PartialResourceList.PartialDescriptors[i]; - if ((int )partial->Type == 5) { - biosDriveMediaConstants = & disketteExtension->BiosDriveMediaConstants; - fDeviceData = (struct _CM_FLOPPY_DEVICE_DATA *)(partial + 1); - if (fDeviceData->MaxDensity == 360) { - goto switch_8_360; - } else { - if (fDeviceData->MaxDensity == 1200) { - goto switch_8_1200; + } + peripheralData = (struct _CM_FULL_RESOURCE_DESCRIPTOR + *)((UCHAR *)*(PeripheralInformation + 1) + + (*(PeripheralInformation + 1))->DataOffset); + i = 0; + { + while (1) { + while_7_continue: /* CIL Label */; + if (i < peripheralData->PartialResourceList.Count) { + } else { - if (fDeviceData->MaxDensity == 1185) { - goto switch_8_1185; + goto while_7_break; + } + partial = &peripheralData->PartialResourceList.PartialDescriptors[i]; + if ((int)partial->Type == 5) { + biosDriveMediaConstants = &disketteExtension->BiosDriveMediaConstants; + fDeviceData = (struct _CM_FLOPPY_DEVICE_DATA *)(partial + 1); + if (fDeviceData->MaxDensity == 360) { + goto switch_8_360; } else { - if (fDeviceData->MaxDensity == 1423) { - goto switch_8_1423; + if (fDeviceData->MaxDensity == 1200) { + goto switch_8_1200; } else { - if (fDeviceData->MaxDensity == 1440) { - goto switch_8_1440; + if (fDeviceData->MaxDensity == 1185) { + goto switch_8_1185; } else { - if (fDeviceData->MaxDensity == 2880) { - goto switch_8_2880; + if (fDeviceData->MaxDensity == 1423) { + goto switch_8_1423; } else { - if (fDeviceData->MaxDensity == 1201) { - goto switch_8_1201; + if (fDeviceData->MaxDensity == 1440) { + goto switch_8_1440; } else { - { - goto switch_8_default; - if (0) { - switch_8_360: /* CIL Label */ - driveType = 0; - goto switch_8_break; - switch_8_1200: /* CIL Label */ - driveType = 1; - goto switch_8_break; - switch_8_1185: /* CIL Label */ - driveType = 1; - goto switch_8_break; - switch_8_1423: /* CIL Label */ - driveType = 3; - goto switch_8_break; - switch_8_1440: /* CIL Label */ - driveType = 3; - goto switch_8_break; - switch_8_2880: /* CIL Label */ - driveType = 4; - goto switch_8_break; - switch_8_1201: /* CIL Label */ ; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - driveType = 5; - goto switch_8_break; + if (fDeviceData->MaxDensity == 2880) { + goto switch_8_2880; + } else { + if (fDeviceData->MaxDensity == 1201) { + goto switch_8_1201; } else { - - } - switch_8_default: /* CIL Label */ ; - { - } - driveType = 1; - { + { + goto switch_8_default; + if (0) { + switch_8_360: /* CIL Label */ + driveType = 0; + goto switch_8_break; + switch_8_1200: /* CIL Label */ + driveType = 1; + goto switch_8_break; + switch_8_1185: /* CIL Label */ + driveType = 1; + goto switch_8_break; + switch_8_1423: /* CIL Label */ + driveType = 3; + goto switch_8_break; + switch_8_1440: /* CIL Label */ + driveType = 3; + goto switch_8_break; + switch_8_2880: /* CIL Label */ + driveType = 4; + goto switch_8_break; + switch_8_1201: /* CIL Label */; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + driveType = 5; + goto switch_8_break; + } else { + } + switch_8_default: /* CIL Label */; + {} + driveType = 1; + {} + goto switch_8_break; + } else { + switch_8_break: /* CIL Label */; + } + } } - goto switch_8_break; - } else { - switch_8_break: /* CIL Label */ ; - } } } } } } } - } - } - disketteExtension->DriveType = driveType; - *biosDriveMediaConstants = *(DriveMediaConstants + (DriveMediaLimits + driveType)->HighestDriveMediaType); - if ((int )fDeviceData->Version >= 2) { - biosDriveMediaConstants->StepRateHeadUnloadTime = fDeviceData->StepRateHeadUnloadTime; - biosDriveMediaConstants->HeadLoadTime = fDeviceData->HeadLoadTime; - biosDriveMediaConstants->MotorOffTime = fDeviceData->MotorOffTime; - biosDriveMediaConstants->SectorLengthCode = fDeviceData->SectorLengthCode; - if ((int )fDeviceData->SectorPerTrack == 0) { - return (0L); - } else { - - } - if (fDeviceData->MaxDensity == 0UL) { - return (0L); - } else { - - } - biosDriveMediaConstants->SectorsPerTrack = fDeviceData->SectorPerTrack; - biosDriveMediaConstants->ReadWriteGapLength = fDeviceData->ReadWriteGapLength; - biosDriveMediaConstants->FormatGapLength = fDeviceData->FormatGapLength; - biosDriveMediaConstants->FormatFillCharacter = fDeviceData->FormatFillCharacter; - biosDriveMediaConstants->HeadSettleTime = fDeviceData->HeadSettleTime; - biosDriveMediaConstants->MotorSettleTimeRead = ((int )fDeviceData->MotorSettleTime * 1000) / 8; - biosDriveMediaConstants->MotorSettleTimeWrite = ((int )fDeviceData->MotorSettleTime * 1000) / 8; - if ((int )fDeviceData->MaximumTrackValue == 0) { - return (0L); + disketteExtension->DriveType = driveType; + *biosDriveMediaConstants = + *(DriveMediaConstants + + (DriveMediaLimits + driveType)->HighestDriveMediaType); + if ((int)fDeviceData->Version >= 2) { + biosDriveMediaConstants->StepRateHeadUnloadTime = + fDeviceData->StepRateHeadUnloadTime; + biosDriveMediaConstants->HeadLoadTime = fDeviceData->HeadLoadTime; + biosDriveMediaConstants->MotorOffTime = fDeviceData->MotorOffTime; + biosDriveMediaConstants->SectorLengthCode = + fDeviceData->SectorLengthCode; + if ((int)fDeviceData->SectorPerTrack == 0) { + return (0L); + } else { + } + if (fDeviceData->MaxDensity == 0UL) { + return (0L); + } else { + } + biosDriveMediaConstants->SectorsPerTrack = + fDeviceData->SectorPerTrack; + biosDriveMediaConstants->ReadWriteGapLength = + fDeviceData->ReadWriteGapLength; + biosDriveMediaConstants->FormatGapLength = + fDeviceData->FormatGapLength; + biosDriveMediaConstants->FormatFillCharacter = + fDeviceData->FormatFillCharacter; + biosDriveMediaConstants->HeadSettleTime = + fDeviceData->HeadSettleTime; + biosDriveMediaConstants->MotorSettleTimeRead = + ((int)fDeviceData->MotorSettleTime * 1000) / 8; + biosDriveMediaConstants->MotorSettleTimeWrite = + ((int)fDeviceData->MotorSettleTime * 1000) / 8; + if ((int)fDeviceData->MaximumTrackValue == 0) { + return (0L); + } else { + } + biosDriveMediaConstants->MaximumTrack = + fDeviceData->MaximumTrackValue; + biosDriveMediaConstants->DataLength = + fDeviceData->DataTransferLength; + } else { + } } else { - } - biosDriveMediaConstants->MaximumTrack = fDeviceData->MaximumTrackValue; - biosDriveMediaConstants->DataLength = fDeviceData->DataTransferLength; - } else { - + i += 1UL; } - } else { - + while_7_break: /* CIL Label */; } - i += 1UL; + return (0L); } - while_7_break: /* CIL Label */ ; - } - return (0L); -} } -NTSTATUS FlAcpiConfigureFloppy(PDISKETTE_EXTENSION DisketteExtension , PFDC_INFO FdcInfo ) -{ UCHAR driveType ; - PDRIVE_MEDIA_CONSTANTS biosDriveMediaConstants ; +NTSTATUS FlAcpiConfigureFloppy(PDISKETTE_EXTENSION DisketteExtension, + PFDC_INFO FdcInfo) { + UCHAR driveType; + PDRIVE_MEDIA_CONSTANTS biosDriveMediaConstants; { - biosDriveMediaConstants = & DisketteExtension->BiosDriveMediaConstants; - if (! FdcInfo->AcpiFdiSupported) { - return (-1073741823L); - } else { - - } - if ((enum _ACPI_FDI_DEVICE_TYPE )FdcInfo->AcpiFdiData.DeviceType == 1) { - goto switch_11_1; - } else { - if ((enum _ACPI_FDI_DEVICE_TYPE )FdcInfo->AcpiFdiData.DeviceType == 2) { - goto switch_11_2; + biosDriveMediaConstants = &DisketteExtension->BiosDriveMediaConstants; + if (!FdcInfo->AcpiFdiSupported) { + return (-1073741823L); + } else { + } + if ((enum _ACPI_FDI_DEVICE_TYPE)FdcInfo->AcpiFdiData.DeviceType == 1) { + goto switch_11_1; } else { - if ((enum _ACPI_FDI_DEVICE_TYPE )FdcInfo->AcpiFdiData.DeviceType == 3) { - goto switch_11_3; + if ((enum _ACPI_FDI_DEVICE_TYPE)FdcInfo->AcpiFdiData.DeviceType == 2) { + goto switch_11_2; } else { - if ((enum _ACPI_FDI_DEVICE_TYPE )FdcInfo->AcpiFdiData.DeviceType == 4) { - goto switch_11_4; + if ((enum _ACPI_FDI_DEVICE_TYPE)FdcInfo->AcpiFdiData.DeviceType == 3) { + goto switch_11_3; } else { - if ((enum _ACPI_FDI_DEVICE_TYPE )FdcInfo->AcpiFdiData.DeviceType == 5) { - goto switch_11_5; + if ((enum _ACPI_FDI_DEVICE_TYPE)FdcInfo->AcpiFdiData.DeviceType == + 4) { + goto switch_11_4; } else { - { - goto switch_11_default; - if (0) { - switch_11_1: /* CIL Label */ - driveType = 0; - goto switch_11_break; - switch_11_2: /* CIL Label */ - driveType = 1; - goto switch_11_break; - switch_11_3: /* CIL Label */ - driveType = 2; - goto switch_11_break; - switch_11_4: /* CIL Label */ - driveType = 3; - goto switch_11_break; - switch_11_5: /* CIL Label */ - driveType = 4; - goto switch_11_break; - switch_11_default: /* CIL Label */ - driveType = 1; - goto switch_11_break; + if ((enum _ACPI_FDI_DEVICE_TYPE)FdcInfo->AcpiFdiData.DeviceType == + 5) { + goto switch_11_5; } else { - switch_11_break: /* CIL Label */ ; - } + { + goto switch_11_default; + if (0) { + switch_11_1: /* CIL Label */ + driveType = 0; + goto switch_11_break; + switch_11_2: /* CIL Label */ + driveType = 1; + goto switch_11_break; + switch_11_3: /* CIL Label */ + driveType = 2; + goto switch_11_break; + switch_11_4: /* CIL Label */ + driveType = 3; + goto switch_11_break; + switch_11_5: /* CIL Label */ + driveType = 4; + goto switch_11_break; + switch_11_default: /* CIL Label */ + driveType = 1; + goto switch_11_break; + } else { + switch_11_break: /* CIL Label */; + } + } } } } } } - } - DisketteExtension->DriveType = driveType; - *biosDriveMediaConstants = *(DriveMediaConstants + (DriveMediaLimits + driveType)->HighestDriveMediaType); - biosDriveMediaConstants->StepRateHeadUnloadTime = (unsigned char )FdcInfo->AcpiFdiData.StepRateHeadUnloadTime; - biosDriveMediaConstants->HeadLoadTime = (unsigned char )FdcInfo->AcpiFdiData.HeadLoadTime; - biosDriveMediaConstants->MotorOffTime = (unsigned char )FdcInfo->AcpiFdiData.MotorOffTime; - biosDriveMediaConstants->SectorLengthCode = (unsigned char )FdcInfo->AcpiFdiData.SectorLengthCode; - biosDriveMediaConstants->SectorsPerTrack = (unsigned char )FdcInfo->AcpiFdiData.SectorPerTrack; - biosDriveMediaConstants->ReadWriteGapLength = (unsigned char )FdcInfo->AcpiFdiData.ReadWriteGapLength; - biosDriveMediaConstants->FormatGapLength = (unsigned char )FdcInfo->AcpiFdiData.FormatGapLength; - biosDriveMediaConstants->FormatFillCharacter = (unsigned char )FdcInfo->AcpiFdiData.FormatFillCharacter; - biosDriveMediaConstants->HeadSettleTime = (unsigned char )FdcInfo->AcpiFdiData.HeadSettleTime; - biosDriveMediaConstants->MotorSettleTimeRead = ((int )((unsigned char )FdcInfo->AcpiFdiData.MotorSettleTime) * 1000) / 8; - biosDriveMediaConstants->MotorSettleTimeWrite = ((int )((unsigned short )FdcInfo->AcpiFdiData.MotorSettleTime) * 1000) / 8; - biosDriveMediaConstants->MaximumTrack = (unsigned char )FdcInfo->AcpiFdiData.MaxCylinderNumber; - biosDriveMediaConstants->DataLength = (unsigned char )FdcInfo->AcpiFdiData.DataTransferLength; - return (0L); -} -} -NTSTATUS FlQueueIrpToThread(PIRP Irp , PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS status ; - HANDLE threadHandle ; - PIO_STACK_LOCATION irpSp ; - OBJECT_ATTRIBUTES ObjAttributes ; - - { - { - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; -/* ExAcquireFastMutex(& DisketteExtension->PowerDownMutex); */ /* INLINED */ - } - if ((int )DisketteExtension->PoweringDown == 1) { - { -/* ExReleaseFastMutex(& DisketteExtension->PowerDownMutex); */ /* INLINED */ - } - { - } - myStatus = -1073741101L; - Irp->IoStatus.__annonCompField4.Status = -1073741101L; - Irp->IoStatus.Information = 0; - return (-1073741101L); - } else { + DisketteExtension->DriveType = driveType; + *biosDriveMediaConstants = + *(DriveMediaConstants + + (DriveMediaLimits + driveType)->HighestDriveMediaType); + biosDriveMediaConstants->StepRateHeadUnloadTime = + (unsigned char)FdcInfo->AcpiFdiData.StepRateHeadUnloadTime; + biosDriveMediaConstants->HeadLoadTime = + (unsigned char)FdcInfo->AcpiFdiData.HeadLoadTime; + biosDriveMediaConstants->MotorOffTime = + (unsigned char)FdcInfo->AcpiFdiData.MotorOffTime; + biosDriveMediaConstants->SectorLengthCode = + (unsigned char)FdcInfo->AcpiFdiData.SectorLengthCode; + biosDriveMediaConstants->SectorsPerTrack = + (unsigned char)FdcInfo->AcpiFdiData.SectorPerTrack; + biosDriveMediaConstants->ReadWriteGapLength = + (unsigned char)FdcInfo->AcpiFdiData.ReadWriteGapLength; + biosDriveMediaConstants->FormatGapLength = + (unsigned char)FdcInfo->AcpiFdiData.FormatGapLength; + biosDriveMediaConstants->FormatFillCharacter = + (unsigned char)FdcInfo->AcpiFdiData.FormatFillCharacter; + biosDriveMediaConstants->HeadSettleTime = + (unsigned char)FdcInfo->AcpiFdiData.HeadSettleTime; + biosDriveMediaConstants->MotorSettleTimeRead = + ((int)((unsigned char)FdcInfo->AcpiFdiData.MotorSettleTime) * 1000) / 8; + biosDriveMediaConstants->MotorSettleTimeWrite = + ((int)((unsigned short)FdcInfo->AcpiFdiData.MotorSettleTime) * 1000) / + 8; + biosDriveMediaConstants->MaximumTrack = + (unsigned char)FdcInfo->AcpiFdiData.MaxCylinderNumber; + biosDriveMediaConstants->DataLength = + (unsigned char)FdcInfo->AcpiFdiData.DataTransferLength; + return (0L); + } +} +NTSTATUS FlQueueIrpToThread(PIRP Irp, PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS status; + HANDLE threadHandle; + PIO_STACK_LOCATION irpSp; + OBJECT_ATTRIBUTES ObjAttributes; - } { -/* ExReleaseFastMutex(& DisketteExtension->PowerDownMutex); */ /* INLINED */ - } - { - } - { -/* ExAcquireFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ - DisketteExtension->ThreadReferenceCount += 1L; - } - if (DisketteExtension->ThreadReferenceCount == 0L) { { - DisketteExtension->ThreadReferenceCount += 1L; -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount += 1UL; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + /* ExAcquireFastMutex(& DisketteExtension->PowerDownMutex); */ /* INLINED + */ } - if (PagingReferenceCount == 1UL) { + if ((int)DisketteExtension->PoweringDown == 1) { { -/* MmResetDriverPaging(& DriverEntry); */ /* INLINED */ - } + /* ExReleaseFastMutex(& DisketteExtension->PowerDownMutex); */ /* INLINED */ + } {} + myStatus = -1073741101L; + Irp->IoStatus.__annonCompField4.Status = -1073741101L; + Irp->IoStatus.Information = 0; + return (-1073741101L); } else { - } { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ - ObjAttributes.Length = sizeof(OBJECT_ATTRIBUTES ); - ObjAttributes.RootDirectory = (void *)0; - ObjAttributes.Attributes = 512L; - ObjAttributes.ObjectName = (void *)0; - ObjAttributes.SecurityDescriptor = (void *)0; - ObjAttributes.SecurityQualityOfService = (void *)0; - status = PsCreateSystemThread(& threadHandle, 0UL, & ObjAttributes, (void *)0L, - (void *)0, & FloppyThread, DisketteExtension); - } - if (! (status >= 0L)) { + /* ExReleaseFastMutex(& DisketteExtension->PowerDownMutex); */ /* INLINED + */ + } {} { + /* ExAcquireFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + DisketteExtension->ThreadReferenceCount += 1L; + } + if (DisketteExtension->ThreadReferenceCount == 0L) { { - DisketteExtension->ThreadReferenceCount = -1; -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; + DisketteExtension->ThreadReferenceCount += 1L; + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount += 1UL; + } + if (PagingReferenceCount == 1UL) { + { /* MmResetDriverPaging(& DriverEntry); */ /* INLINED */ + } + } else { } - if (PagingReferenceCount == 0UL) { + { + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + ObjAttributes.Length = sizeof(OBJECT_ATTRIBUTES); + ObjAttributes.RootDirectory = (void *)0; + ObjAttributes.Attributes = 512L; + ObjAttributes.ObjectName = (void *)0; + ObjAttributes.SecurityDescriptor = (void *)0; + ObjAttributes.SecurityQualityOfService = (void *)0; + status = + PsCreateSystemThread(&threadHandle, 0UL, &ObjAttributes, (void *)0L, + (void *)0, &FloppyThread, DisketteExtension); + } + if (!(status >= 0L)) { + { + DisketteExtension->ThreadReferenceCount = -1; + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; + } + if (PagingReferenceCount == 0UL) { + { /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } + } else { + } { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + /* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ } + return (status); } else { - } { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ -/* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + status = ObReferenceObjectByHandle(threadHandle, 1048576L, (void *)0, 0, + &DisketteExtension->FloppyThread, + (void *)0); + ZwClose(threadHandle); + /* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + } + if (!(status >= 0L)) { + return (status); + } else { } - return (status); } else { - - } - { - status = ObReferenceObjectByHandle(threadHandle, 1048576L, (void *)0, 0, & DisketteExtension->FloppyThread, - (void *)0); - ZwClose(threadHandle); -/* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + { + /* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + } } - if (! (status >= 0L)) { - return (status); + (Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation) + ->Control = (int)(Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation) + ->Control | + 1; + if (pended == 0) { + pended = 1; } else { - - } - } else { - { -/* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + { errorFn(); } } - } - (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1; - if (pended == 0) { - pended = 1; - } else { { - errorFn(); + ExfInterlockedInsertTailList( + &DisketteExtension->ListEntry, + &Irp->Tail.Overlay.__annonCompField17.ListEntry, + &DisketteExtension->ListSpinLock); + KeReleaseSemaphore(&DisketteExtension->RequestSemaphore, 0L, 1, 0); } + return (259L); } - { - ExfInterlockedInsertTailList(& DisketteExtension->ListEntry, & Irp->Tail.Overlay.__annonCompField17.ListEntry, - & DisketteExtension->ListSpinLock); - KeReleaseSemaphore(& DisketteExtension->RequestSemaphore, 0L, 1, 0); - } - return (259L); -} -} -NTSTATUS FloppyCreateClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ - - { - { - } - { - myStatus = 0L; - Irp->IoStatus.__annonCompField4.Status = 0L; - Irp->IoStatus.Information = 1; - IofCompleteRequest(Irp, 0); - } - return (0L); } -} -NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - PDISKETTE_EXTENSION disketteExtension ; - PDISK_GEOMETRY outputBuffer ; - NTSTATUS ntStatus ; - ULONG outputBufferLength ; - UCHAR i ; - DRIVE_MEDIA_TYPE lowestDriveMediaType ; - DRIVE_MEDIA_TYPE highestDriveMediaType ; - ULONG formatExParametersSize ; - PFORMAT_EX_PARAMETERS formatExParameters ; - NTSTATUS tmp ; - PMOUNTDEV_NAME mountName ; - PMOUNTDEV_UNIQUE_ID uniqueId ; - BOOLEAN tmp___0 ; - PMOUNTDEV_SUGGESTED_LINK_NAME suggestedName ; - WCHAR driveLetterNameBuffer[10] ; - RTL_QUERY_REGISTRY_TABLE queryTable[2] ; - PWSTR valueName ; - UNICODE_STRING driveLetterName ; - PVOID tmp___1 ; - int tmp___2 ; +NTSTATUS FloppyCreateClose(PDEVICE_OBJECT DeviceObject, PIRP Irp) { { - { - } - { - disketteExtension = DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; -/* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - } - if (disketteExtension->HoldNewRequests) { - if (irpSp->Parameters.DeviceIoControl.IoControlCode != (ULONG )((50 << 16) | (3 << 14))) { - { - ntStatus = FloppyQueueRequest(disketteExtension, Irp); -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - } - return (ntStatus); - } else { - + {} { + myStatus = 0L; + Irp->IoStatus.__annonCompField4.Status = 0L; + Irp->IoStatus.Information = 1; + IofCompleteRequest(Irp, 0); + } + return (0L); + } +} +NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + PDISKETTE_EXTENSION disketteExtension; + PDISK_GEOMETRY outputBuffer; + NTSTATUS ntStatus; + ULONG outputBufferLength; + UCHAR i; + DRIVE_MEDIA_TYPE lowestDriveMediaType; + DRIVE_MEDIA_TYPE highestDriveMediaType; + ULONG formatExParametersSize; + PFORMAT_EX_PARAMETERS formatExParameters; + NTSTATUS tmp; + PMOUNTDEV_NAME mountName; + PMOUNTDEV_UNIQUE_ID uniqueId; + BOOLEAN tmp___0; + PMOUNTDEV_SUGGESTED_LINK_NAME suggestedName; + WCHAR driveLetterNameBuffer[10]; + RTL_QUERY_REGISTRY_TABLE queryTable[2]; + PWSTR valueName; + UNICODE_STRING driveLetterName; + PVOID tmp___1; + int tmp___2; + + { + {} { + disketteExtension = DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + /* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED + */ + } + if (disketteExtension->HoldNewRequests) { + if (irpSp->Parameters.DeviceIoControl.IoControlCode != + (ULONG)((50 << 16) | (3 << 14))) { + { + ntStatus = FloppyQueueRequest(disketteExtension, Irp); + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + } + return (ntStatus); + } else { + } + } else { } - } else { - - } - { -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - } - if (disketteExtension->IsRemoved) { { - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = -1073741738L; - myStatus = -1073741738L; - IofCompleteRequest(Irp, 0); + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED + */ } - return (-1073741738L); - } else { - - } - if (! disketteExtension->IsStarted) { - if (s == NP) { - s = SKIP1; - } else { + if (disketteExtension->IsRemoved) { { - errorFn(); + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = -1073741738L; + myStatus = -1073741738L; + IofCompleteRequest(Irp, 0); } + return (-1073741738L); + } else { } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - tmp = IofCallDriver(disketteExtension->TargetObject, Irp); + if (!disketteExtension->IsStarted) { + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + tmp = IofCallDriver(disketteExtension->TargetObject, Irp); + } + return (tmp); + } else { } - return (tmp); - } else { - - } - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((77UL << 16) | (unsigned long )(2 << 2))) { - goto switch_16_exp_0; - } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == 77UL << 16) { - goto switch_16_exp_1; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + ((77UL << 16) | (unsigned long)(2 << 2))) { + goto switch_16_exp_0; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((7 << 16) | (3 << 14)) | (6 << 2))) { - goto switch_16_exp_2; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == 77UL << 16) { + goto switch_16_exp_1; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((7 << 16) | (3 << 14)) | (11 << 2))) { - goto switch_16_exp_3; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + (((7 << 16) | (3 << 14)) | (6 << 2))) { + goto switch_16_exp_2; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((7 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_16_exp_4; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + (((7 << 16) | (3 << 14)) | (11 << 2))) { + goto switch_16_exp_3; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((45 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_16_exp_5; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + (((7 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_16_exp_4; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == 7 << 16) { - goto switch_16_exp_6; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + (((45 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_16_exp_5; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((7 << 16) | (9 << 2))) { - goto switch_16_exp_7; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + 7 << 16) { + goto switch_16_exp_6; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((7 << 16) | (768 << 2))) { - goto switch_16_exp_8; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + ((7 << 16) | (9 << 2))) { + goto switch_16_exp_7; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((45 << 16) | (768 << 2))) { - goto switch_16_exp_9; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + ((7 << 16) | (768 << 2))) { + goto switch_16_exp_8; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((77UL << 16) | (unsigned long )(3 << 2))) { - goto switch_16_exp_10; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + ((45 << 16) | (768 << 2))) { + goto switch_16_exp_9; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((7 << 16) | (248 << 2))) { - goto switch_16_exp_11; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + ((77UL << 16) | (unsigned long)(3 << 2))) { + goto switch_16_exp_10; } else { - { - goto switch_16_default; - if (0) { - switch_16_exp_0: /* CIL Label */ ; - { - } - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(MOUNTDEV_NAME )) { - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - mountName = Irp->AssociatedIrp.SystemBuffer; - mountName->NameLength = disketteExtension->DeviceName.Length; - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )(sizeof(USHORT ) + (unsigned int )mountName->NameLength)) { - ntStatus = -2147483643L; - Irp->IoStatus.Information = sizeof(MOUNTDEV_NAME ); - goto switch_16_break; - } else { - - } - { - memcpy(mountName->Name, disketteExtension->DeviceName.Buffer, - mountName->NameLength); - ntStatus = 0L; - Irp->IoStatus.Information = sizeof(USHORT ) + (unsigned int )mountName->NameLength; - } - goto switch_16_break; - switch_16_exp_1: /* CIL Label */ ; - { - } - if (! disketteExtension->InterfaceString.Buffer) { - ntStatus = -1073741811L; - goto switch_16_break; - } else { - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(MOUNTDEV_UNIQUE_ID )) { - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - } - uniqueId = Irp->AssociatedIrp.SystemBuffer; - uniqueId->UniqueIdLength = disketteExtension->InterfaceString.Length; - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )(sizeof(USHORT ) + (unsigned int )uniqueId->UniqueIdLength)) { - ntStatus = -2147483643L; - Irp->IoStatus.Information = sizeof(MOUNTDEV_UNIQUE_ID ); - goto switch_16_break; - } else { - - } - { - memcpy(uniqueId->UniqueId, disketteExtension->InterfaceString.Buffer, - uniqueId->UniqueIdLength); - ntStatus = 0L; - Irp->IoStatus.Information = sizeof(USHORT ) + (unsigned int )uniqueId->UniqueIdLength; - } - goto switch_16_break; - switch_16_exp_2: /* CIL Label */ ; - switch_16_exp_3: /* CIL Label */ ; - if (irpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(FORMAT_PARAMETERS )) { - { - } - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + ((7 << 16) | (248 << 2))) { + goto switch_16_exp_11; + } else { { - tmp___0 = FlCheckFormatParameters(disketteExtension, (struct _FORMAT_PARAMETERS *)Irp->AssociatedIrp.SystemBuffer); - } - if (tmp___0) { - - } else { - { - } - ntStatus = -1073741811L; - goto switch_16_break; - } - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((7 << 16) | (3 << 14)) | (11 << 2))) { - if (irpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(FORMAT_EX_PARAMETERS )) { - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - formatExParameters = (struct _FORMAT_EX_PARAMETERS *)Irp->AssociatedIrp.SystemBuffer; - formatExParametersSize = (unsigned long )((long )(& ((FORMAT_EX_PARAMETERS *)0)->SectorNumber)) + (unsigned long )((unsigned int )formatExParameters->SectorsPerTrack * sizeof(USHORT )); - if (irpSp->Parameters.DeviceIoControl.InputBufferLength < formatExParametersSize) { - ntStatus = -1073741811L; + goto switch_16_default; + if (0) { + switch_16_exp_0: /* CIL Label */; + {} + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof(MOUNTDEV_NAME)) { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + mountName = Irp->AssociatedIrp.SystemBuffer; + mountName->NameLength = + disketteExtension->DeviceName.Length; + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)( + sizeof(USHORT) + + (unsigned int)mountName->NameLength)) { + ntStatus = -2147483643L; + Irp->IoStatus.Information = + sizeof(MOUNTDEV_NAME); + goto switch_16_break; + } else { + } + { + memcpy(mountName->Name, + disketteExtension->DeviceName.Buffer, + mountName->NameLength); + ntStatus = 0L; + Irp->IoStatus.Information = + sizeof(USHORT) + + (unsigned int)mountName->NameLength; + } goto switch_16_break; - } else { - if ((int )formatExParameters->FormatGapLength >= 256) { + switch_16_exp_1: /* CIL Label */; + {} + if (!disketteExtension->InterfaceString + .Buffer) { ntStatus = -1073741811L; goto switch_16_break; } else { - if ((int )formatExParameters->SectorsPerTrack >= 256) { + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof(MOUNTDEV_UNIQUE_ID)) { ntStatus = -1073741811L; goto switch_16_break; } else { - } } - } - } else { - - } - switch_16_exp_4: /* CIL Label */ ; - switch_16_exp_5: /* CIL Label */ ; - switch_16_exp_6: /* CIL Label */ ; - switch_16_exp_7: /* CIL Label */ ; - { - } - { - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - goto switch_16_break; - switch_16_exp_8: /* CIL Label */ ; - switch_16_exp_9: /* CIL Label */ ; - { - } - lowestDriveMediaType = (DriveMediaLimits + disketteExtension->DriveType)->LowestDriveMediaType; - highestDriveMediaType = (DriveMediaLimits + disketteExtension->DriveType)->HighestDriveMediaType; - outputBufferLength = irpSp->Parameters.DeviceIoControl.OutputBufferLength; - if (outputBufferLength < (ULONG )sizeof(DISK_GEOMETRY )) { - { - } - ntStatus = -1073741789L; - goto switch_16_break; - } else { - - } - ntStatus = 0L; - if (outputBufferLength < (ULONG )(sizeof(DISK_GEOMETRY ) * (unsigned int )(((int )highestDriveMediaType - (int )lowestDriveMediaType) + 1))) { - { - } - ntStatus = -2147483643L; - highestDriveMediaType = (enum _DRIVE_MEDIA_TYPE )((ULONG )((int )lowestDriveMediaType - 1) + outputBufferLength / (ULONG )sizeof(DISK_GEOMETRY )); - } else { - - } - outputBuffer = (struct _DISK_GEOMETRY *)Irp->AssociatedIrp.SystemBuffer; - i = (unsigned char )lowestDriveMediaType; - { - while (1) { - while_25_continue: /* CIL Label */ ; - if ((int )i <= (int )((unsigned char )highestDriveMediaType)) { - - } else { - goto while_25_break; - } - outputBuffer->MediaType = (DriveMediaConstants + i)->MediaType; - outputBuffer->Cylinders.__annonCompField1.LowPart = (int )(DriveMediaConstants + i)->MaximumTrack + 1; - outputBuffer->Cylinders.__annonCompField1.HighPart = 0; - outputBuffer->TracksPerCylinder = (DriveMediaConstants + i)->NumberOfHeads; - outputBuffer->SectorsPerTrack = (DriveMediaConstants + i)->SectorsPerTrack; - outputBuffer->BytesPerSector = (DriveMediaConstants + i)->BytesPerSector; - { - } - outputBuffer += 1; - Irp->IoStatus.Information += (ULONG_PTR )sizeof(DISK_GEOMETRY ); - i = (UCHAR )((int )i + 1); - } - while_25_break: /* CIL Label */ ; - } - goto switch_16_break; - switch_16_exp_10: /* CIL Label */ ; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - } - if (! (DeviceObject->Characteristics & 1UL)) { - ntStatus = -1073741275L; - goto switch_16_break; - } else { - - } - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(MOUNTDEV_SUGGESTED_LINK_NAME )) { - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - { - tmp___1 = ExAllocatePoolWithTag(1, sizeof(WCHAR ) * 64U, - 1886350406UL); - valueName = tmp___1; - } - if (! valueName) { - ntStatus = -1073741670L; - goto switch_16_break; - } else { - - } - { - memset(valueName, 0, sizeof(WCHAR ) * 64U); - memcpy(valueName, disketteExtension->DeviceName.Buffer, - disketteExtension->DeviceName.Length); - driveLetterName.Buffer = driveLetterNameBuffer; - driveLetterName.MaximumLength = 20; - driveLetterName.Length = 0; - memset(queryTable, 0, 2U * sizeof(RTL_QUERY_REGISTRY_TABLE )); - queryTable[0].Flags = 36; - queryTable[0].Name = valueName; - queryTable[0].EntryContext = & driveLetterName; - ntStatus = RtlQueryRegistryValues(0, "\\\000R\000e\000g\000i\000s\000t\000r\000y\000\\\000M\000a\000c\000h\000i\000n\000e\000\\\000S\000y\000s\000t\000e\000m\000\\\000D\000I\000S\000K\000", - queryTable, (void *)0, - (void *)0); - } - if (! (ntStatus >= 0L)) { + uniqueId = Irp->AssociatedIrp.SystemBuffer; + uniqueId->UniqueIdLength = + disketteExtension->InterfaceString.Length; + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)(sizeof(USHORT) + + (unsigned int) + uniqueId->UniqueIdLength)) { + ntStatus = -2147483643L; + Irp->IoStatus.Information = + sizeof(MOUNTDEV_UNIQUE_ID); + goto switch_16_break; + } else { + } { -/* ExFreePool(valueName); */ /* INLINED */ + memcpy( + uniqueId->UniqueId, + disketteExtension->InterfaceString.Buffer, + uniqueId->UniqueIdLength); + ntStatus = 0L; + Irp->IoStatus.Information = + sizeof(USHORT) + + (unsigned int)uniqueId->UniqueIdLength; } goto switch_16_break; - } else { + switch_16_exp_2: /* CIL Label */; + switch_16_exp_3: /* CIL Label */; + if (irpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(FORMAT_PARAMETERS)) { + {} + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + { + tmp___0 = FlCheckFormatParameters( + disketteExtension, + (struct _FORMAT_PARAMETERS *) + Irp->AssociatedIrp.SystemBuffer); + } + if (tmp___0) { - } - if ((int )driveLetterName.Length != 4) { + } else { + {} + ntStatus = -1073741811L; + goto switch_16_break; + } + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == + (ULONG)(((7 << 16) | (3 << 14)) | + (11 << 2))) { + if (irpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(FORMAT_EX_PARAMETERS)) { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + formatExParameters = + (struct _FORMAT_EX_PARAMETERS *) + Irp->AssociatedIrp.SystemBuffer; + formatExParametersSize = + (unsigned long)(( + long)(&((FORMAT_EX_PARAMETERS *)0) + ->SectorNumber)) + + (unsigned long)((unsigned int) + formatExParameters + ->SectorsPerTrack * + sizeof(USHORT)); + if (irpSp->Parameters.DeviceIoControl + .InputBufferLength < + formatExParametersSize) { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + if ((int)formatExParameters + ->FormatGapLength >= 256) { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + if ((int)formatExParameters + ->SectorsPerTrack >= 256) { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + } + } + } else { + } + switch_16_exp_4: /* CIL Label */; + switch_16_exp_5: /* CIL Label */; + switch_16_exp_6: /* CIL Label */; + switch_16_exp_7: /* CIL Label */; + {} { + ntStatus = FlQueueIrpToThread( + Irp, disketteExtension); + } + goto switch_16_break; + switch_16_exp_8: /* CIL Label */; + switch_16_exp_9: /* CIL Label */; + {} + lowestDriveMediaType = + (DriveMediaLimits + + disketteExtension->DriveType) + ->LowestDriveMediaType; + highestDriveMediaType = + (DriveMediaLimits + + disketteExtension->DriveType) + ->HighestDriveMediaType; + outputBufferLength = + irpSp->Parameters.DeviceIoControl + .OutputBufferLength; + if (outputBufferLength < + (ULONG)sizeof(DISK_GEOMETRY)) { + {} + ntStatus = -1073741789L; + goto switch_16_break; + } else { + } + ntStatus = 0L; + if (outputBufferLength < + (ULONG)( + sizeof(DISK_GEOMETRY) * + (unsigned int)(((int) + highestDriveMediaType - + (int) + lowestDriveMediaType) + + 1))) { + {} + ntStatus = -2147483643L; + highestDriveMediaType = + (enum _DRIVE_MEDIA_TYPE)( + (ULONG)((int)lowestDriveMediaType - + 1) + + outputBufferLength / + (ULONG)sizeof(DISK_GEOMETRY)); + } else { + } + outputBuffer = + (struct _DISK_GEOMETRY *) + Irp->AssociatedIrp.SystemBuffer; + i = (unsigned char)lowestDriveMediaType; { - ntStatus = -1073741275L; -/* ExFreePool(valueName); */ /* INLINED */ + while (1) { + while_25_continue: /* CIL Label */; + if ((int)i <= + (int)((unsigned char) + highestDriveMediaType)) { + + } else { + goto while_25_break; + } + outputBuffer->MediaType = + (DriveMediaConstants + i)->MediaType; + outputBuffer->Cylinders.__annonCompField1 + .LowPart = + (int)(DriveMediaConstants + i) + ->MaximumTrack + + 1; + outputBuffer->Cylinders.__annonCompField1 + .HighPart = 0; + outputBuffer->TracksPerCylinder = + (DriveMediaConstants + + i)->NumberOfHeads; + outputBuffer->SectorsPerTrack = + (DriveMediaConstants + + i)->SectorsPerTrack; + outputBuffer->BytesPerSector = + (DriveMediaConstants + + i)->BytesPerSector; + {} + outputBuffer += 1; + Irp->IoStatus.Information += + (ULONG_PTR)sizeof(DISK_GEOMETRY); + i = (UCHAR)((int)i + 1); + } + while_25_break: /* CIL Label */; } goto switch_16_break; - } else { - if ((int )*(driveLetterName.Buffer + 0) < 65) { + switch_16_exp_10: /* CIL Label */; + if ((int)((KUSER_SHARED_DATA * + const)4292804608U) + ->AlternativeArchitecture == 1) { + {} + if (!(DeviceObject->Characteristics & 1UL)) { + ntStatus = -1073741275L; + goto switch_16_break; + } else { + } + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof( + MOUNTDEV_SUGGESTED_LINK_NAME)) { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } { - ntStatus = -1073741275L; -/* ExFreePool(valueName); */ /* INLINED */ + tmp___1 = ExAllocatePoolWithTag( + 1, sizeof(WCHAR) * 64U, 1886350406UL); + valueName = tmp___1; } - goto switch_16_break; - } else { - if ((int )*(driveLetterName.Buffer + 0) > 90) { + if (!valueName) { + ntStatus = -1073741670L; + goto switch_16_break; + } else { + } + { + memset(valueName, 0, sizeof(WCHAR) * 64U); + memcpy( + valueName, + disketteExtension->DeviceName.Buffer, + disketteExtension->DeviceName.Length); + driveLetterName.Buffer = + driveLetterNameBuffer; + driveLetterName.MaximumLength = 20; + driveLetterName.Length = 0; + memset( + queryTable, 0, + 2U * sizeof(RTL_QUERY_REGISTRY_TABLE)); + queryTable[0].Flags = 36; + queryTable[0].Name = valueName; + queryTable[0].EntryContext = + &driveLetterName; + ntStatus = RtlQueryRegistryValues( + 0, "\\\000R\000e\000g\000i\000s\000t" + "\000r\000y\000\\\000M\000a\000c\000" + "h\000i\000n\000e\000\\\000S\000y" + "\000s\000t\000e\000m\000\\\000D\000" + "I\000S\000K\000", + queryTable, (void *)0, (void *)0); + } + if (!(ntStatus >= 0L)) { { - ntStatus = -1073741275L; -/* ExFreePool(valueName); */ /* INLINED */ + /* ExFreePool(valueName); */ /* INLINED */ } goto switch_16_break; } else { - if ((int )*(driveLetterName.Buffer + 1) != 58) { - { + } + if ((int)driveLetterName.Length != 4) { + { ntStatus = -1073741275L; -/* ExFreePool(valueName); */ /* INLINED */ + /* ExFreePool(valueName); */ /* INLINED */ + } + goto switch_16_break; + } else { + if ((int)*(driveLetterName.Buffer + 0) < + 65) { + { + ntStatus = -1073741275L; + /* ExFreePool(valueName); */ /* INLINED */ } goto switch_16_break; } else { - + if ((int)*(driveLetterName.Buffer + 0) > + 90) { + { + ntStatus = -1073741275L; + /* ExFreePool(valueName); */ /* INLINED */ + } + goto switch_16_break; + } else { + if ((int)*(driveLetterName.Buffer + + 1) != 58) { + { + ntStatus = -1073741275L; + /* ExFreePool(valueName); */ /* INLINED */ + } + goto switch_16_break; + } else { + } + } + } + } + suggestedName = + Irp->AssociatedIrp.SystemBuffer; + suggestedName->UseOnlyIfThereAreNoOtherLinks = + 1; + suggestedName->NameLength = 28; + Irp->IoStatus.Information = + (long)(&((MOUNTDEV_SUGGESTED_LINK_NAME + *)0) + ->Name) + + 28L; + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + Irp->IoStatus.Information) { + { + Irp->IoStatus.Information = + sizeof(MOUNTDEV_SUGGESTED_LINK_NAME); + ntStatus = -2147483643L; + /* ExFreePool(valueName); */ /* INLINED */ } + goto switch_16_break; + } else { } + { + RtlDeleteRegistryValue( + 0, "\\\000R\000e\000g\000i\000s\000t" + "\000r\000y\000\\\000M\000a\000c\000" + "h\000i\000n\000e\000\\\000S\000y" + "\000s\000t\000e\000m\000\\\000D\000" + "I\000S\000K\000", + valueName); + /* ExFreePool(valueName); */ /* INLINED */ + memcpy(suggestedName->Name, + "\\\000D\000o\000s\000D\000e\000v" + "\000i\000c\000e\000s\000\\\000", + 24); + suggestedName->Name[12] = + *(driveLetterName.Buffer + 0); + suggestedName->Name[13] = ':'; + } + goto switch_16_break; + } else { } - } - suggestedName = Irp->AssociatedIrp.SystemBuffer; - suggestedName->UseOnlyIfThereAreNoOtherLinks = 1; - suggestedName->NameLength = 28; - Irp->IoStatus.Information = (long )(& ((MOUNTDEV_SUGGESTED_LINK_NAME *)0)->Name) + 28L; - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < Irp->IoStatus.Information) { - { - Irp->IoStatus.Information = sizeof(MOUNTDEV_SUGGESTED_LINK_NAME ); - ntStatus = -2147483643L; -/* ExFreePool(valueName); */ /* INLINED */ + switch_16_exp_11: /* CIL Label */; + if ((int)((KUSER_SHARED_DATA * + const)4292804608U) + ->AlternativeArchitecture == 1) { + {} + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof(SENSE_DEVISE_STATUS_PTOS)) { + {} + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + {} { + ntStatus = FlQueueIrpToThread( + Irp, disketteExtension); + } + goto switch_16_break; + } else { + } + switch_16_default: /* CIL Label */; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } } - goto switch_16_break; - } else { - - } - { - RtlDeleteRegistryValue(0, "\\\000R\000e\000g\000i\000s\000t\000r\000y\000\\\000M\000a\000c\000h\000i\000n\000e\000\\\000S\000y\000s\000t\000e\000m\000\\\000D\000I\000S\000K\000", - valueName); -/* ExFreePool(valueName); */ /* INLINED */ - memcpy(suggestedName->Name, "\\\000D\000o\000s\000D\000e\000v\000i\000c\000e\000s\000\\\000", - 24); - suggestedName->Name[12] = *(driveLetterName.Buffer + 0); - suggestedName->Name[13] = ':'; - } - goto switch_16_break; - } else { - - } - switch_16_exp_11: /* CIL Label */ ; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - } - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SENSE_DEVISE_STATUS_PTOS )) { { + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16 + .CurrentStackLocation += 1; + ntStatus = IofCallDriver( + disketteExtension->TargetObject, Irp); } - ntStatus = -1073741811L; - goto switch_16_break; + return (ntStatus); } else { - - } - { - } - { - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - goto switch_16_break; - } else { - - } - switch_16_default: /* CIL Label */ ; - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); + switch_16_break: /* CIL Label */; } } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = IofCallDriver(disketteExtension->TargetObject, - Irp); - } - return (ntStatus); - } else { - switch_16_break: /* CIL Label */ ; - } } } } @@ -3121,368 +3240,363 @@ NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } - } - if (ntStatus != 259L) { - Irp->IoStatus.__annonCompField4.Status = ntStatus; - myStatus = ntStatus; - if (! (ntStatus >= 0L)) { - if (ntStatus == -1073741661L) { - tmp___2 = 1; - } else { - if (ntStatus == -1073741643L) { + if (ntStatus != 259L) { + Irp->IoStatus.__annonCompField4.Status = ntStatus; + myStatus = ntStatus; + if (!(ntStatus >= 0L)) { + if (ntStatus == -1073741661L) { tmp___2 = 1; } else { - if (ntStatus == -1073741662L) { + if (ntStatus == -1073741643L) { tmp___2 = 1; } else { - if (ntStatus == -1073741805L) { + if (ntStatus == -1073741662L) { tmp___2 = 1; } else { - if (ntStatus == -2147483626L) { + if (ntStatus == -1073741805L) { tmp___2 = 1; } else { - if (ntStatus == -1073741804L) { + if (ntStatus == -2147483626L) { tmp___2 = 1; } else { - if (ntStatus == -1073741806L) { + if (ntStatus == -1073741804L) { tmp___2 = 1; } else { - tmp___2 = 0; + if (ntStatus == -1073741806L) { + tmp___2 = 1; + } else { + tmp___2 = 0; + } } } } } } } - } - if ((unsigned char )tmp___2) { - { -/* IoSetHardErrorOrVerifyDevice(Irp, DeviceObject); */ /* INLINED */ - } + if ((unsigned char)tmp___2) { + { + /* IoSetHardErrorOrVerifyDevice(Irp, DeviceObject); */ /* INLINED + */ + } + } else { + } } else { - } + { IofCompleteRequest(Irp, 0); } } else { - - } - { - IofCompleteRequest(Irp, 0); } - } else { - + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - PDISKETTE_EXTENSION disketteExtension ; - NTSTATUS ntStatus ; - KEVENT doneEvent ; - PIO_STACK_LOCATION irpSp___0 ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___1 ; - PCONFIGURATION_INFORMATION tmp ; +NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + PDISKETTE_EXTENSION disketteExtension; + NTSTATUS ntStatus; + KEVENT doneEvent; + PIO_STACK_LOCATION irpSp___0; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___1; + PCONFIGURATION_INFORMATION tmp; { - ntStatus = 0L; - { - } - { -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount += 1UL; - } - if (PagingReferenceCount == 1UL) { - { -/* MmResetDriverPaging(& DriverEntry); */ /* INLINED */ + ntStatus = 0L; + {} { + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount += 1UL; + } + if (PagingReferenceCount == 1UL) { + { /* MmResetDriverPaging(& DriverEntry); */ /* INLINED */ + } + } else { } - } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ - disketteExtension = DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - } - if (disketteExtension->IsRemoved) { { - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = -1073741738L; - myStatus = -1073741738L; - IofCompleteRequest(Irp, 0); + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + disketteExtension = DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; } - return (-1073741738L); - } else { - - } - if (irpSp->MinorFunction == 0) { - goto switch_32_0; - } else { - if (irpSp->MinorFunction == 5) { - goto switch_32_5; + if (disketteExtension->IsRemoved) { + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = -1073741738L; + myStatus = -1073741738L; + IofCompleteRequest(Irp, 0); + } + return (-1073741738L); } else { - if (irpSp->MinorFunction == 1) { - goto switch_32_1; + } + if (irpSp->MinorFunction == 0) { + goto switch_32_0; + } else { + if (irpSp->MinorFunction == 5) { + goto switch_32_5; } else { - if (irpSp->MinorFunction == 6) { - goto switch_32_6; + if (irpSp->MinorFunction == 1) { + goto switch_32_1; } else { - if (irpSp->MinorFunction == 3) { - goto switch_32_3; + if (irpSp->MinorFunction == 6) { + goto switch_32_6; } else { - if (irpSp->MinorFunction == 4) { - goto switch_32_4; + if (irpSp->MinorFunction == 3) { + goto switch_32_3; } else { - if (irpSp->MinorFunction == 2) { - goto switch_32_2; + if (irpSp->MinorFunction == 4) { + goto switch_32_4; } else { - { - goto switch_32_default; - if (0) { - switch_32_0: /* CIL Label */ + if (irpSp->MinorFunction == 2) { + goto switch_32_2; + } else { { - ntStatus = FloppyStartDevice(DeviceObject, Irp); - } - goto switch_32_break; - switch_32_5: /* CIL Label */ ; - switch_32_1: /* CIL Label */ ; - if ((int )irpSp->MinorFunction == 5) { - { - } - } else { + goto switch_32_default; + if (0) { + switch_32_0 : /* CIL Label */ { + ntStatus = FloppyStartDevice(DeviceObject, Irp); } - } - if (! disketteExtension->IsStarted) { - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); + goto switch_32_break; + switch_32_5: /* CIL Label */; + switch_32_1: /* CIL Label */; + if ((int)irpSp->MinorFunction == 5) { + {} + } else { + {} + } + if (!disketteExtension->IsStarted) { + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation += 1; + ntStatus = IofCallDriver( + disketteExtension->TargetObject, Irp); + } + return (ntStatus); + } else { } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - return (ntStatus); - } else { - - } - { -/* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - disketteExtension->HoldNewRequests = 1; -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - if (ntStatus == 259L) { - { - KeWaitForSingleObject(disketteExtension->FloppyThread, 0, 0, 0, - (void *)0); - } - if ((unsigned int )disketteExtension->FloppyThread != (unsigned int )((void *)0)) { { -/* ObfDereferenceObject(disketteExtension->FloppyThread); */ /* INLINED */ + /* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + disketteExtension->HoldNewRequests = 1; + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + ntStatus = FlQueueIrpToThread(Irp, disketteExtension); + } + if (ntStatus == 259L) { + { + KeWaitForSingleObject(disketteExtension->FloppyThread, + 0, 0, 0, (void *)0); + } + if ((unsigned int)disketteExtension->FloppyThread != + (unsigned int)((void *)0)) { + { + /* ObfDereferenceObject(disketteExtension->FloppyThread); */ /* INLINED */ + } + } else { + } + disketteExtension->FloppyThread = (void *)0; + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation += 1; + ntStatus = IofCallDriver( + disketteExtension->TargetObject, Irp); + } + } else { + { + ntStatus = -1073741823L; + Irp->IoStatus.__annonCompField4.Status = ntStatus; + myStatus = ntStatus; + Irp->IoStatus.Information = 0; + IofCompleteRequest(Irp, 0); + } + } + goto switch_32_break; + switch_32_6: /* CIL Label */; + switch_32_3: /* CIL Label */; + if ((int)irpSp->MinorFunction == 6) { + {} + } else { + {} + } + if (!disketteExtension->IsStarted) { + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation += 1; + ntStatus = IofCallDriver( + disketteExtension->TargetObject, Irp); + } + } else { + { + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + irpSp___0 = + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation; + nextIrpSp = + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation - + 1; + memcpy(nextIrpSp, irpSp___0, + (long)(&((IO_STACK_LOCATION *)0) + ->CompletionRoutine)); + nextIrpSp->Control = 0; + /* KeInitializeEvent(& doneEvent, 1, 0); */ /* INLINED */ + } + if (s != NP) { + { errorFn(); } + } else { + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + compFptr = &FloppyPnpComplete; + } + } + { + irpSp___1 = + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation - + 1; + irpSp___1->CompletionRoutine = &FloppyPnpComplete; + irpSp___1->Context = &doneEvent; + irpSp___1->Control = 0; + irpSp___1->Control = 64; + irpSp___1->Control = (int)irpSp___1->Control | 128; + irpSp___1->Control = (int)irpSp___1->Control | 32; + ntStatus = IofCallDriver( + disketteExtension->TargetObject, Irp); + } + if (ntStatus == 259L) { + { + KeWaitForSingleObject(&doneEvent, 0, 0, 0, + (void *)0); + ntStatus = myStatus; + } + } else { + } + { + /* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + disketteExtension->HoldNewRequests = 0; + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + FloppyProcessQueuedRequests(disketteExtension); + Irp->IoStatus.__annonCompField4.Status = ntStatus; + myStatus = ntStatus; + Irp->IoStatus.Information = 0; + IofCompleteRequest(Irp, 0); + } + } + goto switch_32_break; + switch_32_4: /* CIL Label */; + {} + disketteExtension->IsStarted = 0; + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } } - } else { - - } - disketteExtension->FloppyThread = (void *)0; - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (s == NP) { - s = SKIP1; - } else { { - errorFn(); + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + ntStatus = + IofCallDriver(disketteExtension->TargetObject, Irp); + } + goto switch_32_break; + switch_32_2: /* CIL Label */; + {} { + /* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + disketteExtension->HoldNewRequests = 0; + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + disketteExtension->IsStarted = 0; + disketteExtension->IsRemoved = 1; + FloppyProcessQueuedRequests(disketteExtension); + } + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - } else { - { - ntStatus = -1073741823L; - Irp->IoStatus.__annonCompField4.Status = ntStatus; - myStatus = ntStatus; - Irp->IoStatus.Information = 0; - IofCompleteRequest(Irp, 0); - } - } - goto switch_32_break; - switch_32_6: /* CIL Label */ ; - switch_32_3: /* CIL Label */ ; - if ((int )irpSp->MinorFunction == 6) { - { - } - } else { - { - } - } - if (! disketteExtension->IsStarted) { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (s == NP) { - s = SKIP1; - } else { { - errorFn(); + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + ntStatus = + IofCallDriver(disketteExtension->TargetObject, Irp); + } + if ((unsigned int)disketteExtension->InterfaceString + .Buffer != (unsigned int)((void *)0)) { + { + IoSetDeviceInterfaceState( + &disketteExtension->InterfaceString, 0); + /* RtlFreeUnicodeString(& disketteExtension->InterfaceString); */ /* INLINED */ + /* RtlInitUnicodeString(& disketteExtension->InterfaceString, (void *)0); */ /* INLINED */ + } + } else { } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - } else { - { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - memcpy(nextIrpSp, irpSp___0, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine)); - nextIrpSp->Control = 0; -/* KeInitializeEvent(& doneEvent, 1, 0); */ /* INLINED */ - } - if (s != NP) { { - errorFn(); + /* RtlFreeUnicodeString(& disketteExtension->DeviceName); */ /* INLINED */ + /* RtlInitUnicodeString(& disketteExtension->DeviceName, (void *)0); */ /* INLINED */ } - } else { - if (compRegistered != 0) { + if ((int)disketteExtension->ArcName.Length != 0) { { - errorFn(); + IoDeleteSymbolicLink(&disketteExtension->ArcName); + /* RtlFreeUnicodeString(& disketteExtension->ArcName); */ /* INLINED */ + /* RtlInitUnicodeString(& disketteExtension->ArcName, (void *)0); */ /* INLINED */ } } else { - compRegistered = 1; - compFptr = & FloppyPnpComplete; } - } - { - irpSp___1 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp___1->CompletionRoutine = & FloppyPnpComplete; - irpSp___1->Context = & doneEvent; - irpSp___1->Control = 0; - irpSp___1->Control = 64; - irpSp___1->Control = (int )irpSp___1->Control | 128; - irpSp___1->Control = (int )irpSp___1->Control | 32; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - if (ntStatus == 259L) { { - KeWaitForSingleObject(& doneEvent, 0, 0, 0, (void *)0); - ntStatus = myStatus; + /* IoDetachDevice(disketteExtension->TargetObject); */ /* INLINED */ + /* IoDeleteDevice(DeviceObject); */ /* INLINED */ + tmp = IoGetConfigurationInformation(); + tmp->FloppyCount -= 1UL; + } + goto switch_32_break; + switch_32_default: /* CIL Label */; + {} + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + ntStatus = + IofCallDriver(disketteExtension->TargetObject, Irp); } } else { - - } - { -/* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - disketteExtension->HoldNewRequests = 0; -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - FloppyProcessQueuedRequests(disketteExtension); - Irp->IoStatus.__annonCompField4.Status = ntStatus; - myStatus = ntStatus; - Irp->IoStatus.Information = 0; - IofCompleteRequest(Irp, 0); - } - } - goto switch_32_break; - switch_32_4: /* CIL Label */ ; - { - } - disketteExtension->IsStarted = 0; - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); - } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - goto switch_32_break; - switch_32_2: /* CIL Label */ ; - { - } - { -/* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - disketteExtension->HoldNewRequests = 0; -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - disketteExtension->IsStarted = 0; - disketteExtension->IsRemoved = 1; - FloppyProcessQueuedRequests(disketteExtension); - } - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); - } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - if ((unsigned int )disketteExtension->InterfaceString.Buffer != (unsigned int )((void *)0)) { - { - IoSetDeviceInterfaceState(& disketteExtension->InterfaceString, - 0); -/* RtlFreeUnicodeString(& disketteExtension->InterfaceString); */ /* INLINED */ -/* RtlInitUnicodeString(& disketteExtension->InterfaceString, (void *)0); */ /* INLINED */ + switch_32_break: /* CIL Label */; } - } else { - - } - { -/* RtlFreeUnicodeString(& disketteExtension->DeviceName); */ /* INLINED */ -/* RtlInitUnicodeString(& disketteExtension->DeviceName, (void *)0); */ /* INLINED */ - } - if ((int )disketteExtension->ArcName.Length != 0) { - { - IoDeleteSymbolicLink(& disketteExtension->ArcName); -/* RtlFreeUnicodeString(& disketteExtension->ArcName); */ /* INLINED */ -/* RtlInitUnicodeString(& disketteExtension->ArcName, (void *)0); */ /* INLINED */ - } - } else { - - } - { -/* IoDetachDevice(disketteExtension->TargetObject); */ /* INLINED */ -/* IoDeleteDevice(DeviceObject); */ /* INLINED */ - tmp = IoGetConfigurationInformation(); - tmp->FloppyCount -= 1UL; - } - goto switch_32_break; - switch_32_default: /* CIL Label */ ; - { - } - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); - } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); } - } else { - switch_32_break: /* CIL Label */ ; - } } } } @@ -3490,3023 +3604,3008 @@ NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } - } - { -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; - } - if (PagingReferenceCount == 0UL) { { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; } - } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + if (PagingReferenceCount == 0UL) { + { /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } + } else { + } + { /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + } + return (ntStatus); } - return (ntStatus); -} } -NTSTATUS FloppyStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ NTSTATUS ntStatus ; - NTSTATUS pnpStatus ; - KEVENT doneEvent ; - FDC_INFO fdcInfo ; - CONFIGURATION_TYPE Dc ; - CONFIGURATION_TYPE Fp ; - PDISKETTE_EXTENSION disketteExtension ; - PIO_STACK_LOCATION irpSp ; - PIO_STACK_LOCATION irpSp___0 ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___1 ; - INTERFACE_TYPE InterfaceType ; - - { - Dc = 13; - Fp = 26; - disketteExtension = (DISKETTE_EXTENSION *)DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - { - } - { - } - { - } - { -/* KeInitializeEvent(& doneEvent, 0, 0); */ /* INLINED */ - irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - memcpy(nextIrpSp, irpSp___0, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine)); - nextIrpSp->Control = 0; - } - if (s != NP) { - { - errorFn(); +NTSTATUS FloppyStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + NTSTATUS ntStatus; + NTSTATUS pnpStatus; + KEVENT doneEvent; + FDC_INFO fdcInfo; + CONFIGURATION_TYPE Dc; + CONFIGURATION_TYPE Fp; + PDISKETTE_EXTENSION disketteExtension; + PIO_STACK_LOCATION irpSp; + PIO_STACK_LOCATION irpSp___0; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___1; + INTERFACE_TYPE InterfaceType; + + { + Dc = 13; + Fp = 26; + disketteExtension = (DISKETTE_EXTENSION *)DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + {} {} {} { + /* KeInitializeEvent(& doneEvent, 0, 0); */ /* INLINED */ + irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + memcpy(nextIrpSp, irpSp___0, + (long)(&((IO_STACK_LOCATION *)0)->CompletionRoutine)); + nextIrpSp->Control = 0; + } + if (s != NP) { + { errorFn(); } + } else { + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + compFptr = &FloppyPnpComplete; + } } - } else { - if (compRegistered != 0) { + { + irpSp___1 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpSp___1->CompletionRoutine = &FloppyPnpComplete; + irpSp___1->Context = &doneEvent; + irpSp___1->Control = 0; + irpSp___1->Control = 64; + irpSp___1->Control = (int)irpSp___1->Control | 128; + irpSp___1->Control = (int)irpSp___1->Control | 32; + ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); + } + if (ntStatus == 259L) { { - errorFn(); + ntStatus = KeWaitForSingleObject(&doneEvent, 0, 0, 0, (void *)0); + ntStatus = myStatus; } } else { - compRegistered = 1; - compFptr = & FloppyPnpComplete; } - } - { - irpSp___1 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp___1->CompletionRoutine = & FloppyPnpComplete; - irpSp___1->Context = & doneEvent; - irpSp___1->Control = 0; - irpSp___1->Control = 64; - irpSp___1->Control = (int )irpSp___1->Control | 128; - irpSp___1->Control = (int )irpSp___1->Control | 32; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - if (ntStatus == 259L) { { - ntStatus = KeWaitForSingleObject(& doneEvent, 0, 0, 0, (void *)0); - ntStatus = myStatus; + fdcInfo.BufferCount = 0; + fdcInfo.BufferSize = 0; + ntStatus = FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (770 << 2)) | 3, &fdcInfo); } - } else { - - } - { - fdcInfo.BufferCount = 0; - fdcInfo.BufferSize = 0; - ntStatus = FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (770 << 2)) | 3, - & fdcInfo); - } - if (ntStatus >= 0L) { - disketteExtension->MaxTransferSize = fdcInfo.MaxTransferSize; - if (fdcInfo.AcpiBios) { - if (fdcInfo.AcpiFdiSupported) { - { - ntStatus = FlAcpiConfigureFloppy(disketteExtension, & fdcInfo); - } - if ((int )disketteExtension->DriveType == 4) { - disketteExtension->PerpendicularMode = (int )disketteExtension->PerpendicularMode | (1 << fdcInfo.PeripheralNumber); + if (ntStatus >= 0L) { + disketteExtension->MaxTransferSize = fdcInfo.MaxTransferSize; + if (fdcInfo.AcpiBios) { + if (fdcInfo.AcpiFdiSupported) { + { ntStatus = FlAcpiConfigureFloppy(disketteExtension, &fdcInfo); } + if ((int)disketteExtension->DriveType == 4) { + disketteExtension->PerpendicularMode = + (int)disketteExtension->PerpendicularMode | + (1 << fdcInfo.PeripheralNumber); + } else { + } } else { - + goto _L; } } else { - goto _L; - } - } else { - _L: /* CIL Label */ - if ((int )disketteExtension->DriveType == 4) { - disketteExtension->PerpendicularMode = (int )disketteExtension->PerpendicularMode | (1 << fdcInfo.PeripheralNumber); - } else { + _L: /* CIL Label */ + if ((int)disketteExtension->DriveType == 4) { + disketteExtension->PerpendicularMode = + (int)disketteExtension->PerpendicularMode | + (1 << fdcInfo.PeripheralNumber); + } else { + } + InterfaceType = 0; + { + while (1) { + while_43_continue: /* CIL Label */; + if ((int)InterfaceType < 16) { + } else { + goto while_43_break; + } + { + fdcInfo.BusType = InterfaceType; + ntStatus = IoQueryDeviceDescription( + &fdcInfo.BusType, &fdcInfo.BusNumber, &Dc, + &fdcInfo.ControllerNumber, &Fp, &fdcInfo.PeripheralNumber, + &FlConfigCallBack, disketteExtension); + } + if (ntStatus >= 0L) { + {} + goto while_43_break; + } else { + } + InterfaceType = (INTERFACE_TYPE)((int)InterfaceType + 1); + } + while_43_break: /* CIL Label */; + } } - InterfaceType = 0; - { - while (1) { - while_43_continue: /* CIL Label */ ; - if ((int )InterfaceType < 16) { - + if (ntStatus >= 0L) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + disketteExtension->DeviceUnit = (unsigned char)fdcInfo.UnitNumber; + disketteExtension->DriveOnValue = (unsigned char)fdcInfo.UnitNumber; } else { - goto while_43_break; + disketteExtension->DeviceUnit = + (unsigned char)fdcInfo.PeripheralNumber; + disketteExtension->DriveOnValue = + (unsigned char)(fdcInfo.PeripheralNumber | + (unsigned long)(16 << fdcInfo.PeripheralNumber)); } { - fdcInfo.BusType = InterfaceType; - ntStatus = IoQueryDeviceDescription(& fdcInfo.BusType, & fdcInfo.BusNumber, - & Dc, & fdcInfo.ControllerNumber, & Fp, - & fdcInfo.PeripheralNumber, & FlConfigCallBack, - disketteExtension); + pnpStatus = IoRegisterDeviceInterface( + disketteExtension->UnderlyingPDO, + (GUID *)(&MOUNTDEV_MOUNTED_DEVICE_GUID), (void *)0, + &disketteExtension->InterfaceString); } - if (ntStatus >= 0L) { + if (pnpStatus >= 0L) { { + pnpStatus = IoSetDeviceInterfaceState( + &disketteExtension->InterfaceString, 1); } - goto while_43_break; } else { - } - InterfaceType = (INTERFACE_TYPE )((int )InterfaceType + 1); - } - while_43_break: /* CIL Label */ ; - } - } - if (ntStatus >= 0L) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - disketteExtension->DeviceUnit = (unsigned char )fdcInfo.UnitNumber; - disketteExtension->DriveOnValue = (unsigned char )fdcInfo.UnitNumber; - } else { - disketteExtension->DeviceUnit = (unsigned char )fdcInfo.PeripheralNumber; - disketteExtension->DriveOnValue = (unsigned char )(fdcInfo.PeripheralNumber | (unsigned long )(16 << fdcInfo.PeripheralNumber)); - } - { - pnpStatus = IoRegisterDeviceInterface(disketteExtension->UnderlyingPDO, (GUID *)(& MOUNTDEV_MOUNTED_DEVICE_GUID), - (void *)0, & disketteExtension->InterfaceString); - } - if (pnpStatus >= 0L) { { - pnpStatus = IoSetDeviceInterfaceState(& disketteExtension->InterfaceString, - 1); + disketteExtension->IsStarted = 1; + /* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + disketteExtension->HoldNewRequests = 0; + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + FloppyProcessQueuedRequests(disketteExtension); } } else { - - } - { - disketteExtension->IsStarted = 1; -/* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - disketteExtension->HoldNewRequests = 0; -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - FloppyProcessQueuedRequests(disketteExtension); } } else { - } - } else { - - } - { - Irp->IoStatus.__annonCompField4.Status = ntStatus; - myStatus = ntStatus; - IofCompleteRequest(Irp, 0); + { + Irp->IoStatus.__annonCompField4.Status = ntStatus; + myStatus = ntStatus; + IofCompleteRequest(Irp, 0); + } + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FloppyPnpComplete(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) -{ +NTSTATUS FloppyPnpComplete(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context) { { - { - KeSetEvent((struct _KEVENT *)Context, 1, 0); + { KeSetEvent((struct _KEVENT *)Context, 1, 0); } + return (-1073741802L); } - return (-1073741802L); } -} -NTSTATUS FloppyPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDISKETTE_EXTENSION disketteExtension ; - NTSTATUS ntStatus ; - PIO_STACK_LOCATION irpSp ; - POWER_STATE_TYPE type ; - POWER_STATE state ; - BOOLEAN WaitForCompletion ; +NTSTATUS FloppyPower(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDISKETTE_EXTENSION disketteExtension; + NTSTATUS ntStatus; + PIO_STACK_LOCATION irpSp; + POWER_STATE_TYPE type; + POWER_STATE state; + BOOLEAN WaitForCompletion; { - ntStatus = myStatus; - WaitForCompletion = 1; - { - } - disketteExtension = DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - type = irpSp->Parameters.Power.Type; - state = irpSp->Parameters.Power.State; - if (irpSp->MinorFunction == 3) { - goto switch_46_3; - } else { - if (irpSp->MinorFunction == 2) { - goto switch_46_2; + ntStatus = myStatus; + WaitForCompletion = 1; + {} + disketteExtension = DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + type = irpSp->Parameters.Power.Type; + state = irpSp->Parameters.Power.State; + if (irpSp->MinorFunction == 3) { + goto switch_46_3; } else { - { - goto switch_46_default; - if (0) { - switch_46_3: /* CIL Label */ ; - { - } - if ((int )type == 0) { - if ((int )state.SystemState > 5) { - ntStatus = 0L; - goto switch_46_break; - } else { - - } - } else { - - } - { -/* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - } - if (disketteExtension->ThreadReferenceCount >= 0L) { - { -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - } - { - } - { -/* PoStartNextPowerIrp(Irp); */ /* INLINED */ - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = -2147483631L; - myStatus = -2147483631L; - IofCompleteRequest(Irp, 0); - } - return (-2147483631L); - } else { - - } + if (irpSp->MinorFunction == 2) { + goto switch_46_2; + } else { { -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - ntStatus = 0L; - } - goto switch_46_break; - switch_46_2: /* CIL Label */ ; - if ((int )type == 0) { - { -/* ExAcquireFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ - } - if ((int )state.SystemState == 1) { + goto switch_46_default; + if (0) { + switch_46_3: /* CIL Label */; + {} + if ((int)type == 0) { + if ((int)state.SystemState > 5) { + ntStatus = 0L; + goto switch_46_break; + } else { + } + } else { + } { + /* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + } + if (disketteExtension->ThreadReferenceCount >= 0L) { + { + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + } {} { + /* PoStartNextPowerIrp(Irp); */ /* INLINED */ + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = -2147483631L; + myStatus = -2147483631L; + IofCompleteRequest(Irp, 0); + } + return (-2147483631L); + } else { } - disketteExtension->PoweringDown = 0; - WaitForCompletion = 0; - } else { { + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + ntStatus = 0L; } - WaitForCompletion = 1; - disketteExtension->PoweringDown = 1; - } - { -/* ExReleaseFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ - } - if ((unsigned int )disketteExtension->FloppyThread != (unsigned int )((void *)0)) { - if ((int )WaitForCompletion == 1) { + goto switch_46_break; + switch_46_2: /* CIL Label */; + if ((int)type == 0) { + { + /* ExAcquireFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ + } + if ((int)state.SystemState == 1) { + {} + disketteExtension->PoweringDown = 0; + WaitForCompletion = 0; + } else { + {} + WaitForCompletion = 1; + disketteExtension->PoweringDown = 1; + } { - KeWaitForSingleObject(disketteExtension->FloppyThread, 0, 0, 0, (void *)0); + /* ExReleaseFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ + } + if ((unsigned int)disketteExtension->FloppyThread != + (unsigned int)((void *)0)) { + if ((int)WaitForCompletion == 1) { + { + KeWaitForSingleObject(disketteExtension->FloppyThread, 0, 0, + 0, (void *)0); + } + } else { + } + } else { } } else { - } + {} + ntStatus = 0L; + goto switch_46_break; + switch_46_default: /* CIL Label */; + goto switch_46_break; } else { - + switch_46_break: /* CIL Label */; } - } else { - - } - { } - ntStatus = 0L; - goto switch_46_break; - switch_46_default: /* CIL Label */ ; - goto switch_46_break; - } else { - switch_46_break: /* CIL Label */ ; - } } } - } - { -/* PoStartNextPowerIrp(Irp); */ /* INLINED */ - } - if (s == NP) { - s = SKIP1; - } else { + { /* PoStartNextPowerIrp(Irp); */ /* INLINED */ + } + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } { - errorFn(); + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + ntStatus = PoCallDriver(disketteExtension->TargetObject, Irp); } + return (ntStatus); } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = PoCallDriver(disketteExtension->TargetObject, Irp); - } - return (ntStatus); -} } -NTSTATUS FloppyReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - NTSTATUS ntStatus ; - PDISKETTE_EXTENSION disketteExtension ; +NTSTATUS FloppyReadWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + NTSTATUS ntStatus; + PDISKETTE_EXTENSION disketteExtension; { - { - } - { - disketteExtension = DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; -/* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - } - if (disketteExtension->HoldNewRequests) { - { - ntStatus = FloppyQueueRequest(disketteExtension, Irp); -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + {} { + disketteExtension = DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + /* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED + */ } - return (ntStatus); - } else { - - } - { -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - } - if (disketteExtension->IsRemoved) { - goto _L; - } else { - if (! disketteExtension->IsStarted) { - _L: /* CIL Label */ - if (disketteExtension->IsRemoved) { - ntStatus = -1073741738L; - } else { - ntStatus = -1073741823L; - } + if (disketteExtension->HoldNewRequests) { { - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = ntStatus; - myStatus = ntStatus; - IofCompleteRequest(Irp, 0); + ntStatus = FloppyQueueRequest(disketteExtension, Irp); + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED + */ } return (ntStatus); } else { - } - } - if ((int )disketteExtension->MediaType > 0) { - if (irpSp->Parameters.Read.ByteOffset.__annonCompField1.LowPart + irpSp->Parameters.Read.Length > disketteExtension->ByteCapacity) { - goto _L___1; + { + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED + */ + } + if (disketteExtension->IsRemoved) { + goto _L; } else { - if ((irpSp->Parameters.Read.Length & (disketteExtension->BytesPerSector - 1UL)) != 0UL) { - _L___1: /* CIL Label */ - { + if (!disketteExtension->IsStarted) { + _L: /* CIL Label */ + if (disketteExtension->IsRemoved) { + ntStatus = -1073741738L; + } else { + ntStatus = -1073741823L; } { + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = ntStatus; + myStatus = ntStatus; + IofCompleteRequest(Irp, 0); } - ntStatus = -1073741811L; + return (ntStatus); } else { - goto _L___0; } } - } else { - _L___0: /* CIL Label */ - if (irpSp->Parameters.Read.Length) { - { - } - { - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); + if ((int)disketteExtension->MediaType > 0) { + if (irpSp->Parameters.Read.ByteOffset.__annonCompField1.LowPart + + irpSp->Parameters.Read.Length > + disketteExtension->ByteCapacity) { + goto _L___1; + } else { + if ((irpSp->Parameters.Read.Length & + (disketteExtension->BytesPerSector - 1UL)) != 0UL) { + _L___1 : /* CIL Label */ + {} + {} + ntStatus = -1073741811L; + } else { + goto _L___0; + } } } else { - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - { - } - { - IofCompleteRequest(Irp, 0); + _L___0: /* CIL Label */ + if (irpSp->Parameters.Read.Length) { + {} { ntStatus = FlQueueIrpToThread(Irp, disketteExtension); } + } else { + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + {} { IofCompleteRequest(Irp, 0); } + return (0L); } - return (0L); } - } - if (ntStatus != 259L) { - Irp->IoStatus.__annonCompField4.Status = ntStatus; - myStatus = ntStatus; - { - } - { - IofCompleteRequest(Irp, 0); + if (ntStatus != 259L) { + Irp->IoStatus.__annonCompField4.Status = ntStatus; + myStatus = ntStatus; + {} { IofCompleteRequest(Irp, 0); } + } else { } - } else { - + return (ntStatus); } - return (ntStatus); -} } -NTSTATUS FlInterpretError(UCHAR StatusRegister1 , UCHAR StatusRegister2 ) -{ +NTSTATUS FlInterpretError(UCHAR StatusRegister1, UCHAR StatusRegister2) { { - if ((int )StatusRegister1 & 32) { - goto _L; - } else { - if ((int )StatusRegister2 & 32) { - _L: /* CIL Label */ - { - } - return (-1073741761L); + if ((int)StatusRegister1 & 32) { + goto _L; } else { - + if ((int)StatusRegister2 & 32) { + _L : /* CIL Label */ + {} + return (-1073741761L); + } else { + } } - } - if ((int )StatusRegister1 & 16) { - { + if ((int)StatusRegister1 & 16) { + {} + return (-1073741764L); + } else { } - return (-1073741764L); - } else { - - } - if ((int )StatusRegister1 & 4) { - goto _L___0; - } else { - if ((int )StatusRegister1 & 128) { - _L___0: /* CIL Label */ - { - } - return (-1073741803L); + if ((int)StatusRegister1 & 4) { + goto _L___0; } else { - + if ((int)StatusRegister1 & 128) { + _L___0 : /* CIL Label */ + {} + return (-1073741803L); + } else { + } } - } - if ((int )StatusRegister2 & 1) { - goto _L___1; - } else { - if ((int )StatusRegister2 & 2) { + if ((int)StatusRegister2 & 1) { goto _L___1; } else { - if ((int )StatusRegister2 & 64) { - _L___1: /* CIL Label */ - { - } - return (-1073741668L); + if ((int)StatusRegister2 & 2) { + goto _L___1; } else { - + if ((int)StatusRegister2 & 64) { + _L___1 : /* CIL Label */ + {} + return (-1073741668L); + } else { + } } } - } - if ((int )StatusRegister1 & 2) { - { + if ((int)StatusRegister1 & 2) { + {} + return (-1073741662L); + } else { } - return (-1073741662L); - } else { - - } - if ((int )StatusRegister1 & 1) { - { + if ((int)StatusRegister1 & 1) { + {} + return (-1073741467L); + } else { } - return (-1073741467L); - } else { - - } - if ((int )StatusRegister2 & 16) { - { + if ((int)StatusRegister2 & 16) { + {} + return (-1073741466L); + } else { } - return (-1073741466L); - } else { - - } - { - } - return (-1073741465L); -} -} -void FlFinishOperation(PIRP Irp , PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - int tmp ; - - { - { - } - if (myStatus != 0L) { - if (DisketteExtension->HardwareFailed) { - DisketteExtension->HardwareFailCount = (UCHAR )((int )DisketteExtension->HardwareFailCount + 1); - if ((int )DisketteExtension->HardwareFailCount < 2) { - { - ntStatus = FlInitializeControllerHardware(DisketteExtension); - } - if (ntStatus >= 0L) { - { - } - DisketteExtension->MediaType = -1; - { - } - { -/* ExAcquireFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ - DisketteExtension->ThreadReferenceCount += 1L; -/* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ - ExfInterlockedInsertHeadList(& DisketteExtension->ListEntry, & Irp->Tail.Overlay.__annonCompField17.ListEntry, - & DisketteExtension->ListSpinLock); + {} + return (-1073741465L); + } +} +void FlFinishOperation(PIRP Irp, PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + int tmp; + + { + {} + if (myStatus != 0L) { + if (DisketteExtension->HardwareFailed) { + DisketteExtension->HardwareFailCount = + (UCHAR)((int)DisketteExtension->HardwareFailCount + 1); + if ((int)DisketteExtension->HardwareFailCount < 2) { + { ntStatus = FlInitializeControllerHardware(DisketteExtension); } + if (ntStatus >= 0L) { + {} + DisketteExtension->MediaType = -1; + {} { + /* ExAcquireFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + DisketteExtension->ThreadReferenceCount += 1L; + /* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + ExfInterlockedInsertHeadList( + &DisketteExtension->ListEntry, + &Irp->Tail.Overlay.__annonCompField17.ListEntry, + &DisketteExtension->ListSpinLock); + } + return; + } else { } - return; + {} } else { - - } - { } } else { - } } else { - } - } else { - - } - DisketteExtension->HardwareFailCount = 0; - if (! (myStatus >= 0L)) { - if (myStatus == -1073741661L) { - tmp = 1; - } else { - if (myStatus == -1073741643L) { + DisketteExtension->HardwareFailCount = 0; + if (!(myStatus >= 0L)) { + if (myStatus == -1073741661L) { tmp = 1; } else { - if (myStatus == -1073741662L) { + if (myStatus == -1073741643L) { tmp = 1; } else { - if (myStatus == -1073741805L) { + if (myStatus == -1073741662L) { tmp = 1; } else { - if (myStatus == -2147483626L) { + if (myStatus == -1073741805L) { tmp = 1; } else { - if (myStatus == -1073741804L) { + if (myStatus == -2147483626L) { tmp = 1; } else { - if (myStatus == -1073741806L) { + if (myStatus == -1073741804L) { tmp = 1; } else { - tmp = 0; + if (myStatus == -1073741806L) { + tmp = 1; + } else { + tmp = 0; + } } } } } } } - } - if ((unsigned char )tmp) { - { -/* IoSetHardErrorOrVerifyDevice(Irp, DisketteExtension->DeviceObject); */ /* INLINED */ + if ((unsigned char)tmp) { + { + /* IoSetHardErrorOrVerifyDevice(Irp, DisketteExtension->DeviceObject); */ /* INLINED */ + } + } else { } } else { - } - } else { - - } - if (myStatus != 0L) { - if (myStatus != -2147483626L) { - if (myStatus != -1073741805L) { - { + if (myStatus != 0L) { + if (myStatus != -2147483626L) { + if (myStatus != -1073741805L) { + {} + } else { + goto _L___0; } } else { goto _L___0; } } else { - goto _L___0; + _L___0 : /* CIL Label */ + {} } - } else { - _L___0: /* CIL Label */ - { - } - } - { - } - { - } - { - IofCompleteRequest(Irp, 1); + {} {} { IofCompleteRequest(Irp, 1); } + return; } - return; -} } -NTSTATUS FlStartDrive(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp , BOOLEAN WriteOperation , - BOOLEAN SetUpMedia , BOOLEAN IgnoreChange ) -{ LARGE_INTEGER delay ; - BOOLEAN motorStarted ; - UCHAR driveStatus ; - NTSTATUS ntStatus ; - FDC_ENABLE_PARMS fdcEnableParms ; - FDC_DISK_CHANGE_PARMS fdcDiskChangeParms ; +NTSTATUS FlStartDrive(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp, + BOOLEAN WriteOperation, BOOLEAN SetUpMedia, + BOOLEAN IgnoreChange) { + LARGE_INTEGER delay; + BOOLEAN motorStarted; + UCHAR driveStatus; + NTSTATUS ntStatus; + FDC_ENABLE_PARMS fdcEnableParms; + FDC_DISK_CHANGE_PARMS fdcDiskChangeParms; { - ntStatus = 0L; - { - } - *(DriveMediaConstants + (DriveMediaLimits + DisketteExtension->DriveType)->HighestDriveMediaType) = DisketteExtension->BiosDriveMediaConstants; - if ((int )DisketteExtension->MediaType == -1) { - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + 0); - } else { - if ((int )DisketteExtension->MediaType == 0) { + ntStatus = 0L; + {} * (DriveMediaConstants + + (DriveMediaLimits + DisketteExtension->DriveType) + ->HighestDriveMediaType) = + DisketteExtension->BiosDriveMediaConstants; + if ((int)DisketteExtension->MediaType == -1) { DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + 0); } else { - + if ((int)DisketteExtension->MediaType == 0) { + DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + 0); + } else { + } + } + fdcEnableParms.DriveOnValue = DisketteExtension->DriveOnValue; + if (WriteOperation) { + fdcEnableParms.TimeToWait = + DisketteExtension->DriveMediaConstants.MotorSettleTimeWrite; + } else { + fdcEnableParms.TimeToWait = + DisketteExtension->DriveMediaConstants.MotorSettleTimeRead; } - } - fdcEnableParms.DriveOnValue = DisketteExtension->DriveOnValue; - if (WriteOperation) { - fdcEnableParms.TimeToWait = DisketteExtension->DriveMediaConstants.MotorSettleTimeWrite; - } else { - fdcEnableParms.TimeToWait = DisketteExtension->DriveMediaConstants.MotorSettleTimeRead; - } - { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (774 << 2)) | 3, - & fdcEnableParms); - motorStarted = fdcEnableParms.MotorStarted; - } - if (ntStatus >= 0L) { { - fdcDiskChangeParms.DriveOnValue = DisketteExtension->DriveOnValue; - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (776 << 2)) | 3, - & fdcDiskChangeParms); - driveStatus = fdcDiskChangeParms.DriveStatus; + ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (774 << 2)) | 3, &fdcEnableParms); + motorStarted = fdcEnableParms.MotorStarted; } - } else { - - } - if (! (ntStatus >= 0L)) { - return (ntStatus); - } else { - - } - if ((int )DisketteExtension->DriveType == 0) { - if (motorStarted) { - goto _L___1; + if (ntStatus >= 0L) { + { + fdcDiskChangeParms.DriveOnValue = DisketteExtension->DriveOnValue; + ntStatus = + FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (776 << 2)) | 3, &fdcDiskChangeParms); + driveStatus = fdcDiskChangeParms.DriveStatus; + } } else { - goto _L___3; } - } else { - _L___3: /* CIL Label */ - if ((int )DisketteExtension->DriveType != 0) { - if ((int )driveStatus & 128) { - _L___1: /* CIL Label */ - { - } - DisketteExtension->MediaType = -1; - if ((int )((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { - if (Irp) { - { -/* IoSetHardErrorOrVerifyDevice(Irp, DisketteExtension->DeviceObject); */ /* INLINED */ - } - } else { - - } - (DisketteExtension->DeviceObject)->Flags |= 2UL; - } else { - - } - if ((int )DisketteExtension->DriveType != 0) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - DisketteExtension->FifoBuffer[0] = 14; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, - 0); - } - if (! (ntStatus >= 0L)) { + if (!(ntStatus >= 0L)) { + return (ntStatus); + } else { + } + if ((int)DisketteExtension->DriveType == 0) { + if (motorStarted) { + goto _L___1; + } else { + goto _L___3; + } + } else { + _L___3: /* CIL Label */ + if ((int)DisketteExtension->DriveType != 0) { + if ((int)driveStatus & 128) { + _L___1 : /* CIL Label */ + {} + DisketteExtension->MediaType = -1; + if ((int)((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { + if (Irp) { { + /* IoSetHardErrorOrVerifyDevice(Irp, DisketteExtension->DeviceObject); */ /* INLINED */ } - return (ntStatus); - } else { - - } - if ((int )DisketteExtension->FifoBuffer[0] & 32) { - driveStatus = 127; } else { - driveStatus = 128; } - if ((int )driveStatus & 128) { + (DisketteExtension->DeviceObject)->Flags |= 2UL; + } else { + } + if ((int)DisketteExtension->DriveType != 0) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { { + DisketteExtension->FifoBuffer[0] = 14; + DisketteExtension->FifoBuffer[1] = + DisketteExtension->DeviceUnit; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - if ((int )((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { - (DisketteExtension->DeviceObject)->Flags &= 4294967293UL; + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); + } else { + } + if ((int)DisketteExtension->FifoBuffer[0] & 32) { + driveStatus = 127; + } else { + driveStatus = 128; + } + if ((int)driveStatus & 128) { + {} + if ((int)((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { + (DisketteExtension->DeviceObject)->Flags &= 4294967293UL; + } else { + } + return (-1073741805L); } else { - } - return (-1073741805L); } else { - } - } else { - - } - { - DisketteExtension->FifoBuffer[0] = 16; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - DisketteExtension->FifoBuffer[2] = 1; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); - } - if (! (ntStatus >= 0L)) { { + DisketteExtension->FifoBuffer[0] = 16; + DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; + DisketteExtension->FifoBuffer[2] = 1; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - return (ntStatus); - } else { - if (! ((int )DisketteExtension->FifoBuffer[0] & 32)) { - goto _L; + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); } else { - if ((int )DisketteExtension->FifoBuffer[1] != 1) { - _L: /* CIL Label */ - { - } - DisketteExtension->HardwareFailed = 1; - return (-1073741464L); + if (!((int)DisketteExtension->FifoBuffer[0] & 32)) { + goto _L; } else { - + if ((int)DisketteExtension->FifoBuffer[1] != 1) { + _L : /* CIL Label */ + {} + DisketteExtension->HardwareFailed = 1; + return (-1073741464L); + } else { + } } } - } - { - DisketteExtension->FifoBuffer[0] = 16; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - DisketteExtension->FifoBuffer[2] = 0; - delay.__annonCompField1.LowPart = 4294966396UL; - delay.__annonCompField1.HighPart = -1; - KeDelayExecutionThread(0, 0, & delay); - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); - delay.__annonCompField1.LowPart = 4294967291UL; - delay.__annonCompField1.HighPart = -1; - KeDelayExecutionThread(0, 0, & delay); - } - if (! (ntStatus >= 0L)) { { + DisketteExtension->FifoBuffer[0] = 16; + DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; + DisketteExtension->FifoBuffer[2] = 0; + delay.__annonCompField1.LowPart = 4294966396UL; + delay.__annonCompField1.HighPart = -1; + KeDelayExecutionThread(0, 0, &delay); + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + delay.__annonCompField1.LowPart = 4294967291UL; + delay.__annonCompField1.HighPart = -1; + KeDelayExecutionThread(0, 0, &delay); } - return (ntStatus); - } else { - if (! ((int )DisketteExtension->FifoBuffer[0] & 32)) { - goto _L___0; + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); } else { - if ((int )DisketteExtension->FifoBuffer[1] != 0) { - _L___0: /* CIL Label */ - { - } - DisketteExtension->HardwareFailed = 1; - return (-1073741464L); + if (!((int)DisketteExtension->FifoBuffer[0] & 32)) { + goto _L___0; } else { - + if ((int)DisketteExtension->FifoBuffer[1] != 0) { + _L___0 : /* CIL Label */ + {} + DisketteExtension->HardwareFailed = 1; + return (-1073741464L); + } else { + } } } - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - DisketteExtension->FifoBuffer[0] = 14; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, - 0); - } - if (! (ntStatus >= 0L)) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { { + DisketteExtension->FifoBuffer[0] = 14; + DisketteExtension->FifoBuffer[1] = + DisketteExtension->DeviceUnit; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); + } else { + } + if ((int)DisketteExtension->FifoBuffer[0] & 32) { + driveStatus = 127; + } else { + driveStatus = 128; } - return (ntStatus); } else { - + { + ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (776 << 2)) | 3, + &fdcDiskChangeParms); + driveStatus = fdcDiskChangeParms.DriveStatus; + } + if (!(ntStatus >= 0L)) { + return (ntStatus); + } else { + } } - if ((int )DisketteExtension->FifoBuffer[0] & 32) { - driveStatus = 127; + if ((int)driveStatus & 128) { + {} + if ((int)((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { + (DisketteExtension->DeviceObject)->Flags &= 4294967293UL; + } else { + } + return (-1073741805L); } else { - driveStatus = 128; } } else { - { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (776 << 2)) | 3, - & fdcDiskChangeParms); - driveStatus = fdcDiskChangeParms.DriveStatus; - } - if (! (ntStatus >= 0L)) { - return (ntStatus); - } else { - - } } - if ((int )driveStatus & 128) { - { - } - if ((int )((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { - (DisketteExtension->DeviceObject)->Flags &= 4294967293UL; + if ((int)IgnoreChange == 0) { + if ((int)((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { + {} + return (-2147483626L); } else { - - } - return (-1073741805L); - } else { - - } - } else { - - } - if ((int )IgnoreChange == 0) { - if ((int )((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { - { + return (-1073741435L); } - return (-2147483626L); } else { - return (-1073741435L); } } else { - + goto _L___2; } } else { - goto _L___2; - } - } else { - _L___2: /* CIL Label */ - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - FlHdbit(DisketteExtension); + _L___2: /* CIL Label */ + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { FlHdbit(DisketteExtension); } + } else { } - } else { - } } - } - if (SetUpMedia) { - if ((int )DisketteExtension->MediaType == -1) { - { - ntStatus = FlDetermineMediaType(DisketteExtension); - } - } else { - if ((int )DisketteExtension->MediaType == 0) { - { - } - return (-1073741804L); + if (SetUpMedia) { + if ((int)DisketteExtension->MediaType == -1) { + { ntStatus = FlDetermineMediaType(DisketteExtension); } } else { - if ((int )DisketteExtension->DriveMediaType != (int )DisketteExtension->LastDriveMediaType) { - { - ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); - } - if (! (ntStatus >= 0L)) { - { + if ((int)DisketteExtension->MediaType == 0) { + {} + return (-1073741804L); + } else { + if ((int)DisketteExtension->DriveMediaType != + (int)DisketteExtension->LastDriveMediaType) { + { ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); } + if (!(ntStatus >= 0L)) { + {} + } else { } } else { - } - } else { - } } + } else { } - } else { - - } - if (WriteOperation) { - if (ntStatus >= 0L) { - { - DisketteExtension->FifoBuffer[0] = 14; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); - } - if (! (ntStatus >= 0L)) { + if (WriteOperation) { + if (ntStatus >= 0L) { { + DisketteExtension->FifoBuffer[0] = 14; + DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; + ntStatus = + FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - return (ntStatus); - } else { - - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if (! ((int )DisketteExtension->FifoBuffer[0] & 32)) { - { + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); + } else { + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if (!((int)DisketteExtension->FifoBuffer[0] & 32)) { + {} + return (-1073741805L); + } else { } - return (-1073741805L); } else { - } - } else { - - } - if ((int )DisketteExtension->FifoBuffer[0] & 64) { - { + if ((int)DisketteExtension->FifoBuffer[0] & 64) { + {} + return (-1073741662L); + } else { } - return (-1073741662L); } else { - } } else { - } - } else { - + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FlDatarateSpecifyConfigure(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; +NTSTATUS FlDatarateSpecifyConfigure(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; { - ntStatus = 0L; - if (DisketteExtension->ControllerConfigurable) { - DisketteExtension->FifoBuffer[0] = 17; - DisketteExtension->FifoBuffer[1] = 0; - DisketteExtension->FifoBuffer[2] = 15; - DisketteExtension->FifoBuffer[2] = (int )DisketteExtension->FifoBuffer[2] + 16; - if (! DisketteExtension->DriveMediaConstants.CylinderShift) { - DisketteExtension->FifoBuffer[2] = (int )DisketteExtension->FifoBuffer[2] + 64; + ntStatus = 0L; + if (DisketteExtension->ControllerConfigurable) { + DisketteExtension->FifoBuffer[0] = 17; + DisketteExtension->FifoBuffer[1] = 0; + DisketteExtension->FifoBuffer[2] = 15; + DisketteExtension->FifoBuffer[2] = + (int)DisketteExtension->FifoBuffer[2] + 16; + if (!DisketteExtension->DriveMediaConstants.CylinderShift) { + DisketteExtension->FifoBuffer[2] = + (int)DisketteExtension->FifoBuffer[2] + 64; + } else { + } + { + DisketteExtension->FifoBuffer[3] = 0; + ntStatus = + FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + if (ntStatus == -1073741661L) { + DisketteExtension->ControllerConfigurable = 0; + ntStatus = 0L; + } else { + } } else { - } - { - DisketteExtension->FifoBuffer[3] = 0; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, DisketteExtension->FifoBuffer, - (void *)0, 0, 0); - } - if (ntStatus == -1073741661L) { - DisketteExtension->ControllerConfigurable = 0; - ntStatus = 0L; + if (ntStatus >= 0L) { + goto _L; } else { - - } - } else { - - } - if (ntStatus >= 0L) { - goto _L; - } else { - if (ntStatus == -1073741661L) { - _L: /* CIL Label */ + if (ntStatus == -1073741661L) { + _L : /* CIL Label */ { - DisketteExtension->FifoBuffer[0] = 13; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DriveMediaConstants.StepRateHeadUnloadTime; - DisketteExtension->FifoBuffer[2] = DisketteExtension->DriveMediaConstants.HeadLoadTime; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); + DisketteExtension->FifoBuffer[0] = 13; + DisketteExtension->FifoBuffer[1] = + DisketteExtension->DriveMediaConstants.StepRateHeadUnloadTime; + DisketteExtension->FifoBuffer[2] = + DisketteExtension->DriveMediaConstants.HeadLoadTime; + ntStatus = + FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - if (ntStatus >= 0L) { - { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (777 << 2)) | 3, - & DisketteExtension->DriveMediaConstants.DataTransferRate); - } if (ntStatus >= 0L) { { - ntStatus = FlRecalibrateDrive(DisketteExtension); + ntStatus = FlFdcDeviceIo( + DisketteExtension->TargetObject, ((7 << 16) | (777 << 2)) | 3, + &DisketteExtension->DriveMediaConstants.DataTransferRate); + } + if (ntStatus >= 0L) { + { ntStatus = FlRecalibrateDrive(DisketteExtension); } + } else { } } else { - + {} } } else { - { - } - } - } else { - { + {} } } - } - if (ntStatus >= 0L) { - DisketteExtension->LastDriveMediaType = DisketteExtension->DriveMediaType; - } else { - DisketteExtension->LastDriveMediaType = 0; - { + if (ntStatus >= 0L) { + DisketteExtension->LastDriveMediaType = DisketteExtension->DriveMediaType; + } else { + DisketteExtension->LastDriveMediaType = 0; + {} } + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FlRecalibrateDrive(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - UCHAR recalibrateCount ; - UCHAR fifoBuffer[2] ; +NTSTATUS FlRecalibrateDrive(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + UCHAR recalibrateCount; + UCHAR fifoBuffer[2]; { - recalibrateCount = 0; - { - while (1) { - while_93_continue: /* CIL Label */ ; + recalibrateCount = 0; { - DisketteExtension->FifoBuffer[0] = 11; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, DisketteExtension->FifoBuffer, - (void *)0, 0, 0); - } - if (! (ntStatus >= 0L)) { - { - } - } else { - - } - if (ntStatus >= 0L) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { + while (1) { + while_93_continue: /* CIL Label */; { - fifoBuffer[0] = DisketteExtension->FifoBuffer[0]; - fifoBuffer[1] = DisketteExtension->FifoBuffer[1]; - DisketteExtension->FifoBuffer[0] = 14; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); + DisketteExtension->FifoBuffer[0] = 11; + DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; + ntStatus = + FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - if (! (ntStatus >= 0L)) { - { + if (!(ntStatus >= 0L)) { + {} + } else { + } + if (ntStatus >= 0L) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { + fifoBuffer[0] = DisketteExtension->FifoBuffer[0]; + fifoBuffer[1] = DisketteExtension->FifoBuffer[1]; + DisketteExtension->FifoBuffer[0] = 14; + DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); + } else { + } + DisketteExtension->FifoBuffer[0] = fifoBuffer[0]; + DisketteExtension->FifoBuffer[1] = fifoBuffer[1]; + } else { + } + if (!((int)DisketteExtension->FifoBuffer[0] & 32)) { + goto _L; + } else { + if ((int)DisketteExtension->FifoBuffer[1] != 0) { + _L : /* CIL Label */ + {} + DisketteExtension->HardwareFailed = 1; + ntStatus = -1073741464L; + } else { + } } - return (ntStatus); } else { - } - DisketteExtension->FifoBuffer[0] = fifoBuffer[0]; - DisketteExtension->FifoBuffer[1] = fifoBuffer[1]; - } else { + recalibrateCount = (UCHAR)((int)recalibrateCount + 1); + if (!(ntStatus >= 0L)) { + if ((int)recalibrateCount < 2) { - } - if (! ((int )DisketteExtension->FifoBuffer[0] & 32)) { - goto _L; - } else { - if ((int )DisketteExtension->FifoBuffer[1] != 0) { - _L: /* CIL Label */ - { + } else { + goto while_93_break; } - DisketteExtension->HardwareFailed = 1; - ntStatus = -1073741464L; } else { - + goto while_93_break; } } - } else { - - } - recalibrateCount = (UCHAR )((int )recalibrateCount + 1); - if (! (ntStatus >= 0L)) { - if ((int )recalibrateCount < 2) { - - } else { - goto while_93_break; - } - } else { - goto while_93_break; + while_93_break: /* CIL Label */; } + {} + return (ntStatus); } - while_93_break: /* CIL Label */ ; - } - { - } - return (ntStatus); } -} -NTSTATUS FlDetermineMediaType(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - BOOLEAN mediaTypesExhausted ; - ULONG retries ; - USHORT sectorLengthCode ; - PBOOT_SECTOR_INFO bootSector ; - LARGE_INTEGER offset ; - PIRP irp ; - int tmp ; - PVOID tmp___0 ; - int tmp___1 ; - - { - retries = 0; - { - } - DisketteExtension->IsReadOnly = 0; - retries = 0; - { - while (1) { - while_99_continue: /* CIL Label */ ; - if (retries < 3UL) { - - } else { - goto while_99_break; - } - if (retries) { - { - } - { - FlInitializeControllerHardware(DisketteExtension); - } - } else { - - } - DisketteExtension->DriveMediaType = (DriveMediaLimits + DisketteExtension->DriveType)->HighestDriveMediaType; - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + DisketteExtension->DriveMediaType); - mediaTypesExhausted = 0; +NTSTATUS FlDetermineMediaType(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + BOOLEAN mediaTypesExhausted; + ULONG retries; + USHORT sectorLengthCode; + PBOOT_SECTOR_INFO bootSector; + LARGE_INTEGER offset; + PIRP irp; + int tmp; + PVOID tmp___0; + int tmp___1; + + { + retries = 0; + {} + DisketteExtension->IsReadOnly = 0; + retries = 0; { - while (1) { - while_101_continue: /* CIL Label */ ; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - sectorLengthCode = (DriveMediaConstants + DisketteExtension->DriveMediaType)->SectorLengthCode; - FlHdbit(DisketteExtension); - } - } else { + while (1) { + while_99_continue: /* CIL Label */; + if (retries < 3UL) { - } - { - ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); - } - if (! (ntStatus >= 0L)) { - { - } - mediaTypesExhausted = 1; - } else { - { - driveMediaConstants = DriveMediaConstants + DisketteExtension->DriveMediaType; - DisketteExtension->FifoBuffer[1] = (unsigned char )((int )DisketteExtension->DeviceUnit | (((int )driveMediaConstants->NumberOfHeads - 1) << 2)); - DisketteExtension->FifoBuffer[0] = 84; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } else { + goto while_99_break; } - if (! (ntStatus >= 0L)) { - goto _L; + if (retries) { + {} { FlInitializeControllerHardware(DisketteExtension); } } else { - if (((int )DisketteExtension->FifoBuffer[0] & -33) != (int )((unsigned char )((int )DisketteExtension->DeviceUnit | (((int )driveMediaConstants->NumberOfHeads - 1) << 2)))) { - goto _L; - } else { - if ((int )DisketteExtension->FifoBuffer[1] != 0) { - goto _L; + } + DisketteExtension->DriveMediaType = + (DriveMediaLimits + DisketteExtension->DriveType) + ->HighestDriveMediaType; + DisketteExtension->DriveMediaConstants = + *(DriveMediaConstants + DisketteExtension->DriveMediaType); + mediaTypesExhausted = 0; + { + while (1) { + while_101_continue: /* CIL Label */; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { + sectorLengthCode = + (DriveMediaConstants + DisketteExtension->DriveMediaType) + ->SectorLengthCode; + FlHdbit(DisketteExtension); + } } else { - if ((int )DisketteExtension->FifoBuffer[2] != 0) { + } + { ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); } + if (!(ntStatus >= 0L)) { + {} + mediaTypesExhausted = 1; + } else { + { + driveMediaConstants = + DriveMediaConstants + DisketteExtension->DriveMediaType; + DisketteExtension->FifoBuffer[1] = + (unsigned char)((int)DisketteExtension->DeviceUnit | + (((int)driveMediaConstants->NumberOfHeads - + 1) + << 2)); + DisketteExtension->FifoBuffer[0] = 84; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + if (!(ntStatus >= 0L)) { goto _L; } else { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if ((int )DisketteExtension->FifoBuffer[6] != (int )sectorLengthCode) { - _L: /* CIL Label */ - { - } - DisketteExtension->DriveMediaType = (DRIVE_MEDIA_TYPE )((int )DisketteExtension->DriveMediaType - 1); - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + DisketteExtension->DriveMediaType); - if (ntStatus != -1073741661L) { - ntStatus = -1073741804L; - } else { - - } - if ((int )((char )DisketteExtension->DriveMediaType) < (int )((char )(DriveMediaLimits + DisketteExtension->DriveType)->LowestDriveMediaType)) { - DisketteExtension->MediaType = 0; - mediaTypesExhausted = 1; - { - } - } else { - - } - } else { - goto _L___0; - } + if (((int)DisketteExtension->FifoBuffer[0] & -33) != + (int)((unsigned char)((int)DisketteExtension->DeviceUnit | + (((int)driveMediaConstants + ->NumberOfHeads - + 1) + << 2)))) { + goto _L; } else { - _L___0: /* CIL Label */ - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - DisketteExtension->MediaType = driveMediaConstants->MediaType; - DisketteExtension->BytesPerSector = driveMediaConstants->BytesPerSector; - { - } - DisketteExtension->ByteCapacity = (((int )driveMediaConstants->BytesPerSector * (int )driveMediaConstants->SectorsPerTrack) * (1 + (int )driveMediaConstants->MaximumTrack)) * (int )driveMediaConstants->NumberOfHeads; - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + DisketteExtension->DriveMediaType); - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - tmp = 1024; - } else { - tmp = 512; - } - { - tmp___0 = ExAllocatePoolWithTag(4, tmp, 1886350406UL); - bootSector = tmp___0; - } - if (! bootSector) { - return (-1073741670L); - } else { - - } - offset.__annonCompField1.HighPart = 0; - offset.__annonCompField1.LowPart = offset.__annonCompField1.HighPart; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - tmp___1 = 1024; - } else { - tmp___1 = 512; - } - { - irp = IoBuildAsynchronousFsdRequest(3, DisketteExtension->DeviceObject, - bootSector, tmp___1, & offset, - (void *)0); - } - if (! irp) { - { - } - { -/* ExFreePool(bootSector); */ /* INLINED */ - } - return (-1073741670L); + if ((int)DisketteExtension->FifoBuffer[1] != 0) { + goto _L; + } else { + if ((int)DisketteExtension->FifoBuffer[2] != 0) { + goto _L; } else { - - } - { - irp->CurrentLocation = (CHAR )((int )irp->CurrentLocation - 1); - irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation -= 1; - ntStatus = FlReadWrite(DisketteExtension, irp, 1); - } - { - } - { -/* MmUnlockPages(irp->MdlAddress); */ /* INLINED */ -/* IoFreeMdl(irp->MdlAddress); */ /* INLINED */ -/* IoFreeIrp(irp); */ /* INLINED */ -/* ExFreePool(bootSector); */ /* INLINED */ - } - if (! (ntStatus >= 0L)) { - { - } - DisketteExtension->DriveMediaType = (DRIVE_MEDIA_TYPE )((int )DisketteExtension->DriveMediaType - 1); - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + DisketteExtension->DriveMediaType); - if (ntStatus != -1073741661L) { - ntStatus = -1073741804L; - } else { - - } - if ((int )((char )DisketteExtension->DriveMediaType) < (int )((char )(DriveMediaLimits + DisketteExtension->DriveType)->LowestDriveMediaType)) { - DisketteExtension->MediaType = 0; - mediaTypesExhausted = 1; - { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if ((int)DisketteExtension->FifoBuffer[6] != + (int)sectorLengthCode) { + _L : /* CIL Label */ + {} + DisketteExtension->DriveMediaType = + (DRIVE_MEDIA_TYPE)( + (int)DisketteExtension->DriveMediaType - 1); + DisketteExtension->DriveMediaConstants = + *(DriveMediaConstants + + DisketteExtension->DriveMediaType); + if (ntStatus != -1073741661L) { + ntStatus = -1073741804L; + } else { + } + if ((int)((char)DisketteExtension->DriveMediaType) < + (int)((char)(DriveMediaLimits + + DisketteExtension->DriveType) + ->LowestDriveMediaType)) { + DisketteExtension->MediaType = 0; + mediaTypesExhausted = 1; + {} + } else { + } + } else { + goto _L___0; } } else { - + _L___0: /* CIL Label */ + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + DisketteExtension->MediaType = + driveMediaConstants->MediaType; + DisketteExtension->BytesPerSector = + driveMediaConstants->BytesPerSector; + {} + DisketteExtension->ByteCapacity = + (((int)driveMediaConstants->BytesPerSector * + (int)driveMediaConstants->SectorsPerTrack) * + (1 + (int)driveMediaConstants->MaximumTrack)) * + (int)driveMediaConstants->NumberOfHeads; + DisketteExtension->DriveMediaConstants = + *(DriveMediaConstants + + DisketteExtension->DriveMediaType); + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + tmp = 1024; + } else { + tmp = 512; + } + { + tmp___0 = + ExAllocatePoolWithTag(4, tmp, 1886350406UL); + bootSector = tmp___0; + } + if (!bootSector) { + return (-1073741670L); + } else { + } + offset.__annonCompField1.HighPart = 0; + offset.__annonCompField1.LowPart = + offset.__annonCompField1.HighPart; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + tmp___1 = 1024; + } else { + tmp___1 = 512; + } + { + irp = IoBuildAsynchronousFsdRequest( + 3, DisketteExtension->DeviceObject, bootSector, + tmp___1, &offset, (void *)0); + } + if (!irp) { + {} { + /* ExFreePool(bootSector); */ /* INLINED */ + } + return (-1073741670L); + } else { + } + { + irp->CurrentLocation = + (CHAR)((int)irp->CurrentLocation - 1); + irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation -= 1; + ntStatus = FlReadWrite(DisketteExtension, irp, 1); + } + {} { + /* MmUnlockPages(irp->MdlAddress); */ /* INLINED */ + /* IoFreeMdl(irp->MdlAddress); */ /* INLINED */ + /* IoFreeIrp(irp); */ /* INLINED + */ + /* ExFreePool(bootSector); */ /* INLINED */ + } + if (!(ntStatus >= 0L)) { + {} + DisketteExtension->DriveMediaType = + (DRIVE_MEDIA_TYPE)( + (int)DisketteExtension->DriveMediaType - 1); + DisketteExtension->DriveMediaConstants = + *(DriveMediaConstants + + DisketteExtension->DriveMediaType); + if (ntStatus != -1073741661L) { + ntStatus = -1073741804L; + } else { + } + if ((int)((char)DisketteExtension->DriveMediaType) < + (int)((char)(DriveMediaLimits + + DisketteExtension->DriveType) + ->LowestDriveMediaType)) { + DisketteExtension->MediaType = 0; + mediaTypesExhausted = 1; + {} + } else { + } + } else { + } + } else { + } } - } else { - } - } else { - } } } } + if (!(ntStatus >= 0L)) { + if (!mediaTypesExhausted) { + + } else { + goto while_101_break; + } + } else { + goto while_101_break; + } } + while_101_break: /* CIL Label */; } - } - if (! (ntStatus >= 0L)) { - if (! mediaTypesExhausted) { - + if (ntStatus >= 0L) { + {} + goto while_99_break; } else { - goto while_101_break; } + retries += 1UL; + } + while_99_break: /* CIL Label */; + } + if (!(ntStatus >= 0L)) { + goto _L___1; + } else { + if (mediaTypesExhausted) { + _L___1 : /* CIL Label */ + {} + return (ntStatus); } else { - goto while_101_break; } } - while_101_break: /* CIL Label */ ; + DisketteExtension->MediaType = driveMediaConstants->MediaType; + DisketteExtension->BytesPerSector = driveMediaConstants->BytesPerSector; + DisketteExtension->ByteCapacity = + (((int)driveMediaConstants->BytesPerSector * + (int)driveMediaConstants->SectorsPerTrack) * + (1 + (int)driveMediaConstants->MaximumTrack)) * + (int)driveMediaConstants->NumberOfHeads; + {} { + DisketteExtension->DriveMediaConstants = + *(DriveMediaConstants + DisketteExtension->DriveMediaType); + FlCheckBootSector(DisketteExtension); } - if (ntStatus >= 0L) { - { + return (ntStatus); + } +} +void FlAllocateIoBuffer(PDISKETTE_EXTENSION DisketteExtension, + ULONG BufferSize) { + BOOLEAN allocateContiguous; + LARGE_INTEGER maxDmaAddress; + PVOID tmp; + PVOID tmp___0; + + { + if (DisketteExtension->IoBuffer) { + if (DisketteExtension->IoBufferSize >= BufferSize) { + return; + } else { } - goto while_99_break; + { FlFreeIoBuffer(DisketteExtension); } } else { - } - retries += 1UL; - } - while_99_break: /* CIL Label */ ; - } - if (! (ntStatus >= 0L)) { - goto _L___1; - } else { - if (mediaTypesExhausted) { - _L___1: /* CIL Label */ + if (BufferSize > DisketteExtension->MaxTransferSize) { + allocateContiguous = 1; + } else { + allocateContiguous = 0; + } + if (allocateContiguous) { { + maxDmaAddress.QuadPart = 16777215; + tmp = MmAllocateContiguousMemory(BufferSize, maxDmaAddress); + DisketteExtension->IoBuffer = tmp; } - return (ntStatus); } else { - + { + tmp___0 = ExAllocatePoolWithTag(4, BufferSize, 1886350406UL); + DisketteExtension->IoBuffer = tmp___0; + } } - } - DisketteExtension->MediaType = driveMediaConstants->MediaType; - DisketteExtension->BytesPerSector = driveMediaConstants->BytesPerSector; - DisketteExtension->ByteCapacity = (((int )driveMediaConstants->BytesPerSector * (int )driveMediaConstants->SectorsPerTrack) * (1 + (int )driveMediaConstants->MaximumTrack)) * (int )driveMediaConstants->NumberOfHeads; - { - } - { - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + DisketteExtension->DriveMediaType); - FlCheckBootSector(DisketteExtension); - } - return (ntStatus); -} -} -void FlAllocateIoBuffer(PDISKETTE_EXTENSION DisketteExtension , ULONG BufferSize ) -{ BOOLEAN allocateContiguous ; - LARGE_INTEGER maxDmaAddress ; - PVOID tmp ; - PVOID tmp___0 ; - - { - if (DisketteExtension->IoBuffer) { - if (DisketteExtension->IoBufferSize >= BufferSize) { + if (!DisketteExtension->IoBuffer) { return; } else { - - } - { - FlFreeIoBuffer(DisketteExtension); } - } else { - - } - if (BufferSize > DisketteExtension->MaxTransferSize) { - allocateContiguous = 1; - } else { - allocateContiguous = 0; - } - if (allocateContiguous) { { - maxDmaAddress.QuadPart = 16777215; - tmp = MmAllocateContiguousMemory(BufferSize, maxDmaAddress); - DisketteExtension->IoBuffer = tmp; + DisketteExtension->IoBufferMdl = IoAllocateMdl( + DisketteExtension->IoBuffer, BufferSize, 0, 0, (void *)0); } - } else { - { - tmp___0 = ExAllocatePoolWithTag(4, BufferSize, 1886350406UL); - DisketteExtension->IoBuffer = tmp___0; + if (!DisketteExtension->IoBufferMdl) { + if (allocateContiguous) { + { + /* MmFreeContiguousMemory(DisketteExtension->IoBuffer); */ /* INLINED + */ + } + } else { + { /* ExFreePool(DisketteExtension->IoBuffer); */ /* INLINED */ + } + } + DisketteExtension->IoBuffer = (void *)0; + return; + } else { } - } - if (! DisketteExtension->IoBuffer) { - return; - } else { - - } - { - DisketteExtension->IoBufferMdl = IoAllocateMdl(DisketteExtension->IoBuffer, BufferSize, - 0, 0, (void *)0); - } - if (! DisketteExtension->IoBufferMdl) { + { MmProbeAndLockPages(DisketteExtension->IoBufferMdl, 0, 2); } + {} if (allocateContiguous) { { -/* MmFreeContiguousMemory(DisketteExtension->IoBuffer); */ /* INLINED */ + /* MmFreeContiguousMemory(DisketteExtension->IoBuffer); */ /* INLINED + */ } } else { - { -/* ExFreePool(DisketteExtension->IoBuffer); */ /* INLINED */ + { /* ExFreePool(DisketteExtension->IoBuffer); */ /* INLINED */ } } DisketteExtension->IoBuffer = (void *)0; return; - } else { - - } - { - MmProbeAndLockPages(DisketteExtension->IoBufferMdl, 0, 2); + DisketteExtension->IoBufferSize = BufferSize; } - { - } - if (allocateContiguous) { - { -/* MmFreeContiguousMemory(DisketteExtension->IoBuffer); */ /* INLINED */ - } - } else { - { -/* ExFreePool(DisketteExtension->IoBuffer); */ /* INLINED */ - } - } - DisketteExtension->IoBuffer = (void *)0; - return; - DisketteExtension->IoBufferSize = BufferSize; -} } -void FlFreeIoBuffer(PDISKETTE_EXTENSION DisketteExtension ) -{ BOOLEAN contiguousBuffer ; +void FlFreeIoBuffer(PDISKETTE_EXTENSION DisketteExtension) { + BOOLEAN contiguousBuffer; { - if (! DisketteExtension->IoBuffer) { - return; - } else { - - } - if (DisketteExtension->IoBufferSize > DisketteExtension->MaxTransferSize) { - contiguousBuffer = 1; - } else { - contiguousBuffer = 0; - } - { - DisketteExtension->IoBufferSize = 0; -/* MmUnlockPages(DisketteExtension->IoBufferMdl); */ /* INLINED */ -/* IoFreeMdl(DisketteExtension->IoBufferMdl); */ /* INLINED */ - DisketteExtension->IoBufferMdl = (void *)0; - } - if (contiguousBuffer) { - { -/* MmFreeContiguousMemory(DisketteExtension->IoBuffer); */ /* INLINED */ + if (!DisketteExtension->IoBuffer) { + return; + } else { + } + if (DisketteExtension->IoBufferSize > DisketteExtension->MaxTransferSize) { + contiguousBuffer = 1; + } else { + contiguousBuffer = 0; } - } else { { -/* ExFreePool(DisketteExtension->IoBuffer); */ /* INLINED */ + DisketteExtension->IoBufferSize = 0; + /* MmUnlockPages(DisketteExtension->IoBufferMdl); */ /* INLINED */ + /* IoFreeMdl(DisketteExtension->IoBufferMdl); */ /* INLINED */ + DisketteExtension->IoBufferMdl = (void *)0; + } + if (contiguousBuffer) { + { + /* MmFreeContiguousMemory(DisketteExtension->IoBuffer); */ /* INLINED + */ + } + } else { + { /* ExFreePool(DisketteExtension->IoBuffer); */ /* INLINED */ + } } + DisketteExtension->IoBuffer = (void *)0; + return; } - DisketteExtension->IoBuffer = (void *)0; - return; } -} -void FloppyThread(PVOID Context ) -{ PIRP irp ; - PIO_STACK_LOCATION irpSp ; - PLIST_ENTRY request ; - PDISKETTE_EXTENSION disketteExtension ; - NTSTATUS ntStatus ; - NTSTATUS waitStatus ; - LARGE_INTEGER queueWait ; - LARGE_INTEGER acquireWait ; - PKTHREAD tmp ; - PDISK_GEOMETRY outputBuffer ; - PSENSE_DEVISE_STATUS_PTOS outputBuffer___0 ; +void FloppyThread(PVOID Context) { + PIRP irp; + PIO_STACK_LOCATION irpSp; + PLIST_ENTRY request; + PDISKETTE_EXTENSION disketteExtension; + NTSTATUS ntStatus; + NTSTATUS waitStatus; + LARGE_INTEGER queueWait; + LARGE_INTEGER acquireWait; + PKTHREAD tmp; + PDISK_GEOMETRY outputBuffer; + PSENSE_DEVISE_STATUS_PTOS outputBuffer___0; { - { - disketteExtension = Context; - ntStatus = 0L; - tmp = KeGetCurrentThread(); - KeSetPriorityThread(tmp, 16); - queueWait.QuadPart = -30000000; - acquireWait.QuadPart = -150000000; - } - { - while (1) { - while_114_continue: /* CIL Label */ ; { - waitStatus = KeWaitForSingleObject((void *)(& disketteExtension->RequestSemaphore), - 0, 0, 0, & queueWait); + disketteExtension = Context; + ntStatus = 0L; + tmp = KeGetCurrentThread(); + KeSetPriorityThread(tmp, 16); + queueWait.QuadPart = -30000000; + acquireWait.QuadPart = -150000000; } - if (waitStatus == 258L) { - if (! ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1)) { - if (disketteExtension->FloppyControllerAllocated) { - { - } - { - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (775 << 2)) | 3, - (void *)0); - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (769 << 2)) | 3, - disketteExtension->DeviceObject); - disketteExtension->FloppyControllerAllocated = 0; - } - } else { - + { + while (1) { + while_114_continue: /* CIL Label */; + { + waitStatus = KeWaitForSingleObject( + (void *)(&disketteExtension->RequestSemaphore), 0, 0, 0, + &queueWait); } - } else { - - } - { -/* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - } - if (disketteExtension->ThreadReferenceCount == 0L) { - disketteExtension->ThreadReferenceCount = -1; - if ((unsigned int )disketteExtension->FloppyThread != (unsigned int )((void *)0)) { + if (waitStatus == 258L) { + if (!((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1)) { + if (disketteExtension->FloppyControllerAllocated) { + {} { + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (775 << 2)) | 3, (void *)0); + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (769 << 2)) | 3, + disketteExtension->DeviceObject); + disketteExtension->FloppyControllerAllocated = 0; + } + } else { + } + } else { + } { -/* ObfDereferenceObject(disketteExtension->FloppyThread); */ /* INLINED */ - disketteExtension->FloppyThread = (void *)0; + /* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ } - } else { - - } - { -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if (disketteExtension->ReleaseFdcWithMotorRunning) { + if (disketteExtension->ThreadReferenceCount == 0L) { + disketteExtension->ThreadReferenceCount = -1; + if ((unsigned int)disketteExtension->FloppyThread != + (unsigned int)((void *)0)) { + { + /* ObfDereferenceObject(disketteExtension->FloppyThread); */ /* INLINED */ + disketteExtension->FloppyThread = (void *)0; + } + } else { + } + { + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if (disketteExtension->ReleaseFdcWithMotorRunning) { + { + ntStatus = + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (768 << 2)) | 3, &acquireWait); + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (775 << 2)) | 3, (void *)0); + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (769 << 2)) | 3, + disketteExtension->DeviceObject); + disketteExtension->FloppyControllerAllocated = 0; + disketteExtension->ReleaseFdcWithMotorRunning = 0; + } + } else { + } + } else { + } + { + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; + } + if (PagingReferenceCount == 0UL) { + { /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } + } else { + } { - ntStatus = FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (768 << 2)) | 3, - & acquireWait); - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (775 << 2)) | 3, - (void *)0); - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (769 << 2)) | 3, - disketteExtension->DeviceObject); - disketteExtension->FloppyControllerAllocated = 0; - disketteExtension->ReleaseFdcWithMotorRunning = 0; + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + } {} { + PsTerminateSystemThread(0L); } } else { - } - } else { - - } - { -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; - } - if (PagingReferenceCount == 0UL) { { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ } + goto __Cont; } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ - } - { } { - PsTerminateSystemThread(0L); - } - } else { - - } - { -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - } - goto __Cont; - } else { - - } - { - while (1) { - while_117_continue: /* CIL Label */ ; - { - request = (void *)0; /* ExfInterlockedRemoveHeadList(& disketteExtension->ListEntry, & disketteExtension->ListSpinLock); */ /* INLINED */ - } - if (request) { - - } else { - goto while_117_break; - } - { -/* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - disketteExtension->ThreadReferenceCount -= 1L; -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - disketteExtension->HardwareFailed = 0; - irp = (IRP *)((CHAR *)request - (unsigned long )(& ((IRP *)0)->Tail.Overlay.__annonCompField17.ListEntry)); -/* ExAcquireFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ - } - if ((int )disketteExtension->PoweringDown == 1) { - { -/* ExReleaseFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ - } - { - } - { - irp = (IRP *)((CHAR *)request - (unsigned long )(& ((IRP *)0)->Tail.Overlay.__annonCompField17.ListEntry)); - irp->IoStatus.__annonCompField4.Status = -1073741101L; - irp->IoStatus.Information = 0; - IofCompleteRequest(irp, 0); - } - goto while_117_continue; - } else { - - } - { -/* ExReleaseFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ - } - { - } - irpSp = irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - { - } - if (irpSp->MajorFunction == 27) { - goto switch_121_27; - } else { - if (irpSp->MajorFunction == 3) { - goto switch_121_3; - } else { - if (irpSp->MajorFunction == 4) { - goto switch_121_4; - } else { - if (irpSp->MajorFunction == 14) { - goto switch_121_14; - } else { - { - goto switch_121_default; - if (0) { - switch_121_27: /* CIL Label */ ; - { - } - if ((int )irpSp->MinorFunction == 1) { - goto _L; - } else { - if ((int )irpSp->MinorFunction == 5) { - _L: /* CIL Label */ - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if (disketteExtension->ReleaseFdcWithMotorRunning) { - { - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (768 << 2)) | 3, - & acquireWait); - disketteExtension->ReleaseFdcWithMotorRunning = 0; - disketteExtension->FloppyControllerAllocated = 1; - } - } else { - - } - } else { - - } - if (disketteExtension->FloppyControllerAllocated) { - { - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (775 << 2)) | 3, - (void *)0); - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (769 << 2)) | 3, - disketteExtension->DeviceObject); - disketteExtension->FloppyControllerAllocated = 0; - } - } else { - - } - { -/* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - disketteExtension->ThreadReferenceCount = -1; -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; - } - if (PagingReferenceCount == 0UL) { - { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ - } - } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ - PsTerminateSystemThread(0L); - } - } else { - ntStatus = -1073741808L; - } - } - goto switch_121_break; - switch_121_3: /* CIL Label */ ; - switch_121_4: /* CIL Label */ ; - if (! disketteExtension->FloppyControllerAllocated) { - { - ntStatus = FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (768 << 2)) | 3, - & acquireWait); - } - if (ntStatus >= 0L) { - disketteExtension->FloppyControllerAllocated = 1; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - disketteExtension->ReleaseFdcWithMotorRunning = 0; - } else { - - } - } else { - goto switch_121_break; - } - } else { - - } - if ((disketteExtension->DeviceObject)->Flags & 2UL) { - if (! ((int )irpSp->Flags & 2)) { - { - } - ntStatus = -2147483626L; - } else { - { - ntStatus = FlReadWrite(disketteExtension, irp, 0); - } - } - } else { - { - ntStatus = FlReadWrite(disketteExtension, irp, 0); - } - } - goto switch_121_break; - switch_121_14: /* CIL Label */ ; - if (! disketteExtension->FloppyControllerAllocated) { - { - ntStatus = FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (768 << 2)) | 3, - & acquireWait); - } - if (ntStatus >= 0L) { - disketteExtension->FloppyControllerAllocated = 1; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - disketteExtension->ReleaseFdcWithMotorRunning = 0; - } else { - - } - } else { - goto switch_121_break; - } - } else { - - } - if ((disketteExtension->DeviceObject)->Flags & 2UL) { - if (! ((int )irpSp->Flags & 2)) { - { - } - ntStatus = -2147483626L; - } else { - goto _L___2; - } - } else { - _L___2: /* CIL Label */ - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((45 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_125_exp_12; - } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((7 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_125_exp_13; - } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((7 << 16) | (9 << 2))) { - goto switch_125_exp_14; - } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == 7 << 16) { - goto switch_125_exp_15; - } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((7 << 16) | (3 << 14)) | (11 << 2))) { - goto switch_125_exp_16; - } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((7 << 16) | (3 << 14)) | (6 << 2))) { - goto switch_125_exp_17; - } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((7 << 16) | (248 << 2))) { - goto switch_125_exp_18; - } else { - if (0) { - switch_125_exp_12: /* CIL Label */ ; - switch_125_exp_13: /* CIL Label */ ; - { - } - { - ntStatus = FlStartDrive(disketteExtension, irp, - 0, 0, (unsigned char )(! (! ((int )irpSp->Flags & 2)))); - } - goto switch_125_break; - switch_125_exp_14: /* CIL Label */ ; - { - } - if (disketteExtension->IsReadOnly) { - ntStatus = -1073741811L; - } else { - { - ntStatus = FlStartDrive(disketteExtension, irp, - 1, 0, 1); - } - } - goto switch_125_break; - switch_125_exp_15: /* CIL Label */ ; - { - } - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(DISK_GEOMETRY )) { - ntStatus = -1073741811L; - } else { - { - ntStatus = FlStartDrive(disketteExtension, irp, - 0, 1, (unsigned char )(! (! ((int )irpSp->Flags & 2)))); - } - } - if (ntStatus >= 0L) { - goto _L___0; - } else { - if (ntStatus == -1073741804L) { - _L___0: /* CIL Label */ - outputBuffer = (struct _DISK_GEOMETRY *)irp->AssociatedIrp.SystemBuffer; - ntStatus = 0L; - outputBuffer->MediaType = disketteExtension->MediaType; - if ((int )disketteExtension->MediaType == 0) { - { - } - outputBuffer->Cylinders.__annonCompField1.LowPart = 0; - outputBuffer->Cylinders.__annonCompField1.HighPart = 0; - outputBuffer->TracksPerCylinder = 0; - outputBuffer->SectorsPerTrack = 0; - outputBuffer->BytesPerSector = 0; - } else { - { - } - outputBuffer->Cylinders.__annonCompField1.LowPart = (int )disketteExtension->DriveMediaConstants.MaximumTrack + 1; - outputBuffer->Cylinders.__annonCompField1.HighPart = 0; - outputBuffer->TracksPerCylinder = disketteExtension->DriveMediaConstants.NumberOfHeads; - outputBuffer->SectorsPerTrack = disketteExtension->DriveMediaConstants.SectorsPerTrack; - outputBuffer->BytesPerSector = disketteExtension->DriveMediaConstants.BytesPerSector; - } - { - } - } else { - - } - } - irp->IoStatus.Information = sizeof(DISK_GEOMETRY ); - goto switch_125_break; - switch_125_exp_16: /* CIL Label */ ; - switch_125_exp_17: /* CIL Label */ ; - { - } - { - ntStatus = FlStartDrive(disketteExtension, irp, - 1, 0, 0); - } - if (ntStatus >= 0L) { - goto _L___1; - } else { - if (ntStatus == -1073741804L) { - _L___1: /* CIL Label */ - { - FlAllocateIoBuffer(disketteExtension, 4096); - } - if (disketteExtension->IoBuffer) { - { - ntStatus = FlFormat(disketteExtension, irp); - } - } else { - ntStatus = -1073741670L; - } - } else { - - } - } - goto switch_125_break; - switch_125_exp_18: /* CIL Label */ ; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - disketteExtension->FifoBuffer[0] = 14; - disketteExtension->FifoBuffer[1] = disketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(disketteExtension, disketteExtension->FifoBuffer, - disketteExtension->FifoBuffer, - (void *)0, 0, 0); - } - if (ntStatus >= 0L) { - outputBuffer___0 = (struct _SENSE_DEVISE_STATUS_PTOS *)irp->AssociatedIrp.SystemBuffer; - outputBuffer___0->ST3_PTOS = Result_Status3_PTOS[0].ST3_PTOS; - irp->IoStatus.Information = sizeof(SENSE_DEVISE_STATUS_PTOS ); - } else { - - } - goto switch_125_break; - } else { - - } - } else { - switch_125_break: /* CIL Label */ ; - } - } - } - } - } - } - } - } - } - goto switch_121_break; - switch_121_default: /* CIL Label */ ; - { - } - ntStatus = -1073741822L; - } else { - switch_121_break: /* CIL Label */ ; - } - } + while (1) { + while_117_continue: /* CIL Label */; + { + request = (void *)0; + /* ExfInterlockedRemoveHeadList(& disketteExtension->ListEntry, & disketteExtension->ListSpinLock); */ /* INLINED */ } - } - } - } - if (ntStatus == -2147483631L) { - { - while (1) { - while_134_continue: /* CIL Label */ ; - { - disketteExtension->HardwareFailed = 0; - irp->IoStatus.__annonCompField4.Status = -2147483631L; - IofCompleteRequest(irp, 1); - request = (void *)0; /* ExfInterlockedRemoveHeadList(& disketteExtension->ListEntry, & disketteExtension->ListSpinLock); */ /* INLINED */ - } - if (! request) { - goto while_134_break; - } else { + if (request) { - } - { -/* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - disketteExtension->ThreadReferenceCount -= 1L; -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - irp = (IRP *)((CHAR *)request - (unsigned long )(& ((IRP *)0)->Tail.Overlay.__annonCompField17.ListEntry)); - } - } - while_134_break: /* CIL Label */ ; - } - } else { - irp->IoStatus.__annonCompField4.Status = ntStatus; - if (disketteExtension->IoBuffer) { - { - FlFreeIoBuffer(disketteExtension); - } - } else { - - } - { - FlFinishOperation(irp, disketteExtension); - } - } - } - while_117_break: /* CIL Label */ ; - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if (disketteExtension->FloppyControllerAllocated) { - { - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (769 << 2)) | 3, - disketteExtension->DeviceObject); - disketteExtension->FloppyControllerAllocated = 0; - disketteExtension->ReleaseFdcWithMotorRunning = 1; - } - } else { - - } - } else { - - } - __Cont: /* CIL Label */ ; - } - while_114_break: /* CIL Label */ ; - } -} -} -void FlConsolidateMediaTypeWithBootSector(PDISKETTE_EXTENSION DisketteExtension , - PBOOT_SECTOR_INFO BootSector ) -{ USHORT bpbNumberOfSectors ; - USHORT bpbNumberOfHeads ; - USHORT bpbSectorsPerTrack ; - USHORT bpbBytesPerSector ; - USHORT bpbMediaByte ; - USHORT bpbMaximumTrack ; - MEDIA_TYPE bpbMediaType ; - ULONG i ; - ULONG n ; - PDRIVE_MEDIA_CONSTANTS readidDriveMediaConstants ; - BOOLEAN changeToBpbMedia ; - int tmp ; - SIZE_T tmp___0 ; - - { - { - } - if ((int )BootSector->JumpByte[0] != 235) { - if ((int )BootSector->JumpByte[0] != 233) { - return; - } else { - - } - } else { - - } - bpbNumberOfSectors = (int )BootSector->NumberOfSectors[1] * 256 + (int )BootSector->NumberOfSectors[0]; - bpbNumberOfHeads = (int )BootSector->NumberOfHeads[1] * 256 + (int )BootSector->NumberOfHeads[0]; - bpbSectorsPerTrack = (int )BootSector->SectorsPerTrack[1] * 256 + (int )BootSector->SectorsPerTrack[0]; - bpbBytesPerSector = (int )BootSector->BytesPerSector[1] * 256 + (int )BootSector->BytesPerSector[0]; - bpbMediaByte = BootSector->MediaByte[0]; - if (! bpbNumberOfHeads) { - return; - } else { - if (! bpbSectorsPerTrack) { - return; - } else { - - } - } - bpbMaximumTrack = ((int )bpbNumberOfSectors / (int )bpbNumberOfHeads) / (int )bpbSectorsPerTrack - 1; - bpbMediaType = 0; - i = 0; - { - while (1) { - while_136_continue: /* CIL Label */ ; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - tmp = 21; - } else { - tmp = 17; - } - if (i < (unsigned long )tmp) { - - } else { - goto while_136_break; - } - if ((int )bpbBytesPerSector == (int )(DriveMediaConstants + i)->BytesPerSector) { - if ((int )bpbSectorsPerTrack == (int )(DriveMediaConstants + i)->SectorsPerTrack) { - if ((int )bpbMaximumTrack == (int )(DriveMediaConstants + i)->MaximumTrack) { - if ((int )bpbNumberOfHeads == (int )(DriveMediaConstants + i)->NumberOfHeads) { - if ((int )bpbMediaByte == (int )(DriveMediaConstants + i)->MediaByte) { - bpbMediaType = (DriveMediaConstants + i)->MediaType; - goto while_136_break; } else { - + goto while_117_break; } - } else { - - } - } else { - - } - } else { - - } - } else { - - } - i += 1UL; - } - while_136_break: /* CIL Label */ ; - } - if ((int )DisketteExtension->DriveType == 3) { - if (bpbMediaType == 15) { - goto switch_137_15; - } else { - if (bpbMediaType == 16) { - goto switch_137_16; - } else { - if (bpbMediaType == 1) { - goto switch_137_1; - } else { - if (bpbMediaType == 19) { - goto switch_137_19; - } else { { - goto switch_137_default; - if (0) { - switch_137_15: /* CIL Label */ - bpbMediaType = 14; - goto switch_137_break; - switch_137_16: /* CIL Label */ - bpbMediaType = 5; - goto switch_137_break; - switch_137_1: /* CIL Label */ - bpbMediaType = 17; - goto switch_137_break; - switch_137_19: /* CIL Label */ - bpbMediaType = 18; - goto switch_137_break; - switch_137_default: /* CIL Label */ ; - goto switch_137_break; - } else { - switch_137_break: /* CIL Label */ ; + /* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + disketteExtension->ThreadReferenceCount -= 1L; + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + disketteExtension->HardwareFailed = 0; + irp = + (IRP *)((CHAR *)request - + (unsigned long)(&((IRP *)0) + ->Tail.Overlay.__annonCompField17 + .ListEntry)); + /* ExAcquireFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ } + if ((int)disketteExtension->PoweringDown == 1) { + { + /* ExReleaseFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ + } {} { + irp = (IRP *)((CHAR *)request - + (unsigned long)(&((IRP *)0) + ->Tail.Overlay + .__annonCompField17 + .ListEntry)); + irp->IoStatus.__annonCompField4.Status = -1073741101L; + irp->IoStatus.Information = 0; + IofCompleteRequest(irp, 0); + } + goto while_117_continue; + } else { } - } - } - } - } - } else { - - } - { - } - { - } - if ((int )bpbMediaType == (int )DisketteExtension->MediaType) { - changeToBpbMedia = 0; - { - } - } else { - readidDriveMediaConstants = & DisketteExtension->DriveMediaConstants; - if ((int )bpbBytesPerSector == (int )readidDriveMediaConstants->BytesPerSector) { - if ((int )bpbSectorsPerTrack < 256) { - if ((int )bpbMaximumTrack == (int )readidDriveMediaConstants->MaximumTrack) { - if ((int )bpbNumberOfHeads <= (int )readidDriveMediaConstants->NumberOfHeads) { - changeToBpbMedia = 1; - } else { - changeToBpbMedia = 0; - } - } else { - changeToBpbMedia = 0; - } - } else { - changeToBpbMedia = 0; - } - } else { - changeToBpbMedia = 0; - } - { - } - if ((int )bpbMediaType == 0) { - bpbMediaType = readidDriveMediaConstants->MediaType; - DisketteExtension->DriveMediaConstants.SkewDelta = 0; - } else { - - } - } - if (changeToBpbMedia) { - i = (DriveMediaLimits + DisketteExtension->DriveType)->LowestDriveMediaType; - n = (DriveMediaLimits + DisketteExtension->DriveType)->HighestDriveMediaType; - { - while (1) { - while_142_continue: /* CIL Label */ ; - if (i <= n) { - - } else { - goto while_142_break; - } - if ((int )bpbMediaType == (int )(DriveMediaConstants + i)->MediaType) { - DisketteExtension->DriveMediaType = i; - goto while_142_break; - } else { - - } - i += 1UL; - } - while_142_break: /* CIL Label */ ; - } - { - DisketteExtension->MediaType = bpbMediaType; - DisketteExtension->ByteCapacity = (int )bpbNumberOfSectors * (int )bpbBytesPerSector; - DisketteExtension->DriveMediaConstants.SectorsPerTrack = (unsigned char )bpbSectorsPerTrack; - DisketteExtension->DriveMediaConstants.NumberOfHeads = (unsigned char )bpbNumberOfHeads; - tmp___0 = RtlCompareMemory(BootSector->OemData, "MSDMF3.", 7); - } - if (tmp___0 == 7UL) { - DisketteExtension->IsReadOnly = 1; - } else { - - } - } else { - - } - return; -} -} -void FlCheckBootSector(PDISKETTE_EXTENSION DisketteExtension ) -{ PBOOT_SECTOR_INFO bootSector ; - LARGE_INTEGER offset ; - PIRP irp ; - NTSTATUS status ; - int tmp ; - PVOID tmp___0 ; - int tmp___1 ; - - { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - tmp = 1024; - } else { - tmp = 512; - } - { - tmp___0 = ExAllocatePoolWithTag(4, tmp, 1886350406UL); - bootSector = tmp___0; - } - if (! bootSector) { - return; - } else { - - } - offset.__annonCompField1.HighPart = 0; - offset.__annonCompField1.LowPart = offset.__annonCompField1.HighPart; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - tmp___1 = 1024; - } else { - tmp___1 = 512; - } - { - irp = IoBuildAsynchronousFsdRequest(3, DisketteExtension->DeviceObject, bootSector, - tmp___1, & offset, (void *)0); - } - if (! irp) { - { -/* ExFreePool(bootSector); */ /* INLINED */ - } - return; - } else { - - } - { - irp->CurrentLocation = (CHAR )((int )irp->CurrentLocation - 1); - irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation -= 1; - status = FlReadWrite(DisketteExtension, irp, 1); -/* MmUnlockPages(irp->MdlAddress); */ /* INLINED */ -/* IoFreeMdl(irp->MdlAddress); */ /* INLINED */ -/* IoFreeIrp(irp); */ /* INLINED */ -/* ExFreePool(bootSector); */ /* INLINED */ - } - return; -} -} -NTSTATUS FlReadWriteTrack(PDISKETTE_EXTENSION DisketteExtension , PMDL IoMdl , ULONG IoOffset , - BOOLEAN WriteOperation , UCHAR Cylinder , UCHAR Head , UCHAR Sector , - UCHAR NumberOfSectors , BOOLEAN NeedSeek ) -{ PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - ULONG byteToSectorShift ; - ULONG transferBytes ; - LARGE_INTEGER headSettleTime ; - NTSTATUS status ; - ULONG seekRetry ; - ULONG ioRetry ; - BOOLEAN recalibrateDrive ; - UCHAR i ; - - { - recalibrateDrive = 0; - { - } - driveMediaConstants = & DisketteExtension->DriveMediaConstants; - byteToSectorShift = 7 + (int )driveMediaConstants->SectorLengthCode; - transferBytes = (unsigned long )NumberOfSectors << byteToSectorShift; - headSettleTime.__annonCompField1.LowPart = - (10000 * (int )driveMediaConstants->HeadSettleTime); - headSettleTime.__annonCompField1.HighPart = -1; - seekRetry = 0; - ioRetry = 0; - { - while (1) { - while_144_continue: /* CIL Label */ ; - if (seekRetry < 3UL) { - - } else { - goto while_144_break; - } - if (recalibrateDrive) { - { - } - { - FlRecalibrateDrive(DisketteExtension); - } - } else { - - } - if (recalibrateDrive) { - goto _L___0; - } else { - if (NeedSeek) { - if (! DisketteExtension->ControllerConfigurable) { - goto _L___0; - } else { - if ((int )driveMediaConstants->CylinderShift != 0) { - _L___0: /* CIL Label */ { - DisketteExtension->FifoBuffer[0] = 16; - DisketteExtension->FifoBuffer[1] = ((int )Head << 2) | (int )DisketteExtension->DeviceUnit; - DisketteExtension->FifoBuffer[2] = (int )Cylinder << (int )driveMediaConstants->CylinderShift; - status = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); - } - if (status >= 0L) { - if (! ((int )DisketteExtension->FifoBuffer[0] & 32)) { - DisketteExtension->HardwareFailed = 1; - status = -1073741464L; + /* ExReleaseFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ + } {} + irpSp = irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + {} + if (irpSp->MajorFunction == 27) { + goto switch_121_27; + } else { + if (irpSp->MajorFunction == 3) { + goto switch_121_3; } else { - if ((int )DisketteExtension->FifoBuffer[1] != (int )Cylinder << (int )driveMediaConstants->CylinderShift) { - DisketteExtension->HardwareFailed = 1; - status = -1073741464L; + if (irpSp->MajorFunction == 4) { + goto switch_121_4; } else { - - } - } - if (status >= 0L) { - { - KeDelayExecutionThread(0, 0, & headSettleTime); - DisketteExtension->FifoBuffer[0] = 84; - DisketteExtension->FifoBuffer[1] = ((int )Head << 2) | (int )DisketteExtension->DeviceUnit; - status = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, - 0, 0); - } - if (status >= 0L) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if ((int )DisketteExtension->FifoBuffer[0] & 8) { - return (-1073741661L); - } else { - - } + if (irpSp->MajorFunction == 14) { + goto switch_121_14; } else { - - } - if ((int )DisketteExtension->FifoBuffer[0] != (((int )Head << 2) | (int )DisketteExtension->DeviceUnit)) { { - DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], DisketteExtension->FifoBuffer[2]); - } - } else { - if ((int )DisketteExtension->FifoBuffer[1] != 0) { - { - DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], - DisketteExtension->FifoBuffer[2]); - } - } else { - if ((int )DisketteExtension->FifoBuffer[2] != 0) { - { - DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], - DisketteExtension->FifoBuffer[2]); + goto switch_121_default; + if (0) { + switch_121_27: /* CIL Label */; + {} + if ((int)irpSp->MinorFunction == 1) { + goto _L; + } else { + if ((int)irpSp->MinorFunction == 5) { + _L: /* CIL Label */ + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if (disketteExtension + ->ReleaseFdcWithMotorRunning) { + { + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (768 << 2)) | 3, + &acquireWait); + disketteExtension + ->ReleaseFdcWithMotorRunning = 0; + disketteExtension->FloppyControllerAllocated = + 1; + } + } else { + } + } else { + } + if (disketteExtension->FloppyControllerAllocated) { + { + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (775 << 2)) | 3, + (void *)0); + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (769 << 2)) | 3, + disketteExtension->DeviceObject); + disketteExtension->FloppyControllerAllocated = + 0; + } + } else { + } + { + /* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + disketteExtension->ThreadReferenceCount = -1; + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; + } + if (PagingReferenceCount == 0UL) { + { + /* MmPageEntireDriver(& DriverEntry); */ /* INLINED + */ + } + } else { + } + { + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + PsTerminateSystemThread(0L); + } + } else { + ntStatus = -1073741808L; + } } - } else { - if ((int )DisketteExtension->FifoBuffer[3] != (int )Cylinder) { + goto switch_121_break; + switch_121_3: /* CIL Label */; + switch_121_4: /* CIL Label */; + if (!disketteExtension->FloppyControllerAllocated) { { - DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], - DisketteExtension->FifoBuffer[2]); + ntStatus = FlFdcDeviceIo( + disketteExtension->TargetObject, + ((7 << 16) | (768 << 2)) | 3, &acquireWait); + } + if (ntStatus >= 0L) { + disketteExtension->FloppyControllerAllocated = 1; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + disketteExtension->ReleaseFdcWithMotorRunning = 0; + } else { + } + } else { + goto switch_121_break; } } else { - } + if ((disketteExtension->DeviceObject)->Flags & 2UL) { + if (!((int)irpSp->Flags & 2)) { + {} + ntStatus = -2147483626L; + } else { + { + ntStatus = FlReadWrite(disketteExtension, irp, 0); + } + } + } else { + { ntStatus = FlReadWrite(disketteExtension, irp, 0); } + } + goto switch_121_break; + switch_121_14: /* CIL Label */; + if (!disketteExtension->FloppyControllerAllocated) { + { + ntStatus = FlFdcDeviceIo( + disketteExtension->TargetObject, + ((7 << 16) | (768 << 2)) | 3, &acquireWait); + } + if (ntStatus >= 0L) { + disketteExtension->FloppyControllerAllocated = 1; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + disketteExtension->ReleaseFdcWithMotorRunning = 0; + } else { + } + } else { + goto switch_121_break; + } + } else { + } + if ((disketteExtension->DeviceObject)->Flags & 2UL) { + if (!((int)irpSp->Flags & 2)) { + {} + ntStatus = -2147483626L; + } else { + goto _L___2; + } + } else { + _L___2: /* CIL Label */ + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + (((45 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_125_exp_12; + } else { + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == + (((7 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_125_exp_13; + } else { + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == + ((7 << 16) | (9 << 2))) { + goto switch_125_exp_14; + } else { + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == 7 << 16) { + goto switch_125_exp_15; + } else { + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == + (((7 << 16) | (3 << 14)) | (11 << 2))) { + goto switch_125_exp_16; + } else { + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == + (((7 << 16) | (3 << 14)) | (6 << 2))) { + goto switch_125_exp_17; + } else { + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == + ((7 << 16) | (248 << 2))) { + goto switch_125_exp_18; + } else { + if (0) { + switch_125_exp_12: /* CIL Label */; + switch_125_exp_13: /* CIL Label */; + {} { + ntStatus = FlStartDrive( + disketteExtension, irp, 0, 0, + (unsigned char)(!( + !((int)irpSp->Flags & 2)))); + } + goto switch_125_break; + switch_125_exp_14: /* CIL Label */; + {} + if (disketteExtension->IsReadOnly) { + ntStatus = -1073741811L; + } else { + { + ntStatus = FlStartDrive( + disketteExtension, irp, 1, 0, + 1); + } + } + goto switch_125_break; + switch_125_exp_15: /* CIL Label */; + {} + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof(DISK_GEOMETRY)) { + ntStatus = -1073741811L; + } else { + { + ntStatus = FlStartDrive( + disketteExtension, irp, 0, 1, + (unsigned char)(!(!( + (int)irpSp->Flags & 2)))); + } + } + if (ntStatus >= 0L) { + goto _L___0; + } else { + if (ntStatus == -1073741804L) { + _L___0: /* CIL Label */ + outputBuffer = + (struct _DISK_GEOMETRY *) + irp->AssociatedIrp + .SystemBuffer; + ntStatus = 0L; + outputBuffer->MediaType = + disketteExtension->MediaType; + if ((int)disketteExtension + ->MediaType == 0) { + {} + outputBuffer->Cylinders + .__annonCompField1.LowPart = + 0; + outputBuffer->Cylinders + .__annonCompField1 + .HighPart = 0; + outputBuffer + ->TracksPerCylinder = 0; + outputBuffer->SectorsPerTrack = + 0; + outputBuffer->BytesPerSector = + 0; + } else { + {} + outputBuffer->Cylinders + .__annonCompField1.LowPart = + (int)disketteExtension + ->DriveMediaConstants + .MaximumTrack + + 1; + outputBuffer->Cylinders + .__annonCompField1 + .HighPart = 0; + outputBuffer + ->TracksPerCylinder = + disketteExtension + ->DriveMediaConstants + .NumberOfHeads; + outputBuffer->SectorsPerTrack = + disketteExtension + ->DriveMediaConstants + .SectorsPerTrack; + outputBuffer->BytesPerSector = + disketteExtension + ->DriveMediaConstants + .BytesPerSector; + } + {} + } else { + } + } + irp->IoStatus.Information = + sizeof(DISK_GEOMETRY); + goto switch_125_break; + switch_125_exp_16: /* CIL Label */; + switch_125_exp_17: /* CIL Label */; + {} { + ntStatus = + FlStartDrive(disketteExtension, + irp, 1, 0, 0); + } + if (ntStatus >= 0L) { + goto _L___1; + } else { + if (ntStatus == -1073741804L) { + _L___1 : /* CIL Label */ + { + FlAllocateIoBuffer( + disketteExtension, 4096); + } + if (disketteExtension->IoBuffer) { + { + ntStatus = FlFormat( + disketteExtension, irp); + } + } else { + ntStatus = -1073741670L; + } + } else { + } + } + goto switch_125_break; + switch_125_exp_18: /* CIL Label */; + if ((int)((KUSER_SHARED_DATA * + const)4292804608U) + ->AlternativeArchitecture == + 1) { + { + disketteExtension->FifoBuffer[0] = + 14; + disketteExtension->FifoBuffer[1] = + disketteExtension->DeviceUnit; + ntStatus = FlIssueCommand( + disketteExtension, + disketteExtension->FifoBuffer, + disketteExtension->FifoBuffer, + (void *)0, 0, 0); + } + if (ntStatus >= 0L) { + outputBuffer___0 = + (struct + _SENSE_DEVISE_STATUS_PTOS *) + irp->AssociatedIrp + .SystemBuffer; + outputBuffer___0->ST3_PTOS = + Result_Status3_PTOS[0] + .ST3_PTOS; + irp->IoStatus.Information = + sizeof( + SENSE_DEVISE_STATUS_PTOS); + } else { + } + goto switch_125_break; + } else { + } + } else { + switch_125_break: /* CIL Label */; + } + } + } + } + } + } + } + } + } + goto switch_121_break; + switch_121_default: /* CIL Label */; + {} + ntStatus = -1073741822L; + } else { + switch_121_break: /* CIL Label */; } } } - } else { + } + } + } + if (ntStatus == -2147483631L) { + { + while (1) { + while_134_continue: /* CIL Label */; + { + disketteExtension->HardwareFailed = 0; + irp->IoStatus.__annonCompField4.Status = -2147483631L; + IofCompleteRequest(irp, 1); + request = (void *)0; + /* ExfInterlockedRemoveHeadList(& disketteExtension->ListEntry, & disketteExtension->ListSpinLock); */ /* INLINED */ + } + if (!request) { + goto while_134_break; + } else { + } { + /* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + disketteExtension->ThreadReferenceCount -= 1L; + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + irp = (IRP *)((CHAR *)request - + (unsigned long)(&((IRP *)0) + ->Tail.Overlay + .__annonCompField17 + .ListEntry)); } } - } else { - + while_134_break: /* CIL Label */; } } else { - { + irp->IoStatus.__annonCompField4.Status = ntStatus; + if (disketteExtension->IoBuffer) { + { FlFreeIoBuffer(disketteExtension); } + } else { } + { FlFinishOperation(irp, disketteExtension); } } - } else { - status = 0L; - } - } - } else { - status = 0L; - } - } - if (! (status >= 0L)) { - { - } - recalibrateDrive = 1; - goto __Cont; - } else { - - } - { - while (1) { - while_149_continue: /* CIL Label */ ; - DisketteExtension->FifoBuffer[1] = ((int )Head << 2) | (int )DisketteExtension->DeviceUnit; - DisketteExtension->FifoBuffer[2] = Cylinder; - DisketteExtension->FifoBuffer[3] = Head; - DisketteExtension->FifoBuffer[4] = (int )Sector + 1; - DisketteExtension->FifoBuffer[5] = driveMediaConstants->SectorLengthCode; - DisketteExtension->FifoBuffer[6] = (int )Sector + (int )NumberOfSectors; - DisketteExtension->FifoBuffer[7] = driveMediaConstants->ReadWriteGapLength; - DisketteExtension->FifoBuffer[8] = driveMediaConstants->DataLength; - if (WriteOperation) { - DisketteExtension->FifoBuffer[0] = 66; - } else { - DisketteExtension->FifoBuffer[0] = 64; - } - { - status = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, DisketteExtension->FifoBuffer, - IoMdl, IoOffset, transferBytes); - } - if (status >= 0L) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if ((int )DisketteExtension->FifoBuffer[0] & 8) { - return (-1073741661L); - } else { - } - } else { - + while_117_break: /* CIL Label */; } - if (((int )DisketteExtension->FifoBuffer[0] & 192) != 0) { - if (((int )DisketteExtension->FifoBuffer[0] & 192) != 64) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if (disketteExtension->FloppyControllerAllocated) { { - DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], DisketteExtension->FifoBuffer[2]); + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (769 << 2)) | 3, + disketteExtension->DeviceObject); + disketteExtension->FloppyControllerAllocated = 0; + disketteExtension->ReleaseFdcWithMotorRunning = 1; } } else { - if ((int )DisketteExtension->FifoBuffer[1] != 128) { - { - DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], DisketteExtension->FifoBuffer[2]); - } - } else { - if ((int )DisketteExtension->FifoBuffer[2] != 0) { - { - DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], DisketteExtension->FifoBuffer[2]); - } - } else { - goto _L___1; - } - } } } else { - _L___1: /* CIL Label */ - if ((int )DisketteExtension->FifoBuffer[5] != 1) { - DisketteExtension->HardwareFailed = 1; - status = -1073741465L; - } else { - - } - } - } else { - { } + __Cont: /* CIL Label */; } - if (status >= 0L) { - goto while_149_break; - } else { + while_114_break: /* CIL Label */; + } + } +} +void FlConsolidateMediaTypeWithBootSector(PDISKETTE_EXTENSION DisketteExtension, + PBOOT_SECTOR_INFO BootSector) { + USHORT bpbNumberOfSectors; + USHORT bpbNumberOfHeads; + USHORT bpbSectorsPerTrack; + USHORT bpbBytesPerSector; + USHORT bpbMediaByte; + USHORT bpbMaximumTrack; + MEDIA_TYPE bpbMediaType; + ULONG i; + ULONG n; + PDRIVE_MEDIA_CONSTANTS readidDriveMediaConstants; + BOOLEAN changeToBpbMedia; + int tmp; + SIZE_T tmp___0; - } - if (ioRetry >= 2UL) { - { - } - goto while_149_break; + { + {} + if ((int)BootSector->JumpByte[0] != 235) { + if ((int)BootSector->JumpByte[0] != 233) { + return; } else { - } - ioRetry += 1UL; - } - while_149_break: /* CIL Label */ ; - } - if (status >= 0L) { - goto while_144_break; } else { - } - recalibrateDrive = 1; - __Cont: /* CIL Label */ - seekRetry += 1UL; - } - while_144_break: /* CIL Label */ ; - } - if (! (status >= 0L)) { - if ((int )NumberOfSectors > 1) { - { + bpbNumberOfSectors = (int)BootSector->NumberOfSectors[1] * 256 + + (int)BootSector->NumberOfSectors[0]; + bpbNumberOfHeads = (int)BootSector->NumberOfHeads[1] * 256 + + (int)BootSector->NumberOfHeads[0]; + bpbSectorsPerTrack = (int)BootSector->SectorsPerTrack[1] * 256 + + (int)BootSector->SectorsPerTrack[0]; + bpbBytesPerSector = (int)BootSector->BytesPerSector[1] * 256 + + (int)BootSector->BytesPerSector[0]; + bpbMediaByte = BootSector->MediaByte[0]; + if (!bpbNumberOfHeads) { + return; + } else { + if (!bpbSectorsPerTrack) { + return; + } else { } - i = 0; - { + } + bpbMaximumTrack = ((int)bpbNumberOfSectors / (int)bpbNumberOfHeads) / + (int)bpbSectorsPerTrack - + 1; + bpbMediaType = 0; + i = 0; + { while (1) { - while_153_continue: /* CIL Label */ ; - if ((int )i < (int )NumberOfSectors) { - + while_136_continue: /* CIL Label */; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + tmp = 21; } else { - goto while_153_break; + tmp = 17; } - { - status = FlReadWriteTrack(DisketteExtension, IoMdl, IoOffset + ((unsigned long )i << byteToSectorShift), - WriteOperation, Cylinder, Head, (unsigned char )((int )Sector + (int )i), - 1, 0); + if (i < (unsigned long)tmp) { + + } else { + goto while_136_break; } - if (! (status >= 0L)) { - { + if ((int)bpbBytesPerSector == + (int)(DriveMediaConstants + i)->BytesPerSector) { + if ((int)bpbSectorsPerTrack == + (int)(DriveMediaConstants + i)->SectorsPerTrack) { + if ((int)bpbMaximumTrack == + (int)(DriveMediaConstants + i)->MaximumTrack) { + if ((int)bpbNumberOfHeads == + (int)(DriveMediaConstants + i)->NumberOfHeads) { + if ((int)bpbMediaByte == + (int)(DriveMediaConstants + i)->MediaByte) { + bpbMediaType = (DriveMediaConstants + i)->MediaType; + goto while_136_break; + } else { + } + } else { + } + } else { + } + } else { } - DisketteExtension->HardwareFailed = 1; - goto while_153_break; } else { - } - i = (UCHAR )((int )i + 1); - } - while_153_break: /* CIL Label */ ; + i += 1UL; } - } else { - - } - } else { - - } - return (status); -} -} -NTSTATUS FlReadWrite(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp , BOOLEAN DriveStarted ) -{ PIO_STACK_LOCATION irpSp ; - BOOLEAN writeOperation ; - NTSTATUS status ; - PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - ULONG byteToSectorShift ; - ULONG currentSector ; - ULONG firstSector ; - ULONG lastSector ; - ULONG trackSize ; - UCHAR sectorsPerTrack ; - UCHAR numberOfHeads ; - UCHAR currentHead ; - UCHAR currentCylinder ; - UCHAR trackSector ; - PCHAR userBuffer ; - UCHAR skew ; - UCHAR skewDelta ; - UCHAR numTransferSectors ; - PMDL mdl ; - PCHAR ioBuffer ; - ULONG ioOffset ; - PVOID tmp___0 ; - - { - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - { - } - if ((int )irpSp->MajorFunction == 4) { - if (DisketteExtension->IsReadOnly) { - { - } - return (-1073741811L); - } else { - + while_136_break: /* CIL Label */; } - writeOperation = 1; - } else { - writeOperation = 0; - } - { - } - if (DriveStarted) { - status = 0L; - } else { - { - status = FlStartDrive(DisketteExtension, Irp, writeOperation, 1, (unsigned char )(! (! ((int )irpSp->Flags & 2)))); - } - } - if (! (status >= 0L)) { - { - } - return (status); - } else { - - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - FlHdbit(DisketteExtension); - } - } else { - - } - if ((int )DisketteExtension->MediaType == 0) { - { - } - return (-1073741804L); - } else { - - } - driveMediaConstants = & DisketteExtension->DriveMediaConstants; - byteToSectorShift = 7 + (int )driveMediaConstants->SectorLengthCode; - firstSector = irpSp->Parameters.Read.ByteOffset.__annonCompField1.LowPart >> byteToSectorShift; - lastSector = firstSector + (irpSp->Parameters.Read.Length >> byteToSectorShift); - sectorsPerTrack = driveMediaConstants->SectorsPerTrack; - numberOfHeads = driveMediaConstants->NumberOfHeads; - if ((int )(Irp->MdlAddress)->MdlFlags & 5) { - userBuffer = (Irp->MdlAddress)->MappedSystemVa; - } else { - { - tmp___0 = (void *)0; /* MmMapLockedPagesSpecifyCache(Irp->MdlAddress, 0, 1, (void *)0, 0, 32); */ /* INLINED */ - userBuffer = tmp___0; - } - } - if ((unsigned int )userBuffer == (unsigned int )((void *)0)) { - { - } - return (-1073741670L); - } else { - - } - trackSize = (unsigned long )sectorsPerTrack << byteToSectorShift; - skew = 0; - skewDelta = driveMediaConstants->SkewDelta; - currentSector = firstSector; - { - while (1) { - while_161_continue: /* CIL Label */ ; - if (currentSector < lastSector) { - - } else { - goto while_161_break; - } - currentCylinder = (unsigned char )((currentSector / (ULONG )sectorsPerTrack) / (ULONG )numberOfHeads); - trackSector = (unsigned char )(currentSector % (unsigned long )sectorsPerTrack); - currentHead = (unsigned char )((currentSector / (ULONG )sectorsPerTrack) % (unsigned long )numberOfHeads); - numTransferSectors = (int )sectorsPerTrack - (int )trackSector; - if (lastSector - currentSector < (ULONG )numTransferSectors) { - numTransferSectors = (unsigned char )(lastSector - currentSector); - } else { - - } - if (trackSize > DisketteExtension->MaxTransferSize) { - { - } - { - FlAllocateIoBuffer(DisketteExtension, trackSize); - } - if (! DisketteExtension->IoBuffer) { - { - } - return (-1073741670L); - } else { - - } - mdl = DisketteExtension->IoBufferMdl; - ioBuffer = DisketteExtension->IoBuffer; - ioOffset = 0; - if (writeOperation) { - { - memmove(ioBuffer, userBuffer + ((currentSector - firstSector) << byteToSectorShift), - (unsigned long )numTransferSectors << byteToSectorShift); - } + if ((int)DisketteExtension->DriveType == 3) { + if (bpbMediaType == 15) { + goto switch_137_15; } else { - - } - } else { - mdl = Irp->MdlAddress; - ioOffset = (currentSector - firstSector) << byteToSectorShift; - } - if ((int )skew >= (int )numTransferSectors + (int )trackSector) { - skew = 0; - } else { - - } - if ((int )skew < (int )trackSector) { - skew = trackSector; - } else { - - } - { - status = FlReadWriteTrack(DisketteExtension, mdl, ioOffset + (((unsigned long )skew - (unsigned long )trackSector) << byteToSectorShift), - writeOperation, currentCylinder, currentHead, skew, - (unsigned char )(((int )numTransferSectors + (int )trackSector) - (int )skew), - 1); - } - if (status >= 0L) { - if ((int )skew > (int )trackSector) { - { - status = FlReadWriteTrack(DisketteExtension, mdl, ioOffset, writeOperation, - currentCylinder, currentHead, trackSector, (unsigned char )((int )skew - (int )trackSector), - 0); + if (bpbMediaType == 16) { + goto switch_137_16; + } else { + if (bpbMediaType == 1) { + goto switch_137_1; + } else { + if (bpbMediaType == 19) { + goto switch_137_19; + } else { + { + goto switch_137_default; + if (0) { + switch_137_15: /* CIL Label */ + bpbMediaType = 14; + goto switch_137_break; + switch_137_16: /* CIL Label */ + bpbMediaType = 5; + goto switch_137_break; + switch_137_1: /* CIL Label */ + bpbMediaType = 17; + goto switch_137_break; + switch_137_19: /* CIL Label */ + bpbMediaType = 18; + goto switch_137_break; + switch_137_default: /* CIL Label */; + goto switch_137_break; + } else { + switch_137_break: /* CIL Label */; + } + } + } + } } - } else { - skew = ((int )numTransferSectors + (int )trackSector) % (int )sectorsPerTrack; } } else { - skew = ((int )numTransferSectors + (int )trackSector) % (int )sectorsPerTrack; } - if (! (status >= 0L)) { - goto while_161_break; + {} {} + if ((int)bpbMediaType == (int)DisketteExtension->MediaType) { + changeToBpbMedia = 0; + {} } else { - - } - if (! writeOperation) { - if (trackSize > DisketteExtension->MaxTransferSize) { - { - memmove(userBuffer + ((currentSector - firstSector) << byteToSectorShift), - ioBuffer, (unsigned long )numTransferSectors << byteToSectorShift); + readidDriveMediaConstants = &DisketteExtension->DriveMediaConstants; + if ((int)bpbBytesPerSector == + (int)readidDriveMediaConstants->BytesPerSector) { + if ((int)bpbSectorsPerTrack < 256) { + if ((int)bpbMaximumTrack == + (int)readidDriveMediaConstants->MaximumTrack) { + if ((int)bpbNumberOfHeads <= + (int)readidDriveMediaConstants->NumberOfHeads) { + changeToBpbMedia = 1; + } else { + changeToBpbMedia = 0; + } + } else { + changeToBpbMedia = 0; + } + } else { + changeToBpbMedia = 0; } } else { - + changeToBpbMedia = 0; + } + {} + if ((int)bpbMediaType == 0) { + bpbMediaType = readidDriveMediaConstants->MediaType; + DisketteExtension->DriveMediaConstants.SkewDelta = 0; + } else { } - } else { - } - skew = ((int )skew + (int )skewDelta) % (int )sectorsPerTrack; - currentSector += (ULONG )numTransferSectors; - } - while_161_break: /* CIL Label */ ; - } - Irp->IoStatus.Information = (currentSector - firstSector) << byteToSectorShift; - if (status >= 0L) { - if (firstSector == 0UL) { + if (changeToBpbMedia) { + i = (DriveMediaLimits + DisketteExtension->DriveType) + ->LowestDriveMediaType; + n = (DriveMediaLimits + DisketteExtension->DriveType) + ->HighestDriveMediaType; + { + while (1) { + while_142_continue: /* CIL Label */; + if (i <= n) { + + } else { + goto while_142_break; + } + if ((int)bpbMediaType == (int)(DriveMediaConstants + i)->MediaType) { + DisketteExtension->DriveMediaType = i; + goto while_142_break; + } else { + } + i += 1UL; + } + while_142_break: /* CIL Label */; + } { - FlConsolidateMediaTypeWithBootSector(DisketteExtension, (struct _BOOT_SECTOR_INFO *)userBuffer); + DisketteExtension->MediaType = bpbMediaType; + DisketteExtension->ByteCapacity = + (int)bpbNumberOfSectors * (int)bpbBytesPerSector; + DisketteExtension->DriveMediaConstants.SectorsPerTrack = + (unsigned char)bpbSectorsPerTrack; + DisketteExtension->DriveMediaConstants.NumberOfHeads = + (unsigned char)bpbNumberOfHeads; + tmp___0 = RtlCompareMemory(BootSector->OemData, "MSDMF3.", 7); + } + if (tmp___0 == 7UL) { + DisketteExtension->IsReadOnly = 1; + } else { } } else { - } - } else { - - } - { + return; } - return (status); } -} -NTSTATUS FlFormat(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp ) -{ LARGE_INTEGER headSettleTime ; - PIO_STACK_LOCATION irpSp ; - PBAD_TRACK_NUMBER badTrackBuffer ; - PFORMAT_PARAMETERS formatParameters ; - PFORMAT_EX_PARAMETERS formatExParameters ; - PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - NTSTATUS ntStatus ; - ULONG badTrackBufferLength ; - DRIVE_MEDIA_TYPE driveMediaType ; - UCHAR driveStatus ; - UCHAR numberOfBadTracks ; - UCHAR currentTrack ; - UCHAR endTrack ; - UCHAR whichSector ; - UCHAR retryCount ; - BOOLEAN bufferOverflow ; - FDC_DISK_CHANGE_PARMS fdcDiskChangeParms ; - ULONG length ; - UCHAR tmp ; +void FlCheckBootSector(PDISKETTE_EXTENSION DisketteExtension) { + PBOOT_SECTOR_INFO bootSector; + LARGE_INTEGER offset; + PIRP irp; + NTSTATUS status; + int tmp; + PVOID tmp___0; + int tmp___1; { - numberOfBadTracks = 0; - bufferOverflow = 0; - { - } - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - formatParameters = (struct _FORMAT_PARAMETERS *)Irp->AssociatedIrp.SystemBuffer; - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((7 << 16) | (3 << 14)) | (11 << 2))) { - formatExParameters = (struct _FORMAT_EX_PARAMETERS *)Irp->AssociatedIrp.SystemBuffer; - } else { - formatExParameters = (void *)0; - } - { - } - badTrackBufferLength = irpSp->Parameters.DeviceIoControl.OutputBufferLength; - driveMediaType = (DriveMediaLimits + DisketteExtension->DriveType)->HighestDriveMediaType; - { - while (1) { - while_167_continue: /* CIL Label */ ; - if ((int )(DriveMediaConstants + driveMediaType)->MediaType != (int )formatParameters->MediaType) { - if ((int )driveMediaType > (int )(DriveMediaLimits + DisketteExtension->DriveType)->LowestDriveMediaType) { - - } else { - goto while_167_break; - } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + tmp = 1024; } else { - goto while_167_break; + tmp = 512; } - driveMediaType = (DRIVE_MEDIA_TYPE )((int )driveMediaType - 1); - } - while_167_break: /* CIL Label */ ; - } - driveMediaConstants = DriveMediaConstants + driveMediaType; - DisketteExtension->MediaType = formatParameters->MediaType; - DisketteExtension->DriveMediaType = driveMediaType; - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + driveMediaType); - if (formatExParameters) { - DisketteExtension->DriveMediaConstants.SectorsPerTrack = (unsigned char )formatExParameters->SectorsPerTrack; - DisketteExtension->DriveMediaConstants.FormatGapLength = (unsigned char )formatExParameters->FormatGapLength; - } else { - - } - driveMediaConstants = & DisketteExtension->DriveMediaConstants; - DisketteExtension->BytesPerSector = driveMediaConstants->BytesPerSector; - DisketteExtension->ByteCapacity = (((int )driveMediaConstants->BytesPerSector * (int )driveMediaConstants->SectorsPerTrack) * (1 + (int )driveMediaConstants->MaximumTrack)) * (int )driveMediaConstants->NumberOfHeads; - currentTrack = (unsigned char )(formatParameters->StartCylinderNumber * (ULONG )driveMediaConstants->NumberOfHeads + formatParameters->StartHeadNumber); - endTrack = (unsigned char )(formatParameters->EndCylinderNumber * (ULONG )driveMediaConstants->NumberOfHeads + formatParameters->EndHeadNumber); - { - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { { - FlHdbit(DisketteExtension); + tmp___0 = ExAllocatePoolWithTag(4, tmp, 1886350406UL); + bootSector = tmp___0; } - } else { - - } - if ((int )DisketteExtension->LastDriveMediaType != (int )driveMediaType) { - { - ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); + if (!bootSector) { + return; + } else { } - if (! (ntStatus >= 0L)) { - return (ntStatus); + offset.__annonCompField1.HighPart = 0; + offset.__annonCompField1.LowPart = offset.__annonCompField1.HighPart; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + tmp___1 = 1024; } else { - + tmp___1 = 512; } - } else { - - } - DisketteExtension->IsReadOnly = 0; - { - while (1) { - while_169_continue: /* CIL Label */ ; - DisketteExtension->FifoBuffer[0] = 16; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - DisketteExtension->FifoBuffer[2] = (unsigned char )((int )currentTrack / (int )driveMediaConstants->NumberOfHeads << (int )driveMediaConstants->CylinderShift); { + irp = IoBuildAsynchronousFsdRequest(3, DisketteExtension->DeviceObject, + bootSector, tmp___1, &offset, + (void *)0); + } + if (!irp) { + { /* ExFreePool(bootSector); */ /* INLINED */ + } + return; + } else { } { - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, DisketteExtension->FifoBuffer, - (void *)0, 0, 0); + irp->CurrentLocation = (CHAR)((int)irp->CurrentLocation - 1); + irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation -= 1; + status = FlReadWrite(DisketteExtension, irp, 1); + /* MmUnlockPages(irp->MdlAddress); */ /* INLINED */ + /* IoFreeMdl(irp->MdlAddress); */ /* INLINED */ + /* IoFreeIrp(irp); */ /* INLINED */ + /* ExFreePool(bootSector); */ /* INLINED */ } - if (ntStatus >= 0L) { - if ((int )DisketteExtension->FifoBuffer[0] & 32) { - if ((int )DisketteExtension->FifoBuffer[1] == (int )((unsigned char )((int )currentTrack / (int )driveMediaConstants->NumberOfHeads << (int )driveMediaConstants->CylinderShift))) { - { - headSettleTime.__annonCompField1.LowPart = - (10000 * (int )driveMediaConstants->HeadSettleTime); - headSettleTime.__annonCompField1.HighPart = -1; - KeDelayExecutionThread(0, 0, & headSettleTime); - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { + return; + } +} +NTSTATUS FlReadWriteTrack(PDISKETTE_EXTENSION DisketteExtension, PMDL IoMdl, + ULONG IoOffset, BOOLEAN WriteOperation, + UCHAR Cylinder, UCHAR Head, UCHAR Sector, + UCHAR NumberOfSectors, BOOLEAN NeedSeek) { + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + ULONG byteToSectorShift; + ULONG transferBytes; + LARGE_INTEGER headSettleTime; + NTSTATUS status; + ULONG seekRetry; + ULONG ioRetry; + BOOLEAN recalibrateDrive; + UCHAR i; + + { + recalibrateDrive = 0; + {} + driveMediaConstants = &DisketteExtension->DriveMediaConstants; + byteToSectorShift = 7 + (int)driveMediaConstants->SectorLengthCode; + transferBytes = (unsigned long)NumberOfSectors << byteToSectorShift; + headSettleTime.__annonCompField1.LowPart = + -(10000 * (int)driveMediaConstants->HeadSettleTime); + headSettleTime.__annonCompField1.HighPart = -1; + seekRetry = 0; + ioRetry = 0; + { + while (1) { + while_144_continue: /* CIL Label */; + if (seekRetry < 3UL) { + } else { + goto while_144_break; + } + if (recalibrateDrive) { + {} { FlRecalibrateDrive(DisketteExtension); } + } else { + } + if (recalibrateDrive) { + goto _L___0; + } else { + if (NeedSeek) { + if (!DisketteExtension->ControllerConfigurable) { + goto _L___0; + } else { + if ((int)driveMediaConstants->CylinderShift != 0) { + _L___0 : /* CIL Label */ + { + DisketteExtension->FifoBuffer[0] = 16; + DisketteExtension->FifoBuffer[1] = + ((int)Head << 2) | (int)DisketteExtension->DeviceUnit; + DisketteExtension->FifoBuffer[2] = + (int)Cylinder << (int)driveMediaConstants->CylinderShift; + status = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + if (status >= 0L) { + if (!((int)DisketteExtension->FifoBuffer[0] & 32)) { + DisketteExtension->HardwareFailed = 1; + status = -1073741464L; + } else { + if ((int)DisketteExtension->FifoBuffer[1] != + (int)Cylinder + << (int)driveMediaConstants->CylinderShift) { + DisketteExtension->HardwareFailed = 1; + status = -1073741464L; + } else { + } + } + if (status >= 0L) { + { + KeDelayExecutionThread(0, 0, &headSettleTime); + DisketteExtension->FifoBuffer[0] = 84; + DisketteExtension->FifoBuffer[1] = + ((int)Head << 2) | (int)DisketteExtension->DeviceUnit; + status = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + if (status >= 0L) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if ((int)DisketteExtension->FifoBuffer[0] & 8) { + return (-1073741661L); + } else { + } + } else { + } + if ((int)DisketteExtension->FifoBuffer[0] != + (((int)Head << 2) | + (int)DisketteExtension->DeviceUnit)) { + { + DisketteExtension->HardwareFailed = 1; + status = FlInterpretError( + DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + if ((int)DisketteExtension->FifoBuffer[1] != 0) { + { + DisketteExtension->HardwareFailed = 1; + status = FlInterpretError( + DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + if ((int)DisketteExtension->FifoBuffer[2] != 0) { + { + DisketteExtension->HardwareFailed = 1; + status = FlInterpretError( + DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + if ((int)DisketteExtension->FifoBuffer[3] != + (int)Cylinder) { + { + DisketteExtension->HardwareFailed = 1; + status = FlInterpretError( + DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + } + } + } + } + } else { + {} + } + } else { + } + } else { + {} + } + } else { + status = 0L; + } + } } else { + status = 0L; + } + } + if (!(status >= 0L)) { + {} + recalibrateDrive = 1; + goto __Cont; + } else { + } + { + while (1) { + while_149_continue: /* CIL Label */; + DisketteExtension->FifoBuffer[1] = + ((int)Head << 2) | (int)DisketteExtension->DeviceUnit; + DisketteExtension->FifoBuffer[2] = Cylinder; + DisketteExtension->FifoBuffer[3] = Head; + DisketteExtension->FifoBuffer[4] = (int)Sector + 1; + DisketteExtension->FifoBuffer[5] = + driveMediaConstants->SectorLengthCode; + DisketteExtension->FifoBuffer[6] = + (int)Sector + (int)NumberOfSectors; + DisketteExtension->FifoBuffer[7] = + driveMediaConstants->ReadWriteGapLength; + DisketteExtension->FifoBuffer[8] = driveMediaConstants->DataLength; + if (WriteOperation) { + DisketteExtension->FifoBuffer[0] = 66; + } else { + DisketteExtension->FifoBuffer[0] = 64; + } { - DisketteExtension->FifoBuffer[0] = 84; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, - 0); + status = FlIssueCommand(DisketteExtension, + DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, IoMdl, + IoOffset, transferBytes); + } + if (status >= 0L) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if ((int)DisketteExtension->FifoBuffer[0] & 8) { + return (-1073741661L); + } else { + } + } else { + } + if (((int)DisketteExtension->FifoBuffer[0] & 192) != 0) { + if (((int)DisketteExtension->FifoBuffer[0] & 192) != 64) { + { + DisketteExtension->HardwareFailed = 1; + status = FlInterpretError(DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + if ((int)DisketteExtension->FifoBuffer[1] != 128) { + { + DisketteExtension->HardwareFailed = 1; + status = + FlInterpretError(DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + if ((int)DisketteExtension->FifoBuffer[2] != 0) { + { + DisketteExtension->HardwareFailed = 1; + status = + FlInterpretError(DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + goto _L___1; + } + } + } + } else { + _L___1: /* CIL Label */ + if ((int)DisketteExtension->FifoBuffer[5] != 1) { + DisketteExtension->HardwareFailed = 1; + status = -1073741465L; + } else { + } + } + } else { + {} + } + if (status >= 0L) { + goto while_149_break; + } else { } + if (ioRetry >= 2UL) { + {} + goto while_149_break; + } else { + } + ioRetry += 1UL; } + while_149_break: /* CIL Label */; + } + if (status >= 0L) { + goto while_144_break; } else { - goto _L; } - } else { - _L: /* CIL Label */ + recalibrateDrive = 1; + __Cont: /* CIL Label */ + seekRetry += 1UL; + } + while_144_break: /* CIL Label */; + } + if (!(status >= 0L)) { + if ((int)NumberOfSectors > 1) { + {} + i = 0; { + while (1) { + while_153_continue: /* CIL Label */; + if ((int)i < (int)NumberOfSectors) { + + } else { + goto while_153_break; + } + { + status = FlReadWriteTrack( + DisketteExtension, IoMdl, + IoOffset + ((unsigned long)i << byteToSectorShift), + WriteOperation, Cylinder, Head, + (unsigned char)((int)Sector + (int)i), 1, 0); + } + if (!(status >= 0L)) { + {} + DisketteExtension->HardwareFailed = 1; + goto while_153_break; + } else { + } + i = (UCHAR)((int)i + 1); + } + while_153_break: /* CIL Label */; } - DisketteExtension->HardwareFailed = 1; - ntStatus = -1073741464L; + } else { } } else { - } - if (! (ntStatus >= 0L)) { - { + return (status); + } +} +NTSTATUS FlReadWrite(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp, + BOOLEAN DriveStarted) { + PIO_STACK_LOCATION irpSp; + BOOLEAN writeOperation; + NTSTATUS status; + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + ULONG byteToSectorShift; + ULONG currentSector; + ULONG firstSector; + ULONG lastSector; + ULONG trackSize; + UCHAR sectorsPerTrack; + UCHAR numberOfHeads; + UCHAR currentHead; + UCHAR currentCylinder; + UCHAR trackSector; + PCHAR userBuffer; + UCHAR skew; + UCHAR skewDelta; + UCHAR numTransferSectors; + PMDL mdl; + PCHAR ioBuffer; + ULONG ioOffset; + PVOID tmp___0; + + { + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + {} + if ((int)irpSp->MajorFunction == 4) { + if (DisketteExtension->IsReadOnly) { + {} + return (-1073741811L); + } else { } - return (ntStatus); + writeOperation = 1; } else { - + writeOperation = 0; } - whichSector = 0; - { - while (1) { - while_173_continue: /* CIL Label */ ; - if ((int )whichSector < (int )driveMediaConstants->SectorsPerTrack) { - - } else { - goto while_173_break; - } - *(DisketteExtension->IoBuffer + (int )whichSector * 4) = (int )currentTrack / (int )driveMediaConstants->NumberOfHeads; - *(DisketteExtension->IoBuffer + ((int )whichSector * 4 + 1)) = (int )currentTrack % (int )driveMediaConstants->NumberOfHeads; - if (formatExParameters) { - *(DisketteExtension->IoBuffer + ((int )whichSector * 4 + 2)) = (unsigned char )formatExParameters->SectorNumber[whichSector]; - } else { - *(DisketteExtension->IoBuffer + ((int )whichSector * 4 + 2)) = (int )whichSector + 1; - } - *(DisketteExtension->IoBuffer + ((int )whichSector * 4 + 3)) = driveMediaConstants->SectorLengthCode; + {} + if (DriveStarted) { + status = 0L; + } else { { + status = FlStartDrive(DisketteExtension, Irp, writeOperation, 1, + (unsigned char)(!(!((int)irpSp->Flags & 2)))); } - whichSector = (UCHAR )((int )whichSector + 1); } - while_173_break: /* CIL Label */ ; + if (!(status >= 0L)) { + {} + return (status); + } else { } - retryCount = 0; - { - while (1) { - while_175_continue: /* CIL Label */ ; - length = driveMediaConstants->BytesPerSector; - DisketteExtension->FifoBuffer[0] = 71; - DisketteExtension->FifoBuffer[1] = (unsigned char )(((int )currentTrack % (int )driveMediaConstants->NumberOfHeads << 2) | (int )DisketteExtension->DeviceUnit); - DisketteExtension->FifoBuffer[2] = driveMediaConstants->SectorLengthCode; - DisketteExtension->FifoBuffer[3] = driveMediaConstants->SectorsPerTrack; - DisketteExtension->FifoBuffer[4] = driveMediaConstants->FormatGapLength; - DisketteExtension->FifoBuffer[5] = driveMediaConstants->FormatFillCharacter; - { - } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { FlHdbit(DisketteExtension); } + } else { + } + if ((int)DisketteExtension->MediaType == 0) { + {} + return (-1073741804L); + } else { + } + driveMediaConstants = &DisketteExtension->DriveMediaConstants; + byteToSectorShift = 7 + (int)driveMediaConstants->SectorLengthCode; + firstSector = irpSp->Parameters.Read.ByteOffset.__annonCompField1.LowPart >> + byteToSectorShift; + lastSector = + firstSector + (irpSp->Parameters.Read.Length >> byteToSectorShift); + sectorsPerTrack = driveMediaConstants->SectorsPerTrack; + numberOfHeads = driveMediaConstants->NumberOfHeads; + if ((int)(Irp->MdlAddress)->MdlFlags & 5) { + userBuffer = (Irp->MdlAddress)->MappedSystemVa; + } else { { - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, DisketteExtension->IoBufferMdl, - 0, length); + tmp___0 = (void *)0; + /* MmMapLockedPagesSpecifyCache(Irp->MdlAddress, 0, 1, (void *)0, 0, 32); */ /* INLINED */ + userBuffer = tmp___0; } - if (! (ntStatus >= 0L)) { - { - } - } else { + } + if ((unsigned int)userBuffer == (unsigned int)((void *)0)) { + {} + return (-1073741670L); + } else { + } + trackSize = (unsigned long)sectorsPerTrack << byteToSectorShift; + skew = 0; + skewDelta = driveMediaConstants->SkewDelta; + currentSector = firstSector; + { + while (1) { + while_161_continue: /* CIL Label */; + if (currentSector < lastSector) { - } - if (ntStatus >= 0L) { - if ((int )DisketteExtension->FifoBuffer[0] & 208) { - goto _L___0; } else { - if ((int )DisketteExtension->FifoBuffer[1] & 16) { - goto _L___0; + goto while_161_break; + } + currentCylinder = + (unsigned char)((currentSector / (ULONG)sectorsPerTrack) / + (ULONG)numberOfHeads); + trackSector = + (unsigned char)(currentSector % (unsigned long)sectorsPerTrack); + currentHead = (unsigned char)((currentSector / (ULONG)sectorsPerTrack) % + (unsigned long)numberOfHeads); + numTransferSectors = (int)sectorsPerTrack - (int)trackSector; + if (lastSector - currentSector < (ULONG)numTransferSectors) { + numTransferSectors = (unsigned char)(lastSector - currentSector); + } else { + } + if (trackSize > DisketteExtension->MaxTransferSize) { + {} { FlAllocateIoBuffer(DisketteExtension, trackSize); } + if (!DisketteExtension->IoBuffer) { + {} + return (-1073741670L); } else { - if ((int )DisketteExtension->FifoBuffer[2] != 0) { - _L___0: /* CIL Label */ - { - } - { - DisketteExtension->HardwareFailed = 1; - ntStatus = FlInterpretError(DisketteExtension->FifoBuffer[1], DisketteExtension->FifoBuffer[2]); - } - } else { - + } + mdl = DisketteExtension->IoBufferMdl; + ioBuffer = DisketteExtension->IoBuffer; + ioOffset = 0; + if (writeOperation) { + { + memmove(ioBuffer, + userBuffer + + ((currentSector - firstSector) << byteToSectorShift), + (unsigned long)numTransferSectors << byteToSectorShift); + } + } else { + } + } else { + mdl = Irp->MdlAddress; + ioOffset = (currentSector - firstSector) << byteToSectorShift; + } + if ((int)skew >= (int)numTransferSectors + (int)trackSector) { + skew = 0; + } else { + } + if ((int)skew < (int)trackSector) { + skew = trackSector; + } else { + } + { + status = FlReadWriteTrack( + DisketteExtension, mdl, + ioOffset + (((unsigned long)skew - (unsigned long)trackSector) + << byteToSectorShift), + writeOperation, currentCylinder, currentHead, skew, + (unsigned char)(((int)numTransferSectors + (int)trackSector) - + (int)skew), + 1); + } + if (status >= 0L) { + if ((int)skew > (int)trackSector) { + { + status = FlReadWriteTrack( + DisketteExtension, mdl, ioOffset, writeOperation, + currentCylinder, currentHead, trackSector, + (unsigned char)((int)skew - (int)trackSector), 0); + } + } else { + skew = ((int)numTransferSectors + (int)trackSector) % + (int)sectorsPerTrack; + } + } else { + skew = ((int)numTransferSectors + (int)trackSector) % + (int)sectorsPerTrack; + } + if (!(status >= 0L)) { + goto while_161_break; + } else { + } + if (!writeOperation) { + if (trackSize > DisketteExtension->MaxTransferSize) { + { + memmove(userBuffer + + ((currentSector - firstSector) << byteToSectorShift), + ioBuffer, + (unsigned long)numTransferSectors << byteToSectorShift); } + } else { } + } else { + } + skew = ((int)skew + (int)skewDelta) % (int)sectorsPerTrack; + currentSector += (ULONG)numTransferSectors; + } + while_161_break: /* CIL Label */; + } + Irp->IoStatus.Information = (currentSector - firstSector) + << byteToSectorShift; + if (status >= 0L) { + if (firstSector == 0UL) { + { + FlConsolidateMediaTypeWithBootSector( + DisketteExtension, (struct _BOOT_SECTOR_INFO *)userBuffer); } } else { - } - if (! (ntStatus >= 0L)) { - tmp = retryCount; - retryCount = (UCHAR )((int )retryCount + 1); - if (tmp < 3) { + } else { + } + {} + return (status); + } +} +NTSTATUS FlFormat(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp) { + LARGE_INTEGER headSettleTime; + PIO_STACK_LOCATION irpSp; + PBAD_TRACK_NUMBER badTrackBuffer; + PFORMAT_PARAMETERS formatParameters; + PFORMAT_EX_PARAMETERS formatExParameters; + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + NTSTATUS ntStatus; + ULONG badTrackBufferLength; + DRIVE_MEDIA_TYPE driveMediaType; + UCHAR driveStatus; + UCHAR numberOfBadTracks; + UCHAR currentTrack; + UCHAR endTrack; + UCHAR whichSector; + UCHAR retryCount; + BOOLEAN bufferOverflow; + FDC_DISK_CHANGE_PARMS fdcDiskChangeParms; + ULONG length; + UCHAR tmp; + + { + numberOfBadTracks = 0; + bufferOverflow = 0; + {} + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + formatParameters = + (struct _FORMAT_PARAMETERS *)Irp->AssociatedIrp.SystemBuffer; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + (ULONG)(((7 << 16) | (3 << 14)) | (11 << 2))) { + formatExParameters = + (struct _FORMAT_EX_PARAMETERS *)Irp->AssociatedIrp.SystemBuffer; + } else { + formatExParameters = (void *)0; + } + {} + badTrackBufferLength = irpSp->Parameters.DeviceIoControl.OutputBufferLength; + driveMediaType = (DriveMediaLimits + DisketteExtension->DriveType) + ->HighestDriveMediaType; + { + while (1) { + while_167_continue: /* CIL Label */; + if ((int)(DriveMediaConstants + driveMediaType)->MediaType != + (int)formatParameters->MediaType) { + if ((int)driveMediaType > + (int)(DriveMediaLimits + DisketteExtension->DriveType) + ->LowestDriveMediaType) { + } else { + goto while_167_break; + } } else { - goto while_175_break; + goto while_167_break; } - } else { - goto while_175_break; + driveMediaType = (DRIVE_MEDIA_TYPE)((int)driveMediaType - 1); } + while_167_break: /* CIL Label */; + } + driveMediaConstants = DriveMediaConstants + driveMediaType; + DisketteExtension->MediaType = formatParameters->MediaType; + DisketteExtension->DriveMediaType = driveMediaType; + DisketteExtension->DriveMediaConstants = + *(DriveMediaConstants + driveMediaType); + if (formatExParameters) { + DisketteExtension->DriveMediaConstants.SectorsPerTrack = + (unsigned char)formatExParameters->SectorsPerTrack; + DisketteExtension->DriveMediaConstants.FormatGapLength = + (unsigned char)formatExParameters->FormatGapLength; + } else { } - while_175_break: /* CIL Label */ ; + driveMediaConstants = &DisketteExtension->DriveMediaConstants; + DisketteExtension->BytesPerSector = driveMediaConstants->BytesPerSector; + DisketteExtension->ByteCapacity = + (((int)driveMediaConstants->BytesPerSector * + (int)driveMediaConstants->SectorsPerTrack) * + (1 + (int)driveMediaConstants->MaximumTrack)) * + (int)driveMediaConstants->NumberOfHeads; + currentTrack = + (unsigned char)(formatParameters->StartCylinderNumber * + (ULONG)driveMediaConstants->NumberOfHeads + + formatParameters->StartHeadNumber); + endTrack = (unsigned char)(formatParameters->EndCylinderNumber * + (ULONG)driveMediaConstants->NumberOfHeads + + formatParameters->EndHeadNumber); + {} + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { FlHdbit(DisketteExtension); } + } else { } - if (! (ntStatus >= 0L)) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - DisketteExtension->FifoBuffer[0] = 14; + if ((int)DisketteExtension->LastDriveMediaType != (int)driveMediaType) { + { ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); } + if (!(ntStatus >= 0L)) { + return (ntStatus); + } else { + } + } else { + } + DisketteExtension->IsReadOnly = 0; + { + while (1) { + while_169_continue: /* CIL Label */; + DisketteExtension->FifoBuffer[0] = 16; DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); + DisketteExtension->FifoBuffer[2] = + (unsigned char)((int)currentTrack / + (int)driveMediaConstants->NumberOfHeads + << (int)driveMediaConstants->CylinderShift); + {} { + ntStatus = + FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - if (! (ntStatus >= 0L)) { - { + if (ntStatus >= 0L) { + if ((int)DisketteExtension->FifoBuffer[0] & 32) { + if ((int)DisketteExtension->FifoBuffer[1] == + (int)(( + unsigned char)((int)currentTrack / + (int)driveMediaConstants->NumberOfHeads + << (int)driveMediaConstants + ->CylinderShift))) { + { + headSettleTime.__annonCompField1.LowPart = + -(10000 * (int)driveMediaConstants->HeadSettleTime); + headSettleTime.__annonCompField1.HighPart = -1; + KeDelayExecutionThread(0, 0, &headSettleTime); + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + + } else { + { + DisketteExtension->FifoBuffer[0] = 84; + DisketteExtension->FifoBuffer[1] = + DisketteExtension->DeviceUnit; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + } + } else { + goto _L; + } + } else { + _L : /* CIL Label */ + {} + DisketteExtension->HardwareFailed = 1; + ntStatus = -1073741464L; } - return (ntStatus); } else { - } - if ((int )DisketteExtension->FifoBuffer[0] & 32) { - driveStatus = 127; + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); } else { - driveStatus = 128; } - } else { + whichSector = 0; { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (776 << 2)) | 3, - & fdcDiskChangeParms); - driveStatus = fdcDiskChangeParms.DriveStatus; + while (1) { + while_173_continue: /* CIL Label */; + if ((int)whichSector < (int)driveMediaConstants->SectorsPerTrack) { + + } else { + goto while_173_break; + } + *(DisketteExtension->IoBuffer + (int)whichSector * 4) = + (int)currentTrack / (int)driveMediaConstants->NumberOfHeads; + *(DisketteExtension->IoBuffer + ((int)whichSector * 4 + 1)) = + (int)currentTrack % (int)driveMediaConstants->NumberOfHeads; + if (formatExParameters) { + *(DisketteExtension->IoBuffer + ((int)whichSector * 4 + 2)) = + (unsigned char)formatExParameters->SectorNumber[whichSector]; + } else { + *(DisketteExtension->IoBuffer + ((int)whichSector * 4 + 2)) = + (int)whichSector + 1; + } + *(DisketteExtension->IoBuffer + ((int)whichSector * 4 + 3)) = + driveMediaConstants->SectorLengthCode; + {} + whichSector = (UCHAR)((int)whichSector + 1); + } + while_173_break: /* CIL Label */; } - } - if ((int )DisketteExtension->DriveType != 0) { - if ((int )driveStatus & 128) { - return (-1073741805L); - } else { + retryCount = 0; + { + while (1) { + while_175_continue: /* CIL Label */; + length = driveMediaConstants->BytesPerSector; + DisketteExtension->FifoBuffer[0] = 71; + DisketteExtension->FifoBuffer[1] = + (unsigned char)(((int)currentTrack % + (int)driveMediaConstants->NumberOfHeads + << 2) | + (int)DisketteExtension->DeviceUnit); + DisketteExtension->FifoBuffer[2] = + driveMediaConstants->SectorLengthCode; + DisketteExtension->FifoBuffer[3] = + driveMediaConstants->SectorsPerTrack; + DisketteExtension->FifoBuffer[4] = + driveMediaConstants->FormatGapLength; + DisketteExtension->FifoBuffer[5] = + driveMediaConstants->FormatFillCharacter; + {} { + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, DisketteExtension->IoBufferMdl, + 0, length); + } + if (!(ntStatus >= 0L)) { + {} + } else { + } + if (ntStatus >= 0L) { + if ((int)DisketteExtension->FifoBuffer[0] & 208) { + goto _L___0; + } else { + if ((int)DisketteExtension->FifoBuffer[1] & 16) { + goto _L___0; + } else { + if ((int)DisketteExtension->FifoBuffer[2] != 0) { + _L___0 : /* CIL Label */ + {} + { + DisketteExtension->HardwareFailed = 1; + ntStatus = + FlInterpretError(DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + } + } + } + } else { + } + if (!(ntStatus >= 0L)) { + tmp = retryCount; + retryCount = (UCHAR)((int)retryCount + 1); + if (tmp < 3) { + } else { + goto while_175_break; + } + } else { + goto while_175_break; + } + } + while_175_break: /* CIL Label */; } - } else { + if (!(ntStatus >= 0L)) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { + DisketteExtension->FifoBuffer[0] = 14; + DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); + } else { + } + if ((int)DisketteExtension->FifoBuffer[0] & 32) { + driveStatus = 127; + } else { + driveStatus = 128; + } + } else { + { + ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (776 << 2)) | 3, + &fdcDiskChangeParms); + driveStatus = fdcDiskChangeParms.DriveStatus; + } + } + if ((int)DisketteExtension->DriveType != 0) { + if ((int)driveStatus & 128) { + return (-1073741805L); + } else { + } + } else { + } + {} + if (badTrackBufferLength >= + (unsigned long)((unsigned int)((int)numberOfBadTracks + 1) * + sizeof(BAD_TRACK_NUMBER))) { + badTrackBuffer = (USHORT *)Irp->AssociatedIrp.SystemBuffer; + *(badTrackBuffer + numberOfBadTracks) = + (unsigned short)currentTrack; + } else { + bufferOverflow = 1; + } + numberOfBadTracks = (UCHAR)((int)numberOfBadTracks + 1); + } else { + } + currentTrack = (UCHAR)((int)currentTrack + 1); + if ((int)currentTrack <= (int)endTrack) { + } else { + goto while_169_break; + } } - { - } - if (badTrackBufferLength >= (unsigned long )((unsigned int )((int )numberOfBadTracks + 1) * sizeof(BAD_TRACK_NUMBER ))) { - badTrackBuffer = (USHORT *)Irp->AssociatedIrp.SystemBuffer; - *(badTrackBuffer + numberOfBadTracks) = (unsigned short )currentTrack; + while_169_break: /* CIL Label */; + } + if (ntStatus >= 0L) { + if (bufferOverflow) { + ntStatus = -2147483643L; } else { - bufferOverflow = 1; } - numberOfBadTracks = (UCHAR )((int )numberOfBadTracks + 1); - } else { - - } - currentTrack = (UCHAR )((int )currentTrack + 1); - if ((int )currentTrack <= (int )endTrack) { - - } else { - goto while_169_break; - } - } - while_169_break: /* CIL Label */ ; - } - if (ntStatus >= 0L) { - if (bufferOverflow) { - ntStatus = -2147483643L; } else { - } - } else { - + return (ntStatus); } - return (ntStatus); } -} -BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension , PFORMAT_PARAMETERS FormatParameters ) -{ PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - DRIVE_MEDIA_TYPE driveMediaType ; +BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension, + PFORMAT_PARAMETERS FormatParameters) { + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + DRIVE_MEDIA_TYPE driveMediaType; { - driveMediaType = (DriveMediaLimits + DisketteExtension->DriveType)->HighestDriveMediaType; - { - while (1) { - while_181_continue: /* CIL Label */ ; - if ((int )(DriveMediaConstants + driveMediaType)->MediaType != (int )FormatParameters->MediaType) { - if ((int )driveMediaType > (int )(DriveMediaLimits + DisketteExtension->DriveType)->LowestDriveMediaType) { + driveMediaType = (DriveMediaLimits + DisketteExtension->DriveType) + ->HighestDriveMediaType; + { + while (1) { + while_181_continue: /* CIL Label */; + if ((int)(DriveMediaConstants + driveMediaType)->MediaType != + (int)FormatParameters->MediaType) { + if ((int)driveMediaType > + (int)(DriveMediaLimits + DisketteExtension->DriveType) + ->LowestDriveMediaType) { - } else { - goto while_181_break; + } else { + goto while_181_break; + } + } else { + goto while_181_break; + } + driveMediaType = (DRIVE_MEDIA_TYPE)((int)driveMediaType - 1); } - } else { - goto while_181_break; + while_181_break: /* CIL Label */; } - driveMediaType = (DRIVE_MEDIA_TYPE )((int )driveMediaType - 1); - } - while_181_break: /* CIL Label */ ; - } - if ((int )(DriveMediaConstants + driveMediaType)->MediaType != (int )FormatParameters->MediaType) { - return (0); - } else { - driveMediaConstants = DriveMediaConstants + driveMediaType; - if (FormatParameters->StartHeadNumber > (unsigned long )((int )driveMediaConstants->NumberOfHeads - 1)) { + if ((int)(DriveMediaConstants + driveMediaType)->MediaType != + (int)FormatParameters->MediaType) { return (0); } else { - if (FormatParameters->EndHeadNumber > (unsigned long )((int )driveMediaConstants->NumberOfHeads - 1)) { + driveMediaConstants = DriveMediaConstants + driveMediaType; + if (FormatParameters->StartHeadNumber > + (unsigned long)((int)driveMediaConstants->NumberOfHeads - 1)) { return (0); } else { - if (FormatParameters->StartCylinderNumber > (ULONG )driveMediaConstants->MaximumTrack) { + if (FormatParameters->EndHeadNumber > + (unsigned long)((int)driveMediaConstants->NumberOfHeads - 1)) { return (0); } else { - if (FormatParameters->EndCylinderNumber > (ULONG )driveMediaConstants->MaximumTrack) { + if (FormatParameters->StartCylinderNumber > + (ULONG)driveMediaConstants->MaximumTrack) { return (0); } else { - if (FormatParameters->EndCylinderNumber < FormatParameters->StartCylinderNumber) { + if (FormatParameters->EndCylinderNumber > + (ULONG)driveMediaConstants->MaximumTrack) { return (0); } else { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if ((int )FormatParameters->MediaType == 6) { - return (0); - } else { - if ((int )FormatParameters->MediaType == 7) { + if (FormatParameters->EndCylinderNumber < + FormatParameters->StartCylinderNumber) { + return (0); + } else { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if ((int)FormatParameters->MediaType == 6) { return (0); } else { - if ((int )FormatParameters->MediaType == 8) { + if ((int)FormatParameters->MediaType == 7) { return (0); } else { - if ((int )FormatParameters->MediaType == 9) { + if ((int)FormatParameters->MediaType == 8) { return (0); } else { - if ((int )FormatParameters->MediaType == 10) { + if ((int)FormatParameters->MediaType == 9) { return (0); } else { - + if ((int)FormatParameters->MediaType == 10) { + return (0); + } else { + } } } } } + } else { } - } else { - + return (1); } - return (1); } } } @@ -6514,211 +6613,215 @@ BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension , PFORMAT_ } } } -} -NTSTATUS FlIssueCommand(PDISKETTE_EXTENSION DisketteExtension , PUCHAR FifoInBuffer , - PUCHAR FifoOutBuffer , PMDL IoMdl , ULONG IoOffset , ULONG TransferBytes ) -{ NTSTATUS ntStatus ; - ISSUE_FDC_COMMAND_PARMS issueCommandParms ; +NTSTATUS FlIssueCommand(PDISKETTE_EXTENSION DisketteExtension, + PUCHAR FifoInBuffer, PUCHAR FifoOutBuffer, PMDL IoMdl, + ULONG IoOffset, ULONG TransferBytes) { + NTSTATUS ntStatus; + ISSUE_FDC_COMMAND_PARMS issueCommandParms; { - issueCommandParms.FifoInBuffer = FifoInBuffer; - issueCommandParms.FifoOutBuffer = FifoOutBuffer; - issueCommandParms.IoHandle = (void *)IoMdl; - issueCommandParms.IoOffset = IoOffset; - issueCommandParms.TransferBytes = TransferBytes; - issueCommandParms.TimeOut = 4; - { - } - { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (771 << 2)) | 3, - & issueCommandParms); - } - if (ntStatus == -1073741661L) { - DisketteExtension->HardwareFailed = 1; - } else { - if (ntStatus == -1073741464L) { + issueCommandParms.FifoInBuffer = FifoInBuffer; + issueCommandParms.FifoOutBuffer = FifoOutBuffer; + issueCommandParms.IoHandle = (void *)IoMdl; + issueCommandParms.IoOffset = IoOffset; + issueCommandParms.TransferBytes = TransferBytes; + issueCommandParms.TimeOut = 4; + {} { + ntStatus = + FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (771 << 2)) | 3, &issueCommandParms); + } + if (ntStatus == -1073741661L) { DisketteExtension->HardwareFailed = 1; } else { - + if (ntStatus == -1073741464L) { + DisketteExtension->HardwareFailed = 1; + } else { + } } + return (ntStatus); } - return (ntStatus); -} } -NTSTATUS FlInitializeControllerHardware(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; +NTSTATUS FlInitializeControllerHardware(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; { - { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (773 << 2)) | 3, - (void *)0); - } - if (ntStatus >= 0L) { - if ((int )DisketteExtension->PerpendicularMode != 0) { - { - DisketteExtension->FifoBuffer[0] = 21; - DisketteExtension->FifoBuffer[1] = (unsigned char )(128 | ((int )DisketteExtension->PerpendicularMode << 2)); - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); + { + ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (773 << 2)) | 3, (void *)0); + } + if (ntStatus >= 0L) { + if ((int)DisketteExtension->PerpendicularMode != 0) { + { + DisketteExtension->FifoBuffer[0] = 21; + DisketteExtension->FifoBuffer[1] = + (unsigned char)(128 | + ((int)DisketteExtension->PerpendicularMode << 2)); + ntStatus = + FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + } else { } } else { - } - } else { - + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FlFdcDeviceIo(PDEVICE_OBJECT DeviceObject , ULONG Ioctl , PVOID Data ) -{ NTSTATUS ntStatus ; - PIRP irp ; - PIO_STACK_LOCATION irpStack ; - KEVENT doneEvent ; - IO_STATUS_BLOCK ioStatus ; +NTSTATUS FlFdcDeviceIo(PDEVICE_OBJECT DeviceObject, ULONG Ioctl, PVOID Data) { + NTSTATUS ntStatus; + PIRP irp; + PIO_STACK_LOCATION irpStack; + KEVENT doneEvent; + IO_STATUS_BLOCK ioStatus; { - { - } - { -/* KeInitializeEvent(& doneEvent, 0, 0); */ /* INLINED */ - irp = IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, (void *)0, 0, (void *)0, - 0, 1, & doneEvent, & ioStatus); - } - if ((unsigned int )irp == (unsigned int )((void *)0)) { - { + {} { + /* KeInitializeEvent(& doneEvent, 0, 0); */ /* INLINED */ + irp = + IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, (void *)0, 0, + (void *)0, 0, 1, &doneEvent, &ioStatus); + } + if ((unsigned int)irp == (unsigned int)((void *)0)) { + {} + return (-1073741670L); + } else { } - return (-1073741670L); - } else { - - } - { - irpStack = irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpStack->Parameters.DeviceIoControl.Type3InputBuffer = Data; - ntStatus = IofCallDriver(DeviceObject, irp); - } - if (ntStatus == 259L) { { - KeWaitForSingleObject(& doneEvent, 5, 0, 0, (void *)0); - ntStatus = ioStatus.__annonCompField4.Status; + irpStack = irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpStack->Parameters.DeviceIoControl.Type3InputBuffer = Data; + ntStatus = IofCallDriver(DeviceObject, irp); } - } else { - + if (ntStatus == 259L) { + { + KeWaitForSingleObject(&doneEvent, 5, 0, 0, (void *)0); + ntStatus = ioStatus.__annonCompField4.Status; + } + } else { + } + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - SHORT st5 ; - BOOLEAN media144MB ; - BOOLEAN mediaUpTo120MB ; - BOOLEAN supportDrive ; - SET_HD_BIT_PARMS setHdBitParameter ; +NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + SHORT st5; + BOOLEAN media144MB; + BOOLEAN mediaUpTo120MB; + BOOLEAN supportDrive; + SET_HD_BIT_PARMS setHdBitParameter; { - st5 = 0; - media144MB = 0; - mediaUpTo120MB = 0; - supportDrive = 1; - { - } - if (DisketteExtension->DriveMediaType == 18) { - goto switch_186_18; - } else { - if (DisketteExtension->DriveMediaType == 16) { - goto switch_186_16; + st5 = 0; + media144MB = 0; + mediaUpTo120MB = 0; + supportDrive = 1; + {} + if (DisketteExtension->DriveMediaType == 18) { + goto switch_186_18; } else { - if (DisketteExtension->DriveMediaType == 17) { - goto switch_186_17; + if (DisketteExtension->DriveMediaType == 16) { + goto switch_186_16; } else { - if (DisketteExtension->DriveMediaType == 12) { - goto switch_186_12; + if (DisketteExtension->DriveMediaType == 17) { + goto switch_186_17; } else { - if (DisketteExtension->DriveMediaType == 13) { - goto switch_186_13; + if (DisketteExtension->DriveMediaType == 12) { + goto switch_186_12; } else { - if (DisketteExtension->DriveMediaType == 19) { - goto switch_186_19; + if (DisketteExtension->DriveMediaType == 13) { + goto switch_186_13; } else { - if (DisketteExtension->DriveMediaType == 20) { - goto switch_186_20; + if (DisketteExtension->DriveMediaType == 19) { + goto switch_186_19; } else { - if (DisketteExtension->DriveMediaType == 0) { - goto switch_186_0; + if (DisketteExtension->DriveMediaType == 20) { + goto switch_186_20; } else { - if (DisketteExtension->DriveMediaType == 1) { - goto switch_186_1; + if (DisketteExtension->DriveMediaType == 0) { + goto switch_186_0; } else { - if (DisketteExtension->DriveMediaType == 2) { - goto switch_186_2; + if (DisketteExtension->DriveMediaType == 1) { + goto switch_186_1; } else { - if (DisketteExtension->DriveMediaType == 3) { - goto switch_186_3; + if (DisketteExtension->DriveMediaType == 2) { + goto switch_186_2; } else { - if (DisketteExtension->DriveMediaType == 4) { - goto switch_186_4; + if (DisketteExtension->DriveMediaType == 3) { + goto switch_186_3; } else { - if (DisketteExtension->DriveMediaType == 5) { - goto switch_186_5; + if (DisketteExtension->DriveMediaType == 4) { + goto switch_186_4; } else { - if (DisketteExtension->DriveMediaType == 6) { - goto switch_186_6; + if (DisketteExtension->DriveMediaType == 5) { + goto switch_186_5; } else { - if (DisketteExtension->DriveMediaType == 7) { - goto switch_186_7; + if (DisketteExtension->DriveMediaType == 6) { + goto switch_186_6; } else { - if (DisketteExtension->DriveMediaType == 8) { - goto switch_186_8; + if (DisketteExtension->DriveMediaType == 7) { + goto switch_186_7; } else { - if (DisketteExtension->DriveMediaType == 9) { - goto switch_186_9; + if (DisketteExtension->DriveMediaType == 8) { + goto switch_186_8; } else { - if (DisketteExtension->DriveMediaType == 10) { - goto switch_186_10; + if (DisketteExtension->DriveMediaType == + 9) { + goto switch_186_9; } else { - if (DisketteExtension->DriveMediaType == 11) { - goto switch_186_11; + if (DisketteExtension->DriveMediaType == + 10) { + goto switch_186_10; } else { - if (DisketteExtension->DriveMediaType == 14) { - goto switch_186_14; + if (DisketteExtension->DriveMediaType == + 11) { + goto switch_186_11; } else { - if (DisketteExtension->DriveMediaType == 15) { - goto switch_186_15; + if (DisketteExtension + ->DriveMediaType == 14) { + goto switch_186_14; } else { - { - goto switch_186_default; - if (0) { - switch_186_18: /* CIL Label */ - media144MB = 1; - switch_186_16: /* CIL Label */ ; - switch_186_17: /* CIL Label */ ; - switch_186_12: /* CIL Label */ ; - switch_186_13: /* CIL Label */ ; - switch_186_19: /* CIL Label */ ; - switch_186_20: /* CIL Label */ - mediaUpTo120MB = 1; - switch_186_0: /* CIL Label */ ; - switch_186_1: /* CIL Label */ ; - switch_186_2: /* CIL Label */ ; - switch_186_3: /* CIL Label */ ; - switch_186_4: /* CIL Label */ ; - switch_186_5: /* CIL Label */ ; - switch_186_6: /* CIL Label */ ; - switch_186_7: /* CIL Label */ ; - switch_186_8: /* CIL Label */ ; - switch_186_9: /* CIL Label */ ; - switch_186_10: /* CIL Label */ ; - switch_186_11: /* CIL Label */ ; - switch_186_14: /* CIL Label */ ; - switch_186_15: /* CIL Label */ ; - goto switch_186_break; - switch_186_default: /* CIL Label */ - mediaUpTo120MB = 1; - goto switch_186_break; + if (DisketteExtension + ->DriveMediaType == 15) { + goto switch_186_15; } else { - switch_186_break: /* CIL Label */ ; - } + { + goto switch_186_default; + if (0) { + switch_186_18: /* CIL Label */ + media144MB = 1; + switch_186_16: /* CIL Label */; + switch_186_17: /* CIL Label */; + switch_186_12: /* CIL Label */; + switch_186_13: /* CIL Label */; + switch_186_19: /* CIL Label */; + switch_186_20: /* CIL Label */ + mediaUpTo120MB = 1; + switch_186_0: /* CIL Label */; + switch_186_1: /* CIL Label */; + switch_186_2: /* CIL Label */; + switch_186_3: /* CIL Label */; + switch_186_4: /* CIL Label */; + switch_186_5: /* CIL Label */; + switch_186_6: /* CIL Label */; + switch_186_7: /* CIL Label */; + switch_186_8: /* CIL Label */; + switch_186_9: /* CIL Label */; + switch_186_10: /* CIL Label */; + switch_186_11: /* CIL Label */; + switch_186_14: /* CIL Label */; + switch_186_15: /* CIL Label */; + goto switch_186_break; + switch_186_default + : /* CIL Label */ + mediaUpTo120MB = 1; + goto switch_186_break; + } else { + switch_186_break + : /* CIL Label */; + } + } } } } @@ -6740,465 +6843,447 @@ NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension ) } } } - } - setHdBitParameter.Media144MB = media144MB; - setHdBitParameter.More120MB = mediaUpTo120MB; - setHdBitParameter.DeviceUnit = DisketteExtension->DeviceUnit; - if ((int )DisketteExtension->DriveType == 3) { - setHdBitParameter.DriveType144MB = 1; - } else { - setHdBitParameter.DriveType144MB = 0; - } - { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (785 << 2)) | 3, - & setHdBitParameter); - } - if (! (ntStatus >= 0L)) { - return (ntStatus); - } else { - - } - if (setHdBitParameter.ChangedHdBit) { + setHdBitParameter.Media144MB = media144MB; + setHdBitParameter.More120MB = mediaUpTo120MB; + setHdBitParameter.DeviceUnit = DisketteExtension->DeviceUnit; + if ((int)DisketteExtension->DriveType == 3) { + setHdBitParameter.DriveType144MB = 1; + } else { + setHdBitParameter.DriveType144MB = 0; + } { - ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); + ntStatus = + FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (785 << 2)) | 3, &setHdBitParameter); } - } else { - + if (!(ntStatus >= 0L)) { + return (ntStatus); + } else { + } + if (setHdBitParameter.ChangedHdBit) { + { ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); } + } else { + } + return (ntStatus); } - return (ntStatus); -} } -NTSTATUS FloppyQueueRequest(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp ) -{ KIRQL oldIrql ; - NTSTATUS ntStatus ; - LONG tmp ; +NTSTATUS FloppyQueueRequest(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp) { + KIRQL oldIrql; + NTSTATUS ntStatus; + LONG tmp; { - { -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount += 1UL; - } - if (PagingReferenceCount == 1UL) { { -/* MmResetDriverPaging(& DriverEntry); */ /* INLINED */ + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount += 1UL; + } + if (PagingReferenceCount == 1UL) { + { /* MmResetDriverPaging(& DriverEntry); */ /* INLINED */ + } + } else { } - } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ - oldIrql = KfAcquireSpinLock(& DisketteExtension->FlCancelSpinLock); - InterlockedExchange((LONG *)((PVOID *)(& Irp->CancelRoutine)), (long )((void *)(& FloppyCancelQueuedRequest))); - } - if (Irp->Cancel) { { - tmp = InterlockedExchange((LONG *)((PVOID *)(& Irp->CancelRoutine)), (long )((void *)0)); + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + oldIrql = KfAcquireSpinLock(&DisketteExtension->FlCancelSpinLock); + InterlockedExchange((LONG *)((PVOID *)(&Irp->CancelRoutine)), + (long)((void *)(&FloppyCancelQueuedRequest))); } - if ((void (*)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ))((void *)tmp)) { + if (Irp->Cancel) { { - Irp->IoStatus.__annonCompField4.Status = -1073741536L; - myStatus = -1073741536L; - Irp->IoStatus.Information = 0; -/* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ - IofCompleteRequest(Irp, 0); -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; + tmp = InterlockedExchange((LONG *)((PVOID *)(&Irp->CancelRoutine)), + (long)((void *)0)); } - if (PagingReferenceCount == 0UL) { + if ((void (*)(struct _DEVICE_OBJECT * DeviceObject, struct _IRP * Irp))( + (void *)tmp)) { + { + Irp->IoStatus.__annonCompField4.Status = -1073741536L; + myStatus = -1073741536L; + Irp->IoStatus.Information = 0; + /* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ + IofCompleteRequest(Irp, 0); + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; + } + if (PagingReferenceCount == 0UL) { + { /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } + } else { + } { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + ntStatus = -1073741536L; } } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ - ntStatus = -1073741536L; + goto _L; } } else { - goto _L; - } - } else { - _L: /* CIL Label */ - Irp->IoStatus.__annonCompField4.Status = 259L; - myStatus = 259L; - (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1; - if (pended == 0) { - pended = 1; - } else { + _L: /* CIL Label */ + Irp->IoStatus.__annonCompField4.Status = 259L; + myStatus = 259L; + (Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation) + ->Control = (int)(Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation) + ->Control | + 1; + if (pended == 0) { + pended = 1; + } else { + { errorFn(); } + } { - errorFn(); + ExfInterlockedInsertTailList( + &DisketteExtension->NewRequestQueue, + &Irp->Tail.Overlay.__annonCompField17.ListEntry, + &DisketteExtension->NewRequestQueueSpinLock); + /* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ + ntStatus = 259L; } } - { - ExfInterlockedInsertTailList(& DisketteExtension->NewRequestQueue, & Irp->Tail.Overlay.__annonCompField17.ListEntry, - & DisketteExtension->NewRequestQueueSpinLock); -/* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ - ntStatus = 259L; - } - } - return (ntStatus); -} -} -void FloppyCancelQueuedRequest(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDISKETTE_EXTENSION disketteExtension ; - KIRQL oldIrql ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; - - { - disketteExtension = DeviceObject->DeviceExtension; - { - } - { - oldIrql = KfAcquireSpinLock(& disketteExtension->FlCancelSpinLock); - Irp->IoStatus.__annonCompField4.Status = -1073741536L; - myStatus = -1073741536L; - Irp->IoStatus.Information = 0; - } - if (Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink) { - _EX_Flink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink; - _EX_Blink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - } else { - - } - { -/* KfReleaseSpinLock(& disketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ -/* IoReleaseCancelSpinLock(Irp->CancelIrql); */ /* INLINED */ - IofCompleteRequest(Irp, 0); -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; - } - if (PagingReferenceCount == 0UL) { - { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ - } - } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + return (ntStatus); } - return; -} } -void FloppyProcessQueuedRequests(PDISKETTE_EXTENSION DisketteExtension ) -{ KIRQL oldIrql ; - PLIST_ENTRY headOfList ; - PIRP currentIrp ; - PIO_STACK_LOCATION irpSp ; - LONG tmp ; +void FloppyCancelQueuedRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDISKETTE_EXTENSION disketteExtension; + KIRQL oldIrql; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; { - { - oldIrql = KfAcquireSpinLock(& DisketteExtension->FlCancelSpinLock); - } - { - while (1) { - while_188_continue: /* CIL Label */ ; - { - headOfList = ExfInterlockedRemoveHeadList(& DisketteExtension->NewRequestQueue, - & DisketteExtension->NewRequestQueueSpinLock); + disketteExtension = DeviceObject->DeviceExtension; + {} { + oldIrql = KfAcquireSpinLock(&disketteExtension->FlCancelSpinLock); + Irp->IoStatus.__annonCompField4.Status = -1073741536L; + myStatus = -1073741536L; + Irp->IoStatus.Information = 0; } - if ((unsigned int )headOfList != (unsigned int )((void *)0)) { - + if (Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink) { + _EX_Flink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink; + _EX_Blink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; } else { - goto while_188_break; } { - currentIrp = (IRP *)((CHAR *)headOfList - (unsigned long )(& ((IRP *)0)->Tail.Overlay.__annonCompField17.ListEntry)); - tmp = InterlockedExchange((LONG *)((PVOID *)(& currentIrp->CancelRoutine)), (long )((void *)0)); + /* KfReleaseSpinLock(& disketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ + /* IoReleaseCancelSpinLock(Irp->CancelIrql); */ /* INLINED */ + IofCompleteRequest(Irp, 0); + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; } - if ((void (*)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ))((void *)tmp)) { - irpSp = currentIrp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; + if (PagingReferenceCount == 0UL) { + { /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } } else { - currentIrp->Tail.Overlay.__annonCompField17.ListEntry.Flink = (void *)0; - currentIrp = (void *)0; } - { -/* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ + { /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ } - if (currentIrp) { - if (DisketteExtension->IsRemoved) { + return; + } +} +void FloppyProcessQueuedRequests(PDISKETTE_EXTENSION DisketteExtension) { + KIRQL oldIrql; + PLIST_ENTRY headOfList; + PIRP currentIrp; + PIO_STACK_LOCATION irpSp; + LONG tmp; + + { + { oldIrql = KfAcquireSpinLock(&DisketteExtension->FlCancelSpinLock); } + { + while (1) { + while_188_continue: /* CIL Label */; { - currentIrp->IoStatus.Information = 0; - currentIrp->IoStatus.__annonCompField4.Status = -1073741738L; - IofCompleteRequest(currentIrp, 0); + headOfList = ExfInterlockedRemoveHeadList( + &DisketteExtension->NewRequestQueue, + &DisketteExtension->NewRequestQueueSpinLock); } - } else { - if (irpSp->MajorFunction == 3) { - goto switch_189_3; + if ((unsigned int)headOfList != (unsigned int)((void *)0)) { + + } else { + goto while_188_break; + } + { + currentIrp = + (IRP *)((CHAR *)headOfList - + (unsigned long)(&((IRP *)0) + ->Tail.Overlay.__annonCompField17 + .ListEntry)); + tmp = InterlockedExchange( + (LONG *)((PVOID *)(¤tIrp->CancelRoutine)), + (long)((void *)0)); + } + if ((void (*)(struct _DEVICE_OBJECT * DeviceObject, struct _IRP * Irp))( + (void *)tmp)) { + irpSp = currentIrp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; } else { - if (irpSp->MajorFunction == 4) { - goto switch_189_4; + currentIrp->Tail.Overlay.__annonCompField17.ListEntry.Flink = + (void *)0; + currentIrp = (void *)0; + } + { + /* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ + } + if (currentIrp) { + if (DisketteExtension->IsRemoved) { + { + currentIrp->IoStatus.Information = 0; + currentIrp->IoStatus.__annonCompField4.Status = -1073741738L; + IofCompleteRequest(currentIrp, 0); + } } else { - if (irpSp->MajorFunction == 14) { - goto switch_189_14; + if (irpSp->MajorFunction == 3) { + goto switch_189_3; } else { - { - goto switch_189_default; - if (0) { - switch_189_3: /* CIL Label */ ; - switch_189_4: /* CIL Label */ - { - FloppyReadWrite(DisketteExtension->DeviceObject, currentIrp); - } - goto switch_189_break; - switch_189_14: /* CIL Label */ - { - FloppyDeviceControl(DisketteExtension->DeviceObject, currentIrp); - } - goto switch_189_break; - switch_189_default: /* CIL Label */ - { - currentIrp->IoStatus.Information = 0; - currentIrp->IoStatus.__annonCompField4.Status = -1073741823L; - IofCompleteRequest(currentIrp, 0); - } + if (irpSp->MajorFunction == 4) { + goto switch_189_4; } else { - switch_189_break: /* CIL Label */ ; - } + if (irpSp->MajorFunction == 14) { + goto switch_189_14; + } else { + { + goto switch_189_default; + if (0) { + switch_189_3: /* CIL Label */; + switch_189_4 : /* CIL Label */ + { + FloppyReadWrite(DisketteExtension->DeviceObject, + currentIrp); + } + goto switch_189_break; + switch_189_14 : /* CIL Label */ + { + FloppyDeviceControl(DisketteExtension->DeviceObject, + currentIrp); + } + goto switch_189_break; + switch_189_default : /* CIL Label */ + { + currentIrp->IoStatus.Information = 0; + currentIrp->IoStatus.__annonCompField4.Status = + -1073741823L; + IofCompleteRequest(currentIrp, 0); + } + } else { + switch_189_break: /* CIL Label */; + } + } + } } } } + } else { } - } - } else { - - } - if (currentIrp) { - { -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; - } - if (PagingReferenceCount == 0UL) { - { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + if (currentIrp) { + { + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; + } + if (PagingReferenceCount == 0UL) { + { /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } + } else { + } + { /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + } + } else { } - } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + { oldIrql = KfAcquireSpinLock(&DisketteExtension->FlCancelSpinLock); } } - } else { - + while_188_break: /* CIL Label */; } { - oldIrql = KfAcquireSpinLock(& DisketteExtension->FlCancelSpinLock); + /* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ } + return; } - while_188_break: /* CIL Label */ ; - } - { -/* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ - } - return; -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) -IRP *pirp ; -void stub_driver_init(void) -{ - - { - s = NP; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - return; -} -} -int main(void) -{ DRIVER_OBJECT d ; - UNICODE_STRING u ; - NTSTATUS status ; - int we_should_unload = __VERIFIER_nondet_int() ; - IRP irp ; - int __BLAST_NONDET = __VERIFIER_nondet_int() ; - int irp_choice = __VERIFIER_nondet_int() ; - DEVICE_OBJECT devobj ; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +IRP *pirp; +void stub_driver_init(void) { { - { - status = 0; - pirp = & irp; - _BLAST_init(); - status = DriverEntry(& d, & u); - } - if (status >= 0L) { s = NP; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; customIrp = 0; - setEventCalled = customIrp; - lowerDriverReturn = setEventCalled; - compRegistered = lowerDriverReturn; - compFptr = compRegistered; - pended = compFptr; - pirp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (irp_choice == 0) { - pirp->IoStatus.__annonCompField4.Status = -1073741637L; - myStatus = -1073741637L; - } else { + return; + } +} +int main(void) { + DRIVER_OBJECT d; + UNICODE_STRING u; + NTSTATUS status; + int we_should_unload = __VERIFIER_nondet_int(); + IRP irp; + int __BLAST_NONDET = __VERIFIER_nondet_int(); + int irp_choice = __VERIFIER_nondet_int(); + DEVICE_OBJECT devobj; - } + { { - stub_driver_init(); - } - if (! (status >= 0L)) { - return (-1); - } else { - + status = 0; + pirp = &irp; + _BLAST_init(); + status = DriverEntry(&d, &u); } - if (__BLAST_NONDET == 0) { - goto switch_190_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_190_1; + if (status >= 0L) { + s = NP; + customIrp = 0; + setEventCalled = customIrp; + lowerDriverReturn = setEventCalled; + compRegistered = lowerDriverReturn; + compFptr = compRegistered; + pended = compFptr; + pirp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (irp_choice == 0) { + pirp->IoStatus.__annonCompField4.Status = -1073741637L; + myStatus = -1073741637L; + } else { + } + { stub_driver_init(); } + if (!(status >= 0L)) { + return (-1); + } else { + } + if (__BLAST_NONDET == 0) { + goto switch_190_0; } else { - if (__BLAST_NONDET == 2) { - goto switch_190_2; + if (__BLAST_NONDET == 1) { + goto switch_190_1; } else { - if (__BLAST_NONDET == 3) { - goto switch_190_3; + if (__BLAST_NONDET == 2) { + goto switch_190_2; } else { - if (__BLAST_NONDET == 4) { - goto switch_190_4; + if (__BLAST_NONDET == 3) { + goto switch_190_3; } else { - { - goto switch_190_default; - if (0) { - switch_190_0: /* CIL Label */ - { - status = FloppyCreateClose(& devobj, pirp); - } - goto switch_190_break; - switch_190_1: /* CIL Label */ - { - status = FloppyCreateClose(& devobj, pirp); - } - goto switch_190_break; - switch_190_2: /* CIL Label */ - { - status = FloppyDeviceControl(& devobj, pirp); - } - goto switch_190_break; - switch_190_3: /* CIL Label */ - { - status = FloppyPnp(& devobj, pirp); - } - goto switch_190_break; - switch_190_4: /* CIL Label */ + if (__BLAST_NONDET == 4) { + goto switch_190_4; + } else { { - status = FloppyPower(& devobj, pirp); + goto switch_190_default; + if (0) { + switch_190_0 : /* CIL Label */ + { + status = FloppyCreateClose(&devobj, pirp); + } + goto switch_190_break; + switch_190_1 : /* CIL Label */ + { + status = FloppyCreateClose(&devobj, pirp); + } + goto switch_190_break; + switch_190_2 : /* CIL Label */ + { + status = FloppyDeviceControl(&devobj, pirp); + } + goto switch_190_break; + switch_190_3 : /* CIL Label */ + { + status = FloppyPnp(&devobj, pirp); + } + goto switch_190_break; + switch_190_4 : /* CIL Label */ + { + status = FloppyPower(&devobj, pirp); + } + goto switch_190_break; + switch_190_default: /* CIL Label */; + return (-1); + } else { + switch_190_break: /* CIL Label */; + } } - goto switch_190_break; - switch_190_default: /* CIL Label */ ; - return (-1); - } else { - switch_190_break: /* CIL Label */ ; - } } } } } } - } - if (we_should_unload) { - { - FloppyUnload(& d); + if (we_should_unload) { + { FloppyUnload(&d); } + } else { } } else { - - } - } else { - - } - if (pended == 1) { - if (s == NP) { - s = NP; - } else { - goto _L___2; } - } else { - _L___2: /* CIL Label */ if (pended == 1) { - if (s == MPR3) { - s = MPR3; + if (s == NP) { + s = NP; } else { - goto _L___1; + goto _L___2; } } else { - _L___1: /* CIL Label */ - if (s == UNLOADED) { - + _L___2: /* CIL Label */ + if (pended == 1) { + if (s == MPR3) { + s = MPR3; + } else { + goto _L___1; + } } else { - if (status == -1L) { + _L___1: /* CIL Label */ + if (s == UNLOADED) { } else { - if (s != SKIP2) { - if (s != IPC) { - if (s != DC) { - { - errorFn(); + if (status == -1L) { + + } else { + if (s != SKIP2) { + if (s != IPC) { + if (s != DC) { + { errorFn(); } + } else { + goto _L___0; } } else { goto _L___0; } } else { - goto _L___0; - } - } else { - _L___0: /* CIL Label */ - if (pended == 1) { - if (status != 259L) { - status = 0; - } else { - - } - } else { - if (s == DC) { - { - errorFn(); + _L___0: /* CIL Label */ + if (pended == 1) { + if (status != 259L) { + status = 0; + } else { } } else { - if (status != (NTSTATUS )lowerDriverReturn) { - { - errorFn(); - } + if (s == DC) { + { errorFn(); } } else { - + if (status != (NTSTATUS)lowerDriverReturn) { + { errorFn(); } + } else { + } } } } @@ -7206,1091 +7291,960 @@ int main(void) } } } + status = 0; + return (status); } - status = 0; - return (status); -} -} -char _SLAM_alloc_dummy ; -char *malloc(int i ) -{ - - { - return (& _SLAM_alloc_dummy); -} } - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; -void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) -{ +char _SLAM_alloc_dummy; +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; -void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) -{ +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; -PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , SIZE_T NumberOfBytes , - ULONG Tag ) -{ PVOID x ; - char *tmp ; +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag) { + PVOID x; + char *tmp; { - { - tmp = & _SLAM_alloc_dummy; /* malloc(NumberOfBytes); */ /* INLINED */ - x = tmp; + { + tmp = &_SLAM_alloc_dummy; /* malloc(NumberOfBytes); */ /* INLINED */ + x = tmp; + } + return (x); } - return (x); -} } - void ExFreePool(PVOID P ) ; -void ExFreePool(PVOID P ) -{ +void ExFreePool(PVOID P); +void ExFreePool(PVOID P) { - { - return; -} + { return; } } - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; -PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , BOOLEAN SecondaryBuffer , - BOOLEAN ChargeQuota , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_191_0; - } else { - { - goto switch_191_default; - if (0) { - switch_191_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_191_0; + } else { { - tmp = & _SLAM_alloc_dummy; /* malloc(sizeof(MDL )); */ /* INLINED */ + goto switch_191_default; + if (0) { + switch_191_0 : /* CIL Label */ + { + tmp = &_SLAM_alloc_dummy; /* malloc(sizeof(MDL )); */ /* INLINED */ + } + return ((void *)tmp); + switch_191_default: /* CIL Label */; + return ((void *)0); + } else { + switch_191_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_191_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_191_break: /* CIL Label */ ; - } } } } -} - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; -PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , PDEVICE_OBJECT TargetDevice ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_192_0; - } else { - { - goto switch_192_default; - if (0) { - switch_192_0: /* CIL Label */ ; - return (TargetDevice); - switch_192_default: /* CIL Label */ ; - return ((void *)0); + if (__BLAST_NONDET == 0) { + goto switch_192_0; } else { - switch_192_break: /* CIL Label */ ; - } + { + goto switch_192_default; + if (0) { + switch_192_0: /* CIL Label */; + return (TargetDevice); + switch_192_default: /* CIL Label */; + return ((void *)0); + } else { + switch_192_break: /* CIL Label */; + } + } } } } -} - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , PDEVICE_OBJECT DeviceObject , - PVOID Buffer , ULONG Length , PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - customIrp = 1; - if (__BLAST_NONDET == 0) { - goto switch_193_0; - } else { - { - goto switch_193_default; - if (0) { - switch_193_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET == 0) { + goto switch_193_0; + } else { { - tmp = & _SLAM_alloc_dummy; /* malloc(sizeof(IRP )); */ /* INLINED */ + goto switch_193_default; + if (0) { + switch_193_0 : /* CIL Label */ + { + tmp = &_SLAM_alloc_dummy; /* malloc(sizeof(IRP )); */ /* INLINED */ + } + return ((void *)tmp); + switch_193_default: /* CIL Label */; + return ((void *)0); + } else { + switch_193_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_193_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_193_break: /* CIL Label */ ; - } } } } -} - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , BOOLEAN InternalDeviceIoControl , - PKEVENT Event , PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - customIrp = 1; - if (__BLAST_NONDET == 0) { - goto switch_194_0; - } else { - { - goto switch_194_default; - if (0) { - switch_194_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET == 0) { + goto switch_194_0; + } else { { - tmp = & _SLAM_alloc_dummy; /* malloc(sizeof(IRP )); */ /* INLINED */ + goto switch_194_default; + if (0) { + switch_194_0 : /* CIL Label */ + { + tmp = &_SLAM_alloc_dummy; /* malloc(sizeof(IRP )); */ /* INLINED */ + } + return ((void *)tmp); + switch_194_default: /* CIL Label */; + return ((void *)0); + } else { + switch_194_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_194_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_194_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; -NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_195_0; - } else { - { - goto switch_195_default; - if (0) { - switch_195_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_195_0; + } else { { - tmp = & _SLAM_alloc_dummy; /* malloc(sizeof(DEVICE_OBJECT )); */ /* INLINED */ - *DeviceObject = (void *)tmp; + goto switch_195_default; + if (0) { + switch_195_0 : /* CIL Label */ + { + tmp = &_SLAM_alloc_dummy; + /* malloc(sizeof(DEVICE_OBJECT )); */ /* INLINED */ + *DeviceObject = (void *)tmp; + } + return (0L); + switch_195_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_195_break: /* CIL Label */; + } } - return (0L); - switch_195_default: /* CIL Label */ ; - return (-1073741823L); - } else { - switch_195_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; -NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , PUNICODE_STRING DeviceName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_196_0; - } else { - { - goto switch_196_default; - if (0) { - switch_196_0: /* CIL Label */ ; - return (0L); - switch_196_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_196_0; } else { - switch_196_break: /* CIL Label */ ; - } + { + goto switch_196_default; + if (0) { + switch_196_0: /* CIL Label */; + return (0L); + switch_196_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_196_break: /* CIL Label */; + } + } } } } -} - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; -void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) -{ +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject) { - { - return; -} + { return; } } - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_197_0; - } else { - { - goto switch_197_default; - if (0) { - switch_197_0: /* CIL Label */ ; - return (0L); - switch_197_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_197_0; } else { - switch_197_break: /* CIL Label */ ; - } + { + goto switch_197_default; + if (0) { + switch_197_0: /* CIL Label */; + return (0L); + switch_197_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_197_break: /* CIL Label */; + } + } } } } -} - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; -void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) -{ +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice) { - { - return; -} + { return; } } - void IoFreeIrp(PIRP Irp ) ; -void IoFreeIrp(PIRP Irp ) -{ +void IoFreeIrp(PIRP Irp); +void IoFreeIrp(PIRP Irp) { - { - return; -} + { return; } } - void IoFreeMdl(PMDL Mdl ) ; -void IoFreeMdl(PMDL Mdl ) -{ +void IoFreeMdl(PMDL Mdl); +void IoFreeMdl(PMDL Mdl) { - { - return; -} + { return; } } - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; -PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) -{ char *tmp ; +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) { + char *tmp; { - { - tmp = & _SLAM_alloc_dummy; /* malloc(sizeof(CONFIGURATION_INFORMATION )); */ /* INLINED */ - } - return ((void *)tmp); -} -} - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; -NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , PULONG BusNumber , PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; + { + tmp = &_SLAM_alloc_dummy; + /* malloc(sizeof(CONFIGURATION_INFORMATION )); */ /* INLINED */ + } + return ((void *)tmp); + } +} +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_198_0; - } else { - { - goto switch_198_default; - if (0) { - switch_198_0: /* CIL Label */ ; - return (0L); - switch_198_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_198_0; } else { - switch_198_break: /* CIL Label */ ; - } + { + goto switch_198_default; + if (0) { + switch_198_0: /* CIL Label */; + return (0L); + switch_198_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_198_break: /* CIL Label */; + } + } } } } -} - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_199_0; - } else { - { - goto switch_199_default; - if (0) { - switch_199_0: /* CIL Label */ ; - return (0L); - switch_199_default: /* CIL Label */ ; - return (-1073741808L); + if (__BLAST_NONDET == 0) { + goto switch_199_0; } else { - switch_199_break: /* CIL Label */ ; - } + { + goto switch_199_default; + if (0) { + switch_199_0: /* CIL Label */; + return (0L); + switch_199_default: /* CIL Label */; + return (-1073741808L); + } else { + switch_199_break: /* CIL Label */; + } + } } } } -} - void IoReleaseCancelSpinLock(KIRQL Irql ) ; -void IoReleaseCancelSpinLock(KIRQL Irql ) -{ +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoReleaseCancelSpinLock(KIRQL Irql) { - { - return; -} + { return; } } - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , BOOLEAN Enable ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_200_0; - } else { - { - goto switch_200_default; - if (0) { - switch_200_0: /* CIL Label */ ; - return (0L); - switch_200_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_200_0; } else { - switch_200_break: /* CIL Label */ ; - } + { + goto switch_200_default; + if (0) { + switch_200_0: /* CIL Label */; + return (0L); + switch_200_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_200_break: /* CIL Label */; + } + } } } } -} - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; -void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) -{ +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject) { - { - return; -} + { return; } } -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { - if (s == NP) { - s = MPR1; - } else { - { - errorFn(); + if (s == NP) { + s = MPR1; + } else { + { errorFn(); } } + return; } - return; } -} - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - NTSTATUS returnVal2 ; - int compRetStatus1 ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + NTSTATUS returnVal2; + int compRetStatus1; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; { - if (compRegistered) { - { - tmp = FloppyPnpComplete(DeviceObject, Irp, lcontext); - compRetStatus1 = tmp; - } - if ((long )compRetStatus1 == -1073741802L) { + if (compRegistered) { { - stubMoreProcessingRequired(); + tmp = FloppyPnpComplete(DeviceObject, Irp, lcontext); + compRetStatus1 = tmp; + } + if ((long)compRetStatus1 == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET == 0) { - goto switch_201_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_201_1; + if (__BLAST_NONDET == 0) { + goto switch_201_0; } else { - { - goto switch_201_default; - if (0) { - switch_201_0: /* CIL Label */ - returnVal2 = 0L; - goto switch_201_break; - switch_201_1: /* CIL Label */ - returnVal2 = -1073741823L; - goto switch_201_break; - switch_201_default: /* CIL Label */ - returnVal2 = 259L; - goto switch_201_break; + if (__BLAST_NONDET == 1) { + goto switch_201_1; } else { - switch_201_break: /* CIL Label */ ; - } + { + goto switch_201_default; + if (0) { + switch_201_0: /* CIL Label */ + returnVal2 = 0L; + goto switch_201_break; + switch_201_1: /* CIL Label */ + returnVal2 = -1073741823L; + goto switch_201_break; + switch_201_default: /* CIL Label */ + returnVal2 = 259L; + goto switch_201_break; + } else { + switch_201_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal2; - } else { - if (s == MPR1) { - if (returnVal2 == 259L) { - s = MPR3; - lowerDriverReturn = returnVal2; - } else { - s = NP; - lowerDriverReturn = returnVal2; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal2; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal2; + if (s == MPR1) { + if (returnVal2 == 259L) { + s = MPR3; + lowerDriverReturn = returnVal2; + } else { + s = NP; + lowerDriverReturn = returnVal2; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal2; + } else { + { errorFn(); } } } } + return (returnVal2); } - return (returnVal2); -} } - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; -void IofCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) -{ +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost) { { - if (s == NP) { - s = DC; - } else { - { - errorFn(); + if (s == NP) { + s = DC; + } else { + { errorFn(); } } + return; } - return; } -} - KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ; -KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) -{ +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock); +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock) { - { - return ((unsigned char)0); + { return ((unsigned char)0); } } -} - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; -NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , BOOLEAN Alertable , PLARGE_INTEGER Interval ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_202_0; - } else { - { - goto switch_202_default; - if (0) { - switch_202_0: /* CIL Label */ ; - return (0L); - switch_202_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_202_0; } else { - switch_202_break: /* CIL Label */ ; - } + { + goto switch_202_default; + if (0) { + switch_202_0: /* CIL Label */; + return (0L); + switch_202_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_202_break: /* CIL Label */; + } + } } } } -} - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; -void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , BOOLEAN State ) -{ +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State) { - { - return; + { return; } } -} - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; -void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , LONG Count , LONG Limit ) -{ +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit) { - { - return; + { return; } } -} - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; -void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) -{ +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock) { - { - return; + { return; } } -} - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; -LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , LONG Adjustment , - BOOLEAN Wait ) -{ LONG r = __VERIFIER_nondet_long() ; +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait) { + LONG r = __VERIFIER_nondet_long(); - { - return (r); + { return (r); } } -} - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; -void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , KIRQL NewIrql ) -{ +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql) { - { - return; + { return; } } -} - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; -LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , BOOLEAN Wait ) -{ LONG l = __VERIFIER_nondet_long() ; +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait) { + LONG l = __VERIFIER_nondet_long(); { - setEventCalled = 1; - return (l); -} + setEventCalled = 1; + return (l); + } } - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; -NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , PLARGE_INTEGER Timeout ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (s == MPR3) { - if (setEventCalled == 1) { - s = NP; - setEventCalled = 0; - } else { - goto _L; - } - } else { - _L: /* CIL Label */ - if (customIrp == 1) { - s = NP; - customIrp = 0; + if (s == MPR3) { + if (setEventCalled == 1) { + s = NP; + setEventCalled = 0; + } else { + goto _L; + } } else { - if (s == MPR3) { - { - errorFn(); - } + _L: /* CIL Label */ + if (customIrp == 1) { + s = NP; + customIrp = 0; } else { - + if (s == MPR3) { + { errorFn(); } + } else { + } } } - } - if (__BLAST_NONDET == 0) { - goto switch_203_0; - } else { - { - goto switch_203_default; - if (0) { - switch_203_0: /* CIL Label */ ; - return (0L); - switch_203_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_203_0; } else { - switch_203_break: /* CIL Label */ ; - } + { + goto switch_203_default; + if (0) { + switch_203_0: /* CIL Label */; + return (0L); + switch_203_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_203_break: /* CIL Label */; + } + } } } } -} - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; -PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , PHYSICAL_ADDRESS HighestAcceptableAddress ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_204_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_204_1; + if (__BLAST_NONDET == 0) { + goto switch_204_0; } else { - if (0) { - switch_204_0: /* CIL Label */ + if (__BLAST_NONDET == 1) { + goto switch_204_1; + } else { + if (0) { + switch_204_0 : /* CIL Label */ { - tmp = & _SLAM_alloc_dummy; /* malloc(NumberOfBytes); */ /* INLINED */ + tmp = &_SLAM_alloc_dummy; /* malloc(NumberOfBytes); */ /* INLINED */ + } + return (tmp); + switch_204_1: /* CIL Label */; + return ((void *)0); + } else { + switch_204_break: /* CIL Label */; } - return (tmp); - switch_204_1: /* CIL Label */ ; - return ((void *)0); - } else { - switch_204_break: /* CIL Label */ ; } } + return ((void *)0); } - return ((void *)0); } -} - void MmFreeContiguousMemory(PVOID BaseAddress ) ; -void MmFreeContiguousMemory(PVOID BaseAddress ) -{ +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmFreeContiguousMemory(PVOID BaseAddress) { - { - return; + { return; } } -} - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; -PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , PVOID BaseAddress , - ULONG BugCheckOnFailure , MM_PAGE_PRIORITY Priority ) -{ +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority) { - { - return ((void *)0); + { return ((void *)0); } } -} - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; -PVOID MmPageEntireDriver(PVOID AddressWithinSection ) -{ +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection) { - { - return ((void *)0); + { return ((void *)0); } } -} - void MmResetDriverPaging(PVOID AddressWithinSection ) ; -void MmResetDriverPaging(PVOID AddressWithinSection ) -{ +void MmResetDriverPaging(PVOID AddressWithinSection); +void MmResetDriverPaging(PVOID AddressWithinSection) { - { - return; + { return; } } -} - void MmUnlockPages(PMDL MemoryDescriptorList ) ; -void MmUnlockPages(PMDL MemoryDescriptorList ) -{ +void MmUnlockPages(PMDL MemoryDescriptorList); +void MmUnlockPages(PMDL MemoryDescriptorList) { - { - return; + { return; } } -} - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; -NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , ACCESS_MASK DesiredAccess , POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , PVOID *Object , POBJECT_HANDLE_INFORMATION HandleInformation ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_205_0; - } else { - { - goto switch_205_default; - if (0) { - switch_205_0: /* CIL Label */ ; - return (0L); - switch_205_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_205_0; } else { - switch_205_break: /* CIL Label */ ; - } + { + goto switch_205_default; + if (0) { + switch_205_0: /* CIL Label */; + return (0L); + switch_205_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_205_break: /* CIL Label */; + } + } } } } -} - void ObfDereferenceObject(PVOID Object ) ; -void ObfDereferenceObject(PVOID Object ) -{ +void ObfDereferenceObject(PVOID Object); +void ObfDereferenceObject(PVOID Object) { - { - return; + { return; } } -} - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - int compRetStatus ; - NTSTATUS returnVal ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + int compRetStatus; + NTSTATUS returnVal; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; { - if (compRegistered) { - { - tmp = FloppyPnpComplete(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - if ((long )compRetStatus == -1073741802L) { + if (compRegistered) { { - stubMoreProcessingRequired(); + tmp = FloppyPnpComplete(DeviceObject, Irp, lcontext); + compRetStatus = tmp; + } + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET == 0) { - goto switch_206_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_206_1; + if (__BLAST_NONDET == 0) { + goto switch_206_0; } else { - { - goto switch_206_default; - if (0) { - switch_206_0: /* CIL Label */ - returnVal = 0L; - goto switch_206_break; - switch_206_1: /* CIL Label */ - returnVal = -1073741823L; - goto switch_206_break; - switch_206_default: /* CIL Label */ - returnVal = 259L; - goto switch_206_break; + if (__BLAST_NONDET == 1) { + goto switch_206_1; } else { - switch_206_break: /* CIL Label */ ; - } + { + goto switch_206_default; + if (0) { + switch_206_0: /* CIL Label */ + returnVal = 0L; + goto switch_206_break; + switch_206_1: /* CIL Label */ + returnVal = -1073741823L; + goto switch_206_break; + switch_206_default: /* CIL Label */ + returnVal = 259L; + goto switch_206_break; + } else { + switch_206_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal; - } else { - if (s == MPR1) { - if (returnVal == 259L) { - s = MPR3; - lowerDriverReturn = returnVal; - } else { - s = NP; - lowerDriverReturn = returnVal; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal; + if (s == MPR1) { + if (returnVal == 259L) { + s = MPR3; + lowerDriverReturn = returnVal; + } else { + s = NP; + lowerDriverReturn = returnVal; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal; + } else { + { errorFn(); } } } } + return (returnVal); } - return (returnVal); -} } - void PoStartNextPowerIrp(PIRP Irp ) ; -void PoStartNextPowerIrp(PIRP Irp ) -{ +void PoStartNextPowerIrp(PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp) { - { - return; -} + { return; } } - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; -NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , ULONG DesiredAccess , POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , PCLIENT_ID ClientId , void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_207_0; - } else { - { - goto switch_207_default; - if (0) { - switch_207_0: /* CIL Label */ ; - return (0L); - switch_207_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_207_0; } else { - switch_207_break: /* CIL Label */ ; - } + { + goto switch_207_default; + if (0) { + switch_207_0: /* CIL Label */; + return (0L); + switch_207_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_207_break: /* CIL Label */; + } + } } } } -} - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_208_0; - } else { - { - goto switch_208_default; - if (0) { - switch_208_0: /* CIL Label */ ; - return (0L); - switch_208_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_208_0; } else { - switch_208_break: /* CIL Label */ ; - } + { + goto switch_208_default; + if (0) { + switch_208_0: /* CIL Label */; + return (0L); + switch_208_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_208_break: /* CIL Label */; + } + } } } } -} - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; -NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_209_0; - } else { - { - goto switch_209_default; - if (0) { - switch_209_0: /* CIL Label */ ; - return (0L); - switch_209_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_209_0; } else { - switch_209_break: /* CIL Label */ ; - } + { + goto switch_209_default; + if (0) { + switch_209_0: /* CIL Label */; + return (0L); + switch_209_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_209_break: /* CIL Label */; + } + } } } } -} - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; -SIZE_T RtlCompareMemory(void const *Source1 , void const *Source2 , - SIZE_T Length ) -{ SIZE_T r = __VERIFIER_nondet_long() ; +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length) { + SIZE_T r = __VERIFIER_nondet_long(); - { - return (r); -} + { return (r); } } - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; -void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) -{ +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString) { - { - return; -} + { return; } } - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; -NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , PCWSTR ValueName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_210_0; - } else { - { - goto switch_210_default; - if (0) { - switch_210_0: /* CIL Label */ ; - return (0L); - switch_210_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_210_0; } else { - switch_210_break: /* CIL Label */ ; - } + { + goto switch_210_default; + if (0) { + switch_210_0: /* CIL Label */; + return (0L); + switch_210_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_210_break: /* CIL Label */; + } + } } } } -} - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; -void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) -{ +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString) { - { - return; -} + { return; } } - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; -void RtlInitString(PSTRING DestinationString , PCSZ SourceString ) -{ +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString) { - { - return; -} + { return; } } - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; -void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) -{ +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString) { - { - return; -} + { return; } } - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; -NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , PVOID Environment ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_211_0; - } else { - { - goto switch_211_default; - if (0) { - switch_211_0: /* CIL Label */ ; - return (0L); - switch_211_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_211_0; } else { - switch_211_break: /* CIL Label */ ; - } + { + goto switch_211_default; + if (0) { + switch_211_0: /* CIL Label */; + return (0L); + switch_211_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_211_break: /* CIL Label */; + } + } } } } -} - NTSTATUS ZwClose(HANDLE Handle ) ; -NTSTATUS ZwClose(HANDLE Handle ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS ZwClose(HANDLE Handle); +NTSTATUS ZwClose(HANDLE Handle) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_212_0; - } else { - { - goto switch_212_default; - if (0) { - switch_212_0: /* CIL Label */ ; - return (0L); - switch_212_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_212_0; } else { - switch_212_break: /* CIL Label */ ; - } + { + goto switch_212_default; + if (0) { + switch_212_0: /* CIL Label */; + return (0L); + switch_212_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_212_break: /* CIL Label */; + } + } } } } -} diff --git a/test/ntdrivers/floppy_true.i.cil.c b/test/ntdrivers/floppy_true.i.cil.c index dad723114..c9b9791fc 100644 --- a/test/ntdrivers/floppy_true.i.cil.c +++ b/test/ntdrivers/floppy_true.i.cil.c @@ -2,7 +2,6 @@ // @expect verified -extern void *malloc(unsigned long sz ); extern char __VERIFIER_nondet_char(void); extern int __VERIFIER_nondet_int(void); extern long __VERIFIER_nondet_long(void); @@ -10,11 +9,11 @@ extern void *__VERIFIER_nondet_pointer(void); /* Generated by CIL v. 1.3.6 */ /* print_CIL_Input is true */ -#pragma pack(push,8) +#pragma pack(push, 8) typedef unsigned int size_t; typedef unsigned short wchar_t; #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) typedef unsigned long ULONG_PTR; typedef unsigned long *PULONG_PTR; @@ -25,7 +24,7 @@ typedef short SHORT; typedef long LONG; typedef wchar_t WCHAR; typedef WCHAR *PWSTR; -typedef WCHAR const *PCWSTR; +typedef WCHAR const *PCWSTR; typedef CHAR *PCHAR; typedef LONG *PLONG; typedef unsigned char UCHAR; @@ -41,77 +40,74 @@ typedef ULONG LCID; typedef LONG NTSTATUS; typedef long long LONGLONG; struct __anonstruct____missing_field_name_1 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; struct __anonstruct_u_2 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; union _LARGE_INTEGER { - struct __anonstruct____missing_field_name_1 __annonCompField1 ; - struct __anonstruct_u_2 u ; - LONGLONG QuadPart ; + struct __anonstruct____missing_field_name_1 __annonCompField1; + struct __anonstruct_u_2 u; + LONGLONG QuadPart; }; typedef union _LARGE_INTEGER LARGE_INTEGER; typedef LARGE_INTEGER *PLARGE_INTEGER; struct _LUID { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; typedef struct _LUID LUID; typedef LARGE_INTEGER PHYSICAL_ADDRESS; -enum _EVENT_TYPE { - NotificationEvent = 0, - SynchronizationEvent = 1 -} ; +enum _EVENT_TYPE { NotificationEvent = 0, SynchronizationEvent = 1 }; typedef enum _EVENT_TYPE EVENT_TYPE; -typedef char const *PCSZ; +typedef char const *PCSZ; struct _STRING { - USHORT Length ; - USHORT MaximumLength ; - PCHAR Buffer ; + USHORT Length; + USHORT MaximumLength; + PCHAR Buffer; }; typedef struct _STRING STRING; typedef STRING *PSTRING; typedef PSTRING PANSI_STRING; struct _UNICODE_STRING { - USHORT Length ; - USHORT MaximumLength ; - PWSTR Buffer ; + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; }; typedef struct _UNICODE_STRING UNICODE_STRING; typedef UNICODE_STRING *PUNICODE_STRING; typedef UCHAR BOOLEAN; struct _LIST_ENTRY { - struct _LIST_ENTRY *Flink ; - struct _LIST_ENTRY *Blink ; + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; }; typedef struct _LIST_ENTRY LIST_ENTRY; typedef struct _LIST_ENTRY *PLIST_ENTRY; struct _OBJECT_ATTRIBUTES { - ULONG Length ; - HANDLE RootDirectory ; - PUNICODE_STRING ObjectName ; - ULONG Attributes ; - PVOID SecurityDescriptor ; - PVOID SecurityQualityOfService ; + ULONG Length; + HANDLE RootDirectory; + PUNICODE_STRING ObjectName; + ULONG Attributes; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; }; typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES; typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; struct _GUID { - unsigned long Data1 ; - unsigned short Data2 ; - unsigned short Data3 ; - unsigned char Data4[8] ; + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; }; typedef struct _GUID GUID; typedef UCHAR KIRQL; enum _NT_PRODUCT_TYPE { - NtProductWinNt = 1, - NtProductLanManNt = 2, - NtProductServer = 3 -} ; + NtProductWinNt = 1, + NtProductLanManNt = 2, + NtProductServer = 3 +}; typedef enum _NT_PRODUCT_TYPE NT_PRODUCT_TYPE; struct _KTHREAD; typedef struct _KTHREAD *PKTHREAD; @@ -126,82 +122,85 @@ typedef struct _OBJECT_TYPE *POBJECT_TYPE; typedef CCHAR KPROCESSOR_MODE; struct _KAPC; struct _KAPC; -typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ); +typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); struct _KAPC { - CSHORT Type ; - CSHORT Size ; - ULONG Spare0 ; - struct _KTHREAD *Thread ; - LIST_ENTRY ApcListEntry ; - void (*KernelRoutine)(struct _KAPC *Apc , PKNORMAL_ROUTINE *NormalRoutine , PVOID *NormalContext , - PVOID *SystemArgument1 , PVOID *SystemArgument2 ) ; - void (*RundownRoutine)(struct _KAPC *Apc ) ; - void (*NormalRoutine)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ) ; - PVOID NormalContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - CCHAR ApcStateIndex ; - KPROCESSOR_MODE ApcMode ; - BOOLEAN Inserted ; + CSHORT Type; + CSHORT Size; + ULONG Spare0; + struct _KTHREAD *Thread; + LIST_ENTRY ApcListEntry; + void (*KernelRoutine)(struct _KAPC *Apc, PKNORMAL_ROUTINE *NormalRoutine, + PVOID *NormalContext, PVOID *SystemArgument1, + PVOID *SystemArgument2); + void (*RundownRoutine)(struct _KAPC *Apc); + void (*NormalRoutine)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); + PVOID NormalContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + CCHAR ApcStateIndex; + KPROCESSOR_MODE ApcMode; + BOOLEAN Inserted; }; typedef struct _KAPC KAPC; struct _KDPC; struct _KDPC; struct _KDPC { - CSHORT Type ; - UCHAR Number ; - UCHAR Importance ; - LIST_ENTRY DpcListEntry ; - void (*DeferredRoutine)(struct _KDPC *Dpc , PVOID DeferredContext , PVOID SystemArgument1 , - PVOID SystemArgument2 ) ; - PVOID DeferredContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - PULONG_PTR Lock ; + CSHORT Type; + UCHAR Number; + UCHAR Importance; + LIST_ENTRY DpcListEntry; + void (*DeferredRoutine)(struct _KDPC *Dpc, PVOID DeferredContext, + PVOID SystemArgument1, PVOID SystemArgument2); + PVOID DeferredContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + PULONG_PTR Lock; }; typedef struct _KDPC KDPC; typedef struct _KDPC *PKDPC; struct _MDL { - struct _MDL *Next ; - CSHORT Size ; - CSHORT MdlFlags ; - struct _EPROCESS *Process ; - PVOID MappedSystemVa ; - PVOID StartVa ; - ULONG ByteCount ; - ULONG ByteOffset ; + struct _MDL *Next; + CSHORT Size; + CSHORT MdlFlags; + struct _EPROCESS *Process; + PVOID MappedSystemVa; + PVOID StartVa; + ULONG ByteCount; + ULONG ByteOffset; }; typedef struct _MDL MDL; typedef struct _MDL *PMDL; typedef PVOID PACCESS_TOKEN; typedef PVOID PSECURITY_DESCRIPTOR; typedef ULONG ACCESS_MASK; -#pragma pack(push,4) +#pragma pack(push, 4) struct _LUID_AND_ATTRIBUTES { - LUID Luid ; - ULONG Attributes ; + LUID Luid; + ULONG Attributes; }; typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES; #pragma pack(pop) struct _PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[1] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[1]; }; typedef struct _PRIVILEGE_SET PRIVILEGE_SET; enum _SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous = 0, - SecurityIdentification = 1, - SecurityImpersonation = 2, - SecurityDelegation = 3 -} ; + SecurityAnonymous = 0, + SecurityIdentification = 1, + SecurityImpersonation = 2, + SecurityDelegation = 3 +}; typedef enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL; typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE; struct _SECURITY_QUALITY_OF_SERVICE { - ULONG Length ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode ; - BOOLEAN EffectiveOnly ; + ULONG Length; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; + BOOLEAN EffectiveOnly; }; typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE; typedef ULONG SECURITY_INFORMATION; @@ -209,635 +208,632 @@ typedef LONG KPRIORITY; typedef ULONG_PTR KSPIN_LOCK; typedef KSPIN_LOCK *PKSPIN_LOCK; struct _RTL_QUERY_REGISTRY_TABLE { - NTSTATUS (*QueryRoutine)(PWSTR ValueName , ULONG ValueType , - PVOID ValueData , ULONG ValueLength , - PVOID Context , PVOID EntryContext ) ; - ULONG Flags ; - PWSTR Name ; - PVOID EntryContext ; - ULONG DefaultType ; - PVOID DefaultData ; - ULONG DefaultLength ; + NTSTATUS(*QueryRoutine) + (PWSTR ValueName, ULONG ValueType, PVOID ValueData, ULONG ValueLength, + PVOID Context, PVOID EntryContext); + ULONG Flags; + PWSTR Name; + PVOID EntryContext; + ULONG DefaultType; + PVOID DefaultData; + ULONG DefaultLength; }; typedef struct _RTL_QUERY_REGISTRY_TABLE RTL_QUERY_REGISTRY_TABLE; typedef struct _RTL_QUERY_REGISTRY_TABLE *PRTL_QUERY_REGISTRY_TABLE; union __anonunion____missing_field_name_6 { - NTSTATUS Status ; - PVOID Pointer ; + NTSTATUS Status; + PVOID Pointer; }; struct _IO_STATUS_BLOCK { - union __anonunion____missing_field_name_6 __annonCompField4 ; - ULONG_PTR Information ; + union __anonunion____missing_field_name_6 __annonCompField4; + ULONG_PTR Information; }; typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK; typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK; enum _FILE_INFORMATION_CLASS { - FileDirectoryInformation = 1, - FileFullDirectoryInformation = 2, - FileBothDirectoryInformation = 3, - FileBasicInformation = 4, - FileStandardInformation = 5, - FileInternalInformation = 6, - FileEaInformation = 7, - FileAccessInformation = 8, - FileNameInformation = 9, - FileRenameInformation = 10, - FileLinkInformation = 11, - FileNamesInformation = 12, - FileDispositionInformation = 13, - FilePositionInformation = 14, - FileFullEaInformation = 15, - FileModeInformation = 16, - FileAlignmentInformation = 17, - FileAllInformation = 18, - FileAllocationInformation = 19, - FileEndOfFileInformation = 20, - FileAlternateNameInformation = 21, - FileStreamInformation = 22, - FilePipeInformation = 23, - FilePipeLocalInformation = 24, - FilePipeRemoteInformation = 25, - FileMailslotQueryInformation = 26, - FileMailslotSetInformation = 27, - FileCompressionInformation = 28, - FileObjectIdInformation = 29, - FileCompletionInformation = 30, - FileMoveClusterInformation = 31, - FileQuotaInformation = 32, - FileReparsePointInformation = 33, - FileNetworkOpenInformation = 34, - FileAttributeTagInformation = 35, - FileTrackingInformation = 36, - FileMaximumInformation = 37 -} ; + FileDirectoryInformation = 1, + FileFullDirectoryInformation = 2, + FileBothDirectoryInformation = 3, + FileBasicInformation = 4, + FileStandardInformation = 5, + FileInternalInformation = 6, + FileEaInformation = 7, + FileAccessInformation = 8, + FileNameInformation = 9, + FileRenameInformation = 10, + FileLinkInformation = 11, + FileNamesInformation = 12, + FileDispositionInformation = 13, + FilePositionInformation = 14, + FileFullEaInformation = 15, + FileModeInformation = 16, + FileAlignmentInformation = 17, + FileAllInformation = 18, + FileAllocationInformation = 19, + FileEndOfFileInformation = 20, + FileAlternateNameInformation = 21, + FileStreamInformation = 22, + FilePipeInformation = 23, + FilePipeLocalInformation = 24, + FilePipeRemoteInformation = 25, + FileMailslotQueryInformation = 26, + FileMailslotSetInformation = 27, + FileCompressionInformation = 28, + FileObjectIdInformation = 29, + FileCompletionInformation = 30, + FileMoveClusterInformation = 31, + FileQuotaInformation = 32, + FileReparsePointInformation = 33, + FileNetworkOpenInformation = 34, + FileAttributeTagInformation = 35, + FileTrackingInformation = 36, + FileMaximumInformation = 37 +}; typedef enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS; struct _FILE_BASIC_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + ULONG FileAttributes; }; typedef struct _FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION; struct _FILE_STANDARD_INFORMATION { - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG NumberOfLinks ; - BOOLEAN DeletePending ; - BOOLEAN Directory ; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG NumberOfLinks; + BOOLEAN DeletePending; + BOOLEAN Directory; }; typedef struct _FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION; struct _FILE_NETWORK_OPEN_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG FileAttributes; }; typedef struct _FILE_NETWORK_OPEN_INFORMATION *PFILE_NETWORK_OPEN_INFORMATION; enum _FSINFOCLASS { - FileFsVolumeInformation = 1, - FileFsLabelInformation = 2, - FileFsSizeInformation = 3, - FileFsDeviceInformation = 4, - FileFsAttributeInformation = 5, - FileFsControlInformation = 6, - FileFsFullSizeInformation = 7, - FileFsObjectIdInformation = 8, - FileFsMaximumInformation = 9 -} ; + FileFsVolumeInformation = 1, + FileFsLabelInformation = 2, + FileFsSizeInformation = 3, + FileFsDeviceInformation = 4, + FileFsAttributeInformation = 5, + FileFsControlInformation = 6, + FileFsFullSizeInformation = 7, + FileFsObjectIdInformation = 8, + FileFsMaximumInformation = 9 +}; typedef enum _FSINFOCLASS FS_INFORMATION_CLASS; enum _INTERFACE_TYPE { - InterfaceTypeUndefined = -1, - Internal = 0, - Isa = 1, - Eisa = 2, - MicroChannel = 3, - TurboChannel = 4, - PCIBus = 5, - VMEBus = 6, - NuBus = 7, - PCMCIABus = 8, - CBus = 9, - MPIBus = 10, - MPSABus = 11, - ProcessorInternal = 12, - InternalPowerBus = 13, - PNPISABus = 14, - PNPBus = 15, - MaximumInterfaceType = 16 -} ; + InterfaceTypeUndefined = -1, + Internal = 0, + Isa = 1, + Eisa = 2, + MicroChannel = 3, + TurboChannel = 4, + PCIBus = 5, + VMEBus = 6, + NuBus = 7, + PCMCIABus = 8, + CBus = 9, + MPIBus = 10, + MPSABus = 11, + ProcessorInternal = 12, + InternalPowerBus = 13, + PNPISABus = 14, + PNPBus = 15, + MaximumInterfaceType = 16 +}; typedef enum _INTERFACE_TYPE INTERFACE_TYPE; typedef enum _INTERFACE_TYPE *PINTERFACE_TYPE; struct _KEY_VALUE_FULL_INFORMATION { - ULONG TitleIndex ; - ULONG Type ; - ULONG DataOffset ; - ULONG DataLength ; - ULONG NameLength ; - WCHAR Name[1] ; + ULONG TitleIndex; + ULONG Type; + ULONG DataOffset; + ULONG DataLength; + ULONG NameLength; + WCHAR Name[1]; }; typedef struct _KEY_VALUE_FULL_INFORMATION *PKEY_VALUE_FULL_INFORMATION; struct _CLIENT_ID { - HANDLE UniqueProcess ; - HANDLE UniqueThread ; + HANDLE UniqueProcess; + HANDLE UniqueThread; }; typedef struct _CLIENT_ID CLIENT_ID; typedef CLIENT_ID *PCLIENT_ID; enum _SYSTEM_POWER_STATE { - PowerSystemUnspecified = 0, - PowerSystemWorking = 1, - PowerSystemSleeping1 = 2, - PowerSystemSleeping2 = 3, - PowerSystemSleeping3 = 4, - PowerSystemHibernate = 5, - PowerSystemShutdown = 6, - PowerSystemMaximum = 7 -} ; + PowerSystemUnspecified = 0, + PowerSystemWorking = 1, + PowerSystemSleeping1 = 2, + PowerSystemSleeping2 = 3, + PowerSystemSleeping3 = 4, + PowerSystemHibernate = 5, + PowerSystemShutdown = 6, + PowerSystemMaximum = 7 +}; typedef enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE; enum __anonenum_POWER_ACTION_11 { - PowerActionNone = 0, - PowerActionReserved = 1, - PowerActionSleep = 2, - PowerActionHibernate = 3, - PowerActionShutdown = 4, - PowerActionShutdownReset = 5, - PowerActionShutdownOff = 6, - PowerActionWarmEject = 7 -} ; + PowerActionNone = 0, + PowerActionReserved = 1, + PowerActionSleep = 2, + PowerActionHibernate = 3, + PowerActionShutdown = 4, + PowerActionShutdownReset = 5, + PowerActionShutdownOff = 6, + PowerActionWarmEject = 7 +}; typedef enum __anonenum_POWER_ACTION_11 POWER_ACTION; enum _DEVICE_POWER_STATE { - PowerDeviceUnspecified = 0, - PowerDeviceD0 = 1, - PowerDeviceD1 = 2, - PowerDeviceD2 = 3, - PowerDeviceD3 = 4, - PowerDeviceMaximum = 5 -} ; + PowerDeviceUnspecified = 0, + PowerDeviceD0 = 1, + PowerDeviceD1 = 2, + PowerDeviceD2 = 3, + PowerDeviceD3 = 4, + PowerDeviceMaximum = 5 +}; typedef enum _DEVICE_POWER_STATE DEVICE_POWER_STATE; union _POWER_STATE { - SYSTEM_POWER_STATE SystemState ; - DEVICE_POWER_STATE DeviceState ; + SYSTEM_POWER_STATE SystemState; + DEVICE_POWER_STATE DeviceState; }; typedef union _POWER_STATE POWER_STATE; -enum _POWER_STATE_TYPE { - SystemPowerState = 0, - DevicePowerState = 1 -} ; +enum _POWER_STATE_TYPE { SystemPowerState = 0, DevicePowerState = 1 }; typedef enum _POWER_STATE_TYPE POWER_STATE_TYPE; struct _KSYSTEM_TIME { - ULONG LowPart ; - LONG High1Time ; - LONG High2Time ; + ULONG LowPart; + LONG High1Time; + LONG High2Time; }; typedef struct _KSYSTEM_TIME KSYSTEM_TIME; enum _ALTERNATIVE_ARCHITECTURE_TYPE { - StandardDesign = 0, - NEC98x86 = 1, - EndAlternatives = 2 -} ; + StandardDesign = 0, + NEC98x86 = 1, + EndAlternatives = 2 +}; typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE ALTERNATIVE_ARCHITECTURE_TYPE; struct _KUSER_SHARED_DATA { - ULONG volatile TickCountLow ; - ULONG TickCountMultiplier ; - KSYSTEM_TIME volatile InterruptTime ; - KSYSTEM_TIME volatile SystemTime ; - KSYSTEM_TIME volatile TimeZoneBias ; - USHORT ImageNumberLow ; - USHORT ImageNumberHigh ; - WCHAR NtSystemRoot[260] ; - ULONG MaxStackTraceDepth ; - ULONG CryptoExponent ; - ULONG TimeZoneId ; - ULONG Reserved2[8] ; - NT_PRODUCT_TYPE NtProductType ; - BOOLEAN ProductTypeIsValid ; - ULONG NtMajorVersion ; - ULONG NtMinorVersion ; - BOOLEAN ProcessorFeatures[64] ; - ULONG Reserved1 ; - ULONG Reserved3 ; - ULONG volatile TimeSlip ; - ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture ; - LARGE_INTEGER SystemExpirationDate ; - ULONG SuiteMask ; - BOOLEAN KdDebuggerEnabled ; + ULONG volatile TickCountLow; + ULONG TickCountMultiplier; + KSYSTEM_TIME volatile InterruptTime; + KSYSTEM_TIME volatile SystemTime; + KSYSTEM_TIME volatile TimeZoneBias; + USHORT ImageNumberLow; + USHORT ImageNumberHigh; + WCHAR NtSystemRoot[260]; + ULONG MaxStackTraceDepth; + ULONG CryptoExponent; + ULONG TimeZoneId; + ULONG Reserved2[8]; + NT_PRODUCT_TYPE NtProductType; + BOOLEAN ProductTypeIsValid; + ULONG NtMajorVersion; + ULONG NtMinorVersion; + BOOLEAN ProcessorFeatures[64]; + ULONG Reserved1; + ULONG Reserved3; + ULONG volatile TimeSlip; + ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture; + LARGE_INTEGER SystemExpirationDate; + ULONG SuiteMask; + BOOLEAN KdDebuggerEnabled; }; typedef struct _KUSER_SHARED_DATA KUSER_SHARED_DATA; typedef PVOID PASSIGNED_RESOURCE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Generic_16 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Port_17 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Interrupt_18 { - ULONG Level ; - ULONG Vector ; - ULONG Affinity ; + ULONG Level; + ULONG Vector; + ULONG Affinity; }; struct __anonstruct_Memory_19 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Dma_20 { - ULONG Channel ; - ULONG Port ; - ULONG Reserved1 ; + ULONG Channel; + ULONG Port; + ULONG Reserved1; }; struct __anonstruct_DevicePrivate_21 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_22 { - ULONG Start ; - ULONG Length ; - ULONG Reserved ; + ULONG Start; + ULONG Length; + ULONG Reserved; }; struct __anonstruct_DeviceSpecificData_23 { - ULONG DataSize ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG DataSize; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_15 { - struct __anonstruct_Generic_16 Generic ; - struct __anonstruct_Port_17 Port ; - struct __anonstruct_Interrupt_18 Interrupt ; - struct __anonstruct_Memory_19 Memory ; - struct __anonstruct_Dma_20 Dma ; - struct __anonstruct_DevicePrivate_21 DevicePrivate ; - struct __anonstruct_BusNumber_22 BusNumber ; - struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData ; + struct __anonstruct_Generic_16 Generic; + struct __anonstruct_Port_17 Port; + struct __anonstruct_Interrupt_18 Interrupt; + struct __anonstruct_Memory_19 Memory; + struct __anonstruct_Dma_20 Dma; + struct __anonstruct_DevicePrivate_21 DevicePrivate; + struct __anonstruct_BusNumber_22 BusNumber; + struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData; }; struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { - UCHAR Type ; - UCHAR ShareDisposition ; - USHORT Flags ; - union __anonunion_u_15 u ; + UCHAR Type; + UCHAR ShareDisposition; + USHORT Flags; + union __anonunion_u_15 u; }; typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR; typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR *PCM_PARTIAL_RESOURCE_DESCRIPTOR; #pragma pack(pop) struct _CM_PARTIAL_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; }; typedef struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST; struct _CM_FULL_RESOURCE_DESCRIPTOR { - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - CM_PARTIAL_RESOURCE_LIST PartialResourceList ; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; }; typedef struct _CM_FULL_RESOURCE_DESCRIPTOR CM_FULL_RESOURCE_DESCRIPTOR; typedef struct _CM_FULL_RESOURCE_DESCRIPTOR *PCM_FULL_RESOURCE_DESCRIPTOR; struct _CM_RESOURCE_LIST { - ULONG Count ; - CM_FULL_RESOURCE_DESCRIPTOR List[1] ; + ULONG Count; + CM_FULL_RESOURCE_DESCRIPTOR List[1]; }; typedef struct _CM_RESOURCE_LIST *PCM_RESOURCE_LIST; -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _CM_FLOPPY_DEVICE_DATA { - USHORT Version ; - USHORT Revision ; - CHAR Size[8] ; - ULONG MaxDensity ; - ULONG MountDensity ; - UCHAR StepRateHeadUnloadTime ; - UCHAR HeadLoadTime ; - UCHAR MotorOffTime ; - UCHAR SectorLengthCode ; - UCHAR SectorPerTrack ; - UCHAR ReadWriteGapLength ; - UCHAR DataTransferLength ; - UCHAR FormatGapLength ; - UCHAR FormatFillCharacter ; - UCHAR HeadSettleTime ; - UCHAR MotorSettleTime ; - UCHAR MaximumTrackValue ; - UCHAR DataTransferRate ; + USHORT Version; + USHORT Revision; + CHAR Size[8]; + ULONG MaxDensity; + ULONG MountDensity; + UCHAR StepRateHeadUnloadTime; + UCHAR HeadLoadTime; + UCHAR MotorOffTime; + UCHAR SectorLengthCode; + UCHAR SectorPerTrack; + UCHAR ReadWriteGapLength; + UCHAR DataTransferLength; + UCHAR FormatGapLength; + UCHAR FormatFillCharacter; + UCHAR HeadSettleTime; + UCHAR MotorSettleTime; + UCHAR MaximumTrackValue; + UCHAR DataTransferRate; }; typedef struct _CM_FLOPPY_DEVICE_DATA *PCM_FLOPPY_DEVICE_DATA; struct __anonstruct_Port_25 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Memory_26 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Interrupt_27 { - ULONG MinimumVector ; - ULONG MaximumVector ; + ULONG MinimumVector; + ULONG MaximumVector; }; struct __anonstruct_Dma_28 { - ULONG MinimumChannel ; - ULONG MaximumChannel ; + ULONG MinimumChannel; + ULONG MaximumChannel; }; struct __anonstruct_Generic_29 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_DevicePrivate_30 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_31 { - ULONG Length ; - ULONG MinBusNumber ; - ULONG MaxBusNumber ; - ULONG Reserved ; + ULONG Length; + ULONG MinBusNumber; + ULONG MaxBusNumber; + ULONG Reserved; }; struct __anonstruct_AssignedResource_32 { - PASSIGNED_RESOURCE AssignedResource ; + PASSIGNED_RESOURCE AssignedResource; }; struct __anonstruct_SubAllocateFrom_33 { - UCHAR Type ; - UCHAR Reserved[3] ; - PASSIGNED_RESOURCE AssignedResource ; - PHYSICAL_ADDRESS Transformation ; + UCHAR Type; + UCHAR Reserved[3]; + PASSIGNED_RESOURCE AssignedResource; + PHYSICAL_ADDRESS Transformation; }; struct __anonstruct_ConfigData_34 { - ULONG Priority ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG Priority; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_24 { - struct __anonstruct_Port_25 Port ; - struct __anonstruct_Memory_26 Memory ; - struct __anonstruct_Interrupt_27 Interrupt ; - struct __anonstruct_Dma_28 Dma ; - struct __anonstruct_Generic_29 Generic ; - struct __anonstruct_DevicePrivate_30 DevicePrivate ; - struct __anonstruct_BusNumber_31 BusNumber ; - struct __anonstruct_AssignedResource_32 AssignedResource ; - struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom ; - struct __anonstruct_ConfigData_34 ConfigData ; + struct __anonstruct_Port_25 Port; + struct __anonstruct_Memory_26 Memory; + struct __anonstruct_Interrupt_27 Interrupt; + struct __anonstruct_Dma_28 Dma; + struct __anonstruct_Generic_29 Generic; + struct __anonstruct_DevicePrivate_30 DevicePrivate; + struct __anonstruct_BusNumber_31 BusNumber; + struct __anonstruct_AssignedResource_32 AssignedResource; + struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom; + struct __anonstruct_ConfigData_34 ConfigData; }; struct _IO_RESOURCE_DESCRIPTOR { - UCHAR Option ; - UCHAR Type ; - UCHAR ShareDisposition ; - UCHAR Spare1 ; - USHORT Flags ; - USHORT Spare2 ; - union __anonunion_u_24 u ; + UCHAR Option; + UCHAR Type; + UCHAR ShareDisposition; + UCHAR Spare1; + USHORT Flags; + USHORT Spare2; + union __anonunion_u_24 u; }; typedef struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR; struct _IO_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - IO_RESOURCE_DESCRIPTOR Descriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + IO_RESOURCE_DESCRIPTOR Descriptors[1]; }; typedef struct _IO_RESOURCE_LIST IO_RESOURCE_LIST; struct _IO_RESOURCE_REQUIREMENTS_LIST { - ULONG ListSize ; - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - ULONG SlotNumber ; - ULONG Reserved[3] ; - ULONG AlternativeLists ; - IO_RESOURCE_LIST List[1] ; + ULONG ListSize; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + ULONG SlotNumber; + ULONG Reserved[3]; + ULONG AlternativeLists; + IO_RESOURCE_LIST List[1]; }; typedef struct _IO_RESOURCE_REQUIREMENTS_LIST *PIO_RESOURCE_REQUIREMENTS_LIST; enum _CONFIGURATION_TYPE { - ArcSystem = 0, - CentralProcessor = 1, - FloatingPointProcessor = 2, - PrimaryIcache = 3, - PrimaryDcache = 4, - SecondaryIcache = 5, - SecondaryDcache = 6, - SecondaryCache = 7, - EisaAdapter = 8, - TcAdapter = 9, - ScsiAdapter = 10, - DtiAdapter = 11, - MultiFunctionAdapter = 12, - DiskController = 13, - TapeController = 14, - CdromController = 15, - WormController = 16, - SerialController = 17, - NetworkController = 18, - DisplayController = 19, - ParallelController = 20, - PointerController = 21, - KeyboardController = 22, - AudioController = 23, - OtherController = 24, - DiskPeripheral = 25, - FloppyDiskPeripheral = 26, - TapePeripheral = 27, - ModemPeripheral = 28, - MonitorPeripheral = 29, - PrinterPeripheral = 30, - PointerPeripheral = 31, - KeyboardPeripheral = 32, - TerminalPeripheral = 33, - OtherPeripheral = 34, - LinePeripheral = 35, - NetworkPeripheral = 36, - SystemMemory = 37, - DockingInformation = 38, - RealModeIrqRoutingTable = 39, - MaximumType = 40 -} ; + ArcSystem = 0, + CentralProcessor = 1, + FloatingPointProcessor = 2, + PrimaryIcache = 3, + PrimaryDcache = 4, + SecondaryIcache = 5, + SecondaryDcache = 6, + SecondaryCache = 7, + EisaAdapter = 8, + TcAdapter = 9, + ScsiAdapter = 10, + DtiAdapter = 11, + MultiFunctionAdapter = 12, + DiskController = 13, + TapeController = 14, + CdromController = 15, + WormController = 16, + SerialController = 17, + NetworkController = 18, + DisplayController = 19, + ParallelController = 20, + PointerController = 21, + KeyboardController = 22, + AudioController = 23, + OtherController = 24, + DiskPeripheral = 25, + FloppyDiskPeripheral = 26, + TapePeripheral = 27, + ModemPeripheral = 28, + MonitorPeripheral = 29, + PrinterPeripheral = 30, + PointerPeripheral = 31, + KeyboardPeripheral = 32, + TerminalPeripheral = 33, + OtherPeripheral = 34, + LinePeripheral = 35, + NetworkPeripheral = 36, + SystemMemory = 37, + DockingInformation = 38, + RealModeIrqRoutingTable = 39, + MaximumType = 40 +}; typedef enum _CONFIGURATION_TYPE CONFIGURATION_TYPE; typedef enum _CONFIGURATION_TYPE *PCONFIGURATION_TYPE; enum _KWAIT_REASON { - Executive = 0, - FreePage = 1, - PageIn = 2, - PoolAllocation = 3, - DelayExecution = 4, - Suspended = 5, - UserRequest = 6, - WrExecutive = 7, - WrFreePage = 8, - WrPageIn = 9, - WrPoolAllocation = 10, - WrDelayExecution = 11, - WrSuspended = 12, - WrUserRequest = 13, - WrEventPair = 14, - WrQueue = 15, - WrLpcReceive = 16, - WrLpcReply = 17, - WrVirtualMemory = 18, - WrPageOut = 19, - WrRendezvous = 20, - Spare2 = 21, - Spare3 = 22, - Spare4 = 23, - Spare5 = 24, - Spare6 = 25, - WrKernel = 26, - MaximumWaitReason = 27 -} ; + Executive = 0, + FreePage = 1, + PageIn = 2, + PoolAllocation = 3, + DelayExecution = 4, + Suspended = 5, + UserRequest = 6, + WrExecutive = 7, + WrFreePage = 8, + WrPageIn = 9, + WrPoolAllocation = 10, + WrDelayExecution = 11, + WrSuspended = 12, + WrUserRequest = 13, + WrEventPair = 14, + WrQueue = 15, + WrLpcReceive = 16, + WrLpcReply = 17, + WrVirtualMemory = 18, + WrPageOut = 19, + WrRendezvous = 20, + Spare2 = 21, + Spare3 = 22, + Spare4 = 23, + Spare5 = 24, + Spare6 = 25, + WrKernel = 26, + MaximumWaitReason = 27 +}; typedef enum _KWAIT_REASON KWAIT_REASON; struct _DISPATCHER_HEADER { - UCHAR Type ; - UCHAR Absolute ; - UCHAR Size ; - UCHAR Inserted ; - LONG SignalState ; - LIST_ENTRY WaitListHead ; + UCHAR Type; + UCHAR Absolute; + UCHAR Size; + UCHAR Inserted; + LONG SignalState; + LIST_ENTRY WaitListHead; }; typedef struct _DISPATCHER_HEADER DISPATCHER_HEADER; struct _KDEVICE_QUEUE { - CSHORT Type ; - CSHORT Size ; - LIST_ENTRY DeviceListHead ; - KSPIN_LOCK Lock ; - BOOLEAN Busy ; + CSHORT Type; + CSHORT Size; + LIST_ENTRY DeviceListHead; + KSPIN_LOCK Lock; + BOOLEAN Busy; }; typedef struct _KDEVICE_QUEUE KDEVICE_QUEUE; struct _KDEVICE_QUEUE_ENTRY { - LIST_ENTRY DeviceListEntry ; - ULONG SortKey ; - BOOLEAN Inserted ; + LIST_ENTRY DeviceListEntry; + ULONG SortKey; + BOOLEAN Inserted; }; typedef struct _KDEVICE_QUEUE_ENTRY KDEVICE_QUEUE_ENTRY; struct _KEVENT { - DISPATCHER_HEADER Header ; + DISPATCHER_HEADER Header; }; typedef struct _KEVENT KEVENT; typedef struct _KEVENT *PKEVENT; typedef struct _KEVENT *PRKEVENT; struct _KSEMAPHORE { - DISPATCHER_HEADER Header ; - LONG Limit ; + DISPATCHER_HEADER Header; + LONG Limit; }; typedef struct _KSEMAPHORE KSEMAPHORE; typedef struct _KSEMAPHORE *PKSEMAPHORE; typedef struct _KSEMAPHORE *PRKSEMAPHORE; enum _MEMORY_CACHING_TYPE { - MmNonCached = 0, - MmCached = 1, - MmWriteCombined = 2, - MmHardwareCoherentCached = 3, - MmNonCachedUnordered = 4, - MmUSWCCached = 5, - MmMaximumCacheType = 6 -} ; + MmNonCached = 0, + MmCached = 1, + MmWriteCombined = 2, + MmHardwareCoherentCached = 3, + MmNonCachedUnordered = 4, + MmUSWCCached = 5, + MmMaximumCacheType = 6 +}; typedef enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE; enum _POOL_TYPE { - NonPagedPool = 0, - PagedPool = 1, - NonPagedPoolMustSucceed = 2, - DontUseThisType = 3, - NonPagedPoolCacheAligned = 4, - PagedPoolCacheAligned = 5, - NonPagedPoolCacheAlignedMustS = 6, - MaxPoolType = 7, - NonPagedPoolSession = 32, - PagedPoolSession = 33, - NonPagedPoolMustSucceedSession = 34, - DontUseThisTypeSession = 35, - NonPagedPoolCacheAlignedSession = 36, - PagedPoolCacheAlignedSession = 37, - NonPagedPoolCacheAlignedMustSSession = 38 -} ; + NonPagedPool = 0, + PagedPool = 1, + NonPagedPoolMustSucceed = 2, + DontUseThisType = 3, + NonPagedPoolCacheAligned = 4, + PagedPoolCacheAligned = 5, + NonPagedPoolCacheAlignedMustS = 6, + MaxPoolType = 7, + NonPagedPoolSession = 32, + PagedPoolSession = 33, + NonPagedPoolMustSucceedSession = 34, + DontUseThisTypeSession = 35, + NonPagedPoolCacheAlignedSession = 36, + PagedPoolCacheAlignedSession = 37, + NonPagedPoolCacheAlignedMustSSession = 38 +}; typedef enum _POOL_TYPE POOL_TYPE; struct _FAST_MUTEX { - LONG Count ; - PKTHREAD Owner ; - ULONG Contention ; - KEVENT Event ; - ULONG OldIrql ; + LONG Count; + PKTHREAD Owner; + ULONG Contention; + KEVENT Event; + ULONG OldIrql; }; typedef struct _FAST_MUTEX FAST_MUTEX; typedef struct _FAST_MUTEX *PFAST_MUTEX; typedef ULONG_PTR ERESOURCE_THREAD; union __anonunion____missing_field_name_38 { - LONG OwnerCount ; - ULONG TableSize ; + LONG OwnerCount; + ULONG TableSize; }; struct _OWNER_ENTRY { - ERESOURCE_THREAD OwnerThread ; - union __anonunion____missing_field_name_38 __annonCompField10 ; + ERESOURCE_THREAD OwnerThread; + union __anonunion____missing_field_name_38 __annonCompField10; }; typedef struct _OWNER_ENTRY OWNER_ENTRY; typedef struct _OWNER_ENTRY *POWNER_ENTRY; union __anonunion____missing_field_name_39 { - PVOID Address ; - ULONG_PTR CreatorBackTraceIndex ; + PVOID Address; + ULONG_PTR CreatorBackTraceIndex; }; struct _ERESOURCE { - LIST_ENTRY SystemResourcesList ; - POWNER_ENTRY OwnerTable ; - SHORT ActiveCount ; - USHORT Flag ; - PKSEMAPHORE SharedWaiters ; - PKEVENT ExclusiveWaiters ; - OWNER_ENTRY OwnerThreads[2] ; - ULONG ContentionCount ; - USHORT NumberOfSharedWaiters ; - USHORT NumberOfExclusiveWaiters ; - union __anonunion____missing_field_name_39 __annonCompField11 ; - KSPIN_LOCK SpinLock ; + LIST_ENTRY SystemResourcesList; + POWNER_ENTRY OwnerTable; + SHORT ActiveCount; + USHORT Flag; + PKSEMAPHORE SharedWaiters; + PKEVENT ExclusiveWaiters; + OWNER_ENTRY OwnerThreads[2]; + ULONG ContentionCount; + USHORT NumberOfSharedWaiters; + USHORT NumberOfExclusiveWaiters; + union __anonunion____missing_field_name_39 __annonCompField11; + KSPIN_LOCK SpinLock; }; enum _LOCK_OPERATION { - IoReadAccess = 0, - IoWriteAccess = 1, - IoModifyAccess = 2 -} ; + IoReadAccess = 0, + IoWriteAccess = 1, + IoModifyAccess = 2 +}; typedef enum _LOCK_OPERATION LOCK_OPERATION; enum _MM_PAGE_PRIORITY { - LowPagePriority = 0, - NormalPagePriority = 16, - HighPagePriority = 32 -} ; + LowPagePriority = 0, + NormalPagePriority = 16, + HighPagePriority = 32 +}; typedef enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY; struct _DRIVER_OBJECT; struct _DRIVER_OBJECT; struct _SECURITY_SUBJECT_CONTEXT { - PACCESS_TOKEN ClientToken ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - PACCESS_TOKEN PrimaryToken ; - PVOID ProcessAuditId ; + PACCESS_TOKEN ClientToken; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + PACCESS_TOKEN PrimaryToken; + PVOID ProcessAuditId; }; typedef struct _SECURITY_SUBJECT_CONTEXT SECURITY_SUBJECT_CONTEXT; struct _INITIAL_PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[3] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[3]; }; typedef struct _INITIAL_PRIVILEGE_SET INITIAL_PRIVILEGE_SET; union __anonunion_Privileges_40 { - INITIAL_PRIVILEGE_SET InitialPrivilegeSet ; - PRIVILEGE_SET PrivilegeSet ; + INITIAL_PRIVILEGE_SET InitialPrivilegeSet; + PRIVILEGE_SET PrivilegeSet; }; struct _ACCESS_STATE { - LUID OperationID ; - BOOLEAN SecurityEvaluated ; - BOOLEAN GenerateAudit ; - BOOLEAN GenerateOnClose ; - BOOLEAN PrivilegesAllocated ; - ULONG Flags ; - ACCESS_MASK RemainingDesiredAccess ; - ACCESS_MASK PreviouslyGrantedAccess ; - ACCESS_MASK OriginalDesiredAccess ; - SECURITY_SUBJECT_CONTEXT SubjectSecurityContext ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - PVOID AuxData ; - union __anonunion_Privileges_40 Privileges ; - BOOLEAN AuditPrivileges ; - UNICODE_STRING ObjectName ; - UNICODE_STRING ObjectTypeName ; + LUID OperationID; + BOOLEAN SecurityEvaluated; + BOOLEAN GenerateAudit; + BOOLEAN GenerateOnClose; + BOOLEAN PrivilegesAllocated; + ULONG Flags; + ACCESS_MASK RemainingDesiredAccess; + ACCESS_MASK PreviouslyGrantedAccess; + ACCESS_MASK OriginalDesiredAccess; + SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PVOID AuxData; + union __anonunion_Privileges_40 Privileges; + BOOLEAN AuditPrivileges; + UNICODE_STRING ObjectName; + UNICODE_STRING ObjectTypeName; }; typedef struct _ACCESS_STATE *PACCESS_STATE; struct _DEVICE_OBJECT; @@ -849,876 +845,907 @@ struct _IRP; struct _IRP; struct _SCSI_REQUEST_BLOCK; struct _SCSI_REQUEST_BLOCK; -typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ); +typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp); struct _COMPRESSED_DATA_INFO; struct _FAST_IO_DISPATCH { - ULONG SizeOfFastIoDispatch ; - BOOLEAN (*FastIoCheckIfPossible)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , - BOOLEAN CheckForReadOperation , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryBasicInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_BASIC_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryStandardInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_STANDARD_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoLock)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - BOOLEAN FailImmediately , BOOLEAN ExclusiveLock , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockSingle)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAll)(struct _FILE_OBJECT *FileObject , PEPROCESS ProcessId , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAllByKey)(struct _FILE_OBJECT *FileObject , PVOID ProcessId , - ULONG Key , PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoDeviceControl)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , ULONG IoControlCode , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice , struct _DEVICE_OBJECT *TargetDevice ) ; - BOOLEAN (*FastIoQueryNetworkOpenInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - struct _FILE_NETWORK_OPEN_INFORMATION *Buffer , - struct _IO_STATUS_BLOCK *IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForModWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER EndingOffset , - struct _ERESOURCE **ResourceToRelease , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadComplete)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*PrepareMdlWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteComplete)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoReadCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , PMDL *MdlChain , - PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWriteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , - PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadCompleteCompressed)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteCompleteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryOpen)(struct _IRP *Irp , PFILE_NETWORK_OPEN_INFORMATION NetworkInformation , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForModWrite)(struct _FILE_OBJECT *FileObject , struct _ERESOURCE *ResourceToRelease , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; + ULONG SizeOfFastIoDispatch; + BOOLEAN(*FastIoCheckIfPossible) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, BOOLEAN CheckForReadOperation, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryBasicInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_BASIC_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryStandardInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_STANDARD_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoLock) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + BOOLEAN FailImmediately, BOOLEAN ExclusiveLock, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockSingle) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAll) + (struct _FILE_OBJECT *FileObject, PEPROCESS ProcessId, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAllByKey) + (struct _FILE_OBJECT *FileObject, PVOID ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoDeviceControl) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, PVOID InputBuffer, + ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength, + ULONG IoControlCode, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice, + struct _DEVICE_OBJECT *TargetDevice); + BOOLEAN(*FastIoQueryNetworkOpenInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + struct _FILE_NETWORK_OPEN_INFORMATION *Buffer, + struct _IO_STATUS_BLOCK *IoStatus, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForModWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER EndingOffset, + struct _ERESOURCE **ResourceToRelease, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadComplete) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*PrepareMdlWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteComplete) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoReadCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWriteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryOpen) + (struct _IRP *Irp, PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForModWrite) + (struct _FILE_OBJECT *FileObject, struct _ERESOURCE *ResourceToRelease, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); }; typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH; enum _IO_ALLOCATION_ACTION { - KeepObject = 1, - DeallocateObject = 2, - DeallocateObjectKeepRegisters = 3 -} ; + KeepObject = 1, + DeallocateObject = 2, + DeallocateObjectKeepRegisters = 3 +}; typedef enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION; struct _IO_SECURITY_CONTEXT { - PSECURITY_QUALITY_OF_SERVICE SecurityQos ; - PACCESS_STATE AccessState ; - ACCESS_MASK DesiredAccess ; - ULONG FullCreateOptions ; + PSECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_STATE AccessState; + ACCESS_MASK DesiredAccess; + ULONG FullCreateOptions; }; typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT; struct _VPB { - CSHORT Type ; - CSHORT Size ; - USHORT Flags ; - USHORT VolumeLabelLength ; - struct _DEVICE_OBJECT *DeviceObject ; - struct _DEVICE_OBJECT *RealDevice ; - ULONG SerialNumber ; - ULONG ReferenceCount ; - WCHAR VolumeLabel[(32U * sizeof(WCHAR )) / sizeof(WCHAR )] ; + CSHORT Type; + CSHORT Size; + USHORT Flags; + USHORT VolumeLabelLength; + struct _DEVICE_OBJECT *DeviceObject; + struct _DEVICE_OBJECT *RealDevice; + ULONG SerialNumber; + ULONG ReferenceCount; + WCHAR VolumeLabel[(32U * sizeof(WCHAR)) / sizeof(WCHAR)]; }; typedef struct _VPB *PVPB; struct _WAIT_CONTEXT_BLOCK { - KDEVICE_QUEUE_ENTRY WaitQueueEntry ; - IO_ALLOCATION_ACTION (*DeviceRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp , - PVOID MapRegisterBase , PVOID Context ) ; - PVOID DeviceContext ; - ULONG NumberOfMapRegisters ; - PVOID DeviceObject ; - PVOID CurrentIrp ; - PKDPC BufferChainingDpc ; + KDEVICE_QUEUE_ENTRY WaitQueueEntry; + IO_ALLOCATION_ACTION(*DeviceRoutine) + (struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp, PVOID MapRegisterBase, + PVOID Context); + PVOID DeviceContext; + ULONG NumberOfMapRegisters; + PVOID DeviceObject; + PVOID CurrentIrp; + PKDPC BufferChainingDpc; }; typedef struct _WAIT_CONTEXT_BLOCK WAIT_CONTEXT_BLOCK; union __anonunion_Queue_43 { - LIST_ENTRY ListEntry ; - WAIT_CONTEXT_BLOCK Wcb ; + LIST_ENTRY ListEntry; + WAIT_CONTEXT_BLOCK Wcb; }; struct _DEVOBJ_EXTENSION; struct _DEVICE_OBJECT { - CSHORT Type ; - USHORT Size ; - LONG ReferenceCount ; - struct _DRIVER_OBJECT *DriverObject ; - struct _DEVICE_OBJECT *NextDevice ; - struct _DEVICE_OBJECT *AttachedDevice ; - struct _IRP *CurrentIrp ; - PIO_TIMER Timer ; - ULONG Flags ; - ULONG Characteristics ; - PVPB Vpb ; - PVOID DeviceExtension ; - ULONG DeviceType ; - CCHAR StackSize ; - union __anonunion_Queue_43 Queue ; - ULONG AlignmentRequirement ; - KDEVICE_QUEUE DeviceQueue ; - KDPC Dpc ; - ULONG ActiveThreadCount ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - KEVENT DeviceLock ; - USHORT SectorSize ; - USHORT Spare1 ; - struct _DEVOBJ_EXTENSION *DeviceObjectExtension ; - PVOID Reserved ; + CSHORT Type; + USHORT Size; + LONG ReferenceCount; + struct _DRIVER_OBJECT *DriverObject; + struct _DEVICE_OBJECT *NextDevice; + struct _DEVICE_OBJECT *AttachedDevice; + struct _IRP *CurrentIrp; + PIO_TIMER Timer; + ULONG Flags; + ULONG Characteristics; + PVPB Vpb; + PVOID DeviceExtension; + ULONG DeviceType; + CCHAR StackSize; + union __anonunion_Queue_43 Queue; + ULONG AlignmentRequirement; + KDEVICE_QUEUE DeviceQueue; + KDPC Dpc; + ULONG ActiveThreadCount; + PSECURITY_DESCRIPTOR SecurityDescriptor; + KEVENT DeviceLock; + USHORT SectorSize; + USHORT Spare1; + struct _DEVOBJ_EXTENSION *DeviceObjectExtension; + PVOID Reserved; }; typedef struct _DEVICE_OBJECT DEVICE_OBJECT; typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; struct _DEVOBJ_EXTENSION { - CSHORT Type ; - USHORT Size ; - PDEVICE_OBJECT DeviceObject ; + CSHORT Type; + USHORT Size; + PDEVICE_OBJECT DeviceObject; }; struct _DRIVER_EXTENSION { - struct _DRIVER_OBJECT *DriverObject ; - NTSTATUS (*AddDevice)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ; - ULONG Count ; - UNICODE_STRING ServiceKeyName ; + struct _DRIVER_OBJECT *DriverObject; + NTSTATUS(*AddDevice) + (struct _DRIVER_OBJECT *DriverObject, + struct _DEVICE_OBJECT *PhysicalDeviceObject); + ULONG Count; + UNICODE_STRING ServiceKeyName; }; typedef struct _DRIVER_EXTENSION *PDRIVER_EXTENSION; struct _DRIVER_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - ULONG Flags ; - PVOID DriverStart ; - ULONG DriverSize ; - PVOID DriverSection ; - PDRIVER_EXTENSION DriverExtension ; - UNICODE_STRING DriverName ; - PUNICODE_STRING HardwareDatabase ; - PFAST_IO_DISPATCH FastIoDispatch ; - NTSTATUS (*DriverInit)(struct _DRIVER_OBJECT *DriverObject , PUNICODE_STRING RegistryPath ) ; - void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject ) ; - PDRIVER_DISPATCH MajorFunction[28] ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + PVOID DriverStart; + ULONG DriverSize; + PVOID DriverSection; + PDRIVER_EXTENSION DriverExtension; + UNICODE_STRING DriverName; + PUNICODE_STRING HardwareDatabase; + PFAST_IO_DISPATCH FastIoDispatch; + NTSTATUS(*DriverInit) + (struct _DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath); + void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject); + PDRIVER_DISPATCH MajorFunction[28]; }; typedef struct _DRIVER_OBJECT DRIVER_OBJECT; typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; struct _SECTION_OBJECT_POINTERS { - PVOID DataSectionObject ; - PVOID SharedCacheMap ; - PVOID ImageSectionObject ; + PVOID DataSectionObject; + PVOID SharedCacheMap; + PVOID ImageSectionObject; }; typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS; typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS; struct _IO_COMPLETION_CONTEXT { - PVOID Port ; - PVOID Key ; + PVOID Port; + PVOID Key; }; typedef struct _IO_COMPLETION_CONTEXT *PIO_COMPLETION_CONTEXT; struct _FILE_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - PVPB Vpb ; - PVOID FsContext ; - PVOID FsContext2 ; - PSECTION_OBJECT_POINTERS SectionObjectPointer ; - PVOID PrivateCacheMap ; - NTSTATUS FinalStatus ; - struct _FILE_OBJECT *RelatedFileObject ; - BOOLEAN LockOperation ; - BOOLEAN DeletePending ; - BOOLEAN ReadAccess ; - BOOLEAN WriteAccess ; - BOOLEAN DeleteAccess ; - BOOLEAN SharedRead ; - BOOLEAN SharedWrite ; - BOOLEAN SharedDelete ; - ULONG Flags ; - UNICODE_STRING FileName ; - LARGE_INTEGER CurrentByteOffset ; - ULONG Waiters ; - ULONG Busy ; - PVOID LastLock ; - KEVENT Lock ; - KEVENT Event ; - PIO_COMPLETION_CONTEXT CompletionContext ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + PVPB Vpb; + PVOID FsContext; + PVOID FsContext2; + PSECTION_OBJECT_POINTERS SectionObjectPointer; + PVOID PrivateCacheMap; + NTSTATUS FinalStatus; + struct _FILE_OBJECT *RelatedFileObject; + BOOLEAN LockOperation; + BOOLEAN DeletePending; + BOOLEAN ReadAccess; + BOOLEAN WriteAccess; + BOOLEAN DeleteAccess; + BOOLEAN SharedRead; + BOOLEAN SharedWrite; + BOOLEAN SharedDelete; + ULONG Flags; + UNICODE_STRING FileName; + LARGE_INTEGER CurrentByteOffset; + ULONG Waiters; + ULONG Busy; + PVOID LastLock; + KEVENT Lock; + KEVENT Event; + PIO_COMPLETION_CONTEXT CompletionContext; }; typedef struct _FILE_OBJECT *PFILE_OBJECT; union __anonunion_AssociatedIrp_44 { - struct _IRP *MasterIrp ; - LONG IrpCount ; - PVOID SystemBuffer ; + struct _IRP *MasterIrp; + LONG IrpCount; + PVOID SystemBuffer; }; struct __anonstruct_AsynchronousParameters_46 { - void (*UserApcRoutine)(PVOID ApcContext , PIO_STATUS_BLOCK IoStatusBlock , - ULONG Reserved ) ; - PVOID UserApcContext ; + void (*UserApcRoutine)(PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, + ULONG Reserved); + PVOID UserApcContext; }; union __anonunion_Overlay_45 { - struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters ; - LARGE_INTEGER AllocationSize ; + struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters; + LARGE_INTEGER AllocationSize; }; struct __anonstruct____missing_field_name_50 { - PVOID DriverContext[4] ; + PVOID DriverContext[4]; }; union __anonunion____missing_field_name_49 { - KDEVICE_QUEUE_ENTRY DeviceQueueEntry ; - struct __anonstruct____missing_field_name_50 __annonCompField14 ; + KDEVICE_QUEUE_ENTRY DeviceQueueEntry; + struct __anonstruct____missing_field_name_50 __annonCompField14; }; struct _IO_STACK_LOCATION; union __anonunion____missing_field_name_52 { - struct _IO_STACK_LOCATION *CurrentStackLocation ; - ULONG PacketType ; + struct _IO_STACK_LOCATION *CurrentStackLocation; + ULONG PacketType; }; struct __anonstruct____missing_field_name_51 { - LIST_ENTRY ListEntry ; - union __anonunion____missing_field_name_52 __annonCompField16 ; + LIST_ENTRY ListEntry; + union __anonunion____missing_field_name_52 __annonCompField16; }; struct __anonstruct_Overlay_48 { - union __anonunion____missing_field_name_49 __annonCompField15 ; - PETHREAD Thread ; - PCHAR AuxiliaryBuffer ; - struct __anonstruct____missing_field_name_51 __annonCompField17 ; - PFILE_OBJECT OriginalFileObject ; + union __anonunion____missing_field_name_49 __annonCompField15; + PETHREAD Thread; + PCHAR AuxiliaryBuffer; + struct __anonstruct____missing_field_name_51 __annonCompField17; + PFILE_OBJECT OriginalFileObject; }; union __anonunion_Tail_47 { - struct __anonstruct_Overlay_48 Overlay ; - KAPC Apc ; - PVOID CompletionKey ; + struct __anonstruct_Overlay_48 Overlay; + KAPC Apc; + PVOID CompletionKey; }; struct _IRP { - CSHORT Type ; - USHORT Size ; - PMDL MdlAddress ; - ULONG Flags ; - union __anonunion_AssociatedIrp_44 AssociatedIrp ; - LIST_ENTRY ThreadListEntry ; - IO_STATUS_BLOCK IoStatus ; - KPROCESSOR_MODE RequestorMode ; - BOOLEAN PendingReturned ; - CHAR StackCount ; - CHAR CurrentLocation ; - BOOLEAN Cancel ; - KIRQL CancelIrql ; - CCHAR ApcEnvironment ; - UCHAR AllocationFlags ; - PIO_STATUS_BLOCK UserIosb ; - PKEVENT UserEvent ; - union __anonunion_Overlay_45 Overlay ; - void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - PVOID UserBuffer ; - union __anonunion_Tail_47 Tail ; + CSHORT Type; + USHORT Size; + PMDL MdlAddress; + ULONG Flags; + union __anonunion_AssociatedIrp_44 AssociatedIrp; + LIST_ENTRY ThreadListEntry; + IO_STATUS_BLOCK IoStatus; + KPROCESSOR_MODE RequestorMode; + BOOLEAN PendingReturned; + CHAR StackCount; + CHAR CurrentLocation; + BOOLEAN Cancel; + KIRQL CancelIrql; + CCHAR ApcEnvironment; + UCHAR AllocationFlags; + PIO_STATUS_BLOCK UserIosb; + PKEVENT UserEvent; + union __anonunion_Overlay_45 Overlay; + void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + PVOID UserBuffer; + union __anonunion_Tail_47 Tail; }; typedef struct _IRP IRP; typedef struct _IRP *PIRP; enum _DEVICE_RELATION_TYPE { - BusRelations = 0, - EjectionRelations = 1, - PowerRelations = 2, - RemovalRelations = 3, - TargetDeviceRelation = 4 -} ; + BusRelations = 0, + EjectionRelations = 1, + PowerRelations = 2, + RemovalRelations = 3, + TargetDeviceRelation = 4 +}; typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE; enum _DEVICE_USAGE_NOTIFICATION_TYPE { - DeviceUsageTypeUndefined = 0, - DeviceUsageTypePaging = 1, - DeviceUsageTypeHibernation = 2, - DeviceUsageTypeDumpFile = 3 -} ; + DeviceUsageTypeUndefined = 0, + DeviceUsageTypePaging = 1, + DeviceUsageTypeHibernation = 2, + DeviceUsageTypeDumpFile = 3 +}; typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE; struct _INTERFACE { - USHORT Size ; - USHORT Version ; - PVOID Context ; - void (*InterfaceReference)(PVOID Context ) ; - void (*InterfaceDereference)(PVOID Context ) ; + USHORT Size; + USHORT Version; + PVOID Context; + void (*InterfaceReference)(PVOID Context); + void (*InterfaceDereference)(PVOID Context); }; typedef struct _INTERFACE *PINTERFACE; struct _DEVICE_CAPABILITIES { - USHORT Size ; - USHORT Version ; - ULONG DeviceD1 : 1 ; - ULONG DeviceD2 : 1 ; - ULONG LockSupported : 1 ; - ULONG EjectSupported : 1 ; - ULONG Removable : 1 ; - ULONG DockDevice : 1 ; - ULONG UniqueID : 1 ; - ULONG SilentInstall : 1 ; - ULONG RawDeviceOK : 1 ; - ULONG SurpriseRemovalOK : 1 ; - ULONG WakeFromD0 : 1 ; - ULONG WakeFromD1 : 1 ; - ULONG WakeFromD2 : 1 ; - ULONG WakeFromD3 : 1 ; - ULONG HardwareDisabled : 1 ; - ULONG NonDynamic : 1 ; - ULONG WarmEjectSupported : 1 ; - ULONG Reserved : 15 ; - ULONG Address ; - ULONG UINumber ; - DEVICE_POWER_STATE DeviceState[7] ; - SYSTEM_POWER_STATE SystemWake ; - DEVICE_POWER_STATE DeviceWake ; - ULONG D1Latency ; - ULONG D2Latency ; - ULONG D3Latency ; + USHORT Size; + USHORT Version; + ULONG DeviceD1 : 1; + ULONG DeviceD2 : 1; + ULONG LockSupported : 1; + ULONG EjectSupported : 1; + ULONG Removable : 1; + ULONG DockDevice : 1; + ULONG UniqueID : 1; + ULONG SilentInstall : 1; + ULONG RawDeviceOK : 1; + ULONG SurpriseRemovalOK : 1; + ULONG WakeFromD0 : 1; + ULONG WakeFromD1 : 1; + ULONG WakeFromD2 : 1; + ULONG WakeFromD3 : 1; + ULONG HardwareDisabled : 1; + ULONG NonDynamic : 1; + ULONG WarmEjectSupported : 1; + ULONG Reserved : 15; + ULONG Address; + ULONG UINumber; + DEVICE_POWER_STATE DeviceState[7]; + SYSTEM_POWER_STATE SystemWake; + DEVICE_POWER_STATE DeviceWake; + ULONG D1Latency; + ULONG D2Latency; + ULONG D3Latency; }; typedef struct _DEVICE_CAPABILITIES *PDEVICE_CAPABILITIES; struct _POWER_SEQUENCE { - ULONG SequenceD1 ; - ULONG SequenceD2 ; - ULONG SequenceD3 ; + ULONG SequenceD1; + ULONG SequenceD2; + ULONG SequenceD3; }; typedef struct _POWER_SEQUENCE *PPOWER_SEQUENCE; enum __anonenum_BUS_QUERY_ID_TYPE_53 { - BusQueryDeviceID = 0, - BusQueryHardwareIDs = 1, - BusQueryCompatibleIDs = 2, - BusQueryInstanceID = 3, - BusQueryDeviceSerialNumber = 4 -} ; + BusQueryDeviceID = 0, + BusQueryHardwareIDs = 1, + BusQueryCompatibleIDs = 2, + BusQueryInstanceID = 3, + BusQueryDeviceSerialNumber = 4 +}; typedef enum __anonenum_BUS_QUERY_ID_TYPE_53 BUS_QUERY_ID_TYPE; enum __anonenum_DEVICE_TEXT_TYPE_54 { - DeviceTextDescription = 0, - DeviceTextLocationInformation = 1 -} ; + DeviceTextDescription = 0, + DeviceTextLocationInformation = 1 +}; typedef enum __anonenum_DEVICE_TEXT_TYPE_54 DEVICE_TEXT_TYPE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Create_56 { - PIO_SECURITY_CONTEXT SecurityContext ; - ULONG Options ; - USHORT FileAttributes ; - USHORT ShareAccess ; - ULONG EaLength ; + PIO_SECURITY_CONTEXT SecurityContext; + ULONG Options; + USHORT FileAttributes; + USHORT ShareAccess; + ULONG EaLength; }; struct __anonstruct_Read_57 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_Write_58 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_QueryFile_59 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; }; struct __anonstruct____missing_field_name_62 { - BOOLEAN ReplaceIfExists ; - BOOLEAN AdvanceOnly ; + BOOLEAN ReplaceIfExists; + BOOLEAN AdvanceOnly; }; union __anonunion____missing_field_name_61 { - struct __anonstruct____missing_field_name_62 __annonCompField18 ; - ULONG ClusterCount ; - HANDLE DeleteHandle ; + struct __anonstruct____missing_field_name_62 __annonCompField18; + ULONG ClusterCount; + HANDLE DeleteHandle; }; struct __anonstruct_SetFile_60 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; - PFILE_OBJECT FileObject ; - union __anonunion____missing_field_name_61 __annonCompField19 ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; + PFILE_OBJECT FileObject; + union __anonunion____missing_field_name_61 __annonCompField19; }; struct __anonstruct_QueryVolume_63 { - ULONG Length ; - FS_INFORMATION_CLASS FsInformationClass ; + ULONG Length; + FS_INFORMATION_CLASS FsInformationClass; }; struct __anonstruct_DeviceIoControl_64 { - ULONG OutputBufferLength ; - ULONG InputBufferLength ; - ULONG IoControlCode ; - PVOID Type3InputBuffer ; + ULONG OutputBufferLength; + ULONG InputBufferLength; + ULONG IoControlCode; + PVOID Type3InputBuffer; }; struct __anonstruct_QuerySecurity_65 { - SECURITY_INFORMATION SecurityInformation ; - ULONG Length ; + SECURITY_INFORMATION SecurityInformation; + ULONG Length; }; struct __anonstruct_SetSecurity_66 { - SECURITY_INFORMATION SecurityInformation ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; + SECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; }; struct __anonstruct_MountVolume_67 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_VerifyVolume_68 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_Scsi_69 { - struct _SCSI_REQUEST_BLOCK *Srb ; + struct _SCSI_REQUEST_BLOCK *Srb; }; struct __anonstruct_QueryDeviceRelations_70 { - DEVICE_RELATION_TYPE Type ; + DEVICE_RELATION_TYPE Type; }; struct __anonstruct_QueryInterface_71 { - GUID const *InterfaceType ; - USHORT Size ; - USHORT Version ; - PINTERFACE Interface ; - PVOID InterfaceSpecificData ; + GUID const *InterfaceType; + USHORT Size; + USHORT Version; + PINTERFACE Interface; + PVOID InterfaceSpecificData; }; struct __anonstruct_DeviceCapabilities_72 { - PDEVICE_CAPABILITIES Capabilities ; + PDEVICE_CAPABILITIES Capabilities; }; struct __anonstruct_FilterResourceRequirements_73 { - PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList ; + PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; }; struct __anonstruct_ReadWriteConfig_74 { - ULONG WhichSpace ; - PVOID Buffer ; - ULONG Offset ; - ULONG Length ; + ULONG WhichSpace; + PVOID Buffer; + ULONG Offset; + ULONG Length; }; struct __anonstruct_SetLock_75 { - BOOLEAN Lock ; + BOOLEAN Lock; }; struct __anonstruct_QueryId_76 { - BUS_QUERY_ID_TYPE IdType ; + BUS_QUERY_ID_TYPE IdType; }; struct __anonstruct_QueryDeviceText_77 { - DEVICE_TEXT_TYPE DeviceTextType ; - LCID LocaleId ; + DEVICE_TEXT_TYPE DeviceTextType; + LCID LocaleId; }; struct __anonstruct_UsageNotification_78 { - BOOLEAN InPath ; - BOOLEAN Reserved[3] ; - DEVICE_USAGE_NOTIFICATION_TYPE Type ; + BOOLEAN InPath; + BOOLEAN Reserved[3]; + DEVICE_USAGE_NOTIFICATION_TYPE Type; }; struct __anonstruct_WaitWake_79 { - SYSTEM_POWER_STATE PowerState ; + SYSTEM_POWER_STATE PowerState; }; struct __anonstruct_PowerSequence_80 { - PPOWER_SEQUENCE PowerSequence ; + PPOWER_SEQUENCE PowerSequence; }; struct __anonstruct_Power_81 { - ULONG SystemContext ; - POWER_STATE_TYPE Type ; - POWER_STATE State ; - POWER_ACTION ShutdownType ; + ULONG SystemContext; + POWER_STATE_TYPE Type; + POWER_STATE State; + POWER_ACTION ShutdownType; }; struct __anonstruct_StartDevice_82 { - PCM_RESOURCE_LIST AllocatedResources ; - PCM_RESOURCE_LIST AllocatedResourcesTranslated ; + PCM_RESOURCE_LIST AllocatedResources; + PCM_RESOURCE_LIST AllocatedResourcesTranslated; }; struct __anonstruct_WMI_83 { - ULONG_PTR ProviderId ; - PVOID DataPath ; - ULONG BufferSize ; - PVOID Buffer ; + ULONG_PTR ProviderId; + PVOID DataPath; + ULONG BufferSize; + PVOID Buffer; }; struct __anonstruct_Others_84 { - PVOID Argument1 ; - PVOID Argument2 ; - PVOID Argument3 ; - PVOID Argument4 ; + PVOID Argument1; + PVOID Argument2; + PVOID Argument3; + PVOID Argument4; }; union __anonunion_Parameters_55 { - struct __anonstruct_Create_56 Create ; - struct __anonstruct_Read_57 Read ; - struct __anonstruct_Write_58 Write ; - struct __anonstruct_QueryFile_59 QueryFile ; - struct __anonstruct_SetFile_60 SetFile ; - struct __anonstruct_QueryVolume_63 QueryVolume ; - struct __anonstruct_DeviceIoControl_64 DeviceIoControl ; - struct __anonstruct_QuerySecurity_65 QuerySecurity ; - struct __anonstruct_SetSecurity_66 SetSecurity ; - struct __anonstruct_MountVolume_67 MountVolume ; - struct __anonstruct_VerifyVolume_68 VerifyVolume ; - struct __anonstruct_Scsi_69 Scsi ; - struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations ; - struct __anonstruct_QueryInterface_71 QueryInterface ; - struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities ; - struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements ; - struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig ; - struct __anonstruct_SetLock_75 SetLock ; - struct __anonstruct_QueryId_76 QueryId ; - struct __anonstruct_QueryDeviceText_77 QueryDeviceText ; - struct __anonstruct_UsageNotification_78 UsageNotification ; - struct __anonstruct_WaitWake_79 WaitWake ; - struct __anonstruct_PowerSequence_80 PowerSequence ; - struct __anonstruct_Power_81 Power ; - struct __anonstruct_StartDevice_82 StartDevice ; - struct __anonstruct_WMI_83 WMI ; - struct __anonstruct_Others_84 Others ; + struct __anonstruct_Create_56 Create; + struct __anonstruct_Read_57 Read; + struct __anonstruct_Write_58 Write; + struct __anonstruct_QueryFile_59 QueryFile; + struct __anonstruct_SetFile_60 SetFile; + struct __anonstruct_QueryVolume_63 QueryVolume; + struct __anonstruct_DeviceIoControl_64 DeviceIoControl; + struct __anonstruct_QuerySecurity_65 QuerySecurity; + struct __anonstruct_SetSecurity_66 SetSecurity; + struct __anonstruct_MountVolume_67 MountVolume; + struct __anonstruct_VerifyVolume_68 VerifyVolume; + struct __anonstruct_Scsi_69 Scsi; + struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations; + struct __anonstruct_QueryInterface_71 QueryInterface; + struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities; + struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements; + struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig; + struct __anonstruct_SetLock_75 SetLock; + struct __anonstruct_QueryId_76 QueryId; + struct __anonstruct_QueryDeviceText_77 QueryDeviceText; + struct __anonstruct_UsageNotification_78 UsageNotification; + struct __anonstruct_WaitWake_79 WaitWake; + struct __anonstruct_PowerSequence_80 PowerSequence; + struct __anonstruct_Power_81 Power; + struct __anonstruct_StartDevice_82 StartDevice; + struct __anonstruct_WMI_83 WMI; + struct __anonstruct_Others_84 Others; }; struct _IO_STACK_LOCATION { - UCHAR MajorFunction ; - UCHAR MinorFunction ; - UCHAR Flags ; - UCHAR Control ; - union __anonunion_Parameters_55 Parameters ; - PDEVICE_OBJECT DeviceObject ; - PFILE_OBJECT FileObject ; - NTSTATUS (*CompletionRoutine)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - PVOID Context ; + UCHAR MajorFunction; + UCHAR MinorFunction; + UCHAR Flags; + UCHAR Control; + union __anonunion_Parameters_55 Parameters; + PDEVICE_OBJECT DeviceObject; + PFILE_OBJECT FileObject; + NTSTATUS(*CompletionRoutine) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + PVOID Context; }; typedef struct _IO_STACK_LOCATION IO_STACK_LOCATION; typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION; #pragma pack(pop) struct _CONFIGURATION_INFORMATION { - ULONG DiskCount ; - ULONG FloppyCount ; - ULONG CdRomCount ; - ULONG TapeCount ; - ULONG ScsiPortCount ; - ULONG SerialCount ; - ULONG ParallelCount ; - BOOLEAN AtDiskPrimaryAddressClaimed ; - BOOLEAN AtDiskSecondaryAddressClaimed ; - ULONG Version ; - ULONG MediumChangerCount ; + ULONG DiskCount; + ULONG FloppyCount; + ULONG CdRomCount; + ULONG TapeCount; + ULONG ScsiPortCount; + ULONG SerialCount; + ULONG ParallelCount; + BOOLEAN AtDiskPrimaryAddressClaimed; + BOOLEAN AtDiskSecondaryAddressClaimed; + ULONG Version; + ULONG MediumChangerCount; }; typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION; typedef struct _CONFIGURATION_INFORMATION *PCONFIGURATION_INFORMATION; struct _OBJECT_HANDLE_INFORMATION { - ULONG HandleAttributes ; - ACCESS_MASK GrantedAccess ; + ULONG HandleAttributes; + ACCESS_MASK GrantedAccess; }; typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION; enum _MEDIA_TYPE { - Unknown = 0, - F5_1Pt2_512 = 1, - F3_1Pt44_512 = 2, - F3_2Pt88_512 = 3, - F3_20Pt8_512 = 4, - F3_720_512 = 5, - F5_360_512 = 6, - F5_320_512 = 7, - F5_320_1024 = 8, - F5_180_512 = 9, - F5_160_512 = 10, - RemovableMedia = 11, - FixedMedia = 12, - F3_120M_512 = 13, - F3_640_512 = 14, - F5_640_512 = 15, - F5_720_512 = 16, - F3_1Pt2_512 = 17, - F3_1Pt23_1024 = 18, - F5_1Pt23_1024 = 19, - F3_128Mb_512 = 20, - F3_230Mb_512 = 21, - F8_256_128 = 22 -} ; + Unknown = 0, + F5_1Pt2_512 = 1, + F3_1Pt44_512 = 2, + F3_2Pt88_512 = 3, + F3_20Pt8_512 = 4, + F3_720_512 = 5, + F5_360_512 = 6, + F5_320_512 = 7, + F5_320_1024 = 8, + F5_180_512 = 9, + F5_160_512 = 10, + RemovableMedia = 11, + FixedMedia = 12, + F3_120M_512 = 13, + F3_640_512 = 14, + F5_640_512 = 15, + F5_720_512 = 16, + F3_1Pt2_512 = 17, + F3_1Pt23_1024 = 18, + F5_1Pt23_1024 = 19, + F3_128Mb_512 = 20, + F3_230Mb_512 = 21, + F8_256_128 = 22 +}; typedef enum _MEDIA_TYPE MEDIA_TYPE; struct _FORMAT_PARAMETERS { - MEDIA_TYPE MediaType ; - ULONG StartCylinderNumber ; - ULONG EndCylinderNumber ; - ULONG StartHeadNumber ; - ULONG EndHeadNumber ; + MEDIA_TYPE MediaType; + ULONG StartCylinderNumber; + ULONG EndCylinderNumber; + ULONG StartHeadNumber; + ULONG EndHeadNumber; }; typedef struct _FORMAT_PARAMETERS FORMAT_PARAMETERS; typedef struct _FORMAT_PARAMETERS *PFORMAT_PARAMETERS; typedef USHORT BAD_TRACK_NUMBER; typedef USHORT *PBAD_TRACK_NUMBER; struct _FORMAT_EX_PARAMETERS { - MEDIA_TYPE MediaType ; - ULONG StartCylinderNumber ; - ULONG EndCylinderNumber ; - ULONG StartHeadNumber ; - ULONG EndHeadNumber ; - USHORT FormatGapLength ; - USHORT SectorsPerTrack ; - USHORT SectorNumber[1] ; + MEDIA_TYPE MediaType; + ULONG StartCylinderNumber; + ULONG EndCylinderNumber; + ULONG StartHeadNumber; + ULONG EndHeadNumber; + USHORT FormatGapLength; + USHORT SectorsPerTrack; + USHORT SectorNumber[1]; }; typedef struct _FORMAT_EX_PARAMETERS FORMAT_EX_PARAMETERS; typedef struct _FORMAT_EX_PARAMETERS *PFORMAT_EX_PARAMETERS; struct _DISK_GEOMETRY { - LARGE_INTEGER Cylinders ; - MEDIA_TYPE MediaType ; - ULONG TracksPerCylinder ; - ULONG SectorsPerTrack ; - ULONG BytesPerSector ; + LARGE_INTEGER Cylinders; + MEDIA_TYPE MediaType; + ULONG TracksPerCylinder; + ULONG SectorsPerTrack; + ULONG BytesPerSector; }; typedef struct _DISK_GEOMETRY DISK_GEOMETRY; typedef struct _DISK_GEOMETRY *PDISK_GEOMETRY; -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _TRANSFER_BUFFER { - PHYSICAL_ADDRESS Logical ; - PVOID Virtual ; + PHYSICAL_ADDRESS Logical; + PVOID Virtual; }; typedef struct _TRANSFER_BUFFER TRANSFER_BUFFER; struct _ACPI_FDI_DATA { - ULONG DriveNumber ; - ULONG DeviceType ; - ULONG MaxCylinderNumber ; - ULONG MaxSectorNumber ; - ULONG MaxHeadNumber ; - ULONG StepRateHeadUnloadTime ; - ULONG HeadLoadTime ; - ULONG MotorOffTime ; - ULONG SectorLengthCode ; - ULONG SectorPerTrack ; - ULONG ReadWriteGapLength ; - ULONG DataTransferLength ; - ULONG FormatGapLength ; - ULONG FormatFillCharacter ; - ULONG HeadSettleTime ; - ULONG MotorSettleTime ; + ULONG DriveNumber; + ULONG DeviceType; + ULONG MaxCylinderNumber; + ULONG MaxSectorNumber; + ULONG MaxHeadNumber; + ULONG StepRateHeadUnloadTime; + ULONG HeadLoadTime; + ULONG MotorOffTime; + ULONG SectorLengthCode; + ULONG SectorPerTrack; + ULONG ReadWriteGapLength; + ULONG DataTransferLength; + ULONG FormatGapLength; + ULONG FormatFillCharacter; + ULONG HeadSettleTime; + ULONG MotorSettleTime; }; typedef struct _ACPI_FDI_DATA ACPI_FDI_DATA; enum _ACPI_FDI_DEVICE_TYPE { - CmosProblem = 0, - Form525Capacity360 = 1, - Form525Capacity1200 = 2, - Form35Capacity720 = 3, - Form35Capacity1440 = 4, - Form35Capacity2880 = 5 -} ; + CmosProblem = 0, + Form525Capacity360 = 1, + Form525Capacity1200 = 2, + Form35Capacity720 = 3, + Form35Capacity1440 = 4, + Form35Capacity2880 = 5 +}; struct _FDC_INFO { - UCHAR FloppyControllerType ; - UCHAR SpeedsAvailable ; - ULONG AdapterBufferSize ; - INTERFACE_TYPE BusType ; - ULONG BusNumber ; - ULONG ControllerNumber ; - ULONG PeripheralNumber ; - ULONG UnitNumber ; - ULONG MaxTransferSize ; - BOOLEAN AcpiBios ; - BOOLEAN AcpiFdiSupported ; - ACPI_FDI_DATA AcpiFdiData ; - ULONG BufferCount ; - ULONG BufferSize ; - TRANSFER_BUFFER BufferAddress[] ; + UCHAR FloppyControllerType; + UCHAR SpeedsAvailable; + ULONG AdapterBufferSize; + INTERFACE_TYPE BusType; + ULONG BusNumber; + ULONG ControllerNumber; + ULONG PeripheralNumber; + ULONG UnitNumber; + ULONG MaxTransferSize; + BOOLEAN AcpiBios; + BOOLEAN AcpiFdiSupported; + ACPI_FDI_DATA AcpiFdiData; + ULONG BufferCount; + ULONG BufferSize; + TRANSFER_BUFFER BufferAddress[]; }; typedef struct _FDC_INFO FDC_INFO; typedef struct _FDC_INFO *PFDC_INFO; struct _FDC_ENABLE_PARMS { - UCHAR DriveOnValue ; - USHORT TimeToWait ; - BOOLEAN MotorStarted ; + UCHAR DriveOnValue; + USHORT TimeToWait; + BOOLEAN MotorStarted; }; typedef struct _FDC_ENABLE_PARMS FDC_ENABLE_PARMS; struct _FDC_DISK_CHANGE_PARMS { - UCHAR DriveStatus ; - UCHAR DriveOnValue ; + UCHAR DriveStatus; + UCHAR DriveOnValue; }; typedef struct _FDC_DISK_CHANGE_PARMS FDC_DISK_CHANGE_PARMS; struct _ISSUE_FDC_COMMAND_PARMS { - PUCHAR FifoInBuffer ; - PUCHAR FifoOutBuffer ; - PVOID IoHandle ; - ULONG IoOffset ; - ULONG TransferBytes ; - ULONG TimeOut ; + PUCHAR FifoInBuffer; + PUCHAR FifoOutBuffer; + PVOID IoHandle; + ULONG IoOffset; + ULONG TransferBytes; + ULONG TimeOut; }; typedef struct _ISSUE_FDC_COMMAND_PARMS ISSUE_FDC_COMMAND_PARMS; struct _SET_HD_BIT_PARMS { - BOOLEAN DriveType144MB ; - BOOLEAN Media144MB ; - BOOLEAN More120MB ; - UCHAR DeviceUnit ; - BOOLEAN ChangedHdBit ; + BOOLEAN DriveType144MB; + BOOLEAN Media144MB; + BOOLEAN More120MB; + UCHAR DeviceUnit; + BOOLEAN ChangedHdBit; }; typedef struct _SET_HD_BIT_PARMS SET_HD_BIT_PARMS; struct _MOUNTDEV_NAME { - USHORT NameLength ; - WCHAR Name[1] ; + USHORT NameLength; + WCHAR Name[1]; }; typedef struct _MOUNTDEV_NAME MOUNTDEV_NAME; typedef struct _MOUNTDEV_NAME *PMOUNTDEV_NAME; struct _MOUNTDEV_UNIQUE_ID { - USHORT UniqueIdLength ; - UCHAR UniqueId[1] ; + USHORT UniqueIdLength; + UCHAR UniqueId[1]; }; typedef struct _MOUNTDEV_UNIQUE_ID MOUNTDEV_UNIQUE_ID; typedef struct _MOUNTDEV_UNIQUE_ID *PMOUNTDEV_UNIQUE_ID; struct _MOUNTDEV_SUGGESTED_LINK_NAME { - BOOLEAN UseOnlyIfThereAreNoOtherLinks ; - USHORT NameLength ; - WCHAR Name[1] ; + BOOLEAN UseOnlyIfThereAreNoOtherLinks; + USHORT NameLength; + WCHAR Name[1]; }; typedef struct _MOUNTDEV_SUGGESTED_LINK_NAME MOUNTDEV_SUGGESTED_LINK_NAME; typedef struct _MOUNTDEV_SUGGESTED_LINK_NAME *PMOUNTDEV_SUGGESTED_LINK_NAME; struct _BOOT_SECTOR_INFO { - UCHAR JumpByte[1] ; - UCHAR Ignore1[2] ; - UCHAR OemData[8] ; - UCHAR BytesPerSector[2] ; - UCHAR Ignore2[6] ; - UCHAR NumberOfSectors[2] ; - UCHAR MediaByte[1] ; - UCHAR Ignore3[2] ; - UCHAR SectorsPerTrack[2] ; - UCHAR NumberOfHeads[2] ; + UCHAR JumpByte[1]; + UCHAR Ignore1[2]; + UCHAR OemData[8]; + UCHAR BytesPerSector[2]; + UCHAR Ignore2[6]; + UCHAR NumberOfSectors[2]; + UCHAR MediaByte[1]; + UCHAR Ignore3[2]; + UCHAR SectorsPerTrack[2]; + UCHAR NumberOfHeads[2]; }; typedef struct _BOOT_SECTOR_INFO *PBOOT_SECTOR_INFO; enum _DRIVE_MEDIA_TYPE { - Drive360Media160 = 0, - Drive360Media180 = 1, - Drive360Media320 = 2, - Drive360Media32X = 3, - Drive360Media360 = 4, - Drive720Media720 = 5, - Drive120Media160 = 6, - Drive120Media180 = 7, - Drive120Media320 = 8, - Drive120Media32X = 9, - Drive120Media360 = 10, - Drive120Media120 = 11, - Drive144Media720 = 12, - Drive144Media144 = 13, - Drive288Media720 = 14, - Drive288Media144 = 15, - Drive288Media288 = 16 -} ; + Drive360Media160 = 0, + Drive360Media180 = 1, + Drive360Media320 = 2, + Drive360Media32X = 3, + Drive360Media360 = 4, + Drive720Media720 = 5, + Drive120Media160 = 6, + Drive120Media180 = 7, + Drive120Media320 = 8, + Drive120Media32X = 9, + Drive120Media360 = 10, + Drive120Media120 = 11, + Drive144Media720 = 12, + Drive144Media144 = 13, + Drive288Media720 = 14, + Drive288Media144 = 15, + Drive288Media288 = 16 +}; typedef enum _DRIVE_MEDIA_TYPE DRIVE_MEDIA_TYPE; enum _DRIVE_MEDIA_TYPE_NEC98 { - Drive360Media160Nec98 = 0, - Drive360Media180Nec98 = 1, - Drive360Media320Nec98 = 2, - Drive360Media32XNec98 = 3, - Drive360Media360Nec98 = 4, - Drive120Media160Nec98 = 5, - Drive120Media180Nec98 = 6, - Drive120Media320Nec98 = 7, - Drive120Media32XNec98 = 8, - Drive120Media360Nec98 = 9, - Drive120Media640Nec98 = 10, - Drive120Media720Nec98 = 11, - Drive120Media120Nec98 = 12, - Drive120Media123Nec98 = 13, - Drive144Media640Nec98 = 14, - Drive144Media720Nec98 = 15, - Drive144Media120Nec98 = 16, - Drive144Media123Nec98 = 17, - Drive144Media144Nec98 = 18, - Drive12EMedia120Nec98 = 19, - Drive12EMedia123Nec98 = 20 -} ; + Drive360Media160Nec98 = 0, + Drive360Media180Nec98 = 1, + Drive360Media320Nec98 = 2, + Drive360Media32XNec98 = 3, + Drive360Media360Nec98 = 4, + Drive120Media160Nec98 = 5, + Drive120Media180Nec98 = 6, + Drive120Media320Nec98 = 7, + Drive120Media32XNec98 = 8, + Drive120Media360Nec98 = 9, + Drive120Media640Nec98 = 10, + Drive120Media720Nec98 = 11, + Drive120Media120Nec98 = 12, + Drive120Media123Nec98 = 13, + Drive144Media640Nec98 = 14, + Drive144Media720Nec98 = 15, + Drive144Media120Nec98 = 16, + Drive144Media123Nec98 = 17, + Drive144Media144Nec98 = 18, + Drive12EMedia120Nec98 = 19, + Drive12EMedia123Nec98 = 20 +}; typedef enum _DRIVE_MEDIA_TYPE_NEC98 DRIVE_MEDIA_TYPE_NEC98; struct _DRIVE_MEDIA_LIMITS { - DRIVE_MEDIA_TYPE HighestDriveMediaType ; - DRIVE_MEDIA_TYPE LowestDriveMediaType ; + DRIVE_MEDIA_TYPE HighestDriveMediaType; + DRIVE_MEDIA_TYPE LowestDriveMediaType; }; typedef struct _DRIVE_MEDIA_LIMITS DRIVE_MEDIA_LIMITS; typedef struct _DRIVE_MEDIA_LIMITS *PDRIVE_MEDIA_LIMITS; struct _DRIVE_MEDIA_LIMITS_NEC98 { - DRIVE_MEDIA_TYPE_NEC98 HighestDriveMediaType ; - DRIVE_MEDIA_TYPE_NEC98 LowestDriveMediaType ; + DRIVE_MEDIA_TYPE_NEC98 HighestDriveMediaType; + DRIVE_MEDIA_TYPE_NEC98 LowestDriveMediaType; }; typedef struct _DRIVE_MEDIA_LIMITS_NEC98 DRIVE_MEDIA_LIMITS_NEC98; struct _DRIVE_MEDIA_CONSTANTS { - MEDIA_TYPE MediaType ; - UCHAR StepRateHeadUnloadTime ; - UCHAR HeadLoadTime ; - UCHAR MotorOffTime ; - UCHAR SectorLengthCode ; - USHORT BytesPerSector ; - UCHAR SectorsPerTrack ; - UCHAR ReadWriteGapLength ; - UCHAR FormatGapLength ; - UCHAR FormatFillCharacter ; - UCHAR HeadSettleTime ; - USHORT MotorSettleTimeRead ; - USHORT MotorSettleTimeWrite ; - UCHAR MaximumTrack ; - UCHAR CylinderShift ; - UCHAR DataTransferRate ; - UCHAR NumberOfHeads ; - UCHAR DataLength ; - UCHAR MediaByte ; - UCHAR SkewDelta ; + MEDIA_TYPE MediaType; + UCHAR StepRateHeadUnloadTime; + UCHAR HeadLoadTime; + UCHAR MotorOffTime; + UCHAR SectorLengthCode; + USHORT BytesPerSector; + UCHAR SectorsPerTrack; + UCHAR ReadWriteGapLength; + UCHAR FormatGapLength; + UCHAR FormatFillCharacter; + UCHAR HeadSettleTime; + USHORT MotorSettleTimeRead; + USHORT MotorSettleTimeWrite; + UCHAR MaximumTrack; + UCHAR CylinderShift; + UCHAR DataTransferRate; + UCHAR NumberOfHeads; + UCHAR DataLength; + UCHAR MediaByte; + UCHAR SkewDelta; }; typedef struct _DRIVE_MEDIA_CONSTANTS DRIVE_MEDIA_CONSTANTS; typedef struct _DRIVE_MEDIA_CONSTANTS *PDRIVE_MEDIA_CONSTANTS; struct _DISKETTE_EXTENSION { - KSPIN_LOCK FlCancelSpinLock ; - PDEVICE_OBJECT UnderlyingPDO ; - PDEVICE_OBJECT TargetObject ; - BOOLEAN IsStarted ; - BOOLEAN IsRemoved ; - BOOLEAN HoldNewRequests ; - LIST_ENTRY NewRequestQueue ; - KSPIN_LOCK NewRequestQueueSpinLock ; - PDEVICE_OBJECT DeviceObject ; - KSEMAPHORE RequestSemaphore ; - KSPIN_LOCK ListSpinLock ; - FAST_MUTEX ThreadReferenceMutex ; - LONG ThreadReferenceCount ; - PKTHREAD FloppyThread ; - LIST_ENTRY ListEntry ; - BOOLEAN HardwareFailed ; - UCHAR HardwareFailCount ; - ULONG MaxTransferSize ; - UCHAR FifoBuffer[10] ; - PUCHAR IoBuffer ; - PMDL IoBufferMdl ; - ULONG IoBufferSize ; - PDRIVER_OBJECT DriverObject ; - DRIVE_MEDIA_TYPE LastDriveMediaType ; - BOOLEAN FloppyControllerAllocated ; - BOOLEAN ACPI_BIOS ; - UCHAR DriveType ; - ULONG BytesPerSector ; - ULONG ByteCapacity ; - MEDIA_TYPE MediaType ; - DRIVE_MEDIA_TYPE DriveMediaType ; - UCHAR DeviceUnit ; - UCHAR DriveOnValue ; - BOOLEAN IsReadOnly ; - DRIVE_MEDIA_CONSTANTS BiosDriveMediaConstants ; - DRIVE_MEDIA_CONSTANTS DriveMediaConstants ; - UCHAR PerpendicularMode ; - BOOLEAN ControllerConfigurable ; - UNICODE_STRING DeviceName ; - UNICODE_STRING InterfaceString ; - UNICODE_STRING ArcName ; - BOOLEAN ReleaseFdcWithMotorRunning ; - BOOLEAN PoweringDown ; - FAST_MUTEX PowerDownMutex ; - FAST_MUTEX HoldNewReqMutex ; + KSPIN_LOCK FlCancelSpinLock; + PDEVICE_OBJECT UnderlyingPDO; + PDEVICE_OBJECT TargetObject; + BOOLEAN IsStarted; + BOOLEAN IsRemoved; + BOOLEAN HoldNewRequests; + LIST_ENTRY NewRequestQueue; + KSPIN_LOCK NewRequestQueueSpinLock; + PDEVICE_OBJECT DeviceObject; + KSEMAPHORE RequestSemaphore; + KSPIN_LOCK ListSpinLock; + FAST_MUTEX ThreadReferenceMutex; + LONG ThreadReferenceCount; + PKTHREAD FloppyThread; + LIST_ENTRY ListEntry; + BOOLEAN HardwareFailed; + UCHAR HardwareFailCount; + ULONG MaxTransferSize; + UCHAR FifoBuffer[10]; + PUCHAR IoBuffer; + PMDL IoBufferMdl; + ULONG IoBufferSize; + PDRIVER_OBJECT DriverObject; + DRIVE_MEDIA_TYPE LastDriveMediaType; + BOOLEAN FloppyControllerAllocated; + BOOLEAN ACPI_BIOS; + UCHAR DriveType; + ULONG BytesPerSector; + ULONG ByteCapacity; + MEDIA_TYPE MediaType; + DRIVE_MEDIA_TYPE DriveMediaType; + UCHAR DeviceUnit; + UCHAR DriveOnValue; + BOOLEAN IsReadOnly; + DRIVE_MEDIA_CONSTANTS BiosDriveMediaConstants; + DRIVE_MEDIA_CONSTANTS DriveMediaConstants; + UCHAR PerpendicularMode; + BOOLEAN ControllerConfigurable; + UNICODE_STRING DeviceName; + UNICODE_STRING InterfaceString; + UNICODE_STRING ArcName; + BOOLEAN ReleaseFdcWithMotorRunning; + BOOLEAN PoweringDown; + FAST_MUTEX PowerDownMutex; + FAST_MUTEX HoldNewReqMutex; }; typedef struct _DISKETTE_EXTENSION DISKETTE_EXTENSION; typedef DISKETTE_EXTENSION *PDISKETTE_EXTENSION; struct _SENSE_DEVISE_STATUS_PTOS { - UCHAR ST3_PTOS ; + UCHAR ST3_PTOS; }; typedef struct _SENSE_DEVISE_STATUS_PTOS SENSE_DEVISE_STATUS_PTOS; typedef struct _SENSE_DEVISE_STATUS_PTOS *PSENSE_DEVISE_STATUS_PTOS; -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1726,1390 +1753,1481 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) #pragma once -extern int sprintf(char * , char const * , ...) ; -extern int swprintf(wchar_t * , wchar_t const * , ...) ; +extern int sprintf(char *, char const *, ...); +extern int swprintf(wchar_t *, wchar_t const *, ...); #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -extern void *memcpy(void * , void const * , size_t ) ; -extern void *memset(void * , int , size_t ) ; -extern void *memmove(void * , void const * , size_t ) ; -extern PKTHREAD KeGetCurrentThread() ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; +extern void *memcpy(void *, void const *, size_t); +extern void *memset(void *, int, size_t); +extern void *memmove(void *, void const *, size_t); +extern PKTHREAD KeGetCurrentThread(); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -extern LONG InterlockedExchange(PLONG Target , - LONG Value ) ; -#pragma warning(disable:4035) +extern LONG InterlockedExchange(PLONG Target, LONG Value); +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; -extern KPRIORITY KeSetPriorityThread(PKTHREAD Thread , - KPRIORITY Priority ) ; - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; -extern KIRQL KfAcquireSpinLock(PKSPIN_LOCK SpinLock ) ; - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; - void ExFreePool(PVOID P ) ; - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; -extern void MmProbeAndLockPages(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - LOCK_OPERATION Operation ) ; - void MmUnlockPages(PMDL MemoryDescriptorList ) ; - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; - void MmFreeContiguousMemory(PVOID BaseAddress ) ; - void MmResetDriverPaging(PVOID AddressWithinSection ) ; - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; - void IoFreeIrp(PIRP Irp ) ; - void IoFreeMdl(PMDL Mdl ) ; - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; - void IoReleaseCancelSpinLock(KIRQL Irql ) ; - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -#pragma warning(disable:4200) -#pragma warning(default:4200) - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void PoStartNextPowerIrp(PIRP Irp ) ; - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; - void ObfDereferenceObject(PVOID Object ) ; - NTSTATUS ZwClose(HANDLE Handle ) ; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +extern KPRIORITY KeSetPriorityThread(PKTHREAD Thread, KPRIORITY Priority); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +extern KIRQL KfAcquireSpinLock(PKSPIN_LOCK SpinLock); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +void ExFreePool(PVOID P); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +extern void MmProbeAndLockPages(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + LOCK_OPERATION Operation); +void MmUnlockPages(PMDL MemoryDescriptorList); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmResetDriverPaging(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoFreeIrp(PIRP Irp); +void IoFreeMdl(PMDL Mdl); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +void ObfDereferenceObject(PVOID Object); +NTSTATUS ZwClose(HANDLE Handle); #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma once #pragma once - struct _GUID const MOUNTDEV_MOUNTED_DEVICE_GUID = {1408590605, - 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; +struct _GUID const MOUNTDEV_MOUNTED_DEVICE_GUID = { + 1408590605, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}}; #pragma once -DRIVE_MEDIA_LIMITS _DriveMediaLimits[5] = { {4, 0}, - {11, 6}, - {5, 5}, - {13, 12}, - {16, 14}}; -DRIVE_MEDIA_LIMITS_NEC98 _DriveMediaLimits_NEC98[6] = { {4, 0}, - {13, 5}, - {11, 5}, - {18, 14}, - {18, 14}, - {20, 19}}; -PDRIVE_MEDIA_LIMITS DriveMediaLimits ; -DRIVE_MEDIA_CONSTANTS _DriveMediaConstants[17] = - { {10, 223, 2, 37, 2, 512, 8, 42, 80, 246, 15, 1000, 1000, 39, 0, 2, 1, 255, 254, - 0}, - {9, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 1000, 1000, 39, 0, 2, 1, 255, 252, - 0}, - {7, 223, 2, 37, 2, 512, 8, 42, 80, 246, 15, 1000, 1000, 39, 0, 2, 2, 255, 255, - 0}, - {8, 223, 2, 37, 3, 1024, 4, 128, 240, 246, 15, 1000, 1000, 39, 0, 2, 2, 255, - 255, 0}, - {6, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 250, 1000, 39, 0, 2, 2, 255, 253, - 0}, - {5, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 500, 1000, 79, 0, 2, 2, 255, 249, - 2}, - {10, 223, 2, 37, 2, 512, 8, 42, 80, 246, 15, 1000, 1000, 39, 1, 1, 1, 255, 254, - 0}, - {9, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 1000, 1000, 39, 1, 1, 1, 255, 252, - 0}, - {7, 223, 2, 37, 2, 512, 8, 42, 80, 246, 15, 1000, 1000, 39, 1, 1, 2, 255, 255, - 0}, - {8, 223, 2, 37, 3, 1024, 4, 128, 240, 246, 15, 1000, 1000, 39, 1, 1, 2, 255, - 255, 0}, - {6, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 625, 1000, 39, 1, 1, 2, 255, 253, - 0}, - {1, 223, 2, 37, 2, 512, 15, 27, 84, 246, 15, 625, 1000, 79, 0, 0, 2, 255, 249, - 0}, - {5, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 500, 1000, 79, 0, 2, 2, 255, 249, - 2}, - {2, 175, 2, 37, 2, 512, 18, 27, 101, 246, 15, 500, 1000, 79, 0, 0, 2, 255, 240, - 3}, - {5, 225, 2, 37, 2, 512, 9, 42, 80, 246, 15, 500, 1000, 79, 0, 2, 2, 255, 249, - 2}, - {2, 209, 2, 37, 2, 512, 18, 27, 101, 246, 15, 500, 1000, 79, 0, 0, 2, 255, 240, - 3}, - {3, 161, 2, 37, 2, 512, 36, 56, 83, 246, 15, 500, 1000, 79, 0, 3, 2, 255, 240, - 6}}; -DRIVE_MEDIA_CONSTANTS _DriveMediaConstants_NEC98[21] = - { {10, 223, 2, 37, 2, 512, 8, 42, 80, 246, 15, 1000, 1000, 39, 0, 2, 1, 255, 254, - 0}, - {9, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 1000, 1000, 39, 0, 2, 1, 255, 252, - 0}, - {7, 223, 2, 37, 2, 512, 8, 42, 80, 246, 15, 1000, 1000, 39, 0, 2, 2, 255, 255, - 0}, - {8, 223, 2, 37, 3, 1024, 4, 128, 240, 246, 15, 1000, 1000, 39, 0, 2, 2, 255, - 255, 0}, - {6, 223, 2, 37, 2, 512, 9, 42, 80, 246, 15, 250, 1000, 39, 0, 2, 2, 255, 253, - 0}, - {10, 223, 22, 37, 2, 512, 8, 42, 80, 229, 15, 1000, 1000, 39, 1, 2, 1, 255, 254, - 0}, - {9, 223, 22, 37, 2, 512, 9, 42, 80, 229, 15, 1000, 1000, 39, 1, 2, 1, 255, 252, - 0}, - {7, 223, 22, 37, 2, 512, 8, 42, 80, 229, 15, 1000, 1000, 39, 1, 2, 2, 255, 255, - 0}, - {8, 223, 22, 37, 3, 1024, 4, 128, 240, 229, 15, 1000, 1000, 39, 1, 2, 2, 255, - 255, 0}, - {6, 223, 22, 37, 2, 512, 9, 42, 80, 229, 15, 1000, 1000, 39, 1, 2, 2, 255, 253, - 0}, - {15, 223, 22, 37, 2, 512, 8, 42, 80, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, 251, - 0}, - {16, 223, 22, 37, 2, 512, 9, 42, 80, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, 249, - 2}, - {1, 207, 36, 37, 2, 512, 15, 27, 84, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, 249, - 0}, - {19, 207, 36, 37, 3, 1024, 8, 53, 116, 229, 15, 1000, 1000, 76, 0, 0, 2, 255, - 254, 0}, - {14, 223, 22, 37, 2, 512, 8, 42, 80, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, 251, - 0}, - {5, 223, 22, 37, 2, 512, 9, 42, 80, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, 249, - 2}, - {17, 207, 36, 37, 2, 512, 15, 27, 84, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, - 249, 0}, - {18, 207, 36, 37, 3, 1024, 8, 53, 116, 229, 15, 1000, 1000, 76, 0, 0, 2, 255, - 254, 0}, - {2, 223, 36, 37, 2, 512, 18, 27, 108, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, - 240, 3}, - {1, 191, 50, 37, 2, 512, 15, 27, 84, 229, 15, 1000, 1000, 79, 0, 0, 2, 255, 249, - 0}, - {19, 191, 50, 37, 3, 1024, 8, 53, 116, 229, 15, 1000, 1000, 76, 0, 0, 2, 255, - 254, 0}}; -PDRIVE_MEDIA_CONSTANTS DriveMediaConstants ; -SENSE_DEVISE_STATUS_PTOS Result_Status3_PTOS[4] ; -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) ; -void FloppyUnload(PDRIVER_OBJECT DriverObject ) ; -NTSTATUS FlConfigCallBack(PVOID Context , PUNICODE_STRING PathName , INTERFACE_TYPE BusType , - ULONG BusNumber , PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ; -NTSTATUS FlInitializeControllerHardware(PDISKETTE_EXTENSION DisketteExtension ) ; -NTSTATUS FloppyCreateClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS FloppyReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS FlRecalibrateDrive(PDISKETTE_EXTENSION DisketteExtension ) ; -NTSTATUS FlDatarateSpecifyConfigure(PDISKETTE_EXTENSION DisketteExtension ) ; -NTSTATUS FlStartDrive(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp , BOOLEAN WriteOperation , - BOOLEAN SetUpMedia , BOOLEAN IgnoreChange ) ; -void FlFinishOperation(PIRP Irp , PDISKETTE_EXTENSION DisketteExtension ) ; -NTSTATUS FlDetermineMediaType(PDISKETTE_EXTENSION DisketteExtension ) ; -void FloppyThread(PVOID Context ) ; -NTSTATUS FlReadWrite(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp , BOOLEAN DriveStarted ) ; -NTSTATUS FlFormat(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp ) ; -NTSTATUS FlIssueCommand(PDISKETTE_EXTENSION DisketteExtension , PUCHAR FifoInBuffer , - PUCHAR FifoOutBuffer , PMDL IoMdl , ULONG IoOffset , ULONG TransferBytes ) ; -BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension , PFORMAT_PARAMETERS FormatParameters ) ; -NTSTATUS FlQueueIrpToThread(PIRP Irp , PDISKETTE_EXTENSION DisketteExtension ) ; -NTSTATUS FlInterpretError(UCHAR StatusRegister1 , UCHAR StatusRegister2 ) ; -void FlAllocateIoBuffer(PDISKETTE_EXTENSION DisketteExtension , ULONG BufferSize ) ; -void FlFreeIoBuffer(PDISKETTE_EXTENSION DisketteExtension ) ; -void FlConsolidateMediaTypeWithBootSector(PDISKETTE_EXTENSION DisketteExtension , - PBOOT_SECTOR_INFO BootSector ) ; -void FlCheckBootSector(PDISKETTE_EXTENSION DisketteExtension ) ; -NTSTATUS FlReadWriteTrack(PDISKETTE_EXTENSION DisketteExtension , PMDL IoMdl , ULONG IoOffset , - BOOLEAN WriteOperation , UCHAR Cylinder , UCHAR Head , UCHAR Sector , - UCHAR NumberOfSectors , BOOLEAN NeedSeek ) ; -NTSTATUS FlFdcDeviceIo(PDEVICE_OBJECT DeviceObject , ULONG Ioctl , PVOID Data ) ; -NTSTATUS FloppyAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) ; -NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS FloppyPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS FloppyPnpComplete(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -NTSTATUS FloppyQueueRequest(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp ) ; -NTSTATUS FloppyStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void FloppyProcessQueuedRequests(PDISKETTE_EXTENSION DisketteExtension ) ; -void FloppyCancelQueuedRequest(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS FlAcpiConfigureFloppy(PDISKETTE_EXTENSION DisketteExtension , PFDC_INFO FdcInfo ) ; -NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension ) ; -#pragma alloc_text(INIT,DriverEntry) -#pragma alloc_text(PAGE,FloppyAddDevice) -#pragma alloc_text(PAGE,FloppyPnp) -#pragma alloc_text(PAGE,FloppyPower) -#pragma alloc_text(PAGE,FlConfigCallBack) -#pragma alloc_text(PAGE,FlInitializeControllerHardware) -#pragma alloc_text(PAGE,FlInterpretError) -#pragma alloc_text(PAGE,FlDatarateSpecifyConfigure) -#pragma alloc_text(PAGE,FlRecalibrateDrive) -#pragma alloc_text(PAGE,FlDetermineMediaType) -#pragma alloc_text(PAGE,FlCheckBootSector) -#pragma alloc_text(PAGE,FlConsolidateMediaTypeWithBootSector) -#pragma alloc_text(PAGE,FlIssueCommand) -#pragma alloc_text(PAGE,FlReadWriteTrack) -#pragma alloc_text(PAGE,FlReadWrite) -#pragma alloc_text(PAGE,FlFormat) -#pragma alloc_text(PAGE,FlFinishOperation) -#pragma alloc_text(PAGE,FlStartDrive) -#pragma alloc_text(PAGE,FloppyThread) -#pragma alloc_text(PAGE,FlAllocateIoBuffer) -#pragma alloc_text(PAGE,FlFreeIoBuffer) -#pragma alloc_text(PAGE,FloppyCreateClose) -#pragma alloc_text(PAGE,FloppyDeviceControl) -#pragma alloc_text(PAGE,FloppyReadWrite) -#pragma alloc_text(PAGE,FlCheckFormatParameters) -#pragma alloc_text(PAGE,FlFdcDeviceIo) -#pragma alloc_text(PAGE,FlHdbit) -void errorFn(void) -{ - - { - ERROR: assert(0); - goto ERROR; -} -} -NTSTATUS myStatus ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -void _BLAST_init(void) -{ - - { - UNLOADED = 0; - NP = 1; - DC = 2; - SKIP1 = 3; - SKIP2 = 4; - MPR1 = 5; - MPR3 = 6; - IPC = 7; - s = UNLOADED; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - return; -} -} -ULONG PagingReferenceCount = 0; -PFAST_MUTEX PagingMutex = (void *)0; -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) -{ NTSTATUS ntStatus ; - PVOID tmp ; - - { - ntStatus = 0L; - { - } - { - DriverObject->MajorFunction[0] = & FloppyCreateClose; - DriverObject->MajorFunction[2] = & FloppyCreateClose; - DriverObject->MajorFunction[3] = & FloppyReadWrite; - DriverObject->MajorFunction[4] = & FloppyReadWrite; - DriverObject->MajorFunction[14] = & FloppyDeviceControl; - DriverObject->MajorFunction[27] = & FloppyPnp; - DriverObject->MajorFunction[22] = & FloppyPower; - DriverObject->DriverUnload = & FloppyUnload; - (DriverObject->DriverExtension)->AddDevice = & FloppyAddDevice; - tmp = ExAllocatePoolWithTag(0, sizeof(FAST_MUTEX ), 1886350406UL); - PagingMutex = tmp; - } - if ((unsigned int )PagingMutex == (unsigned int )((void *)0)) { - return (-1073741670L); - } else { - - } - { - PagingMutex->Count = 1; - PagingMutex->Contention = 0; -/* KeInitializeEvent(& PagingMutex->Event, 1, 0); */ /* INLINED */ -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - DriveMediaLimits = (struct _DRIVE_MEDIA_LIMITS *)(_DriveMediaLimits_NEC98); - } else { - DriveMediaLimits = _DriveMediaLimits; - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - DriveMediaConstants = _DriveMediaConstants_NEC98; - } else { - DriveMediaConstants = _DriveMediaConstants; +DRIVE_MEDIA_LIMITS _DriveMediaLimits[5] = { + {4, 0}, {11, 6}, {5, 5}, {13, 12}, {16, 14}}; +DRIVE_MEDIA_LIMITS_NEC98 _DriveMediaLimits_NEC98[6] = { + {4, 0}, {13, 5}, {11, 5}, {18, 14}, {18, 14}, {20, 19}}; +PDRIVE_MEDIA_LIMITS DriveMediaLimits; +DRIVE_MEDIA_CONSTANTS _DriveMediaConstants[17] = { + {10, 223, 2, 37, 2, 512, 8, 42, 80, 246, + 15, 1000, 1000, 39, 0, 2, 1, 255, 254, 0}, + {9, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 1000, 1000, 39, 0, 2, 1, 255, 252, 0}, + {7, 223, 2, 37, 2, 512, 8, 42, 80, 246, + 15, 1000, 1000, 39, 0, 2, 2, 255, 255, 0}, + {8, 223, 2, 37, 3, 1024, 4, 128, 240, 246, + 15, 1000, 1000, 39, 0, 2, 2, 255, 255, 0}, + {6, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 250, 1000, 39, 0, 2, 2, 255, 253, 0}, + {5, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 500, 1000, 79, 0, 2, 2, 255, 249, 2}, + {10, 223, 2, 37, 2, 512, 8, 42, 80, 246, + 15, 1000, 1000, 39, 1, 1, 1, 255, 254, 0}, + {9, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 1000, 1000, 39, 1, 1, 1, 255, 252, 0}, + {7, 223, 2, 37, 2, 512, 8, 42, 80, 246, + 15, 1000, 1000, 39, 1, 1, 2, 255, 255, 0}, + {8, 223, 2, 37, 3, 1024, 4, 128, 240, 246, + 15, 1000, 1000, 39, 1, 1, 2, 255, 255, 0}, + {6, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 625, 1000, 39, 1, 1, 2, 255, 253, 0}, + {1, 223, 2, 37, 2, 512, 15, 27, 84, 246, + 15, 625, 1000, 79, 0, 0, 2, 255, 249, 0}, + {5, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 500, 1000, 79, 0, 2, 2, 255, 249, 2}, + {2, 175, 2, 37, 2, 512, 18, 27, 101, 246, + 15, 500, 1000, 79, 0, 0, 2, 255, 240, 3}, + {5, 225, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 500, 1000, 79, 0, 2, 2, 255, 249, 2}, + {2, 209, 2, 37, 2, 512, 18, 27, 101, 246, + 15, 500, 1000, 79, 0, 0, 2, 255, 240, 3}, + {3, 161, 2, 37, 2, 512, 36, 56, 83, 246, + 15, 500, 1000, 79, 0, 3, 2, 255, 240, 6}}; +DRIVE_MEDIA_CONSTANTS _DriveMediaConstants_NEC98[21] = { + {10, 223, 2, 37, 2, 512, 8, 42, 80, 246, + 15, 1000, 1000, 39, 0, 2, 1, 255, 254, 0}, + {9, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 1000, 1000, 39, 0, 2, 1, 255, 252, 0}, + {7, 223, 2, 37, 2, 512, 8, 42, 80, 246, + 15, 1000, 1000, 39, 0, 2, 2, 255, 255, 0}, + {8, 223, 2, 37, 3, 1024, 4, 128, 240, 246, + 15, 1000, 1000, 39, 0, 2, 2, 255, 255, 0}, + {6, 223, 2, 37, 2, 512, 9, 42, 80, 246, + 15, 250, 1000, 39, 0, 2, 2, 255, 253, 0}, + {10, 223, 22, 37, 2, 512, 8, 42, 80, 229, + 15, 1000, 1000, 39, 1, 2, 1, 255, 254, 0}, + {9, 223, 22, 37, 2, 512, 9, 42, 80, 229, + 15, 1000, 1000, 39, 1, 2, 1, 255, 252, 0}, + {7, 223, 22, 37, 2, 512, 8, 42, 80, 229, + 15, 1000, 1000, 39, 1, 2, 2, 255, 255, 0}, + {8, 223, 22, 37, 3, 1024, 4, 128, 240, 229, + 15, 1000, 1000, 39, 1, 2, 2, 255, 255, 0}, + {6, 223, 22, 37, 2, 512, 9, 42, 80, 229, + 15, 1000, 1000, 39, 1, 2, 2, 255, 253, 0}, + {15, 223, 22, 37, 2, 512, 8, 42, 80, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 251, 0}, + {16, 223, 22, 37, 2, 512, 9, 42, 80, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 249, 2}, + {1, 207, 36, 37, 2, 512, 15, 27, 84, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 249, 0}, + {19, 207, 36, 37, 3, 1024, 8, 53, 116, 229, + 15, 1000, 1000, 76, 0, 0, 2, 255, 254, 0}, + {14, 223, 22, 37, 2, 512, 8, 42, 80, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 251, 0}, + {5, 223, 22, 37, 2, 512, 9, 42, 80, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 249, 2}, + {17, 207, 36, 37, 2, 512, 15, 27, 84, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 249, 0}, + {18, 207, 36, 37, 3, 1024, 8, 53, 116, 229, + 15, 1000, 1000, 76, 0, 0, 2, 255, 254, 0}, + {2, 223, 36, 37, 2, 512, 18, 27, 108, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 240, 3}, + {1, 191, 50, 37, 2, 512, 15, 27, 84, 229, + 15, 1000, 1000, 79, 0, 0, 2, 255, 249, 0}, + {19, 191, 50, 37, 3, 1024, 8, 53, 116, 229, + 15, 1000, 1000, 76, 0, 0, 2, 255, 254, 0}}; +PDRIVE_MEDIA_CONSTANTS DriveMediaConstants; +SENSE_DEVISE_STATUS_PTOS Result_Status3_PTOS[4]; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath); +void FloppyUnload(PDRIVER_OBJECT DriverObject); +NTSTATUS FlConfigCallBack(PVOID Context, PUNICODE_STRING PathName, + INTERFACE_TYPE BusType, ULONG BusNumber, + PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, + ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, + ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation); +NTSTATUS FlInitializeControllerHardware(PDISKETTE_EXTENSION DisketteExtension); +NTSTATUS FloppyCreateClose(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS FloppyReadWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS FlRecalibrateDrive(PDISKETTE_EXTENSION DisketteExtension); +NTSTATUS FlDatarateSpecifyConfigure(PDISKETTE_EXTENSION DisketteExtension); +NTSTATUS FlStartDrive(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp, + BOOLEAN WriteOperation, BOOLEAN SetUpMedia, + BOOLEAN IgnoreChange); +void FlFinishOperation(PIRP Irp, PDISKETTE_EXTENSION DisketteExtension); +NTSTATUS FlDetermineMediaType(PDISKETTE_EXTENSION DisketteExtension); +void FloppyThread(PVOID Context); +NTSTATUS FlReadWrite(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp, + BOOLEAN DriveStarted); +NTSTATUS FlFormat(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp); +NTSTATUS FlIssueCommand(PDISKETTE_EXTENSION DisketteExtension, + PUCHAR FifoInBuffer, PUCHAR FifoOutBuffer, PMDL IoMdl, + ULONG IoOffset, ULONG TransferBytes); +BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension, + PFORMAT_PARAMETERS FormatParameters); +NTSTATUS FlQueueIrpToThread(PIRP Irp, PDISKETTE_EXTENSION DisketteExtension); +NTSTATUS FlInterpretError(UCHAR StatusRegister1, UCHAR StatusRegister2); +void FlAllocateIoBuffer(PDISKETTE_EXTENSION DisketteExtension, + ULONG BufferSize); +void FlFreeIoBuffer(PDISKETTE_EXTENSION DisketteExtension); +void FlConsolidateMediaTypeWithBootSector(PDISKETTE_EXTENSION DisketteExtension, + PBOOT_SECTOR_INFO BootSector); +void FlCheckBootSector(PDISKETTE_EXTENSION DisketteExtension); +NTSTATUS FlReadWriteTrack(PDISKETTE_EXTENSION DisketteExtension, PMDL IoMdl, + ULONG IoOffset, BOOLEAN WriteOperation, + UCHAR Cylinder, UCHAR Head, UCHAR Sector, + UCHAR NumberOfSectors, BOOLEAN NeedSeek); +NTSTATUS FlFdcDeviceIo(PDEVICE_OBJECT DeviceObject, ULONG Ioctl, PVOID Data); +NTSTATUS FloppyAddDevice(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject); +NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS FloppyPower(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS FloppyPnpComplete(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context); +NTSTATUS FloppyQueueRequest(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp); +NTSTATUS FloppyStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void FloppyProcessQueuedRequests(PDISKETTE_EXTENSION DisketteExtension); +void FloppyCancelQueuedRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS FlAcpiConfigureFloppy(PDISKETTE_EXTENSION DisketteExtension, + PFDC_INFO FdcInfo); +NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension); +#pragma alloc_text(INIT, DriverEntry) +#pragma alloc_text(PAGE, FloppyAddDevice) +#pragma alloc_text(PAGE, FloppyPnp) +#pragma alloc_text(PAGE, FloppyPower) +#pragma alloc_text(PAGE, FlConfigCallBack) +#pragma alloc_text(PAGE, FlInitializeControllerHardware) +#pragma alloc_text(PAGE, FlInterpretError) +#pragma alloc_text(PAGE, FlDatarateSpecifyConfigure) +#pragma alloc_text(PAGE, FlRecalibrateDrive) +#pragma alloc_text(PAGE, FlDetermineMediaType) +#pragma alloc_text(PAGE, FlCheckBootSector) +#pragma alloc_text(PAGE, FlConsolidateMediaTypeWithBootSector) +#pragma alloc_text(PAGE, FlIssueCommand) +#pragma alloc_text(PAGE, FlReadWriteTrack) +#pragma alloc_text(PAGE, FlReadWrite) +#pragma alloc_text(PAGE, FlFormat) +#pragma alloc_text(PAGE, FlFinishOperation) +#pragma alloc_text(PAGE, FlStartDrive) +#pragma alloc_text(PAGE, FloppyThread) +#pragma alloc_text(PAGE, FlAllocateIoBuffer) +#pragma alloc_text(PAGE, FlFreeIoBuffer) +#pragma alloc_text(PAGE, FloppyCreateClose) +#pragma alloc_text(PAGE, FloppyDeviceControl) +#pragma alloc_text(PAGE, FloppyReadWrite) +#pragma alloc_text(PAGE, FlCheckFormatParameters) +#pragma alloc_text(PAGE, FlFdcDeviceIo) +#pragma alloc_text(PAGE, FlHdbit) +void errorFn(void) { + + { + ERROR: + assert(0); + goto ERROR; + } +} +NTSTATUS myStatus; +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +void _BLAST_init(void) { + + { + UNLOADED = 0; + NP = 1; + DC = 2; + SKIP1 = 3; + SKIP2 = 4; + MPR1 = 5; + MPR3 = 6; + IPC = 7; + s = UNLOADED; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + return; } - return (ntStatus); -} } -void FloppyUnload(PDRIVER_OBJECT DriverObject ) -{ - - { - { - } - { -/* ExFreePool(PagingMutex); */ /* INLINED */ +ULONG PagingReferenceCount = 0; +PFAST_MUTEX PagingMutex = (void *)0; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, + PUNICODE_STRING RegistryPath) { + NTSTATUS ntStatus; + PVOID tmp; + + { + ntStatus = 0L; + {} { + DriverObject->MajorFunction[0] = &FloppyCreateClose; + DriverObject->MajorFunction[2] = &FloppyCreateClose; + DriverObject->MajorFunction[3] = &FloppyReadWrite; + DriverObject->MajorFunction[4] = &FloppyReadWrite; + DriverObject->MajorFunction[14] = &FloppyDeviceControl; + DriverObject->MajorFunction[27] = &FloppyPnp; + DriverObject->MajorFunction[22] = &FloppyPower; + DriverObject->DriverUnload = &FloppyUnload; + (DriverObject->DriverExtension)->AddDevice = &FloppyAddDevice; + tmp = ExAllocatePoolWithTag(0, sizeof(FAST_MUTEX), 1886350406UL); + PagingMutex = tmp; + } + if ((unsigned int)PagingMutex == (unsigned int)((void *)0)) { + return (-1073741670L); + } else { + } + { + PagingMutex->Count = 1; + PagingMutex->Contention = 0; + /* KeInitializeEvent(& PagingMutex->Event, 1, 0); */ /* INLINED */ + /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + DriveMediaLimits = + (struct _DRIVE_MEDIA_LIMITS *)(_DriveMediaLimits_NEC98); + } else { + DriveMediaLimits = _DriveMediaLimits; + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + DriveMediaConstants = _DriveMediaConstants_NEC98; + } else { + DriveMediaConstants = _DriveMediaConstants; + } + return (ntStatus); } - return; -} } -NTSTATUS FloppyAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) -{ NTSTATUS ntStatus ; - PDEVICE_OBJECT deviceObject ; - PDISKETTE_EXTENSION disketteExtension ; - FDC_INFO fdcInfo ; - UCHAR arcNameBuffer[256] ; - STRING arcNameString ; - WCHAR deviceNameBuffer[20] ; - UNICODE_STRING deviceName ; - USHORT i ; - USHORT tmp ; - PVOID tmp___0 ; - PCONFIGURATION_INFORMATION tmp___1 ; +void FloppyUnload(PDRIVER_OBJECT DriverObject) { { - ntStatus = 0L; - { - } - { - fdcInfo.BufferCount = 0; - fdcInfo.BufferSize = 0; - ntStatus = FlFdcDeviceIo(PhysicalDeviceObject, ((7 << 16) | (770 << 2)) | 3, & fdcInfo); - } - if (ntStatus >= 0L) { - i = 0; - { - while (1) { - while_3_continue: /* CIL Label */ ; - { - tmp = i; - i = (USHORT )((int )i + 1); - swprintf(deviceNameBuffer, "\\\000D\000e\000v\000i\000c\000e\000\\\000F\000l\000o\000p\000p\000y\000%\000d\000", - tmp); -/* RtlInitUnicodeString(& deviceName, deviceNameBuffer); */ /* INLINED */ - ntStatus = IoCreateDevice(DriverObject, sizeof(DISKETTE_EXTENSION ), & deviceName, - 7, 261, 0, & deviceObject); - } - if (ntStatus == -1073741771L) { - - } else { - goto while_3_break; - } + {} { /* ExFreePool(PagingMutex); */ /* INLINED */ } - while_3_break: /* CIL Label */ ; + return; + } +} +NTSTATUS FloppyAddDevice(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject) { + NTSTATUS ntStatus; + PDEVICE_OBJECT deviceObject; + PDISKETTE_EXTENSION disketteExtension; + FDC_INFO fdcInfo; + UCHAR arcNameBuffer[256]; + STRING arcNameString; + WCHAR deviceNameBuffer[20]; + UNICODE_STRING deviceName; + USHORT i; + USHORT tmp; + PVOID tmp___0; + PCONFIGURATION_INFORMATION tmp___1; + + { + ntStatus = 0L; + {} { + fdcInfo.BufferCount = 0; + fdcInfo.BufferSize = 0; + ntStatus = FlFdcDeviceIo(PhysicalDeviceObject, + ((7 << 16) | (770 << 2)) | 3, &fdcInfo); } if (ntStatus >= 0L) { - disketteExtension = (DISKETTE_EXTENSION *)deviceObject->DeviceExtension; - { - } + i = 0; { - tmp___0 = ExAllocatePoolWithTag(1, deviceName.Length, 1886350406UL); - disketteExtension->DeviceName.Buffer = tmp___0; - } - if ((unsigned int )disketteExtension->DeviceName.Buffer == (unsigned int )((void *)0)) { - { -/* IoDeleteDevice(deviceObject); */ /* INLINED */ - } - return (-1073741670L); - } else { + while (1) { + while_3_continue: /* CIL Label */; + { + tmp = i; + i = (USHORT)((int)i + 1); + swprintf(deviceNameBuffer, "\\\000D\000e\000v\000i\000c\000e\000\\" + "\000F\000l\000o\000p\000p\000y\000%" + "\000d\000", + tmp); + /* RtlInitUnicodeString(& deviceName, deviceNameBuffer); */ /* INLINED */ + ntStatus = IoCreateDevice(DriverObject, sizeof(DISKETTE_EXTENSION), + &deviceName, 7, 261, 0, &deviceObject); + } + if (ntStatus == -1073741771L) { - } - { - disketteExtension->DeviceName.Length = 0; - disketteExtension->DeviceName.MaximumLength = deviceName.Length; -/* RtlCopyUnicodeString(& disketteExtension->DeviceName, & deviceName); */ /* INLINED */ - tmp___1 = IoGetConfigurationInformation(); - tmp___1->FloppyCount += 1UL; - sprintf(arcNameBuffer, "%s(%d)disk(%d)fdisk(%d)", "\\ArcName\\multi", fdcInfo.BusNumber, - fdcInfo.ControllerNumber, fdcInfo.PeripheralNumber); -/* RtlInitString(& arcNameString, arcNameBuffer); */ /* INLINED */ - ntStatus = RtlAnsiStringToUnicodeString(& disketteExtension->ArcName, & arcNameString, - 1); + } else { + goto while_3_break; + } + } + while_3_break: /* CIL Label */; } if (ntStatus >= 0L) { + disketteExtension = (DISKETTE_EXTENSION *)deviceObject->DeviceExtension; + {} { + tmp___0 = ExAllocatePoolWithTag(1, deviceName.Length, 1886350406UL); + disketteExtension->DeviceName.Buffer = tmp___0; + } + if ((unsigned int)disketteExtension->DeviceName.Buffer == + (unsigned int)((void *)0)) { + { /* IoDeleteDevice(deviceObject); */ /* INLINED */ + } + return (-1073741670L); + } else { + } { - IoCreateSymbolicLink(& disketteExtension->ArcName, & deviceName); + disketteExtension->DeviceName.Length = 0; + disketteExtension->DeviceName.MaximumLength = deviceName.Length; + /* RtlCopyUnicodeString(& disketteExtension->DeviceName, & deviceName); */ /* INLINED */ + tmp___1 = IoGetConfigurationInformation(); + tmp___1->FloppyCount += 1UL; + sprintf(arcNameBuffer, "%s(%d)disk(%d)fdisk(%d)", "\\ArcName\\multi", + fdcInfo.BusNumber, fdcInfo.ControllerNumber, + fdcInfo.PeripheralNumber); + /* RtlInitString(& arcNameString, arcNameBuffer); */ /* INLINED + */ + ntStatus = RtlAnsiStringToUnicodeString(&disketteExtension->ArcName, + &arcNameString, 1); + } + if (ntStatus >= 0L) { + { IoCreateSymbolicLink(&disketteExtension->ArcName, &deviceName); } + } else { + } + deviceObject->Flags |= 8208UL; + if (deviceObject->AlignmentRequirement < 1UL) { + deviceObject->AlignmentRequirement = 1; + } else { + } + deviceObject->Flags &= 4294967167UL; + disketteExtension->DriverObject = DriverObject; + disketteExtension->UnderlyingPDO = PhysicalDeviceObject; + {} { + disketteExtension->TargetObject = + IoAttachDeviceToDeviceStack(deviceObject, PhysicalDeviceObject); + } + {} { + /* KeInitializeSemaphore(& disketteExtension->RequestSemaphore, 0L, 2147483647); */ /* INLINED */ + disketteExtension->PowerDownMutex.Count = 1; + disketteExtension->PowerDownMutex.Contention = 0; + /* KeInitializeEvent(& disketteExtension->PowerDownMutex.Event, 1, 0); */ /* INLINED */ + /* KeInitializeSpinLock(& disketteExtension->ListSpinLock); */ /* INLINED */ + disketteExtension->ThreadReferenceMutex.Count = 1; + disketteExtension->ThreadReferenceMutex.Contention = 0; + /* KeInitializeEvent(& disketteExtension->ThreadReferenceMutex.Event, 1, 0); */ /* INLINED */ + disketteExtension->HoldNewReqMutex.Count = 1; + disketteExtension->HoldNewReqMutex.Contention = 0; + /* KeInitializeEvent(& disketteExtension->HoldNewReqMutex.Event, 1, 0); */ /* INLINED */ + disketteExtension->ListEntry.Blink = &disketteExtension->ListEntry; + disketteExtension->ListEntry.Flink = + disketteExtension->ListEntry.Blink; + disketteExtension->ThreadReferenceCount = -1; + disketteExtension->IsStarted = 0; + disketteExtension->IsRemoved = 0; + disketteExtension->HoldNewRequests = 0; + disketteExtension->NewRequestQueue.Blink = + &disketteExtension->NewRequestQueue; + disketteExtension->NewRequestQueue.Flink = + disketteExtension->NewRequestQueue.Blink; + /* KeInitializeSpinLock(& disketteExtension->NewRequestQueueSpinLock); */ /* INLINED */ + /* KeInitializeSpinLock(& disketteExtension->FlCancelSpinLock); */ /* INLINED */ + disketteExtension->FloppyControllerAllocated = 0; + disketteExtension->ReleaseFdcWithMotorRunning = 0; + disketteExtension->DeviceObject = deviceObject; + disketteExtension->IsReadOnly = 0; + disketteExtension->MediaType = -1; + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + disketteExtension->ControllerConfigurable = 0; + } else { + disketteExtension->ControllerConfigurable = 1; } } else { - - } - deviceObject->Flags |= 8208UL; - if (deviceObject->AlignmentRequirement < 1UL) { - deviceObject->AlignmentRequirement = 1; - } else { - - } - deviceObject->Flags &= 4294967167UL; - disketteExtension->DriverObject = DriverObject; - disketteExtension->UnderlyingPDO = PhysicalDeviceObject; - { - } - { - disketteExtension->TargetObject = IoAttachDeviceToDeviceStack(deviceObject, - PhysicalDeviceObject); - } - { - } - { -/* KeInitializeSemaphore(& disketteExtension->RequestSemaphore, 0L, 2147483647); */ /* INLINED */ - disketteExtension->PowerDownMutex.Count = 1; - disketteExtension->PowerDownMutex.Contention = 0; -/* KeInitializeEvent(& disketteExtension->PowerDownMutex.Event, 1, 0); */ /* INLINED */ -/* KeInitializeSpinLock(& disketteExtension->ListSpinLock); */ /* INLINED */ - disketteExtension->ThreadReferenceMutex.Count = 1; - disketteExtension->ThreadReferenceMutex.Contention = 0; -/* KeInitializeEvent(& disketteExtension->ThreadReferenceMutex.Event, 1, 0); */ /* INLINED */ - disketteExtension->HoldNewReqMutex.Count = 1; - disketteExtension->HoldNewReqMutex.Contention = 0; -/* KeInitializeEvent(& disketteExtension->HoldNewReqMutex.Event, 1, 0); */ /* INLINED */ - disketteExtension->ListEntry.Blink = & disketteExtension->ListEntry; - disketteExtension->ListEntry.Flink = disketteExtension->ListEntry.Blink; - disketteExtension->ThreadReferenceCount = -1; - disketteExtension->IsStarted = 0; - disketteExtension->IsRemoved = 0; - disketteExtension->HoldNewRequests = 0; - disketteExtension->NewRequestQueue.Blink = & disketteExtension->NewRequestQueue; - disketteExtension->NewRequestQueue.Flink = disketteExtension->NewRequestQueue.Blink; -/* KeInitializeSpinLock(& disketteExtension->NewRequestQueueSpinLock); */ /* INLINED */ -/* KeInitializeSpinLock(& disketteExtension->FlCancelSpinLock); */ /* INLINED */ - disketteExtension->FloppyControllerAllocated = 0; - disketteExtension->ReleaseFdcWithMotorRunning = 0; - disketteExtension->DeviceObject = deviceObject; - disketteExtension->IsReadOnly = 0; - disketteExtension->MediaType = -1; - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - disketteExtension->ControllerConfigurable = 0; - } else { - disketteExtension->ControllerConfigurable = 1; } } else { - } - } else { - + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FlConfigCallBack(PVOID Context , PUNICODE_STRING PathName , INTERFACE_TYPE BusType , - ULONG BusNumber , PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) -{ PDISKETTE_EXTENSION disketteExtension ; - ULONG i ; - PCM_FULL_RESOURCE_DESCRIPTOR peripheralData ; - PCM_PARTIAL_RESOURCE_DESCRIPTOR partial ; - PCM_FLOPPY_DEVICE_DATA fDeviceData ; - UCHAR driveType ; - PDRIVE_MEDIA_CONSTANTS biosDriveMediaConstants ; - - { - disketteExtension = Context; - if (! ((UCHAR *)*(PeripheralInformation + 1) + (*(PeripheralInformation + 1))->DataLength)) { - return (-1073741811L); - } else { - - } - peripheralData = (struct _CM_FULL_RESOURCE_DESCRIPTOR *)((UCHAR *)*(PeripheralInformation + 1) + (*(PeripheralInformation + 1))->DataOffset); - i = 0; - { - while (1) { - while_7_continue: /* CIL Label */ ; - if (i < peripheralData->PartialResourceList.Count) { - +NTSTATUS FlConfigCallBack(PVOID Context, PUNICODE_STRING PathName, + INTERFACE_TYPE BusType, ULONG BusNumber, + PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, + ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, + ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation) { + PDISKETTE_EXTENSION disketteExtension; + ULONG i; + PCM_FULL_RESOURCE_DESCRIPTOR peripheralData; + PCM_PARTIAL_RESOURCE_DESCRIPTOR partial; + PCM_FLOPPY_DEVICE_DATA fDeviceData; + UCHAR driveType; + PDRIVE_MEDIA_CONSTANTS biosDriveMediaConstants; + + { + disketteExtension = Context; + if (!((UCHAR *)*(PeripheralInformation + 1) + + (*(PeripheralInformation + 1))->DataLength)) { + return (-1073741811L); } else { - goto while_7_break; - } - partial = & peripheralData->PartialResourceList.PartialDescriptors[i]; - if ((int )partial->Type == 5) { - biosDriveMediaConstants = & disketteExtension->BiosDriveMediaConstants; - fDeviceData = (struct _CM_FLOPPY_DEVICE_DATA *)(partial + 1); - if (fDeviceData->MaxDensity == 360) { - goto switch_8_360; - } else { - if (fDeviceData->MaxDensity == 1200) { - goto switch_8_1200; + } + peripheralData = (struct _CM_FULL_RESOURCE_DESCRIPTOR + *)((UCHAR *)*(PeripheralInformation + 1) + + (*(PeripheralInformation + 1))->DataOffset); + i = 0; + { + while (1) { + while_7_continue: /* CIL Label */; + if (i < peripheralData->PartialResourceList.Count) { + } else { - if (fDeviceData->MaxDensity == 1185) { - goto switch_8_1185; + goto while_7_break; + } + partial = &peripheralData->PartialResourceList.PartialDescriptors[i]; + if ((int)partial->Type == 5) { + biosDriveMediaConstants = &disketteExtension->BiosDriveMediaConstants; + fDeviceData = (struct _CM_FLOPPY_DEVICE_DATA *)(partial + 1); + if (fDeviceData->MaxDensity == 360) { + goto switch_8_360; } else { - if (fDeviceData->MaxDensity == 1423) { - goto switch_8_1423; + if (fDeviceData->MaxDensity == 1200) { + goto switch_8_1200; } else { - if (fDeviceData->MaxDensity == 1440) { - goto switch_8_1440; + if (fDeviceData->MaxDensity == 1185) { + goto switch_8_1185; } else { - if (fDeviceData->MaxDensity == 2880) { - goto switch_8_2880; + if (fDeviceData->MaxDensity == 1423) { + goto switch_8_1423; } else { - if (fDeviceData->MaxDensity == 1201) { - goto switch_8_1201; + if (fDeviceData->MaxDensity == 1440) { + goto switch_8_1440; } else { - { - goto switch_8_default; - if (0) { - switch_8_360: /* CIL Label */ - driveType = 0; - goto switch_8_break; - switch_8_1200: /* CIL Label */ - driveType = 1; - goto switch_8_break; - switch_8_1185: /* CIL Label */ - driveType = 1; - goto switch_8_break; - switch_8_1423: /* CIL Label */ - driveType = 3; - goto switch_8_break; - switch_8_1440: /* CIL Label */ - driveType = 3; - goto switch_8_break; - switch_8_2880: /* CIL Label */ - driveType = 4; - goto switch_8_break; - switch_8_1201: /* CIL Label */ ; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - driveType = 5; - goto switch_8_break; + if (fDeviceData->MaxDensity == 2880) { + goto switch_8_2880; + } else { + if (fDeviceData->MaxDensity == 1201) { + goto switch_8_1201; } else { - - } - switch_8_default: /* CIL Label */ ; - { - } - driveType = 1; - { + { + goto switch_8_default; + if (0) { + switch_8_360: /* CIL Label */ + driveType = 0; + goto switch_8_break; + switch_8_1200: /* CIL Label */ + driveType = 1; + goto switch_8_break; + switch_8_1185: /* CIL Label */ + driveType = 1; + goto switch_8_break; + switch_8_1423: /* CIL Label */ + driveType = 3; + goto switch_8_break; + switch_8_1440: /* CIL Label */ + driveType = 3; + goto switch_8_break; + switch_8_2880: /* CIL Label */ + driveType = 4; + goto switch_8_break; + switch_8_1201: /* CIL Label */; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + driveType = 5; + goto switch_8_break; + } else { + } + switch_8_default: /* CIL Label */; + {} + driveType = 1; + {} + goto switch_8_break; + } else { + switch_8_break: /* CIL Label */; + } + } } - goto switch_8_break; - } else { - switch_8_break: /* CIL Label */ ; - } } } } } } } - } - } - disketteExtension->DriveType = driveType; - *biosDriveMediaConstants = *(DriveMediaConstants + (DriveMediaLimits + driveType)->HighestDriveMediaType); - if ((int )fDeviceData->Version >= 2) { - biosDriveMediaConstants->StepRateHeadUnloadTime = fDeviceData->StepRateHeadUnloadTime; - biosDriveMediaConstants->HeadLoadTime = fDeviceData->HeadLoadTime; - biosDriveMediaConstants->MotorOffTime = fDeviceData->MotorOffTime; - biosDriveMediaConstants->SectorLengthCode = fDeviceData->SectorLengthCode; - if ((int )fDeviceData->SectorPerTrack == 0) { - return (0L); - } else { - - } - if (fDeviceData->MaxDensity == 0UL) { - return (0L); - } else { - - } - biosDriveMediaConstants->SectorsPerTrack = fDeviceData->SectorPerTrack; - biosDriveMediaConstants->ReadWriteGapLength = fDeviceData->ReadWriteGapLength; - biosDriveMediaConstants->FormatGapLength = fDeviceData->FormatGapLength; - biosDriveMediaConstants->FormatFillCharacter = fDeviceData->FormatFillCharacter; - biosDriveMediaConstants->HeadSettleTime = fDeviceData->HeadSettleTime; - biosDriveMediaConstants->MotorSettleTimeRead = ((int )fDeviceData->MotorSettleTime * 1000) / 8; - biosDriveMediaConstants->MotorSettleTimeWrite = ((int )fDeviceData->MotorSettleTime * 1000) / 8; - if ((int )fDeviceData->MaximumTrackValue == 0) { - return (0L); + disketteExtension->DriveType = driveType; + *biosDriveMediaConstants = + *(DriveMediaConstants + + (DriveMediaLimits + driveType)->HighestDriveMediaType); + if ((int)fDeviceData->Version >= 2) { + biosDriveMediaConstants->StepRateHeadUnloadTime = + fDeviceData->StepRateHeadUnloadTime; + biosDriveMediaConstants->HeadLoadTime = fDeviceData->HeadLoadTime; + biosDriveMediaConstants->MotorOffTime = fDeviceData->MotorOffTime; + biosDriveMediaConstants->SectorLengthCode = + fDeviceData->SectorLengthCode; + if ((int)fDeviceData->SectorPerTrack == 0) { + return (0L); + } else { + } + if (fDeviceData->MaxDensity == 0UL) { + return (0L); + } else { + } + biosDriveMediaConstants->SectorsPerTrack = + fDeviceData->SectorPerTrack; + biosDriveMediaConstants->ReadWriteGapLength = + fDeviceData->ReadWriteGapLength; + biosDriveMediaConstants->FormatGapLength = + fDeviceData->FormatGapLength; + biosDriveMediaConstants->FormatFillCharacter = + fDeviceData->FormatFillCharacter; + biosDriveMediaConstants->HeadSettleTime = + fDeviceData->HeadSettleTime; + biosDriveMediaConstants->MotorSettleTimeRead = + ((int)fDeviceData->MotorSettleTime * 1000) / 8; + biosDriveMediaConstants->MotorSettleTimeWrite = + ((int)fDeviceData->MotorSettleTime * 1000) / 8; + if ((int)fDeviceData->MaximumTrackValue == 0) { + return (0L); + } else { + } + biosDriveMediaConstants->MaximumTrack = + fDeviceData->MaximumTrackValue; + biosDriveMediaConstants->DataLength = + fDeviceData->DataTransferLength; + } else { + } } else { - } - biosDriveMediaConstants->MaximumTrack = fDeviceData->MaximumTrackValue; - biosDriveMediaConstants->DataLength = fDeviceData->DataTransferLength; - } else { - + i += 1UL; } - } else { - + while_7_break: /* CIL Label */; } - i += 1UL; + return (0L); } - while_7_break: /* CIL Label */ ; - } - return (0L); -} } -NTSTATUS FlAcpiConfigureFloppy(PDISKETTE_EXTENSION DisketteExtension , PFDC_INFO FdcInfo ) -{ UCHAR driveType ; - PDRIVE_MEDIA_CONSTANTS biosDriveMediaConstants ; +NTSTATUS FlAcpiConfigureFloppy(PDISKETTE_EXTENSION DisketteExtension, + PFDC_INFO FdcInfo) { + UCHAR driveType; + PDRIVE_MEDIA_CONSTANTS biosDriveMediaConstants; { - biosDriveMediaConstants = & DisketteExtension->BiosDriveMediaConstants; - if (! FdcInfo->AcpiFdiSupported) { - return (-1073741823L); - } else { - - } - if ((enum _ACPI_FDI_DEVICE_TYPE )FdcInfo->AcpiFdiData.DeviceType == 1) { - goto switch_11_1; - } else { - if ((enum _ACPI_FDI_DEVICE_TYPE )FdcInfo->AcpiFdiData.DeviceType == 2) { - goto switch_11_2; + biosDriveMediaConstants = &DisketteExtension->BiosDriveMediaConstants; + if (!FdcInfo->AcpiFdiSupported) { + return (-1073741823L); + } else { + } + if ((enum _ACPI_FDI_DEVICE_TYPE)FdcInfo->AcpiFdiData.DeviceType == 1) { + goto switch_11_1; } else { - if ((enum _ACPI_FDI_DEVICE_TYPE )FdcInfo->AcpiFdiData.DeviceType == 3) { - goto switch_11_3; + if ((enum _ACPI_FDI_DEVICE_TYPE)FdcInfo->AcpiFdiData.DeviceType == 2) { + goto switch_11_2; } else { - if ((enum _ACPI_FDI_DEVICE_TYPE )FdcInfo->AcpiFdiData.DeviceType == 4) { - goto switch_11_4; + if ((enum _ACPI_FDI_DEVICE_TYPE)FdcInfo->AcpiFdiData.DeviceType == 3) { + goto switch_11_3; } else { - if ((enum _ACPI_FDI_DEVICE_TYPE )FdcInfo->AcpiFdiData.DeviceType == 5) { - goto switch_11_5; + if ((enum _ACPI_FDI_DEVICE_TYPE)FdcInfo->AcpiFdiData.DeviceType == + 4) { + goto switch_11_4; } else { - { - goto switch_11_default; - if (0) { - switch_11_1: /* CIL Label */ - driveType = 0; - goto switch_11_break; - switch_11_2: /* CIL Label */ - driveType = 1; - goto switch_11_break; - switch_11_3: /* CIL Label */ - driveType = 2; - goto switch_11_break; - switch_11_4: /* CIL Label */ - driveType = 3; - goto switch_11_break; - switch_11_5: /* CIL Label */ - driveType = 4; - goto switch_11_break; - switch_11_default: /* CIL Label */ - driveType = 1; - goto switch_11_break; + if ((enum _ACPI_FDI_DEVICE_TYPE)FdcInfo->AcpiFdiData.DeviceType == + 5) { + goto switch_11_5; } else { - switch_11_break: /* CIL Label */ ; - } + { + goto switch_11_default; + if (0) { + switch_11_1: /* CIL Label */ + driveType = 0; + goto switch_11_break; + switch_11_2: /* CIL Label */ + driveType = 1; + goto switch_11_break; + switch_11_3: /* CIL Label */ + driveType = 2; + goto switch_11_break; + switch_11_4: /* CIL Label */ + driveType = 3; + goto switch_11_break; + switch_11_5: /* CIL Label */ + driveType = 4; + goto switch_11_break; + switch_11_default: /* CIL Label */ + driveType = 1; + goto switch_11_break; + } else { + switch_11_break: /* CIL Label */; + } + } } } } } } - } - DisketteExtension->DriveType = driveType; - *biosDriveMediaConstants = *(DriveMediaConstants + (DriveMediaLimits + driveType)->HighestDriveMediaType); - biosDriveMediaConstants->StepRateHeadUnloadTime = (unsigned char )FdcInfo->AcpiFdiData.StepRateHeadUnloadTime; - biosDriveMediaConstants->HeadLoadTime = (unsigned char )FdcInfo->AcpiFdiData.HeadLoadTime; - biosDriveMediaConstants->MotorOffTime = (unsigned char )FdcInfo->AcpiFdiData.MotorOffTime; - biosDriveMediaConstants->SectorLengthCode = (unsigned char )FdcInfo->AcpiFdiData.SectorLengthCode; - biosDriveMediaConstants->SectorsPerTrack = (unsigned char )FdcInfo->AcpiFdiData.SectorPerTrack; - biosDriveMediaConstants->ReadWriteGapLength = (unsigned char )FdcInfo->AcpiFdiData.ReadWriteGapLength; - biosDriveMediaConstants->FormatGapLength = (unsigned char )FdcInfo->AcpiFdiData.FormatGapLength; - biosDriveMediaConstants->FormatFillCharacter = (unsigned char )FdcInfo->AcpiFdiData.FormatFillCharacter; - biosDriveMediaConstants->HeadSettleTime = (unsigned char )FdcInfo->AcpiFdiData.HeadSettleTime; - biosDriveMediaConstants->MotorSettleTimeRead = ((int )((unsigned char )FdcInfo->AcpiFdiData.MotorSettleTime) * 1000) / 8; - biosDriveMediaConstants->MotorSettleTimeWrite = ((int )((unsigned short )FdcInfo->AcpiFdiData.MotorSettleTime) * 1000) / 8; - biosDriveMediaConstants->MaximumTrack = (unsigned char )FdcInfo->AcpiFdiData.MaxCylinderNumber; - biosDriveMediaConstants->DataLength = (unsigned char )FdcInfo->AcpiFdiData.DataTransferLength; - return (0L); -} -} -NTSTATUS FlQueueIrpToThread(PIRP Irp , PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS status ; - HANDLE threadHandle ; - PIO_STACK_LOCATION irpSp ; - OBJECT_ATTRIBUTES ObjAttributes ; - - { - { - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; -/* ExAcquireFastMutex(& DisketteExtension->PowerDownMutex); */ /* INLINED */ - } - if ((int )DisketteExtension->PoweringDown == 1) { - { -/* ExReleaseFastMutex(& DisketteExtension->PowerDownMutex); */ /* INLINED */ - } - { - } - myStatus = -1073741101L; - Irp->IoStatus.__annonCompField4.Status = -1073741101L; - Irp->IoStatus.Information = 0; - return (-1073741101L); - } else { + DisketteExtension->DriveType = driveType; + *biosDriveMediaConstants = + *(DriveMediaConstants + + (DriveMediaLimits + driveType)->HighestDriveMediaType); + biosDriveMediaConstants->StepRateHeadUnloadTime = + (unsigned char)FdcInfo->AcpiFdiData.StepRateHeadUnloadTime; + biosDriveMediaConstants->HeadLoadTime = + (unsigned char)FdcInfo->AcpiFdiData.HeadLoadTime; + biosDriveMediaConstants->MotorOffTime = + (unsigned char)FdcInfo->AcpiFdiData.MotorOffTime; + biosDriveMediaConstants->SectorLengthCode = + (unsigned char)FdcInfo->AcpiFdiData.SectorLengthCode; + biosDriveMediaConstants->SectorsPerTrack = + (unsigned char)FdcInfo->AcpiFdiData.SectorPerTrack; + biosDriveMediaConstants->ReadWriteGapLength = + (unsigned char)FdcInfo->AcpiFdiData.ReadWriteGapLength; + biosDriveMediaConstants->FormatGapLength = + (unsigned char)FdcInfo->AcpiFdiData.FormatGapLength; + biosDriveMediaConstants->FormatFillCharacter = + (unsigned char)FdcInfo->AcpiFdiData.FormatFillCharacter; + biosDriveMediaConstants->HeadSettleTime = + (unsigned char)FdcInfo->AcpiFdiData.HeadSettleTime; + biosDriveMediaConstants->MotorSettleTimeRead = + ((int)((unsigned char)FdcInfo->AcpiFdiData.MotorSettleTime) * 1000) / 8; + biosDriveMediaConstants->MotorSettleTimeWrite = + ((int)((unsigned short)FdcInfo->AcpiFdiData.MotorSettleTime) * 1000) / + 8; + biosDriveMediaConstants->MaximumTrack = + (unsigned char)FdcInfo->AcpiFdiData.MaxCylinderNumber; + biosDriveMediaConstants->DataLength = + (unsigned char)FdcInfo->AcpiFdiData.DataTransferLength; + return (0L); + } +} +NTSTATUS FlQueueIrpToThread(PIRP Irp, PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS status; + HANDLE threadHandle; + PIO_STACK_LOCATION irpSp; + OBJECT_ATTRIBUTES ObjAttributes; - } { -/* ExReleaseFastMutex(& DisketteExtension->PowerDownMutex); */ /* INLINED */ - } - { - } - { -/* ExAcquireFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ - DisketteExtension->ThreadReferenceCount += 1L; - } - if (DisketteExtension->ThreadReferenceCount == 0L) { { - DisketteExtension->ThreadReferenceCount += 1L; -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount += 1UL; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + /* ExAcquireFastMutex(& DisketteExtension->PowerDownMutex); */ /* INLINED + */ } - if (PagingReferenceCount == 1UL) { + if ((int)DisketteExtension->PoweringDown == 1) { { -/* MmResetDriverPaging(& DriverEntry); */ /* INLINED */ - } + /* ExReleaseFastMutex(& DisketteExtension->PowerDownMutex); */ /* INLINED */ + } {} + myStatus = -1073741101L; + Irp->IoStatus.__annonCompField4.Status = -1073741101L; + Irp->IoStatus.Information = 0; + return (-1073741101L); } else { - } { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ - ObjAttributes.Length = sizeof(OBJECT_ATTRIBUTES ); - ObjAttributes.RootDirectory = (void *)0; - ObjAttributes.Attributes = 512L; - ObjAttributes.ObjectName = (void *)0; - ObjAttributes.SecurityDescriptor = (void *)0; - ObjAttributes.SecurityQualityOfService = (void *)0; - status = PsCreateSystemThread(& threadHandle, 0UL, & ObjAttributes, (void *)0L, - (void *)0, & FloppyThread, DisketteExtension); - } - if (! (status >= 0L)) { + /* ExReleaseFastMutex(& DisketteExtension->PowerDownMutex); */ /* INLINED + */ + } {} { + /* ExAcquireFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + DisketteExtension->ThreadReferenceCount += 1L; + } + if (DisketteExtension->ThreadReferenceCount == 0L) { { - DisketteExtension->ThreadReferenceCount = -1; -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; + DisketteExtension->ThreadReferenceCount += 1L; + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount += 1UL; + } + if (PagingReferenceCount == 1UL) { + { /* MmResetDriverPaging(& DriverEntry); */ /* INLINED */ + } + } else { } - if (PagingReferenceCount == 0UL) { + { + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + ObjAttributes.Length = sizeof(OBJECT_ATTRIBUTES); + ObjAttributes.RootDirectory = (void *)0; + ObjAttributes.Attributes = 512L; + ObjAttributes.ObjectName = (void *)0; + ObjAttributes.SecurityDescriptor = (void *)0; + ObjAttributes.SecurityQualityOfService = (void *)0; + status = + PsCreateSystemThread(&threadHandle, 0UL, &ObjAttributes, (void *)0L, + (void *)0, &FloppyThread, DisketteExtension); + } + if (!(status >= 0L)) { + { + DisketteExtension->ThreadReferenceCount = -1; + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; + } + if (PagingReferenceCount == 0UL) { + { /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } + } else { + } { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + /* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ } + return (status); } else { - } { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ -/* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + status = ObReferenceObjectByHandle(threadHandle, 1048576L, (void *)0, 0, + &DisketteExtension->FloppyThread, + (void *)0); + ZwClose(threadHandle); + /* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + } + if (!(status >= 0L)) { + return (status); + } else { } - return (status); } else { - - } - { - status = ObReferenceObjectByHandle(threadHandle, 1048576L, (void *)0, 0, & DisketteExtension->FloppyThread, - (void *)0); - ZwClose(threadHandle); -/* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + { + /* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + } } - if (! (status >= 0L)) { - return (status); + (Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation) + ->Control = (int)(Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation) + ->Control | + 1; + if (pended == 0) { + pended = 1; } else { - - } - } else { - { -/* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + { errorFn(); } } - } - (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1; - if (pended == 0) { - pended = 1; - } else { { - errorFn(); + ExfInterlockedInsertTailList( + &DisketteExtension->ListEntry, + &Irp->Tail.Overlay.__annonCompField17.ListEntry, + &DisketteExtension->ListSpinLock); + KeReleaseSemaphore(&DisketteExtension->RequestSemaphore, 0L, 1, 0); } + return (259L); } - { - ExfInterlockedInsertTailList(& DisketteExtension->ListEntry, & Irp->Tail.Overlay.__annonCompField17.ListEntry, - & DisketteExtension->ListSpinLock); - KeReleaseSemaphore(& DisketteExtension->RequestSemaphore, 0L, 1, 0); - } - return (259L); -} -} -NTSTATUS FloppyCreateClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ - - { - { - } - { - myStatus = 0L; - Irp->IoStatus.__annonCompField4.Status = 0L; - Irp->IoStatus.Information = 1; - IofCompleteRequest(Irp, 0); - } - return (0L); } -} -NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - PDISKETTE_EXTENSION disketteExtension ; - PDISK_GEOMETRY outputBuffer ; - NTSTATUS ntStatus ; - ULONG outputBufferLength ; - UCHAR i ; - DRIVE_MEDIA_TYPE lowestDriveMediaType ; - DRIVE_MEDIA_TYPE highestDriveMediaType ; - ULONG formatExParametersSize ; - PFORMAT_EX_PARAMETERS formatExParameters ; - NTSTATUS tmp ; - PMOUNTDEV_NAME mountName ; - PMOUNTDEV_UNIQUE_ID uniqueId ; - BOOLEAN tmp___0 ; - PMOUNTDEV_SUGGESTED_LINK_NAME suggestedName ; - WCHAR driveLetterNameBuffer[10] ; - RTL_QUERY_REGISTRY_TABLE queryTable[2] ; - PWSTR valueName ; - UNICODE_STRING driveLetterName ; - PVOID tmp___1 ; - int tmp___2 ; +NTSTATUS FloppyCreateClose(PDEVICE_OBJECT DeviceObject, PIRP Irp) { { - { - } - { - disketteExtension = DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; -/* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - } - if (disketteExtension->HoldNewRequests) { - if (irpSp->Parameters.DeviceIoControl.IoControlCode != (ULONG )((50 << 16) | (3 << 14))) { - { - ntStatus = FloppyQueueRequest(disketteExtension, Irp); -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - } - return (ntStatus); - } else { - + {} { + myStatus = 0L; + Irp->IoStatus.__annonCompField4.Status = 0L; + Irp->IoStatus.Information = 1; + IofCompleteRequest(Irp, 0); + } + return (0L); + } +} +NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + PDISKETTE_EXTENSION disketteExtension; + PDISK_GEOMETRY outputBuffer; + NTSTATUS ntStatus; + ULONG outputBufferLength; + UCHAR i; + DRIVE_MEDIA_TYPE lowestDriveMediaType; + DRIVE_MEDIA_TYPE highestDriveMediaType; + ULONG formatExParametersSize; + PFORMAT_EX_PARAMETERS formatExParameters; + NTSTATUS tmp; + PMOUNTDEV_NAME mountName; + PMOUNTDEV_UNIQUE_ID uniqueId; + BOOLEAN tmp___0; + PMOUNTDEV_SUGGESTED_LINK_NAME suggestedName; + WCHAR driveLetterNameBuffer[10]; + RTL_QUERY_REGISTRY_TABLE queryTable[2]; + PWSTR valueName; + UNICODE_STRING driveLetterName; + PVOID tmp___1; + int tmp___2; + + { + {} { + disketteExtension = DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + /* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED + */ + } + if (disketteExtension->HoldNewRequests) { + if (irpSp->Parameters.DeviceIoControl.IoControlCode != + (ULONG)((50 << 16) | (3 << 14))) { + { + ntStatus = FloppyQueueRequest(disketteExtension, Irp); + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + } + return (ntStatus); + } else { + } + } else { } - } else { - - } - { -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - } - if (disketteExtension->IsRemoved) { { - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = -1073741738L; - myStatus = -1073741738L; - IofCompleteRequest(Irp, 0); + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED + */ } - return (-1073741738L); - } else { - - } - if (! disketteExtension->IsStarted) { - if (s == NP) { - s = SKIP1; - } else { + if (disketteExtension->IsRemoved) { { - errorFn(); + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = -1073741738L; + myStatus = -1073741738L; + IofCompleteRequest(Irp, 0); } + return (-1073741738L); + } else { } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - tmp = IofCallDriver(disketteExtension->TargetObject, Irp); + if (!disketteExtension->IsStarted) { + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + tmp = IofCallDriver(disketteExtension->TargetObject, Irp); + } + return (tmp); + } else { } - return (tmp); - } else { - - } - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((77UL << 16) | (unsigned long )(2 << 2))) { - goto switch_16_exp_0; - } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == 77UL << 16) { - goto switch_16_exp_1; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + ((77UL << 16) | (unsigned long)(2 << 2))) { + goto switch_16_exp_0; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((7 << 16) | (3 << 14)) | (6 << 2))) { - goto switch_16_exp_2; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == 77UL << 16) { + goto switch_16_exp_1; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((7 << 16) | (3 << 14)) | (11 << 2))) { - goto switch_16_exp_3; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + (((7 << 16) | (3 << 14)) | (6 << 2))) { + goto switch_16_exp_2; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((7 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_16_exp_4; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + (((7 << 16) | (3 << 14)) | (11 << 2))) { + goto switch_16_exp_3; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((45 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_16_exp_5; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + (((7 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_16_exp_4; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == 7 << 16) { - goto switch_16_exp_6; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + (((45 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_16_exp_5; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((7 << 16) | (9 << 2))) { - goto switch_16_exp_7; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + 7 << 16) { + goto switch_16_exp_6; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((7 << 16) | (768 << 2))) { - goto switch_16_exp_8; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + ((7 << 16) | (9 << 2))) { + goto switch_16_exp_7; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((45 << 16) | (768 << 2))) { - goto switch_16_exp_9; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + ((7 << 16) | (768 << 2))) { + goto switch_16_exp_8; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((77UL << 16) | (unsigned long )(3 << 2))) { - goto switch_16_exp_10; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + ((45 << 16) | (768 << 2))) { + goto switch_16_exp_9; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((7 << 16) | (248 << 2))) { - goto switch_16_exp_11; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + ((77UL << 16) | (unsigned long)(3 << 2))) { + goto switch_16_exp_10; } else { - { - goto switch_16_default; - if (0) { - switch_16_exp_0: /* CIL Label */ ; - { - } - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(MOUNTDEV_NAME )) { - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - mountName = Irp->AssociatedIrp.SystemBuffer; - mountName->NameLength = disketteExtension->DeviceName.Length; - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )(sizeof(USHORT ) + (unsigned int )mountName->NameLength)) { - ntStatus = -2147483643L; - Irp->IoStatus.Information = sizeof(MOUNTDEV_NAME ); - goto switch_16_break; - } else { - - } - { - memcpy(mountName->Name, disketteExtension->DeviceName.Buffer, - mountName->NameLength); - ntStatus = 0L; - Irp->IoStatus.Information = sizeof(USHORT ) + (unsigned int )mountName->NameLength; - } - goto switch_16_break; - switch_16_exp_1: /* CIL Label */ ; - { - } - if (! disketteExtension->InterfaceString.Buffer) { - ntStatus = -1073741811L; - goto switch_16_break; - } else { - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(MOUNTDEV_UNIQUE_ID )) { - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - } - uniqueId = Irp->AssociatedIrp.SystemBuffer; - uniqueId->UniqueIdLength = disketteExtension->InterfaceString.Length; - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )(sizeof(USHORT ) + (unsigned int )uniqueId->UniqueIdLength)) { - ntStatus = -2147483643L; - Irp->IoStatus.Information = sizeof(MOUNTDEV_UNIQUE_ID ); - goto switch_16_break; - } else { - - } - { - memcpy(uniqueId->UniqueId, disketteExtension->InterfaceString.Buffer, - uniqueId->UniqueIdLength); - ntStatus = 0L; - Irp->IoStatus.Information = sizeof(USHORT ) + (unsigned int )uniqueId->UniqueIdLength; - } - goto switch_16_break; - switch_16_exp_2: /* CIL Label */ ; - switch_16_exp_3: /* CIL Label */ ; - if (irpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(FORMAT_PARAMETERS )) { - { - } - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + ((7 << 16) | (248 << 2))) { + goto switch_16_exp_11; + } else { { - tmp___0 = FlCheckFormatParameters(disketteExtension, (struct _FORMAT_PARAMETERS *)Irp->AssociatedIrp.SystemBuffer); - } - if (tmp___0) { - - } else { - { - } - ntStatus = -1073741811L; - goto switch_16_break; - } - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((7 << 16) | (3 << 14)) | (11 << 2))) { - if (irpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(FORMAT_EX_PARAMETERS )) { - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - formatExParameters = (struct _FORMAT_EX_PARAMETERS *)Irp->AssociatedIrp.SystemBuffer; - formatExParametersSize = (unsigned long )((long )(& ((FORMAT_EX_PARAMETERS *)0)->SectorNumber)) + (unsigned long )((unsigned int )formatExParameters->SectorsPerTrack * sizeof(USHORT )); - if (irpSp->Parameters.DeviceIoControl.InputBufferLength < formatExParametersSize) { - ntStatus = -1073741811L; + goto switch_16_default; + if (0) { + switch_16_exp_0: /* CIL Label */; + {} + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof(MOUNTDEV_NAME)) { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + mountName = Irp->AssociatedIrp.SystemBuffer; + mountName->NameLength = + disketteExtension->DeviceName.Length; + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)( + sizeof(USHORT) + + (unsigned int)mountName->NameLength)) { + ntStatus = -2147483643L; + Irp->IoStatus.Information = + sizeof(MOUNTDEV_NAME); + goto switch_16_break; + } else { + } + { + memcpy(mountName->Name, + disketteExtension->DeviceName.Buffer, + mountName->NameLength); + ntStatus = 0L; + Irp->IoStatus.Information = + sizeof(USHORT) + + (unsigned int)mountName->NameLength; + } goto switch_16_break; - } else { - if ((int )formatExParameters->FormatGapLength >= 256) { + switch_16_exp_1: /* CIL Label */; + {} + if (!disketteExtension->InterfaceString + .Buffer) { ntStatus = -1073741811L; goto switch_16_break; } else { - if ((int )formatExParameters->SectorsPerTrack >= 256) { + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof(MOUNTDEV_UNIQUE_ID)) { ntStatus = -1073741811L; goto switch_16_break; } else { - } } - } - } else { - - } - switch_16_exp_4: /* CIL Label */ ; - switch_16_exp_5: /* CIL Label */ ; - switch_16_exp_6: /* CIL Label */ ; - switch_16_exp_7: /* CIL Label */ ; - { - } - { - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - goto switch_16_break; - switch_16_exp_8: /* CIL Label */ ; - switch_16_exp_9: /* CIL Label */ ; - { - } - lowestDriveMediaType = (DriveMediaLimits + disketteExtension->DriveType)->LowestDriveMediaType; - highestDriveMediaType = (DriveMediaLimits + disketteExtension->DriveType)->HighestDriveMediaType; - outputBufferLength = irpSp->Parameters.DeviceIoControl.OutputBufferLength; - if (outputBufferLength < (ULONG )sizeof(DISK_GEOMETRY )) { - { - } - ntStatus = -1073741789L; - goto switch_16_break; - } else { - - } - ntStatus = 0L; - if (outputBufferLength < (ULONG )(sizeof(DISK_GEOMETRY ) * (unsigned int )(((int )highestDriveMediaType - (int )lowestDriveMediaType) + 1))) { - { - } - ntStatus = -2147483643L; - highestDriveMediaType = (enum _DRIVE_MEDIA_TYPE )((ULONG )((int )lowestDriveMediaType - 1) + outputBufferLength / (ULONG )sizeof(DISK_GEOMETRY )); - } else { - - } - outputBuffer = (struct _DISK_GEOMETRY *)Irp->AssociatedIrp.SystemBuffer; - i = (unsigned char )lowestDriveMediaType; - { - while (1) { - while_25_continue: /* CIL Label */ ; - if ((int )i <= (int )((unsigned char )highestDriveMediaType)) { - - } else { - goto while_25_break; - } - outputBuffer->MediaType = (DriveMediaConstants + i)->MediaType; - outputBuffer->Cylinders.__annonCompField1.LowPart = (int )(DriveMediaConstants + i)->MaximumTrack + 1; - outputBuffer->Cylinders.__annonCompField1.HighPart = 0; - outputBuffer->TracksPerCylinder = (DriveMediaConstants + i)->NumberOfHeads; - outputBuffer->SectorsPerTrack = (DriveMediaConstants + i)->SectorsPerTrack; - outputBuffer->BytesPerSector = (DriveMediaConstants + i)->BytesPerSector; - { - } - outputBuffer += 1; - Irp->IoStatus.Information += (ULONG_PTR )sizeof(DISK_GEOMETRY ); - i = (UCHAR )((int )i + 1); - } - while_25_break: /* CIL Label */ ; - } - goto switch_16_break; - switch_16_exp_10: /* CIL Label */ ; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - } - if (! (DeviceObject->Characteristics & 1UL)) { - ntStatus = -1073741275L; - goto switch_16_break; - } else { - - } - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(MOUNTDEV_SUGGESTED_LINK_NAME )) { - ntStatus = -1073741811L; - goto switch_16_break; - } else { - - } - { - tmp___1 = ExAllocatePoolWithTag(1, sizeof(WCHAR ) * 64U, - 1886350406UL); - valueName = tmp___1; - } - if (! valueName) { - ntStatus = -1073741670L; - goto switch_16_break; - } else { - - } - { - memset(valueName, 0, sizeof(WCHAR ) * 64U); - memcpy(valueName, disketteExtension->DeviceName.Buffer, - disketteExtension->DeviceName.Length); - driveLetterName.Buffer = driveLetterNameBuffer; - driveLetterName.MaximumLength = 20; - driveLetterName.Length = 0; - memset(queryTable, 0, 2U * sizeof(RTL_QUERY_REGISTRY_TABLE )); - queryTable[0].Flags = 36; - queryTable[0].Name = valueName; - queryTable[0].EntryContext = & driveLetterName; - ntStatus = RtlQueryRegistryValues(0, "\\\000R\000e\000g\000i\000s\000t\000r\000y\000\\\000M\000a\000c\000h\000i\000n\000e\000\\\000S\000y\000s\000t\000e\000m\000\\\000D\000I\000S\000K\000", - queryTable, (void *)0, - (void *)0); - } - if (! (ntStatus >= 0L)) { + uniqueId = Irp->AssociatedIrp.SystemBuffer; + uniqueId->UniqueIdLength = + disketteExtension->InterfaceString.Length; + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)(sizeof(USHORT) + + (unsigned int) + uniqueId->UniqueIdLength)) { + ntStatus = -2147483643L; + Irp->IoStatus.Information = + sizeof(MOUNTDEV_UNIQUE_ID); + goto switch_16_break; + } else { + } { -/* ExFreePool(valueName); */ /* INLINED */ + memcpy( + uniqueId->UniqueId, + disketteExtension->InterfaceString.Buffer, + uniqueId->UniqueIdLength); + ntStatus = 0L; + Irp->IoStatus.Information = + sizeof(USHORT) + + (unsigned int)uniqueId->UniqueIdLength; } goto switch_16_break; - } else { + switch_16_exp_2: /* CIL Label */; + switch_16_exp_3: /* CIL Label */; + if (irpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(FORMAT_PARAMETERS)) { + {} + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + { + tmp___0 = FlCheckFormatParameters( + disketteExtension, + (struct _FORMAT_PARAMETERS *) + Irp->AssociatedIrp.SystemBuffer); + } + if (tmp___0) { - } - if ((int )driveLetterName.Length != 4) { + } else { + {} + ntStatus = -1073741811L; + goto switch_16_break; + } + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == + (ULONG)(((7 << 16) | (3 << 14)) | + (11 << 2))) { + if (irpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(FORMAT_EX_PARAMETERS)) { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + formatExParameters = + (struct _FORMAT_EX_PARAMETERS *) + Irp->AssociatedIrp.SystemBuffer; + formatExParametersSize = + (unsigned long)(( + long)(&((FORMAT_EX_PARAMETERS *)0) + ->SectorNumber)) + + (unsigned long)((unsigned int) + formatExParameters + ->SectorsPerTrack * + sizeof(USHORT)); + if (irpSp->Parameters.DeviceIoControl + .InputBufferLength < + formatExParametersSize) { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + if ((int)formatExParameters + ->FormatGapLength >= 256) { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + if ((int)formatExParameters + ->SectorsPerTrack >= 256) { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + } + } + } else { + } + switch_16_exp_4: /* CIL Label */; + switch_16_exp_5: /* CIL Label */; + switch_16_exp_6: /* CIL Label */; + switch_16_exp_7: /* CIL Label */; + {} { + ntStatus = FlQueueIrpToThread( + Irp, disketteExtension); + } + goto switch_16_break; + switch_16_exp_8: /* CIL Label */; + switch_16_exp_9: /* CIL Label */; + {} + lowestDriveMediaType = + (DriveMediaLimits + + disketteExtension->DriveType) + ->LowestDriveMediaType; + highestDriveMediaType = + (DriveMediaLimits + + disketteExtension->DriveType) + ->HighestDriveMediaType; + outputBufferLength = + irpSp->Parameters.DeviceIoControl + .OutputBufferLength; + if (outputBufferLength < + (ULONG)sizeof(DISK_GEOMETRY)) { + {} + ntStatus = -1073741789L; + goto switch_16_break; + } else { + } + ntStatus = 0L; + if (outputBufferLength < + (ULONG)( + sizeof(DISK_GEOMETRY) * + (unsigned int)(((int) + highestDriveMediaType - + (int) + lowestDriveMediaType) + + 1))) { + {} + ntStatus = -2147483643L; + highestDriveMediaType = + (enum _DRIVE_MEDIA_TYPE)( + (ULONG)((int)lowestDriveMediaType - + 1) + + outputBufferLength / + (ULONG)sizeof(DISK_GEOMETRY)); + } else { + } + outputBuffer = + (struct _DISK_GEOMETRY *) + Irp->AssociatedIrp.SystemBuffer; + i = (unsigned char)lowestDriveMediaType; { - ntStatus = -1073741275L; -/* ExFreePool(valueName); */ /* INLINED */ + while (1) { + while_25_continue: /* CIL Label */; + if ((int)i <= + (int)((unsigned char) + highestDriveMediaType)) { + + } else { + goto while_25_break; + } + outputBuffer->MediaType = + (DriveMediaConstants + i)->MediaType; + outputBuffer->Cylinders.__annonCompField1 + .LowPart = + (int)(DriveMediaConstants + i) + ->MaximumTrack + + 1; + outputBuffer->Cylinders.__annonCompField1 + .HighPart = 0; + outputBuffer->TracksPerCylinder = + (DriveMediaConstants + + i)->NumberOfHeads; + outputBuffer->SectorsPerTrack = + (DriveMediaConstants + + i)->SectorsPerTrack; + outputBuffer->BytesPerSector = + (DriveMediaConstants + + i)->BytesPerSector; + {} + outputBuffer += 1; + Irp->IoStatus.Information += + (ULONG_PTR)sizeof(DISK_GEOMETRY); + i = (UCHAR)((int)i + 1); + } + while_25_break: /* CIL Label */; } goto switch_16_break; - } else { - if ((int )*(driveLetterName.Buffer + 0) < 65) { + switch_16_exp_10: /* CIL Label */; + if ((int)((KUSER_SHARED_DATA * + const)4292804608U) + ->AlternativeArchitecture == 1) { + {} + if (!(DeviceObject->Characteristics & 1UL)) { + ntStatus = -1073741275L; + goto switch_16_break; + } else { + } + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof( + MOUNTDEV_SUGGESTED_LINK_NAME)) { + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } { - ntStatus = -1073741275L; -/* ExFreePool(valueName); */ /* INLINED */ + tmp___1 = ExAllocatePoolWithTag( + 1, sizeof(WCHAR) * 64U, 1886350406UL); + valueName = tmp___1; } - goto switch_16_break; - } else { - if ((int )*(driveLetterName.Buffer + 0) > 90) { + if (!valueName) { + ntStatus = -1073741670L; + goto switch_16_break; + } else { + } + { + memset(valueName, 0, sizeof(WCHAR) * 64U); + memcpy( + valueName, + disketteExtension->DeviceName.Buffer, + disketteExtension->DeviceName.Length); + driveLetterName.Buffer = + driveLetterNameBuffer; + driveLetterName.MaximumLength = 20; + driveLetterName.Length = 0; + memset( + queryTable, 0, + 2U * sizeof(RTL_QUERY_REGISTRY_TABLE)); + queryTable[0].Flags = 36; + queryTable[0].Name = valueName; + queryTable[0].EntryContext = + &driveLetterName; + ntStatus = RtlQueryRegistryValues( + 0, "\\\000R\000e\000g\000i\000s\000t" + "\000r\000y\000\\\000M\000a\000c\000" + "h\000i\000n\000e\000\\\000S\000y" + "\000s\000t\000e\000m\000\\\000D\000" + "I\000S\000K\000", + queryTable, (void *)0, (void *)0); + } + if (!(ntStatus >= 0L)) { { - ntStatus = -1073741275L; -/* ExFreePool(valueName); */ /* INLINED */ + /* ExFreePool(valueName); */ /* INLINED */ } goto switch_16_break; } else { - if ((int )*(driveLetterName.Buffer + 1) != 58) { - { + } + if ((int)driveLetterName.Length != 4) { + { ntStatus = -1073741275L; -/* ExFreePool(valueName); */ /* INLINED */ + /* ExFreePool(valueName); */ /* INLINED */ + } + goto switch_16_break; + } else { + if ((int)*(driveLetterName.Buffer + 0) < + 65) { + { + ntStatus = -1073741275L; + /* ExFreePool(valueName); */ /* INLINED */ } goto switch_16_break; } else { - + if ((int)*(driveLetterName.Buffer + 0) > + 90) { + { + ntStatus = -1073741275L; + /* ExFreePool(valueName); */ /* INLINED */ + } + goto switch_16_break; + } else { + if ((int)*(driveLetterName.Buffer + + 1) != 58) { + { + ntStatus = -1073741275L; + /* ExFreePool(valueName); */ /* INLINED */ + } + goto switch_16_break; + } else { + } + } + } + } + suggestedName = + Irp->AssociatedIrp.SystemBuffer; + suggestedName->UseOnlyIfThereAreNoOtherLinks = + 1; + suggestedName->NameLength = 28; + Irp->IoStatus.Information = + (long)(&((MOUNTDEV_SUGGESTED_LINK_NAME + *)0) + ->Name) + + 28L; + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + Irp->IoStatus.Information) { + { + Irp->IoStatus.Information = + sizeof(MOUNTDEV_SUGGESTED_LINK_NAME); + ntStatus = -2147483643L; + /* ExFreePool(valueName); */ /* INLINED */ } + goto switch_16_break; + } else { } + { + RtlDeleteRegistryValue( + 0, "\\\000R\000e\000g\000i\000s\000t" + "\000r\000y\000\\\000M\000a\000c\000" + "h\000i\000n\000e\000\\\000S\000y" + "\000s\000t\000e\000m\000\\\000D\000" + "I\000S\000K\000", + valueName); + /* ExFreePool(valueName); */ /* INLINED */ + memcpy(suggestedName->Name, + "\\\000D\000o\000s\000D\000e\000v" + "\000i\000c\000e\000s\000\\\000", + 24); + suggestedName->Name[12] = + *(driveLetterName.Buffer + 0); + suggestedName->Name[13] = ':'; + } + goto switch_16_break; + } else { } - } - suggestedName = Irp->AssociatedIrp.SystemBuffer; - suggestedName->UseOnlyIfThereAreNoOtherLinks = 1; - suggestedName->NameLength = 28; - Irp->IoStatus.Information = (long )(& ((MOUNTDEV_SUGGESTED_LINK_NAME *)0)->Name) + 28L; - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < Irp->IoStatus.Information) { - { - Irp->IoStatus.Information = sizeof(MOUNTDEV_SUGGESTED_LINK_NAME ); - ntStatus = -2147483643L; -/* ExFreePool(valueName); */ /* INLINED */ + switch_16_exp_11: /* CIL Label */; + if ((int)((KUSER_SHARED_DATA * + const)4292804608U) + ->AlternativeArchitecture == 1) { + {} + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof(SENSE_DEVISE_STATUS_PTOS)) { + {} + ntStatus = -1073741811L; + goto switch_16_break; + } else { + } + {} { + ntStatus = FlQueueIrpToThread( + Irp, disketteExtension); + } + goto switch_16_break; + } else { + } + switch_16_default: /* CIL Label */; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } } - goto switch_16_break; - } else { - - } - { - RtlDeleteRegistryValue(0, "\\\000R\000e\000g\000i\000s\000t\000r\000y\000\\\000M\000a\000c\000h\000i\000n\000e\000\\\000S\000y\000s\000t\000e\000m\000\\\000D\000I\000S\000K\000", - valueName); -/* ExFreePool(valueName); */ /* INLINED */ - memcpy(suggestedName->Name, "\\\000D\000o\000s\000D\000e\000v\000i\000c\000e\000s\000\\\000", - 24); - suggestedName->Name[12] = *(driveLetterName.Buffer + 0); - suggestedName->Name[13] = ':'; - } - goto switch_16_break; - } else { - - } - switch_16_exp_11: /* CIL Label */ ; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - } - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SENSE_DEVISE_STATUS_PTOS )) { { + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16 + .CurrentStackLocation += 1; + ntStatus = IofCallDriver( + disketteExtension->TargetObject, Irp); } - ntStatus = -1073741811L; - goto switch_16_break; + return (ntStatus); } else { - - } - { - } - { - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - goto switch_16_break; - } else { - - } - switch_16_default: /* CIL Label */ ; - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); + switch_16_break: /* CIL Label */; } } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = IofCallDriver(disketteExtension->TargetObject, - Irp); - } - return (ntStatus); - } else { - switch_16_break: /* CIL Label */ ; - } } } } @@ -3122,368 +3240,363 @@ NTSTATUS FloppyDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } - } - if (ntStatus != 259L) { - Irp->IoStatus.__annonCompField4.Status = ntStatus; - myStatus = ntStatus; - if (! (ntStatus >= 0L)) { - if (ntStatus == -1073741661L) { - tmp___2 = 1; - } else { - if (ntStatus == -1073741643L) { + if (ntStatus != 259L) { + Irp->IoStatus.__annonCompField4.Status = ntStatus; + myStatus = ntStatus; + if (!(ntStatus >= 0L)) { + if (ntStatus == -1073741661L) { tmp___2 = 1; } else { - if (ntStatus == -1073741662L) { + if (ntStatus == -1073741643L) { tmp___2 = 1; } else { - if (ntStatus == -1073741805L) { + if (ntStatus == -1073741662L) { tmp___2 = 1; } else { - if (ntStatus == -2147483626L) { + if (ntStatus == -1073741805L) { tmp___2 = 1; } else { - if (ntStatus == -1073741804L) { + if (ntStatus == -2147483626L) { tmp___2 = 1; } else { - if (ntStatus == -1073741806L) { + if (ntStatus == -1073741804L) { tmp___2 = 1; } else { - tmp___2 = 0; + if (ntStatus == -1073741806L) { + tmp___2 = 1; + } else { + tmp___2 = 0; + } } } } } } } - } - if ((unsigned char )tmp___2) { - { -/* IoSetHardErrorOrVerifyDevice(Irp, DeviceObject); */ /* INLINED */ - } + if ((unsigned char)tmp___2) { + { + /* IoSetHardErrorOrVerifyDevice(Irp, DeviceObject); */ /* INLINED + */ + } + } else { + } } else { - } + { IofCompleteRequest(Irp, 0); } } else { - - } - { - IofCompleteRequest(Irp, 0); } - } else { - + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - PDISKETTE_EXTENSION disketteExtension ; - NTSTATUS ntStatus ; - KEVENT doneEvent ; - PIO_STACK_LOCATION irpSp___0 ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___1 ; - PCONFIGURATION_INFORMATION tmp ; +NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + PDISKETTE_EXTENSION disketteExtension; + NTSTATUS ntStatus; + KEVENT doneEvent; + PIO_STACK_LOCATION irpSp___0; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___1; + PCONFIGURATION_INFORMATION tmp; { - ntStatus = 0L; - { - } - { -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount += 1UL; - } - if (PagingReferenceCount == 1UL) { - { -/* MmResetDriverPaging(& DriverEntry); */ /* INLINED */ + ntStatus = 0L; + {} { + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount += 1UL; + } + if (PagingReferenceCount == 1UL) { + { /* MmResetDriverPaging(& DriverEntry); */ /* INLINED */ + } + } else { } - } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ - disketteExtension = DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - } - if (disketteExtension->IsRemoved) { { - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = -1073741738L; - myStatus = -1073741738L; - IofCompleteRequest(Irp, 0); + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + disketteExtension = DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; } - return (-1073741738L); - } else { - - } - if (irpSp->MinorFunction == 0) { - goto switch_32_0; - } else { - if (irpSp->MinorFunction == 5) { - goto switch_32_5; + if (disketteExtension->IsRemoved) { + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = -1073741738L; + myStatus = -1073741738L; + IofCompleteRequest(Irp, 0); + } + return (-1073741738L); } else { - if (irpSp->MinorFunction == 1) { - goto switch_32_1; + } + if (irpSp->MinorFunction == 0) { + goto switch_32_0; + } else { + if (irpSp->MinorFunction == 5) { + goto switch_32_5; } else { - if (irpSp->MinorFunction == 6) { - goto switch_32_6; + if (irpSp->MinorFunction == 1) { + goto switch_32_1; } else { - if (irpSp->MinorFunction == 3) { - goto switch_32_3; + if (irpSp->MinorFunction == 6) { + goto switch_32_6; } else { - if (irpSp->MinorFunction == 4) { - goto switch_32_4; + if (irpSp->MinorFunction == 3) { + goto switch_32_3; } else { - if (irpSp->MinorFunction == 2) { - goto switch_32_2; + if (irpSp->MinorFunction == 4) { + goto switch_32_4; } else { - { - goto switch_32_default; - if (0) { - switch_32_0: /* CIL Label */ + if (irpSp->MinorFunction == 2) { + goto switch_32_2; + } else { { - ntStatus = FloppyStartDevice(DeviceObject, Irp); - } - goto switch_32_break; - switch_32_5: /* CIL Label */ ; - switch_32_1: /* CIL Label */ ; - if ((int )irpSp->MinorFunction == 5) { - { - } - } else { + goto switch_32_default; + if (0) { + switch_32_0 : /* CIL Label */ { + ntStatus = FloppyStartDevice(DeviceObject, Irp); } - } - if (! disketteExtension->IsStarted) { - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); + goto switch_32_break; + switch_32_5: /* CIL Label */; + switch_32_1: /* CIL Label */; + if ((int)irpSp->MinorFunction == 5) { + {} + } else { + {} + } + if (!disketteExtension->IsStarted) { + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation += 1; + ntStatus = IofCallDriver( + disketteExtension->TargetObject, Irp); + } + return (ntStatus); + } else { } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - return (ntStatus); - } else { - - } - { -/* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - disketteExtension->HoldNewRequests = 1; -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); - } - if (ntStatus == 259L) { - { - KeWaitForSingleObject(disketteExtension->FloppyThread, 0, 0, 0, - (void *)0); - } - if ((unsigned int )disketteExtension->FloppyThread != (unsigned int )((void *)0)) { { -/* ObfDereferenceObject(disketteExtension->FloppyThread); */ /* INLINED */ + /* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + disketteExtension->HoldNewRequests = 1; + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + ntStatus = FlQueueIrpToThread(Irp, disketteExtension); + } + if (ntStatus == 259L) { + { + KeWaitForSingleObject(disketteExtension->FloppyThread, + 0, 0, 0, (void *)0); + } + if ((unsigned int)disketteExtension->FloppyThread != + (unsigned int)((void *)0)) { + { + /* ObfDereferenceObject(disketteExtension->FloppyThread); */ /* INLINED */ + } + } else { + } + disketteExtension->FloppyThread = (void *)0; + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation += 1; + ntStatus = IofCallDriver( + disketteExtension->TargetObject, Irp); + } + } else { + { + ntStatus = -1073741823L; + Irp->IoStatus.__annonCompField4.Status = ntStatus; + myStatus = ntStatus; + Irp->IoStatus.Information = 0; + IofCompleteRequest(Irp, 0); + } + } + goto switch_32_break; + switch_32_6: /* CIL Label */; + switch_32_3: /* CIL Label */; + if ((int)irpSp->MinorFunction == 6) { + {} + } else { + {} + } + if (!disketteExtension->IsStarted) { + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation += 1; + ntStatus = IofCallDriver( + disketteExtension->TargetObject, Irp); + } + } else { + { + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + irpSp___0 = + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation; + nextIrpSp = + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation - + 1; + memcpy(nextIrpSp, irpSp___0, + (long)(&((IO_STACK_LOCATION *)0) + ->CompletionRoutine)); + nextIrpSp->Control = 0; + /* KeInitializeEvent(& doneEvent, 1, 0); */ /* INLINED */ + } + if (s != NP) { + { errorFn(); } + } else { + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + compFptr = &FloppyPnpComplete; + } + } + { + irpSp___1 = + Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation - + 1; + irpSp___1->CompletionRoutine = &FloppyPnpComplete; + irpSp___1->Context = &doneEvent; + irpSp___1->Control = 0; + irpSp___1->Control = 64; + irpSp___1->Control = (int)irpSp___1->Control | 128; + irpSp___1->Control = (int)irpSp___1->Control | 32; + ntStatus = IofCallDriver( + disketteExtension->TargetObject, Irp); + } + if (ntStatus == 259L) { + { + KeWaitForSingleObject(&doneEvent, 0, 0, 0, + (void *)0); + ntStatus = myStatus; + } + } else { + } + { + /* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + disketteExtension->HoldNewRequests = 0; + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + FloppyProcessQueuedRequests(disketteExtension); + Irp->IoStatus.__annonCompField4.Status = ntStatus; + myStatus = ntStatus; + Irp->IoStatus.Information = 0; + IofCompleteRequest(Irp, 0); + } + } + goto switch_32_break; + switch_32_4: /* CIL Label */; + {} + disketteExtension->IsStarted = 0; + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } } - } else { - - } - disketteExtension->FloppyThread = (void *)0; - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (s == NP) { - s = SKIP1; - } else { { - errorFn(); + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + ntStatus = + IofCallDriver(disketteExtension->TargetObject, Irp); + } + goto switch_32_break; + switch_32_2: /* CIL Label */; + {} { + /* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + disketteExtension->HoldNewRequests = 0; + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + disketteExtension->IsStarted = 0; + disketteExtension->IsRemoved = 1; + FloppyProcessQueuedRequests(disketteExtension); + } + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - } else { - { - ntStatus = -1073741823L; - Irp->IoStatus.__annonCompField4.Status = ntStatus; - myStatus = ntStatus; - Irp->IoStatus.Information = 0; - IofCompleteRequest(Irp, 0); - } - } - goto switch_32_break; - switch_32_6: /* CIL Label */ ; - switch_32_3: /* CIL Label */ ; - if ((int )irpSp->MinorFunction == 6) { - { - } - } else { - { - } - } - if (! disketteExtension->IsStarted) { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (s == NP) { - s = SKIP1; - } else { { - errorFn(); + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + ntStatus = + IofCallDriver(disketteExtension->TargetObject, Irp); + } + if ((unsigned int)disketteExtension->InterfaceString + .Buffer != (unsigned int)((void *)0)) { + { + IoSetDeviceInterfaceState( + &disketteExtension->InterfaceString, 0); + /* RtlFreeUnicodeString(& disketteExtension->InterfaceString); */ /* INLINED */ + /* RtlInitUnicodeString(& disketteExtension->InterfaceString, (void *)0); */ /* INLINED */ + } + } else { } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - } else { - { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - memcpy(nextIrpSp, irpSp___0, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine)); - nextIrpSp->Control = 0; -/* KeInitializeEvent(& doneEvent, 1, 0); */ /* INLINED */ - } - if (s != NP) { { - errorFn(); + /* RtlFreeUnicodeString(& disketteExtension->DeviceName); */ /* INLINED */ + /* RtlInitUnicodeString(& disketteExtension->DeviceName, (void *)0); */ /* INLINED */ } - } else { - if (compRegistered != 0) { + if ((int)disketteExtension->ArcName.Length != 0) { { - errorFn(); + IoDeleteSymbolicLink(&disketteExtension->ArcName); + /* RtlFreeUnicodeString(& disketteExtension->ArcName); */ /* INLINED */ + /* RtlInitUnicodeString(& disketteExtension->ArcName, (void *)0); */ /* INLINED */ } } else { - compRegistered = 1; - compFptr = & FloppyPnpComplete; } - } - { - irpSp___1 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp___1->CompletionRoutine = & FloppyPnpComplete; - irpSp___1->Context = & doneEvent; - irpSp___1->Control = 0; - irpSp___1->Control = 64; - irpSp___1->Control = (int )irpSp___1->Control | 128; - irpSp___1->Control = (int )irpSp___1->Control | 32; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - if (ntStatus == 259L) { { - KeWaitForSingleObject(& doneEvent, 0, 0, 0, (void *)0); - ntStatus = myStatus; + /* IoDetachDevice(disketteExtension->TargetObject); */ /* INLINED */ + /* IoDeleteDevice(DeviceObject); */ /* INLINED */ + tmp = IoGetConfigurationInformation(); + tmp->FloppyCount -= 1UL; + } + goto switch_32_break; + switch_32_default: /* CIL Label */; + {} + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = + (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + ntStatus = + IofCallDriver(disketteExtension->TargetObject, Irp); } } else { - - } - { -/* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - disketteExtension->HoldNewRequests = 0; -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - FloppyProcessQueuedRequests(disketteExtension); - Irp->IoStatus.__annonCompField4.Status = ntStatus; - myStatus = ntStatus; - Irp->IoStatus.Information = 0; - IofCompleteRequest(Irp, 0); - } - } - goto switch_32_break; - switch_32_4: /* CIL Label */ ; - { - } - disketteExtension->IsStarted = 0; - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); - } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - goto switch_32_break; - switch_32_2: /* CIL Label */ ; - { - } - { -/* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - disketteExtension->HoldNewRequests = 0; -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - disketteExtension->IsStarted = 0; - disketteExtension->IsRemoved = 1; - FloppyProcessQueuedRequests(disketteExtension); - } - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); - } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - if ((unsigned int )disketteExtension->InterfaceString.Buffer != (unsigned int )((void *)0)) { - { - IoSetDeviceInterfaceState(& disketteExtension->InterfaceString, - 0); -/* RtlFreeUnicodeString(& disketteExtension->InterfaceString); */ /* INLINED */ -/* RtlInitUnicodeString(& disketteExtension->InterfaceString, (void *)0); */ /* INLINED */ + switch_32_break: /* CIL Label */; } - } else { - - } - { -/* RtlFreeUnicodeString(& disketteExtension->DeviceName); */ /* INLINED */ -/* RtlInitUnicodeString(& disketteExtension->DeviceName, (void *)0); */ /* INLINED */ - } - if ((int )disketteExtension->ArcName.Length != 0) { - { - IoDeleteSymbolicLink(& disketteExtension->ArcName); -/* RtlFreeUnicodeString(& disketteExtension->ArcName); */ /* INLINED */ -/* RtlInitUnicodeString(& disketteExtension->ArcName, (void *)0); */ /* INLINED */ - } - } else { - - } - { -/* IoDetachDevice(disketteExtension->TargetObject); */ /* INLINED */ -/* IoDeleteDevice(DeviceObject); */ /* INLINED */ - tmp = IoGetConfigurationInformation(); - tmp->FloppyCount -= 1UL; - } - goto switch_32_break; - switch_32_default: /* CIL Label */ ; - { - } - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); - } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); } - } else { - switch_32_break: /* CIL Label */ ; - } } } } @@ -3491,2060 +3604,2016 @@ NTSTATUS FloppyPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } - } - { -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; - } - if (PagingReferenceCount == 0UL) { { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; } - } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + if (PagingReferenceCount == 0UL) { + { /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } + } else { + } + { /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + } + return (ntStatus); } - return (ntStatus); -} } -NTSTATUS FloppyStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ NTSTATUS ntStatus ; - NTSTATUS pnpStatus ; - KEVENT doneEvent ; - FDC_INFO fdcInfo ; - CONFIGURATION_TYPE Dc ; - CONFIGURATION_TYPE Fp ; - PDISKETTE_EXTENSION disketteExtension ; - PIO_STACK_LOCATION irpSp ; - PIO_STACK_LOCATION irpSp___0 ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___1 ; - INTERFACE_TYPE InterfaceType ; - - { - Dc = 13; - Fp = 26; - disketteExtension = (DISKETTE_EXTENSION *)DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - { - } - { - } - { - } - { -/* KeInitializeEvent(& doneEvent, 0, 0); */ /* INLINED */ - irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - memcpy(nextIrpSp, irpSp___0, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine)); - nextIrpSp->Control = 0; - } - if (s != NP) { - { - errorFn(); +NTSTATUS FloppyStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + NTSTATUS ntStatus; + NTSTATUS pnpStatus; + KEVENT doneEvent; + FDC_INFO fdcInfo; + CONFIGURATION_TYPE Dc; + CONFIGURATION_TYPE Fp; + PDISKETTE_EXTENSION disketteExtension; + PIO_STACK_LOCATION irpSp; + PIO_STACK_LOCATION irpSp___0; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___1; + INTERFACE_TYPE InterfaceType; + + { + Dc = 13; + Fp = 26; + disketteExtension = (DISKETTE_EXTENSION *)DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + {} {} {} { + /* KeInitializeEvent(& doneEvent, 0, 0); */ /* INLINED */ + irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + memcpy(nextIrpSp, irpSp___0, + (long)(&((IO_STACK_LOCATION *)0)->CompletionRoutine)); + nextIrpSp->Control = 0; + } + if (s != NP) { + { errorFn(); } + } else { + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + compFptr = &FloppyPnpComplete; + } } - } else { - if (compRegistered != 0) { + { + irpSp___1 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpSp___1->CompletionRoutine = &FloppyPnpComplete; + irpSp___1->Context = &doneEvent; + irpSp___1->Control = 0; + irpSp___1->Control = 64; + irpSp___1->Control = (int)irpSp___1->Control | 128; + irpSp___1->Control = (int)irpSp___1->Control | 32; + ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); + } + if (ntStatus == 259L) { { - errorFn(); + ntStatus = KeWaitForSingleObject(&doneEvent, 0, 0, 0, (void *)0); + ntStatus = myStatus; } } else { - compRegistered = 1; - compFptr = & FloppyPnpComplete; } - } - { - irpSp___1 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp___1->CompletionRoutine = & FloppyPnpComplete; - irpSp___1->Context = & doneEvent; - irpSp___1->Control = 0; - irpSp___1->Control = 64; - irpSp___1->Control = (int )irpSp___1->Control | 128; - irpSp___1->Control = (int )irpSp___1->Control | 32; - ntStatus = IofCallDriver(disketteExtension->TargetObject, Irp); - } - if (ntStatus == 259L) { { - ntStatus = KeWaitForSingleObject(& doneEvent, 0, 0, 0, (void *)0); - ntStatus = myStatus; + fdcInfo.BufferCount = 0; + fdcInfo.BufferSize = 0; + ntStatus = FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (770 << 2)) | 3, &fdcInfo); } - } else { - - } - { - fdcInfo.BufferCount = 0; - fdcInfo.BufferSize = 0; - ntStatus = FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (770 << 2)) | 3, - & fdcInfo); - } - if (ntStatus >= 0L) { - disketteExtension->MaxTransferSize = fdcInfo.MaxTransferSize; - if (fdcInfo.AcpiBios) { - if (fdcInfo.AcpiFdiSupported) { - { - ntStatus = FlAcpiConfigureFloppy(disketteExtension, & fdcInfo); - } - if ((int )disketteExtension->DriveType == 4) { - disketteExtension->PerpendicularMode = (int )disketteExtension->PerpendicularMode | (1 << fdcInfo.PeripheralNumber); + if (ntStatus >= 0L) { + disketteExtension->MaxTransferSize = fdcInfo.MaxTransferSize; + if (fdcInfo.AcpiBios) { + if (fdcInfo.AcpiFdiSupported) { + { ntStatus = FlAcpiConfigureFloppy(disketteExtension, &fdcInfo); } + if ((int)disketteExtension->DriveType == 4) { + disketteExtension->PerpendicularMode = + (int)disketteExtension->PerpendicularMode | + (1 << fdcInfo.PeripheralNumber); + } else { + } } else { - + goto _L; } } else { - goto _L; - } - } else { - _L: /* CIL Label */ - if ((int )disketteExtension->DriveType == 4) { - disketteExtension->PerpendicularMode = (int )disketteExtension->PerpendicularMode | (1 << fdcInfo.PeripheralNumber); - } else { + _L: /* CIL Label */ + if ((int)disketteExtension->DriveType == 4) { + disketteExtension->PerpendicularMode = + (int)disketteExtension->PerpendicularMode | + (1 << fdcInfo.PeripheralNumber); + } else { + } + InterfaceType = 0; + { + while (1) { + while_43_continue: /* CIL Label */; + if ((int)InterfaceType < 16) { + } else { + goto while_43_break; + } + { + fdcInfo.BusType = InterfaceType; + ntStatus = IoQueryDeviceDescription( + &fdcInfo.BusType, &fdcInfo.BusNumber, &Dc, + &fdcInfo.ControllerNumber, &Fp, &fdcInfo.PeripheralNumber, + &FlConfigCallBack, disketteExtension); + } + if (ntStatus >= 0L) { + {} + goto while_43_break; + } else { + } + InterfaceType = (INTERFACE_TYPE)((int)InterfaceType + 1); + } + while_43_break: /* CIL Label */; + } } - InterfaceType = 0; - { - while (1) { - while_43_continue: /* CIL Label */ ; - if ((int )InterfaceType < 16) { - + if (ntStatus >= 0L) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + disketteExtension->DeviceUnit = (unsigned char)fdcInfo.UnitNumber; + disketteExtension->DriveOnValue = (unsigned char)fdcInfo.UnitNumber; } else { - goto while_43_break; + disketteExtension->DeviceUnit = + (unsigned char)fdcInfo.PeripheralNumber; + disketteExtension->DriveOnValue = + (unsigned char)(fdcInfo.PeripheralNumber | + (unsigned long)(16 << fdcInfo.PeripheralNumber)); } { - fdcInfo.BusType = InterfaceType; - ntStatus = IoQueryDeviceDescription(& fdcInfo.BusType, & fdcInfo.BusNumber, - & Dc, & fdcInfo.ControllerNumber, & Fp, - & fdcInfo.PeripheralNumber, & FlConfigCallBack, - disketteExtension); + pnpStatus = IoRegisterDeviceInterface( + disketteExtension->UnderlyingPDO, + (GUID *)(&MOUNTDEV_MOUNTED_DEVICE_GUID), (void *)0, + &disketteExtension->InterfaceString); } - if (ntStatus >= 0L) { + if (pnpStatus >= 0L) { { + pnpStatus = IoSetDeviceInterfaceState( + &disketteExtension->InterfaceString, 1); } - goto while_43_break; } else { - } - InterfaceType = (INTERFACE_TYPE )((int )InterfaceType + 1); - } - while_43_break: /* CIL Label */ ; - } - } - if (ntStatus >= 0L) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - disketteExtension->DeviceUnit = (unsigned char )fdcInfo.UnitNumber; - disketteExtension->DriveOnValue = (unsigned char )fdcInfo.UnitNumber; - } else { - disketteExtension->DeviceUnit = (unsigned char )fdcInfo.PeripheralNumber; - disketteExtension->DriveOnValue = (unsigned char )(fdcInfo.PeripheralNumber | (unsigned long )(16 << fdcInfo.PeripheralNumber)); - } - { - pnpStatus = IoRegisterDeviceInterface(disketteExtension->UnderlyingPDO, (GUID *)(& MOUNTDEV_MOUNTED_DEVICE_GUID), - (void *)0, & disketteExtension->InterfaceString); - } - if (pnpStatus >= 0L) { { - pnpStatus = IoSetDeviceInterfaceState(& disketteExtension->InterfaceString, - 1); + disketteExtension->IsStarted = 1; + /* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + disketteExtension->HoldNewRequests = 0; + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + FloppyProcessQueuedRequests(disketteExtension); } } else { - - } - { - disketteExtension->IsStarted = 1; -/* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - disketteExtension->HoldNewRequests = 0; -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - FloppyProcessQueuedRequests(disketteExtension); } } else { - } - } else { - - } - { - Irp->IoStatus.__annonCompField4.Status = ntStatus; - myStatus = ntStatus; - IofCompleteRequest(Irp, 0); + { + Irp->IoStatus.__annonCompField4.Status = ntStatus; + myStatus = ntStatus; + IofCompleteRequest(Irp, 0); + } + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FloppyPnpComplete(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) -{ +NTSTATUS FloppyPnpComplete(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context) { { - { - KeSetEvent((struct _KEVENT *)Context, 1, 0); + { KeSetEvent((struct _KEVENT *)Context, 1, 0); } + return (-1073741802L); } - return (-1073741802L); } -} -NTSTATUS FloppyPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDISKETTE_EXTENSION disketteExtension ; - NTSTATUS ntStatus ; - PIO_STACK_LOCATION irpSp ; - POWER_STATE_TYPE type ; - POWER_STATE state ; - BOOLEAN WaitForCompletion ; +NTSTATUS FloppyPower(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDISKETTE_EXTENSION disketteExtension; + NTSTATUS ntStatus; + PIO_STACK_LOCATION irpSp; + POWER_STATE_TYPE type; + POWER_STATE state; + BOOLEAN WaitForCompletion; { - ntStatus = myStatus; - WaitForCompletion = 1; - { - } - disketteExtension = DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - type = irpSp->Parameters.Power.Type; - state = irpSp->Parameters.Power.State; - if (irpSp->MinorFunction == 3) { - goto switch_46_3; - } else { - if (irpSp->MinorFunction == 2) { - goto switch_46_2; + ntStatus = myStatus; + WaitForCompletion = 1; + {} + disketteExtension = DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + type = irpSp->Parameters.Power.Type; + state = irpSp->Parameters.Power.State; + if (irpSp->MinorFunction == 3) { + goto switch_46_3; } else { - { - goto switch_46_default; - if (0) { - switch_46_3: /* CIL Label */ ; - { - } - if ((int )type == 0) { - if ((int )state.SystemState > 5) { - ntStatus = 0L; - goto switch_46_break; - } else { - - } - } else { - - } - { -/* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - } - if (disketteExtension->ThreadReferenceCount >= 0L) { - { -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - } - { - } - { -/* PoStartNextPowerIrp(Irp); */ /* INLINED */ - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = -2147483631L; - myStatus = -2147483631L; - IofCompleteRequest(Irp, 0); - } - return (-2147483631L); - } else { - - } + if (irpSp->MinorFunction == 2) { + goto switch_46_2; + } else { { -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - ntStatus = 0L; - } - goto switch_46_break; - switch_46_2: /* CIL Label */ ; - if ((int )type == 0) { - { -/* ExAcquireFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ - } - if ((int )state.SystemState == 1) { + goto switch_46_default; + if (0) { + switch_46_3: /* CIL Label */; + {} + if ((int)type == 0) { + if ((int)state.SystemState > 5) { + ntStatus = 0L; + goto switch_46_break; + } else { + } + } else { + } { + /* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + } + if (disketteExtension->ThreadReferenceCount >= 0L) { + { + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + } {} { + /* PoStartNextPowerIrp(Irp); */ /* INLINED */ + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = -2147483631L; + myStatus = -2147483631L; + IofCompleteRequest(Irp, 0); + } + return (-2147483631L); + } else { } - disketteExtension->PoweringDown = 0; - WaitForCompletion = 0; - } else { { + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + ntStatus = 0L; } - WaitForCompletion = 1; - disketteExtension->PoweringDown = 1; - } - { -/* ExReleaseFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ - } - if ((unsigned int )disketteExtension->FloppyThread != (unsigned int )((void *)0)) { - if ((int )WaitForCompletion == 1) { + goto switch_46_break; + switch_46_2: /* CIL Label */; + if ((int)type == 0) { + { + /* ExAcquireFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ + } + if ((int)state.SystemState == 1) { + {} + disketteExtension->PoweringDown = 0; + WaitForCompletion = 0; + } else { + {} + WaitForCompletion = 1; + disketteExtension->PoweringDown = 1; + } { - KeWaitForSingleObject(disketteExtension->FloppyThread, 0, 0, 0, (void *)0); + /* ExReleaseFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ + } + if ((unsigned int)disketteExtension->FloppyThread != + (unsigned int)((void *)0)) { + if ((int)WaitForCompletion == 1) { + { + KeWaitForSingleObject(disketteExtension->FloppyThread, 0, 0, + 0, (void *)0); + } + } else { + } + } else { } } else { - } + {} + ntStatus = 0L; + goto switch_46_break; + switch_46_default: /* CIL Label */; + goto switch_46_break; } else { - + switch_46_break: /* CIL Label */; } - } else { - - } - { } - ntStatus = 0L; - goto switch_46_break; - switch_46_default: /* CIL Label */ ; - goto switch_46_break; - } else { - switch_46_break: /* CIL Label */ ; - } } } - } - { -/* PoStartNextPowerIrp(Irp); */ /* INLINED */ - } - if (s == NP) { - s = SKIP1; - } else { + { /* PoStartNextPowerIrp(Irp); */ /* INLINED */ + } + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } { - errorFn(); + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + ntStatus = PoCallDriver(disketteExtension->TargetObject, Irp); } + return (ntStatus); } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - ntStatus = PoCallDriver(disketteExtension->TargetObject, Irp); - } - return (ntStatus); -} } -NTSTATUS FloppyReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpSp ; - NTSTATUS ntStatus ; - PDISKETTE_EXTENSION disketteExtension ; +NTSTATUS FloppyReadWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpSp; + NTSTATUS ntStatus; + PDISKETTE_EXTENSION disketteExtension; { - { - } - { - disketteExtension = DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; -/* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - } - if (disketteExtension->HoldNewRequests) { - { - ntStatus = FloppyQueueRequest(disketteExtension, Irp); -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ + {} { + disketteExtension = DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + /* ExAcquireFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED + */ } - return (ntStatus); - } else { - - } - { -/* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED */ - } - if (disketteExtension->IsRemoved) { - goto _L; - } else { - if (! disketteExtension->IsStarted) { - _L: /* CIL Label */ - if (disketteExtension->IsRemoved) { - ntStatus = -1073741738L; - } else { - ntStatus = -1073741823L; - } + if (disketteExtension->HoldNewRequests) { { - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = ntStatus; - myStatus = ntStatus; - IofCompleteRequest(Irp, 0); + ntStatus = FloppyQueueRequest(disketteExtension, Irp); + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED + */ } return (ntStatus); } else { - } - } - if ((int )disketteExtension->MediaType > 0) { - if (irpSp->Parameters.Read.ByteOffset.__annonCompField1.LowPart + irpSp->Parameters.Read.Length > disketteExtension->ByteCapacity) { - goto _L___1; + { + /* ExReleaseFastMutex(& disketteExtension->HoldNewReqMutex); */ /* INLINED + */ + } + if (disketteExtension->IsRemoved) { + goto _L; } else { - if ((irpSp->Parameters.Read.Length & (disketteExtension->BytesPerSector - 1UL)) != 0UL) { - _L___1: /* CIL Label */ - { + if (!disketteExtension->IsStarted) { + _L: /* CIL Label */ + if (disketteExtension->IsRemoved) { + ntStatus = -1073741738L; + } else { + ntStatus = -1073741823L; } { + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = ntStatus; + myStatus = ntStatus; + IofCompleteRequest(Irp, 0); } - ntStatus = -1073741811L; + return (ntStatus); } else { - goto _L___0; } } - } else { - _L___0: /* CIL Label */ - if (irpSp->Parameters.Read.Length) { - { - } - { - ntStatus = FlQueueIrpToThread(Irp, disketteExtension); + if ((int)disketteExtension->MediaType > 0) { + if (irpSp->Parameters.Read.ByteOffset.__annonCompField1.LowPart + + irpSp->Parameters.Read.Length > + disketteExtension->ByteCapacity) { + goto _L___1; + } else { + if ((irpSp->Parameters.Read.Length & + (disketteExtension->BytesPerSector - 1UL)) != 0UL) { + _L___1 : /* CIL Label */ + {} + {} + ntStatus = -1073741811L; + } else { + goto _L___0; + } } } else { - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - { - } - { - IofCompleteRequest(Irp, 0); + _L___0: /* CIL Label */ + if (irpSp->Parameters.Read.Length) { + {} { ntStatus = FlQueueIrpToThread(Irp, disketteExtension); } + } else { + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + {} { IofCompleteRequest(Irp, 0); } + return (0L); } - return (0L); } - } - if (ntStatus != 259L) { - Irp->IoStatus.__annonCompField4.Status = ntStatus; - myStatus = ntStatus; - { - } - { - IofCompleteRequest(Irp, 0); + if (ntStatus != 259L) { + Irp->IoStatus.__annonCompField4.Status = ntStatus; + myStatus = ntStatus; + {} { IofCompleteRequest(Irp, 0); } + } else { } - } else { - + return (ntStatus); } - return (ntStatus); -} } -NTSTATUS FlInterpretError(UCHAR StatusRegister1 , UCHAR StatusRegister2 ) -{ +NTSTATUS FlInterpretError(UCHAR StatusRegister1, UCHAR StatusRegister2) { { - if ((int )StatusRegister1 & 32) { - goto _L; - } else { - if ((int )StatusRegister2 & 32) { - _L: /* CIL Label */ - { - } - return (-1073741761L); + if ((int)StatusRegister1 & 32) { + goto _L; } else { - + if ((int)StatusRegister2 & 32) { + _L : /* CIL Label */ + {} + return (-1073741761L); + } else { + } } - } - if ((int )StatusRegister1 & 16) { - { + if ((int)StatusRegister1 & 16) { + {} + return (-1073741764L); + } else { } - return (-1073741764L); - } else { - - } - if ((int )StatusRegister1 & 4) { - goto _L___0; - } else { - if ((int )StatusRegister1 & 128) { - _L___0: /* CIL Label */ - { - } - return (-1073741803L); + if ((int)StatusRegister1 & 4) { + goto _L___0; } else { - + if ((int)StatusRegister1 & 128) { + _L___0 : /* CIL Label */ + {} + return (-1073741803L); + } else { + } } - } - if ((int )StatusRegister2 & 1) { - goto _L___1; - } else { - if ((int )StatusRegister2 & 2) { + if ((int)StatusRegister2 & 1) { goto _L___1; } else { - if ((int )StatusRegister2 & 64) { - _L___1: /* CIL Label */ - { - } - return (-1073741668L); + if ((int)StatusRegister2 & 2) { + goto _L___1; } else { - + if ((int)StatusRegister2 & 64) { + _L___1 : /* CIL Label */ + {} + return (-1073741668L); + } else { + } } } - } - if ((int )StatusRegister1 & 2) { - { + if ((int)StatusRegister1 & 2) { + {} + return (-1073741662L); + } else { } - return (-1073741662L); - } else { - - } - if ((int )StatusRegister1 & 1) { - { + if ((int)StatusRegister1 & 1) { + {} + return (-1073741467L); + } else { } - return (-1073741467L); - } else { - - } - if ((int )StatusRegister2 & 16) { - { + if ((int)StatusRegister2 & 16) { + {} + return (-1073741466L); + } else { } - return (-1073741466L); - } else { - - } - { - } - return (-1073741465L); -} -} -void FlFinishOperation(PIRP Irp , PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - int tmp ; - - { - { - } - if (myStatus != 0L) { - if (DisketteExtension->HardwareFailed) { - DisketteExtension->HardwareFailCount = (UCHAR )((int )DisketteExtension->HardwareFailCount + 1); - if ((int )DisketteExtension->HardwareFailCount < 2) { - { - ntStatus = FlInitializeControllerHardware(DisketteExtension); - } - if (ntStatus >= 0L) { - { - } - DisketteExtension->MediaType = -1; - { - } - { -/* ExAcquireFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ - DisketteExtension->ThreadReferenceCount += 1L; -/* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ - ExfInterlockedInsertHeadList(& DisketteExtension->ListEntry, & Irp->Tail.Overlay.__annonCompField17.ListEntry, - & DisketteExtension->ListSpinLock); + {} + return (-1073741465L); + } +} +void FlFinishOperation(PIRP Irp, PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + int tmp; + + { + {} + if (myStatus != 0L) { + if (DisketteExtension->HardwareFailed) { + DisketteExtension->HardwareFailCount = + (UCHAR)((int)DisketteExtension->HardwareFailCount + 1); + if ((int)DisketteExtension->HardwareFailCount < 2) { + { ntStatus = FlInitializeControllerHardware(DisketteExtension); } + if (ntStatus >= 0L) { + {} + DisketteExtension->MediaType = -1; + {} { + /* ExAcquireFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + DisketteExtension->ThreadReferenceCount += 1L; + /* ExReleaseFastMutex(& DisketteExtension->ThreadReferenceMutex); */ /* INLINED */ + ExfInterlockedInsertHeadList( + &DisketteExtension->ListEntry, + &Irp->Tail.Overlay.__annonCompField17.ListEntry, + &DisketteExtension->ListSpinLock); + } + return; + } else { } - return; + {} } else { - - } - { } } else { - } } else { - } - } else { - - } - DisketteExtension->HardwareFailCount = 0; - if (! (myStatus >= 0L)) { - if (myStatus == -1073741661L) { - tmp = 1; - } else { - if (myStatus == -1073741643L) { + DisketteExtension->HardwareFailCount = 0; + if (!(myStatus >= 0L)) { + if (myStatus == -1073741661L) { tmp = 1; } else { - if (myStatus == -1073741662L) { + if (myStatus == -1073741643L) { tmp = 1; } else { - if (myStatus == -1073741805L) { + if (myStatus == -1073741662L) { tmp = 1; } else { - if (myStatus == -2147483626L) { + if (myStatus == -1073741805L) { tmp = 1; } else { - if (myStatus == -1073741804L) { + if (myStatus == -2147483626L) { tmp = 1; } else { - if (myStatus == -1073741806L) { + if (myStatus == -1073741804L) { tmp = 1; } else { - tmp = 0; + if (myStatus == -1073741806L) { + tmp = 1; + } else { + tmp = 0; + } } } } } } } - } - if ((unsigned char )tmp) { - { -/* IoSetHardErrorOrVerifyDevice(Irp, DisketteExtension->DeviceObject); */ /* INLINED */ + if ((unsigned char)tmp) { + { + /* IoSetHardErrorOrVerifyDevice(Irp, DisketteExtension->DeviceObject); */ /* INLINED */ + } + } else { } } else { - } - } else { - - } - if (myStatus != 0L) { - if (myStatus != -2147483626L) { - if (myStatus != -1073741805L) { - { + if (myStatus != 0L) { + if (myStatus != -2147483626L) { + if (myStatus != -1073741805L) { + {} + } else { + goto _L___0; } } else { goto _L___0; } } else { - goto _L___0; + _L___0 : /* CIL Label */ + {} } - } else { - _L___0: /* CIL Label */ - { - } - } - { - } - { - } - { - IofCompleteRequest(Irp, 1); + {} {} { IofCompleteRequest(Irp, 1); } + return; } - return; -} } -NTSTATUS FlStartDrive(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp , BOOLEAN WriteOperation , - BOOLEAN SetUpMedia , BOOLEAN IgnoreChange ) -{ LARGE_INTEGER delay ; - BOOLEAN motorStarted ; - UCHAR driveStatus ; - NTSTATUS ntStatus ; - FDC_ENABLE_PARMS fdcEnableParms ; - FDC_DISK_CHANGE_PARMS fdcDiskChangeParms ; +NTSTATUS FlStartDrive(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp, + BOOLEAN WriteOperation, BOOLEAN SetUpMedia, + BOOLEAN IgnoreChange) { + LARGE_INTEGER delay; + BOOLEAN motorStarted; + UCHAR driveStatus; + NTSTATUS ntStatus; + FDC_ENABLE_PARMS fdcEnableParms; + FDC_DISK_CHANGE_PARMS fdcDiskChangeParms; { - ntStatus = 0L; - { - } - *(DriveMediaConstants + (DriveMediaLimits + DisketteExtension->DriveType)->HighestDriveMediaType) = DisketteExtension->BiosDriveMediaConstants; - if ((int )DisketteExtension->MediaType == -1) { - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + 0); - } else { - if ((int )DisketteExtension->MediaType == 0) { + ntStatus = 0L; + {} * (DriveMediaConstants + + (DriveMediaLimits + DisketteExtension->DriveType) + ->HighestDriveMediaType) = + DisketteExtension->BiosDriveMediaConstants; + if ((int)DisketteExtension->MediaType == -1) { DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + 0); } else { - + if ((int)DisketteExtension->MediaType == 0) { + DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + 0); + } else { + } + } + fdcEnableParms.DriveOnValue = DisketteExtension->DriveOnValue; + if (WriteOperation) { + fdcEnableParms.TimeToWait = + DisketteExtension->DriveMediaConstants.MotorSettleTimeWrite; + } else { + fdcEnableParms.TimeToWait = + DisketteExtension->DriveMediaConstants.MotorSettleTimeRead; } - } - fdcEnableParms.DriveOnValue = DisketteExtension->DriveOnValue; - if (WriteOperation) { - fdcEnableParms.TimeToWait = DisketteExtension->DriveMediaConstants.MotorSettleTimeWrite; - } else { - fdcEnableParms.TimeToWait = DisketteExtension->DriveMediaConstants.MotorSettleTimeRead; - } - { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (774 << 2)) | 3, - & fdcEnableParms); - motorStarted = fdcEnableParms.MotorStarted; - } - if (ntStatus >= 0L) { { - fdcDiskChangeParms.DriveOnValue = DisketteExtension->DriveOnValue; - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (776 << 2)) | 3, - & fdcDiskChangeParms); - driveStatus = fdcDiskChangeParms.DriveStatus; + ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (774 << 2)) | 3, &fdcEnableParms); + motorStarted = fdcEnableParms.MotorStarted; } - } else { - - } - if (! (ntStatus >= 0L)) { - return (ntStatus); - } else { - - } - if ((int )DisketteExtension->DriveType == 0) { - if (motorStarted) { - goto _L___1; + if (ntStatus >= 0L) { + { + fdcDiskChangeParms.DriveOnValue = DisketteExtension->DriveOnValue; + ntStatus = + FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (776 << 2)) | 3, &fdcDiskChangeParms); + driveStatus = fdcDiskChangeParms.DriveStatus; + } } else { - goto _L___3; } - } else { - _L___3: /* CIL Label */ - if ((int )DisketteExtension->DriveType != 0) { - if ((int )driveStatus & 128) { - _L___1: /* CIL Label */ - { - } - DisketteExtension->MediaType = -1; - if ((int )((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { - if (Irp) { - { -/* IoSetHardErrorOrVerifyDevice(Irp, DisketteExtension->DeviceObject); */ /* INLINED */ - } - } else { - - } - (DisketteExtension->DeviceObject)->Flags |= 2UL; - } else { - - } - if ((int )DisketteExtension->DriveType != 0) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - DisketteExtension->FifoBuffer[0] = 14; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, - 0); - } - if (! (ntStatus >= 0L)) { + if (!(ntStatus >= 0L)) { + return (ntStatus); + } else { + } + if ((int)DisketteExtension->DriveType == 0) { + if (motorStarted) { + goto _L___1; + } else { + goto _L___3; + } + } else { + _L___3: /* CIL Label */ + if ((int)DisketteExtension->DriveType != 0) { + if ((int)driveStatus & 128) { + _L___1 : /* CIL Label */ + {} + DisketteExtension->MediaType = -1; + if ((int)((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { + if (Irp) { { + /* IoSetHardErrorOrVerifyDevice(Irp, DisketteExtension->DeviceObject); */ /* INLINED */ } - return (ntStatus); - } else { - - } - if ((int )DisketteExtension->FifoBuffer[0] & 32) { - driveStatus = 127; } else { - driveStatus = 128; } - if ((int )driveStatus & 128) { + (DisketteExtension->DeviceObject)->Flags |= 2UL; + } else { + } + if ((int)DisketteExtension->DriveType != 0) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { { + DisketteExtension->FifoBuffer[0] = 14; + DisketteExtension->FifoBuffer[1] = + DisketteExtension->DeviceUnit; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - if ((int )((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { - (DisketteExtension->DeviceObject)->Flags &= 4294967293UL; + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); + } else { + } + if ((int)DisketteExtension->FifoBuffer[0] & 32) { + driveStatus = 127; + } else { + driveStatus = 128; + } + if ((int)driveStatus & 128) { + {} + if ((int)((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { + (DisketteExtension->DeviceObject)->Flags &= 4294967293UL; + } else { + } + return (-1073741805L); } else { - } - return (-1073741805L); } else { - } - } else { - - } - { - DisketteExtension->FifoBuffer[0] = 16; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - DisketteExtension->FifoBuffer[2] = 1; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); - } - if (! (ntStatus >= 0L)) { { + DisketteExtension->FifoBuffer[0] = 16; + DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; + DisketteExtension->FifoBuffer[2] = 1; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - return (ntStatus); - } else { - if (! ((int )DisketteExtension->FifoBuffer[0] & 32)) { - goto _L; + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); } else { - if ((int )DisketteExtension->FifoBuffer[1] != 1) { - _L: /* CIL Label */ - { - } - DisketteExtension->HardwareFailed = 1; - return (-1073741464L); + if (!((int)DisketteExtension->FifoBuffer[0] & 32)) { + goto _L; } else { - + if ((int)DisketteExtension->FifoBuffer[1] != 1) { + _L : /* CIL Label */ + {} + DisketteExtension->HardwareFailed = 1; + return (-1073741464L); + } else { + } } } - } - { - DisketteExtension->FifoBuffer[0] = 16; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - DisketteExtension->FifoBuffer[2] = 0; - delay.__annonCompField1.LowPart = 4294966396UL; - delay.__annonCompField1.HighPart = -1; - KeDelayExecutionThread(0, 0, & delay); - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); - delay.__annonCompField1.LowPart = 4294967291UL; - delay.__annonCompField1.HighPart = -1; - KeDelayExecutionThread(0, 0, & delay); - } - if (! (ntStatus >= 0L)) { { + DisketteExtension->FifoBuffer[0] = 16; + DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; + DisketteExtension->FifoBuffer[2] = 0; + delay.__annonCompField1.LowPart = 4294966396UL; + delay.__annonCompField1.HighPart = -1; + KeDelayExecutionThread(0, 0, &delay); + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + delay.__annonCompField1.LowPart = 4294967291UL; + delay.__annonCompField1.HighPart = -1; + KeDelayExecutionThread(0, 0, &delay); } - return (ntStatus); - } else { - if (! ((int )DisketteExtension->FifoBuffer[0] & 32)) { - goto _L___0; + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); } else { - if ((int )DisketteExtension->FifoBuffer[1] != 0) { - _L___0: /* CIL Label */ - { - } - DisketteExtension->HardwareFailed = 1; - return (-1073741464L); + if (!((int)DisketteExtension->FifoBuffer[0] & 32)) { + goto _L___0; } else { - + if ((int)DisketteExtension->FifoBuffer[1] != 0) { + _L___0 : /* CIL Label */ + {} + DisketteExtension->HardwareFailed = 1; + return (-1073741464L); + } else { + } } } - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - DisketteExtension->FifoBuffer[0] = 14; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, - 0); - } - if (! (ntStatus >= 0L)) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { { + DisketteExtension->FifoBuffer[0] = 14; + DisketteExtension->FifoBuffer[1] = + DisketteExtension->DeviceUnit; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); + } else { + } + if ((int)DisketteExtension->FifoBuffer[0] & 32) { + driveStatus = 127; + } else { + driveStatus = 128; } - return (ntStatus); } else { - + { + ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (776 << 2)) | 3, + &fdcDiskChangeParms); + driveStatus = fdcDiskChangeParms.DriveStatus; + } + if (!(ntStatus >= 0L)) { + return (ntStatus); + } else { + } } - if ((int )DisketteExtension->FifoBuffer[0] & 32) { - driveStatus = 127; + if ((int)driveStatus & 128) { + {} + if ((int)((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { + (DisketteExtension->DeviceObject)->Flags &= 4294967293UL; + } else { + } + return (-1073741805L); } else { - driveStatus = 128; } } else { - { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (776 << 2)) | 3, - & fdcDiskChangeParms); - driveStatus = fdcDiskChangeParms.DriveStatus; - } - if (! (ntStatus >= 0L)) { - return (ntStatus); - } else { - - } } - if ((int )driveStatus & 128) { - { - } - if ((int )((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { - (DisketteExtension->DeviceObject)->Flags &= 4294967293UL; + if ((int)IgnoreChange == 0) { + if ((int)((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { + {} + return (-2147483626L); } else { - - } - return (-1073741805L); - } else { - - } - } else { - - } - if ((int )IgnoreChange == 0) { - if ((int )((DisketteExtension->DeviceObject)->Vpb)->Flags & 1) { - { + return (-1073741435L); } - return (-2147483626L); } else { - return (-1073741435L); } } else { - + goto _L___2; } } else { - goto _L___2; - } - } else { - _L___2: /* CIL Label */ - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - FlHdbit(DisketteExtension); + _L___2: /* CIL Label */ + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { FlHdbit(DisketteExtension); } + } else { } - } else { - } } - } - if (SetUpMedia) { - if ((int )DisketteExtension->MediaType == -1) { - { - ntStatus = FlDetermineMediaType(DisketteExtension); - } - } else { - if ((int )DisketteExtension->MediaType == 0) { - { - } - return (-1073741804L); + if (SetUpMedia) { + if ((int)DisketteExtension->MediaType == -1) { + { ntStatus = FlDetermineMediaType(DisketteExtension); } } else { - if ((int )DisketteExtension->DriveMediaType != (int )DisketteExtension->LastDriveMediaType) { - { - ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); - } - if (! (ntStatus >= 0L)) { - { + if ((int)DisketteExtension->MediaType == 0) { + {} + return (-1073741804L); + } else { + if ((int)DisketteExtension->DriveMediaType != + (int)DisketteExtension->LastDriveMediaType) { + { ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); } + if (!(ntStatus >= 0L)) { + {} + } else { } } else { - } - } else { - } } + } else { } - } else { - - } - if (WriteOperation) { - if (ntStatus >= 0L) { - { - DisketteExtension->FifoBuffer[0] = 14; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); - } - if (! (ntStatus >= 0L)) { + if (WriteOperation) { + if (ntStatus >= 0L) { { + DisketteExtension->FifoBuffer[0] = 14; + DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; + ntStatus = + FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - return (ntStatus); - } else { - - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if (! ((int )DisketteExtension->FifoBuffer[0] & 32)) { - { + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); + } else { + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if (!((int)DisketteExtension->FifoBuffer[0] & 32)) { + {} + return (-1073741805L); + } else { } - return (-1073741805L); } else { - } - } else { - - } - if ((int )DisketteExtension->FifoBuffer[0] & 64) { - { + if ((int)DisketteExtension->FifoBuffer[0] & 64) { + {} + return (-1073741662L); + } else { } - return (-1073741662L); } else { - } } else { - } - } else { - + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FlDatarateSpecifyConfigure(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; +NTSTATUS FlDatarateSpecifyConfigure(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; { - ntStatus = 0L; - if (DisketteExtension->ControllerConfigurable) { - DisketteExtension->FifoBuffer[0] = 17; - DisketteExtension->FifoBuffer[1] = 0; - DisketteExtension->FifoBuffer[2] = 15; - DisketteExtension->FifoBuffer[2] = (int )DisketteExtension->FifoBuffer[2] + 16; - if (! DisketteExtension->DriveMediaConstants.CylinderShift) { - DisketteExtension->FifoBuffer[2] = (int )DisketteExtension->FifoBuffer[2] + 64; + ntStatus = 0L; + if (DisketteExtension->ControllerConfigurable) { + DisketteExtension->FifoBuffer[0] = 17; + DisketteExtension->FifoBuffer[1] = 0; + DisketteExtension->FifoBuffer[2] = 15; + DisketteExtension->FifoBuffer[2] = + (int)DisketteExtension->FifoBuffer[2] + 16; + if (!DisketteExtension->DriveMediaConstants.CylinderShift) { + DisketteExtension->FifoBuffer[2] = + (int)DisketteExtension->FifoBuffer[2] + 64; + } else { + } + { + DisketteExtension->FifoBuffer[3] = 0; + ntStatus = + FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + if (ntStatus == -1073741661L) { + DisketteExtension->ControllerConfigurable = 0; + ntStatus = 0L; + } else { + } } else { - } - { - DisketteExtension->FifoBuffer[3] = 0; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, DisketteExtension->FifoBuffer, - (void *)0, 0, 0); - } - if (ntStatus == -1073741661L) { - DisketteExtension->ControllerConfigurable = 0; - ntStatus = 0L; + if (ntStatus >= 0L) { + goto _L; } else { - - } - } else { - - } - if (ntStatus >= 0L) { - goto _L; - } else { - if (ntStatus == -1073741661L) { - _L: /* CIL Label */ + if (ntStatus == -1073741661L) { + _L : /* CIL Label */ { - DisketteExtension->FifoBuffer[0] = 13; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DriveMediaConstants.StepRateHeadUnloadTime; - DisketteExtension->FifoBuffer[2] = DisketteExtension->DriveMediaConstants.HeadLoadTime; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); + DisketteExtension->FifoBuffer[0] = 13; + DisketteExtension->FifoBuffer[1] = + DisketteExtension->DriveMediaConstants.StepRateHeadUnloadTime; + DisketteExtension->FifoBuffer[2] = + DisketteExtension->DriveMediaConstants.HeadLoadTime; + ntStatus = + FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - if (ntStatus >= 0L) { - { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (777 << 2)) | 3, - & DisketteExtension->DriveMediaConstants.DataTransferRate); - } if (ntStatus >= 0L) { { - ntStatus = FlRecalibrateDrive(DisketteExtension); + ntStatus = FlFdcDeviceIo( + DisketteExtension->TargetObject, ((7 << 16) | (777 << 2)) | 3, + &DisketteExtension->DriveMediaConstants.DataTransferRate); + } + if (ntStatus >= 0L) { + { ntStatus = FlRecalibrateDrive(DisketteExtension); } + } else { } } else { - + {} } } else { - { - } - } - } else { - { + {} } } - } - if (ntStatus >= 0L) { - DisketteExtension->LastDriveMediaType = DisketteExtension->DriveMediaType; - } else { - DisketteExtension->LastDriveMediaType = 0; - { + if (ntStatus >= 0L) { + DisketteExtension->LastDriveMediaType = DisketteExtension->DriveMediaType; + } else { + DisketteExtension->LastDriveMediaType = 0; + {} } + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FlRecalibrateDrive(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - UCHAR recalibrateCount ; - UCHAR fifoBuffer[2] ; +NTSTATUS FlRecalibrateDrive(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + UCHAR recalibrateCount; + UCHAR fifoBuffer[2]; { - recalibrateCount = 0; - { - while (1) { - while_93_continue: /* CIL Label */ ; + recalibrateCount = 0; { - DisketteExtension->FifoBuffer[0] = 11; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, DisketteExtension->FifoBuffer, - (void *)0, 0, 0); - } - if (! (ntStatus >= 0L)) { - { - } - } else { - - } - if (ntStatus >= 0L) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { + while (1) { + while_93_continue: /* CIL Label */; { - fifoBuffer[0] = DisketteExtension->FifoBuffer[0]; - fifoBuffer[1] = DisketteExtension->FifoBuffer[1]; - DisketteExtension->FifoBuffer[0] = 14; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); + DisketteExtension->FifoBuffer[0] = 11; + DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; + ntStatus = + FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - if (! (ntStatus >= 0L)) { - { + if (!(ntStatus >= 0L)) { + {} + } else { + } + if (ntStatus >= 0L) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { + fifoBuffer[0] = DisketteExtension->FifoBuffer[0]; + fifoBuffer[1] = DisketteExtension->FifoBuffer[1]; + DisketteExtension->FifoBuffer[0] = 14; + DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); + } else { + } + DisketteExtension->FifoBuffer[0] = fifoBuffer[0]; + DisketteExtension->FifoBuffer[1] = fifoBuffer[1]; + } else { + } + if (!((int)DisketteExtension->FifoBuffer[0] & 32)) { + goto _L; + } else { + if ((int)DisketteExtension->FifoBuffer[1] != 0) { + _L : /* CIL Label */ + {} + DisketteExtension->HardwareFailed = 1; + ntStatus = -1073741464L; + } else { + } } - return (ntStatus); } else { - } - DisketteExtension->FifoBuffer[0] = fifoBuffer[0]; - DisketteExtension->FifoBuffer[1] = fifoBuffer[1]; - } else { + recalibrateCount = (UCHAR)((int)recalibrateCount + 1); + if (!(ntStatus >= 0L)) { + if ((int)recalibrateCount < 2) { - } - if (! ((int )DisketteExtension->FifoBuffer[0] & 32)) { - goto _L; - } else { - if ((int )DisketteExtension->FifoBuffer[1] != 0) { - _L: /* CIL Label */ - { + } else { + goto while_93_break; } - DisketteExtension->HardwareFailed = 1; - ntStatus = -1073741464L; } else { - + goto while_93_break; } } - } else { - - } - recalibrateCount = (UCHAR )((int )recalibrateCount + 1); - if (! (ntStatus >= 0L)) { - if ((int )recalibrateCount < 2) { - - } else { - goto while_93_break; - } - } else { - goto while_93_break; + while_93_break: /* CIL Label */; } + {} + return (ntStatus); } - while_93_break: /* CIL Label */ ; - } - { - } - return (ntStatus); } -} -NTSTATUS FlDetermineMediaType(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - BOOLEAN mediaTypesExhausted ; - ULONG retries ; - USHORT sectorLengthCode ; - PBOOT_SECTOR_INFO bootSector ; - LARGE_INTEGER offset ; - PIRP irp ; - int tmp ; - PVOID tmp___0 ; - int tmp___1 ; - - { - retries = 0; - { - } - DisketteExtension->IsReadOnly = 0; - retries = 0; - { - while (1) { - while_99_continue: /* CIL Label */ ; - if (retries < 3UL) { - - } else { - goto while_99_break; - } - if (retries) { - { - } - { - FlInitializeControllerHardware(DisketteExtension); - } - } else { - - } - DisketteExtension->DriveMediaType = (DriveMediaLimits + DisketteExtension->DriveType)->HighestDriveMediaType; - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + DisketteExtension->DriveMediaType); - mediaTypesExhausted = 0; +NTSTATUS FlDetermineMediaType(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + BOOLEAN mediaTypesExhausted; + ULONG retries; + USHORT sectorLengthCode; + PBOOT_SECTOR_INFO bootSector; + LARGE_INTEGER offset; + PIRP irp; + int tmp; + PVOID tmp___0; + int tmp___1; + + { + retries = 0; + {} + DisketteExtension->IsReadOnly = 0; + retries = 0; { - while (1) { - while_101_continue: /* CIL Label */ ; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - sectorLengthCode = (DriveMediaConstants + DisketteExtension->DriveMediaType)->SectorLengthCode; - FlHdbit(DisketteExtension); - } - } else { + while (1) { + while_99_continue: /* CIL Label */; + if (retries < 3UL) { - } - { - ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); - } - if (! (ntStatus >= 0L)) { - { - } - mediaTypesExhausted = 1; - } else { - { - driveMediaConstants = DriveMediaConstants + DisketteExtension->DriveMediaType; - DisketteExtension->FifoBuffer[1] = (unsigned char )((int )DisketteExtension->DeviceUnit | (((int )driveMediaConstants->NumberOfHeads - 1) << 2)); - DisketteExtension->FifoBuffer[0] = 84; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } else { + goto while_99_break; } - if (! (ntStatus >= 0L)) { - goto _L; + if (retries) { + {} { FlInitializeControllerHardware(DisketteExtension); } } else { - if (((int )DisketteExtension->FifoBuffer[0] & -33) != (int )((unsigned char )((int )DisketteExtension->DeviceUnit | (((int )driveMediaConstants->NumberOfHeads - 1) << 2)))) { - goto _L; - } else { - if ((int )DisketteExtension->FifoBuffer[1] != 0) { - goto _L; + } + DisketteExtension->DriveMediaType = + (DriveMediaLimits + DisketteExtension->DriveType) + ->HighestDriveMediaType; + DisketteExtension->DriveMediaConstants = + *(DriveMediaConstants + DisketteExtension->DriveMediaType); + mediaTypesExhausted = 0; + { + while (1) { + while_101_continue: /* CIL Label */; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { + sectorLengthCode = + (DriveMediaConstants + DisketteExtension->DriveMediaType) + ->SectorLengthCode; + FlHdbit(DisketteExtension); + } } else { - if ((int )DisketteExtension->FifoBuffer[2] != 0) { + } + { ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); } + if (!(ntStatus >= 0L)) { + {} + mediaTypesExhausted = 1; + } else { + { + driveMediaConstants = + DriveMediaConstants + DisketteExtension->DriveMediaType; + DisketteExtension->FifoBuffer[1] = + (unsigned char)((int)DisketteExtension->DeviceUnit | + (((int)driveMediaConstants->NumberOfHeads - + 1) + << 2)); + DisketteExtension->FifoBuffer[0] = 84; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + if (!(ntStatus >= 0L)) { goto _L; } else { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if ((int )DisketteExtension->FifoBuffer[6] != (int )sectorLengthCode) { - _L: /* CIL Label */ - { - } - DisketteExtension->DriveMediaType = (DRIVE_MEDIA_TYPE )((int )DisketteExtension->DriveMediaType - 1); - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + DisketteExtension->DriveMediaType); - if (ntStatus != -1073741661L) { - ntStatus = -1073741804L; - } else { - - } - if ((int )((char )DisketteExtension->DriveMediaType) < (int )((char )(DriveMediaLimits + DisketteExtension->DriveType)->LowestDriveMediaType)) { - DisketteExtension->MediaType = 0; - mediaTypesExhausted = 1; - { - } - } else { - - } - } else { - goto _L___0; - } + if (((int)DisketteExtension->FifoBuffer[0] & -33) != + (int)((unsigned char)((int)DisketteExtension->DeviceUnit | + (((int)driveMediaConstants + ->NumberOfHeads - + 1) + << 2)))) { + goto _L; } else { - _L___0: /* CIL Label */ - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - DisketteExtension->MediaType = driveMediaConstants->MediaType; - DisketteExtension->BytesPerSector = driveMediaConstants->BytesPerSector; - { - } - DisketteExtension->ByteCapacity = (((int )driveMediaConstants->BytesPerSector * (int )driveMediaConstants->SectorsPerTrack) * (1 + (int )driveMediaConstants->MaximumTrack)) * (int )driveMediaConstants->NumberOfHeads; - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + DisketteExtension->DriveMediaType); - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - tmp = 1024; - } else { - tmp = 512; - } - { - tmp___0 = ExAllocatePoolWithTag(4, tmp, 1886350406UL); - bootSector = tmp___0; - } - if (! bootSector) { - return (-1073741670L); - } else { - - } - offset.__annonCompField1.HighPart = 0; - offset.__annonCompField1.LowPart = offset.__annonCompField1.HighPart; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - tmp___1 = 1024; - } else { - tmp___1 = 512; - } - { - irp = IoBuildAsynchronousFsdRequest(3, DisketteExtension->DeviceObject, - bootSector, tmp___1, & offset, - (void *)0); - } - if (! irp) { - { - } - { -/* ExFreePool(bootSector); */ /* INLINED */ - } - return (-1073741670L); + if ((int)DisketteExtension->FifoBuffer[1] != 0) { + goto _L; + } else { + if ((int)DisketteExtension->FifoBuffer[2] != 0) { + goto _L; } else { - - } - { - irp->CurrentLocation = (CHAR )((int )irp->CurrentLocation - 1); - irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation -= 1; - ntStatus = FlReadWrite(DisketteExtension, irp, 1); - } - { - } - { -/* MmUnlockPages(irp->MdlAddress); */ /* INLINED */ -/* IoFreeMdl(irp->MdlAddress); */ /* INLINED */ -/* IoFreeIrp(irp); */ /* INLINED */ -/* ExFreePool(bootSector); */ /* INLINED */ - } - if (! (ntStatus >= 0L)) { - { - } - DisketteExtension->DriveMediaType = (DRIVE_MEDIA_TYPE )((int )DisketteExtension->DriveMediaType - 1); - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + DisketteExtension->DriveMediaType); - if (ntStatus != -1073741661L) { - ntStatus = -1073741804L; - } else { - - } - if ((int )((char )DisketteExtension->DriveMediaType) < (int )((char )(DriveMediaLimits + DisketteExtension->DriveType)->LowestDriveMediaType)) { - DisketteExtension->MediaType = 0; - mediaTypesExhausted = 1; - { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if ((int)DisketteExtension->FifoBuffer[6] != + (int)sectorLengthCode) { + _L : /* CIL Label */ + {} + DisketteExtension->DriveMediaType = + (DRIVE_MEDIA_TYPE)( + (int)DisketteExtension->DriveMediaType - 1); + DisketteExtension->DriveMediaConstants = + *(DriveMediaConstants + + DisketteExtension->DriveMediaType); + if (ntStatus != -1073741661L) { + ntStatus = -1073741804L; + } else { + } + if ((int)((char)DisketteExtension->DriveMediaType) < + (int)((char)(DriveMediaLimits + + DisketteExtension->DriveType) + ->LowestDriveMediaType)) { + DisketteExtension->MediaType = 0; + mediaTypesExhausted = 1; + {} + } else { + } + } else { + goto _L___0; } } else { - + _L___0: /* CIL Label */ + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + DisketteExtension->MediaType = + driveMediaConstants->MediaType; + DisketteExtension->BytesPerSector = + driveMediaConstants->BytesPerSector; + {} + DisketteExtension->ByteCapacity = + (((int)driveMediaConstants->BytesPerSector * + (int)driveMediaConstants->SectorsPerTrack) * + (1 + (int)driveMediaConstants->MaximumTrack)) * + (int)driveMediaConstants->NumberOfHeads; + DisketteExtension->DriveMediaConstants = + *(DriveMediaConstants + + DisketteExtension->DriveMediaType); + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + tmp = 1024; + } else { + tmp = 512; + } + { + tmp___0 = + ExAllocatePoolWithTag(4, tmp, 1886350406UL); + bootSector = tmp___0; + } + if (!bootSector) { + return (-1073741670L); + } else { + } + offset.__annonCompField1.HighPart = 0; + offset.__annonCompField1.LowPart = + offset.__annonCompField1.HighPart; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + tmp___1 = 1024; + } else { + tmp___1 = 512; + } + { + irp = IoBuildAsynchronousFsdRequest( + 3, DisketteExtension->DeviceObject, bootSector, + tmp___1, &offset, (void *)0); + } + if (!irp) { + {} { + /* ExFreePool(bootSector); */ /* INLINED */ + } + return (-1073741670L); + } else { + } + { + irp->CurrentLocation = + (CHAR)((int)irp->CurrentLocation - 1); + irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation -= 1; + ntStatus = FlReadWrite(DisketteExtension, irp, 1); + } + {} { + /* MmUnlockPages(irp->MdlAddress); */ /* INLINED */ + /* IoFreeMdl(irp->MdlAddress); */ /* INLINED */ + /* IoFreeIrp(irp); */ /* INLINED + */ + /* ExFreePool(bootSector); */ /* INLINED */ + } + if (!(ntStatus >= 0L)) { + {} + DisketteExtension->DriveMediaType = + (DRIVE_MEDIA_TYPE)( + (int)DisketteExtension->DriveMediaType - 1); + DisketteExtension->DriveMediaConstants = + *(DriveMediaConstants + + DisketteExtension->DriveMediaType); + if (ntStatus != -1073741661L) { + ntStatus = -1073741804L; + } else { + } + if ((int)((char)DisketteExtension->DriveMediaType) < + (int)((char)(DriveMediaLimits + + DisketteExtension->DriveType) + ->LowestDriveMediaType)) { + DisketteExtension->MediaType = 0; + mediaTypesExhausted = 1; + {} + } else { + } + } else { + } + } else { + } } - } else { - } - } else { - } } } } + if (!(ntStatus >= 0L)) { + if (!mediaTypesExhausted) { + + } else { + goto while_101_break; + } + } else { + goto while_101_break; + } } + while_101_break: /* CIL Label */; } - } - if (! (ntStatus >= 0L)) { - if (! mediaTypesExhausted) { - + if (ntStatus >= 0L) { + {} + goto while_99_break; } else { - goto while_101_break; } + retries += 1UL; + } + while_99_break: /* CIL Label */; + } + if (!(ntStatus >= 0L)) { + goto _L___1; + } else { + if (mediaTypesExhausted) { + _L___1 : /* CIL Label */ + {} + return (ntStatus); } else { - goto while_101_break; } } - while_101_break: /* CIL Label */ ; + DisketteExtension->MediaType = driveMediaConstants->MediaType; + DisketteExtension->BytesPerSector = driveMediaConstants->BytesPerSector; + DisketteExtension->ByteCapacity = + (((int)driveMediaConstants->BytesPerSector * + (int)driveMediaConstants->SectorsPerTrack) * + (1 + (int)driveMediaConstants->MaximumTrack)) * + (int)driveMediaConstants->NumberOfHeads; + {} { + DisketteExtension->DriveMediaConstants = + *(DriveMediaConstants + DisketteExtension->DriveMediaType); + FlCheckBootSector(DisketteExtension); } - if (ntStatus >= 0L) { - { + return (ntStatus); + } +} +void FlAllocateIoBuffer(PDISKETTE_EXTENSION DisketteExtension, + ULONG BufferSize) { + BOOLEAN allocateContiguous; + LARGE_INTEGER maxDmaAddress; + PVOID tmp; + PVOID tmp___0; + + { + if (DisketteExtension->IoBuffer) { + if (DisketteExtension->IoBufferSize >= BufferSize) { + return; + } else { } - goto while_99_break; + { FlFreeIoBuffer(DisketteExtension); } } else { - } - retries += 1UL; - } - while_99_break: /* CIL Label */ ; - } - if (! (ntStatus >= 0L)) { - goto _L___1; - } else { - if (mediaTypesExhausted) { - _L___1: /* CIL Label */ + if (BufferSize > DisketteExtension->MaxTransferSize) { + allocateContiguous = 1; + } else { + allocateContiguous = 0; + } + if (allocateContiguous) { { + maxDmaAddress.QuadPart = 16777215; + tmp = MmAllocateContiguousMemory(BufferSize, maxDmaAddress); + DisketteExtension->IoBuffer = tmp; } - return (ntStatus); } else { - + { + tmp___0 = ExAllocatePoolWithTag(4, BufferSize, 1886350406UL); + DisketteExtension->IoBuffer = tmp___0; + } } - } - DisketteExtension->MediaType = driveMediaConstants->MediaType; - DisketteExtension->BytesPerSector = driveMediaConstants->BytesPerSector; - DisketteExtension->ByteCapacity = (((int )driveMediaConstants->BytesPerSector * (int )driveMediaConstants->SectorsPerTrack) * (1 + (int )driveMediaConstants->MaximumTrack)) * (int )driveMediaConstants->NumberOfHeads; - { - } - { - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + DisketteExtension->DriveMediaType); - FlCheckBootSector(DisketteExtension); - } - return (ntStatus); -} -} -void FlAllocateIoBuffer(PDISKETTE_EXTENSION DisketteExtension , ULONG BufferSize ) -{ BOOLEAN allocateContiguous ; - LARGE_INTEGER maxDmaAddress ; - PVOID tmp ; - PVOID tmp___0 ; - - { - if (DisketteExtension->IoBuffer) { - if (DisketteExtension->IoBufferSize >= BufferSize) { + if (!DisketteExtension->IoBuffer) { return; } else { - - } - { - FlFreeIoBuffer(DisketteExtension); } - } else { - - } - if (BufferSize > DisketteExtension->MaxTransferSize) { - allocateContiguous = 1; - } else { - allocateContiguous = 0; - } - if (allocateContiguous) { { - maxDmaAddress.QuadPart = 16777215; - tmp = MmAllocateContiguousMemory(BufferSize, maxDmaAddress); - DisketteExtension->IoBuffer = tmp; + DisketteExtension->IoBufferMdl = IoAllocateMdl( + DisketteExtension->IoBuffer, BufferSize, 0, 0, (void *)0); } - } else { - { - tmp___0 = ExAllocatePoolWithTag(4, BufferSize, 1886350406UL); - DisketteExtension->IoBuffer = tmp___0; + if (!DisketteExtension->IoBufferMdl) { + if (allocateContiguous) { + { + /* MmFreeContiguousMemory(DisketteExtension->IoBuffer); */ /* INLINED + */ + } + } else { + { /* ExFreePool(DisketteExtension->IoBuffer); */ /* INLINED */ + } + } + DisketteExtension->IoBuffer = (void *)0; + return; + } else { } - } - if (! DisketteExtension->IoBuffer) { - return; - } else { - - } - { - DisketteExtension->IoBufferMdl = IoAllocateMdl(DisketteExtension->IoBuffer, BufferSize, - 0, 0, (void *)0); - } - if (! DisketteExtension->IoBufferMdl) { + { MmProbeAndLockPages(DisketteExtension->IoBufferMdl, 0, 2); } + {} if (allocateContiguous) { { -/* MmFreeContiguousMemory(DisketteExtension->IoBuffer); */ /* INLINED */ + /* MmFreeContiguousMemory(DisketteExtension->IoBuffer); */ /* INLINED + */ } } else { - { -/* ExFreePool(DisketteExtension->IoBuffer); */ /* INLINED */ + { /* ExFreePool(DisketteExtension->IoBuffer); */ /* INLINED */ } } DisketteExtension->IoBuffer = (void *)0; return; - } else { - - } - { - MmProbeAndLockPages(DisketteExtension->IoBufferMdl, 0, 2); + DisketteExtension->IoBufferSize = BufferSize; } - { - } - if (allocateContiguous) { - { -/* MmFreeContiguousMemory(DisketteExtension->IoBuffer); */ /* INLINED */ - } - } else { - { -/* ExFreePool(DisketteExtension->IoBuffer); */ /* INLINED */ - } - } - DisketteExtension->IoBuffer = (void *)0; - return; - DisketteExtension->IoBufferSize = BufferSize; -} } -void FlFreeIoBuffer(PDISKETTE_EXTENSION DisketteExtension ) -{ BOOLEAN contiguousBuffer ; +void FlFreeIoBuffer(PDISKETTE_EXTENSION DisketteExtension) { + BOOLEAN contiguousBuffer; { - if (! DisketteExtension->IoBuffer) { - return; - } else { - - } - if (DisketteExtension->IoBufferSize > DisketteExtension->MaxTransferSize) { - contiguousBuffer = 1; - } else { - contiguousBuffer = 0; - } - { - DisketteExtension->IoBufferSize = 0; -/* MmUnlockPages(DisketteExtension->IoBufferMdl); */ /* INLINED */ -/* IoFreeMdl(DisketteExtension->IoBufferMdl); */ /* INLINED */ - DisketteExtension->IoBufferMdl = (void *)0; - } - if (contiguousBuffer) { - { -/* MmFreeContiguousMemory(DisketteExtension->IoBuffer); */ /* INLINED */ + if (!DisketteExtension->IoBuffer) { + return; + } else { + } + if (DisketteExtension->IoBufferSize > DisketteExtension->MaxTransferSize) { + contiguousBuffer = 1; + } else { + contiguousBuffer = 0; } - } else { { -/* ExFreePool(DisketteExtension->IoBuffer); */ /* INLINED */ + DisketteExtension->IoBufferSize = 0; + /* MmUnlockPages(DisketteExtension->IoBufferMdl); */ /* INLINED */ + /* IoFreeMdl(DisketteExtension->IoBufferMdl); */ /* INLINED */ + DisketteExtension->IoBufferMdl = (void *)0; + } + if (contiguousBuffer) { + { + /* MmFreeContiguousMemory(DisketteExtension->IoBuffer); */ /* INLINED + */ + } + } else { + { /* ExFreePool(DisketteExtension->IoBuffer); */ /* INLINED */ + } } + DisketteExtension->IoBuffer = (void *)0; + return; } - DisketteExtension->IoBuffer = (void *)0; - return; } -} -void FloppyThread(PVOID Context ) -{ PIRP irp ; - PIO_STACK_LOCATION irpSp ; - PLIST_ENTRY request ; - PDISKETTE_EXTENSION disketteExtension ; - NTSTATUS ntStatus ; - NTSTATUS waitStatus ; - LARGE_INTEGER queueWait ; - LARGE_INTEGER acquireWait ; - PKTHREAD tmp ; - PDISK_GEOMETRY outputBuffer ; - PSENSE_DEVISE_STATUS_PTOS outputBuffer___0 ; +void FloppyThread(PVOID Context) { + PIRP irp; + PIO_STACK_LOCATION irpSp; + PLIST_ENTRY request; + PDISKETTE_EXTENSION disketteExtension; + NTSTATUS ntStatus; + NTSTATUS waitStatus; + LARGE_INTEGER queueWait; + LARGE_INTEGER acquireWait; + PKTHREAD tmp; + PDISK_GEOMETRY outputBuffer; + PSENSE_DEVISE_STATUS_PTOS outputBuffer___0; { - { - disketteExtension = Context; - ntStatus = 0L; - tmp = KeGetCurrentThread(); - KeSetPriorityThread(tmp, 16); - queueWait.QuadPart = -30000000; - acquireWait.QuadPart = -150000000; - } - { - while (1) { - while_114_continue: /* CIL Label */ ; { - waitStatus = KeWaitForSingleObject((void *)(& disketteExtension->RequestSemaphore), - 0, 0, 0, & queueWait); + disketteExtension = Context; + ntStatus = 0L; + tmp = KeGetCurrentThread(); + KeSetPriorityThread(tmp, 16); + queueWait.QuadPart = -30000000; + acquireWait.QuadPart = -150000000; } - if (waitStatus == 258L) { - if (! ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1)) { - if (disketteExtension->FloppyControllerAllocated) { - { - } - { - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (775 << 2)) | 3, - (void *)0); - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (769 << 2)) | 3, - disketteExtension->DeviceObject); - disketteExtension->FloppyControllerAllocated = 0; - } - } else { - + { + while (1) { + while_114_continue: /* CIL Label */; + { + waitStatus = KeWaitForSingleObject( + (void *)(&disketteExtension->RequestSemaphore), 0, 0, 0, + &queueWait); } - } else { - - } - { -/* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - } - if (disketteExtension->ThreadReferenceCount == 0L) { - disketteExtension->ThreadReferenceCount = -1; - if ((unsigned int )disketteExtension->FloppyThread != (unsigned int )((void *)0)) { + if (waitStatus == 258L) { + if (!((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1)) { + if (disketteExtension->FloppyControllerAllocated) { + {} { + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (775 << 2)) | 3, (void *)0); + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (769 << 2)) | 3, + disketteExtension->DeviceObject); + disketteExtension->FloppyControllerAllocated = 0; + } + } else { + } + } else { + } { -/* ObfDereferenceObject(disketteExtension->FloppyThread); */ /* INLINED */ - disketteExtension->FloppyThread = (void *)0; + /* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ } - } else { - - } - { -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if (disketteExtension->ReleaseFdcWithMotorRunning) { + if (disketteExtension->ThreadReferenceCount == 0L) { + disketteExtension->ThreadReferenceCount = -1; + if ((unsigned int)disketteExtension->FloppyThread != + (unsigned int)((void *)0)) { + { + /* ObfDereferenceObject(disketteExtension->FloppyThread); */ /* INLINED */ + disketteExtension->FloppyThread = (void *)0; + } + } else { + } + { + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if (disketteExtension->ReleaseFdcWithMotorRunning) { + { + ntStatus = + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (768 << 2)) | 3, &acquireWait); + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (775 << 2)) | 3, (void *)0); + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (769 << 2)) | 3, + disketteExtension->DeviceObject); + disketteExtension->FloppyControllerAllocated = 0; + disketteExtension->ReleaseFdcWithMotorRunning = 0; + } + } else { + } + } else { + } + { + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; + } + if (PagingReferenceCount == 0UL) { + { /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } + } else { + } { - ntStatus = FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (768 << 2)) | 3, - & acquireWait); - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (775 << 2)) | 3, - (void *)0); - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (769 << 2)) | 3, - disketteExtension->DeviceObject); - disketteExtension->FloppyControllerAllocated = 0; - disketteExtension->ReleaseFdcWithMotorRunning = 0; + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + } {} { + PsTerminateSystemThread(0L); } } else { - } - } else { - - } - { -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; - } - if (PagingReferenceCount == 0UL) { { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ } + goto __Cont; } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ - } - { } { - PsTerminateSystemThread(0L); - } - } else { - - } - { -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - } - goto __Cont; - } else { - - } - { - while (1) { - while_117_continue: /* CIL Label */ ; - { - request = (void *)0; /* ExfInterlockedRemoveHeadList(& disketteExtension->ListEntry, & disketteExtension->ListSpinLock); */ /* INLINED */ - } - if (request) { - - } else { - goto while_117_break; - } - { -/* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - disketteExtension->ThreadReferenceCount -= 1L; -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - disketteExtension->HardwareFailed = 0; - irp = (IRP *)((CHAR *)request - (unsigned long )(& ((IRP *)0)->Tail.Overlay.__annonCompField17.ListEntry)); -/* ExAcquireFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ - } - if ((int )disketteExtension->PoweringDown == 1) { - { -/* ExReleaseFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ - } - { - } - { - irp = (IRP *)((CHAR *)request - (unsigned long )(& ((IRP *)0)->Tail.Overlay.__annonCompField17.ListEntry)); - irp->IoStatus.__annonCompField4.Status = -1073741101L; - irp->IoStatus.Information = 0; - IofCompleteRequest(irp, 0); - } - goto while_117_continue; - } else { + while (1) { + while_117_continue: /* CIL Label */; + { + request = (void *)0; + /* ExfInterlockedRemoveHeadList(& disketteExtension->ListEntry, & disketteExtension->ListSpinLock); */ /* INLINED */ + } + if (request) { - } - { -/* ExReleaseFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ - } - { - } - irpSp = irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - { - } - if (irpSp->MajorFunction == 27) { - goto switch_121_27; - } else { - if (irpSp->MajorFunction == 3) { - goto switch_121_3; - } else { - if (irpSp->MajorFunction == 4) { - goto switch_121_4; - } else { - if (irpSp->MajorFunction == 14) { - goto switch_121_14; } else { + goto while_117_break; + } + { + /* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + disketteExtension->ThreadReferenceCount -= 1L; + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + disketteExtension->HardwareFailed = 0; + irp = + (IRP *)((CHAR *)request - + (unsigned long)(&((IRP *)0) + ->Tail.Overlay.__annonCompField17 + .ListEntry)); + /* ExAcquireFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ + } + if ((int)disketteExtension->PoweringDown == 1) { { - goto switch_121_default; - if (0) { - switch_121_27: /* CIL Label */ ; - { - } - if ((int )irpSp->MinorFunction == 1) { - goto _L; - } else { - if ((int )irpSp->MinorFunction == 5) { - _L: /* CIL Label */ - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if (disketteExtension->ReleaseFdcWithMotorRunning) { - { - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (768 << 2)) | 3, - & acquireWait); - disketteExtension->ReleaseFdcWithMotorRunning = 0; - disketteExtension->FloppyControllerAllocated = 1; - } - } else { - - } - } else { - - } - if (disketteExtension->FloppyControllerAllocated) { - { - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (775 << 2)) | 3, - (void *)0); - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (769 << 2)) | 3, - disketteExtension->DeviceObject); - disketteExtension->FloppyControllerAllocated = 0; - } - } else { - - } - { -/* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - disketteExtension->ThreadReferenceCount = -1; -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; - } - if (PagingReferenceCount == 0UL) { - { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ - } - } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ - PsTerminateSystemThread(0L); - } - } else { - ntStatus = -1073741808L; - } - } - goto switch_121_break; - switch_121_3: /* CIL Label */ ; - switch_121_4: /* CIL Label */ ; - if (! disketteExtension->FloppyControllerAllocated) { - { - ntStatus = FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (768 << 2)) | 3, - & acquireWait); - } - if (ntStatus >= 0L) { - disketteExtension->FloppyControllerAllocated = 1; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - disketteExtension->ReleaseFdcWithMotorRunning = 0; - } else { - - } - } else { - goto switch_121_break; - } - } else { - - } - if ((disketteExtension->DeviceObject)->Flags & 2UL) { - if (! ((int )irpSp->Flags & 2)) { - { - } - ntStatus = -2147483626L; - } else { - { - ntStatus = FlReadWrite(disketteExtension, irp, 0); - } - } + /* ExReleaseFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ + } {} { + irp = (IRP *)((CHAR *)request - + (unsigned long)(&((IRP *)0) + ->Tail.Overlay + .__annonCompField17 + .ListEntry)); + irp->IoStatus.__annonCompField4.Status = -1073741101L; + irp->IoStatus.Information = 0; + IofCompleteRequest(irp, 0); + } + goto while_117_continue; + } else { + } + { + /* ExReleaseFastMutex(& disketteExtension->PowerDownMutex); */ /* INLINED */ + } {} + irpSp = irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + {} + if (irpSp->MajorFunction == 27) { + goto switch_121_27; + } else { + if (irpSp->MajorFunction == 3) { + goto switch_121_3; + } else { + if (irpSp->MajorFunction == 4) { + goto switch_121_4; } else { - { - ntStatus = FlReadWrite(disketteExtension, irp, 0); - } - } - goto switch_121_break; - switch_121_14: /* CIL Label */ ; - if (! disketteExtension->FloppyControllerAllocated) { - { - ntStatus = FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (768 << 2)) | 3, - & acquireWait); - } - if (ntStatus >= 0L) { - disketteExtension->FloppyControllerAllocated = 1; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - disketteExtension->ReleaseFdcWithMotorRunning = 0; - } else { - - } + if (irpSp->MajorFunction == 14) { + goto switch_121_14; } else { - goto switch_121_break; - } - } else { - - } - if ((disketteExtension->DeviceObject)->Flags & 2UL) { - if (! ((int )irpSp->Flags & 2)) { { - } - ntStatus = -2147483626L; - } else { - goto _L___2; - } - } else { - _L___2: /* CIL Label */ - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((45 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_125_exp_12; - } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((7 << 16) | (1 << 14)) | (512 << 2))) { - goto switch_125_exp_13; - } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((7 << 16) | (9 << 2))) { - goto switch_125_exp_14; - } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == 7 << 16) { - goto switch_125_exp_15; + goto switch_121_default; + if (0) { + switch_121_27: /* CIL Label */; + {} + if ((int)irpSp->MinorFunction == 1) { + goto _L; + } else { + if ((int)irpSp->MinorFunction == 5) { + _L: /* CIL Label */ + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if (disketteExtension + ->ReleaseFdcWithMotorRunning) { + { + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (768 << 2)) | 3, + &acquireWait); + disketteExtension + ->ReleaseFdcWithMotorRunning = 0; + disketteExtension->FloppyControllerAllocated = + 1; + } + } else { + } + } else { + } + if (disketteExtension->FloppyControllerAllocated) { + { + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (775 << 2)) | 3, + (void *)0); + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (769 << 2)) | 3, + disketteExtension->DeviceObject); + disketteExtension->FloppyControllerAllocated = + 0; + } + } else { + } + { + /* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + disketteExtension->ThreadReferenceCount = -1; + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; + } + if (PagingReferenceCount == 0UL) { + { + /* MmPageEntireDriver(& DriverEntry); */ /* INLINED + */ + } + } else { + } + { + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + PsTerminateSystemThread(0L); + } + } else { + ntStatus = -1073741808L; + } + } + goto switch_121_break; + switch_121_3: /* CIL Label */; + switch_121_4: /* CIL Label */; + if (!disketteExtension->FloppyControllerAllocated) { + { + ntStatus = FlFdcDeviceIo( + disketteExtension->TargetObject, + ((7 << 16) | (768 << 2)) | 3, &acquireWait); + } + if (ntStatus >= 0L) { + disketteExtension->FloppyControllerAllocated = 1; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + disketteExtension->ReleaseFdcWithMotorRunning = 0; + } else { + } + } else { + goto switch_121_break; + } } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((7 << 16) | (3 << 14)) | (11 << 2))) { - goto switch_125_exp_16; + } + if ((disketteExtension->DeviceObject)->Flags & 2UL) { + if (!((int)irpSp->Flags & 2)) { + {} + ntStatus = -2147483626L; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (((7 << 16) | (3 << 14)) | (6 << 2))) { - goto switch_125_exp_17; + { + ntStatus = FlReadWrite(disketteExtension, irp, 0); + } + } + } else { + { ntStatus = FlReadWrite(disketteExtension, irp, 0); } + } + goto switch_121_break; + switch_121_14: /* CIL Label */; + if (!disketteExtension->FloppyControllerAllocated) { + { + ntStatus = FlFdcDeviceIo( + disketteExtension->TargetObject, + ((7 << 16) | (768 << 2)) | 3, &acquireWait); + } + if (ntStatus >= 0L) { + disketteExtension->FloppyControllerAllocated = 1; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + disketteExtension->ReleaseFdcWithMotorRunning = 0; } else { - if (irpSp->Parameters.DeviceIoControl.IoControlCode == ((7 << 16) | (248 << 2))) { - goto switch_125_exp_18; + } + } else { + goto switch_121_break; + } + } else { + } + if ((disketteExtension->DeviceObject)->Flags & 2UL) { + if (!((int)irpSp->Flags & 2)) { + {} + ntStatus = -2147483626L; + } else { + goto _L___2; + } + } else { + _L___2: /* CIL Label */ + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + (((45 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_125_exp_12; + } else { + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == + (((7 << 16) | (1 << 14)) | (512 << 2))) { + goto switch_125_exp_13; + } else { + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == + ((7 << 16) | (9 << 2))) { + goto switch_125_exp_14; } else { - if (0) { - switch_125_exp_12: /* CIL Label */ ; - switch_125_exp_13: /* CIL Label */ ; - { - } - { - ntStatus = FlStartDrive(disketteExtension, irp, - 0, 0, (unsigned char )(! (! ((int )irpSp->Flags & 2)))); - } - goto switch_125_break; - switch_125_exp_14: /* CIL Label */ ; - { - } - if (disketteExtension->IsReadOnly) { - ntStatus = -1073741811L; - } else { - { - ntStatus = FlStartDrive(disketteExtension, irp, - 1, 0, 1); - } - } - goto switch_125_break; - switch_125_exp_15: /* CIL Label */ ; - { - } - if (irpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(DISK_GEOMETRY )) { - ntStatus = -1073741811L; - } else { - { - ntStatus = FlStartDrive(disketteExtension, irp, - 0, 1, (unsigned char )(! (! ((int )irpSp->Flags & 2)))); - } - } - if (ntStatus >= 0L) { - goto _L___0; + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == 7 << 16) { + goto switch_125_exp_15; + } else { + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == + (((7 << 16) | (3 << 14)) | (11 << 2))) { + goto switch_125_exp_16; } else { - if (ntStatus == -1073741804L) { - _L___0: /* CIL Label */ - outputBuffer = (struct _DISK_GEOMETRY *)irp->AssociatedIrp.SystemBuffer; - ntStatus = 0L; - outputBuffer->MediaType = disketteExtension->MediaType; - if ((int )disketteExtension->MediaType == 0) { - { - } - outputBuffer->Cylinders.__annonCompField1.LowPart = 0; - outputBuffer->Cylinders.__annonCompField1.HighPart = 0; - outputBuffer->TracksPerCylinder = 0; - outputBuffer->SectorsPerTrack = 0; - outputBuffer->BytesPerSector = 0; - } else { - { - } - outputBuffer->Cylinders.__annonCompField1.LowPart = (int )disketteExtension->DriveMediaConstants.MaximumTrack + 1; - outputBuffer->Cylinders.__annonCompField1.HighPart = 0; - outputBuffer->TracksPerCylinder = disketteExtension->DriveMediaConstants.NumberOfHeads; - outputBuffer->SectorsPerTrack = disketteExtension->DriveMediaConstants.SectorsPerTrack; - outputBuffer->BytesPerSector = disketteExtension->DriveMediaConstants.BytesPerSector; - } - { - } + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == + (((7 << 16) | (3 << 14)) | (6 << 2))) { + goto switch_125_exp_17; } else { - - } - } - irp->IoStatus.Information = sizeof(DISK_GEOMETRY ); - goto switch_125_break; - switch_125_exp_16: /* CIL Label */ ; - switch_125_exp_17: /* CIL Label */ ; - { - } - { - ntStatus = FlStartDrive(disketteExtension, irp, - 1, 0, 0); - } - if (ntStatus >= 0L) { - goto _L___1; - } else { - if (ntStatus == -1073741804L) { - _L___1: /* CIL Label */ - { - FlAllocateIoBuffer(disketteExtension, 4096); - } - if (disketteExtension->IoBuffer) { - { - ntStatus = FlFormat(disketteExtension, irp); - } + if (irpSp->Parameters.DeviceIoControl + .IoControlCode == + ((7 << 16) | (248 << 2))) { + goto switch_125_exp_18; } else { - ntStatus = -1073741670L; + if (0) { + switch_125_exp_12: /* CIL Label */; + switch_125_exp_13: /* CIL Label */; + {} { + ntStatus = FlStartDrive( + disketteExtension, irp, 0, 0, + (unsigned char)(!( + !((int)irpSp->Flags & 2)))); + } + goto switch_125_break; + switch_125_exp_14: /* CIL Label */; + {} + if (disketteExtension->IsReadOnly) { + ntStatus = -1073741811L; + } else { + { + ntStatus = FlStartDrive( + disketteExtension, irp, 1, 0, + 1); + } + } + goto switch_125_break; + switch_125_exp_15: /* CIL Label */; + {} + if (irpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof(DISK_GEOMETRY)) { + ntStatus = -1073741811L; + } else { + { + ntStatus = FlStartDrive( + disketteExtension, irp, 0, 1, + (unsigned char)(!(!( + (int)irpSp->Flags & 2)))); + } + } + if (ntStatus >= 0L) { + goto _L___0; + } else { + if (ntStatus == -1073741804L) { + _L___0: /* CIL Label */ + outputBuffer = + (struct _DISK_GEOMETRY *) + irp->AssociatedIrp + .SystemBuffer; + ntStatus = 0L; + outputBuffer->MediaType = + disketteExtension->MediaType; + if ((int)disketteExtension + ->MediaType == 0) { + {} + outputBuffer->Cylinders + .__annonCompField1.LowPart = + 0; + outputBuffer->Cylinders + .__annonCompField1 + .HighPart = 0; + outputBuffer + ->TracksPerCylinder = 0; + outputBuffer->SectorsPerTrack = + 0; + outputBuffer->BytesPerSector = + 0; + } else { + {} + outputBuffer->Cylinders + .__annonCompField1.LowPart = + (int)disketteExtension + ->DriveMediaConstants + .MaximumTrack + + 1; + outputBuffer->Cylinders + .__annonCompField1 + .HighPart = 0; + outputBuffer + ->TracksPerCylinder = + disketteExtension + ->DriveMediaConstants + .NumberOfHeads; + outputBuffer->SectorsPerTrack = + disketteExtension + ->DriveMediaConstants + .SectorsPerTrack; + outputBuffer->BytesPerSector = + disketteExtension + ->DriveMediaConstants + .BytesPerSector; + } + {} + } else { + } + } + irp->IoStatus.Information = + sizeof(DISK_GEOMETRY); + goto switch_125_break; + switch_125_exp_16: /* CIL Label */; + switch_125_exp_17: /* CIL Label */; + {} { + ntStatus = + FlStartDrive(disketteExtension, + irp, 1, 0, 0); + } + if (ntStatus >= 0L) { + goto _L___1; + } else { + if (ntStatus == -1073741804L) { + _L___1 : /* CIL Label */ + { + FlAllocateIoBuffer( + disketteExtension, 4096); + } + if (disketteExtension->IoBuffer) { + { + ntStatus = FlFormat( + disketteExtension, irp); + } + } else { + ntStatus = -1073741670L; + } + } else { + } + } + goto switch_125_break; + switch_125_exp_18: /* CIL Label */; + if ((int)((KUSER_SHARED_DATA * + const)4292804608U) + ->AlternativeArchitecture == + 1) { + { + disketteExtension->FifoBuffer[0] = + 14; + disketteExtension->FifoBuffer[1] = + disketteExtension->DeviceUnit; + ntStatus = FlIssueCommand( + disketteExtension, + disketteExtension->FifoBuffer, + disketteExtension->FifoBuffer, + (void *)0, 0, 0); + } + if (ntStatus >= 0L) { + outputBuffer___0 = + (struct + _SENSE_DEVISE_STATUS_PTOS *) + irp->AssociatedIrp + .SystemBuffer; + outputBuffer___0->ST3_PTOS = + Result_Status3_PTOS[0] + .ST3_PTOS; + irp->IoStatus.Information = + sizeof( + SENSE_DEVISE_STATUS_PTOS); + } else { + } + goto switch_125_break; + } else { + } + } else { + switch_125_break: /* CIL Label */; + } } - } else { - } } - goto switch_125_break; - switch_125_exp_18: /* CIL Label */ ; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - disketteExtension->FifoBuffer[0] = 14; - disketteExtension->FifoBuffer[1] = disketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(disketteExtension, disketteExtension->FifoBuffer, - disketteExtension->FifoBuffer, - (void *)0, 0, 0); - } - if (ntStatus >= 0L) { - outputBuffer___0 = (struct _SENSE_DEVISE_STATUS_PTOS *)irp->AssociatedIrp.SystemBuffer; - outputBuffer___0->ST3_PTOS = Result_Status3_PTOS[0].ST3_PTOS; - irp->IoStatus.Information = sizeof(SENSE_DEVISE_STATUS_PTOS ); - } else { - - } - goto switch_125_break; - } else { - - } - } else { - switch_125_break: /* CIL Label */ ; } } } } } + goto switch_121_break; + switch_121_default: /* CIL Label */; + {} + ntStatus = -1073741822L; + } else { + switch_121_break: /* CIL Label */; } } } } - goto switch_121_break; - switch_121_default: /* CIL Label */ ; - { + } + } + if (ntStatus == -2147483631L) { + { + while (1) { + while_134_continue: /* CIL Label */; + { + disketteExtension->HardwareFailed = 0; + irp->IoStatus.__annonCompField4.Status = -2147483631L; + IofCompleteRequest(irp, 1); + request = (void *)0; + /* ExfInterlockedRemoveHeadList(& disketteExtension->ListEntry, & disketteExtension->ListSpinLock); */ /* INLINED */ + } + if (!request) { + goto while_134_break; + } else { + } + { + /* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + disketteExtension->ThreadReferenceCount -= 1L; + /* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ + irp = (IRP *)((CHAR *)request - + (unsigned long)(&((IRP *)0) + ->Tail.Overlay + .__annonCompField17 + .ListEntry)); + } } - ntStatus = -1073741822L; - } else { - switch_121_break: /* CIL Label */ ; + while_134_break: /* CIL Label */; } + } else { + irp->IoStatus.__annonCompField4.Status = ntStatus; + if (disketteExtension->IoBuffer) { + { FlFreeIoBuffer(disketteExtension); } + } else { } + { FlFinishOperation(irp, disketteExtension); } } } + while_117_break: /* CIL Label */; } - } - if (ntStatus == -2147483631L) { - { - while (1) { - while_134_continue: /* CIL Label */ ; - { - disketteExtension->HardwareFailed = 0; - irp->IoStatus.__annonCompField4.Status = -2147483631L; - IofCompleteRequest(irp, 1); - request = (void *)0; /* ExfInterlockedRemoveHeadList(& disketteExtension->ListEntry, & disketteExtension->ListSpinLock); */ /* INLINED */ - } - if (! request) { - goto while_134_break; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if (disketteExtension->FloppyControllerAllocated) { + { + FlFdcDeviceIo(disketteExtension->TargetObject, + ((7 << 16) | (769 << 2)) | 3, + disketteExtension->DeviceObject); + disketteExtension->FloppyControllerAllocated = 0; + disketteExtension->ReleaseFdcWithMotorRunning = 1; + } } else { - - } - { -/* ExAcquireFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - disketteExtension->ThreadReferenceCount -= 1L; -/* ExReleaseFastMutex(& disketteExtension->ThreadReferenceMutex); */ /* INLINED */ - irp = (IRP *)((CHAR *)request - (unsigned long )(& ((IRP *)0)->Tail.Overlay.__annonCompField17.ListEntry)); - } - } - while_134_break: /* CIL Label */ ; - } - } else { - irp->IoStatus.__annonCompField4.Status = ntStatus; - if (disketteExtension->IoBuffer) { - { - FlFreeIoBuffer(disketteExtension); } } else { - - } - { - FlFinishOperation(irp, disketteExtension); } + __Cont: /* CIL Label */; } + while_114_break: /* CIL Label */; } - while_117_break: /* CIL Label */ ; - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if (disketteExtension->FloppyControllerAllocated) { - { - FlFdcDeviceIo(disketteExtension->TargetObject, ((7 << 16) | (769 << 2)) | 3, - disketteExtension->DeviceObject); - disketteExtension->FloppyControllerAllocated = 0; - disketteExtension->ReleaseFdcWithMotorRunning = 1; - } - } else { - - } - } else { - - } - __Cont: /* CIL Label */ ; } - while_114_break: /* CIL Label */ ; - } -} } -void FlConsolidateMediaTypeWithBootSector(PDISKETTE_EXTENSION DisketteExtension , - PBOOT_SECTOR_INFO BootSector ) -{ USHORT bpbNumberOfSectors ; - USHORT bpbNumberOfHeads ; - USHORT bpbSectorsPerTrack ; - USHORT bpbBytesPerSector ; - USHORT bpbMediaByte ; - USHORT bpbMaximumTrack ; - MEDIA_TYPE bpbMediaType ; - ULONG i ; - ULONG n ; - PDRIVE_MEDIA_CONSTANTS readidDriveMediaConstants ; - BOOLEAN changeToBpbMedia ; - int tmp ; - SIZE_T tmp___0 ; +void FlConsolidateMediaTypeWithBootSector(PDISKETTE_EXTENSION DisketteExtension, + PBOOT_SECTOR_INFO BootSector) { + USHORT bpbNumberOfSectors; + USHORT bpbNumberOfHeads; + USHORT bpbSectorsPerTrack; + USHORT bpbBytesPerSector; + USHORT bpbMediaByte; + USHORT bpbMaximumTrack; + MEDIA_TYPE bpbMediaType; + ULONG i; + ULONG n; + PDRIVE_MEDIA_CONSTANTS readidDriveMediaConstants; + BOOLEAN changeToBpbMedia; + int tmp; + SIZE_T tmp___0; { - { - } - if ((int )BootSector->JumpByte[0] != 235) { - if ((int )BootSector->JumpByte[0] != 233) { - return; + {} + if ((int)BootSector->JumpByte[0] != 235) { + if ((int)BootSector->JumpByte[0] != 233) { + return; + } else { + } } else { - } - } else { - - } - bpbNumberOfSectors = (int )BootSector->NumberOfSectors[1] * 256 + (int )BootSector->NumberOfSectors[0]; - bpbNumberOfHeads = (int )BootSector->NumberOfHeads[1] * 256 + (int )BootSector->NumberOfHeads[0]; - bpbSectorsPerTrack = (int )BootSector->SectorsPerTrack[1] * 256 + (int )BootSector->SectorsPerTrack[0]; - bpbBytesPerSector = (int )BootSector->BytesPerSector[1] * 256 + (int )BootSector->BytesPerSector[0]; - bpbMediaByte = BootSector->MediaByte[0]; - if (! bpbNumberOfHeads) { - return; - } else { - if (! bpbSectorsPerTrack) { + bpbNumberOfSectors = (int)BootSector->NumberOfSectors[1] * 256 + + (int)BootSector->NumberOfSectors[0]; + bpbNumberOfHeads = (int)BootSector->NumberOfHeads[1] * 256 + + (int)BootSector->NumberOfHeads[0]; + bpbSectorsPerTrack = (int)BootSector->SectorsPerTrack[1] * 256 + + (int)BootSector->SectorsPerTrack[0]; + bpbBytesPerSector = (int)BootSector->BytesPerSector[1] * 256 + + (int)BootSector->BytesPerSector[0]; + bpbMediaByte = BootSector->MediaByte[0]; + if (!bpbNumberOfHeads) { return; } else { - - } - } - bpbMaximumTrack = ((int )bpbNumberOfSectors / (int )bpbNumberOfHeads) / (int )bpbSectorsPerTrack - 1; - bpbMediaType = 0; - i = 0; - { - while (1) { - while_136_continue: /* CIL Label */ ; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - tmp = 21; - } else { - tmp = 17; + if (!bpbSectorsPerTrack) { + return; + } else { + } } - if (i < (unsigned long )tmp) { + bpbMaximumTrack = ((int)bpbNumberOfSectors / (int)bpbNumberOfHeads) / + (int)bpbSectorsPerTrack - + 1; + bpbMediaType = 0; + i = 0; + { + while (1) { + while_136_continue: /* CIL Label */; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + tmp = 21; + } else { + tmp = 17; + } + if (i < (unsigned long)tmp) { - } else { - goto while_136_break; - } - if ((int )bpbBytesPerSector == (int )(DriveMediaConstants + i)->BytesPerSector) { - if ((int )bpbSectorsPerTrack == (int )(DriveMediaConstants + i)->SectorsPerTrack) { - if ((int )bpbMaximumTrack == (int )(DriveMediaConstants + i)->MaximumTrack) { - if ((int )bpbNumberOfHeads == (int )(DriveMediaConstants + i)->NumberOfHeads) { - if ((int )bpbMediaByte == (int )(DriveMediaConstants + i)->MediaByte) { - bpbMediaType = (DriveMediaConstants + i)->MediaType; - goto while_136_break; + } else { + goto while_136_break; + } + if ((int)bpbBytesPerSector == + (int)(DriveMediaConstants + i)->BytesPerSector) { + if ((int)bpbSectorsPerTrack == + (int)(DriveMediaConstants + i)->SectorsPerTrack) { + if ((int)bpbMaximumTrack == + (int)(DriveMediaConstants + i)->MaximumTrack) { + if ((int)bpbNumberOfHeads == + (int)(DriveMediaConstants + i)->NumberOfHeads) { + if ((int)bpbMediaByte == + (int)(DriveMediaConstants + i)->MediaByte) { + bpbMediaType = (DriveMediaConstants + i)->MediaType; + goto while_136_break; + } else { + } + } else { + } } else { - } } else { - } } else { - } - } else { - + i += 1UL; } - } else { - + while_136_break: /* CIL Label */; } - i += 1UL; - } - while_136_break: /* CIL Label */ ; - } - if ((int )DisketteExtension->DriveType == 3) { - if (bpbMediaType == 15) { - goto switch_137_15; - } else { - if (bpbMediaType == 16) { - goto switch_137_16; + if ((int)DisketteExtension->DriveType == 3) { + if (bpbMediaType == 15) { + goto switch_137_15; } else { - if (bpbMediaType == 1) { - goto switch_137_1; + if (bpbMediaType == 16) { + goto switch_137_16; } else { - if (bpbMediaType == 19) { - goto switch_137_19; + if (bpbMediaType == 1) { + goto switch_137_1; } else { - { - goto switch_137_default; - if (0) { - switch_137_15: /* CIL Label */ - bpbMediaType = 14; - goto switch_137_break; - switch_137_16: /* CIL Label */ - bpbMediaType = 5; - goto switch_137_break; - switch_137_1: /* CIL Label */ - bpbMediaType = 17; - goto switch_137_break; - switch_137_19: /* CIL Label */ - bpbMediaType = 18; - goto switch_137_break; - switch_137_default: /* CIL Label */ ; - goto switch_137_break; + if (bpbMediaType == 19) { + goto switch_137_19; } else { - switch_137_break: /* CIL Label */ ; - } + { + goto switch_137_default; + if (0) { + switch_137_15: /* CIL Label */ + bpbMediaType = 14; + goto switch_137_break; + switch_137_16: /* CIL Label */ + bpbMediaType = 5; + goto switch_137_break; + switch_137_1: /* CIL Label */ + bpbMediaType = 17; + goto switch_137_break; + switch_137_19: /* CIL Label */ + bpbMediaType = 18; + goto switch_137_break; + switch_137_default: /* CIL Label */; + goto switch_137_break; + } else { + switch_137_break: /* CIL Label */; + } + } } } } } + } else { } - } else { - - } - { - } - { - } - if ((int )bpbMediaType == (int )DisketteExtension->MediaType) { - changeToBpbMedia = 0; - { - } - } else { - readidDriveMediaConstants = & DisketteExtension->DriveMediaConstants; - if ((int )bpbBytesPerSector == (int )readidDriveMediaConstants->BytesPerSector) { - if ((int )bpbSectorsPerTrack < 256) { - if ((int )bpbMaximumTrack == (int )readidDriveMediaConstants->MaximumTrack) { - if ((int )bpbNumberOfHeads <= (int )readidDriveMediaConstants->NumberOfHeads) { - changeToBpbMedia = 1; + {} {} + if ((int)bpbMediaType == (int)DisketteExtension->MediaType) { + changeToBpbMedia = 0; + {} + } else { + readidDriveMediaConstants = &DisketteExtension->DriveMediaConstants; + if ((int)bpbBytesPerSector == + (int)readidDriveMediaConstants->BytesPerSector) { + if ((int)bpbSectorsPerTrack < 256) { + if ((int)bpbMaximumTrack == + (int)readidDriveMediaConstants->MaximumTrack) { + if ((int)bpbNumberOfHeads <= + (int)readidDriveMediaConstants->NumberOfHeads) { + changeToBpbMedia = 1; + } else { + changeToBpbMedia = 0; + } } else { changeToBpbMedia = 0; } @@ -5554,960 +5623,989 @@ void FlConsolidateMediaTypeWithBootSector(PDISKETTE_EXTENSION DisketteExtension } else { changeToBpbMedia = 0; } - } else { - changeToBpbMedia = 0; - } - { - } - if ((int )bpbMediaType == 0) { - bpbMediaType = readidDriveMediaConstants->MediaType; - DisketteExtension->DriveMediaConstants.SkewDelta = 0; - } else { - + {} + if ((int)bpbMediaType == 0) { + bpbMediaType = readidDriveMediaConstants->MediaType; + DisketteExtension->DriveMediaConstants.SkewDelta = 0; + } else { + } } - } - if (changeToBpbMedia) { - i = (DriveMediaLimits + DisketteExtension->DriveType)->LowestDriveMediaType; - n = (DriveMediaLimits + DisketteExtension->DriveType)->HighestDriveMediaType; - { - while (1) { - while_142_continue: /* CIL Label */ ; - if (i <= n) { + if (changeToBpbMedia) { + i = (DriveMediaLimits + DisketteExtension->DriveType) + ->LowestDriveMediaType; + n = (DriveMediaLimits + DisketteExtension->DriveType) + ->HighestDriveMediaType; + { + while (1) { + while_142_continue: /* CIL Label */; + if (i <= n) { - } else { - goto while_142_break; + } else { + goto while_142_break; + } + if ((int)bpbMediaType == (int)(DriveMediaConstants + i)->MediaType) { + DisketteExtension->DriveMediaType = i; + goto while_142_break; + } else { + } + i += 1UL; + } + while_142_break: /* CIL Label */; } - if ((int )bpbMediaType == (int )(DriveMediaConstants + i)->MediaType) { - DisketteExtension->DriveMediaType = i; - goto while_142_break; + { + DisketteExtension->MediaType = bpbMediaType; + DisketteExtension->ByteCapacity = + (int)bpbNumberOfSectors * (int)bpbBytesPerSector; + DisketteExtension->DriveMediaConstants.SectorsPerTrack = + (unsigned char)bpbSectorsPerTrack; + DisketteExtension->DriveMediaConstants.NumberOfHeads = + (unsigned char)bpbNumberOfHeads; + tmp___0 = RtlCompareMemory(BootSector->OemData, "MSDMF3.", 7); + } + if (tmp___0 == 7UL) { + DisketteExtension->IsReadOnly = 1; } else { - } - i += 1UL; - } - while_142_break: /* CIL Label */ ; - } - { - DisketteExtension->MediaType = bpbMediaType; - DisketteExtension->ByteCapacity = (int )bpbNumberOfSectors * (int )bpbBytesPerSector; - DisketteExtension->DriveMediaConstants.SectorsPerTrack = (unsigned char )bpbSectorsPerTrack; - DisketteExtension->DriveMediaConstants.NumberOfHeads = (unsigned char )bpbNumberOfHeads; - tmp___0 = RtlCompareMemory(BootSector->OemData, "MSDMF3.", 7); - } - if (tmp___0 == 7UL) { - DisketteExtension->IsReadOnly = 1; } else { - } - } else { - + return; } - return; -} } -void FlCheckBootSector(PDISKETTE_EXTENSION DisketteExtension ) -{ PBOOT_SECTOR_INFO bootSector ; - LARGE_INTEGER offset ; - PIRP irp ; - NTSTATUS status ; - int tmp ; - PVOID tmp___0 ; - int tmp___1 ; - - { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - tmp = 1024; - } else { - tmp = 512; - } - { - tmp___0 = ExAllocatePoolWithTag(4, tmp, 1886350406UL); - bootSector = tmp___0; - } - if (! bootSector) { - return; - } else { +void FlCheckBootSector(PDISKETTE_EXTENSION DisketteExtension) { + PBOOT_SECTOR_INFO bootSector; + LARGE_INTEGER offset; + PIRP irp; + NTSTATUS status; + int tmp; + PVOID tmp___0; + int tmp___1; - } - offset.__annonCompField1.HighPart = 0; - offset.__annonCompField1.LowPart = offset.__annonCompField1.HighPart; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - tmp___1 = 1024; - } else { - tmp___1 = 512; - } { - irp = IoBuildAsynchronousFsdRequest(3, DisketteExtension->DeviceObject, bootSector, - tmp___1, & offset, (void *)0); - } - if (! irp) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + tmp = 1024; + } else { + tmp = 512; + } { -/* ExFreePool(bootSector); */ /* INLINED */ + tmp___0 = ExAllocatePoolWithTag(4, tmp, 1886350406UL); + bootSector = tmp___0; } - return; - } else { - - } - { - irp->CurrentLocation = (CHAR )((int )irp->CurrentLocation - 1); - irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation -= 1; - status = FlReadWrite(DisketteExtension, irp, 1); -/* MmUnlockPages(irp->MdlAddress); */ /* INLINED */ -/* IoFreeMdl(irp->MdlAddress); */ /* INLINED */ -/* IoFreeIrp(irp); */ /* INLINED */ -/* ExFreePool(bootSector); */ /* INLINED */ - } - return; -} -} -NTSTATUS FlReadWriteTrack(PDISKETTE_EXTENSION DisketteExtension , PMDL IoMdl , ULONG IoOffset , - BOOLEAN WriteOperation , UCHAR Cylinder , UCHAR Head , UCHAR Sector , - UCHAR NumberOfSectors , BOOLEAN NeedSeek ) -{ PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - ULONG byteToSectorShift ; - ULONG transferBytes ; - LARGE_INTEGER headSettleTime ; - NTSTATUS status ; - ULONG seekRetry ; - ULONG ioRetry ; - BOOLEAN recalibrateDrive ; - UCHAR i ; - - { - recalibrateDrive = 0; - { - } - driveMediaConstants = & DisketteExtension->DriveMediaConstants; - byteToSectorShift = 7 + (int )driveMediaConstants->SectorLengthCode; - transferBytes = (unsigned long )NumberOfSectors << byteToSectorShift; - headSettleTime.__annonCompField1.LowPart = - (10000 * (int )driveMediaConstants->HeadSettleTime); - headSettleTime.__annonCompField1.HighPart = -1; - seekRetry = 0; - ioRetry = 0; - { - while (1) { - while_144_continue: /* CIL Label */ ; - if (seekRetry < 3UL) { - + if (!bootSector) { + return; } else { - goto while_144_break; } - if (recalibrateDrive) { - { - } - { - FlRecalibrateDrive(DisketteExtension); - } + offset.__annonCompField1.HighPart = 0; + offset.__annonCompField1.LowPart = offset.__annonCompField1.HighPart; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + tmp___1 = 1024; } else { - + tmp___1 = 512; } - if (recalibrateDrive) { - goto _L___0; + { + irp = IoBuildAsynchronousFsdRequest(3, DisketteExtension->DeviceObject, + bootSector, tmp___1, &offset, + (void *)0); + } + if (!irp) { + { /* ExFreePool(bootSector); */ /* INLINED */ + } + return; } else { - if (NeedSeek) { - if (! DisketteExtension->ControllerConfigurable) { + } + { + irp->CurrentLocation = (CHAR)((int)irp->CurrentLocation - 1); + irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation -= 1; + status = FlReadWrite(DisketteExtension, irp, 1); + /* MmUnlockPages(irp->MdlAddress); */ /* INLINED */ + /* IoFreeMdl(irp->MdlAddress); */ /* INLINED */ + /* IoFreeIrp(irp); */ /* INLINED */ + /* ExFreePool(bootSector); */ /* INLINED */ + } + return; + } +} +NTSTATUS FlReadWriteTrack(PDISKETTE_EXTENSION DisketteExtension, PMDL IoMdl, + ULONG IoOffset, BOOLEAN WriteOperation, + UCHAR Cylinder, UCHAR Head, UCHAR Sector, + UCHAR NumberOfSectors, BOOLEAN NeedSeek) { + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + ULONG byteToSectorShift; + ULONG transferBytes; + LARGE_INTEGER headSettleTime; + NTSTATUS status; + ULONG seekRetry; + ULONG ioRetry; + BOOLEAN recalibrateDrive; + UCHAR i; + + { + recalibrateDrive = 0; + {} + driveMediaConstants = &DisketteExtension->DriveMediaConstants; + byteToSectorShift = 7 + (int)driveMediaConstants->SectorLengthCode; + transferBytes = (unsigned long)NumberOfSectors << byteToSectorShift; + headSettleTime.__annonCompField1.LowPart = + -(10000 * (int)driveMediaConstants->HeadSettleTime); + headSettleTime.__annonCompField1.HighPart = -1; + seekRetry = 0; + ioRetry = 0; + { + while (1) { + while_144_continue: /* CIL Label */; + if (seekRetry < 3UL) { + + } else { + goto while_144_break; + } + if (recalibrateDrive) { + {} { FlRecalibrateDrive(DisketteExtension); } + } else { + } + if (recalibrateDrive) { goto _L___0; } else { - if ((int )driveMediaConstants->CylinderShift != 0) { - _L___0: /* CIL Label */ - { - DisketteExtension->FifoBuffer[0] = 16; - DisketteExtension->FifoBuffer[1] = ((int )Head << 2) | (int )DisketteExtension->DeviceUnit; - DisketteExtension->FifoBuffer[2] = (int )Cylinder << (int )driveMediaConstants->CylinderShift; - status = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); - } - if (status >= 0L) { - if (! ((int )DisketteExtension->FifoBuffer[0] & 32)) { - DisketteExtension->HardwareFailed = 1; - status = -1073741464L; - } else { - if ((int )DisketteExtension->FifoBuffer[1] != (int )Cylinder << (int )driveMediaConstants->CylinderShift) { - DisketteExtension->HardwareFailed = 1; - status = -1073741464L; - } else { - - } + if (NeedSeek) { + if (!DisketteExtension->ControllerConfigurable) { + goto _L___0; + } else { + if ((int)driveMediaConstants->CylinderShift != 0) { + _L___0 : /* CIL Label */ + { + DisketteExtension->FifoBuffer[0] = 16; + DisketteExtension->FifoBuffer[1] = + ((int)Head << 2) | (int)DisketteExtension->DeviceUnit; + DisketteExtension->FifoBuffer[2] = + (int)Cylinder << (int)driveMediaConstants->CylinderShift; + status = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - if (status >= 0L) { - { - KeDelayExecutionThread(0, 0, & headSettleTime); - DisketteExtension->FifoBuffer[0] = 84; - DisketteExtension->FifoBuffer[1] = ((int )Head << 2) | (int )DisketteExtension->DeviceUnit; - status = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, - 0, 0); - } if (status >= 0L) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if ((int )DisketteExtension->FifoBuffer[0] & 8) { - return (-1073741661L); + if (!((int)DisketteExtension->FifoBuffer[0] & 32)) { + DisketteExtension->HardwareFailed = 1; + status = -1073741464L; + } else { + if ((int)DisketteExtension->FifoBuffer[1] != + (int)Cylinder + << (int)driveMediaConstants->CylinderShift) { + DisketteExtension->HardwareFailed = 1; + status = -1073741464L; } else { - } - } else { - } - if ((int )DisketteExtension->FifoBuffer[0] != (((int )Head << 2) | (int )DisketteExtension->DeviceUnit)) { + if (status >= 0L) { { - DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], DisketteExtension->FifoBuffer[2]); + KeDelayExecutionThread(0, 0, &headSettleTime); + DisketteExtension->FifoBuffer[0] = 84; + DisketteExtension->FifoBuffer[1] = + ((int)Head << 2) | (int)DisketteExtension->DeviceUnit; + status = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - } else { - if ((int )DisketteExtension->FifoBuffer[1] != 0) { - { - DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], - DisketteExtension->FifoBuffer[2]); + if (status >= 0L) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if ((int)DisketteExtension->FifoBuffer[0] & 8) { + return (-1073741661L); + } else { + } + } else { } - } else { - if ((int )DisketteExtension->FifoBuffer[2] != 0) { + if ((int)DisketteExtension->FifoBuffer[0] != + (((int)Head << 2) | + (int)DisketteExtension->DeviceUnit)) { { - DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], - DisketteExtension->FifoBuffer[2]); + DisketteExtension->HardwareFailed = 1; + status = FlInterpretError( + DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); } } else { - if ((int )DisketteExtension->FifoBuffer[3] != (int )Cylinder) { + if ((int)DisketteExtension->FifoBuffer[1] != 0) { { - DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], - DisketteExtension->FifoBuffer[2]); + DisketteExtension->HardwareFailed = 1; + status = FlInterpretError( + DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); } } else { - + if ((int)DisketteExtension->FifoBuffer[2] != 0) { + { + DisketteExtension->HardwareFailed = 1; + status = FlInterpretError( + DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + if ((int)DisketteExtension->FifoBuffer[3] != + (int)Cylinder) { + { + DisketteExtension->HardwareFailed = 1; + status = FlInterpretError( + DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + } + } } } + } else { + {} + } + } else { + } + } else { + {} + } + } else { + status = 0L; + } + } + } else { + status = 0L; + } + } + if (!(status >= 0L)) { + {} + recalibrateDrive = 1; + goto __Cont; + } else { + } + { + while (1) { + while_149_continue: /* CIL Label */; + DisketteExtension->FifoBuffer[1] = + ((int)Head << 2) | (int)DisketteExtension->DeviceUnit; + DisketteExtension->FifoBuffer[2] = Cylinder; + DisketteExtension->FifoBuffer[3] = Head; + DisketteExtension->FifoBuffer[4] = (int)Sector + 1; + DisketteExtension->FifoBuffer[5] = + driveMediaConstants->SectorLengthCode; + DisketteExtension->FifoBuffer[6] = + (int)Sector + (int)NumberOfSectors; + DisketteExtension->FifoBuffer[7] = + driveMediaConstants->ReadWriteGapLength; + DisketteExtension->FifoBuffer[8] = driveMediaConstants->DataLength; + if (WriteOperation) { + DisketteExtension->FifoBuffer[0] = 66; + } else { + DisketteExtension->FifoBuffer[0] = 64; + } + { + status = FlIssueCommand(DisketteExtension, + DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, IoMdl, + IoOffset, transferBytes); + } + if (status >= 0L) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if ((int)DisketteExtension->FifoBuffer[0] & 8) { + return (-1073741661L); + } else { + } + } else { + } + if (((int)DisketteExtension->FifoBuffer[0] & 192) != 0) { + if (((int)DisketteExtension->FifoBuffer[0] & 192) != 64) { + { + DisketteExtension->HardwareFailed = 1; + status = FlInterpretError(DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + if ((int)DisketteExtension->FifoBuffer[1] != 128) { + { + DisketteExtension->HardwareFailed = 1; + status = + FlInterpretError(DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + if ((int)DisketteExtension->FifoBuffer[2] != 0) { + { + DisketteExtension->HardwareFailed = 1; + status = + FlInterpretError(DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + goto _L___1; } } - } else { - { - } } } else { - + _L___1: /* CIL Label */ + if ((int)DisketteExtension->FifoBuffer[5] != 1) { + DisketteExtension->HardwareFailed = 1; + status = -1073741465L; + } else { + } } } else { - { - } + {} } - } else { - status = 0L; + if (status >= 0L) { + goto while_149_break; + } else { + } + if (ioRetry >= 2UL) { + {} + goto while_149_break; + } else { + } + ioRetry += 1UL; } + while_149_break: /* CIL Label */; } - } else { - status = 0L; - } - } - if (! (status >= 0L)) { - { + if (status >= 0L) { + goto while_144_break; + } else { + } + recalibrateDrive = 1; + __Cont: /* CIL Label */ + seekRetry += 1UL; } - recalibrateDrive = 1; - goto __Cont; - } else { - + while_144_break: /* CIL Label */; } - { - while (1) { - while_149_continue: /* CIL Label */ ; - DisketteExtension->FifoBuffer[1] = ((int )Head << 2) | (int )DisketteExtension->DeviceUnit; - DisketteExtension->FifoBuffer[2] = Cylinder; - DisketteExtension->FifoBuffer[3] = Head; - DisketteExtension->FifoBuffer[4] = (int )Sector + 1; - DisketteExtension->FifoBuffer[5] = driveMediaConstants->SectorLengthCode; - DisketteExtension->FifoBuffer[6] = (int )Sector + (int )NumberOfSectors; - DisketteExtension->FifoBuffer[7] = driveMediaConstants->ReadWriteGapLength; - DisketteExtension->FifoBuffer[8] = driveMediaConstants->DataLength; - if (WriteOperation) { - DisketteExtension->FifoBuffer[0] = 66; - } else { - DisketteExtension->FifoBuffer[0] = 64; - } - { - status = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, DisketteExtension->FifoBuffer, - IoMdl, IoOffset, transferBytes); - } - if (status >= 0L) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if ((int )DisketteExtension->FifoBuffer[0] & 8) { - return (-1073741661L); - } else { - - } - } else { + if (!(status >= 0L)) { + if ((int)NumberOfSectors > 1) { + {} + i = 0; + { + while (1) { + while_153_continue: /* CIL Label */; + if ((int)i < (int)NumberOfSectors) { - } - if (((int )DisketteExtension->FifoBuffer[0] & 192) != 0) { - if (((int )DisketteExtension->FifoBuffer[0] & 192) != 64) { + } else { + goto while_153_break; + } { - DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], DisketteExtension->FifoBuffer[2]); + status = FlReadWriteTrack( + DisketteExtension, IoMdl, + IoOffset + ((unsigned long)i << byteToSectorShift), + WriteOperation, Cylinder, Head, + (unsigned char)((int)Sector + (int)i), 1, 0); } - } else { - if ((int )DisketteExtension->FifoBuffer[1] != 128) { - { + if (!(status >= 0L)) { + {} DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], DisketteExtension->FifoBuffer[2]); - } + goto while_153_break; } else { - if ((int )DisketteExtension->FifoBuffer[2] != 0) { - { - DisketteExtension->HardwareFailed = 1; - status = FlInterpretError(DisketteExtension->FifoBuffer[1], DisketteExtension->FifoBuffer[2]); - } - } else { - goto _L___1; - } } + i = (UCHAR)((int)i + 1); } - } else { - _L___1: /* CIL Label */ - if ((int )DisketteExtension->FifoBuffer[5] != 1) { - DisketteExtension->HardwareFailed = 1; - status = -1073741465L; - } else { - - } - } - } else { - { - } - } - if (status >= 0L) { - goto while_149_break; - } else { - - } - if (ioRetry >= 2UL) { - { + while_153_break: /* CIL Label */; } - goto while_149_break; } else { - } - ioRetry += 1UL; - } - while_149_break: /* CIL Label */ ; - } - if (status >= 0L) { - goto while_144_break; } else { - } - recalibrateDrive = 1; - __Cont: /* CIL Label */ - seekRetry += 1UL; - } - while_144_break: /* CIL Label */ ; + return (status); } - if (! (status >= 0L)) { - if ((int )NumberOfSectors > 1) { - { - } - i = 0; - { - while (1) { - while_153_continue: /* CIL Label */ ; - if ((int )i < (int )NumberOfSectors) { - - } else { - goto while_153_break; - } - { - status = FlReadWriteTrack(DisketteExtension, IoMdl, IoOffset + ((unsigned long )i << byteToSectorShift), - WriteOperation, Cylinder, Head, (unsigned char )((int )Sector + (int )i), - 1, 0); - } - if (! (status >= 0L)) { - { - } - DisketteExtension->HardwareFailed = 1; - goto while_153_break; - } else { - - } - i = (UCHAR )((int )i + 1); - } - while_153_break: /* CIL Label */ ; +} +NTSTATUS FlReadWrite(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp, + BOOLEAN DriveStarted) { + PIO_STACK_LOCATION irpSp; + BOOLEAN writeOperation; + NTSTATUS status; + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + ULONG byteToSectorShift; + ULONG currentSector; + ULONG firstSector; + ULONG lastSector; + ULONG trackSize; + UCHAR sectorsPerTrack; + UCHAR numberOfHeads; + UCHAR currentHead; + UCHAR currentCylinder; + UCHAR trackSector; + PCHAR userBuffer; + UCHAR skew; + UCHAR skewDelta; + UCHAR numTransferSectors; + PMDL mdl; + PCHAR ioBuffer; + ULONG ioOffset; + PVOID tmp___0; + + { + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + {} + if ((int)irpSp->MajorFunction == 4) { + if (DisketteExtension->IsReadOnly) { + {} + return (-1073741811L); + } else { } + writeOperation = 1; } else { - + writeOperation = 0; } - } else { - - } - return (status); -} -} -NTSTATUS FlReadWrite(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp , BOOLEAN DriveStarted ) -{ PIO_STACK_LOCATION irpSp ; - BOOLEAN writeOperation ; - NTSTATUS status ; - PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - ULONG byteToSectorShift ; - ULONG currentSector ; - ULONG firstSector ; - ULONG lastSector ; - ULONG trackSize ; - UCHAR sectorsPerTrack ; - UCHAR numberOfHeads ; - UCHAR currentHead ; - UCHAR currentCylinder ; - UCHAR trackSector ; - PCHAR userBuffer ; - UCHAR skew ; - UCHAR skewDelta ; - UCHAR numTransferSectors ; - PMDL mdl ; - PCHAR ioBuffer ; - ULONG ioOffset ; - PVOID tmp___0 ; - - { - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - { - } - if ((int )irpSp->MajorFunction == 4) { - if (DisketteExtension->IsReadOnly) { + {} + if (DriveStarted) { + status = 0L; + } else { { + status = FlStartDrive(DisketteExtension, Irp, writeOperation, 1, + (unsigned char)(!(!((int)irpSp->Flags & 2)))); } - return (-1073741811L); - } else { - - } - writeOperation = 1; - } else { - writeOperation = 0; - } - { - } - if (DriveStarted) { - status = 0L; - } else { - { - status = FlStartDrive(DisketteExtension, Irp, writeOperation, 1, (unsigned char )(! (! ((int )irpSp->Flags & 2)))); - } - } - if (! (status >= 0L)) { - { - } - return (status); - } else { - - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - FlHdbit(DisketteExtension); - } - } else { - - } - if ((int )DisketteExtension->MediaType == 0) { - { - } - return (-1073741804L); - } else { - - } - driveMediaConstants = & DisketteExtension->DriveMediaConstants; - byteToSectorShift = 7 + (int )driveMediaConstants->SectorLengthCode; - firstSector = irpSp->Parameters.Read.ByteOffset.__annonCompField1.LowPart >> byteToSectorShift; - lastSector = firstSector + (irpSp->Parameters.Read.Length >> byteToSectorShift); - sectorsPerTrack = driveMediaConstants->SectorsPerTrack; - numberOfHeads = driveMediaConstants->NumberOfHeads; - if ((int )(Irp->MdlAddress)->MdlFlags & 5) { - userBuffer = (Irp->MdlAddress)->MappedSystemVa; - } else { - { - tmp___0 = (void *)0; /* MmMapLockedPagesSpecifyCache(Irp->MdlAddress, 0, 1, (void *)0, 0, 32); */ /* INLINED */ - userBuffer = tmp___0; - } - } - if ((unsigned int )userBuffer == (unsigned int )((void *)0)) { - { } - return (-1073741670L); - } else { - - } - trackSize = (unsigned long )sectorsPerTrack << byteToSectorShift; - skew = 0; - skewDelta = driveMediaConstants->SkewDelta; - currentSector = firstSector; - { - while (1) { - while_161_continue: /* CIL Label */ ; - if (currentSector < lastSector) { - + if (!(status >= 0L)) { + {} + return (status); } else { - goto while_161_break; - } - currentCylinder = (unsigned char )((currentSector / (ULONG )sectorsPerTrack) / (ULONG )numberOfHeads); - trackSector = (unsigned char )(currentSector % (unsigned long )sectorsPerTrack); - currentHead = (unsigned char )((currentSector / (ULONG )sectorsPerTrack) % (unsigned long )numberOfHeads); - numTransferSectors = (int )sectorsPerTrack - (int )trackSector; - if (lastSector - currentSector < (ULONG )numTransferSectors) { - numTransferSectors = (unsigned char )(lastSector - currentSector); + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { FlHdbit(DisketteExtension); } } else { - } - if (trackSize > DisketteExtension->MaxTransferSize) { - { - } - { - FlAllocateIoBuffer(DisketteExtension, trackSize); - } - if (! DisketteExtension->IoBuffer) { - { - } - return (-1073741670L); - } else { - - } - mdl = DisketteExtension->IoBufferMdl; - ioBuffer = DisketteExtension->IoBuffer; - ioOffset = 0; - if (writeOperation) { - { - memmove(ioBuffer, userBuffer + ((currentSector - firstSector) << byteToSectorShift), - (unsigned long )numTransferSectors << byteToSectorShift); - } - } else { - - } + if ((int)DisketteExtension->MediaType == 0) { + {} + return (-1073741804L); } else { - mdl = Irp->MdlAddress; - ioOffset = (currentSector - firstSector) << byteToSectorShift; } - if ((int )skew >= (int )numTransferSectors + (int )trackSector) { - skew = 0; + driveMediaConstants = &DisketteExtension->DriveMediaConstants; + byteToSectorShift = 7 + (int)driveMediaConstants->SectorLengthCode; + firstSector = irpSp->Parameters.Read.ByteOffset.__annonCompField1.LowPart >> + byteToSectorShift; + lastSector = + firstSector + (irpSp->Parameters.Read.Length >> byteToSectorShift); + sectorsPerTrack = driveMediaConstants->SectorsPerTrack; + numberOfHeads = driveMediaConstants->NumberOfHeads; + if ((int)(Irp->MdlAddress)->MdlFlags & 5) { + userBuffer = (Irp->MdlAddress)->MappedSystemVa; } else { - + { + tmp___0 = (void *)0; + /* MmMapLockedPagesSpecifyCache(Irp->MdlAddress, 0, 1, (void *)0, 0, 32); */ /* INLINED */ + userBuffer = tmp___0; + } } - if ((int )skew < (int )trackSector) { - skew = trackSector; + if ((unsigned int)userBuffer == (unsigned int)((void *)0)) { + {} + return (-1073741670L); } else { - } + trackSize = (unsigned long)sectorsPerTrack << byteToSectorShift; + skew = 0; + skewDelta = driveMediaConstants->SkewDelta; + currentSector = firstSector; { - status = FlReadWriteTrack(DisketteExtension, mdl, ioOffset + (((unsigned long )skew - (unsigned long )trackSector) << byteToSectorShift), - writeOperation, currentCylinder, currentHead, skew, - (unsigned char )(((int )numTransferSectors + (int )trackSector) - (int )skew), - 1); - } - if (status >= 0L) { - if ((int )skew > (int )trackSector) { + while (1) { + while_161_continue: /* CIL Label */; + if (currentSector < lastSector) { + + } else { + goto while_161_break; + } + currentCylinder = + (unsigned char)((currentSector / (ULONG)sectorsPerTrack) / + (ULONG)numberOfHeads); + trackSector = + (unsigned char)(currentSector % (unsigned long)sectorsPerTrack); + currentHead = (unsigned char)((currentSector / (ULONG)sectorsPerTrack) % + (unsigned long)numberOfHeads); + numTransferSectors = (int)sectorsPerTrack - (int)trackSector; + if (lastSector - currentSector < (ULONG)numTransferSectors) { + numTransferSectors = (unsigned char)(lastSector - currentSector); + } else { + } + if (trackSize > DisketteExtension->MaxTransferSize) { + {} { FlAllocateIoBuffer(DisketteExtension, trackSize); } + if (!DisketteExtension->IoBuffer) { + {} + return (-1073741670L); + } else { + } + mdl = DisketteExtension->IoBufferMdl; + ioBuffer = DisketteExtension->IoBuffer; + ioOffset = 0; + if (writeOperation) { + { + memmove(ioBuffer, + userBuffer + + ((currentSector - firstSector) << byteToSectorShift), + (unsigned long)numTransferSectors << byteToSectorShift); + } + } else { + } + } else { + mdl = Irp->MdlAddress; + ioOffset = (currentSector - firstSector) << byteToSectorShift; + } + if ((int)skew >= (int)numTransferSectors + (int)trackSector) { + skew = 0; + } else { + } + if ((int)skew < (int)trackSector) { + skew = trackSector; + } else { + } { - status = FlReadWriteTrack(DisketteExtension, mdl, ioOffset, writeOperation, - currentCylinder, currentHead, trackSector, (unsigned char )((int )skew - (int )trackSector), - 0); + status = FlReadWriteTrack( + DisketteExtension, mdl, + ioOffset + (((unsigned long)skew - (unsigned long)trackSector) + << byteToSectorShift), + writeOperation, currentCylinder, currentHead, skew, + (unsigned char)(((int)numTransferSectors + (int)trackSector) - + (int)skew), + 1); } - } else { - skew = ((int )numTransferSectors + (int )trackSector) % (int )sectorsPerTrack; + if (status >= 0L) { + if ((int)skew > (int)trackSector) { + { + status = FlReadWriteTrack( + DisketteExtension, mdl, ioOffset, writeOperation, + currentCylinder, currentHead, trackSector, + (unsigned char)((int)skew - (int)trackSector), 0); + } + } else { + skew = ((int)numTransferSectors + (int)trackSector) % + (int)sectorsPerTrack; + } + } else { + skew = ((int)numTransferSectors + (int)trackSector) % + (int)sectorsPerTrack; + } + if (!(status >= 0L)) { + goto while_161_break; + } else { + } + if (!writeOperation) { + if (trackSize > DisketteExtension->MaxTransferSize) { + { + memmove(userBuffer + + ((currentSector - firstSector) << byteToSectorShift), + ioBuffer, + (unsigned long)numTransferSectors << byteToSectorShift); + } + } else { + } + } else { + } + skew = ((int)skew + (int)skewDelta) % (int)sectorsPerTrack; + currentSector += (ULONG)numTransferSectors; } - } else { - skew = ((int )numTransferSectors + (int )trackSector) % (int )sectorsPerTrack; - } - if (! (status >= 0L)) { - goto while_161_break; - } else { - + while_161_break: /* CIL Label */; } - if (! writeOperation) { - if (trackSize > DisketteExtension->MaxTransferSize) { + Irp->IoStatus.Information = (currentSector - firstSector) + << byteToSectorShift; + if (status >= 0L) { + if (firstSector == 0UL) { { - memmove(userBuffer + ((currentSector - firstSector) << byteToSectorShift), - ioBuffer, (unsigned long )numTransferSectors << byteToSectorShift); + FlConsolidateMediaTypeWithBootSector( + DisketteExtension, (struct _BOOT_SECTOR_INFO *)userBuffer); } } else { - - } - } else { - - } - skew = ((int )skew + (int )skewDelta) % (int )sectorsPerTrack; - currentSector += (ULONG )numTransferSectors; - } - while_161_break: /* CIL Label */ ; - } - Irp->IoStatus.Information = (currentSector - firstSector) << byteToSectorShift; - if (status >= 0L) { - if (firstSector == 0UL) { - { - FlConsolidateMediaTypeWithBootSector(DisketteExtension, (struct _BOOT_SECTOR_INFO *)userBuffer); } } else { - } - } else { - - } - { + {} + return (status); } - return (status); -} } -NTSTATUS FlFormat(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp ) -{ LARGE_INTEGER headSettleTime ; - PIO_STACK_LOCATION irpSp ; - PBAD_TRACK_NUMBER badTrackBuffer ; - PFORMAT_PARAMETERS formatParameters ; - PFORMAT_EX_PARAMETERS formatExParameters ; - PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - NTSTATUS ntStatus ; - ULONG badTrackBufferLength ; - DRIVE_MEDIA_TYPE driveMediaType ; - UCHAR driveStatus ; - UCHAR numberOfBadTracks ; - UCHAR currentTrack ; - UCHAR endTrack ; - UCHAR whichSector ; - UCHAR retryCount ; - BOOLEAN bufferOverflow ; - FDC_DISK_CHANGE_PARMS fdcDiskChangeParms ; - ULONG length ; - UCHAR tmp ; - - { - numberOfBadTracks = 0; - bufferOverflow = 0; - { - } - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - formatParameters = (struct _FORMAT_PARAMETERS *)Irp->AssociatedIrp.SystemBuffer; - if (irpSp->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((7 << 16) | (3 << 14)) | (11 << 2))) { - formatExParameters = (struct _FORMAT_EX_PARAMETERS *)Irp->AssociatedIrp.SystemBuffer; - } else { - formatExParameters = (void *)0; - } - { - } - badTrackBufferLength = irpSp->Parameters.DeviceIoControl.OutputBufferLength; - driveMediaType = (DriveMediaLimits + DisketteExtension->DriveType)->HighestDriveMediaType; - { - while (1) { - while_167_continue: /* CIL Label */ ; - if ((int )(DriveMediaConstants + driveMediaType)->MediaType != (int )formatParameters->MediaType) { - if ((int )driveMediaType > (int )(DriveMediaLimits + DisketteExtension->DriveType)->LowestDriveMediaType) { - - } else { - goto while_167_break; - } - } else { - goto while_167_break; - } - driveMediaType = (DRIVE_MEDIA_TYPE )((int )driveMediaType - 1); - } - while_167_break: /* CIL Label */ ; - } - driveMediaConstants = DriveMediaConstants + driveMediaType; - DisketteExtension->MediaType = formatParameters->MediaType; - DisketteExtension->DriveMediaType = driveMediaType; - DisketteExtension->DriveMediaConstants = *(DriveMediaConstants + driveMediaType); - if (formatExParameters) { - DisketteExtension->DriveMediaConstants.SectorsPerTrack = (unsigned char )formatExParameters->SectorsPerTrack; - DisketteExtension->DriveMediaConstants.FormatGapLength = (unsigned char )formatExParameters->FormatGapLength; - } else { - - } - driveMediaConstants = & DisketteExtension->DriveMediaConstants; - DisketteExtension->BytesPerSector = driveMediaConstants->BytesPerSector; - DisketteExtension->ByteCapacity = (((int )driveMediaConstants->BytesPerSector * (int )driveMediaConstants->SectorsPerTrack) * (1 + (int )driveMediaConstants->MaximumTrack)) * (int )driveMediaConstants->NumberOfHeads; - currentTrack = (unsigned char )(formatParameters->StartCylinderNumber * (ULONG )driveMediaConstants->NumberOfHeads + formatParameters->StartHeadNumber); - endTrack = (unsigned char )(formatParameters->EndCylinderNumber * (ULONG )driveMediaConstants->NumberOfHeads + formatParameters->EndHeadNumber); - { - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - FlHdbit(DisketteExtension); - } - } else { - - } - if ((int )DisketteExtension->LastDriveMediaType != (int )driveMediaType) { - { - ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); - } - if (! (ntStatus >= 0L)) { - return (ntStatus); +NTSTATUS FlFormat(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp) { + LARGE_INTEGER headSettleTime; + PIO_STACK_LOCATION irpSp; + PBAD_TRACK_NUMBER badTrackBuffer; + PFORMAT_PARAMETERS formatParameters; + PFORMAT_EX_PARAMETERS formatExParameters; + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + NTSTATUS ntStatus; + ULONG badTrackBufferLength; + DRIVE_MEDIA_TYPE driveMediaType; + UCHAR driveStatus; + UCHAR numberOfBadTracks; + UCHAR currentTrack; + UCHAR endTrack; + UCHAR whichSector; + UCHAR retryCount; + BOOLEAN bufferOverflow; + FDC_DISK_CHANGE_PARMS fdcDiskChangeParms; + ULONG length; + UCHAR tmp; + + { + numberOfBadTracks = 0; + bufferOverflow = 0; + {} + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + formatParameters = + (struct _FORMAT_PARAMETERS *)Irp->AssociatedIrp.SystemBuffer; + if (irpSp->Parameters.DeviceIoControl.IoControlCode == + (ULONG)(((7 << 16) | (3 << 14)) | (11 << 2))) { + formatExParameters = + (struct _FORMAT_EX_PARAMETERS *)Irp->AssociatedIrp.SystemBuffer; } else { - - } - } else { - - } - DisketteExtension->IsReadOnly = 0; - { - while (1) { - while_169_continue: /* CIL Label */ ; - DisketteExtension->FifoBuffer[0] = 16; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - DisketteExtension->FifoBuffer[2] = (unsigned char )((int )currentTrack / (int )driveMediaConstants->NumberOfHeads << (int )driveMediaConstants->CylinderShift); - { + formatExParameters = (void *)0; } + {} + badTrackBufferLength = irpSp->Parameters.DeviceIoControl.OutputBufferLength; + driveMediaType = (DriveMediaLimits + DisketteExtension->DriveType) + ->HighestDriveMediaType; { - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, DisketteExtension->FifoBuffer, - (void *)0, 0, 0); - } - if (ntStatus >= 0L) { - if ((int )DisketteExtension->FifoBuffer[0] & 32) { - if ((int )DisketteExtension->FifoBuffer[1] == (int )((unsigned char )((int )currentTrack / (int )driveMediaConstants->NumberOfHeads << (int )driveMediaConstants->CylinderShift))) { - { - headSettleTime.__annonCompField1.LowPart = - (10000 * (int )driveMediaConstants->HeadSettleTime); - headSettleTime.__annonCompField1.HighPart = -1; - KeDelayExecutionThread(0, 0, & headSettleTime); - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { + while (1) { + while_167_continue: /* CIL Label */; + if ((int)(DriveMediaConstants + driveMediaType)->MediaType != + (int)formatParameters->MediaType) { + if ((int)driveMediaType > + (int)(DriveMediaLimits + DisketteExtension->DriveType) + ->LowestDriveMediaType) { } else { - { - DisketteExtension->FifoBuffer[0] = 84; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, - 0); - } + goto while_167_break; } } else { - goto _L; + goto while_167_break; } - } else { - _L: /* CIL Label */ - { - } - DisketteExtension->HardwareFailed = 1; - ntStatus = -1073741464L; + driveMediaType = (DRIVE_MEDIA_TYPE)((int)driveMediaType - 1); } + while_167_break: /* CIL Label */; + } + driveMediaConstants = DriveMediaConstants + driveMediaType; + DisketteExtension->MediaType = formatParameters->MediaType; + DisketteExtension->DriveMediaType = driveMediaType; + DisketteExtension->DriveMediaConstants = + *(DriveMediaConstants + driveMediaType); + if (formatExParameters) { + DisketteExtension->DriveMediaConstants.SectorsPerTrack = + (unsigned char)formatExParameters->SectorsPerTrack; + DisketteExtension->DriveMediaConstants.FormatGapLength = + (unsigned char)formatExParameters->FormatGapLength; } else { - } - if (! (ntStatus >= 0L)) { - { - } - return (ntStatus); + driveMediaConstants = &DisketteExtension->DriveMediaConstants; + DisketteExtension->BytesPerSector = driveMediaConstants->BytesPerSector; + DisketteExtension->ByteCapacity = + (((int)driveMediaConstants->BytesPerSector * + (int)driveMediaConstants->SectorsPerTrack) * + (1 + (int)driveMediaConstants->MaximumTrack)) * + (int)driveMediaConstants->NumberOfHeads; + currentTrack = + (unsigned char)(formatParameters->StartCylinderNumber * + (ULONG)driveMediaConstants->NumberOfHeads + + formatParameters->StartHeadNumber); + endTrack = (unsigned char)(formatParameters->EndCylinderNumber * + (ULONG)driveMediaConstants->NumberOfHeads + + formatParameters->EndHeadNumber); + {} + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { FlHdbit(DisketteExtension); } } else { - } - whichSector = 0; - { - while (1) { - while_173_continue: /* CIL Label */ ; - if ((int )whichSector < (int )driveMediaConstants->SectorsPerTrack) { - - } else { - goto while_173_break; - } - *(DisketteExtension->IoBuffer + (int )whichSector * 4) = (int )currentTrack / (int )driveMediaConstants->NumberOfHeads; - *(DisketteExtension->IoBuffer + ((int )whichSector * 4 + 1)) = (int )currentTrack % (int )driveMediaConstants->NumberOfHeads; - if (formatExParameters) { - *(DisketteExtension->IoBuffer + ((int )whichSector * 4 + 2)) = (unsigned char )formatExParameters->SectorNumber[whichSector]; + if ((int)DisketteExtension->LastDriveMediaType != (int)driveMediaType) { + { ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); } + if (!(ntStatus >= 0L)) { + return (ntStatus); } else { - *(DisketteExtension->IoBuffer + ((int )whichSector * 4 + 2)) = (int )whichSector + 1; } - *(DisketteExtension->IoBuffer + ((int )whichSector * 4 + 3)) = driveMediaConstants->SectorLengthCode; - { - } - whichSector = (UCHAR )((int )whichSector + 1); - } - while_173_break: /* CIL Label */ ; + } else { } - retryCount = 0; + DisketteExtension->IsReadOnly = 0; { - while (1) { - while_175_continue: /* CIL Label */ ; - length = driveMediaConstants->BytesPerSector; - DisketteExtension->FifoBuffer[0] = 71; - DisketteExtension->FifoBuffer[1] = (unsigned char )(((int )currentTrack % (int )driveMediaConstants->NumberOfHeads << 2) | (int )DisketteExtension->DeviceUnit); - DisketteExtension->FifoBuffer[2] = driveMediaConstants->SectorLengthCode; - DisketteExtension->FifoBuffer[3] = driveMediaConstants->SectorsPerTrack; - DisketteExtension->FifoBuffer[4] = driveMediaConstants->FormatGapLength; - DisketteExtension->FifoBuffer[5] = driveMediaConstants->FormatFillCharacter; - { - } - { - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, DisketteExtension->IoBufferMdl, - 0, length); - } - if (! (ntStatus >= 0L)) { - { + while (1) { + while_169_continue: /* CIL Label */; + DisketteExtension->FifoBuffer[0] = 16; + DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; + DisketteExtension->FifoBuffer[2] = + (unsigned char)((int)currentTrack / + (int)driveMediaConstants->NumberOfHeads + << (int)driveMediaConstants->CylinderShift); + {} { + ntStatus = + FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - } else { - - } - if (ntStatus >= 0L) { - if ((int )DisketteExtension->FifoBuffer[0] & 208) { - goto _L___0; - } else { - if ((int )DisketteExtension->FifoBuffer[1] & 16) { - goto _L___0; - } else { - if ((int )DisketteExtension->FifoBuffer[2] != 0) { - _L___0: /* CIL Label */ + if (ntStatus >= 0L) { + if ((int)DisketteExtension->FifoBuffer[0] & 32) { + if ((int)DisketteExtension->FifoBuffer[1] == + (int)(( + unsigned char)((int)currentTrack / + (int)driveMediaConstants->NumberOfHeads + << (int)driveMediaConstants + ->CylinderShift))) { { + headSettleTime.__annonCompField1.LowPart = + -(10000 * (int)driveMediaConstants->HeadSettleTime); + headSettleTime.__annonCompField1.HighPart = -1; + KeDelayExecutionThread(0, 0, &headSettleTime); } - { - DisketteExtension->HardwareFailed = 1; - ntStatus = FlInterpretError(DisketteExtension->FifoBuffer[1], DisketteExtension->FifoBuffer[2]); + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + + } else { + { + DisketteExtension->FifoBuffer[0] = 84; + DisketteExtension->FifoBuffer[1] = + DisketteExtension->DeviceUnit; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } } } else { - + goto _L; } + } else { + _L : /* CIL Label */ + {} + DisketteExtension->HardwareFailed = 1; + ntStatus = -1073741464L; } - } - } else { - - } - if (! (ntStatus >= 0L)) { - tmp = retryCount; - retryCount = (UCHAR )((int )retryCount + 1); - if (tmp < 3) { - } else { - goto while_175_break; - } - } else { - goto while_175_break; - } - } - while_175_break: /* CIL Label */ ; - } - if (! (ntStatus >= 0L)) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - { - DisketteExtension->FifoBuffer[0] = 14; - DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); } - if (! (ntStatus >= 0L)) { - { - } + if (!(ntStatus >= 0L)) { + {} return (ntStatus); } else { - } - if ((int )DisketteExtension->FifoBuffer[0] & 32) { - driveStatus = 127; - } else { - driveStatus = 128; + whichSector = 0; + { + while (1) { + while_173_continue: /* CIL Label */; + if ((int)whichSector < (int)driveMediaConstants->SectorsPerTrack) { + + } else { + goto while_173_break; + } + *(DisketteExtension->IoBuffer + (int)whichSector * 4) = + (int)currentTrack / (int)driveMediaConstants->NumberOfHeads; + *(DisketteExtension->IoBuffer + ((int)whichSector * 4 + 1)) = + (int)currentTrack % (int)driveMediaConstants->NumberOfHeads; + if (formatExParameters) { + *(DisketteExtension->IoBuffer + ((int)whichSector * 4 + 2)) = + (unsigned char)formatExParameters->SectorNumber[whichSector]; + } else { + *(DisketteExtension->IoBuffer + ((int)whichSector * 4 + 2)) = + (int)whichSector + 1; + } + *(DisketteExtension->IoBuffer + ((int)whichSector * 4 + 3)) = + driveMediaConstants->SectorLengthCode; + {} + whichSector = (UCHAR)((int)whichSector + 1); + } + while_173_break: /* CIL Label */; } - } else { + retryCount = 0; { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (776 << 2)) | 3, - & fdcDiskChangeParms); - driveStatus = fdcDiskChangeParms.DriveStatus; + while (1) { + while_175_continue: /* CIL Label */; + length = driveMediaConstants->BytesPerSector; + DisketteExtension->FifoBuffer[0] = 71; + DisketteExtension->FifoBuffer[1] = + (unsigned char)(((int)currentTrack % + (int)driveMediaConstants->NumberOfHeads + << 2) | + (int)DisketteExtension->DeviceUnit); + DisketteExtension->FifoBuffer[2] = + driveMediaConstants->SectorLengthCode; + DisketteExtension->FifoBuffer[3] = + driveMediaConstants->SectorsPerTrack; + DisketteExtension->FifoBuffer[4] = + driveMediaConstants->FormatGapLength; + DisketteExtension->FifoBuffer[5] = + driveMediaConstants->FormatFillCharacter; + {} { + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, DisketteExtension->IoBufferMdl, + 0, length); + } + if (!(ntStatus >= 0L)) { + {} + } else { + } + if (ntStatus >= 0L) { + if ((int)DisketteExtension->FifoBuffer[0] & 208) { + goto _L___0; + } else { + if ((int)DisketteExtension->FifoBuffer[1] & 16) { + goto _L___0; + } else { + if ((int)DisketteExtension->FifoBuffer[2] != 0) { + _L___0 : /* CIL Label */ + {} + { + DisketteExtension->HardwareFailed = 1; + ntStatus = + FlInterpretError(DisketteExtension->FifoBuffer[1], + DisketteExtension->FifoBuffer[2]); + } + } else { + } + } + } + } else { + } + if (!(ntStatus >= 0L)) { + tmp = retryCount; + retryCount = (UCHAR)((int)retryCount + 1); + if (tmp < 3) { + + } else { + goto while_175_break; + } + } else { + goto while_175_break; + } + } + while_175_break: /* CIL Label */; } - } - if ((int )DisketteExtension->DriveType != 0) { - if ((int )driveStatus & 128) { - return (-1073741805L); + if (!(ntStatus >= 0L)) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { + DisketteExtension->FifoBuffer[0] = 14; + DisketteExtension->FifoBuffer[1] = DisketteExtension->DeviceUnit; + ntStatus = FlIssueCommand( + DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + if (!(ntStatus >= 0L)) { + {} + return (ntStatus); + } else { + } + if ((int)DisketteExtension->FifoBuffer[0] & 32) { + driveStatus = 127; + } else { + driveStatus = 128; + } + } else { + { + ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (776 << 2)) | 3, + &fdcDiskChangeParms); + driveStatus = fdcDiskChangeParms.DriveStatus; + } + } + if ((int)DisketteExtension->DriveType != 0) { + if ((int)driveStatus & 128) { + return (-1073741805L); + } else { + } + } else { + } + {} + if (badTrackBufferLength >= + (unsigned long)((unsigned int)((int)numberOfBadTracks + 1) * + sizeof(BAD_TRACK_NUMBER))) { + badTrackBuffer = (USHORT *)Irp->AssociatedIrp.SystemBuffer; + *(badTrackBuffer + numberOfBadTracks) = + (unsigned short)currentTrack; + } else { + bufferOverflow = 1; + } + numberOfBadTracks = (UCHAR)((int)numberOfBadTracks + 1); } else { - } - } else { + currentTrack = (UCHAR)((int)currentTrack + 1); + if ((int)currentTrack <= (int)endTrack) { + } else { + goto while_169_break; + } } - { - } - if (badTrackBufferLength >= (unsigned long )((unsigned int )((int )numberOfBadTracks + 1) * sizeof(BAD_TRACK_NUMBER ))) { - badTrackBuffer = (USHORT *)Irp->AssociatedIrp.SystemBuffer; - *(badTrackBuffer + numberOfBadTracks) = (unsigned short )currentTrack; + while_169_break: /* CIL Label */; + } + if (ntStatus >= 0L) { + if (bufferOverflow) { + ntStatus = -2147483643L; } else { - bufferOverflow = 1; } - numberOfBadTracks = (UCHAR )((int )numberOfBadTracks + 1); - } else { - - } - currentTrack = (UCHAR )((int )currentTrack + 1); - if ((int )currentTrack <= (int )endTrack) { - - } else { - goto while_169_break; - } - } - while_169_break: /* CIL Label */ ; - } - if (ntStatus >= 0L) { - if (bufferOverflow) { - ntStatus = -2147483643L; } else { - } - } else { - + return (ntStatus); } - return (ntStatus); -} } -BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension , PFORMAT_PARAMETERS FormatParameters ) -{ PDRIVE_MEDIA_CONSTANTS driveMediaConstants ; - DRIVE_MEDIA_TYPE driveMediaType ; +BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension, + PFORMAT_PARAMETERS FormatParameters) { + PDRIVE_MEDIA_CONSTANTS driveMediaConstants; + DRIVE_MEDIA_TYPE driveMediaType; { - driveMediaType = (DriveMediaLimits + DisketteExtension->DriveType)->HighestDriveMediaType; - { - while (1) { - while_181_continue: /* CIL Label */ ; - if ((int )(DriveMediaConstants + driveMediaType)->MediaType != (int )FormatParameters->MediaType) { - if ((int )driveMediaType > (int )(DriveMediaLimits + DisketteExtension->DriveType)->LowestDriveMediaType) { + driveMediaType = (DriveMediaLimits + DisketteExtension->DriveType) + ->HighestDriveMediaType; + { + while (1) { + while_181_continue: /* CIL Label */; + if ((int)(DriveMediaConstants + driveMediaType)->MediaType != + (int)FormatParameters->MediaType) { + if ((int)driveMediaType > + (int)(DriveMediaLimits + DisketteExtension->DriveType) + ->LowestDriveMediaType) { - } else { - goto while_181_break; + } else { + goto while_181_break; + } + } else { + goto while_181_break; + } + driveMediaType = (DRIVE_MEDIA_TYPE)((int)driveMediaType - 1); } - } else { - goto while_181_break; + while_181_break: /* CIL Label */; } - driveMediaType = (DRIVE_MEDIA_TYPE )((int )driveMediaType - 1); - } - while_181_break: /* CIL Label */ ; - } - if ((int )(DriveMediaConstants + driveMediaType)->MediaType != (int )FormatParameters->MediaType) { - return (0); - } else { - driveMediaConstants = DriveMediaConstants + driveMediaType; - if (FormatParameters->StartHeadNumber > (unsigned long )((int )driveMediaConstants->NumberOfHeads - 1)) { + if ((int)(DriveMediaConstants + driveMediaType)->MediaType != + (int)FormatParameters->MediaType) { return (0); } else { - if (FormatParameters->EndHeadNumber > (unsigned long )((int )driveMediaConstants->NumberOfHeads - 1)) { + driveMediaConstants = DriveMediaConstants + driveMediaType; + if (FormatParameters->StartHeadNumber > + (unsigned long)((int)driveMediaConstants->NumberOfHeads - 1)) { return (0); } else { - if (FormatParameters->StartCylinderNumber > (ULONG )driveMediaConstants->MaximumTrack) { + if (FormatParameters->EndHeadNumber > + (unsigned long)((int)driveMediaConstants->NumberOfHeads - 1)) { return (0); } else { - if (FormatParameters->EndCylinderNumber > (ULONG )driveMediaConstants->MaximumTrack) { + if (FormatParameters->StartCylinderNumber > + (ULONG)driveMediaConstants->MaximumTrack) { return (0); } else { - if (FormatParameters->EndCylinderNumber < FormatParameters->StartCylinderNumber) { + if (FormatParameters->EndCylinderNumber > + (ULONG)driveMediaConstants->MaximumTrack) { return (0); } else { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { - if ((int )FormatParameters->MediaType == 6) { - return (0); - } else { - if ((int )FormatParameters->MediaType == 7) { + if (FormatParameters->EndCylinderNumber < + FormatParameters->StartCylinderNumber) { + return (0); + } else { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + if ((int)FormatParameters->MediaType == 6) { return (0); } else { - if ((int )FormatParameters->MediaType == 8) { + if ((int)FormatParameters->MediaType == 7) { return (0); } else { - if ((int )FormatParameters->MediaType == 9) { + if ((int)FormatParameters->MediaType == 8) { return (0); } else { - if ((int )FormatParameters->MediaType == 10) { + if ((int)FormatParameters->MediaType == 9) { return (0); } else { - + if ((int)FormatParameters->MediaType == 10) { + return (0); + } else { + } } } } } + } else { } - } else { - + return (1); } - return (1); } } } @@ -6515,211 +6613,215 @@ BOOLEAN FlCheckFormatParameters(PDISKETTE_EXTENSION DisketteExtension , PFORMAT_ } } } -} -NTSTATUS FlIssueCommand(PDISKETTE_EXTENSION DisketteExtension , PUCHAR FifoInBuffer , - PUCHAR FifoOutBuffer , PMDL IoMdl , ULONG IoOffset , ULONG TransferBytes ) -{ NTSTATUS ntStatus ; - ISSUE_FDC_COMMAND_PARMS issueCommandParms ; +NTSTATUS FlIssueCommand(PDISKETTE_EXTENSION DisketteExtension, + PUCHAR FifoInBuffer, PUCHAR FifoOutBuffer, PMDL IoMdl, + ULONG IoOffset, ULONG TransferBytes) { + NTSTATUS ntStatus; + ISSUE_FDC_COMMAND_PARMS issueCommandParms; { - issueCommandParms.FifoInBuffer = FifoInBuffer; - issueCommandParms.FifoOutBuffer = FifoOutBuffer; - issueCommandParms.IoHandle = (void *)IoMdl; - issueCommandParms.IoOffset = IoOffset; - issueCommandParms.TransferBytes = TransferBytes; - issueCommandParms.TimeOut = 4; - { - } - { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (771 << 2)) | 3, - & issueCommandParms); - } - if (ntStatus == -1073741661L) { - DisketteExtension->HardwareFailed = 1; - } else { - if (ntStatus == -1073741464L) { + issueCommandParms.FifoInBuffer = FifoInBuffer; + issueCommandParms.FifoOutBuffer = FifoOutBuffer; + issueCommandParms.IoHandle = (void *)IoMdl; + issueCommandParms.IoOffset = IoOffset; + issueCommandParms.TransferBytes = TransferBytes; + issueCommandParms.TimeOut = 4; + {} { + ntStatus = + FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (771 << 2)) | 3, &issueCommandParms); + } + if (ntStatus == -1073741661L) { DisketteExtension->HardwareFailed = 1; } else { - + if (ntStatus == -1073741464L) { + DisketteExtension->HardwareFailed = 1; + } else { + } } + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FlInitializeControllerHardware(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; +NTSTATUS FlInitializeControllerHardware(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; { - { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (773 << 2)) | 3, - (void *)0); - } - if (ntStatus >= 0L) { - if ((int )DisketteExtension->PerpendicularMode != 0) { - { - DisketteExtension->FifoBuffer[0] = 21; - DisketteExtension->FifoBuffer[1] = (unsigned char )(128 | ((int )DisketteExtension->PerpendicularMode << 2)); - ntStatus = FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, - DisketteExtension->FifoBuffer, (void *)0, 0, 0); + { + ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (773 << 2)) | 3, (void *)0); + } + if (ntStatus >= 0L) { + if ((int)DisketteExtension->PerpendicularMode != 0) { + { + DisketteExtension->FifoBuffer[0] = 21; + DisketteExtension->FifoBuffer[1] = + (unsigned char)(128 | + ((int)DisketteExtension->PerpendicularMode << 2)); + ntStatus = + FlIssueCommand(DisketteExtension, DisketteExtension->FifoBuffer, + DisketteExtension->FifoBuffer, (void *)0, 0, 0); + } + } else { } } else { - } - } else { - + return (ntStatus); } - return (ntStatus); -} } -NTSTATUS FlFdcDeviceIo(PDEVICE_OBJECT DeviceObject , ULONG Ioctl , PVOID Data ) -{ NTSTATUS ntStatus ; - PIRP irp ; - PIO_STACK_LOCATION irpStack ; - KEVENT doneEvent ; - IO_STATUS_BLOCK ioStatus ; +NTSTATUS FlFdcDeviceIo(PDEVICE_OBJECT DeviceObject, ULONG Ioctl, PVOID Data) { + NTSTATUS ntStatus; + PIRP irp; + PIO_STACK_LOCATION irpStack; + KEVENT doneEvent; + IO_STATUS_BLOCK ioStatus; { - { - } - { -/* KeInitializeEvent(& doneEvent, 0, 0); */ /* INLINED */ - irp = IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, (void *)0, 0, (void *)0, - 0, 1, & doneEvent, & ioStatus); - } - if ((unsigned int )irp == (unsigned int )((void *)0)) { - { + {} { + /* KeInitializeEvent(& doneEvent, 0, 0); */ /* INLINED */ + irp = + IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, (void *)0, 0, + (void *)0, 0, 1, &doneEvent, &ioStatus); + } + if ((unsigned int)irp == (unsigned int)((void *)0)) { + {} + return (-1073741670L); + } else { } - return (-1073741670L); - } else { - - } - { - irpStack = irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpStack->Parameters.DeviceIoControl.Type3InputBuffer = Data; - ntStatus = IofCallDriver(DeviceObject, irp); - } - if (ntStatus == 259L) { { - KeWaitForSingleObject(& doneEvent, 5, 0, 0, (void *)0); - ntStatus = ioStatus.__annonCompField4.Status; + irpStack = irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpStack->Parameters.DeviceIoControl.Type3InputBuffer = Data; + ntStatus = IofCallDriver(DeviceObject, irp); } - } else { - + if (ntStatus == 259L) { + { + KeWaitForSingleObject(&doneEvent, 5, 0, 0, (void *)0); + ntStatus = ioStatus.__annonCompField4.Status; + } + } else { + } + return (ntStatus); } - return (ntStatus); -} } -NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension ) -{ NTSTATUS ntStatus ; - SHORT st5 ; - BOOLEAN media144MB ; - BOOLEAN mediaUpTo120MB ; - BOOLEAN supportDrive ; - SET_HD_BIT_PARMS setHdBitParameter ; +NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension) { + NTSTATUS ntStatus; + SHORT st5; + BOOLEAN media144MB; + BOOLEAN mediaUpTo120MB; + BOOLEAN supportDrive; + SET_HD_BIT_PARMS setHdBitParameter; { - st5 = 0; - media144MB = 0; - mediaUpTo120MB = 0; - supportDrive = 1; - { - } - if (DisketteExtension->DriveMediaType == 18) { - goto switch_186_18; - } else { - if (DisketteExtension->DriveMediaType == 16) { - goto switch_186_16; + st5 = 0; + media144MB = 0; + mediaUpTo120MB = 0; + supportDrive = 1; + {} + if (DisketteExtension->DriveMediaType == 18) { + goto switch_186_18; } else { - if (DisketteExtension->DriveMediaType == 17) { - goto switch_186_17; + if (DisketteExtension->DriveMediaType == 16) { + goto switch_186_16; } else { - if (DisketteExtension->DriveMediaType == 12) { - goto switch_186_12; + if (DisketteExtension->DriveMediaType == 17) { + goto switch_186_17; } else { - if (DisketteExtension->DriveMediaType == 13) { - goto switch_186_13; + if (DisketteExtension->DriveMediaType == 12) { + goto switch_186_12; } else { - if (DisketteExtension->DriveMediaType == 19) { - goto switch_186_19; + if (DisketteExtension->DriveMediaType == 13) { + goto switch_186_13; } else { - if (DisketteExtension->DriveMediaType == 20) { - goto switch_186_20; + if (DisketteExtension->DriveMediaType == 19) { + goto switch_186_19; } else { - if (DisketteExtension->DriveMediaType == 0) { - goto switch_186_0; + if (DisketteExtension->DriveMediaType == 20) { + goto switch_186_20; } else { - if (DisketteExtension->DriveMediaType == 1) { - goto switch_186_1; + if (DisketteExtension->DriveMediaType == 0) { + goto switch_186_0; } else { - if (DisketteExtension->DriveMediaType == 2) { - goto switch_186_2; + if (DisketteExtension->DriveMediaType == 1) { + goto switch_186_1; } else { - if (DisketteExtension->DriveMediaType == 3) { - goto switch_186_3; + if (DisketteExtension->DriveMediaType == 2) { + goto switch_186_2; } else { - if (DisketteExtension->DriveMediaType == 4) { - goto switch_186_4; + if (DisketteExtension->DriveMediaType == 3) { + goto switch_186_3; } else { - if (DisketteExtension->DriveMediaType == 5) { - goto switch_186_5; + if (DisketteExtension->DriveMediaType == 4) { + goto switch_186_4; } else { - if (DisketteExtension->DriveMediaType == 6) { - goto switch_186_6; + if (DisketteExtension->DriveMediaType == 5) { + goto switch_186_5; } else { - if (DisketteExtension->DriveMediaType == 7) { - goto switch_186_7; + if (DisketteExtension->DriveMediaType == 6) { + goto switch_186_6; } else { - if (DisketteExtension->DriveMediaType == 8) { - goto switch_186_8; + if (DisketteExtension->DriveMediaType == 7) { + goto switch_186_7; } else { - if (DisketteExtension->DriveMediaType == 9) { - goto switch_186_9; + if (DisketteExtension->DriveMediaType == 8) { + goto switch_186_8; } else { - if (DisketteExtension->DriveMediaType == 10) { - goto switch_186_10; + if (DisketteExtension->DriveMediaType == + 9) { + goto switch_186_9; } else { - if (DisketteExtension->DriveMediaType == 11) { - goto switch_186_11; + if (DisketteExtension->DriveMediaType == + 10) { + goto switch_186_10; } else { - if (DisketteExtension->DriveMediaType == 14) { - goto switch_186_14; + if (DisketteExtension->DriveMediaType == + 11) { + goto switch_186_11; } else { - if (DisketteExtension->DriveMediaType == 15) { - goto switch_186_15; + if (DisketteExtension + ->DriveMediaType == 14) { + goto switch_186_14; } else { - { - goto switch_186_default; - if (0) { - switch_186_18: /* CIL Label */ - media144MB = 1; - switch_186_16: /* CIL Label */ ; - switch_186_17: /* CIL Label */ ; - switch_186_12: /* CIL Label */ ; - switch_186_13: /* CIL Label */ ; - switch_186_19: /* CIL Label */ ; - switch_186_20: /* CIL Label */ - mediaUpTo120MB = 1; - switch_186_0: /* CIL Label */ ; - switch_186_1: /* CIL Label */ ; - switch_186_2: /* CIL Label */ ; - switch_186_3: /* CIL Label */ ; - switch_186_4: /* CIL Label */ ; - switch_186_5: /* CIL Label */ ; - switch_186_6: /* CIL Label */ ; - switch_186_7: /* CIL Label */ ; - switch_186_8: /* CIL Label */ ; - switch_186_9: /* CIL Label */ ; - switch_186_10: /* CIL Label */ ; - switch_186_11: /* CIL Label */ ; - switch_186_14: /* CIL Label */ ; - switch_186_15: /* CIL Label */ ; - goto switch_186_break; - switch_186_default: /* CIL Label */ - mediaUpTo120MB = 1; - goto switch_186_break; + if (DisketteExtension + ->DriveMediaType == 15) { + goto switch_186_15; } else { - switch_186_break: /* CIL Label */ ; - } + { + goto switch_186_default; + if (0) { + switch_186_18: /* CIL Label */ + media144MB = 1; + switch_186_16: /* CIL Label */; + switch_186_17: /* CIL Label */; + switch_186_12: /* CIL Label */; + switch_186_13: /* CIL Label */; + switch_186_19: /* CIL Label */; + switch_186_20: /* CIL Label */ + mediaUpTo120MB = 1; + switch_186_0: /* CIL Label */; + switch_186_1: /* CIL Label */; + switch_186_2: /* CIL Label */; + switch_186_3: /* CIL Label */; + switch_186_4: /* CIL Label */; + switch_186_5: /* CIL Label */; + switch_186_6: /* CIL Label */; + switch_186_7: /* CIL Label */; + switch_186_8: /* CIL Label */; + switch_186_9: /* CIL Label */; + switch_186_10: /* CIL Label */; + switch_186_11: /* CIL Label */; + switch_186_14: /* CIL Label */; + switch_186_15: /* CIL Label */; + goto switch_186_break; + switch_186_default + : /* CIL Label */ + mediaUpTo120MB = 1; + goto switch_186_break; + } else { + switch_186_break + : /* CIL Label */; + } + } } } } @@ -6741,470 +6843,451 @@ NTSTATUS FlHdbit(PDISKETTE_EXTENSION DisketteExtension ) } } } - } - setHdBitParameter.Media144MB = media144MB; - setHdBitParameter.More120MB = mediaUpTo120MB; - setHdBitParameter.DeviceUnit = DisketteExtension->DeviceUnit; - if ((int )DisketteExtension->DriveType == 3) { - setHdBitParameter.DriveType144MB = 1; - } else { - setHdBitParameter.DriveType144MB = 0; - } - { - ntStatus = FlFdcDeviceIo(DisketteExtension->TargetObject, ((7 << 16) | (785 << 2)) | 3, - & setHdBitParameter); - } - if (! (ntStatus >= 0L)) { - return (ntStatus); - } else { - - } - if (setHdBitParameter.ChangedHdBit) { + setHdBitParameter.Media144MB = media144MB; + setHdBitParameter.More120MB = mediaUpTo120MB; + setHdBitParameter.DeviceUnit = DisketteExtension->DeviceUnit; + if ((int)DisketteExtension->DriveType == 3) { + setHdBitParameter.DriveType144MB = 1; + } else { + setHdBitParameter.DriveType144MB = 0; + } { - ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); + ntStatus = + FlFdcDeviceIo(DisketteExtension->TargetObject, + ((7 << 16) | (785 << 2)) | 3, &setHdBitParameter); } - } else { - + if (!(ntStatus >= 0L)) { + return (ntStatus); + } else { + } + if (setHdBitParameter.ChangedHdBit) { + { ntStatus = FlDatarateSpecifyConfigure(DisketteExtension); } + } else { + } + return (ntStatus); } - return (ntStatus); } -} -NTSTATUS FloppyQueueRequest(PDISKETTE_EXTENSION DisketteExtension , PIRP Irp ) -{ KIRQL oldIrql ; - NTSTATUS ntStatus ; - LONG tmp ; +NTSTATUS FloppyQueueRequest(PDISKETTE_EXTENSION DisketteExtension, PIRP Irp) { + KIRQL oldIrql; + NTSTATUS ntStatus; + LONG tmp; { - { -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount += 1UL; - } - if (PagingReferenceCount == 1UL) { { -/* MmResetDriverPaging(& DriverEntry); */ /* INLINED */ + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount += 1UL; + } + if (PagingReferenceCount == 1UL) { + { /* MmResetDriverPaging(& DriverEntry); */ /* INLINED */ + } + } else { } - } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ - oldIrql = KfAcquireSpinLock(& DisketteExtension->FlCancelSpinLock); - InterlockedExchange((LONG *)((PVOID *)(& Irp->CancelRoutine)), (long )((void *)(& FloppyCancelQueuedRequest))); - } - if (Irp->Cancel) { { - tmp = InterlockedExchange((LONG *)((PVOID *)(& Irp->CancelRoutine)), (long )((void *)0)); + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + oldIrql = KfAcquireSpinLock(&DisketteExtension->FlCancelSpinLock); + InterlockedExchange((LONG *)((PVOID *)(&Irp->CancelRoutine)), + (long)((void *)(&FloppyCancelQueuedRequest))); } - if ((void (*)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ))((void *)tmp)) { + if (Irp->Cancel) { { - Irp->IoStatus.__annonCompField4.Status = -1073741536L; - myStatus = -1073741536L; - Irp->IoStatus.Information = 0; -/* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ - IofCompleteRequest(Irp, 0); -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; + tmp = InterlockedExchange((LONG *)((PVOID *)(&Irp->CancelRoutine)), + (long)((void *)0)); } - if (PagingReferenceCount == 0UL) { + if ((void (*)(struct _DEVICE_OBJECT * DeviceObject, struct _IRP * Irp))( + (void *)tmp)) { + { + Irp->IoStatus.__annonCompField4.Status = -1073741536L; + myStatus = -1073741536L; + Irp->IoStatus.Information = 0; + /* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ + IofCompleteRequest(Irp, 0); + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; + } + if (PagingReferenceCount == 0UL) { + { /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } + } else { + } { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + ntStatus = -1073741536L; } } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ - ntStatus = -1073741536L; + goto _L; } } else { - goto _L; - } - } else { - _L: /* CIL Label */ - Irp->IoStatus.__annonCompField4.Status = 259L; - myStatus = 259L; - (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1; - if (pended == 0) { - pended = 1; - } else { + _L: /* CIL Label */ + Irp->IoStatus.__annonCompField4.Status = 259L; + myStatus = 259L; + (Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation) + ->Control = (int)(Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16.CurrentStackLocation) + ->Control | + 1; + if (pended == 0) { + pended = 1; + } else { + { errorFn(); } + } { - errorFn(); + ExfInterlockedInsertTailList( + &DisketteExtension->NewRequestQueue, + &Irp->Tail.Overlay.__annonCompField17.ListEntry, + &DisketteExtension->NewRequestQueueSpinLock); + /* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ + ntStatus = 259L; } - } - { - ExfInterlockedInsertTailList(& DisketteExtension->NewRequestQueue, & Irp->Tail.Overlay.__annonCompField17.ListEntry, - & DisketteExtension->NewRequestQueueSpinLock); -/* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ - ntStatus = 259L; - } - } - return (ntStatus); -} -} -void FloppyCancelQueuedRequest(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDISKETTE_EXTENSION disketteExtension ; - KIRQL oldIrql ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; - - { - disketteExtension = DeviceObject->DeviceExtension; - { - } - { - oldIrql = KfAcquireSpinLock(& disketteExtension->FlCancelSpinLock); - Irp->IoStatus.__annonCompField4.Status = -1073741536L; - myStatus = -1073741536L; - Irp->IoStatus.Information = 0; - } - if (Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink) { - _EX_Flink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink; - _EX_Blink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - } else { - - } - { -/* KfReleaseSpinLock(& disketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ -/* IoReleaseCancelSpinLock(Irp->CancelIrql); */ /* INLINED */ - IofCompleteRequest(Irp, 0); -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; - } - if (PagingReferenceCount == 0UL) { - { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ - } - } else { - - } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + } + return (ntStatus); } - return; } -} -void FloppyProcessQueuedRequests(PDISKETTE_EXTENSION DisketteExtension ) -{ KIRQL oldIrql ; - PLIST_ENTRY headOfList ; - PIRP currentIrp ; - PIO_STACK_LOCATION irpSp ; - LONG tmp ; +void FloppyCancelQueuedRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDISKETTE_EXTENSION disketteExtension; + KIRQL oldIrql; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; { - { - oldIrql = KfAcquireSpinLock(& DisketteExtension->FlCancelSpinLock); - } - { - while (1) { - while_188_continue: /* CIL Label */ ; - { - headOfList = ExfInterlockedRemoveHeadList(& DisketteExtension->NewRequestQueue, - & DisketteExtension->NewRequestQueueSpinLock); + disketteExtension = DeviceObject->DeviceExtension; + {} { + oldIrql = KfAcquireSpinLock(&disketteExtension->FlCancelSpinLock); + Irp->IoStatus.__annonCompField4.Status = -1073741536L; + myStatus = -1073741536L; + Irp->IoStatus.Information = 0; } - if ((unsigned int )headOfList != (unsigned int )((void *)0)) { - + if (Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink) { + _EX_Flink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink; + _EX_Blink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; } else { - goto while_188_break; } { - currentIrp = (IRP *)((CHAR *)headOfList - (unsigned long )(& ((IRP *)0)->Tail.Overlay.__annonCompField17.ListEntry)); - tmp = InterlockedExchange((LONG *)((PVOID *)(& currentIrp->CancelRoutine)), (long )((void *)0)); + /* KfReleaseSpinLock(& disketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ + /* IoReleaseCancelSpinLock(Irp->CancelIrql); */ /* INLINED */ + IofCompleteRequest(Irp, 0); + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; } - if ((void (*)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ))((void *)tmp)) { - irpSp = currentIrp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; + if (PagingReferenceCount == 0UL) { + { /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } } else { - currentIrp->Tail.Overlay.__annonCompField17.ListEntry.Flink = (void *)0; - currentIrp = (void *)0; } - { -/* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ + { /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ } - if (currentIrp) { - if (DisketteExtension->IsRemoved) { + return; + } +} +void FloppyProcessQueuedRequests(PDISKETTE_EXTENSION DisketteExtension) { + KIRQL oldIrql; + PLIST_ENTRY headOfList; + PIRP currentIrp; + PIO_STACK_LOCATION irpSp; + LONG tmp; + + { + { oldIrql = KfAcquireSpinLock(&DisketteExtension->FlCancelSpinLock); } + { + while (1) { + while_188_continue: /* CIL Label */; { - currentIrp->IoStatus.Information = 0; - currentIrp->IoStatus.__annonCompField4.Status = -1073741738L; - IofCompleteRequest(currentIrp, 0); + headOfList = ExfInterlockedRemoveHeadList( + &DisketteExtension->NewRequestQueue, + &DisketteExtension->NewRequestQueueSpinLock); } - } else { - if (irpSp->MajorFunction == 3) { - goto switch_189_3; + if ((unsigned int)headOfList != (unsigned int)((void *)0)) { + } else { - if (irpSp->MajorFunction == 4) { - goto switch_189_4; + goto while_188_break; + } + { + currentIrp = + (IRP *)((CHAR *)headOfList - + (unsigned long)(&((IRP *)0) + ->Tail.Overlay.__annonCompField17 + .ListEntry)); + tmp = InterlockedExchange( + (LONG *)((PVOID *)(¤tIrp->CancelRoutine)), + (long)((void *)0)); + } + if ((void (*)(struct _DEVICE_OBJECT * DeviceObject, struct _IRP * Irp))( + (void *)tmp)) { + irpSp = currentIrp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + } else { + currentIrp->Tail.Overlay.__annonCompField17.ListEntry.Flink = + (void *)0; + currentIrp = (void *)0; + } + { + /* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ + } + if (currentIrp) { + if (DisketteExtension->IsRemoved) { + { + currentIrp->IoStatus.Information = 0; + currentIrp->IoStatus.__annonCompField4.Status = -1073741738L; + IofCompleteRequest(currentIrp, 0); + } } else { - if (irpSp->MajorFunction == 14) { - goto switch_189_14; + if (irpSp->MajorFunction == 3) { + goto switch_189_3; } else { - { - goto switch_189_default; - if (0) { - switch_189_3: /* CIL Label */ ; - switch_189_4: /* CIL Label */ - { - FloppyReadWrite(DisketteExtension->DeviceObject, currentIrp); - } - goto switch_189_break; - switch_189_14: /* CIL Label */ - { - FloppyDeviceControl(DisketteExtension->DeviceObject, currentIrp); - } - goto switch_189_break; - switch_189_default: /* CIL Label */ - { - currentIrp->IoStatus.Information = 0; - currentIrp->IoStatus.__annonCompField4.Status = -1073741823L; - IofCompleteRequest(currentIrp, 0); - } + if (irpSp->MajorFunction == 4) { + goto switch_189_4; } else { - switch_189_break: /* CIL Label */ ; - } + if (irpSp->MajorFunction == 14) { + goto switch_189_14; + } else { + { + goto switch_189_default; + if (0) { + switch_189_3: /* CIL Label */; + switch_189_4 : /* CIL Label */ + { + FloppyReadWrite(DisketteExtension->DeviceObject, + currentIrp); + } + goto switch_189_break; + switch_189_14 : /* CIL Label */ + { + FloppyDeviceControl(DisketteExtension->DeviceObject, + currentIrp); + } + goto switch_189_break; + switch_189_default : /* CIL Label */ + { + currentIrp->IoStatus.Information = 0; + currentIrp->IoStatus.__annonCompField4.Status = + -1073741823L; + IofCompleteRequest(currentIrp, 0); + } + } else { + switch_189_break: /* CIL Label */; + } + } + } } } } + } else { } - } - } else { - - } - if (currentIrp) { - { -/* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ - PagingReferenceCount -= 1UL; - } - if (PagingReferenceCount == 0UL) { - { -/* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + if (currentIrp) { + { + /* ExAcquireFastMutex(PagingMutex); */ /* INLINED */ + PagingReferenceCount -= 1UL; + } + if (PagingReferenceCount == 0UL) { + { /* MmPageEntireDriver(& DriverEntry); */ /* INLINED */ + } + } else { + } + { /* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ + } + } else { } - } else { - + { oldIrql = KfAcquireSpinLock(&DisketteExtension->FlCancelSpinLock); } } - { -/* ExReleaseFastMutex(PagingMutex); */ /* INLINED */ - } - } else { - + while_188_break: /* CIL Label */; } { - oldIrql = KfAcquireSpinLock(& DisketteExtension->FlCancelSpinLock); + /* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ } + return; } - while_188_break: /* CIL Label */ ; - } - { -/* KfReleaseSpinLock(& DisketteExtension->FlCancelSpinLock, oldIrql); */ /* INLINED */ - } - return; -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) -IRP *pirp ; -void stub_driver_init(void) -{ - - { - s = NP; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - return; -} -} -int main(void) -{ DRIVER_OBJECT d ; - UNICODE_STRING u ; - NTSTATUS status ; - int we_should_unload = __VERIFIER_nondet_int() ; - IRP irp ; - int __BLAST_NONDET = __VERIFIER_nondet_int() ; - int irp_choice = __VERIFIER_nondet_int() ; - DEVICE_OBJECT devobj ; - d.DriverExtension = malloc(sizeof (struct _DRIVER_EXTENSION)); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +IRP *pirp; +void stub_driver_init(void) { { - { - status = 0; - pirp = & irp; - _BLAST_init(); - status = DriverEntry(& d, & u); - } - if (status >= 0L) { s = NP; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; customIrp = 0; - setEventCalled = customIrp; - lowerDriverReturn = setEventCalled; - compRegistered = lowerDriverReturn; - compFptr = compRegistered; - pended = compFptr; - pirp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (irp_choice == 0) { - pirp->IoStatus.__annonCompField4.Status = -1073741637L; - myStatus = -1073741637L; - } else { + return; + } +} +int main(void) { + DRIVER_OBJECT d; + UNICODE_STRING u; + NTSTATUS status; + int we_should_unload = __VERIFIER_nondet_int(); + IRP irp; + int __BLAST_NONDET = __VERIFIER_nondet_int(); + int irp_choice = __VERIFIER_nondet_int(); + DEVICE_OBJECT devobj; + d.DriverExtension = malloc(sizeof(struct _DRIVER_EXTENSION)); - } + { { - stub_driver_init(); - } - if (! (status >= 0L)) { - return (-1); - } else { - + status = 0; + pirp = &irp; + _BLAST_init(); + status = DriverEntry(&d, &u); } - if (__BLAST_NONDET == 0) { - goto switch_190_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_190_1; + if (status >= 0L) { + s = NP; + customIrp = 0; + setEventCalled = customIrp; + lowerDriverReturn = setEventCalled; + compRegistered = lowerDriverReturn; + compFptr = compRegistered; + pended = compFptr; + pirp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (irp_choice == 0) { + pirp->IoStatus.__annonCompField4.Status = -1073741637L; + myStatus = -1073741637L; + } else { + } + { stub_driver_init(); } + if (!(status >= 0L)) { + return (-1); + } else { + } + if (__BLAST_NONDET == 0) { + goto switch_190_0; } else { - if (__BLAST_NONDET == 2) { - goto switch_190_2; + if (__BLAST_NONDET == 1) { + goto switch_190_1; } else { - if (__BLAST_NONDET == 3) { - goto switch_190_3; + if (__BLAST_NONDET == 2) { + goto switch_190_2; } else { - if (__BLAST_NONDET == 4) { - goto switch_190_4; + if (__BLAST_NONDET == 3) { + goto switch_190_3; } else { - { - goto switch_190_default; - if (0) { - switch_190_0: /* CIL Label */ - { - status = FloppyCreateClose(& devobj, pirp); - } - goto switch_190_break; - switch_190_1: /* CIL Label */ - { - status = FloppyCreateClose(& devobj, pirp); - } - goto switch_190_break; - switch_190_2: /* CIL Label */ - { - status = FloppyDeviceControl(& devobj, pirp); - } - goto switch_190_break; - switch_190_3: /* CIL Label */ - { - status = FloppyPnp(& devobj, pirp); - } - goto switch_190_break; - switch_190_4: /* CIL Label */ + if (__BLAST_NONDET == 4) { + goto switch_190_4; + } else { { - status = FloppyPower(& devobj, pirp); + goto switch_190_default; + if (0) { + switch_190_0 : /* CIL Label */ + { + status = FloppyCreateClose(&devobj, pirp); + } + goto switch_190_break; + switch_190_1 : /* CIL Label */ + { + status = FloppyCreateClose(&devobj, pirp); + } + goto switch_190_break; + switch_190_2 : /* CIL Label */ + { + status = FloppyDeviceControl(&devobj, pirp); + } + goto switch_190_break; + switch_190_3 : /* CIL Label */ + { + status = FloppyPnp(&devobj, pirp); + } + goto switch_190_break; + switch_190_4 : /* CIL Label */ + { + status = FloppyPower(&devobj, pirp); + } + goto switch_190_break; + switch_190_default: /* CIL Label */; + return (-1); + } else { + switch_190_break: /* CIL Label */; + } } - goto switch_190_break; - switch_190_default: /* CIL Label */ ; - return (-1); - } else { - switch_190_break: /* CIL Label */ ; - } } } } } } - } - if (we_should_unload) { - { - FloppyUnload(& d); + if (we_should_unload) { + { FloppyUnload(&d); } + } else { } } else { - - } - } else { - - } - if (pended == 1) { - if (s == NP) { - s = NP; - } else { - goto _L___2; } - } else { - _L___2: /* CIL Label */ if (pended == 1) { - if (s == MPR3) { - s = MPR3; + if (s == NP) { + s = NP; } else { - goto _L___1; + goto _L___2; } } else { - _L___1: /* CIL Label */ - if (s == UNLOADED) { - + _L___2: /* CIL Label */ + if (pended == 1) { + if (s == MPR3) { + s = MPR3; + } else { + goto _L___1; + } } else { - if (status == -1L) { + _L___1: /* CIL Label */ + if (s == UNLOADED) { } else { - if (s != SKIP2) { - if (s != IPC) { - if (s != DC) { - { - errorFn(); + if (status == -1L) { + + } else { + if (s != SKIP2) { + if (s != IPC) { + if (s != DC) { + { errorFn(); } + } else { + goto _L___0; } } else { goto _L___0; } } else { - goto _L___0; - } - } else { - _L___0: /* CIL Label */ - if (pended == 1) { - if (status != 259L) { - status = 0; - } else { - - } - } else { - if (s == DC) { - if (status == 259L) { - { - errorFn(); - } + _L___0: /* CIL Label */ + if (pended == 1) { + if (status != 259L) { + status = 0; } else { - } } else { - if (status != (NTSTATUS )lowerDriverReturn) { - { - errorFn(); + if (s == DC) { + if (status == 259L) { + { errorFn(); } + } else { } } else { - + if (status != (NTSTATUS)lowerDriverReturn) { + { errorFn(); } + } else { + } } } } @@ -7212,1084 +7295,960 @@ int main(void) } } } + status = 0; + return (status); } - status = 0; - return (status); -} } -char _SLAM_alloc_dummy ; - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; -void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) -{ +char _SLAM_alloc_dummy; +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; -void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) -{ +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; -PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , SIZE_T NumberOfBytes , - ULONG Tag ) -{ PVOID x ; - char *tmp ; +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag) { + PVOID x; + char *tmp; { - { - tmp = malloc(NumberOfBytes); - x = tmp; + { + tmp = malloc(NumberOfBytes); + x = tmp; + } + return (x); } - return (x); -} } - void ExFreePool(PVOID P ) ; -void ExFreePool(PVOID P ) -{ +void ExFreePool(PVOID P); +void ExFreePool(PVOID P) { - { - return; -} + { return; } } - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; -PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , BOOLEAN SecondaryBuffer , - BOOLEAN ChargeQuota , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_191_0; - } else { - { - goto switch_191_default; - if (0) { - switch_191_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_191_0; + } else { { - tmp = & _SLAM_alloc_dummy; /* malloc(sizeof(MDL )); */ /* INLINED */ + goto switch_191_default; + if (0) { + switch_191_0 : /* CIL Label */ + { + tmp = &_SLAM_alloc_dummy; /* malloc(sizeof(MDL )); */ /* INLINED */ + } + return ((void *)tmp); + switch_191_default: /* CIL Label */; + return ((void *)0); + } else { + switch_191_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_191_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_191_break: /* CIL Label */ ; - } } } } -} - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; -PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , PDEVICE_OBJECT TargetDevice ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_192_0; - } else { - { - goto switch_192_default; - if (0) { - switch_192_0: /* CIL Label */ ; - return (TargetDevice); - switch_192_default: /* CIL Label */ ; - return ((void *)0); + if (__BLAST_NONDET == 0) { + goto switch_192_0; } else { - switch_192_break: /* CIL Label */ ; - } + { + goto switch_192_default; + if (0) { + switch_192_0: /* CIL Label */; + return (TargetDevice); + switch_192_default: /* CIL Label */; + return ((void *)0); + } else { + switch_192_break: /* CIL Label */; + } + } } } } -} - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , PDEVICE_OBJECT DeviceObject , - PVOID Buffer , ULONG Length , PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - customIrp = 1; - if (__BLAST_NONDET == 0) { - goto switch_193_0; - } else { - { - goto switch_193_default; - if (0) { - switch_193_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET == 0) { + goto switch_193_0; + } else { { - tmp = & _SLAM_alloc_dummy; /* malloc(sizeof(IRP )); */ /* INLINED */ + goto switch_193_default; + if (0) { + switch_193_0 : /* CIL Label */ + { + tmp = &_SLAM_alloc_dummy; /* malloc(sizeof(IRP )); */ /* INLINED */ + } + return ((void *)tmp); + switch_193_default: /* CIL Label */; + return ((void *)0); + } else { + switch_193_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_193_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_193_break: /* CIL Label */ ; - } } } } -} - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , BOOLEAN InternalDeviceIoControl , - PKEVENT Event , PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - customIrp = 1; - if (__BLAST_NONDET == 0) { - goto switch_194_0; - } else { - { - goto switch_194_default; - if (0) { - switch_194_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET == 0) { + goto switch_194_0; + } else { { - tmp = & _SLAM_alloc_dummy; /* malloc(sizeof(IRP )); */ /* INLINED */ + goto switch_194_default; + if (0) { + switch_194_0 : /* CIL Label */ + { + tmp = &_SLAM_alloc_dummy; /* malloc(sizeof(IRP )); */ /* INLINED */ + } + return ((void *)tmp); + switch_194_default: /* CIL Label */; + return ((void *)0); + } else { + switch_194_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_194_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_194_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; -NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_195_0; - } else { - { - goto switch_195_default; - if (0) { - switch_195_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_195_0; + } else { { - tmp = & _SLAM_alloc_dummy; /* malloc(sizeof(DEVICE_OBJECT )); */ /* INLINED */ - *DeviceObject = (void *)tmp; + goto switch_195_default; + if (0) { + switch_195_0 : /* CIL Label */ + { + tmp = &_SLAM_alloc_dummy; + /* malloc(sizeof(DEVICE_OBJECT )); */ /* INLINED */ + *DeviceObject = (void *)tmp; + } + return (0L); + switch_195_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_195_break: /* CIL Label */; + } } - return (0L); - switch_195_default: /* CIL Label */ ; - return (-1073741823L); - } else { - switch_195_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; -NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , PUNICODE_STRING DeviceName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_196_0; - } else { - { - goto switch_196_default; - if (0) { - switch_196_0: /* CIL Label */ ; - return (0L); - switch_196_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_196_0; } else { - switch_196_break: /* CIL Label */ ; - } + { + goto switch_196_default; + if (0) { + switch_196_0: /* CIL Label */; + return (0L); + switch_196_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_196_break: /* CIL Label */; + } + } } } } -} - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; -void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) -{ +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject) { - { - return; -} + { return; } } - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_197_0; - } else { - { - goto switch_197_default; - if (0) { - switch_197_0: /* CIL Label */ ; - return (0L); - switch_197_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_197_0; } else { - switch_197_break: /* CIL Label */ ; - } + { + goto switch_197_default; + if (0) { + switch_197_0: /* CIL Label */; + return (0L); + switch_197_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_197_break: /* CIL Label */; + } + } } } } -} - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; -void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) -{ +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice) { - { - return; -} + { return; } } - void IoFreeIrp(PIRP Irp ) ; -void IoFreeIrp(PIRP Irp ) -{ +void IoFreeIrp(PIRP Irp); +void IoFreeIrp(PIRP Irp) { - { - return; -} + { return; } } - void IoFreeMdl(PMDL Mdl ) ; -void IoFreeMdl(PMDL Mdl ) -{ +void IoFreeMdl(PMDL Mdl); +void IoFreeMdl(PMDL Mdl) { - { - return; -} + { return; } } - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; -PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) -{ char *tmp ; +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) { + char *tmp; { - { - tmp = & _SLAM_alloc_dummy; /* malloc(sizeof(CONFIGURATION_INFORMATION )); */ /* INLINED */ - } - return ((void *)tmp); -} -} - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; -NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , PULONG BusNumber , PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; + { + tmp = &_SLAM_alloc_dummy; + /* malloc(sizeof(CONFIGURATION_INFORMATION )); */ /* INLINED */ + } + return ((void *)tmp); + } +} +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_198_0; - } else { - { - goto switch_198_default; - if (0) { - switch_198_0: /* CIL Label */ ; - return (0L); - switch_198_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_198_0; } else { - switch_198_break: /* CIL Label */ ; - } + { + goto switch_198_default; + if (0) { + switch_198_0: /* CIL Label */; + return (0L); + switch_198_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_198_break: /* CIL Label */; + } + } } } } -} - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_199_0; - } else { - { - goto switch_199_default; - if (0) { - switch_199_0: /* CIL Label */ ; - return (0L); - switch_199_default: /* CIL Label */ ; - return (-1073741808L); + if (__BLAST_NONDET == 0) { + goto switch_199_0; } else { - switch_199_break: /* CIL Label */ ; - } + { + goto switch_199_default; + if (0) { + switch_199_0: /* CIL Label */; + return (0L); + switch_199_default: /* CIL Label */; + return (-1073741808L); + } else { + switch_199_break: /* CIL Label */; + } + } } } } -} - void IoReleaseCancelSpinLock(KIRQL Irql ) ; -void IoReleaseCancelSpinLock(KIRQL Irql ) -{ +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoReleaseCancelSpinLock(KIRQL Irql) { - { - return; -} + { return; } } - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , BOOLEAN Enable ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_200_0; - } else { - { - goto switch_200_default; - if (0) { - switch_200_0: /* CIL Label */ ; - return (0L); - switch_200_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_200_0; } else { - switch_200_break: /* CIL Label */ ; - } + { + goto switch_200_default; + if (0) { + switch_200_0: /* CIL Label */; + return (0L); + switch_200_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_200_break: /* CIL Label */; + } + } } } } -} - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; -void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) -{ +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject) { - { - return; -} + { return; } } -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { - if (s == NP) { - s = MPR1; - } else { - { - errorFn(); + if (s == NP) { + s = MPR1; + } else { + { errorFn(); } } + return; } - return; } -} - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - NTSTATUS returnVal2 ; - int compRetStatus1 ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + NTSTATUS returnVal2; + int compRetStatus1; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; { - if (compRegistered) { - { - tmp = FloppyPnpComplete(DeviceObject, Irp, lcontext); - compRetStatus1 = tmp; - } - if ((long )compRetStatus1 == -1073741802L) { + if (compRegistered) { { - stubMoreProcessingRequired(); + tmp = FloppyPnpComplete(DeviceObject, Irp, lcontext); + compRetStatus1 = tmp; + } + if ((long)compRetStatus1 == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET == 0) { - goto switch_201_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_201_1; + if (__BLAST_NONDET == 0) { + goto switch_201_0; } else { - { - goto switch_201_default; - if (0) { - switch_201_0: /* CIL Label */ - returnVal2 = 0L; - goto switch_201_break; - switch_201_1: /* CIL Label */ - returnVal2 = -1073741823L; - goto switch_201_break; - switch_201_default: /* CIL Label */ - returnVal2 = 259L; - goto switch_201_break; + if (__BLAST_NONDET == 1) { + goto switch_201_1; } else { - switch_201_break: /* CIL Label */ ; - } + { + goto switch_201_default; + if (0) { + switch_201_0: /* CIL Label */ + returnVal2 = 0L; + goto switch_201_break; + switch_201_1: /* CIL Label */ + returnVal2 = -1073741823L; + goto switch_201_break; + switch_201_default: /* CIL Label */ + returnVal2 = 259L; + goto switch_201_break; + } else { + switch_201_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal2; - } else { - if (s == MPR1) { - if (returnVal2 == 259L) { - s = MPR3; - lowerDriverReturn = returnVal2; - } else { - s = NP; - lowerDriverReturn = returnVal2; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal2; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal2; + if (s == MPR1) { + if (returnVal2 == 259L) { + s = MPR3; + lowerDriverReturn = returnVal2; + } else { + s = NP; + lowerDriverReturn = returnVal2; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal2; + } else { + { errorFn(); } } } } + return (returnVal2); } - return (returnVal2); -} } - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; -void IofCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) -{ +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost) { { - if (s == NP) { - s = DC; - } else { - { - errorFn(); + if (s == NP) { + s = DC; + } else { + { errorFn(); } } + return; } - return; } -} - KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ; -KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) -{ +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock); +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock) { - { - return ((unsigned char)0); + { return ((unsigned char)0); } } -} - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; -NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , BOOLEAN Alertable , PLARGE_INTEGER Interval ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_202_0; - } else { - { - goto switch_202_default; - if (0) { - switch_202_0: /* CIL Label */ ; - return (0L); - switch_202_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_202_0; } else { - switch_202_break: /* CIL Label */ ; - } + { + goto switch_202_default; + if (0) { + switch_202_0: /* CIL Label */; + return (0L); + switch_202_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_202_break: /* CIL Label */; + } + } } } } -} - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; -void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , BOOLEAN State ) -{ +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State) { - { - return; + { return; } } -} - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; -void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , LONG Count , LONG Limit ) -{ +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit) { - { - return; + { return; } } -} - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; -void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) -{ +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock) { - { - return; + { return; } } -} - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; -LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , LONG Adjustment , - BOOLEAN Wait ) -{ LONG r = __VERIFIER_nondet_long() ; +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait) { + LONG r = __VERIFIER_nondet_long(); - { - return (r); + { return (r); } } -} - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; -void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , KIRQL NewIrql ) -{ +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql) { - { - return; + { return; } } -} - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; -LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , BOOLEAN Wait ) -{ LONG l = __VERIFIER_nondet_long() ; +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait) { + LONG l = __VERIFIER_nondet_long(); { - setEventCalled = 1; - return (l); -} + setEventCalled = 1; + return (l); + } } - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; -NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , PLARGE_INTEGER Timeout ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (s == MPR3) { - if (setEventCalled == 1) { - s = NP; - setEventCalled = 0; - } else { - goto _L; - } - } else { - _L: /* CIL Label */ - if (customIrp == 1) { - s = NP; - customIrp = 0; + if (s == MPR3) { + if (setEventCalled == 1) { + s = NP; + setEventCalled = 0; + } else { + goto _L; + } } else { - if (s == MPR3) { - { - errorFn(); - } + _L: /* CIL Label */ + if (customIrp == 1) { + s = NP; + customIrp = 0; } else { - + if (s == MPR3) { + { errorFn(); } + } else { + } } } - } - if (__BLAST_NONDET == 0) { - goto switch_203_0; - } else { - { - goto switch_203_default; - if (0) { - switch_203_0: /* CIL Label */ ; - return (0L); - switch_203_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_203_0; } else { - switch_203_break: /* CIL Label */ ; - } + { + goto switch_203_default; + if (0) { + switch_203_0: /* CIL Label */; + return (0L); + switch_203_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_203_break: /* CIL Label */; + } + } } } } -} - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; -PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , PHYSICAL_ADDRESS HighestAcceptableAddress ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_204_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_204_1; + if (__BLAST_NONDET == 0) { + goto switch_204_0; } else { - if (0) { - switch_204_0: /* CIL Label */ + if (__BLAST_NONDET == 1) { + goto switch_204_1; + } else { + if (0) { + switch_204_0 : /* CIL Label */ { - tmp = & _SLAM_alloc_dummy; /* malloc(NumberOfBytes); */ /* INLINED */ + tmp = &_SLAM_alloc_dummy; /* malloc(NumberOfBytes); */ /* INLINED */ + } + return (tmp); + switch_204_1: /* CIL Label */; + return ((void *)0); + } else { + switch_204_break: /* CIL Label */; } - return (tmp); - switch_204_1: /* CIL Label */ ; - return ((void *)0); - } else { - switch_204_break: /* CIL Label */ ; } } + return ((void *)0); } - return ((void *)0); } -} - void MmFreeContiguousMemory(PVOID BaseAddress ) ; -void MmFreeContiguousMemory(PVOID BaseAddress ) -{ +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmFreeContiguousMemory(PVOID BaseAddress) { - { - return; + { return; } } -} - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; -PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , PVOID BaseAddress , - ULONG BugCheckOnFailure , MM_PAGE_PRIORITY Priority ) -{ +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority) { - { - return ((void *)0); + { return ((void *)0); } } -} - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; -PVOID MmPageEntireDriver(PVOID AddressWithinSection ) -{ +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection) { - { - return ((void *)0); + { return ((void *)0); } } -} - void MmResetDriverPaging(PVOID AddressWithinSection ) ; -void MmResetDriverPaging(PVOID AddressWithinSection ) -{ +void MmResetDriverPaging(PVOID AddressWithinSection); +void MmResetDriverPaging(PVOID AddressWithinSection) { - { - return; + { return; } } -} - void MmUnlockPages(PMDL MemoryDescriptorList ) ; -void MmUnlockPages(PMDL MemoryDescriptorList ) -{ +void MmUnlockPages(PMDL MemoryDescriptorList); +void MmUnlockPages(PMDL MemoryDescriptorList) { - { - return; + { return; } } -} - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; -NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , ACCESS_MASK DesiredAccess , POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , PVOID *Object , POBJECT_HANDLE_INFORMATION HandleInformation ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_205_0; - } else { - { - goto switch_205_default; - if (0) { - switch_205_0: /* CIL Label */ ; - return (0L); - switch_205_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_205_0; } else { - switch_205_break: /* CIL Label */ ; - } + { + goto switch_205_default; + if (0) { + switch_205_0: /* CIL Label */; + return (0L); + switch_205_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_205_break: /* CIL Label */; + } + } } } } -} - void ObfDereferenceObject(PVOID Object ) ; -void ObfDereferenceObject(PVOID Object ) -{ +void ObfDereferenceObject(PVOID Object); +void ObfDereferenceObject(PVOID Object) { - { - return; + { return; } } -} - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - int compRetStatus ; - NTSTATUS returnVal ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + int compRetStatus; + NTSTATUS returnVal; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; { - if (compRegistered) { - { - tmp = FloppyPnpComplete(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - if ((long )compRetStatus == -1073741802L) { + if (compRegistered) { { - stubMoreProcessingRequired(); + tmp = FloppyPnpComplete(DeviceObject, Irp, lcontext); + compRetStatus = tmp; + } + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET == 0) { - goto switch_206_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_206_1; + if (__BLAST_NONDET == 0) { + goto switch_206_0; } else { - { - goto switch_206_default; - if (0) { - switch_206_0: /* CIL Label */ - returnVal = 0L; - goto switch_206_break; - switch_206_1: /* CIL Label */ - returnVal = -1073741823L; - goto switch_206_break; - switch_206_default: /* CIL Label */ - returnVal = 259L; - goto switch_206_break; + if (__BLAST_NONDET == 1) { + goto switch_206_1; } else { - switch_206_break: /* CIL Label */ ; - } + { + goto switch_206_default; + if (0) { + switch_206_0: /* CIL Label */ + returnVal = 0L; + goto switch_206_break; + switch_206_1: /* CIL Label */ + returnVal = -1073741823L; + goto switch_206_break; + switch_206_default: /* CIL Label */ + returnVal = 259L; + goto switch_206_break; + } else { + switch_206_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal; - } else { - if (s == MPR1) { - if (returnVal == 259L) { - s = MPR3; - lowerDriverReturn = returnVal; - } else { - s = NP; - lowerDriverReturn = returnVal; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal; + if (s == MPR1) { + if (returnVal == 259L) { + s = MPR3; + lowerDriverReturn = returnVal; + } else { + s = NP; + lowerDriverReturn = returnVal; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal; + } else { + { errorFn(); } } } } + return (returnVal); } - return (returnVal); -} } - void PoStartNextPowerIrp(PIRP Irp ) ; -void PoStartNextPowerIrp(PIRP Irp ) -{ +void PoStartNextPowerIrp(PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp) { - { - return; -} + { return; } } - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; -NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , ULONG DesiredAccess , POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , PCLIENT_ID ClientId , void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_207_0; - } else { - { - goto switch_207_default; - if (0) { - switch_207_0: /* CIL Label */ ; - return (0L); - switch_207_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_207_0; } else { - switch_207_break: /* CIL Label */ ; - } + { + goto switch_207_default; + if (0) { + switch_207_0: /* CIL Label */; + return (0L); + switch_207_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_207_break: /* CIL Label */; + } + } } } } -} - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_208_0; - } else { - { - goto switch_208_default; - if (0) { - switch_208_0: /* CIL Label */ ; - return (0L); - switch_208_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_208_0; } else { - switch_208_break: /* CIL Label */ ; - } + { + goto switch_208_default; + if (0) { + switch_208_0: /* CIL Label */; + return (0L); + switch_208_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_208_break: /* CIL Label */; + } + } } } } -} - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; -NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_209_0; - } else { - { - goto switch_209_default; - if (0) { - switch_209_0: /* CIL Label */ ; - return (0L); - switch_209_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_209_0; } else { - switch_209_break: /* CIL Label */ ; - } + { + goto switch_209_default; + if (0) { + switch_209_0: /* CIL Label */; + return (0L); + switch_209_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_209_break: /* CIL Label */; + } + } } } } -} - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; -SIZE_T RtlCompareMemory(void const *Source1 , void const *Source2 , - SIZE_T Length ) -{ SIZE_T r = __VERIFIER_nondet_long() ; +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length) { + SIZE_T r = __VERIFIER_nondet_long(); - { - return (r); -} + { return (r); } } - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; -void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) -{ +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString) { - { - return; -} + { return; } } - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; -NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , PCWSTR ValueName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_210_0; - } else { - { - goto switch_210_default; - if (0) { - switch_210_0: /* CIL Label */ ; - return (0L); - switch_210_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_210_0; } else { - switch_210_break: /* CIL Label */ ; - } + { + goto switch_210_default; + if (0) { + switch_210_0: /* CIL Label */; + return (0L); + switch_210_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_210_break: /* CIL Label */; + } + } } } } -} - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; -void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) -{ +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString) { - { - return; -} + { return; } } - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; -void RtlInitString(PSTRING DestinationString , PCSZ SourceString ) -{ +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString) { - { - return; -} + { return; } } - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; -void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) -{ +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString) { - { - return; -} + { return; } } - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; -NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , PVOID Environment ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_211_0; - } else { - { - goto switch_211_default; - if (0) { - switch_211_0: /* CIL Label */ ; - return (0L); - switch_211_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_211_0; } else { - switch_211_break: /* CIL Label */ ; - } + { + goto switch_211_default; + if (0) { + switch_211_0: /* CIL Label */; + return (0L); + switch_211_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_211_break: /* CIL Label */; + } + } } } } -} - NTSTATUS ZwClose(HANDLE Handle ) ; -NTSTATUS ZwClose(HANDLE Handle ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS ZwClose(HANDLE Handle); +NTSTATUS ZwClose(HANDLE Handle) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_212_0; - } else { - { - goto switch_212_default; - if (0) { - switch_212_0: /* CIL Label */ ; - return (0L); - switch_212_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_212_0; } else { - switch_212_break: /* CIL Label */ ; - } + { + goto switch_212_default; + if (0) { + switch_212_0: /* CIL Label */; + return (0L); + switch_212_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_212_break: /* CIL Label */; + } + } } } } -} diff --git a/test/ntdrivers/kbfiltr_false.i.cil.c b/test/ntdrivers/kbfiltr_false.i.cil.c index 04fcabea6..f2adaad6f 100644 --- a/test/ntdrivers/kbfiltr_false.i.cil.c +++ b/test/ntdrivers/kbfiltr_false.i.cil.c @@ -9,7 +9,7 @@ extern void *__VERIFIER_nondet_pointer(void); /* Generated by CIL v. 1.3.6 */ /* print_CIL_Input is true */ -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) typedef unsigned short wchar_t; typedef unsigned long ULONG_PTR; @@ -21,7 +21,7 @@ typedef short SHORT; typedef long LONG; typedef wchar_t WCHAR; typedef WCHAR *PWSTR; -typedef WCHAR const *PCWSTR; +typedef WCHAR const *PCWSTR; typedef CHAR *PCHAR; typedef LONG *PLONG; typedef unsigned char UCHAR; @@ -37,70 +37,67 @@ typedef ULONG LCID; typedef LONG NTSTATUS; typedef long long LONGLONG; struct __anonstruct____missing_field_name_1 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; struct __anonstruct_u_2 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; union _LARGE_INTEGER { - struct __anonstruct____missing_field_name_1 __annonCompField1 ; - struct __anonstruct_u_2 u ; - LONGLONG QuadPart ; + struct __anonstruct____missing_field_name_1 __annonCompField1; + struct __anonstruct_u_2 u; + LONGLONG QuadPart; }; typedef union _LARGE_INTEGER LARGE_INTEGER; typedef LARGE_INTEGER *PLARGE_INTEGER; struct _LUID { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; typedef struct _LUID LUID; typedef LARGE_INTEGER PHYSICAL_ADDRESS; -enum _EVENT_TYPE { - NotificationEvent = 0, - SynchronizationEvent = 1 -} ; +enum _EVENT_TYPE { NotificationEvent = 0, SynchronizationEvent = 1 }; typedef enum _EVENT_TYPE EVENT_TYPE; -typedef char const *PCSZ; +typedef char const *PCSZ; struct _STRING { - USHORT Length ; - USHORT MaximumLength ; - PCHAR Buffer ; + USHORT Length; + USHORT MaximumLength; + PCHAR Buffer; }; typedef struct _STRING STRING; typedef STRING *PSTRING; typedef PSTRING PANSI_STRING; struct _UNICODE_STRING { - USHORT Length ; - USHORT MaximumLength ; - PWSTR Buffer ; + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; }; typedef struct _UNICODE_STRING UNICODE_STRING; typedef UNICODE_STRING *PUNICODE_STRING; typedef UCHAR BOOLEAN; typedef BOOLEAN *PBOOLEAN; struct _LIST_ENTRY { - struct _LIST_ENTRY *Flink ; - struct _LIST_ENTRY *Blink ; + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; }; typedef struct _LIST_ENTRY LIST_ENTRY; typedef struct _LIST_ENTRY *PLIST_ENTRY; struct _OBJECT_ATTRIBUTES { - ULONG Length ; - HANDLE RootDirectory ; - PUNICODE_STRING ObjectName ; - ULONG Attributes ; - PVOID SecurityDescriptor ; - PVOID SecurityQualityOfService ; + ULONG Length; + HANDLE RootDirectory; + PUNICODE_STRING ObjectName; + ULONG Attributes; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; }; typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES; typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; struct _GUID { - unsigned long Data1 ; - unsigned short Data2 ; - unsigned short Data3 ; - unsigned char Data4[8] ; + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; }; typedef struct _GUID GUID; typedef unsigned int size_t; @@ -118,82 +115,85 @@ typedef struct _OBJECT_TYPE *POBJECT_TYPE; typedef CCHAR KPROCESSOR_MODE; struct _KAPC; struct _KAPC; -typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ); +typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); struct _KAPC { - CSHORT Type ; - CSHORT Size ; - ULONG Spare0 ; - struct _KTHREAD *Thread ; - LIST_ENTRY ApcListEntry ; - void (*KernelRoutine)(struct _KAPC *Apc , PKNORMAL_ROUTINE *NormalRoutine , PVOID *NormalContext , - PVOID *SystemArgument1 , PVOID *SystemArgument2 ) ; - void (*RundownRoutine)(struct _KAPC *Apc ) ; - void (*NormalRoutine)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ) ; - PVOID NormalContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - CCHAR ApcStateIndex ; - KPROCESSOR_MODE ApcMode ; - BOOLEAN Inserted ; + CSHORT Type; + CSHORT Size; + ULONG Spare0; + struct _KTHREAD *Thread; + LIST_ENTRY ApcListEntry; + void (*KernelRoutine)(struct _KAPC *Apc, PKNORMAL_ROUTINE *NormalRoutine, + PVOID *NormalContext, PVOID *SystemArgument1, + PVOID *SystemArgument2); + void (*RundownRoutine)(struct _KAPC *Apc); + void (*NormalRoutine)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); + PVOID NormalContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + CCHAR ApcStateIndex; + KPROCESSOR_MODE ApcMode; + BOOLEAN Inserted; }; typedef struct _KAPC KAPC; struct _KDPC; struct _KDPC; struct _KDPC { - CSHORT Type ; - UCHAR Number ; - UCHAR Importance ; - LIST_ENTRY DpcListEntry ; - void (*DeferredRoutine)(struct _KDPC *Dpc , PVOID DeferredContext , PVOID SystemArgument1 , - PVOID SystemArgument2 ) ; - PVOID DeferredContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - PULONG_PTR Lock ; + CSHORT Type; + UCHAR Number; + UCHAR Importance; + LIST_ENTRY DpcListEntry; + void (*DeferredRoutine)(struct _KDPC *Dpc, PVOID DeferredContext, + PVOID SystemArgument1, PVOID SystemArgument2); + PVOID DeferredContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + PULONG_PTR Lock; }; typedef struct _KDPC KDPC; typedef struct _KDPC *PKDPC; struct _MDL { - struct _MDL *Next ; - CSHORT Size ; - CSHORT MdlFlags ; - struct _EPROCESS *Process ; - PVOID MappedSystemVa ; - PVOID StartVa ; - ULONG ByteCount ; - ULONG ByteOffset ; + struct _MDL *Next; + CSHORT Size; + CSHORT MdlFlags; + struct _EPROCESS *Process; + PVOID MappedSystemVa; + PVOID StartVa; + ULONG ByteCount; + ULONG ByteOffset; }; typedef struct _MDL MDL; typedef struct _MDL *PMDL; typedef PVOID PACCESS_TOKEN; typedef PVOID PSECURITY_DESCRIPTOR; typedef ULONG ACCESS_MASK; -#pragma pack(push,4) +#pragma pack(push, 4) struct _LUID_AND_ATTRIBUTES { - LUID Luid ; - ULONG Attributes ; + LUID Luid; + ULONG Attributes; }; typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES; #pragma pack(pop) struct _PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[1] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[1]; }; typedef struct _PRIVILEGE_SET PRIVILEGE_SET; enum _SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous = 0, - SecurityIdentification = 1, - SecurityImpersonation = 2, - SecurityDelegation = 3 -} ; + SecurityAnonymous = 0, + SecurityIdentification = 1, + SecurityImpersonation = 2, + SecurityDelegation = 3 +}; typedef enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL; typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE; struct _SECURITY_QUALITY_OF_SERVICE { - ULONG Length ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode ; - BOOLEAN EffectiveOnly ; + ULONG Length; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; + BOOLEAN EffectiveOnly; }; typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE; typedef ULONG SECURITY_INFORMATION; @@ -201,580 +201,577 @@ typedef LONG KPRIORITY; typedef ULONG_PTR KSPIN_LOCK; typedef KSPIN_LOCK *PKSPIN_LOCK; struct _RTL_QUERY_REGISTRY_TABLE { - NTSTATUS (*QueryRoutine)(PWSTR ValueName , ULONG ValueType , - PVOID ValueData , ULONG ValueLength , - PVOID Context , PVOID EntryContext ) ; - ULONG Flags ; - PWSTR Name ; - PVOID EntryContext ; - ULONG DefaultType ; - PVOID DefaultData ; - ULONG DefaultLength ; + NTSTATUS(*QueryRoutine) + (PWSTR ValueName, ULONG ValueType, PVOID ValueData, ULONG ValueLength, + PVOID Context, PVOID EntryContext); + ULONG Flags; + PWSTR Name; + PVOID EntryContext; + ULONG DefaultType; + PVOID DefaultData; + ULONG DefaultLength; }; typedef struct _RTL_QUERY_REGISTRY_TABLE *PRTL_QUERY_REGISTRY_TABLE; union __anonunion____missing_field_name_6 { - NTSTATUS Status ; - PVOID Pointer ; + NTSTATUS Status; + PVOID Pointer; }; struct _IO_STATUS_BLOCK { - union __anonunion____missing_field_name_6 __annonCompField4 ; - ULONG_PTR Information ; + union __anonunion____missing_field_name_6 __annonCompField4; + ULONG_PTR Information; }; typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK; typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK; enum _FILE_INFORMATION_CLASS { - FileDirectoryInformation = 1, - FileFullDirectoryInformation = 2, - FileBothDirectoryInformation = 3, - FileBasicInformation = 4, - FileStandardInformation = 5, - FileInternalInformation = 6, - FileEaInformation = 7, - FileAccessInformation = 8, - FileNameInformation = 9, - FileRenameInformation = 10, - FileLinkInformation = 11, - FileNamesInformation = 12, - FileDispositionInformation = 13, - FilePositionInformation = 14, - FileFullEaInformation = 15, - FileModeInformation = 16, - FileAlignmentInformation = 17, - FileAllInformation = 18, - FileAllocationInformation = 19, - FileEndOfFileInformation = 20, - FileAlternateNameInformation = 21, - FileStreamInformation = 22, - FilePipeInformation = 23, - FilePipeLocalInformation = 24, - FilePipeRemoteInformation = 25, - FileMailslotQueryInformation = 26, - FileMailslotSetInformation = 27, - FileCompressionInformation = 28, - FileObjectIdInformation = 29, - FileCompletionInformation = 30, - FileMoveClusterInformation = 31, - FileQuotaInformation = 32, - FileReparsePointInformation = 33, - FileNetworkOpenInformation = 34, - FileAttributeTagInformation = 35, - FileTrackingInformation = 36, - FileMaximumInformation = 37 -} ; + FileDirectoryInformation = 1, + FileFullDirectoryInformation = 2, + FileBothDirectoryInformation = 3, + FileBasicInformation = 4, + FileStandardInformation = 5, + FileInternalInformation = 6, + FileEaInformation = 7, + FileAccessInformation = 8, + FileNameInformation = 9, + FileRenameInformation = 10, + FileLinkInformation = 11, + FileNamesInformation = 12, + FileDispositionInformation = 13, + FilePositionInformation = 14, + FileFullEaInformation = 15, + FileModeInformation = 16, + FileAlignmentInformation = 17, + FileAllInformation = 18, + FileAllocationInformation = 19, + FileEndOfFileInformation = 20, + FileAlternateNameInformation = 21, + FileStreamInformation = 22, + FilePipeInformation = 23, + FilePipeLocalInformation = 24, + FilePipeRemoteInformation = 25, + FileMailslotQueryInformation = 26, + FileMailslotSetInformation = 27, + FileCompressionInformation = 28, + FileObjectIdInformation = 29, + FileCompletionInformation = 30, + FileMoveClusterInformation = 31, + FileQuotaInformation = 32, + FileReparsePointInformation = 33, + FileNetworkOpenInformation = 34, + FileAttributeTagInformation = 35, + FileTrackingInformation = 36, + FileMaximumInformation = 37 +}; typedef enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS; struct _FILE_BASIC_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + ULONG FileAttributes; }; typedef struct _FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION; struct _FILE_STANDARD_INFORMATION { - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG NumberOfLinks ; - BOOLEAN DeletePending ; - BOOLEAN Directory ; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG NumberOfLinks; + BOOLEAN DeletePending; + BOOLEAN Directory; }; typedef struct _FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION; struct _FILE_NETWORK_OPEN_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG FileAttributes; }; typedef struct _FILE_NETWORK_OPEN_INFORMATION *PFILE_NETWORK_OPEN_INFORMATION; enum _FSINFOCLASS { - FileFsVolumeInformation = 1, - FileFsLabelInformation = 2, - FileFsSizeInformation = 3, - FileFsDeviceInformation = 4, - FileFsAttributeInformation = 5, - FileFsControlInformation = 6, - FileFsFullSizeInformation = 7, - FileFsObjectIdInformation = 8, - FileFsMaximumInformation = 9 -} ; + FileFsVolumeInformation = 1, + FileFsLabelInformation = 2, + FileFsSizeInformation = 3, + FileFsDeviceInformation = 4, + FileFsAttributeInformation = 5, + FileFsControlInformation = 6, + FileFsFullSizeInformation = 7, + FileFsObjectIdInformation = 8, + FileFsMaximumInformation = 9 +}; typedef enum _FSINFOCLASS FS_INFORMATION_CLASS; enum _INTERFACE_TYPE { - InterfaceTypeUndefined = -1, - Internal = 0, - Isa = 1, - Eisa = 2, - MicroChannel = 3, - TurboChannel = 4, - PCIBus = 5, - VMEBus = 6, - NuBus = 7, - PCMCIABus = 8, - CBus = 9, - MPIBus = 10, - MPSABus = 11, - ProcessorInternal = 12, - InternalPowerBus = 13, - PNPISABus = 14, - PNPBus = 15, - MaximumInterfaceType = 16 -} ; + InterfaceTypeUndefined = -1, + Internal = 0, + Isa = 1, + Eisa = 2, + MicroChannel = 3, + TurboChannel = 4, + PCIBus = 5, + VMEBus = 6, + NuBus = 7, + PCMCIABus = 8, + CBus = 9, + MPIBus = 10, + MPSABus = 11, + ProcessorInternal = 12, + InternalPowerBus = 13, + PNPISABus = 14, + PNPBus = 15, + MaximumInterfaceType = 16 +}; typedef enum _INTERFACE_TYPE INTERFACE_TYPE; typedef enum _INTERFACE_TYPE *PINTERFACE_TYPE; struct _IO_ERROR_LOG_PACKET { - UCHAR MajorFunctionCode ; - UCHAR RetryCount ; - USHORT DumpDataSize ; - USHORT NumberOfStrings ; - USHORT StringOffset ; - USHORT EventCategory ; - NTSTATUS ErrorCode ; - ULONG UniqueErrorValue ; - NTSTATUS FinalStatus ; - ULONG SequenceNumber ; - ULONG IoControlCode ; - LARGE_INTEGER DeviceOffset ; - ULONG DumpData[1] ; + UCHAR MajorFunctionCode; + UCHAR RetryCount; + USHORT DumpDataSize; + USHORT NumberOfStrings; + USHORT StringOffset; + USHORT EventCategory; + NTSTATUS ErrorCode; + ULONG UniqueErrorValue; + NTSTATUS FinalStatus; + ULONG SequenceNumber; + ULONG IoControlCode; + LARGE_INTEGER DeviceOffset; + ULONG DumpData[1]; }; typedef struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET; struct _KEY_VALUE_FULL_INFORMATION { - ULONG TitleIndex ; - ULONG Type ; - ULONG DataOffset ; - ULONG DataLength ; - ULONG NameLength ; - WCHAR Name[1] ; + ULONG TitleIndex; + ULONG Type; + ULONG DataOffset; + ULONG DataLength; + ULONG NameLength; + WCHAR Name[1]; }; typedef struct _KEY_VALUE_FULL_INFORMATION *PKEY_VALUE_FULL_INFORMATION; struct _CLIENT_ID { - HANDLE UniqueProcess ; - HANDLE UniqueThread ; + HANDLE UniqueProcess; + HANDLE UniqueThread; }; typedef struct _CLIENT_ID CLIENT_ID; typedef CLIENT_ID *PCLIENT_ID; enum _SYSTEM_POWER_STATE { - PowerSystemUnspecified = 0, - PowerSystemWorking = 1, - PowerSystemSleeping1 = 2, - PowerSystemSleeping2 = 3, - PowerSystemSleeping3 = 4, - PowerSystemHibernate = 5, - PowerSystemShutdown = 6, - PowerSystemMaximum = 7 -} ; + PowerSystemUnspecified = 0, + PowerSystemWorking = 1, + PowerSystemSleeping1 = 2, + PowerSystemSleeping2 = 3, + PowerSystemSleeping3 = 4, + PowerSystemHibernate = 5, + PowerSystemShutdown = 6, + PowerSystemMaximum = 7 +}; typedef enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE; enum __anonenum_POWER_ACTION_11 { - PowerActionNone = 0, - PowerActionReserved = 1, - PowerActionSleep = 2, - PowerActionHibernate = 3, - PowerActionShutdown = 4, - PowerActionShutdownReset = 5, - PowerActionShutdownOff = 6, - PowerActionWarmEject = 7 -} ; + PowerActionNone = 0, + PowerActionReserved = 1, + PowerActionSleep = 2, + PowerActionHibernate = 3, + PowerActionShutdown = 4, + PowerActionShutdownReset = 5, + PowerActionShutdownOff = 6, + PowerActionWarmEject = 7 +}; typedef enum __anonenum_POWER_ACTION_11 POWER_ACTION; enum _DEVICE_POWER_STATE { - PowerDeviceUnspecified = 0, - PowerDeviceD0 = 1, - PowerDeviceD1 = 2, - PowerDeviceD2 = 3, - PowerDeviceD3 = 4, - PowerDeviceMaximum = 5 -} ; + PowerDeviceUnspecified = 0, + PowerDeviceD0 = 1, + PowerDeviceD1 = 2, + PowerDeviceD2 = 3, + PowerDeviceD3 = 4, + PowerDeviceMaximum = 5 +}; typedef enum _DEVICE_POWER_STATE DEVICE_POWER_STATE; union _POWER_STATE { - SYSTEM_POWER_STATE SystemState ; - DEVICE_POWER_STATE DeviceState ; + SYSTEM_POWER_STATE SystemState; + DEVICE_POWER_STATE DeviceState; }; typedef union _POWER_STATE POWER_STATE; -enum _POWER_STATE_TYPE { - SystemPowerState = 0, - DevicePowerState = 1 -} ; +enum _POWER_STATE_TYPE { SystemPowerState = 0, DevicePowerState = 1 }; typedef enum _POWER_STATE_TYPE POWER_STATE_TYPE; typedef PVOID PASSIGNED_RESOURCE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Generic_16 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Port_17 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Interrupt_18 { - ULONG Level ; - ULONG Vector ; - ULONG Affinity ; + ULONG Level; + ULONG Vector; + ULONG Affinity; }; struct __anonstruct_Memory_19 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Dma_20 { - ULONG Channel ; - ULONG Port ; - ULONG Reserved1 ; + ULONG Channel; + ULONG Port; + ULONG Reserved1; }; struct __anonstruct_DevicePrivate_21 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_22 { - ULONG Start ; - ULONG Length ; - ULONG Reserved ; + ULONG Start; + ULONG Length; + ULONG Reserved; }; struct __anonstruct_DeviceSpecificData_23 { - ULONG DataSize ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG DataSize; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_15 { - struct __anonstruct_Generic_16 Generic ; - struct __anonstruct_Port_17 Port ; - struct __anonstruct_Interrupt_18 Interrupt ; - struct __anonstruct_Memory_19 Memory ; - struct __anonstruct_Dma_20 Dma ; - struct __anonstruct_DevicePrivate_21 DevicePrivate ; - struct __anonstruct_BusNumber_22 BusNumber ; - struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData ; + struct __anonstruct_Generic_16 Generic; + struct __anonstruct_Port_17 Port; + struct __anonstruct_Interrupt_18 Interrupt; + struct __anonstruct_Memory_19 Memory; + struct __anonstruct_Dma_20 Dma; + struct __anonstruct_DevicePrivate_21 DevicePrivate; + struct __anonstruct_BusNumber_22 BusNumber; + struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData; }; struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { - UCHAR Type ; - UCHAR ShareDisposition ; - USHORT Flags ; - union __anonunion_u_15 u ; + UCHAR Type; + UCHAR ShareDisposition; + USHORT Flags; + union __anonunion_u_15 u; }; typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR; #pragma pack(pop) struct _CM_PARTIAL_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; }; typedef struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST; struct _CM_FULL_RESOURCE_DESCRIPTOR { - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - CM_PARTIAL_RESOURCE_LIST PartialResourceList ; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; }; typedef struct _CM_FULL_RESOURCE_DESCRIPTOR CM_FULL_RESOURCE_DESCRIPTOR; struct _CM_RESOURCE_LIST { - ULONG Count ; - CM_FULL_RESOURCE_DESCRIPTOR List[1] ; + ULONG Count; + CM_FULL_RESOURCE_DESCRIPTOR List[1]; }; typedef struct _CM_RESOURCE_LIST *PCM_RESOURCE_LIST; -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct __anonstruct_Port_25 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Memory_26 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Interrupt_27 { - ULONG MinimumVector ; - ULONG MaximumVector ; + ULONG MinimumVector; + ULONG MaximumVector; }; struct __anonstruct_Dma_28 { - ULONG MinimumChannel ; - ULONG MaximumChannel ; + ULONG MinimumChannel; + ULONG MaximumChannel; }; struct __anonstruct_Generic_29 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_DevicePrivate_30 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_31 { - ULONG Length ; - ULONG MinBusNumber ; - ULONG MaxBusNumber ; - ULONG Reserved ; + ULONG Length; + ULONG MinBusNumber; + ULONG MaxBusNumber; + ULONG Reserved; }; struct __anonstruct_AssignedResource_32 { - PASSIGNED_RESOURCE AssignedResource ; + PASSIGNED_RESOURCE AssignedResource; }; struct __anonstruct_SubAllocateFrom_33 { - UCHAR Type ; - UCHAR Reserved[3] ; - PASSIGNED_RESOURCE AssignedResource ; - PHYSICAL_ADDRESS Transformation ; + UCHAR Type; + UCHAR Reserved[3]; + PASSIGNED_RESOURCE AssignedResource; + PHYSICAL_ADDRESS Transformation; }; struct __anonstruct_ConfigData_34 { - ULONG Priority ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG Priority; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_24 { - struct __anonstruct_Port_25 Port ; - struct __anonstruct_Memory_26 Memory ; - struct __anonstruct_Interrupt_27 Interrupt ; - struct __anonstruct_Dma_28 Dma ; - struct __anonstruct_Generic_29 Generic ; - struct __anonstruct_DevicePrivate_30 DevicePrivate ; - struct __anonstruct_BusNumber_31 BusNumber ; - struct __anonstruct_AssignedResource_32 AssignedResource ; - struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom ; - struct __anonstruct_ConfigData_34 ConfigData ; + struct __anonstruct_Port_25 Port; + struct __anonstruct_Memory_26 Memory; + struct __anonstruct_Interrupt_27 Interrupt; + struct __anonstruct_Dma_28 Dma; + struct __anonstruct_Generic_29 Generic; + struct __anonstruct_DevicePrivate_30 DevicePrivate; + struct __anonstruct_BusNumber_31 BusNumber; + struct __anonstruct_AssignedResource_32 AssignedResource; + struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom; + struct __anonstruct_ConfigData_34 ConfigData; }; struct _IO_RESOURCE_DESCRIPTOR { - UCHAR Option ; - UCHAR Type ; - UCHAR ShareDisposition ; - UCHAR Spare1 ; - USHORT Flags ; - USHORT Spare2 ; - union __anonunion_u_24 u ; + UCHAR Option; + UCHAR Type; + UCHAR ShareDisposition; + UCHAR Spare1; + USHORT Flags; + USHORT Spare2; + union __anonunion_u_24 u; }; typedef struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR; struct _IO_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - IO_RESOURCE_DESCRIPTOR Descriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + IO_RESOURCE_DESCRIPTOR Descriptors[1]; }; typedef struct _IO_RESOURCE_LIST IO_RESOURCE_LIST; struct _IO_RESOURCE_REQUIREMENTS_LIST { - ULONG ListSize ; - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - ULONG SlotNumber ; - ULONG Reserved[3] ; - ULONG AlternativeLists ; - IO_RESOURCE_LIST List[1] ; + ULONG ListSize; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + ULONG SlotNumber; + ULONG Reserved[3]; + ULONG AlternativeLists; + IO_RESOURCE_LIST List[1]; }; typedef struct _IO_RESOURCE_REQUIREMENTS_LIST *PIO_RESOURCE_REQUIREMENTS_LIST; enum _CONFIGURATION_TYPE { - ArcSystem = 0, - CentralProcessor = 1, - FloatingPointProcessor = 2, - PrimaryIcache = 3, - PrimaryDcache = 4, - SecondaryIcache = 5, - SecondaryDcache = 6, - SecondaryCache = 7, - EisaAdapter = 8, - TcAdapter = 9, - ScsiAdapter = 10, - DtiAdapter = 11, - MultiFunctionAdapter = 12, - DiskController = 13, - TapeController = 14, - CdromController = 15, - WormController = 16, - SerialController = 17, - NetworkController = 18, - DisplayController = 19, - ParallelController = 20, - PointerController = 21, - KeyboardController = 22, - AudioController = 23, - OtherController = 24, - DiskPeripheral = 25, - FloppyDiskPeripheral = 26, - TapePeripheral = 27, - ModemPeripheral = 28, - MonitorPeripheral = 29, - PrinterPeripheral = 30, - PointerPeripheral = 31, - KeyboardPeripheral = 32, - TerminalPeripheral = 33, - OtherPeripheral = 34, - LinePeripheral = 35, - NetworkPeripheral = 36, - SystemMemory = 37, - DockingInformation = 38, - RealModeIrqRoutingTable = 39, - MaximumType = 40 -} ; + ArcSystem = 0, + CentralProcessor = 1, + FloatingPointProcessor = 2, + PrimaryIcache = 3, + PrimaryDcache = 4, + SecondaryIcache = 5, + SecondaryDcache = 6, + SecondaryCache = 7, + EisaAdapter = 8, + TcAdapter = 9, + ScsiAdapter = 10, + DtiAdapter = 11, + MultiFunctionAdapter = 12, + DiskController = 13, + TapeController = 14, + CdromController = 15, + WormController = 16, + SerialController = 17, + NetworkController = 18, + DisplayController = 19, + ParallelController = 20, + PointerController = 21, + KeyboardController = 22, + AudioController = 23, + OtherController = 24, + DiskPeripheral = 25, + FloppyDiskPeripheral = 26, + TapePeripheral = 27, + ModemPeripheral = 28, + MonitorPeripheral = 29, + PrinterPeripheral = 30, + PointerPeripheral = 31, + KeyboardPeripheral = 32, + TerminalPeripheral = 33, + OtherPeripheral = 34, + LinePeripheral = 35, + NetworkPeripheral = 36, + SystemMemory = 37, + DockingInformation = 38, + RealModeIrqRoutingTable = 39, + MaximumType = 40 +}; typedef enum _CONFIGURATION_TYPE CONFIGURATION_TYPE; typedef enum _CONFIGURATION_TYPE *PCONFIGURATION_TYPE; enum _KWAIT_REASON { - Executive = 0, - FreePage = 1, - PageIn = 2, - PoolAllocation = 3, - DelayExecution = 4, - Suspended = 5, - UserRequest = 6, - WrExecutive = 7, - WrFreePage = 8, - WrPageIn = 9, - WrPoolAllocation = 10, - WrDelayExecution = 11, - WrSuspended = 12, - WrUserRequest = 13, - WrEventPair = 14, - WrQueue = 15, - WrLpcReceive = 16, - WrLpcReply = 17, - WrVirtualMemory = 18, - WrPageOut = 19, - WrRendezvous = 20, - Spare2 = 21, - Spare3 = 22, - Spare4 = 23, - Spare5 = 24, - Spare6 = 25, - WrKernel = 26, - MaximumWaitReason = 27 -} ; + Executive = 0, + FreePage = 1, + PageIn = 2, + PoolAllocation = 3, + DelayExecution = 4, + Suspended = 5, + UserRequest = 6, + WrExecutive = 7, + WrFreePage = 8, + WrPageIn = 9, + WrPoolAllocation = 10, + WrDelayExecution = 11, + WrSuspended = 12, + WrUserRequest = 13, + WrEventPair = 14, + WrQueue = 15, + WrLpcReceive = 16, + WrLpcReply = 17, + WrVirtualMemory = 18, + WrPageOut = 19, + WrRendezvous = 20, + Spare2 = 21, + Spare3 = 22, + Spare4 = 23, + Spare5 = 24, + Spare6 = 25, + WrKernel = 26, + MaximumWaitReason = 27 +}; typedef enum _KWAIT_REASON KWAIT_REASON; struct _DISPATCHER_HEADER { - UCHAR Type ; - UCHAR Absolute ; - UCHAR Size ; - UCHAR Inserted ; - LONG SignalState ; - LIST_ENTRY WaitListHead ; + UCHAR Type; + UCHAR Absolute; + UCHAR Size; + UCHAR Inserted; + LONG SignalState; + LIST_ENTRY WaitListHead; }; typedef struct _DISPATCHER_HEADER DISPATCHER_HEADER; struct _KDEVICE_QUEUE { - CSHORT Type ; - CSHORT Size ; - LIST_ENTRY DeviceListHead ; - KSPIN_LOCK Lock ; - BOOLEAN Busy ; + CSHORT Type; + CSHORT Size; + LIST_ENTRY DeviceListHead; + KSPIN_LOCK Lock; + BOOLEAN Busy; }; typedef struct _KDEVICE_QUEUE KDEVICE_QUEUE; struct _KDEVICE_QUEUE_ENTRY { - LIST_ENTRY DeviceListEntry ; - ULONG SortKey ; - BOOLEAN Inserted ; + LIST_ENTRY DeviceListEntry; + ULONG SortKey; + BOOLEAN Inserted; }; typedef struct _KDEVICE_QUEUE_ENTRY KDEVICE_QUEUE_ENTRY; struct _KEVENT { - DISPATCHER_HEADER Header ; + DISPATCHER_HEADER Header; }; typedef struct _KEVENT KEVENT; typedef struct _KEVENT *PKEVENT; typedef struct _KEVENT *PRKEVENT; struct _KSEMAPHORE { - DISPATCHER_HEADER Header ; - LONG Limit ; + DISPATCHER_HEADER Header; + LONG Limit; }; typedef struct _KSEMAPHORE *PKSEMAPHORE; typedef struct _KSEMAPHORE *PRKSEMAPHORE; enum _MEMORY_CACHING_TYPE { - MmNonCached = 0, - MmCached = 1, - MmWriteCombined = 2, - MmHardwareCoherentCached = 3, - MmNonCachedUnordered = 4, - MmUSWCCached = 5, - MmMaximumCacheType = 6 -} ; + MmNonCached = 0, + MmCached = 1, + MmWriteCombined = 2, + MmHardwareCoherentCached = 3, + MmNonCachedUnordered = 4, + MmUSWCCached = 5, + MmMaximumCacheType = 6 +}; typedef enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE; enum _POOL_TYPE { - NonPagedPool = 0, - PagedPool = 1, - NonPagedPoolMustSucceed = 2, - DontUseThisType = 3, - NonPagedPoolCacheAligned = 4, - PagedPoolCacheAligned = 5, - NonPagedPoolCacheAlignedMustS = 6, - MaxPoolType = 7, - NonPagedPoolSession = 32, - PagedPoolSession = 33, - NonPagedPoolMustSucceedSession = 34, - DontUseThisTypeSession = 35, - NonPagedPoolCacheAlignedSession = 36, - PagedPoolCacheAlignedSession = 37, - NonPagedPoolCacheAlignedMustSSession = 38 -} ; + NonPagedPool = 0, + PagedPool = 1, + NonPagedPoolMustSucceed = 2, + DontUseThisType = 3, + NonPagedPoolCacheAligned = 4, + PagedPoolCacheAligned = 5, + NonPagedPoolCacheAlignedMustS = 6, + MaxPoolType = 7, + NonPagedPoolSession = 32, + PagedPoolSession = 33, + NonPagedPoolMustSucceedSession = 34, + DontUseThisTypeSession = 35, + NonPagedPoolCacheAlignedSession = 36, + PagedPoolCacheAlignedSession = 37, + NonPagedPoolCacheAlignedMustSSession = 38 +}; typedef enum _POOL_TYPE POOL_TYPE; struct _FAST_MUTEX { - LONG Count ; - PKTHREAD Owner ; - ULONG Contention ; - KEVENT Event ; - ULONG OldIrql ; + LONG Count; + PKTHREAD Owner; + ULONG Contention; + KEVENT Event; + ULONG OldIrql; }; typedef struct _FAST_MUTEX *PFAST_MUTEX; typedef ULONG_PTR ERESOURCE_THREAD; union __anonunion____missing_field_name_38 { - LONG OwnerCount ; - ULONG TableSize ; + LONG OwnerCount; + ULONG TableSize; }; struct _OWNER_ENTRY { - ERESOURCE_THREAD OwnerThread ; - union __anonunion____missing_field_name_38 __annonCompField10 ; + ERESOURCE_THREAD OwnerThread; + union __anonunion____missing_field_name_38 __annonCompField10; }; typedef struct _OWNER_ENTRY OWNER_ENTRY; typedef struct _OWNER_ENTRY *POWNER_ENTRY; union __anonunion____missing_field_name_39 { - PVOID Address ; - ULONG_PTR CreatorBackTraceIndex ; + PVOID Address; + ULONG_PTR CreatorBackTraceIndex; }; struct _ERESOURCE { - LIST_ENTRY SystemResourcesList ; - POWNER_ENTRY OwnerTable ; - SHORT ActiveCount ; - USHORT Flag ; - PKSEMAPHORE SharedWaiters ; - PKEVENT ExclusiveWaiters ; - OWNER_ENTRY OwnerThreads[2] ; - ULONG ContentionCount ; - USHORT NumberOfSharedWaiters ; - USHORT NumberOfExclusiveWaiters ; - union __anonunion____missing_field_name_39 __annonCompField11 ; - KSPIN_LOCK SpinLock ; + LIST_ENTRY SystemResourcesList; + POWNER_ENTRY OwnerTable; + SHORT ActiveCount; + USHORT Flag; + PKSEMAPHORE SharedWaiters; + PKEVENT ExclusiveWaiters; + OWNER_ENTRY OwnerThreads[2]; + ULONG ContentionCount; + USHORT NumberOfSharedWaiters; + USHORT NumberOfExclusiveWaiters; + union __anonunion____missing_field_name_39 __annonCompField11; + KSPIN_LOCK SpinLock; }; enum _MM_PAGE_PRIORITY { - LowPagePriority = 0, - NormalPagePriority = 16, - HighPagePriority = 32 -} ; + LowPagePriority = 0, + NormalPagePriority = 16, + HighPagePriority = 32 +}; typedef enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY; struct _DRIVER_OBJECT; struct _DRIVER_OBJECT; struct _SECURITY_SUBJECT_CONTEXT { - PACCESS_TOKEN ClientToken ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - PACCESS_TOKEN PrimaryToken ; - PVOID ProcessAuditId ; + PACCESS_TOKEN ClientToken; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + PACCESS_TOKEN PrimaryToken; + PVOID ProcessAuditId; }; typedef struct _SECURITY_SUBJECT_CONTEXT SECURITY_SUBJECT_CONTEXT; struct _INITIAL_PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[3] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[3]; }; typedef struct _INITIAL_PRIVILEGE_SET INITIAL_PRIVILEGE_SET; union __anonunion_Privileges_40 { - INITIAL_PRIVILEGE_SET InitialPrivilegeSet ; - PRIVILEGE_SET PrivilegeSet ; + INITIAL_PRIVILEGE_SET InitialPrivilegeSet; + PRIVILEGE_SET PrivilegeSet; }; struct _ACCESS_STATE { - LUID OperationID ; - BOOLEAN SecurityEvaluated ; - BOOLEAN GenerateAudit ; - BOOLEAN GenerateOnClose ; - BOOLEAN PrivilegesAllocated ; - ULONG Flags ; - ACCESS_MASK RemainingDesiredAccess ; - ACCESS_MASK PreviouslyGrantedAccess ; - ACCESS_MASK OriginalDesiredAccess ; - SECURITY_SUBJECT_CONTEXT SubjectSecurityContext ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - PVOID AuxData ; - union __anonunion_Privileges_40 Privileges ; - BOOLEAN AuditPrivileges ; - UNICODE_STRING ObjectName ; - UNICODE_STRING ObjectTypeName ; + LUID OperationID; + BOOLEAN SecurityEvaluated; + BOOLEAN GenerateAudit; + BOOLEAN GenerateOnClose; + BOOLEAN PrivilegesAllocated; + ULONG Flags; + ACCESS_MASK RemainingDesiredAccess; + ACCESS_MASK PreviouslyGrantedAccess; + ACCESS_MASK OriginalDesiredAccess; + SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PVOID AuxData; + union __anonunion_Privileges_40 Privileges; + BOOLEAN AuditPrivileges; + UNICODE_STRING ObjectName; + UNICODE_STRING ObjectTypeName; }; typedef struct _ACCESS_STATE *PACCESS_STATE; struct _DEVICE_OBJECT; @@ -786,639 +783,663 @@ struct _IRP; struct _IRP; struct _SCSI_REQUEST_BLOCK; struct _SCSI_REQUEST_BLOCK; -typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ); +typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp); struct _COMPRESSED_DATA_INFO; struct _FAST_IO_DISPATCH { - ULONG SizeOfFastIoDispatch ; - BOOLEAN (*FastIoCheckIfPossible)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , - BOOLEAN CheckForReadOperation , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryBasicInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_BASIC_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryStandardInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_STANDARD_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoLock)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - BOOLEAN FailImmediately , BOOLEAN ExclusiveLock , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockSingle)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAll)(struct _FILE_OBJECT *FileObject , PEPROCESS ProcessId , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAllByKey)(struct _FILE_OBJECT *FileObject , PVOID ProcessId , - ULONG Key , PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoDeviceControl)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , ULONG IoControlCode , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice , struct _DEVICE_OBJECT *TargetDevice ) ; - BOOLEAN (*FastIoQueryNetworkOpenInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - struct _FILE_NETWORK_OPEN_INFORMATION *Buffer , - struct _IO_STATUS_BLOCK *IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForModWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER EndingOffset , - struct _ERESOURCE **ResourceToRelease , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadComplete)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*PrepareMdlWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteComplete)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoReadCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , PMDL *MdlChain , - PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWriteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , - PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadCompleteCompressed)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteCompleteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryOpen)(struct _IRP *Irp , PFILE_NETWORK_OPEN_INFORMATION NetworkInformation , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForModWrite)(struct _FILE_OBJECT *FileObject , struct _ERESOURCE *ResourceToRelease , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; + ULONG SizeOfFastIoDispatch; + BOOLEAN(*FastIoCheckIfPossible) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, BOOLEAN CheckForReadOperation, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryBasicInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_BASIC_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryStandardInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_STANDARD_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoLock) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + BOOLEAN FailImmediately, BOOLEAN ExclusiveLock, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockSingle) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAll) + (struct _FILE_OBJECT *FileObject, PEPROCESS ProcessId, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAllByKey) + (struct _FILE_OBJECT *FileObject, PVOID ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoDeviceControl) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, PVOID InputBuffer, + ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength, + ULONG IoControlCode, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice, + struct _DEVICE_OBJECT *TargetDevice); + BOOLEAN(*FastIoQueryNetworkOpenInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + struct _FILE_NETWORK_OPEN_INFORMATION *Buffer, + struct _IO_STATUS_BLOCK *IoStatus, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForModWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER EndingOffset, + struct _ERESOURCE **ResourceToRelease, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadComplete) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*PrepareMdlWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteComplete) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoReadCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWriteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryOpen) + (struct _IRP *Irp, PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForModWrite) + (struct _FILE_OBJECT *FileObject, struct _ERESOURCE *ResourceToRelease, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); }; typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH; enum _IO_ALLOCATION_ACTION { - KeepObject = 1, - DeallocateObject = 2, - DeallocateObjectKeepRegisters = 3 -} ; + KeepObject = 1, + DeallocateObject = 2, + DeallocateObjectKeepRegisters = 3 +}; typedef enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION; struct _IO_SECURITY_CONTEXT { - PSECURITY_QUALITY_OF_SERVICE SecurityQos ; - PACCESS_STATE AccessState ; - ACCESS_MASK DesiredAccess ; - ULONG FullCreateOptions ; + PSECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_STATE AccessState; + ACCESS_MASK DesiredAccess; + ULONG FullCreateOptions; }; typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT; struct _VPB { - CSHORT Type ; - CSHORT Size ; - USHORT Flags ; - USHORT VolumeLabelLength ; - struct _DEVICE_OBJECT *DeviceObject ; - struct _DEVICE_OBJECT *RealDevice ; - ULONG SerialNumber ; - ULONG ReferenceCount ; - WCHAR VolumeLabel[(32U * sizeof(WCHAR )) / sizeof(WCHAR )] ; + CSHORT Type; + CSHORT Size; + USHORT Flags; + USHORT VolumeLabelLength; + struct _DEVICE_OBJECT *DeviceObject; + struct _DEVICE_OBJECT *RealDevice; + ULONG SerialNumber; + ULONG ReferenceCount; + WCHAR VolumeLabel[(32U * sizeof(WCHAR)) / sizeof(WCHAR)]; }; typedef struct _VPB *PVPB; struct _WAIT_CONTEXT_BLOCK { - KDEVICE_QUEUE_ENTRY WaitQueueEntry ; - IO_ALLOCATION_ACTION (*DeviceRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp , - PVOID MapRegisterBase , PVOID Context ) ; - PVOID DeviceContext ; - ULONG NumberOfMapRegisters ; - PVOID DeviceObject ; - PVOID CurrentIrp ; - PKDPC BufferChainingDpc ; + KDEVICE_QUEUE_ENTRY WaitQueueEntry; + IO_ALLOCATION_ACTION(*DeviceRoutine) + (struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp, PVOID MapRegisterBase, + PVOID Context); + PVOID DeviceContext; + ULONG NumberOfMapRegisters; + PVOID DeviceObject; + PVOID CurrentIrp; + PKDPC BufferChainingDpc; }; typedef struct _WAIT_CONTEXT_BLOCK WAIT_CONTEXT_BLOCK; union __anonunion_Queue_43 { - LIST_ENTRY ListEntry ; - WAIT_CONTEXT_BLOCK Wcb ; + LIST_ENTRY ListEntry; + WAIT_CONTEXT_BLOCK Wcb; }; struct _DEVOBJ_EXTENSION; struct _DEVICE_OBJECT { - CSHORT Type ; - USHORT Size ; - LONG ReferenceCount ; - struct _DRIVER_OBJECT *DriverObject ; - struct _DEVICE_OBJECT *NextDevice ; - struct _DEVICE_OBJECT *AttachedDevice ; - struct _IRP *CurrentIrp ; - PIO_TIMER Timer ; - ULONG Flags ; - ULONG Characteristics ; - PVPB Vpb ; - PVOID DeviceExtension ; - ULONG DeviceType ; - CCHAR StackSize ; - union __anonunion_Queue_43 Queue ; - ULONG AlignmentRequirement ; - KDEVICE_QUEUE DeviceQueue ; - KDPC Dpc ; - ULONG ActiveThreadCount ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - KEVENT DeviceLock ; - USHORT SectorSize ; - USHORT Spare1 ; - struct _DEVOBJ_EXTENSION *DeviceObjectExtension ; - PVOID Reserved ; + CSHORT Type; + USHORT Size; + LONG ReferenceCount; + struct _DRIVER_OBJECT *DriverObject; + struct _DEVICE_OBJECT *NextDevice; + struct _DEVICE_OBJECT *AttachedDevice; + struct _IRP *CurrentIrp; + PIO_TIMER Timer; + ULONG Flags; + ULONG Characteristics; + PVPB Vpb; + PVOID DeviceExtension; + ULONG DeviceType; + CCHAR StackSize; + union __anonunion_Queue_43 Queue; + ULONG AlignmentRequirement; + KDEVICE_QUEUE DeviceQueue; + KDPC Dpc; + ULONG ActiveThreadCount; + PSECURITY_DESCRIPTOR SecurityDescriptor; + KEVENT DeviceLock; + USHORT SectorSize; + USHORT Spare1; + struct _DEVOBJ_EXTENSION *DeviceObjectExtension; + PVOID Reserved; }; typedef struct _DEVICE_OBJECT DEVICE_OBJECT; typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; struct _DEVOBJ_EXTENSION { - CSHORT Type ; - USHORT Size ; - PDEVICE_OBJECT DeviceObject ; + CSHORT Type; + USHORT Size; + PDEVICE_OBJECT DeviceObject; }; struct _DRIVER_EXTENSION { - struct _DRIVER_OBJECT *DriverObject ; - NTSTATUS (*AddDevice)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ; - ULONG Count ; - UNICODE_STRING ServiceKeyName ; + struct _DRIVER_OBJECT *DriverObject; + NTSTATUS(*AddDevice) + (struct _DRIVER_OBJECT *DriverObject, + struct _DEVICE_OBJECT *PhysicalDeviceObject); + ULONG Count; + UNICODE_STRING ServiceKeyName; }; typedef struct _DRIVER_EXTENSION *PDRIVER_EXTENSION; struct _DRIVER_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - ULONG Flags ; - PVOID DriverStart ; - ULONG DriverSize ; - PVOID DriverSection ; - PDRIVER_EXTENSION DriverExtension ; - UNICODE_STRING DriverName ; - PUNICODE_STRING HardwareDatabase ; - PFAST_IO_DISPATCH FastIoDispatch ; - NTSTATUS (*DriverInit)(struct _DRIVER_OBJECT *DriverObject , PUNICODE_STRING RegistryPath ) ; - void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject ) ; - PDRIVER_DISPATCH MajorFunction[28] ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + PVOID DriverStart; + ULONG DriverSize; + PVOID DriverSection; + PDRIVER_EXTENSION DriverExtension; + UNICODE_STRING DriverName; + PUNICODE_STRING HardwareDatabase; + PFAST_IO_DISPATCH FastIoDispatch; + NTSTATUS(*DriverInit) + (struct _DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath); + void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject); + PDRIVER_DISPATCH MajorFunction[28]; }; typedef struct _DRIVER_OBJECT DRIVER_OBJECT; typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; struct _SECTION_OBJECT_POINTERS { - PVOID DataSectionObject ; - PVOID SharedCacheMap ; - PVOID ImageSectionObject ; + PVOID DataSectionObject; + PVOID SharedCacheMap; + PVOID ImageSectionObject; }; typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS; typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS; struct _IO_COMPLETION_CONTEXT { - PVOID Port ; - PVOID Key ; + PVOID Port; + PVOID Key; }; typedef struct _IO_COMPLETION_CONTEXT *PIO_COMPLETION_CONTEXT; struct _FILE_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - PVPB Vpb ; - PVOID FsContext ; - PVOID FsContext2 ; - PSECTION_OBJECT_POINTERS SectionObjectPointer ; - PVOID PrivateCacheMap ; - NTSTATUS FinalStatus ; - struct _FILE_OBJECT *RelatedFileObject ; - BOOLEAN LockOperation ; - BOOLEAN DeletePending ; - BOOLEAN ReadAccess ; - BOOLEAN WriteAccess ; - BOOLEAN DeleteAccess ; - BOOLEAN SharedRead ; - BOOLEAN SharedWrite ; - BOOLEAN SharedDelete ; - ULONG Flags ; - UNICODE_STRING FileName ; - LARGE_INTEGER CurrentByteOffset ; - ULONG Waiters ; - ULONG Busy ; - PVOID LastLock ; - KEVENT Lock ; - KEVENT Event ; - PIO_COMPLETION_CONTEXT CompletionContext ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + PVPB Vpb; + PVOID FsContext; + PVOID FsContext2; + PSECTION_OBJECT_POINTERS SectionObjectPointer; + PVOID PrivateCacheMap; + NTSTATUS FinalStatus; + struct _FILE_OBJECT *RelatedFileObject; + BOOLEAN LockOperation; + BOOLEAN DeletePending; + BOOLEAN ReadAccess; + BOOLEAN WriteAccess; + BOOLEAN DeleteAccess; + BOOLEAN SharedRead; + BOOLEAN SharedWrite; + BOOLEAN SharedDelete; + ULONG Flags; + UNICODE_STRING FileName; + LARGE_INTEGER CurrentByteOffset; + ULONG Waiters; + ULONG Busy; + PVOID LastLock; + KEVENT Lock; + KEVENT Event; + PIO_COMPLETION_CONTEXT CompletionContext; }; typedef struct _FILE_OBJECT *PFILE_OBJECT; union __anonunion_AssociatedIrp_44 { - struct _IRP *MasterIrp ; - LONG IrpCount ; - PVOID SystemBuffer ; + struct _IRP *MasterIrp; + LONG IrpCount; + PVOID SystemBuffer; }; struct __anonstruct_AsynchronousParameters_46 { - void (*UserApcRoutine)(PVOID ApcContext , PIO_STATUS_BLOCK IoStatusBlock , - ULONG Reserved ) ; - PVOID UserApcContext ; + void (*UserApcRoutine)(PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, + ULONG Reserved); + PVOID UserApcContext; }; union __anonunion_Overlay_45 { - struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters ; - LARGE_INTEGER AllocationSize ; + struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters; + LARGE_INTEGER AllocationSize; }; struct __anonstruct____missing_field_name_50 { - PVOID DriverContext[4] ; + PVOID DriverContext[4]; }; union __anonunion____missing_field_name_49 { - KDEVICE_QUEUE_ENTRY DeviceQueueEntry ; - struct __anonstruct____missing_field_name_50 __annonCompField14 ; + KDEVICE_QUEUE_ENTRY DeviceQueueEntry; + struct __anonstruct____missing_field_name_50 __annonCompField14; }; struct _IO_STACK_LOCATION; union __anonunion____missing_field_name_52 { - struct _IO_STACK_LOCATION *CurrentStackLocation ; - ULONG PacketType ; + struct _IO_STACK_LOCATION *CurrentStackLocation; + ULONG PacketType; }; struct __anonstruct____missing_field_name_51 { - LIST_ENTRY ListEntry ; - union __anonunion____missing_field_name_52 __annonCompField16 ; + LIST_ENTRY ListEntry; + union __anonunion____missing_field_name_52 __annonCompField16; }; struct __anonstruct_Overlay_48 { - union __anonunion____missing_field_name_49 __annonCompField15 ; - PETHREAD Thread ; - PCHAR AuxiliaryBuffer ; - struct __anonstruct____missing_field_name_51 __annonCompField17 ; - PFILE_OBJECT OriginalFileObject ; + union __anonunion____missing_field_name_49 __annonCompField15; + PETHREAD Thread; + PCHAR AuxiliaryBuffer; + struct __anonstruct____missing_field_name_51 __annonCompField17; + PFILE_OBJECT OriginalFileObject; }; union __anonunion_Tail_47 { - struct __anonstruct_Overlay_48 Overlay ; - KAPC Apc ; - PVOID CompletionKey ; + struct __anonstruct_Overlay_48 Overlay; + KAPC Apc; + PVOID CompletionKey; }; struct _IRP { - CSHORT Type ; - USHORT Size ; - PMDL MdlAddress ; - ULONG Flags ; - union __anonunion_AssociatedIrp_44 AssociatedIrp ; - LIST_ENTRY ThreadListEntry ; - IO_STATUS_BLOCK IoStatus ; - KPROCESSOR_MODE RequestorMode ; - BOOLEAN PendingReturned ; - CHAR StackCount ; - CHAR CurrentLocation ; - BOOLEAN Cancel ; - KIRQL CancelIrql ; - CCHAR ApcEnvironment ; - UCHAR AllocationFlags ; - PIO_STATUS_BLOCK UserIosb ; - PKEVENT UserEvent ; - union __anonunion_Overlay_45 Overlay ; - void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - PVOID UserBuffer ; - union __anonunion_Tail_47 Tail ; + CSHORT Type; + USHORT Size; + PMDL MdlAddress; + ULONG Flags; + union __anonunion_AssociatedIrp_44 AssociatedIrp; + LIST_ENTRY ThreadListEntry; + IO_STATUS_BLOCK IoStatus; + KPROCESSOR_MODE RequestorMode; + BOOLEAN PendingReturned; + CHAR StackCount; + CHAR CurrentLocation; + BOOLEAN Cancel; + KIRQL CancelIrql; + CCHAR ApcEnvironment; + UCHAR AllocationFlags; + PIO_STATUS_BLOCK UserIosb; + PKEVENT UserEvent; + union __anonunion_Overlay_45 Overlay; + void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + PVOID UserBuffer; + union __anonunion_Tail_47 Tail; }; typedef struct _IRP IRP; typedef struct _IRP *PIRP; enum _DEVICE_RELATION_TYPE { - BusRelations = 0, - EjectionRelations = 1, - PowerRelations = 2, - RemovalRelations = 3, - TargetDeviceRelation = 4 -} ; + BusRelations = 0, + EjectionRelations = 1, + PowerRelations = 2, + RemovalRelations = 3, + TargetDeviceRelation = 4 +}; typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE; enum _DEVICE_USAGE_NOTIFICATION_TYPE { - DeviceUsageTypeUndefined = 0, - DeviceUsageTypePaging = 1, - DeviceUsageTypeHibernation = 2, - DeviceUsageTypeDumpFile = 3 -} ; + DeviceUsageTypeUndefined = 0, + DeviceUsageTypePaging = 1, + DeviceUsageTypeHibernation = 2, + DeviceUsageTypeDumpFile = 3 +}; typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE; struct _INTERFACE { - USHORT Size ; - USHORT Version ; - PVOID Context ; - void (*InterfaceReference)(PVOID Context ) ; - void (*InterfaceDereference)(PVOID Context ) ; + USHORT Size; + USHORT Version; + PVOID Context; + void (*InterfaceReference)(PVOID Context); + void (*InterfaceDereference)(PVOID Context); }; typedef struct _INTERFACE *PINTERFACE; struct _DEVICE_CAPABILITIES { - USHORT Size ; - USHORT Version ; - ULONG DeviceD1 : 1 ; - ULONG DeviceD2 : 1 ; - ULONG LockSupported : 1 ; - ULONG EjectSupported : 1 ; - ULONG Removable : 1 ; - ULONG DockDevice : 1 ; - ULONG UniqueID : 1 ; - ULONG SilentInstall : 1 ; - ULONG RawDeviceOK : 1 ; - ULONG SurpriseRemovalOK : 1 ; - ULONG WakeFromD0 : 1 ; - ULONG WakeFromD1 : 1 ; - ULONG WakeFromD2 : 1 ; - ULONG WakeFromD3 : 1 ; - ULONG HardwareDisabled : 1 ; - ULONG NonDynamic : 1 ; - ULONG WarmEjectSupported : 1 ; - ULONG Reserved : 15 ; - ULONG Address ; - ULONG UINumber ; - DEVICE_POWER_STATE DeviceState[7] ; - SYSTEM_POWER_STATE SystemWake ; - DEVICE_POWER_STATE DeviceWake ; - ULONG D1Latency ; - ULONG D2Latency ; - ULONG D3Latency ; + USHORT Size; + USHORT Version; + ULONG DeviceD1 : 1; + ULONG DeviceD2 : 1; + ULONG LockSupported : 1; + ULONG EjectSupported : 1; + ULONG Removable : 1; + ULONG DockDevice : 1; + ULONG UniqueID : 1; + ULONG SilentInstall : 1; + ULONG RawDeviceOK : 1; + ULONG SurpriseRemovalOK : 1; + ULONG WakeFromD0 : 1; + ULONG WakeFromD1 : 1; + ULONG WakeFromD2 : 1; + ULONG WakeFromD3 : 1; + ULONG HardwareDisabled : 1; + ULONG NonDynamic : 1; + ULONG WarmEjectSupported : 1; + ULONG Reserved : 15; + ULONG Address; + ULONG UINumber; + DEVICE_POWER_STATE DeviceState[7]; + SYSTEM_POWER_STATE SystemWake; + DEVICE_POWER_STATE DeviceWake; + ULONG D1Latency; + ULONG D2Latency; + ULONG D3Latency; }; typedef struct _DEVICE_CAPABILITIES *PDEVICE_CAPABILITIES; struct _POWER_SEQUENCE { - ULONG SequenceD1 ; - ULONG SequenceD2 ; - ULONG SequenceD3 ; + ULONG SequenceD1; + ULONG SequenceD2; + ULONG SequenceD3; }; typedef struct _POWER_SEQUENCE *PPOWER_SEQUENCE; enum __anonenum_BUS_QUERY_ID_TYPE_53 { - BusQueryDeviceID = 0, - BusQueryHardwareIDs = 1, - BusQueryCompatibleIDs = 2, - BusQueryInstanceID = 3, - BusQueryDeviceSerialNumber = 4 -} ; + BusQueryDeviceID = 0, + BusQueryHardwareIDs = 1, + BusQueryCompatibleIDs = 2, + BusQueryInstanceID = 3, + BusQueryDeviceSerialNumber = 4 +}; typedef enum __anonenum_BUS_QUERY_ID_TYPE_53 BUS_QUERY_ID_TYPE; enum __anonenum_DEVICE_TEXT_TYPE_54 { - DeviceTextDescription = 0, - DeviceTextLocationInformation = 1 -} ; + DeviceTextDescription = 0, + DeviceTextLocationInformation = 1 +}; typedef enum __anonenum_DEVICE_TEXT_TYPE_54 DEVICE_TEXT_TYPE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Create_56 { - PIO_SECURITY_CONTEXT SecurityContext ; - ULONG Options ; - USHORT FileAttributes ; - USHORT ShareAccess ; - ULONG EaLength ; + PIO_SECURITY_CONTEXT SecurityContext; + ULONG Options; + USHORT FileAttributes; + USHORT ShareAccess; + ULONG EaLength; }; struct __anonstruct_Read_57 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_Write_58 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_QueryFile_59 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; }; struct __anonstruct____missing_field_name_62 { - BOOLEAN ReplaceIfExists ; - BOOLEAN AdvanceOnly ; + BOOLEAN ReplaceIfExists; + BOOLEAN AdvanceOnly; }; union __anonunion____missing_field_name_61 { - struct __anonstruct____missing_field_name_62 __annonCompField18 ; - ULONG ClusterCount ; - HANDLE DeleteHandle ; + struct __anonstruct____missing_field_name_62 __annonCompField18; + ULONG ClusterCount; + HANDLE DeleteHandle; }; struct __anonstruct_SetFile_60 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; - PFILE_OBJECT FileObject ; - union __anonunion____missing_field_name_61 __annonCompField19 ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; + PFILE_OBJECT FileObject; + union __anonunion____missing_field_name_61 __annonCompField19; }; struct __anonstruct_QueryVolume_63 { - ULONG Length ; - FS_INFORMATION_CLASS FsInformationClass ; + ULONG Length; + FS_INFORMATION_CLASS FsInformationClass; }; struct __anonstruct_DeviceIoControl_64 { - ULONG OutputBufferLength ; - ULONG InputBufferLength ; - ULONG IoControlCode ; - PVOID Type3InputBuffer ; + ULONG OutputBufferLength; + ULONG InputBufferLength; + ULONG IoControlCode; + PVOID Type3InputBuffer; }; struct __anonstruct_QuerySecurity_65 { - SECURITY_INFORMATION SecurityInformation ; - ULONG Length ; + SECURITY_INFORMATION SecurityInformation; + ULONG Length; }; struct __anonstruct_SetSecurity_66 { - SECURITY_INFORMATION SecurityInformation ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; + SECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; }; struct __anonstruct_MountVolume_67 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_VerifyVolume_68 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_Scsi_69 { - struct _SCSI_REQUEST_BLOCK *Srb ; + struct _SCSI_REQUEST_BLOCK *Srb; }; struct __anonstruct_QueryDeviceRelations_70 { - DEVICE_RELATION_TYPE Type ; + DEVICE_RELATION_TYPE Type; }; struct __anonstruct_QueryInterface_71 { - GUID const *InterfaceType ; - USHORT Size ; - USHORT Version ; - PINTERFACE Interface ; - PVOID InterfaceSpecificData ; + GUID const *InterfaceType; + USHORT Size; + USHORT Version; + PINTERFACE Interface; + PVOID InterfaceSpecificData; }; struct __anonstruct_DeviceCapabilities_72 { - PDEVICE_CAPABILITIES Capabilities ; + PDEVICE_CAPABILITIES Capabilities; }; struct __anonstruct_FilterResourceRequirements_73 { - PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList ; + PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; }; struct __anonstruct_ReadWriteConfig_74 { - ULONG WhichSpace ; - PVOID Buffer ; - ULONG Offset ; - ULONG Length ; + ULONG WhichSpace; + PVOID Buffer; + ULONG Offset; + ULONG Length; }; struct __anonstruct_SetLock_75 { - BOOLEAN Lock ; + BOOLEAN Lock; }; struct __anonstruct_QueryId_76 { - BUS_QUERY_ID_TYPE IdType ; + BUS_QUERY_ID_TYPE IdType; }; struct __anonstruct_QueryDeviceText_77 { - DEVICE_TEXT_TYPE DeviceTextType ; - LCID LocaleId ; + DEVICE_TEXT_TYPE DeviceTextType; + LCID LocaleId; }; struct __anonstruct_UsageNotification_78 { - BOOLEAN InPath ; - BOOLEAN Reserved[3] ; - DEVICE_USAGE_NOTIFICATION_TYPE Type ; + BOOLEAN InPath; + BOOLEAN Reserved[3]; + DEVICE_USAGE_NOTIFICATION_TYPE Type; }; struct __anonstruct_WaitWake_79 { - SYSTEM_POWER_STATE PowerState ; + SYSTEM_POWER_STATE PowerState; }; struct __anonstruct_PowerSequence_80 { - PPOWER_SEQUENCE PowerSequence ; + PPOWER_SEQUENCE PowerSequence; }; struct __anonstruct_Power_81 { - ULONG SystemContext ; - POWER_STATE_TYPE Type ; - POWER_STATE State ; - POWER_ACTION ShutdownType ; + ULONG SystemContext; + POWER_STATE_TYPE Type; + POWER_STATE State; + POWER_ACTION ShutdownType; }; struct __anonstruct_StartDevice_82 { - PCM_RESOURCE_LIST AllocatedResources ; - PCM_RESOURCE_LIST AllocatedResourcesTranslated ; + PCM_RESOURCE_LIST AllocatedResources; + PCM_RESOURCE_LIST AllocatedResourcesTranslated; }; struct __anonstruct_WMI_83 { - ULONG_PTR ProviderId ; - PVOID DataPath ; - ULONG BufferSize ; - PVOID Buffer ; + ULONG_PTR ProviderId; + PVOID DataPath; + ULONG BufferSize; + PVOID Buffer; }; struct __anonstruct_Others_84 { - PVOID Argument1 ; - PVOID Argument2 ; - PVOID Argument3 ; - PVOID Argument4 ; + PVOID Argument1; + PVOID Argument2; + PVOID Argument3; + PVOID Argument4; }; union __anonunion_Parameters_55 { - struct __anonstruct_Create_56 Create ; - struct __anonstruct_Read_57 Read ; - struct __anonstruct_Write_58 Write ; - struct __anonstruct_QueryFile_59 QueryFile ; - struct __anonstruct_SetFile_60 SetFile ; - struct __anonstruct_QueryVolume_63 QueryVolume ; - struct __anonstruct_DeviceIoControl_64 DeviceIoControl ; - struct __anonstruct_QuerySecurity_65 QuerySecurity ; - struct __anonstruct_SetSecurity_66 SetSecurity ; - struct __anonstruct_MountVolume_67 MountVolume ; - struct __anonstruct_VerifyVolume_68 VerifyVolume ; - struct __anonstruct_Scsi_69 Scsi ; - struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations ; - struct __anonstruct_QueryInterface_71 QueryInterface ; - struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities ; - struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements ; - struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig ; - struct __anonstruct_SetLock_75 SetLock ; - struct __anonstruct_QueryId_76 QueryId ; - struct __anonstruct_QueryDeviceText_77 QueryDeviceText ; - struct __anonstruct_UsageNotification_78 UsageNotification ; - struct __anonstruct_WaitWake_79 WaitWake ; - struct __anonstruct_PowerSequence_80 PowerSequence ; - struct __anonstruct_Power_81 Power ; - struct __anonstruct_StartDevice_82 StartDevice ; - struct __anonstruct_WMI_83 WMI ; - struct __anonstruct_Others_84 Others ; + struct __anonstruct_Create_56 Create; + struct __anonstruct_Read_57 Read; + struct __anonstruct_Write_58 Write; + struct __anonstruct_QueryFile_59 QueryFile; + struct __anonstruct_SetFile_60 SetFile; + struct __anonstruct_QueryVolume_63 QueryVolume; + struct __anonstruct_DeviceIoControl_64 DeviceIoControl; + struct __anonstruct_QuerySecurity_65 QuerySecurity; + struct __anonstruct_SetSecurity_66 SetSecurity; + struct __anonstruct_MountVolume_67 MountVolume; + struct __anonstruct_VerifyVolume_68 VerifyVolume; + struct __anonstruct_Scsi_69 Scsi; + struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations; + struct __anonstruct_QueryInterface_71 QueryInterface; + struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities; + struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements; + struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig; + struct __anonstruct_SetLock_75 SetLock; + struct __anonstruct_QueryId_76 QueryId; + struct __anonstruct_QueryDeviceText_77 QueryDeviceText; + struct __anonstruct_UsageNotification_78 UsageNotification; + struct __anonstruct_WaitWake_79 WaitWake; + struct __anonstruct_PowerSequence_80 PowerSequence; + struct __anonstruct_Power_81 Power; + struct __anonstruct_StartDevice_82 StartDevice; + struct __anonstruct_WMI_83 WMI; + struct __anonstruct_Others_84 Others; }; struct _IO_STACK_LOCATION { - UCHAR MajorFunction ; - UCHAR MinorFunction ; - UCHAR Flags ; - UCHAR Control ; - union __anonunion_Parameters_55 Parameters ; - PDEVICE_OBJECT DeviceObject ; - PFILE_OBJECT FileObject ; - NTSTATUS (*CompletionRoutine)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - PVOID Context ; + UCHAR MajorFunction; + UCHAR MinorFunction; + UCHAR Flags; + UCHAR Control; + union __anonunion_Parameters_55 Parameters; + PDEVICE_OBJECT DeviceObject; + PFILE_OBJECT FileObject; + NTSTATUS(*CompletionRoutine) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + PVOID Context; }; typedef struct _IO_STACK_LOCATION IO_STACK_LOCATION; typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION; #pragma pack(pop) struct _CONFIGURATION_INFORMATION { - ULONG DiskCount ; - ULONG FloppyCount ; - ULONG CdRomCount ; - ULONG TapeCount ; - ULONG ScsiPortCount ; - ULONG SerialCount ; - ULONG ParallelCount ; - BOOLEAN AtDiskPrimaryAddressClaimed ; - BOOLEAN AtDiskSecondaryAddressClaimed ; - ULONG Version ; - ULONG MediumChangerCount ; + ULONG DiskCount; + ULONG FloppyCount; + ULONG CdRomCount; + ULONG TapeCount; + ULONG ScsiPortCount; + ULONG SerialCount; + ULONG ParallelCount; + BOOLEAN AtDiskPrimaryAddressClaimed; + BOOLEAN AtDiskSecondaryAddressClaimed; + ULONG Version; + ULONG MediumChangerCount; }; typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION; typedef struct _CONFIGURATION_INFORMATION *PCONFIGURATION_INFORMATION; struct _OBJECT_HANDLE_INFORMATION { - ULONG HandleAttributes ; - ACCESS_MASK GrantedAccess ; + ULONG HandleAttributes; + ACCESS_MASK GrantedAccess; }; typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION; struct _KEYBOARD_INPUT_DATA { - USHORT UnitId ; - USHORT MakeCode ; - USHORT Flags ; - USHORT Reserved ; - ULONG ExtraInformation ; + USHORT UnitId; + USHORT MakeCode; + USHORT Flags; + USHORT Reserved; + ULONG ExtraInformation; }; typedef struct _KEYBOARD_INPUT_DATA *PKEYBOARD_INPUT_DATA; struct _CONNECT_DATA { - PDEVICE_OBJECT ClassDeviceObject ; - PVOID ClassService ; + PDEVICE_OBJECT ClassDeviceObject; + PVOID ClassService; }; typedef struct _CONNECT_DATA CONNECT_DATA; typedef struct _CONNECT_DATA *PCONNECT_DATA; -enum _TRANSMIT_STATE { - Idle = 0, - SendingBytes = 1 -} ; +enum _TRANSMIT_STATE { Idle = 0, SendingBytes = 1 }; typedef enum _TRANSMIT_STATE TRANSMIT_STATE; struct _OUTPUT_PACKET { - PUCHAR Bytes ; - ULONG CurrentByte ; - ULONG ByteCount ; - TRANSMIT_STATE State ; + PUCHAR Bytes; + ULONG CurrentByte; + ULONG ByteCount; + TRANSMIT_STATE State; }; typedef struct _OUTPUT_PACKET *POUTPUT_PACKET; -enum _KEYBOARD_SCAN_STATE { - Normal = 0, - GotE0 = 1, - GotE1 = 2 -} ; +enum _KEYBOARD_SCAN_STATE { Normal = 0, GotE0 = 1, GotE1 = 2 }; typedef enum _KEYBOARD_SCAN_STATE *PKEYBOARD_SCAN_STATE; struct _INTERNAL_I8042_HOOK_KEYBOARD { - PVOID Context ; - NTSTATUS (*InitializationRoutine)(PVOID InitializationContext , PVOID SynchFuncContext , - NTSTATUS (*ReadPort)(PVOID Context , PUCHAR Value , - BOOLEAN WaitForACK ) , NTSTATUS (*WritePort)(PVOID Context , - UCHAR Value , - BOOLEAN WaitForACK ) , - PBOOLEAN TurnTranslationOn ) ; - BOOLEAN (*IsrRoutine)(PVOID IsrContext , PKEYBOARD_INPUT_DATA CurrentInput , POUTPUT_PACKET CurrentOutput , - UCHAR StatusByte , PUCHAR Byte , PBOOLEAN ContinueProcessing , - PKEYBOARD_SCAN_STATE ScanState ) ; - void (*IsrWritePort)(PVOID Context , UCHAR Value ) ; - void (*QueueKeyboardPacket)(PVOID Context ) ; - PVOID CallContext ; + PVOID Context; + NTSTATUS(*InitializationRoutine) + (PVOID InitializationContext, PVOID SynchFuncContext, + NTSTATUS (*ReadPort)(PVOID Context, PUCHAR Value, BOOLEAN WaitForACK), + NTSTATUS (*WritePort)(PVOID Context, UCHAR Value, BOOLEAN WaitForACK), + PBOOLEAN TurnTranslationOn); + BOOLEAN(*IsrRoutine) + (PVOID IsrContext, PKEYBOARD_INPUT_DATA CurrentInput, + POUTPUT_PACKET CurrentOutput, UCHAR StatusByte, PUCHAR Byte, + PBOOLEAN ContinueProcessing, PKEYBOARD_SCAN_STATE ScanState); + void (*IsrWritePort)(PVOID Context, UCHAR Value); + void (*QueueKeyboardPacket)(PVOID Context); + PVOID CallContext; }; typedef struct _INTERNAL_I8042_HOOK_KEYBOARD INTERNAL_I8042_HOOK_KEYBOARD; typedef struct _INTERNAL_I8042_HOOK_KEYBOARD *PINTERNAL_I8042_HOOK_KEYBOARD; struct _DEVICE_EXTENSION { - PDEVICE_OBJECT Self ; - PDEVICE_OBJECT PDO ; - PDEVICE_OBJECT TopOfStack ; - LONG EnableCount ; - CONNECT_DATA UpperConnectData ; - PVOID UpperContext ; - NTSTATUS (*UpperInitializationRoutine)(PVOID InitializationContext , PVOID SynchFuncContext , - NTSTATUS (*ReadPort)(PVOID Context , PUCHAR Value , - BOOLEAN WaitForACK ) , - NTSTATUS (*WritePort)(PVOID Context , UCHAR Value , - BOOLEAN WaitForACK ) , - PBOOLEAN TurnTranslationOn ) ; - BOOLEAN (*UpperIsrHook)(PVOID IsrContext , PKEYBOARD_INPUT_DATA CurrentInput , - POUTPUT_PACKET CurrentOutput , UCHAR StatusByte , PUCHAR Byte , - PBOOLEAN ContinueProcessing , PKEYBOARD_SCAN_STATE ScanState ) ; - void (*IsrWritePort)(PVOID Context , UCHAR Value ) ; - void (*QueueKeyboardPacket)(PVOID Context ) ; - PVOID CallContext ; - DEVICE_POWER_STATE DeviceState ; - BOOLEAN Started ; - BOOLEAN SurpriseRemoved ; - BOOLEAN Removed ; + PDEVICE_OBJECT Self; + PDEVICE_OBJECT PDO; + PDEVICE_OBJECT TopOfStack; + LONG EnableCount; + CONNECT_DATA UpperConnectData; + PVOID UpperContext; + NTSTATUS(*UpperInitializationRoutine) + (PVOID InitializationContext, PVOID SynchFuncContext, + NTSTATUS (*ReadPort)(PVOID Context, PUCHAR Value, BOOLEAN WaitForACK), + NTSTATUS (*WritePort)(PVOID Context, UCHAR Value, BOOLEAN WaitForACK), + PBOOLEAN TurnTranslationOn); + BOOLEAN(*UpperIsrHook) + (PVOID IsrContext, PKEYBOARD_INPUT_DATA CurrentInput, + POUTPUT_PACKET CurrentOutput, UCHAR StatusByte, PUCHAR Byte, + PBOOLEAN ContinueProcessing, PKEYBOARD_SCAN_STATE ScanState); + void (*IsrWritePort)(PVOID Context, UCHAR Value); + void (*QueueKeyboardPacket)(PVOID Context); + PVOID CallContext; + DEVICE_POWER_STATE DeviceState; + BOOLEAN Started; + BOOLEAN SurpriseRemoved; + BOOLEAN Removed; }; typedef struct _DEVICE_EXTENSION DEVICE_EXTENSION; typedef struct _DEVICE_EXTENSION *PDEVICE_EXTENSION; -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1426,510 +1447,498 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -extern void *memcpy(void * , void const * , size_t ) ; -extern void *memset(void * , int , size_t ) ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; +extern void *memcpy(void *, void const *, size_t); +extern void *memset(void *, int, size_t); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -extern LONG InterlockedIncrement(PLONG Addend ) ; -extern LONG InterlockedDecrement(PLONG Addend ) ; -#pragma warning(disable:4035) +extern LONG InterlockedIncrement(PLONG Addend); +extern LONG InterlockedDecrement(PLONG Addend); +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; - void ExFreePool(PVOID P ) ; - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; - void MmUnlockPages(PMDL MemoryDescriptorList ) ; - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; - void MmFreeContiguousMemory(PVOID BaseAddress ) ; - void MmResetDriverPaging(PVOID AddressWithinSection ) ; - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; - void IoFreeIrp(PIRP Irp ) ; - void IoFreeMdl(PMDL Mdl ) ; - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; - void IoReleaseCancelSpinLock(KIRQL Irql ) ; - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -#pragma warning(disable:4200) -#pragma warning(default:4200) - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void PoStartNextPowerIrp(PIRP Irp ) ; - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; - void ObfDereferenceObject(PVOID Object ) ; - NTSTATUS ZwClose(HANDLE Handle ) ; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +void ExFreePool(PVOID P); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +void MmUnlockPages(PMDL MemoryDescriptorList); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmResetDriverPaging(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoFreeIrp(PIRP Irp); +void IoFreeMdl(PMDL Mdl); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +void ObfDereferenceObject(PVOID Object); +NTSTATUS ZwClose(HANDLE Handle); #pragma once #pragma once #pragma once -NTSTATUS KbFilter_AddDevice(PDRIVER_OBJECT Driver , PDEVICE_OBJECT PDO ) ; -NTSTATUS KbFilter_CreateClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS KbFilter_DispatchPassThrough(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS KbFilter_InternIoCtl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -extern NTSTATUS KbFilter_IoCtl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS KbFilter_PnP(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS KbFilter_Power(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS KbFilter_InitializationRoutine(PDEVICE_OBJECT DeviceObject , PVOID SynchFuncContext , - NTSTATUS (*ReadPort)(PVOID Context , PUCHAR Value , - BOOLEAN WaitForACK ) , - NTSTATUS (*WritePort)(PVOID Context , UCHAR Value , - BOOLEAN WaitForACK ) , - PBOOLEAN TurnTranslationOn ) ; -BOOLEAN KbFilter_IsrHook(PDEVICE_OBJECT DeviceObject , PKEYBOARD_INPUT_DATA CurrentInput , - POUTPUT_PACKET CurrentOutput , UCHAR StatusByte , PUCHAR DataByte , - PBOOLEAN ContinueProcessing , PKEYBOARD_SCAN_STATE ScanState ) ; -void KbFilter_ServiceCallback(PDEVICE_OBJECT DeviceObject , PKEYBOARD_INPUT_DATA InputDataStart , - PKEYBOARD_INPUT_DATA InputDataEnd , PULONG InputDataConsumed ) ; -void KbFilter_Unload(PDRIVER_OBJECT Driver ) ; -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) ; -#pragma alloc_text(INIT,DriverEntry) -#pragma alloc_text(PAGE,KbFilter_AddDevice) -#pragma alloc_text(PAGE,KbFilter_CreateClose) -#pragma alloc_text(PAGE,KbFilter_IoCtl) -#pragma alloc_text(PAGE,KbFilter_InternIoCtl) -#pragma alloc_text(PAGE,KbFilter_Unload) -#pragma alloc_text(PAGE,KbFilter_DispatchPassThrough) -#pragma alloc_text(PAGE,KbFilter_PnP) -#pragma alloc_text(PAGE,KbFilter_Power) -void errorFn(void) -{ - - { - ERROR: assert(0); - goto ERROR; -} -} -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -int myStatus ; -void _BLAST_init(void) -{ - - { - UNLOADED = 0; - NP = 1; - DC = 2; - SKIP1 = 3; - SKIP2 = 4; - MPR1 = 5; - MPR3 = 6; - IPC = 7; - s = UNLOADED; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - return; -} -} -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) -{ ULONG i = __VERIFIER_nondet_long() ; - - { - DriverObject->MajorFunction[i] = & KbFilter_DispatchPassThrough; - DriverObject->MajorFunction[0] = & KbFilter_CreateClose; - DriverObject->MajorFunction[2] = & KbFilter_CreateClose; - DriverObject->MajorFunction[27] = & KbFilter_PnP; - DriverObject->MajorFunction[22] = & KbFilter_Power; - DriverObject->MajorFunction[15] = & KbFilter_InternIoCtl; - DriverObject->DriverUnload = & KbFilter_Unload; - (DriverObject->DriverExtension)->AddDevice = & KbFilter_AddDevice; - return (0L); -} -} -NTSTATUS KbFilter_AddDevice(PDRIVER_OBJECT Driver , PDEVICE_OBJECT PDO ) -{ PDEVICE_EXTENSION devExt ; - PDEVICE_OBJECT device ; - NTSTATUS status ; - - { - { - status = 0L; - status = IoCreateDevice(Driver, sizeof(DEVICE_EXTENSION ), (void *)0, 11, 0, 0, - & device); +NTSTATUS KbFilter_AddDevice(PDRIVER_OBJECT Driver, PDEVICE_OBJECT PDO); +NTSTATUS KbFilter_CreateClose(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS KbFilter_DispatchPassThrough(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS KbFilter_InternIoCtl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +extern NTSTATUS KbFilter_IoCtl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS KbFilter_PnP(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS KbFilter_Power(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS KbFilter_InitializationRoutine( + PDEVICE_OBJECT DeviceObject, PVOID SynchFuncContext, + NTSTATUS (*ReadPort)(PVOID Context, PUCHAR Value, BOOLEAN WaitForACK), + NTSTATUS (*WritePort)(PVOID Context, UCHAR Value, BOOLEAN WaitForACK), + PBOOLEAN TurnTranslationOn); +BOOLEAN KbFilter_IsrHook(PDEVICE_OBJECT DeviceObject, + PKEYBOARD_INPUT_DATA CurrentInput, + POUTPUT_PACKET CurrentOutput, UCHAR StatusByte, + PUCHAR DataByte, PBOOLEAN ContinueProcessing, + PKEYBOARD_SCAN_STATE ScanState); +void KbFilter_ServiceCallback(PDEVICE_OBJECT DeviceObject, + PKEYBOARD_INPUT_DATA InputDataStart, + PKEYBOARD_INPUT_DATA InputDataEnd, + PULONG InputDataConsumed); +void KbFilter_Unload(PDRIVER_OBJECT Driver); +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath); +#pragma alloc_text(INIT, DriverEntry) +#pragma alloc_text(PAGE, KbFilter_AddDevice) +#pragma alloc_text(PAGE, KbFilter_CreateClose) +#pragma alloc_text(PAGE, KbFilter_IoCtl) +#pragma alloc_text(PAGE, KbFilter_InternIoCtl) +#pragma alloc_text(PAGE, KbFilter_Unload) +#pragma alloc_text(PAGE, KbFilter_DispatchPassThrough) +#pragma alloc_text(PAGE, KbFilter_PnP) +#pragma alloc_text(PAGE, KbFilter_Power) +void errorFn(void) { + + { + ERROR: + assert(0); + goto ERROR; } - if (! (status >= 0L)) { - return (status); - } else { - +} +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +int myStatus; +void _BLAST_init(void) { + + { + UNLOADED = 0; + NP = 1; + DC = 2; + SKIP1 = 3; + SKIP2 = 4; + MPR1 = 5; + MPR3 = 6; + IPC = 7; + s = UNLOADED; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + return; } +} +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, + PUNICODE_STRING RegistryPath) { + ULONG i = __VERIFIER_nondet_long(); + { - memset(device->DeviceExtension, 0, sizeof(DEVICE_EXTENSION )); - devExt = (struct _DEVICE_EXTENSION *)device->DeviceExtension; - devExt->TopOfStack = IoAttachDeviceToDeviceStack(device, PDO); - devExt->Self = device; - devExt->PDO = PDO; - devExt->DeviceState = 1; - devExt->SurpriseRemoved = 0; - devExt->Removed = 0; - devExt->Started = 0; - device->Flags |= 8196UL; - device->Flags &= 4294967167UL; + DriverObject->MajorFunction[i] = &KbFilter_DispatchPassThrough; + DriverObject->MajorFunction[0] = &KbFilter_CreateClose; + DriverObject->MajorFunction[2] = &KbFilter_CreateClose; + DriverObject->MajorFunction[27] = &KbFilter_PnP; + DriverObject->MajorFunction[22] = &KbFilter_Power; + DriverObject->MajorFunction[15] = &KbFilter_InternIoCtl; + DriverObject->DriverUnload = &KbFilter_Unload; + (DriverObject->DriverExtension)->AddDevice = &KbFilter_AddDevice; + return (0L); } - return (status); } -} -NTSTATUS KbFilter_Complete(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) -{ PKEVENT event ; +NTSTATUS KbFilter_AddDevice(PDRIVER_OBJECT Driver, PDEVICE_OBJECT PDO) { + PDEVICE_EXTENSION devExt; + PDEVICE_OBJECT device; + NTSTATUS status; { - { - event = (struct _KEVENT *)Context; - KeSetEvent(event, 0, 0); + { + status = 0L; + status = IoCreateDevice(Driver, sizeof(DEVICE_EXTENSION), (void *)0, 11, + 0, 0, &device); + } + if (!(status >= 0L)) { + return (status); + } else { + } + { + memset(device->DeviceExtension, 0, sizeof(DEVICE_EXTENSION)); + devExt = (struct _DEVICE_EXTENSION *)device->DeviceExtension; + devExt->TopOfStack = IoAttachDeviceToDeviceStack(device, PDO); + devExt->Self = device; + devExt->PDO = PDO; + devExt->DeviceState = 1; + devExt->SurpriseRemoved = 0; + devExt->Removed = 0; + devExt->Started = 0; + device->Flags |= 8196UL; + device->Flags &= 4294967167UL; + } + return (status); } - return (-1073741802L); } -} -NTSTATUS KbFilter_CreateClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpStack ; - NTSTATUS status ; - PDEVICE_EXTENSION devExt ; - LONG tmp ; - LONG tmp___0 ; - NTSTATUS tmp___1 ; +NTSTATUS KbFilter_Complete(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PVOID Context) { + PKEVENT event; { - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - status = Irp->IoStatus.__annonCompField4.Status; - status = myStatus; - if (irpStack->MajorFunction == 0) { - goto switch_0_0; - } else { - if (irpStack->MajorFunction == 2) { - goto switch_0_2; + { + event = (struct _KEVENT *)Context; + KeSetEvent(event, 0, 0); + } + return (-1073741802L); + } +} +NTSTATUS KbFilter_CreateClose(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpStack; + NTSTATUS status; + PDEVICE_EXTENSION devExt; + LONG tmp; + LONG tmp___0; + NTSTATUS tmp___1; + + { + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + status = Irp->IoStatus.__annonCompField4.Status; + status = myStatus; + if (irpStack->MajorFunction == 0) { + goto switch_0_0; } else { - if (0) { - switch_0_0: /* CIL Label */ ; - if ((unsigned int )((void *)0) == (unsigned int )devExt->UpperConnectData.ClassService) { - status = -1073741436L; - } else { - { - tmp = InterlockedIncrement(& devExt->EnableCount); - } - if (1L == tmp) { - + if (irpStack->MajorFunction == 2) { + goto switch_0_2; + } else { + if (0) { + switch_0_0: /* CIL Label */; + if ((unsigned int)((void *)0) == + (unsigned int)devExt->UpperConnectData.ClassService) { + status = -1073741436L; } else { + { tmp = InterlockedIncrement(&devExt->EnableCount); } + if (1L == tmp) { + } else { + } } - } - goto switch_0_break; - switch_0_2: /* CIL Label */ + goto switch_0_break; + switch_0_2 : /* CIL Label */ { - tmp___0 = InterlockedDecrement(& devExt->EnableCount); + tmp___0 = InterlockedDecrement(&devExt->EnableCount); } - if (0L == tmp___0) { + if (0L == tmp___0) { + } else { + } + goto switch_0_break; } else { - + switch_0_break: /* CIL Label */; } - goto switch_0_break; - } else { - switch_0_break: /* CIL Label */ ; } } + { + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + tmp___1 = KbFilter_DispatchPassThrough(DeviceObject, Irp); + } + return (tmp___1); } - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - tmp___1 = KbFilter_DispatchPassThrough(DeviceObject, Irp); - } - return (tmp___1); } -} -NTSTATUS KbFilter_DispatchPassThrough(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpStack ; - NTSTATUS tmp ; +NTSTATUS KbFilter_DispatchPassThrough(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpStack; + NTSTATUS tmp; { - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } } + { + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + tmp = IofCallDriver( + ((struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension) + ->TopOfStack, + Irp); + } + return (tmp); } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - tmp = IofCallDriver(((struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension)->TopOfStack, - Irp); - } - return (tmp); -} } -NTSTATUS KbFilter_InternIoCtl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpStack ; - PDEVICE_EXTENSION devExt ; - PINTERNAL_I8042_HOOK_KEYBOARD hookKeyboard ; - PCONNECT_DATA connectData ; - NTSTATUS status ; - NTSTATUS tmp ; - - { - status = 0L; - devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - Irp->IoStatus.Information = 0; - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - if (irpStack->Parameters.DeviceIoControl.IoControlCode == (((11 << 16) | (128 << 2)) | 3)) { - goto switch_1_exp_0; - } else { - if (irpStack->Parameters.DeviceIoControl.IoControlCode == (((11 << 16) | (256 << 2)) | 3)) { - goto switch_1_exp_1; +NTSTATUS KbFilter_InternIoCtl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpStack; + PDEVICE_EXTENSION devExt; + PINTERNAL_I8042_HOOK_KEYBOARD hookKeyboard; + PCONNECT_DATA connectData; + NTSTATUS status; + NTSTATUS tmp; + + { + status = 0L; + devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + Irp->IoStatus.Information = 0; + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + if (irpStack->Parameters.DeviceIoControl.IoControlCode == + (((11 << 16) | (128 << 2)) | 3)) { + goto switch_1_exp_0; } else { - if (irpStack->Parameters.DeviceIoControl.IoControlCode == (((11 << 16) | (4080 << 2)) | 3)) { - goto switch_1_exp_2; + if (irpStack->Parameters.DeviceIoControl.IoControlCode == + (((11 << 16) | (256 << 2)) | 3)) { + goto switch_1_exp_1; } else { - if (irpStack->Parameters.DeviceIoControl.IoControlCode == 11 << 16) { - goto switch_1_exp_3; + if (irpStack->Parameters.DeviceIoControl.IoControlCode == + (((11 << 16) | (4080 << 2)) | 3)) { + goto switch_1_exp_2; } else { - if (irpStack->Parameters.DeviceIoControl.IoControlCode == ((11 << 16) | (32 << 2))) { - goto switch_1_exp_4; + if (irpStack->Parameters.DeviceIoControl.IoControlCode == 11 << 16) { + goto switch_1_exp_3; } else { - if (irpStack->Parameters.DeviceIoControl.IoControlCode == ((11 << 16) | (16 << 2))) { - goto switch_1_exp_5; + if (irpStack->Parameters.DeviceIoControl.IoControlCode == + ((11 << 16) | (32 << 2))) { + goto switch_1_exp_4; } else { - if (irpStack->Parameters.DeviceIoControl.IoControlCode == ((11 << 16) | (2 << 2))) { - goto switch_1_exp_6; + if (irpStack->Parameters.DeviceIoControl.IoControlCode == + ((11 << 16) | (16 << 2))) { + goto switch_1_exp_5; } else { - if (irpStack->Parameters.DeviceIoControl.IoControlCode == ((11 << 16) | (8 << 2))) { - goto switch_1_exp_7; + if (irpStack->Parameters.DeviceIoControl.IoControlCode == + ((11 << 16) | (2 << 2))) { + goto switch_1_exp_6; } else { - if (irpStack->Parameters.DeviceIoControl.IoControlCode == ((11 << 16) | (1 << 2))) { - goto switch_1_exp_8; + if (irpStack->Parameters.DeviceIoControl.IoControlCode == + ((11 << 16) | (8 << 2))) { + goto switch_1_exp_7; } else { - if (0) { - switch_1_exp_0: /* CIL Label */ ; - if ((unsigned int )devExt->UpperConnectData.ClassService != (unsigned int )((void *)0)) { - status = -1073741757L; + if (irpStack->Parameters.DeviceIoControl.IoControlCode == + ((11 << 16) | (1 << 2))) { + goto switch_1_exp_8; + } else { + if (0) { + switch_1_exp_0: /* CIL Label */; + if ((unsigned int)devExt->UpperConnectData + .ClassService != (unsigned int)((void *)0)) { + status = -1073741757L; + goto switch_1_break; + } else { + if (irpStack->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(CONNECT_DATA)) { + status = -1073741811L; + goto switch_1_break; + } else { + } + } + connectData = + (struct _CONNECT_DATA *)irpStack->Parameters + .DeviceIoControl.Type3InputBuffer; + devExt->UpperConnectData = *connectData; + connectData->ClassDeviceObject = devExt->Self; + connectData->ClassService = &KbFilter_ServiceCallback; goto switch_1_break; - } else { - if (irpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CONNECT_DATA )) { + switch_1_exp_1: /* CIL Label */ + status = -1073741822L; + goto switch_1_break; + switch_1_exp_2: /* CIL Label */; + if (irpStack->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(INTERNAL_I8042_HOOK_KEYBOARD)) { status = -1073741811L; goto switch_1_break; } else { - } - } - connectData = (struct _CONNECT_DATA *)irpStack->Parameters.DeviceIoControl.Type3InputBuffer; - devExt->UpperConnectData = *connectData; - connectData->ClassDeviceObject = devExt->Self; - connectData->ClassService = & KbFilter_ServiceCallback; - goto switch_1_break; - switch_1_exp_1: /* CIL Label */ - status = -1073741822L; - goto switch_1_break; - switch_1_exp_2: /* CIL Label */ ; - if (irpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(INTERNAL_I8042_HOOK_KEYBOARD )) { - status = -1073741811L; + hookKeyboard = + (struct _INTERNAL_I8042_HOOK_KEYBOARD *)irpStack + ->Parameters.DeviceIoControl.Type3InputBuffer; + devExt->UpperContext = hookKeyboard->Context; + hookKeyboard->Context = (void *)DeviceObject; + if (hookKeyboard->InitializationRoutine) { + devExt->UpperInitializationRoutine = + hookKeyboard->InitializationRoutine; + } else { + } + hookKeyboard->InitializationRoutine = (NTSTATUS(*)( + PVOID InitializationContext, PVOID SynchFuncContext, + NTSTATUS(*ReadPort)(PVOID Context, PUCHAR Value, + BOOLEAN WaitForACK), + NTSTATUS(*WritePort)(PVOID Context, UCHAR Value, + BOOLEAN WaitForACK), + PBOOLEAN TurnTranslationOn))( + &KbFilter_InitializationRoutine); + if (hookKeyboard->IsrRoutine) { + devExt->UpperIsrHook = hookKeyboard->IsrRoutine; + } else { + } + hookKeyboard->IsrRoutine = (BOOLEAN(*)( + PVOID IsrContext, PKEYBOARD_INPUT_DATA CurrentInput, + POUTPUT_PACKET CurrentOutput, UCHAR StatusByte, + PUCHAR Byte, PBOOLEAN ContinueProcessing, + PKEYBOARD_SCAN_STATE ScanState))(&KbFilter_IsrHook); + devExt->IsrWritePort = hookKeyboard->IsrWritePort; + devExt->QueueKeyboardPacket = + hookKeyboard->QueueKeyboardPacket; + devExt->CallContext = hookKeyboard->CallContext; + status = 0L; + goto switch_1_break; + switch_1_exp_3: /* CIL Label */; + switch_1_exp_4: /* CIL Label */; + switch_1_exp_5: /* CIL Label */; + switch_1_exp_6: /* CIL Label */; + switch_1_exp_7: /* CIL Label */; + switch_1_exp_8: /* CIL Label */; goto switch_1_break; } else { - - } - hookKeyboard = (struct _INTERNAL_I8042_HOOK_KEYBOARD *)irpStack->Parameters.DeviceIoControl.Type3InputBuffer; - devExt->UpperContext = hookKeyboard->Context; - hookKeyboard->Context = (void *)DeviceObject; - if (hookKeyboard->InitializationRoutine) { - devExt->UpperInitializationRoutine = hookKeyboard->InitializationRoutine; - } else { - - } - hookKeyboard->InitializationRoutine = (NTSTATUS (*)(PVOID InitializationContext , - PVOID SynchFuncContext , - NTSTATUS (*ReadPort)(PVOID Context , - PUCHAR Value , - BOOLEAN WaitForACK ) , - NTSTATUS (*WritePort)(PVOID Context , - UCHAR Value , - BOOLEAN WaitForACK ) , - PBOOLEAN TurnTranslationOn ))(& KbFilter_InitializationRoutine); - if (hookKeyboard->IsrRoutine) { - devExt->UpperIsrHook = hookKeyboard->IsrRoutine; - } else { - + switch_1_break: /* CIL Label */; } - hookKeyboard->IsrRoutine = (BOOLEAN (*)(PVOID IsrContext , PKEYBOARD_INPUT_DATA CurrentInput , - POUTPUT_PACKET CurrentOutput , - UCHAR StatusByte , PUCHAR Byte , - PBOOLEAN ContinueProcessing , - PKEYBOARD_SCAN_STATE ScanState ))(& KbFilter_IsrHook); - devExt->IsrWritePort = hookKeyboard->IsrWritePort; - devExt->QueueKeyboardPacket = hookKeyboard->QueueKeyboardPacket; - devExt->CallContext = hookKeyboard->CallContext; - status = 0L; - goto switch_1_break; - switch_1_exp_3: /* CIL Label */ ; - switch_1_exp_4: /* CIL Label */ ; - switch_1_exp_5: /* CIL Label */ ; - switch_1_exp_6: /* CIL Label */ ; - switch_1_exp_7: /* CIL Label */ ; - switch_1_exp_8: /* CIL Label */ ; - goto switch_1_break; - } else { - switch_1_break: /* CIL Label */ ; } } } @@ -1939,231 +1948,275 @@ NTSTATUS KbFilter_InternIoCtl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } - } - if (! (status >= 0L)) { - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - IofCompleteRequest(Irp, 0); + if (!(status >= 0L)) { + { + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } else { } - return (status); - } else { - + { tmp = KbFilter_DispatchPassThrough(DeviceObject, Irp); } + return (tmp); } - { - tmp = KbFilter_DispatchPassThrough(DeviceObject, Irp); - } - return (tmp); } -} -NTSTATUS KbFilter_PnP(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION devExt ; - PIO_STACK_LOCATION irpStack ; - NTSTATUS status ; - KEVENT event ; - PIO_STACK_LOCATION irpSp ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___0 ; - - { - status = 0L; - devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - if (irpStack->MinorFunction == 0) { - goto switch_2_0; - } else { - if (irpStack->MinorFunction == 23) { - goto switch_2_23; +NTSTATUS KbFilter_PnP(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION devExt; + PIO_STACK_LOCATION irpStack; + NTSTATUS status; + KEVENT event; + PIO_STACK_LOCATION irpSp; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___0; + + { + status = 0L; + devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + if (irpStack->MinorFunction == 0) { + goto switch_2_0; } else { - if (irpStack->MinorFunction == 2) { - goto switch_2_2; + if (irpStack->MinorFunction == 23) { + goto switch_2_23; } else { - if (irpStack->MinorFunction == 1) { - goto switch_2_1; + if (irpStack->MinorFunction == 2) { + goto switch_2_2; } else { - if (irpStack->MinorFunction == 5) { - goto switch_2_5; + if (irpStack->MinorFunction == 1) { + goto switch_2_1; } else { - if (irpStack->MinorFunction == 3) { - goto switch_2_3; + if (irpStack->MinorFunction == 5) { + goto switch_2_5; } else { - if (irpStack->MinorFunction == 6) { - goto switch_2_6; + if (irpStack->MinorFunction == 3) { + goto switch_2_3; } else { - if (irpStack->MinorFunction == 13) { - goto switch_2_13; + if (irpStack->MinorFunction == 6) { + goto switch_2_6; } else { - if (irpStack->MinorFunction == 4) { - goto switch_2_4; + if (irpStack->MinorFunction == 13) { + goto switch_2_13; } else { - if (irpStack->MinorFunction == 7) { - goto switch_2_7; + if (irpStack->MinorFunction == 4) { + goto switch_2_4; } else { - if (irpStack->MinorFunction == 8) { - goto switch_2_8; + if (irpStack->MinorFunction == 7) { + goto switch_2_7; } else { - if (irpStack->MinorFunction == 9) { - goto switch_2_9; + if (irpStack->MinorFunction == 8) { + goto switch_2_8; } else { - if (irpStack->MinorFunction == 12) { - goto switch_2_12; + if (irpStack->MinorFunction == 9) { + goto switch_2_9; } else { - if (irpStack->MinorFunction == 10) { - goto switch_2_10; + if (irpStack->MinorFunction == 12) { + goto switch_2_12; } else { - if (irpStack->MinorFunction == 11) { - goto switch_2_11; + if (irpStack->MinorFunction == 10) { + goto switch_2_10; } else { - if (irpStack->MinorFunction == 15) { - goto switch_2_15; + if (irpStack->MinorFunction == 11) { + goto switch_2_11; } else { - if (irpStack->MinorFunction == 16) { - goto switch_2_16; + if (irpStack->MinorFunction == 15) { + goto switch_2_15; } else { - if (irpStack->MinorFunction == 17) { - goto switch_2_17; + if (irpStack->MinorFunction == 16) { + goto switch_2_16; } else { - if (irpStack->MinorFunction == 18) { - goto switch_2_18; + if (irpStack->MinorFunction == 17) { + goto switch_2_17; } else { - if (irpStack->MinorFunction == 19) { - goto switch_2_19; + if (irpStack->MinorFunction == 18) { + goto switch_2_18; } else { - if (irpStack->MinorFunction == 20) { - goto switch_2_20; + if (irpStack->MinorFunction == 19) { + goto switch_2_19; } else { - { - goto switch_2_default; - if (0) { - switch_2_0: /* CIL Label */ + if (irpStack->MinorFunction == 20) { + goto switch_2_20; + } else { { - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine)); - nextIrpSp->Control = 0; -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - } - if (s != NP) { + goto switch_2_default; + if (0) { + switch_2_0 : /* CIL Label */ { - errorFn(); + irpSp = + Irp->Tail.Overlay + .__annonCompField17 + .__annonCompField16 + .CurrentStackLocation; + nextIrpSp = + Irp->Tail.Overlay + .__annonCompField17 + .__annonCompField16 + .CurrentStackLocation - + 1; + memcpy( + nextIrpSp, irpSp, + (long)(&((IO_STACK_LOCATION + *)0) + ->CompletionRoutine)); + nextIrpSp->Control = 0; + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ } - } else { - if (compRegistered != 0) { + if (s != NP) { + { errorFn(); } + } else { + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + compFptr = + &KbFilter_Complete; + } + } { - errorFn(); + irpSp___0 = + Irp->Tail.Overlay + .__annonCompField17 + .__annonCompField16 + .CurrentStackLocation - + 1; + irpSp___0 + ->CompletionRoutine = + &KbFilter_Complete; + irpSp___0->Context = &event; + irpSp___0->Control = 0; + irpSp___0->Control = 64; + irpSp___0->Control = + (int) + irpSp___0->Control | + 128; + irpSp___0->Control = + (int) + irpSp___0->Control | + 32; + status = IofCallDriver( + devExt->TopOfStack, + Irp); } + if (259L == status) { + { + KeWaitForSingleObject( + &event, 0, 0, 0, + (void *)0); + } + } else { + } + if (status >= 0L) { + if ((long)myStatus >= 0L) { + devExt->Started = 1; + devExt->Removed = 0; + devExt->SurpriseRemoved = + 0; + } else { + } + } else { + } + { + Irp->IoStatus + .__annonCompField4 + .Status = status; + myStatus = status; + Irp->IoStatus.Information = + 0; + IofCompleteRequest(Irp, 0); + } + goto switch_2_break; + switch_2_23: /* CIL Label */ + devExt->SurpriseRemoved = 1; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = (CHAR)( + (int)Irp + ->CurrentLocation + + 1); + Irp->Tail.Overlay + .__annonCompField17 + .__annonCompField16 + .CurrentStackLocation += + 1; + status = IofCallDriver( + devExt->TopOfStack, + Irp); + } + goto switch_2_break; + switch_2_2: /* CIL Label */ + devExt->Removed = 1; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = (CHAR)( + (int)Irp + ->CurrentLocation + + 1); + Irp->Tail.Overlay + .__annonCompField17 + .__annonCompField16 + .CurrentStackLocation += + 1; + IofCallDriver( + devExt->TopOfStack, + Irp); + /* IoDetachDevice(devExt->TopOfStack); */ /* INLINED */ + /* IoDeleteDevice(DeviceObject); */ /* INLINED */ + status = 0L; + } + goto switch_2_break; + switch_2_1: /* CIL Label */; + switch_2_5: /* CIL Label */; + switch_2_3: /* CIL Label */; + switch_2_6: /* CIL Label */; + switch_2_13: /* CIL Label */; + switch_2_4: /* CIL Label */; + switch_2_7: /* CIL Label */; + switch_2_8: /* CIL Label */; + switch_2_9: /* CIL Label */; + switch_2_12: /* CIL Label */; + switch_2_10: /* CIL Label */; + switch_2_11: /* CIL Label */; + switch_2_15: /* CIL Label */; + switch_2_16: /* CIL Label */; + switch_2_17: /* CIL Label */; + switch_2_18: /* CIL Label */; + switch_2_19: /* CIL Label */; + switch_2_20: /* CIL Label */; + switch_2_default + : /* CIL Label */; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = (CHAR)( + (int)Irp + ->CurrentLocation + + 1); + Irp->Tail.Overlay + .__annonCompField17 + .__annonCompField16 + .CurrentStackLocation += + 1; + status = IofCallDriver( + devExt->TopOfStack, + Irp); + } + goto switch_2_break; } else { - compRegistered = 1; - compFptr = & KbFilter_Complete; - } - } - { - irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp___0->CompletionRoutine = & KbFilter_Complete; - irpSp___0->Context = & event; - irpSp___0->Control = 0; - irpSp___0->Control = 64; - irpSp___0->Control = (int )irpSp___0->Control | 128; - irpSp___0->Control = (int )irpSp___0->Control | 32; - status = IofCallDriver(devExt->TopOfStack, - Irp); - } - if (259L == status) { - { - KeWaitForSingleObject(& event, 0, - 0, 0, (void *)0); - } - } else { - - } - if (status >= 0L) { - if ((long )myStatus >= 0L) { - devExt->Started = 1; - devExt->Removed = 0; - devExt->SurpriseRemoved = 0; - } else { - - } - } else { - - } - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - Irp->IoStatus.Information = 0; - IofCompleteRequest(Irp, 0); - } - goto switch_2_break; - switch_2_23: /* CIL Label */ - devExt->SurpriseRemoved = 1; - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); - } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - status = IofCallDriver(devExt->TopOfStack, - Irp); - } - goto switch_2_break; - switch_2_2: /* CIL Label */ - devExt->Removed = 1; - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); - } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - IofCallDriver(devExt->TopOfStack, Irp); -/* IoDetachDevice(devExt->TopOfStack); */ /* INLINED */ -/* IoDeleteDevice(DeviceObject); */ /* INLINED */ - status = 0L; - } - goto switch_2_break; - switch_2_1: /* CIL Label */ ; - switch_2_5: /* CIL Label */ ; - switch_2_3: /* CIL Label */ ; - switch_2_6: /* CIL Label */ ; - switch_2_13: /* CIL Label */ ; - switch_2_4: /* CIL Label */ ; - switch_2_7: /* CIL Label */ ; - switch_2_8: /* CIL Label */ ; - switch_2_9: /* CIL Label */ ; - switch_2_12: /* CIL Label */ ; - switch_2_10: /* CIL Label */ ; - switch_2_11: /* CIL Label */ ; - switch_2_15: /* CIL Label */ ; - switch_2_16: /* CIL Label */ ; - switch_2_17: /* CIL Label */ ; - switch_2_18: /* CIL Label */ ; - switch_2_19: /* CIL Label */ ; - switch_2_20: /* CIL Label */ ; - switch_2_default: /* CIL Label */ ; - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); + switch_2_break: /* CIL Label */; } } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - status = IofCallDriver(devExt->TopOfStack, - Irp); - } - goto switch_2_break; - } else { - switch_2_break: /* CIL Label */ ; - } } } } @@ -2185,368 +2238,351 @@ NTSTATUS KbFilter_PnP(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } + return (status); } - return (status); } -} -NTSTATUS KbFilter_Power(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION irpStack ; - PDEVICE_EXTENSION devExt ; - POWER_STATE powerState ; - POWER_STATE_TYPE powerType ; - NTSTATUS tmp ; - - { - devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - powerType = irpStack->Parameters.Power.Type; - powerState = irpStack->Parameters.Power.State; - if (irpStack->MinorFunction == 2) { - goto switch_3_2; - } else { - if (irpStack->MinorFunction == 1) { - goto switch_3_1; +NTSTATUS KbFilter_Power(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION irpStack; + PDEVICE_EXTENSION devExt; + POWER_STATE powerState; + POWER_STATE_TYPE powerType; + NTSTATUS tmp; + + { + devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + powerType = irpStack->Parameters.Power.Type; + powerState = irpStack->Parameters.Power.State; + if (irpStack->MinorFunction == 2) { + goto switch_3_2; } else { - if (irpStack->MinorFunction == 0) { - goto switch_3_0; + if (irpStack->MinorFunction == 1) { + goto switch_3_1; } else { - if (irpStack->MinorFunction == 3) { - goto switch_3_3; + if (irpStack->MinorFunction == 0) { + goto switch_3_0; } else { - { - goto switch_3_default; - if (0) { - switch_3_2: /* CIL Label */ ; - if ((int )powerType == 1) { - devExt->DeviceState = powerState.DeviceState; - } else { - - } - switch_3_1: /* CIL Label */ ; - switch_3_0: /* CIL Label */ ; - switch_3_3: /* CIL Label */ ; - switch_3_default: /* CIL Label */ ; - goto switch_3_break; + if (irpStack->MinorFunction == 3) { + goto switch_3_3; } else { - switch_3_break: /* CIL Label */ ; - } + { + goto switch_3_default; + if (0) { + switch_3_2: /* CIL Label */; + if ((int)powerType == 1) { + devExt->DeviceState = powerState.DeviceState; + } else { + } + switch_3_1: /* CIL Label */; + switch_3_0: /* CIL Label */; + switch_3_3: /* CIL Label */; + switch_3_default: /* CIL Label */; + goto switch_3_break; + } else { + switch_3_break: /* CIL Label */; + } + } } } } } - } - { -/* PoStartNextPowerIrp(Irp); */ /* INLINED */ - } - if (s == NP) { - s = SKIP1; - } else { + { /* PoStartNextPowerIrp(Irp); */ /* INLINED */ + } + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } { - errorFn(); + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + tmp = PoCallDriver(devExt->TopOfStack, Irp); } + return (tmp); } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - tmp = PoCallDriver(devExt->TopOfStack, Irp); - } - return (tmp); } -} -NTSTATUS KbFilter_InitializationRoutine(PDEVICE_OBJECT DeviceObject , PVOID SynchFuncContext , - NTSTATUS (*ReadPort)(PVOID Context , PUCHAR Value , - BOOLEAN WaitForACK ) , - NTSTATUS (*WritePort)(PVOID Context , UCHAR Value , - BOOLEAN WaitForACK ) , - PBOOLEAN TurnTranslationOn ) -{ PDEVICE_EXTENSION devExt ; - NTSTATUS status ; +NTSTATUS KbFilter_InitializationRoutine( + PDEVICE_OBJECT DeviceObject, PVOID SynchFuncContext, + NTSTATUS (*ReadPort)(PVOID Context, PUCHAR Value, BOOLEAN WaitForACK), + NTSTATUS (*WritePort)(PVOID Context, UCHAR Value, BOOLEAN WaitForACK), + PBOOLEAN TurnTranslationOn) { + PDEVICE_EXTENSION devExt; + NTSTATUS status; { - status = 0L; - devExt = DeviceObject->DeviceExtension; - if (devExt->UpperInitializationRoutine) { - { - status = (*(devExt->UpperInitializationRoutine))(devExt->UpperContext, SynchFuncContext, - ReadPort, WritePort, TurnTranslationOn); - } - if (! (status >= 0L)) { - return (status); + status = 0L; + devExt = DeviceObject->DeviceExtension; + if (devExt->UpperInitializationRoutine) { + { + status = (*(devExt->UpperInitializationRoutine))( + devExt->UpperContext, SynchFuncContext, ReadPort, WritePort, + TurnTranslationOn); + } + if (!(status >= 0L)) { + return (status); + } else { + } } else { - } - } else { - + *TurnTranslationOn = 1; + return (status); } - *TurnTranslationOn = 1; - return (status); -} } -BOOLEAN KbFilter_IsrHook(PDEVICE_OBJECT DeviceObject , PKEYBOARD_INPUT_DATA CurrentInput , - POUTPUT_PACKET CurrentOutput , UCHAR StatusByte , PUCHAR DataByte , - PBOOLEAN ContinueProcessing , PKEYBOARD_SCAN_STATE ScanState ) -{ PDEVICE_EXTENSION devExt ; - BOOLEAN retVal ; +BOOLEAN KbFilter_IsrHook(PDEVICE_OBJECT DeviceObject, + PKEYBOARD_INPUT_DATA CurrentInput, + POUTPUT_PACKET CurrentOutput, UCHAR StatusByte, + PUCHAR DataByte, PBOOLEAN ContinueProcessing, + PKEYBOARD_SCAN_STATE ScanState) { + PDEVICE_EXTENSION devExt; + BOOLEAN retVal; { - retVal = 1; - devExt = DeviceObject->DeviceExtension; - if (devExt->UpperIsrHook) { - { - retVal = (*(devExt->UpperIsrHook))(devExt->UpperContext, CurrentInput, CurrentOutput, - StatusByte, DataByte, ContinueProcessing, ScanState); - } - if (! retVal) { - return (retVal); - } else { - if (! *ContinueProcessing) { + retVal = 1; + devExt = DeviceObject->DeviceExtension; + if (devExt->UpperIsrHook) { + { + retVal = (*(devExt->UpperIsrHook))(devExt->UpperContext, CurrentInput, + CurrentOutput, StatusByte, DataByte, + ContinueProcessing, ScanState); + } + if (!retVal) { return (retVal); } else { - + if (!*ContinueProcessing) { + return (retVal); + } else { + } } + } else { } - } else { - + *ContinueProcessing = 1; + return (retVal); } - *ContinueProcessing = 1; - return (retVal); } -} -void KbFilter_ServiceCallback(PDEVICE_OBJECT DeviceObject , PKEYBOARD_INPUT_DATA InputDataStart , - PKEYBOARD_INPUT_DATA InputDataEnd , PULONG InputDataConsumed ) -{ PDEVICE_EXTENSION devExt ; +void KbFilter_ServiceCallback(PDEVICE_OBJECT DeviceObject, + PKEYBOARD_INPUT_DATA InputDataStart, + PKEYBOARD_INPUT_DATA InputDataEnd, + PULONG InputDataConsumed) { + PDEVICE_EXTENSION devExt; { - { - devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - (*((void (*)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 , - PVOID SystemArgument3 ))devExt->UpperConnectData.ClassService))(devExt->UpperConnectData.ClassDeviceObject, - InputDataStart, - InputDataEnd, - InputDataConsumed); + { + devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + (*((void (*)( + PVOID NormalContext, PVOID SystemArgument1, PVOID SystemArgument2, + PVOID SystemArgument3))devExt->UpperConnectData.ClassService))( + devExt->UpperConnectData.ClassDeviceObject, InputDataStart, + InputDataEnd, InputDataConsumed); + } + return; } - return; -} } -void KbFilter_Unload(PDRIVER_OBJECT Driver ) -{ +void KbFilter_Unload(PDRIVER_OBJECT Driver) { - { - return; -} + { return; } } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) -IRP *pirp ; -void stub_driver_init(void) -{ - - { - s = NP; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - return; -} -} -int main(void) -{ DRIVER_OBJECT d ; - UNICODE_STRING u ; - NTSTATUS status ; - int we_should_unload = __VERIFIER_nondet_int() ; - PIRP irp ; - int __BLAST_NONDET = __VERIFIER_nondet_int() ; - int irp_choice = __VERIFIER_nondet_int() ; - DEVICE_OBJECT devobj ; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +IRP *pirp; +void stub_driver_init(void) { { - { - pirp = & irp; - _BLAST_init(); - status = DriverEntry(& d, & u); - } - if (status >= 0L) { s = NP; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; customIrp = 0; - setEventCalled = customIrp; - lowerDriverReturn = setEventCalled; - compRegistered = lowerDriverReturn; - compFptr = compRegistered; - pended = compFptr; - pirp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (irp_choice == 0) { - pirp->IoStatus.__annonCompField4.Status = -1073741637L; - myStatus = -1073741637L; - } else { + return; + } +} +int main(void) { + DRIVER_OBJECT d; + UNICODE_STRING u; + NTSTATUS status; + int we_should_unload = __VERIFIER_nondet_int(); + PIRP irp; + int __BLAST_NONDET = __VERIFIER_nondet_int(); + int irp_choice = __VERIFIER_nondet_int(); + DEVICE_OBJECT devobj; - } + { { - status = KbFilter_AddDevice(& d, & devobj); - stub_driver_init(); - } - if (! (status >= 0L)) { - return (-1); - } else { - + pirp = &irp; + _BLAST_init(); + status = DriverEntry(&d, &u); } - if (__BLAST_NONDET == 0) { - goto switch_4_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_4_1; + if (status >= 0L) { + s = NP; + customIrp = 0; + setEventCalled = customIrp; + lowerDriverReturn = setEventCalled; + compRegistered = lowerDriverReturn; + compFptr = compRegistered; + pended = compFptr; + pirp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (irp_choice == 0) { + pirp->IoStatus.__annonCompField4.Status = -1073741637L; + myStatus = -1073741637L; + } else { + } + { + status = KbFilter_AddDevice(&d, &devobj); + stub_driver_init(); + } + if (!(status >= 0L)) { + return (-1); + } else { + } + if (__BLAST_NONDET == 0) { + goto switch_4_0; } else { - if (__BLAST_NONDET == 2) { - goto switch_4_2; + if (__BLAST_NONDET == 1) { + goto switch_4_1; } else { - if (__BLAST_NONDET == 3) { - goto switch_4_3; + if (__BLAST_NONDET == 2) { + goto switch_4_2; } else { - if (__BLAST_NONDET == 4) { - goto switch_4_4; + if (__BLAST_NONDET == 3) { + goto switch_4_3; } else { - if (__BLAST_NONDET == 8) { - goto switch_4_8; + if (__BLAST_NONDET == 4) { + goto switch_4_4; } else { - { - goto switch_4_default; - if (0) { - switch_4_0: /* CIL Label */ - { - status = KbFilter_CreateClose(& devobj, pirp); - } - goto switch_4_break; - switch_4_1: /* CIL Label */ - { - status = KbFilter_CreateClose(& devobj, pirp); - } - goto switch_4_break; - switch_4_2: /* CIL Label */ - { - status = KbFilter_IoCtl(& devobj, pirp); - } - goto switch_4_break; - switch_4_3: /* CIL Label */ - { - status = KbFilter_PnP(& devobj, pirp); - } - goto switch_4_break; - switch_4_4: /* CIL Label */ - { - status = KbFilter_Power(& devobj, pirp); - } - goto switch_4_break; - switch_4_8: /* CIL Label */ + if (__BLAST_NONDET == 8) { + goto switch_4_8; + } else { { - status = KbFilter_InternIoCtl(& devobj, pirp); + goto switch_4_default; + if (0) { + switch_4_0 : /* CIL Label */ + { + status = KbFilter_CreateClose(&devobj, pirp); + } + goto switch_4_break; + switch_4_1 : /* CIL Label */ + { + status = KbFilter_CreateClose(&devobj, pirp); + } + goto switch_4_break; + switch_4_2 : /* CIL Label */ + { + status = KbFilter_IoCtl(&devobj, pirp); + } + goto switch_4_break; + switch_4_3 : /* CIL Label */ + { + status = KbFilter_PnP(&devobj, pirp); + } + goto switch_4_break; + switch_4_4 : /* CIL Label */ + { + status = KbFilter_Power(&devobj, pirp); + } + goto switch_4_break; + switch_4_8 : /* CIL Label */ + { + status = KbFilter_InternIoCtl(&devobj, pirp); + } + goto switch_4_break; + switch_4_default: /* CIL Label */; + return (-1); + } else { + switch_4_break: /* CIL Label */; + } } - goto switch_4_break; - switch_4_default: /* CIL Label */ ; - return (-1); - } else { - switch_4_break: /* CIL Label */ ; - } } } } } } } - } - if (we_should_unload) { - { -/* KbFilter_Unload(& d); */ /* INLINED */ + if (we_should_unload) { + { /* KbFilter_Unload(& d); */ /* INLINED */ + } + } else { } } else { - } - } else { - - } - if (pended == 1) { - if (s == NP) { - s = NP; - } else { - goto _L___2; - } - } else { - _L___2: /* CIL Label */ if (pended == 1) { - if (s == MPR3) { - s = MPR3; + if (s == NP) { + s = NP; } else { - goto _L___1; + goto _L___2; } } else { - _L___1: /* CIL Label */ - if (s == UNLOADED) { - + _L___2: /* CIL Label */ + if (pended == 1) { + if (s == MPR3) { + s = MPR3; + } else { + goto _L___1; + } } else { - if (status == -1L) { + _L___1: /* CIL Label */ + if (s == UNLOADED) { } else { - if (s != SKIP2) { - if (s != IPC) { - if (s != DC) { + if (status == -1L) { - } else { - goto _L___0; - } - } else { - goto _L___0; - } } else { - _L___0: /* CIL Label */ - if (pended == 1) { - if (status != 259L) { - { - errorFn(); + if (s != SKIP2) { + if (s != IPC) { + if (s != DC) { + + } else { + goto _L___0; } } else { - + goto _L___0; } } else { - if (s == DC) { - if (status == 259L) { - { - errorFn(); - } + _L___0: /* CIL Label */ + if (pended == 1) { + if (status != 259L) { + { errorFn(); } } else { - } } else { - if (status != (NTSTATUS )lowerDriverReturn) { - + if (s == DC) { + if (status == 259L) { + { errorFn(); } + } else { + } } else { + if (status != (NTSTATUS)lowerDriverReturn) { + } else { + } } } } @@ -2554,1094 +2590,954 @@ int main(void) } } } - } - return (status); -} -} -char _SLAM_alloc_dummy ; -char *malloc(int i ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - - { - if (__BLAST_NONDET) { - return ((char *)0); - } else { - return ((char *)1); + return (status); } } -} - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; -void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) -{ +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; -void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) -{ +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; -PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , SIZE_T NumberOfBytes , - ULONG Tag ) -{ PVOID x ; - char *tmp ; +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag) { + PVOID x; + char *tmp; { - { - tmp = malloc(NumberOfBytes); - x = tmp; + { + tmp = malloc(NumberOfBytes); + x = tmp; + } + return (x); } - return (x); -} } - void ExFreePool(PVOID P ) ; -void ExFreePool(PVOID P ) -{ +void ExFreePool(PVOID P); +void ExFreePool(PVOID P) { - { - return; -} + { return; } } - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); + { return ((void *)0); } } -} - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; -PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , BOOLEAN SecondaryBuffer , - BOOLEAN ChargeQuota , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_5_0; - } else { - { - goto switch_5_default; - if (0) { - switch_5_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_5_0; + } else { { - tmp = malloc(sizeof(MDL )); + goto switch_5_default; + if (0) { + switch_5_0 : /* CIL Label */ + { + tmp = malloc(sizeof(MDL)); + } + return ((void *)tmp); + switch_5_default: /* CIL Label */; + return ((void *)0); + } else { + switch_5_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_5_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_5_break: /* CIL Label */ ; - } } } } -} - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; -PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , PDEVICE_OBJECT TargetDevice ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_6_0; - } else { - { - goto switch_6_default; - if (0) { - switch_6_0: /* CIL Label */ ; - return (TargetDevice); - switch_6_default: /* CIL Label */ ; - return ((void *)0); + if (__BLAST_NONDET == 0) { + goto switch_6_0; } else { - switch_6_break: /* CIL Label */ ; - } + { + goto switch_6_default; + if (0) { + switch_6_0: /* CIL Label */; + return (TargetDevice); + switch_6_default: /* CIL Label */; + return ((void *)0); + } else { + switch_6_break: /* CIL Label */; + } + } } } } -} - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , PDEVICE_OBJECT DeviceObject , - PVOID Buffer , ULONG Length , PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - customIrp = 1; - if (__BLAST_NONDET == 0) { - goto switch_7_0; - } else { - { - goto switch_7_default; - if (0) { - switch_7_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET == 0) { + goto switch_7_0; + } else { { - tmp = malloc(sizeof(IRP )); + goto switch_7_default; + if (0) { + switch_7_0 : /* CIL Label */ + { + tmp = malloc(sizeof(IRP)); + } + return ((void *)tmp); + switch_7_default: /* CIL Label */; + return ((void *)0); + } else { + switch_7_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_7_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_7_break: /* CIL Label */ ; - } } } } -} - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , BOOLEAN InternalDeviceIoControl , - PKEVENT Event , PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; - - { - customIrp = 1; - if (__BLAST_NONDET == 0) { - goto switch_8_0; - } else { - { - goto switch_8_default; - if (0) { - switch_8_0: /* CIL Label */ +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; + + { + customIrp = 1; + if (__BLAST_NONDET == 0) { + goto switch_8_0; + } else { { - tmp = malloc(sizeof(IRP )); + goto switch_8_default; + if (0) { + switch_8_0 : /* CIL Label */ + { + tmp = malloc(sizeof(IRP)); + } + return ((void *)tmp); + switch_8_default: /* CIL Label */; + return ((void *)0); + } else { + switch_8_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_8_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_8_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; -NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_9_0; - } else { - { - goto switch_9_default; - if (0) { - switch_9_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_9_0; + } else { { - tmp = malloc(sizeof(DEVICE_OBJECT )); - *DeviceObject = (void *)tmp; + goto switch_9_default; + if (0) { + switch_9_0 : /* CIL Label */ + { + tmp = malloc(sizeof(DEVICE_OBJECT)); + *DeviceObject = (void *)tmp; + } + return (0L); + switch_9_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_9_break: /* CIL Label */; + } } - return (0L); - switch_9_default: /* CIL Label */ ; - return (-1073741823L); - } else { - switch_9_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; -NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , PUNICODE_STRING DeviceName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_10_0; - } else { - { - goto switch_10_default; - if (0) { - switch_10_0: /* CIL Label */ ; - return (0L); - switch_10_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_10_0; } else { - switch_10_break: /* CIL Label */ ; - } + { + goto switch_10_default; + if (0) { + switch_10_0: /* CIL Label */; + return (0L); + switch_10_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_10_break: /* CIL Label */; + } + } } } } -} - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; -void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) -{ +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject) { - { - return; + { return; } } -} - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_11_0; - } else { - { - goto switch_11_default; - if (0) { - switch_11_0: /* CIL Label */ ; - return (0L); - switch_11_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_11_0; } else { - switch_11_break: /* CIL Label */ ; - } + { + goto switch_11_default; + if (0) { + switch_11_0: /* CIL Label */; + return (0L); + switch_11_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_11_break: /* CIL Label */; + } + } } } } -} - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; -void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) -{ +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice) { - { - return; -} + { return; } } - void IoFreeIrp(PIRP Irp ) ; -void IoFreeIrp(PIRP Irp ) -{ +void IoFreeIrp(PIRP Irp); +void IoFreeIrp(PIRP Irp) { - { - return; -} + { return; } } - void IoFreeMdl(PMDL Mdl ) ; -void IoFreeMdl(PMDL Mdl ) -{ +void IoFreeMdl(PMDL Mdl); +void IoFreeMdl(PMDL Mdl) { - { - return; + { return; } } -} - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; -PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) -{ char *tmp ; +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) { + char *tmp; { - { - tmp = malloc(sizeof(CONFIGURATION_INFORMATION )); + { tmp = malloc(sizeof(CONFIGURATION_INFORMATION)); } + return ((void *)tmp); } - return ((void *)tmp); -} -} - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; -NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , PULONG BusNumber , PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +} +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_12_0; - } else { - { - goto switch_12_default; - if (0) { - switch_12_0: /* CIL Label */ ; - return (0L); - switch_12_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_12_0; } else { - switch_12_break: /* CIL Label */ ; - } + { + goto switch_12_default; + if (0) { + switch_12_0: /* CIL Label */; + return (0L); + switch_12_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_12_break: /* CIL Label */; + } + } } } } -} - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_13_0; - } else { - { - goto switch_13_default; - if (0) { - switch_13_0: /* CIL Label */ ; - return (0L); - switch_13_default: /* CIL Label */ ; - return (-1073741808L); + if (__BLAST_NONDET == 0) { + goto switch_13_0; } else { - switch_13_break: /* CIL Label */ ; - } + { + goto switch_13_default; + if (0) { + switch_13_0: /* CIL Label */; + return (0L); + switch_13_default: /* CIL Label */; + return (-1073741808L); + } else { + switch_13_break: /* CIL Label */; + } + } } } } -} - void IoReleaseCancelSpinLock(KIRQL Irql ) ; -void IoReleaseCancelSpinLock(KIRQL Irql ) -{ +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoReleaseCancelSpinLock(KIRQL Irql) { - { - return; -} + { return; } } - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , BOOLEAN Enable ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_14_0; - } else { - { - goto switch_14_default; - if (0) { - switch_14_0: /* CIL Label */ ; - return (0L); - switch_14_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_14_0; } else { - switch_14_break: /* CIL Label */ ; - } + { + goto switch_14_default; + if (0) { + switch_14_0: /* CIL Label */; + return (0L); + switch_14_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_14_break: /* CIL Label */; + } + } } } } -} - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; -void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) -{ +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject) { - { - return; -} + { return; } } -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { - if (s == NP) { - s = MPR1; - } else { - { - errorFn(); + if (s == NP) { + s = MPR1; + } else { + { errorFn(); } } + return; } - return; -} } - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - NTSTATUS returnVal2 ; - int compRetStatus ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + NTSTATUS returnVal2; + int compRetStatus; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; { - if (compRegistered) { - { - tmp = KbFilter_Complete(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - if ((long )compRetStatus == -1073741802L) { + if (compRegistered) { { - stubMoreProcessingRequired(); + tmp = KbFilter_Complete(DeviceObject, Irp, lcontext); + compRetStatus = tmp; + } + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET == 0) { - goto switch_15_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_15_1; + if (__BLAST_NONDET == 0) { + goto switch_15_0; } else { - { - goto switch_15_default; - if (0) { - switch_15_0: /* CIL Label */ - returnVal2 = 0L; - goto switch_15_break; - switch_15_1: /* CIL Label */ - returnVal2 = -1073741823L; - goto switch_15_break; - switch_15_default: /* CIL Label */ - returnVal2 = 259L; - goto switch_15_break; + if (__BLAST_NONDET == 1) { + goto switch_15_1; } else { - switch_15_break: /* CIL Label */ ; - } + { + goto switch_15_default; + if (0) { + switch_15_0: /* CIL Label */ + returnVal2 = 0L; + goto switch_15_break; + switch_15_1: /* CIL Label */ + returnVal2 = -1073741823L; + goto switch_15_break; + switch_15_default: /* CIL Label */ + returnVal2 = 259L; + goto switch_15_break; + } else { + switch_15_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal2; - } else { - if (s == MPR1) { - if (returnVal2 == 259L) { - s = MPR3; - lowerDriverReturn = returnVal2; - } else { - s = NP; - lowerDriverReturn = returnVal2; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal2; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal2; + if (s == MPR1) { + if (returnVal2 == 259L) { + s = MPR3; + lowerDriverReturn = returnVal2; + } else { + s = NP; + lowerDriverReturn = returnVal2; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal2; + } else { + { errorFn(); } } } } + return (returnVal2); } - return (returnVal2); -} } - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; -void IofCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) -{ +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost) { { - if (s == NP) { - s = DC; - } else { - { - errorFn(); + if (s == NP) { + s = DC; + } else { + { errorFn(); } } + return; } - return; } -} - KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ; -KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) -{ +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock); +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock) { - { - return ((unsigned char)0); -} + { return ((unsigned char)0); } } - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; -NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , BOOLEAN Alertable , PLARGE_INTEGER Interval ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_16_0; - } else { - { - goto switch_16_default; - if (0) { - switch_16_0: /* CIL Label */ ; - return (0L); - switch_16_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_16_0; } else { - switch_16_break: /* CIL Label */ ; - } + { + goto switch_16_default; + if (0) { + switch_16_0: /* CIL Label */; + return (0L); + switch_16_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_16_break: /* CIL Label */; + } + } } } } -} - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; -void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , BOOLEAN State ) -{ +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State) { - { - return; -} + { return; } } - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; -void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , LONG Count , LONG Limit ) -{ +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit) { - { - return; + { return; } } -} - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; -void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) -{ +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock) { - { - return; -} + { return; } } - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; -LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , LONG Adjustment , - BOOLEAN Wait ) -{ LONG r = __VERIFIER_nondet_long() ; +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait) { + LONG r = __VERIFIER_nondet_long(); - { - return (r); -} + { return (r); } } - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; -void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , KIRQL NewIrql ) -{ +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql) { - { - return; -} + { return; } } - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; -LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , BOOLEAN Wait ) -{ LONG l = __VERIFIER_nondet_long() ; +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait) { + LONG l = __VERIFIER_nondet_long(); { - setEventCalled = 1; - return (l); -} + setEventCalled = 1; + return (l); + } } - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; -NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , PLARGE_INTEGER Timeout ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (s == MPR3) { - if (setEventCalled == 1) { - s = NP; - setEventCalled = 0; - } else { - goto _L; - } - } else { - _L: /* CIL Label */ - if (customIrp == 1) { - s = NP; - customIrp = 0; + if (s == MPR3) { + if (setEventCalled == 1) { + s = NP; + setEventCalled = 0; + } else { + goto _L; + } } else { - if (s == MPR3) { - { - errorFn(); - } + _L: /* CIL Label */ + if (customIrp == 1) { + s = NP; + customIrp = 0; } else { - + if (s == MPR3) { + { errorFn(); } + } else { + } } } - } - if (__BLAST_NONDET == 0) { - goto switch_17_0; - } else { - { - goto switch_17_default; - if (0) { - switch_17_0: /* CIL Label */ ; - return (0L); - switch_17_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_17_0; } else { - switch_17_break: /* CIL Label */ ; - } + { + goto switch_17_default; + if (0) { + switch_17_0: /* CIL Label */; + return (0L); + switch_17_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_17_break: /* CIL Label */; + } + } } } } -} - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; -PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , PHYSICAL_ADDRESS HighestAcceptableAddress ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_18_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_18_1; + if (__BLAST_NONDET == 0) { + goto switch_18_0; } else { - if (0) { - switch_18_0: /* CIL Label */ + if (__BLAST_NONDET == 1) { + goto switch_18_1; + } else { + if (0) { + switch_18_0 : /* CIL Label */ { - tmp = malloc(NumberOfBytes); + tmp = malloc(NumberOfBytes); + } + return (tmp); + switch_18_1: /* CIL Label */; + return ((void *)0); + } else { + switch_18_break: /* CIL Label */; } - return (tmp); - switch_18_1: /* CIL Label */ ; - return ((void *)0); - } else { - switch_18_break: /* CIL Label */ ; } } + return ((void *)0); } - return ((void *)0); } -} - void MmFreeContiguousMemory(PVOID BaseAddress ) ; -void MmFreeContiguousMemory(PVOID BaseAddress ) -{ +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmFreeContiguousMemory(PVOID BaseAddress) { - { - return; -} + { return; } } - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; -PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , PVOID BaseAddress , - ULONG BugCheckOnFailure , MM_PAGE_PRIORITY Priority ) -{ +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority) { - { - return ((void *)0); -} + { return ((void *)0); } } - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; -PVOID MmPageEntireDriver(PVOID AddressWithinSection ) -{ +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection) { - { - return ((void *)0); + { return ((void *)0); } } -} - void MmResetDriverPaging(PVOID AddressWithinSection ) ; -void MmResetDriverPaging(PVOID AddressWithinSection ) -{ +void MmResetDriverPaging(PVOID AddressWithinSection); +void MmResetDriverPaging(PVOID AddressWithinSection) { - { - return; -} + { return; } } - void MmUnlockPages(PMDL MemoryDescriptorList ) ; -void MmUnlockPages(PMDL MemoryDescriptorList ) -{ +void MmUnlockPages(PMDL MemoryDescriptorList); +void MmUnlockPages(PMDL MemoryDescriptorList) { - { - return; -} + { return; } } - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; -NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , ACCESS_MASK DesiredAccess , POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , PVOID *Object , POBJECT_HANDLE_INFORMATION HandleInformation ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_19_0; - } else { - { - goto switch_19_default; - if (0) { - switch_19_0: /* CIL Label */ ; - return (0L); - switch_19_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_19_0; } else { - switch_19_break: /* CIL Label */ ; - } + { + goto switch_19_default; + if (0) { + switch_19_0: /* CIL Label */; + return (0L); + switch_19_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_19_break: /* CIL Label */; + } + } } } } -} - void ObfDereferenceObject(PVOID Object ) ; -void ObfDereferenceObject(PVOID Object ) -{ +void ObfDereferenceObject(PVOID Object); +void ObfDereferenceObject(PVOID Object) { - { - return; -} + { return; } } - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - int compRetStatus ; - NTSTATUS returnVal ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + int compRetStatus; + NTSTATUS returnVal; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; { - if (compRegistered) { - { - tmp = KbFilter_Complete(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - if ((long )compRetStatus == -1073741802L) { + if (compRegistered) { { - stubMoreProcessingRequired(); + tmp = KbFilter_Complete(DeviceObject, Irp, lcontext); + compRetStatus = tmp; + } + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET == 0) { - goto switch_20_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_20_1; + if (__BLAST_NONDET == 0) { + goto switch_20_0; } else { - { - goto switch_20_default; - if (0) { - switch_20_0: /* CIL Label */ - returnVal = 0L; - goto switch_20_break; - switch_20_1: /* CIL Label */ - returnVal = -1073741823L; - goto switch_20_break; - switch_20_default: /* CIL Label */ - returnVal = 259L; - goto switch_20_break; + if (__BLAST_NONDET == 1) { + goto switch_20_1; } else { - switch_20_break: /* CIL Label */ ; - } + { + goto switch_20_default; + if (0) { + switch_20_0: /* CIL Label */ + returnVal = 0L; + goto switch_20_break; + switch_20_1: /* CIL Label */ + returnVal = -1073741823L; + goto switch_20_break; + switch_20_default: /* CIL Label */ + returnVal = 259L; + goto switch_20_break; + } else { + switch_20_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal; - } else { - if (s == MPR1) { - if (returnVal == 259L) { - s = MPR3; - lowerDriverReturn = returnVal; - } else { - s = NP; - lowerDriverReturn = returnVal; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal; + if (s == MPR1) { + if (returnVal == 259L) { + s = MPR3; + lowerDriverReturn = returnVal; + } else { + s = NP; + lowerDriverReturn = returnVal; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal; + } else { + { errorFn(); } } } } + return (returnVal); } - return (returnVal); } -} - void PoStartNextPowerIrp(PIRP Irp ) ; -void PoStartNextPowerIrp(PIRP Irp ) -{ +void PoStartNextPowerIrp(PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp) { - { - return; -} + { return; } } - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; -NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , ULONG DesiredAccess , POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , PCLIENT_ID ClientId , void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_21_0; - } else { - { - goto switch_21_default; - if (0) { - switch_21_0: /* CIL Label */ ; - return (0L); - switch_21_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_21_0; } else { - switch_21_break: /* CIL Label */ ; - } + { + goto switch_21_default; + if (0) { + switch_21_0: /* CIL Label */; + return (0L); + switch_21_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_21_break: /* CIL Label */; + } + } } } } -} - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_22_0; - } else { - { - goto switch_22_default; - if (0) { - switch_22_0: /* CIL Label */ ; - return (0L); - switch_22_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_22_0; } else { - switch_22_break: /* CIL Label */ ; - } + { + goto switch_22_default; + if (0) { + switch_22_0: /* CIL Label */; + return (0L); + switch_22_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_22_break: /* CIL Label */; + } + } } } } -} - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; -NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_23_0; - } else { - { - goto switch_23_default; - if (0) { - switch_23_0: /* CIL Label */ ; - return (0L); - switch_23_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_23_0; } else { - switch_23_break: /* CIL Label */ ; - } + { + goto switch_23_default; + if (0) { + switch_23_0: /* CIL Label */; + return (0L); + switch_23_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_23_break: /* CIL Label */; + } + } } } } -} - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; -SIZE_T RtlCompareMemory(void const *Source1 , void const *Source2 , - SIZE_T Length ) -{ SIZE_T r = __VERIFIER_nondet_long() ; +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length) { + SIZE_T r = __VERIFIER_nondet_long(); - { - return (r); -} + { return (r); } } - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; -void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) -{ +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString) { - { - return; -} + { return; } } - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; -NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , PCWSTR ValueName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_24_0; - } else { - { - goto switch_24_default; - if (0) { - switch_24_0: /* CIL Label */ ; - return (0L); - switch_24_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_24_0; } else { - switch_24_break: /* CIL Label */ ; - } + { + goto switch_24_default; + if (0) { + switch_24_0: /* CIL Label */; + return (0L); + switch_24_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_24_break: /* CIL Label */; + } + } } } } -} - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; -void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) -{ +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString) { - { - return; + { return; } } -} - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; -void RtlInitString(PSTRING DestinationString , PCSZ SourceString ) -{ +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString) { - { - return; -} + { return; } } - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; -void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) -{ +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString) { - { - return; -} + { return; } } - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; -NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , PVOID Environment ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_25_0; - } else { - { - goto switch_25_default; - if (0) { - switch_25_0: /* CIL Label */ ; - return (0L); - switch_25_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_25_0; } else { - switch_25_break: /* CIL Label */ ; - } + { + goto switch_25_default; + if (0) { + switch_25_0: /* CIL Label */; + return (0L); + switch_25_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_25_break: /* CIL Label */; + } + } } } } -} - NTSTATUS ZwClose(HANDLE Handle ) ; -NTSTATUS ZwClose(HANDLE Handle ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS ZwClose(HANDLE Handle); +NTSTATUS ZwClose(HANDLE Handle) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_26_0; - } else { - { - goto switch_26_default; - if (0) { - switch_26_0: /* CIL Label */ ; - return (0L); - switch_26_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_26_0; } else { - switch_26_break: /* CIL Label */ ; - } + { + goto switch_26_default; + if (0) { + switch_26_0: /* CIL Label */; + return (0L); + switch_26_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_26_break: /* CIL Label */; + } + } } } } -} diff --git a/test/ntdrivers/parport_false.i.cil.c b/test/ntdrivers/parport_false.i.cil.c index 9b688c4d0..c9bd3086f 100644 --- a/test/ntdrivers/parport_false.i.cil.c +++ b/test/ntdrivers/parport_false.i.cil.c @@ -9,7 +9,7 @@ extern void *__VERIFIER_nondet_pointer(void); /* Generated by CIL v. 1.3.6 */ /* print_CIL_Input is true */ -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) typedef unsigned short wchar_t; typedef unsigned long ULONG_PTR; @@ -21,9 +21,9 @@ typedef short SHORT; typedef long LONG; typedef wchar_t WCHAR; typedef WCHAR *PWSTR; -typedef WCHAR const *PCWSTR; +typedef WCHAR const *PCWSTR; typedef CHAR *PCHAR; -typedef CHAR const *PCSTR; +typedef CHAR const *PCSTR; typedef LONG *PLONG; typedef unsigned char UCHAR; typedef unsigned short USHORT; @@ -38,81 +38,78 @@ typedef ULONG LCID; typedef LONG NTSTATUS; typedef long long LONGLONG; struct __anonstruct____missing_field_name_1 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; struct __anonstruct_u_2 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; union _LARGE_INTEGER { - struct __anonstruct____missing_field_name_1 __annonCompField1 ; - struct __anonstruct_u_2 u ; - LONGLONG QuadPart ; + struct __anonstruct____missing_field_name_1 __annonCompField1; + struct __anonstruct_u_2 u; + LONGLONG QuadPart; }; typedef union _LARGE_INTEGER LARGE_INTEGER; typedef LARGE_INTEGER *PLARGE_INTEGER; struct _LUID { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; typedef struct _LUID LUID; typedef LARGE_INTEGER PHYSICAL_ADDRESS; -enum _EVENT_TYPE { - NotificationEvent = 0, - SynchronizationEvent = 1 -} ; +enum _EVENT_TYPE { NotificationEvent = 0, SynchronizationEvent = 1 }; typedef enum _EVENT_TYPE EVENT_TYPE; -typedef char const *PCSZ; +typedef char const *PCSZ; struct _STRING { - USHORT Length ; - USHORT MaximumLength ; - PCHAR Buffer ; + USHORT Length; + USHORT MaximumLength; + PCHAR Buffer; }; typedef struct _STRING STRING; typedef STRING *PSTRING; typedef PSTRING PANSI_STRING; struct _UNICODE_STRING { - USHORT Length ; - USHORT MaximumLength ; - PWSTR Buffer ; + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; }; typedef struct _UNICODE_STRING UNICODE_STRING; typedef UNICODE_STRING *PUNICODE_STRING; typedef UCHAR BOOLEAN; typedef BOOLEAN *PBOOLEAN; struct _LIST_ENTRY { - struct _LIST_ENTRY *Flink ; - struct _LIST_ENTRY *Blink ; + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; }; typedef struct _LIST_ENTRY LIST_ENTRY; typedef struct _LIST_ENTRY *PLIST_ENTRY; struct _OBJECT_ATTRIBUTES { - ULONG Length ; - HANDLE RootDirectory ; - PUNICODE_STRING ObjectName ; - ULONG Attributes ; - PVOID SecurityDescriptor ; - PVOID SecurityQualityOfService ; + ULONG Length; + HANDLE RootDirectory; + PUNICODE_STRING ObjectName; + ULONG Attributes; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; }; typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES; typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; struct _GUID { - unsigned long Data1 ; - unsigned short Data2 ; - unsigned short Data3 ; - unsigned char Data4[8] ; + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; }; typedef struct _GUID GUID; -typedef GUID const *LPCGUID; +typedef GUID const *LPCGUID; typedef unsigned int size_t; typedef UCHAR KIRQL; typedef KIRQL *PKIRQL; enum _NT_PRODUCT_TYPE { - NtProductWinNt = 1, - NtProductLanManNt = 2, - NtProductServer = 3 -} ; + NtProductWinNt = 1, + NtProductLanManNt = 2, + NtProductServer = 3 +}; typedef enum _NT_PRODUCT_TYPE NT_PRODUCT_TYPE; struct _KTHREAD; typedef struct _KTHREAD *PKTHREAD; @@ -129,83 +126,86 @@ typedef struct _OBJECT_TYPE *POBJECT_TYPE; typedef CCHAR KPROCESSOR_MODE; struct _KAPC; struct _KAPC; -typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ); +typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); struct _KAPC { - CSHORT Type ; - CSHORT Size ; - ULONG Spare0 ; - struct _KTHREAD *Thread ; - LIST_ENTRY ApcListEntry ; - void (*KernelRoutine)(struct _KAPC *Apc , PKNORMAL_ROUTINE *NormalRoutine , PVOID *NormalContext , - PVOID *SystemArgument1 , PVOID *SystemArgument2 ) ; - void (*RundownRoutine)(struct _KAPC *Apc ) ; - void (*NormalRoutine)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ) ; - PVOID NormalContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - CCHAR ApcStateIndex ; - KPROCESSOR_MODE ApcMode ; - BOOLEAN Inserted ; + CSHORT Type; + CSHORT Size; + ULONG Spare0; + struct _KTHREAD *Thread; + LIST_ENTRY ApcListEntry; + void (*KernelRoutine)(struct _KAPC *Apc, PKNORMAL_ROUTINE *NormalRoutine, + PVOID *NormalContext, PVOID *SystemArgument1, + PVOID *SystemArgument2); + void (*RundownRoutine)(struct _KAPC *Apc); + void (*NormalRoutine)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); + PVOID NormalContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + CCHAR ApcStateIndex; + KPROCESSOR_MODE ApcMode; + BOOLEAN Inserted; }; typedef struct _KAPC KAPC; struct _KDPC; struct _KDPC; struct _KDPC { - CSHORT Type ; - UCHAR Number ; - UCHAR Importance ; - LIST_ENTRY DpcListEntry ; - void (*DeferredRoutine)(struct _KDPC *Dpc , PVOID DeferredContext , PVOID SystemArgument1 , - PVOID SystemArgument2 ) ; - PVOID DeferredContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - PULONG_PTR Lock ; + CSHORT Type; + UCHAR Number; + UCHAR Importance; + LIST_ENTRY DpcListEntry; + void (*DeferredRoutine)(struct _KDPC *Dpc, PVOID DeferredContext, + PVOID SystemArgument1, PVOID SystemArgument2); + PVOID DeferredContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + PULONG_PTR Lock; }; typedef struct _KDPC KDPC; typedef struct _KDPC *PKDPC; typedef struct _KDPC *PRKDPC; struct _MDL { - struct _MDL *Next ; - CSHORT Size ; - CSHORT MdlFlags ; - struct _EPROCESS *Process ; - PVOID MappedSystemVa ; - PVOID StartVa ; - ULONG ByteCount ; - ULONG ByteOffset ; + struct _MDL *Next; + CSHORT Size; + CSHORT MdlFlags; + struct _EPROCESS *Process; + PVOID MappedSystemVa; + PVOID StartVa; + ULONG ByteCount; + ULONG ByteOffset; }; typedef struct _MDL MDL; typedef struct _MDL *PMDL; typedef PVOID PACCESS_TOKEN; typedef PVOID PSECURITY_DESCRIPTOR; typedef ULONG ACCESS_MASK; -#pragma pack(push,4) +#pragma pack(push, 4) struct _LUID_AND_ATTRIBUTES { - LUID Luid ; - ULONG Attributes ; + LUID Luid; + ULONG Attributes; }; typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES; #pragma pack(pop) struct _PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[1] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[1]; }; typedef struct _PRIVILEGE_SET PRIVILEGE_SET; enum _SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous = 0, - SecurityIdentification = 1, - SecurityImpersonation = 2, - SecurityDelegation = 3 -} ; + SecurityAnonymous = 0, + SecurityIdentification = 1, + SecurityImpersonation = 2, + SecurityDelegation = 3 +}; typedef enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL; typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE; struct _SECURITY_QUALITY_OF_SERVICE { - ULONG Length ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode ; - BOOLEAN EffectiveOnly ; + ULONG Length; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; + BOOLEAN EffectiveOnly; }; typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE; typedef ULONG SECURITY_INFORMATION; @@ -214,641 +214,635 @@ typedef LONG KPRIORITY; typedef ULONG_PTR KSPIN_LOCK; typedef KSPIN_LOCK *PKSPIN_LOCK; struct _RTL_QUERY_REGISTRY_TABLE { - NTSTATUS (*QueryRoutine)(PWSTR ValueName , ULONG ValueType , - PVOID ValueData , ULONG ValueLength , - PVOID Context , PVOID EntryContext ) ; - ULONG Flags ; - PWSTR Name ; - PVOID EntryContext ; - ULONG DefaultType ; - PVOID DefaultData ; - ULONG DefaultLength ; + NTSTATUS(*QueryRoutine) + (PWSTR ValueName, ULONG ValueType, PVOID ValueData, ULONG ValueLength, + PVOID Context, PVOID EntryContext); + ULONG Flags; + PWSTR Name; + PVOID EntryContext; + ULONG DefaultType; + PVOID DefaultData; + ULONG DefaultLength; }; typedef struct _RTL_QUERY_REGISTRY_TABLE RTL_QUERY_REGISTRY_TABLE; typedef struct _RTL_QUERY_REGISTRY_TABLE *PRTL_QUERY_REGISTRY_TABLE; union __anonunion____missing_field_name_6 { - NTSTATUS Status ; - PVOID Pointer ; + NTSTATUS Status; + PVOID Pointer; }; struct _IO_STATUS_BLOCK { - union __anonunion____missing_field_name_6 __annonCompField4 ; - ULONG_PTR Information ; + union __anonunion____missing_field_name_6 __annonCompField4; + ULONG_PTR Information; }; typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK; typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK; enum _FILE_INFORMATION_CLASS { - FileDirectoryInformation = 1, - FileFullDirectoryInformation = 2, - FileBothDirectoryInformation = 3, - FileBasicInformation = 4, - FileStandardInformation = 5, - FileInternalInformation = 6, - FileEaInformation = 7, - FileAccessInformation = 8, - FileNameInformation = 9, - FileRenameInformation = 10, - FileLinkInformation = 11, - FileNamesInformation = 12, - FileDispositionInformation = 13, - FilePositionInformation = 14, - FileFullEaInformation = 15, - FileModeInformation = 16, - FileAlignmentInformation = 17, - FileAllInformation = 18, - FileAllocationInformation = 19, - FileEndOfFileInformation = 20, - FileAlternateNameInformation = 21, - FileStreamInformation = 22, - FilePipeInformation = 23, - FilePipeLocalInformation = 24, - FilePipeRemoteInformation = 25, - FileMailslotQueryInformation = 26, - FileMailslotSetInformation = 27, - FileCompressionInformation = 28, - FileObjectIdInformation = 29, - FileCompletionInformation = 30, - FileMoveClusterInformation = 31, - FileQuotaInformation = 32, - FileReparsePointInformation = 33, - FileNetworkOpenInformation = 34, - FileAttributeTagInformation = 35, - FileTrackingInformation = 36, - FileMaximumInformation = 37 -} ; + FileDirectoryInformation = 1, + FileFullDirectoryInformation = 2, + FileBothDirectoryInformation = 3, + FileBasicInformation = 4, + FileStandardInformation = 5, + FileInternalInformation = 6, + FileEaInformation = 7, + FileAccessInformation = 8, + FileNameInformation = 9, + FileRenameInformation = 10, + FileLinkInformation = 11, + FileNamesInformation = 12, + FileDispositionInformation = 13, + FilePositionInformation = 14, + FileFullEaInformation = 15, + FileModeInformation = 16, + FileAlignmentInformation = 17, + FileAllInformation = 18, + FileAllocationInformation = 19, + FileEndOfFileInformation = 20, + FileAlternateNameInformation = 21, + FileStreamInformation = 22, + FilePipeInformation = 23, + FilePipeLocalInformation = 24, + FilePipeRemoteInformation = 25, + FileMailslotQueryInformation = 26, + FileMailslotSetInformation = 27, + FileCompressionInformation = 28, + FileObjectIdInformation = 29, + FileCompletionInformation = 30, + FileMoveClusterInformation = 31, + FileQuotaInformation = 32, + FileReparsePointInformation = 33, + FileNetworkOpenInformation = 34, + FileAttributeTagInformation = 35, + FileTrackingInformation = 36, + FileMaximumInformation = 37 +}; typedef enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS; struct _FILE_BASIC_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + ULONG FileAttributes; }; typedef struct _FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION; struct _FILE_STANDARD_INFORMATION { - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG NumberOfLinks ; - BOOLEAN DeletePending ; - BOOLEAN Directory ; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG NumberOfLinks; + BOOLEAN DeletePending; + BOOLEAN Directory; }; typedef struct _FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION; struct _FILE_NETWORK_OPEN_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG FileAttributes; }; typedef struct _FILE_NETWORK_OPEN_INFORMATION *PFILE_NETWORK_OPEN_INFORMATION; enum _FSINFOCLASS { - FileFsVolumeInformation = 1, - FileFsLabelInformation = 2, - FileFsSizeInformation = 3, - FileFsDeviceInformation = 4, - FileFsAttributeInformation = 5, - FileFsControlInformation = 6, - FileFsFullSizeInformation = 7, - FileFsObjectIdInformation = 8, - FileFsMaximumInformation = 9 -} ; + FileFsVolumeInformation = 1, + FileFsLabelInformation = 2, + FileFsSizeInformation = 3, + FileFsDeviceInformation = 4, + FileFsAttributeInformation = 5, + FileFsControlInformation = 6, + FileFsFullSizeInformation = 7, + FileFsObjectIdInformation = 8, + FileFsMaximumInformation = 9 +}; typedef enum _FSINFOCLASS FS_INFORMATION_CLASS; enum _INTERFACE_TYPE { - InterfaceTypeUndefined = -1, - Internal = 0, - Isa = 1, - Eisa = 2, - MicroChannel = 3, - TurboChannel = 4, - PCIBus = 5, - VMEBus = 6, - NuBus = 7, - PCMCIABus = 8, - CBus = 9, - MPIBus = 10, - MPSABus = 11, - ProcessorInternal = 12, - InternalPowerBus = 13, - PNPISABus = 14, - PNPBus = 15, - MaximumInterfaceType = 16 -} ; + InterfaceTypeUndefined = -1, + Internal = 0, + Isa = 1, + Eisa = 2, + MicroChannel = 3, + TurboChannel = 4, + PCIBus = 5, + VMEBus = 6, + NuBus = 7, + PCMCIABus = 8, + CBus = 9, + MPIBus = 10, + MPSABus = 11, + ProcessorInternal = 12, + InternalPowerBus = 13, + PNPISABus = 14, + PNPBus = 15, + MaximumInterfaceType = 16 +}; typedef enum _INTERFACE_TYPE INTERFACE_TYPE; typedef enum _INTERFACE_TYPE *PINTERFACE_TYPE; struct _IO_ERROR_LOG_PACKET { - UCHAR MajorFunctionCode ; - UCHAR RetryCount ; - USHORT DumpDataSize ; - USHORT NumberOfStrings ; - USHORT StringOffset ; - USHORT EventCategory ; - NTSTATUS ErrorCode ; - ULONG UniqueErrorValue ; - NTSTATUS FinalStatus ; - ULONG SequenceNumber ; - ULONG IoControlCode ; - LARGE_INTEGER DeviceOffset ; - ULONG DumpData[1] ; + UCHAR MajorFunctionCode; + UCHAR RetryCount; + USHORT DumpDataSize; + USHORT NumberOfStrings; + USHORT StringOffset; + USHORT EventCategory; + NTSTATUS ErrorCode; + ULONG UniqueErrorValue; + NTSTATUS FinalStatus; + ULONG SequenceNumber; + ULONG IoControlCode; + LARGE_INTEGER DeviceOffset; + ULONG DumpData[1]; }; typedef struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET; typedef struct _IO_ERROR_LOG_PACKET *PIO_ERROR_LOG_PACKET; struct _KEY_VALUE_FULL_INFORMATION { - ULONG TitleIndex ; - ULONG Type ; - ULONG DataOffset ; - ULONG DataLength ; - ULONG NameLength ; - WCHAR Name[1] ; + ULONG TitleIndex; + ULONG Type; + ULONG DataOffset; + ULONG DataLength; + ULONG NameLength; + WCHAR Name[1]; }; typedef struct _KEY_VALUE_FULL_INFORMATION *PKEY_VALUE_FULL_INFORMATION; enum _KEY_VALUE_INFORMATION_CLASS { - KeyValueBasicInformation = 0, - KeyValueFullInformation = 1, - KeyValuePartialInformation = 2, - KeyValueFullInformationAlign64 = 3, - KeyValuePartialInformationAlign64 = 4 -} ; + KeyValueBasicInformation = 0, + KeyValueFullInformation = 1, + KeyValuePartialInformation = 2, + KeyValueFullInformationAlign64 = 3, + KeyValuePartialInformationAlign64 = 4 +}; typedef enum _KEY_VALUE_INFORMATION_CLASS KEY_VALUE_INFORMATION_CLASS; struct _CLIENT_ID { - HANDLE UniqueProcess ; - HANDLE UniqueThread ; + HANDLE UniqueProcess; + HANDLE UniqueThread; }; typedef struct _CLIENT_ID CLIENT_ID; typedef CLIENT_ID *PCLIENT_ID; enum _SYSTEM_POWER_STATE { - PowerSystemUnspecified = 0, - PowerSystemWorking = 1, - PowerSystemSleeping1 = 2, - PowerSystemSleeping2 = 3, - PowerSystemSleeping3 = 4, - PowerSystemHibernate = 5, - PowerSystemShutdown = 6, - PowerSystemMaximum = 7 -} ; + PowerSystemUnspecified = 0, + PowerSystemWorking = 1, + PowerSystemSleeping1 = 2, + PowerSystemSleeping2 = 3, + PowerSystemSleeping3 = 4, + PowerSystemHibernate = 5, + PowerSystemShutdown = 6, + PowerSystemMaximum = 7 +}; typedef enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE; enum __anonenum_POWER_ACTION_11 { - PowerActionNone = 0, - PowerActionReserved = 1, - PowerActionSleep = 2, - PowerActionHibernate = 3, - PowerActionShutdown = 4, - PowerActionShutdownReset = 5, - PowerActionShutdownOff = 6, - PowerActionWarmEject = 7 -} ; + PowerActionNone = 0, + PowerActionReserved = 1, + PowerActionSleep = 2, + PowerActionHibernate = 3, + PowerActionShutdown = 4, + PowerActionShutdownReset = 5, + PowerActionShutdownOff = 6, + PowerActionWarmEject = 7 +}; typedef enum __anonenum_POWER_ACTION_11 POWER_ACTION; enum _DEVICE_POWER_STATE { - PowerDeviceUnspecified = 0, - PowerDeviceD0 = 1, - PowerDeviceD1 = 2, - PowerDeviceD2 = 3, - PowerDeviceD3 = 4, - PowerDeviceMaximum = 5 -} ; + PowerDeviceUnspecified = 0, + PowerDeviceD0 = 1, + PowerDeviceD1 = 2, + PowerDeviceD2 = 3, + PowerDeviceD3 = 4, + PowerDeviceMaximum = 5 +}; typedef enum _DEVICE_POWER_STATE DEVICE_POWER_STATE; union _POWER_STATE { - SYSTEM_POWER_STATE SystemState ; - DEVICE_POWER_STATE DeviceState ; + SYSTEM_POWER_STATE SystemState; + DEVICE_POWER_STATE DeviceState; }; typedef union _POWER_STATE POWER_STATE; -enum _POWER_STATE_TYPE { - SystemPowerState = 0, - DevicePowerState = 1 -} ; +enum _POWER_STATE_TYPE { SystemPowerState = 0, DevicePowerState = 1 }; typedef enum _POWER_STATE_TYPE POWER_STATE_TYPE; struct _KSYSTEM_TIME { - ULONG LowPart ; - LONG High1Time ; - LONG High2Time ; + ULONG LowPart; + LONG High1Time; + LONG High2Time; }; typedef struct _KSYSTEM_TIME KSYSTEM_TIME; enum _ALTERNATIVE_ARCHITECTURE_TYPE { - StandardDesign = 0, - NEC98x86 = 1, - EndAlternatives = 2 -} ; + StandardDesign = 0, + NEC98x86 = 1, + EndAlternatives = 2 +}; typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE ALTERNATIVE_ARCHITECTURE_TYPE; struct _KUSER_SHARED_DATA { - ULONG volatile TickCountLow ; - ULONG TickCountMultiplier ; - KSYSTEM_TIME volatile InterruptTime ; - KSYSTEM_TIME volatile SystemTime ; - KSYSTEM_TIME volatile TimeZoneBias ; - USHORT ImageNumberLow ; - USHORT ImageNumberHigh ; - WCHAR NtSystemRoot[260] ; - ULONG MaxStackTraceDepth ; - ULONG CryptoExponent ; - ULONG TimeZoneId ; - ULONG Reserved2[8] ; - NT_PRODUCT_TYPE NtProductType ; - BOOLEAN ProductTypeIsValid ; - ULONG NtMajorVersion ; - ULONG NtMinorVersion ; - BOOLEAN ProcessorFeatures[64] ; - ULONG Reserved1 ; - ULONG Reserved3 ; - ULONG volatile TimeSlip ; - ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture ; - LARGE_INTEGER SystemExpirationDate ; - ULONG SuiteMask ; - BOOLEAN KdDebuggerEnabled ; + ULONG volatile TickCountLow; + ULONG TickCountMultiplier; + KSYSTEM_TIME volatile InterruptTime; + KSYSTEM_TIME volatile SystemTime; + KSYSTEM_TIME volatile TimeZoneBias; + USHORT ImageNumberLow; + USHORT ImageNumberHigh; + WCHAR NtSystemRoot[260]; + ULONG MaxStackTraceDepth; + ULONG CryptoExponent; + ULONG TimeZoneId; + ULONG Reserved2[8]; + NT_PRODUCT_TYPE NtProductType; + BOOLEAN ProductTypeIsValid; + ULONG NtMajorVersion; + ULONG NtMinorVersion; + BOOLEAN ProcessorFeatures[64]; + ULONG Reserved1; + ULONG Reserved3; + ULONG volatile TimeSlip; + ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture; + LARGE_INTEGER SystemExpirationDate; + ULONG SuiteMask; + BOOLEAN KdDebuggerEnabled; }; typedef struct _KUSER_SHARED_DATA KUSER_SHARED_DATA; typedef PVOID PASSIGNED_RESOURCE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Generic_16 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Port_17 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Interrupt_18 { - ULONG Level ; - ULONG Vector ; - ULONG Affinity ; + ULONG Level; + ULONG Vector; + ULONG Affinity; }; struct __anonstruct_Memory_19 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Dma_20 { - ULONG Channel ; - ULONG Port ; - ULONG Reserved1 ; + ULONG Channel; + ULONG Port; + ULONG Reserved1; }; struct __anonstruct_DevicePrivate_21 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_22 { - ULONG Start ; - ULONG Length ; - ULONG Reserved ; + ULONG Start; + ULONG Length; + ULONG Reserved; }; struct __anonstruct_DeviceSpecificData_23 { - ULONG DataSize ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG DataSize; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_15 { - struct __anonstruct_Generic_16 Generic ; - struct __anonstruct_Port_17 Port ; - struct __anonstruct_Interrupt_18 Interrupt ; - struct __anonstruct_Memory_19 Memory ; - struct __anonstruct_Dma_20 Dma ; - struct __anonstruct_DevicePrivate_21 DevicePrivate ; - struct __anonstruct_BusNumber_22 BusNumber ; - struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData ; + struct __anonstruct_Generic_16 Generic; + struct __anonstruct_Port_17 Port; + struct __anonstruct_Interrupt_18 Interrupt; + struct __anonstruct_Memory_19 Memory; + struct __anonstruct_Dma_20 Dma; + struct __anonstruct_DevicePrivate_21 DevicePrivate; + struct __anonstruct_BusNumber_22 BusNumber; + struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData; }; struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { - UCHAR Type ; - UCHAR ShareDisposition ; - USHORT Flags ; - union __anonunion_u_15 u ; + UCHAR Type; + UCHAR ShareDisposition; + USHORT Flags; + union __anonunion_u_15 u; }; typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR; typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR *PCM_PARTIAL_RESOURCE_DESCRIPTOR; #pragma pack(pop) struct _CM_PARTIAL_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; }; typedef struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST; typedef struct _CM_PARTIAL_RESOURCE_LIST *PCM_PARTIAL_RESOURCE_LIST; struct _CM_FULL_RESOURCE_DESCRIPTOR { - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - CM_PARTIAL_RESOURCE_LIST PartialResourceList ; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; }; typedef struct _CM_FULL_RESOURCE_DESCRIPTOR CM_FULL_RESOURCE_DESCRIPTOR; typedef struct _CM_FULL_RESOURCE_DESCRIPTOR *PCM_FULL_RESOURCE_DESCRIPTOR; struct _CM_RESOURCE_LIST { - ULONG Count ; - CM_FULL_RESOURCE_DESCRIPTOR List[1] ; + ULONG Count; + CM_FULL_RESOURCE_DESCRIPTOR List[1]; }; typedef struct _CM_RESOURCE_LIST CM_RESOURCE_LIST; typedef struct _CM_RESOURCE_LIST *PCM_RESOURCE_LIST; -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct __anonstruct_Port_25 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Memory_26 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Interrupt_27 { - ULONG MinimumVector ; - ULONG MaximumVector ; + ULONG MinimumVector; + ULONG MaximumVector; }; struct __anonstruct_Dma_28 { - ULONG MinimumChannel ; - ULONG MaximumChannel ; + ULONG MinimumChannel; + ULONG MaximumChannel; }; struct __anonstruct_Generic_29 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_DevicePrivate_30 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_31 { - ULONG Length ; - ULONG MinBusNumber ; - ULONG MaxBusNumber ; - ULONG Reserved ; + ULONG Length; + ULONG MinBusNumber; + ULONG MaxBusNumber; + ULONG Reserved; }; struct __anonstruct_AssignedResource_32 { - PASSIGNED_RESOURCE AssignedResource ; + PASSIGNED_RESOURCE AssignedResource; }; struct __anonstruct_SubAllocateFrom_33 { - UCHAR Type ; - UCHAR Reserved[3] ; - PASSIGNED_RESOURCE AssignedResource ; - PHYSICAL_ADDRESS Transformation ; + UCHAR Type; + UCHAR Reserved[3]; + PASSIGNED_RESOURCE AssignedResource; + PHYSICAL_ADDRESS Transformation; }; struct __anonstruct_ConfigData_34 { - ULONG Priority ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG Priority; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_24 { - struct __anonstruct_Port_25 Port ; - struct __anonstruct_Memory_26 Memory ; - struct __anonstruct_Interrupt_27 Interrupt ; - struct __anonstruct_Dma_28 Dma ; - struct __anonstruct_Generic_29 Generic ; - struct __anonstruct_DevicePrivate_30 DevicePrivate ; - struct __anonstruct_BusNumber_31 BusNumber ; - struct __anonstruct_AssignedResource_32 AssignedResource ; - struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom ; - struct __anonstruct_ConfigData_34 ConfigData ; + struct __anonstruct_Port_25 Port; + struct __anonstruct_Memory_26 Memory; + struct __anonstruct_Interrupt_27 Interrupt; + struct __anonstruct_Dma_28 Dma; + struct __anonstruct_Generic_29 Generic; + struct __anonstruct_DevicePrivate_30 DevicePrivate; + struct __anonstruct_BusNumber_31 BusNumber; + struct __anonstruct_AssignedResource_32 AssignedResource; + struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom; + struct __anonstruct_ConfigData_34 ConfigData; }; struct _IO_RESOURCE_DESCRIPTOR { - UCHAR Option ; - UCHAR Type ; - UCHAR ShareDisposition ; - UCHAR Spare1 ; - USHORT Flags ; - USHORT Spare2 ; - union __anonunion_u_24 u ; + UCHAR Option; + UCHAR Type; + UCHAR ShareDisposition; + UCHAR Spare1; + USHORT Flags; + USHORT Spare2; + union __anonunion_u_24 u; }; typedef struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR; typedef struct _IO_RESOURCE_DESCRIPTOR *PIO_RESOURCE_DESCRIPTOR; struct _IO_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - IO_RESOURCE_DESCRIPTOR Descriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + IO_RESOURCE_DESCRIPTOR Descriptors[1]; }; typedef struct _IO_RESOURCE_LIST IO_RESOURCE_LIST; typedef struct _IO_RESOURCE_LIST *PIO_RESOURCE_LIST; struct _IO_RESOURCE_REQUIREMENTS_LIST { - ULONG ListSize ; - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - ULONG SlotNumber ; - ULONG Reserved[3] ; - ULONG AlternativeLists ; - IO_RESOURCE_LIST List[1] ; + ULONG ListSize; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + ULONG SlotNumber; + ULONG Reserved[3]; + ULONG AlternativeLists; + IO_RESOURCE_LIST List[1]; }; typedef struct _IO_RESOURCE_REQUIREMENTS_LIST *PIO_RESOURCE_REQUIREMENTS_LIST; enum _CONFIGURATION_TYPE { - ArcSystem = 0, - CentralProcessor = 1, - FloatingPointProcessor = 2, - PrimaryIcache = 3, - PrimaryDcache = 4, - SecondaryIcache = 5, - SecondaryDcache = 6, - SecondaryCache = 7, - EisaAdapter = 8, - TcAdapter = 9, - ScsiAdapter = 10, - DtiAdapter = 11, - MultiFunctionAdapter = 12, - DiskController = 13, - TapeController = 14, - CdromController = 15, - WormController = 16, - SerialController = 17, - NetworkController = 18, - DisplayController = 19, - ParallelController = 20, - PointerController = 21, - KeyboardController = 22, - AudioController = 23, - OtherController = 24, - DiskPeripheral = 25, - FloppyDiskPeripheral = 26, - TapePeripheral = 27, - ModemPeripheral = 28, - MonitorPeripheral = 29, - PrinterPeripheral = 30, - PointerPeripheral = 31, - KeyboardPeripheral = 32, - TerminalPeripheral = 33, - OtherPeripheral = 34, - LinePeripheral = 35, - NetworkPeripheral = 36, - SystemMemory = 37, - DockingInformation = 38, - RealModeIrqRoutingTable = 39, - MaximumType = 40 -} ; + ArcSystem = 0, + CentralProcessor = 1, + FloatingPointProcessor = 2, + PrimaryIcache = 3, + PrimaryDcache = 4, + SecondaryIcache = 5, + SecondaryDcache = 6, + SecondaryCache = 7, + EisaAdapter = 8, + TcAdapter = 9, + ScsiAdapter = 10, + DtiAdapter = 11, + MultiFunctionAdapter = 12, + DiskController = 13, + TapeController = 14, + CdromController = 15, + WormController = 16, + SerialController = 17, + NetworkController = 18, + DisplayController = 19, + ParallelController = 20, + PointerController = 21, + KeyboardController = 22, + AudioController = 23, + OtherController = 24, + DiskPeripheral = 25, + FloppyDiskPeripheral = 26, + TapePeripheral = 27, + ModemPeripheral = 28, + MonitorPeripheral = 29, + PrinterPeripheral = 30, + PointerPeripheral = 31, + KeyboardPeripheral = 32, + TerminalPeripheral = 33, + OtherPeripheral = 34, + LinePeripheral = 35, + NetworkPeripheral = 36, + SystemMemory = 37, + DockingInformation = 38, + RealModeIrqRoutingTable = 39, + MaximumType = 40 +}; typedef enum _CONFIGURATION_TYPE CONFIGURATION_TYPE; typedef enum _CONFIGURATION_TYPE *PCONFIGURATION_TYPE; -enum _KINTERRUPT_MODE { - LevelSensitive = 0, - Latched = 1 -} ; +enum _KINTERRUPT_MODE { LevelSensitive = 0, Latched = 1 }; typedef enum _KINTERRUPT_MODE KINTERRUPT_MODE; enum _KWAIT_REASON { - Executive = 0, - FreePage = 1, - PageIn = 2, - PoolAllocation = 3, - DelayExecution = 4, - Suspended = 5, - UserRequest = 6, - WrExecutive = 7, - WrFreePage = 8, - WrPageIn = 9, - WrPoolAllocation = 10, - WrDelayExecution = 11, - WrSuspended = 12, - WrUserRequest = 13, - WrEventPair = 14, - WrQueue = 15, - WrLpcReceive = 16, - WrLpcReply = 17, - WrVirtualMemory = 18, - WrPageOut = 19, - WrRendezvous = 20, - Spare2 = 21, - Spare3 = 22, - Spare4 = 23, - Spare5 = 24, - Spare6 = 25, - WrKernel = 26, - MaximumWaitReason = 27 -} ; + Executive = 0, + FreePage = 1, + PageIn = 2, + PoolAllocation = 3, + DelayExecution = 4, + Suspended = 5, + UserRequest = 6, + WrExecutive = 7, + WrFreePage = 8, + WrPageIn = 9, + WrPoolAllocation = 10, + WrDelayExecution = 11, + WrSuspended = 12, + WrUserRequest = 13, + WrEventPair = 14, + WrQueue = 15, + WrLpcReceive = 16, + WrLpcReply = 17, + WrVirtualMemory = 18, + WrPageOut = 19, + WrRendezvous = 20, + Spare2 = 21, + Spare3 = 22, + Spare4 = 23, + Spare5 = 24, + Spare6 = 25, + WrKernel = 26, + MaximumWaitReason = 27 +}; typedef enum _KWAIT_REASON KWAIT_REASON; struct _DISPATCHER_HEADER { - UCHAR Type ; - UCHAR Absolute ; - UCHAR Size ; - UCHAR Inserted ; - LONG SignalState ; - LIST_ENTRY WaitListHead ; + UCHAR Type; + UCHAR Absolute; + UCHAR Size; + UCHAR Inserted; + LONG SignalState; + LIST_ENTRY WaitListHead; }; typedef struct _DISPATCHER_HEADER DISPATCHER_HEADER; struct _KDEVICE_QUEUE { - CSHORT Type ; - CSHORT Size ; - LIST_ENTRY DeviceListHead ; - KSPIN_LOCK Lock ; - BOOLEAN Busy ; + CSHORT Type; + CSHORT Size; + LIST_ENTRY DeviceListHead; + KSPIN_LOCK Lock; + BOOLEAN Busy; }; typedef struct _KDEVICE_QUEUE KDEVICE_QUEUE; struct _KDEVICE_QUEUE_ENTRY { - LIST_ENTRY DeviceListEntry ; - ULONG SortKey ; - BOOLEAN Inserted ; + LIST_ENTRY DeviceListEntry; + ULONG SortKey; + BOOLEAN Inserted; }; typedef struct _KDEVICE_QUEUE_ENTRY KDEVICE_QUEUE_ENTRY; struct _KEVENT { - DISPATCHER_HEADER Header ; + DISPATCHER_HEADER Header; }; typedef struct _KEVENT KEVENT; typedef struct _KEVENT *PKEVENT; typedef struct _KEVENT *PRKEVENT; struct _KSEMAPHORE { - DISPATCHER_HEADER Header ; - LONG Limit ; + DISPATCHER_HEADER Header; + LONG Limit; }; typedef struct _KSEMAPHORE *PKSEMAPHORE; typedef struct _KSEMAPHORE *PRKSEMAPHORE; enum _MEMORY_CACHING_TYPE { - MmNonCached = 0, - MmCached = 1, - MmWriteCombined = 2, - MmHardwareCoherentCached = 3, - MmNonCachedUnordered = 4, - MmUSWCCached = 5, - MmMaximumCacheType = 6 -} ; + MmNonCached = 0, + MmCached = 1, + MmWriteCombined = 2, + MmHardwareCoherentCached = 3, + MmNonCachedUnordered = 4, + MmUSWCCached = 5, + MmMaximumCacheType = 6 +}; typedef enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE; enum _POOL_TYPE { - NonPagedPool = 0, - PagedPool = 1, - NonPagedPoolMustSucceed = 2, - DontUseThisType = 3, - NonPagedPoolCacheAligned = 4, - PagedPoolCacheAligned = 5, - NonPagedPoolCacheAlignedMustS = 6, - MaxPoolType = 7, - NonPagedPoolSession = 32, - PagedPoolSession = 33, - NonPagedPoolMustSucceedSession = 34, - DontUseThisTypeSession = 35, - NonPagedPoolCacheAlignedSession = 36, - PagedPoolCacheAlignedSession = 37, - NonPagedPoolCacheAlignedMustSSession = 38 -} ; + NonPagedPool = 0, + PagedPool = 1, + NonPagedPoolMustSucceed = 2, + DontUseThisType = 3, + NonPagedPoolCacheAligned = 4, + PagedPoolCacheAligned = 5, + NonPagedPoolCacheAlignedMustS = 6, + MaxPoolType = 7, + NonPagedPoolSession = 32, + PagedPoolSession = 33, + NonPagedPoolMustSucceedSession = 34, + DontUseThisTypeSession = 35, + NonPagedPoolCacheAlignedSession = 36, + PagedPoolCacheAlignedSession = 37, + NonPagedPoolCacheAlignedMustSSession = 38 +}; typedef enum _POOL_TYPE POOL_TYPE; struct _FAST_MUTEX { - LONG Count ; - PKTHREAD Owner ; - ULONG Contention ; - KEVENT Event ; - ULONG OldIrql ; + LONG Count; + PKTHREAD Owner; + ULONG Contention; + KEVENT Event; + ULONG OldIrql; }; typedef struct _FAST_MUTEX FAST_MUTEX; typedef struct _FAST_MUTEX *PFAST_MUTEX; typedef ULONG_PTR ERESOURCE_THREAD; union __anonunion____missing_field_name_38 { - LONG OwnerCount ; - ULONG TableSize ; + LONG OwnerCount; + ULONG TableSize; }; struct _OWNER_ENTRY { - ERESOURCE_THREAD OwnerThread ; - union __anonunion____missing_field_name_38 __annonCompField10 ; + ERESOURCE_THREAD OwnerThread; + union __anonunion____missing_field_name_38 __annonCompField10; }; typedef struct _OWNER_ENTRY OWNER_ENTRY; typedef struct _OWNER_ENTRY *POWNER_ENTRY; union __anonunion____missing_field_name_39 { - PVOID Address ; - ULONG_PTR CreatorBackTraceIndex ; + PVOID Address; + ULONG_PTR CreatorBackTraceIndex; }; struct _ERESOURCE { - LIST_ENTRY SystemResourcesList ; - POWNER_ENTRY OwnerTable ; - SHORT ActiveCount ; - USHORT Flag ; - PKSEMAPHORE SharedWaiters ; - PKEVENT ExclusiveWaiters ; - OWNER_ENTRY OwnerThreads[2] ; - ULONG ContentionCount ; - USHORT NumberOfSharedWaiters ; - USHORT NumberOfExclusiveWaiters ; - union __anonunion____missing_field_name_39 __annonCompField11 ; - KSPIN_LOCK SpinLock ; + LIST_ENTRY SystemResourcesList; + POWNER_ENTRY OwnerTable; + SHORT ActiveCount; + USHORT Flag; + PKSEMAPHORE SharedWaiters; + PKEVENT ExclusiveWaiters; + OWNER_ENTRY OwnerThreads[2]; + ULONG ContentionCount; + USHORT NumberOfSharedWaiters; + USHORT NumberOfExclusiveWaiters; + union __anonunion____missing_field_name_39 __annonCompField11; + KSPIN_LOCK SpinLock; }; enum _MM_PAGE_PRIORITY { - LowPagePriority = 0, - NormalPagePriority = 16, - HighPagePriority = 32 -} ; + LowPagePriority = 0, + NormalPagePriority = 16, + HighPagePriority = 32 +}; typedef enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY; struct _DRIVER_OBJECT; struct _DRIVER_OBJECT; struct _SECURITY_SUBJECT_CONTEXT { - PACCESS_TOKEN ClientToken ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - PACCESS_TOKEN PrimaryToken ; - PVOID ProcessAuditId ; + PACCESS_TOKEN ClientToken; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + PACCESS_TOKEN PrimaryToken; + PVOID ProcessAuditId; }; typedef struct _SECURITY_SUBJECT_CONTEXT SECURITY_SUBJECT_CONTEXT; struct _INITIAL_PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[3] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[3]; }; typedef struct _INITIAL_PRIVILEGE_SET INITIAL_PRIVILEGE_SET; union __anonunion_Privileges_40 { - INITIAL_PRIVILEGE_SET InitialPrivilegeSet ; - PRIVILEGE_SET PrivilegeSet ; + INITIAL_PRIVILEGE_SET InitialPrivilegeSet; + PRIVILEGE_SET PrivilegeSet; }; struct _ACCESS_STATE { - LUID OperationID ; - BOOLEAN SecurityEvaluated ; - BOOLEAN GenerateAudit ; - BOOLEAN GenerateOnClose ; - BOOLEAN PrivilegesAllocated ; - ULONG Flags ; - ACCESS_MASK RemainingDesiredAccess ; - ACCESS_MASK PreviouslyGrantedAccess ; - ACCESS_MASK OriginalDesiredAccess ; - SECURITY_SUBJECT_CONTEXT SubjectSecurityContext ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - PVOID AuxData ; - union __anonunion_Privileges_40 Privileges ; - BOOLEAN AuditPrivileges ; - UNICODE_STRING ObjectName ; - UNICODE_STRING ObjectTypeName ; + LUID OperationID; + BOOLEAN SecurityEvaluated; + BOOLEAN GenerateAudit; + BOOLEAN GenerateOnClose; + BOOLEAN PrivilegesAllocated; + ULONG Flags; + ACCESS_MASK RemainingDesiredAccess; + ACCESS_MASK PreviouslyGrantedAccess; + ACCESS_MASK OriginalDesiredAccess; + SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PVOID AuxData; + union __anonunion_Privileges_40 Privileges; + BOOLEAN AuditPrivileges; + UNICODE_STRING ObjectName; + UNICODE_STRING ObjectTypeName; }; typedef struct _ACCESS_STATE *PACCESS_STATE; struct _DEVICE_OBJECT; @@ -860,800 +854,840 @@ struct _IRP; struct _IRP; struct _SCSI_REQUEST_BLOCK; struct _SCSI_REQUEST_BLOCK; -typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ); +typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp); struct _COMPRESSED_DATA_INFO; struct _FAST_IO_DISPATCH { - ULONG SizeOfFastIoDispatch ; - BOOLEAN (*FastIoCheckIfPossible)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , - BOOLEAN CheckForReadOperation , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryBasicInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_BASIC_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryStandardInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_STANDARD_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoLock)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - BOOLEAN FailImmediately , BOOLEAN ExclusiveLock , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockSingle)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAll)(struct _FILE_OBJECT *FileObject , PEPROCESS ProcessId , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAllByKey)(struct _FILE_OBJECT *FileObject , PVOID ProcessId , - ULONG Key , PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoDeviceControl)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , ULONG IoControlCode , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice , struct _DEVICE_OBJECT *TargetDevice ) ; - BOOLEAN (*FastIoQueryNetworkOpenInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - struct _FILE_NETWORK_OPEN_INFORMATION *Buffer , - struct _IO_STATUS_BLOCK *IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForModWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER EndingOffset , - struct _ERESOURCE **ResourceToRelease , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadComplete)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*PrepareMdlWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteComplete)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoReadCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , PMDL *MdlChain , - PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWriteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , - PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadCompleteCompressed)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteCompleteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryOpen)(struct _IRP *Irp , PFILE_NETWORK_OPEN_INFORMATION NetworkInformation , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForModWrite)(struct _FILE_OBJECT *FileObject , struct _ERESOURCE *ResourceToRelease , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; + ULONG SizeOfFastIoDispatch; + BOOLEAN(*FastIoCheckIfPossible) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, BOOLEAN CheckForReadOperation, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryBasicInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_BASIC_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryStandardInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_STANDARD_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoLock) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + BOOLEAN FailImmediately, BOOLEAN ExclusiveLock, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockSingle) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAll) + (struct _FILE_OBJECT *FileObject, PEPROCESS ProcessId, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAllByKey) + (struct _FILE_OBJECT *FileObject, PVOID ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoDeviceControl) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, PVOID InputBuffer, + ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength, + ULONG IoControlCode, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice, + struct _DEVICE_OBJECT *TargetDevice); + BOOLEAN(*FastIoQueryNetworkOpenInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + struct _FILE_NETWORK_OPEN_INFORMATION *Buffer, + struct _IO_STATUS_BLOCK *IoStatus, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForModWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER EndingOffset, + struct _ERESOURCE **ResourceToRelease, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadComplete) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*PrepareMdlWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteComplete) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoReadCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWriteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryOpen) + (struct _IRP *Irp, PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForModWrite) + (struct _FILE_OBJECT *FileObject, struct _ERESOURCE *ResourceToRelease, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); }; typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH; enum _IO_ALLOCATION_ACTION { - KeepObject = 1, - DeallocateObject = 2, - DeallocateObjectKeepRegisters = 3 -} ; + KeepObject = 1, + DeallocateObject = 2, + DeallocateObjectKeepRegisters = 3 +}; typedef enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION; struct _IO_SECURITY_CONTEXT { - PSECURITY_QUALITY_OF_SERVICE SecurityQos ; - PACCESS_STATE AccessState ; - ACCESS_MASK DesiredAccess ; - ULONG FullCreateOptions ; + PSECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_STATE AccessState; + ACCESS_MASK DesiredAccess; + ULONG FullCreateOptions; }; typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT; struct _VPB { - CSHORT Type ; - CSHORT Size ; - USHORT Flags ; - USHORT VolumeLabelLength ; - struct _DEVICE_OBJECT *DeviceObject ; - struct _DEVICE_OBJECT *RealDevice ; - ULONG SerialNumber ; - ULONG ReferenceCount ; - WCHAR VolumeLabel[(32U * sizeof(WCHAR )) / sizeof(WCHAR )] ; + CSHORT Type; + CSHORT Size; + USHORT Flags; + USHORT VolumeLabelLength; + struct _DEVICE_OBJECT *DeviceObject; + struct _DEVICE_OBJECT *RealDevice; + ULONG SerialNumber; + ULONG ReferenceCount; + WCHAR VolumeLabel[(32U * sizeof(WCHAR)) / sizeof(WCHAR)]; }; typedef struct _VPB *PVPB; struct _WAIT_CONTEXT_BLOCK { - KDEVICE_QUEUE_ENTRY WaitQueueEntry ; - IO_ALLOCATION_ACTION (*DeviceRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp , - PVOID MapRegisterBase , PVOID Context ) ; - PVOID DeviceContext ; - ULONG NumberOfMapRegisters ; - PVOID DeviceObject ; - PVOID CurrentIrp ; - PKDPC BufferChainingDpc ; + KDEVICE_QUEUE_ENTRY WaitQueueEntry; + IO_ALLOCATION_ACTION(*DeviceRoutine) + (struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp, PVOID MapRegisterBase, + PVOID Context); + PVOID DeviceContext; + ULONG NumberOfMapRegisters; + PVOID DeviceObject; + PVOID CurrentIrp; + PKDPC BufferChainingDpc; }; typedef struct _WAIT_CONTEXT_BLOCK WAIT_CONTEXT_BLOCK; union __anonunion_Queue_43 { - LIST_ENTRY ListEntry ; - WAIT_CONTEXT_BLOCK Wcb ; + LIST_ENTRY ListEntry; + WAIT_CONTEXT_BLOCK Wcb; }; struct _DEVOBJ_EXTENSION; struct _DEVICE_OBJECT { - CSHORT Type ; - USHORT Size ; - LONG ReferenceCount ; - struct _DRIVER_OBJECT *DriverObject ; - struct _DEVICE_OBJECT *NextDevice ; - struct _DEVICE_OBJECT *AttachedDevice ; - struct _IRP *CurrentIrp ; - PIO_TIMER Timer ; - ULONG Flags ; - ULONG Characteristics ; - PVPB Vpb ; - PVOID DeviceExtension ; - ULONG DeviceType ; - CCHAR StackSize ; - union __anonunion_Queue_43 Queue ; - ULONG AlignmentRequirement ; - KDEVICE_QUEUE DeviceQueue ; - KDPC Dpc ; - ULONG ActiveThreadCount ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - KEVENT DeviceLock ; - USHORT SectorSize ; - USHORT Spare1 ; - struct _DEVOBJ_EXTENSION *DeviceObjectExtension ; - PVOID Reserved ; + CSHORT Type; + USHORT Size; + LONG ReferenceCount; + struct _DRIVER_OBJECT *DriverObject; + struct _DEVICE_OBJECT *NextDevice; + struct _DEVICE_OBJECT *AttachedDevice; + struct _IRP *CurrentIrp; + PIO_TIMER Timer; + ULONG Flags; + ULONG Characteristics; + PVPB Vpb; + PVOID DeviceExtension; + ULONG DeviceType; + CCHAR StackSize; + union __anonunion_Queue_43 Queue; + ULONG AlignmentRequirement; + KDEVICE_QUEUE DeviceQueue; + KDPC Dpc; + ULONG ActiveThreadCount; + PSECURITY_DESCRIPTOR SecurityDescriptor; + KEVENT DeviceLock; + USHORT SectorSize; + USHORT Spare1; + struct _DEVOBJ_EXTENSION *DeviceObjectExtension; + PVOID Reserved; }; typedef struct _DEVICE_OBJECT DEVICE_OBJECT; typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; struct _DEVOBJ_EXTENSION { - CSHORT Type ; - USHORT Size ; - PDEVICE_OBJECT DeviceObject ; + CSHORT Type; + USHORT Size; + PDEVICE_OBJECT DeviceObject; }; struct _DRIVER_EXTENSION { - struct _DRIVER_OBJECT *DriverObject ; - NTSTATUS (*AddDevice)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ; - ULONG Count ; - UNICODE_STRING ServiceKeyName ; + struct _DRIVER_OBJECT *DriverObject; + NTSTATUS(*AddDevice) + (struct _DRIVER_OBJECT *DriverObject, + struct _DEVICE_OBJECT *PhysicalDeviceObject); + ULONG Count; + UNICODE_STRING ServiceKeyName; }; typedef struct _DRIVER_EXTENSION *PDRIVER_EXTENSION; struct _DRIVER_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - ULONG Flags ; - PVOID DriverStart ; - ULONG DriverSize ; - PVOID DriverSection ; - PDRIVER_EXTENSION DriverExtension ; - UNICODE_STRING DriverName ; - PUNICODE_STRING HardwareDatabase ; - PFAST_IO_DISPATCH FastIoDispatch ; - NTSTATUS (*DriverInit)(struct _DRIVER_OBJECT *DriverObject , PUNICODE_STRING RegistryPath ) ; - void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject ) ; - PDRIVER_DISPATCH MajorFunction[28] ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + PVOID DriverStart; + ULONG DriverSize; + PVOID DriverSection; + PDRIVER_EXTENSION DriverExtension; + UNICODE_STRING DriverName; + PUNICODE_STRING HardwareDatabase; + PFAST_IO_DISPATCH FastIoDispatch; + NTSTATUS(*DriverInit) + (struct _DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath); + void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject); + PDRIVER_DISPATCH MajorFunction[28]; }; typedef struct _DRIVER_OBJECT DRIVER_OBJECT; typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; struct _SECTION_OBJECT_POINTERS { - PVOID DataSectionObject ; - PVOID SharedCacheMap ; - PVOID ImageSectionObject ; + PVOID DataSectionObject; + PVOID SharedCacheMap; + PVOID ImageSectionObject; }; typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS; typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS; struct _IO_COMPLETION_CONTEXT { - PVOID Port ; - PVOID Key ; + PVOID Port; + PVOID Key; }; typedef struct _IO_COMPLETION_CONTEXT *PIO_COMPLETION_CONTEXT; struct _FILE_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - PVPB Vpb ; - PVOID FsContext ; - PVOID FsContext2 ; - PSECTION_OBJECT_POINTERS SectionObjectPointer ; - PVOID PrivateCacheMap ; - NTSTATUS FinalStatus ; - struct _FILE_OBJECT *RelatedFileObject ; - BOOLEAN LockOperation ; - BOOLEAN DeletePending ; - BOOLEAN ReadAccess ; - BOOLEAN WriteAccess ; - BOOLEAN DeleteAccess ; - BOOLEAN SharedRead ; - BOOLEAN SharedWrite ; - BOOLEAN SharedDelete ; - ULONG Flags ; - UNICODE_STRING FileName ; - LARGE_INTEGER CurrentByteOffset ; - ULONG Waiters ; - ULONG Busy ; - PVOID LastLock ; - KEVENT Lock ; - KEVENT Event ; - PIO_COMPLETION_CONTEXT CompletionContext ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + PVPB Vpb; + PVOID FsContext; + PVOID FsContext2; + PSECTION_OBJECT_POINTERS SectionObjectPointer; + PVOID PrivateCacheMap; + NTSTATUS FinalStatus; + struct _FILE_OBJECT *RelatedFileObject; + BOOLEAN LockOperation; + BOOLEAN DeletePending; + BOOLEAN ReadAccess; + BOOLEAN WriteAccess; + BOOLEAN DeleteAccess; + BOOLEAN SharedRead; + BOOLEAN SharedWrite; + BOOLEAN SharedDelete; + ULONG Flags; + UNICODE_STRING FileName; + LARGE_INTEGER CurrentByteOffset; + ULONG Waiters; + ULONG Busy; + PVOID LastLock; + KEVENT Lock; + KEVENT Event; + PIO_COMPLETION_CONTEXT CompletionContext; }; typedef struct _FILE_OBJECT *PFILE_OBJECT; union __anonunion_AssociatedIrp_44 { - struct _IRP *MasterIrp ; - LONG IrpCount ; - PVOID SystemBuffer ; + struct _IRP *MasterIrp; + LONG IrpCount; + PVOID SystemBuffer; }; struct __anonstruct_AsynchronousParameters_46 { - void (*UserApcRoutine)(PVOID ApcContext , PIO_STATUS_BLOCK IoStatusBlock , - ULONG Reserved ) ; - PVOID UserApcContext ; + void (*UserApcRoutine)(PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, + ULONG Reserved); + PVOID UserApcContext; }; union __anonunion_Overlay_45 { - struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters ; - LARGE_INTEGER AllocationSize ; + struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters; + LARGE_INTEGER AllocationSize; }; struct __anonstruct____missing_field_name_50 { - PVOID DriverContext[4] ; + PVOID DriverContext[4]; }; union __anonunion____missing_field_name_49 { - KDEVICE_QUEUE_ENTRY DeviceQueueEntry ; - struct __anonstruct____missing_field_name_50 __annonCompField14 ; + KDEVICE_QUEUE_ENTRY DeviceQueueEntry; + struct __anonstruct____missing_field_name_50 __annonCompField14; }; struct _IO_STACK_LOCATION; union __anonunion____missing_field_name_52 { - struct _IO_STACK_LOCATION *CurrentStackLocation ; - ULONG PacketType ; + struct _IO_STACK_LOCATION *CurrentStackLocation; + ULONG PacketType; }; struct __anonstruct____missing_field_name_51 { - LIST_ENTRY ListEntry ; - union __anonunion____missing_field_name_52 __annonCompField16 ; + LIST_ENTRY ListEntry; + union __anonunion____missing_field_name_52 __annonCompField16; }; struct __anonstruct_Overlay_48 { - union __anonunion____missing_field_name_49 __annonCompField15 ; - PETHREAD Thread ; - PCHAR AuxiliaryBuffer ; - struct __anonstruct____missing_field_name_51 __annonCompField17 ; - PFILE_OBJECT OriginalFileObject ; + union __anonunion____missing_field_name_49 __annonCompField15; + PETHREAD Thread; + PCHAR AuxiliaryBuffer; + struct __anonstruct____missing_field_name_51 __annonCompField17; + PFILE_OBJECT OriginalFileObject; }; union __anonunion_Tail_47 { - struct __anonstruct_Overlay_48 Overlay ; - KAPC Apc ; - PVOID CompletionKey ; + struct __anonstruct_Overlay_48 Overlay; + KAPC Apc; + PVOID CompletionKey; }; struct _IRP { - CSHORT Type ; - USHORT Size ; - PMDL MdlAddress ; - ULONG Flags ; - union __anonunion_AssociatedIrp_44 AssociatedIrp ; - LIST_ENTRY ThreadListEntry ; - IO_STATUS_BLOCK IoStatus ; - KPROCESSOR_MODE RequestorMode ; - BOOLEAN PendingReturned ; - CHAR StackCount ; - CHAR CurrentLocation ; - BOOLEAN Cancel ; - KIRQL CancelIrql ; - CCHAR ApcEnvironment ; - UCHAR AllocationFlags ; - PIO_STATUS_BLOCK UserIosb ; - PKEVENT UserEvent ; - union __anonunion_Overlay_45 Overlay ; - void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - PVOID UserBuffer ; - union __anonunion_Tail_47 Tail ; + CSHORT Type; + USHORT Size; + PMDL MdlAddress; + ULONG Flags; + union __anonunion_AssociatedIrp_44 AssociatedIrp; + LIST_ENTRY ThreadListEntry; + IO_STATUS_BLOCK IoStatus; + KPROCESSOR_MODE RequestorMode; + BOOLEAN PendingReturned; + CHAR StackCount; + CHAR CurrentLocation; + BOOLEAN Cancel; + KIRQL CancelIrql; + CCHAR ApcEnvironment; + UCHAR AllocationFlags; + PIO_STATUS_BLOCK UserIosb; + PKEVENT UserEvent; + union __anonunion_Overlay_45 Overlay; + void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + PVOID UserBuffer; + union __anonunion_Tail_47 Tail; }; typedef struct _IRP IRP; typedef struct _IRP *PIRP; enum _DEVICE_RELATION_TYPE { - BusRelations = 0, - EjectionRelations = 1, - PowerRelations = 2, - RemovalRelations = 3, - TargetDeviceRelation = 4 -} ; + BusRelations = 0, + EjectionRelations = 1, + PowerRelations = 2, + RemovalRelations = 3, + TargetDeviceRelation = 4 +}; typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE; struct _DEVICE_RELATIONS { - ULONG Count ; - PDEVICE_OBJECT Objects[1] ; + ULONG Count; + PDEVICE_OBJECT Objects[1]; }; typedef struct _DEVICE_RELATIONS DEVICE_RELATIONS; typedef struct _DEVICE_RELATIONS *PDEVICE_RELATIONS; enum _DEVICE_USAGE_NOTIFICATION_TYPE { - DeviceUsageTypeUndefined = 0, - DeviceUsageTypePaging = 1, - DeviceUsageTypeHibernation = 2, - DeviceUsageTypeDumpFile = 3 -} ; + DeviceUsageTypeUndefined = 0, + DeviceUsageTypePaging = 1, + DeviceUsageTypeHibernation = 2, + DeviceUsageTypeDumpFile = 3 +}; typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE; struct _INTERFACE { - USHORT Size ; - USHORT Version ; - PVOID Context ; - void (*InterfaceReference)(PVOID Context ) ; - void (*InterfaceDereference)(PVOID Context ) ; + USHORT Size; + USHORT Version; + PVOID Context; + void (*InterfaceReference)(PVOID Context); + void (*InterfaceDereference)(PVOID Context); }; typedef struct _INTERFACE *PINTERFACE; struct _DEVICE_CAPABILITIES { - USHORT Size ; - USHORT Version ; - ULONG DeviceD1 : 1 ; - ULONG DeviceD2 : 1 ; - ULONG LockSupported : 1 ; - ULONG EjectSupported : 1 ; - ULONG Removable : 1 ; - ULONG DockDevice : 1 ; - ULONG UniqueID : 1 ; - ULONG SilentInstall : 1 ; - ULONG RawDeviceOK : 1 ; - ULONG SurpriseRemovalOK : 1 ; - ULONG WakeFromD0 : 1 ; - ULONG WakeFromD1 : 1 ; - ULONG WakeFromD2 : 1 ; - ULONG WakeFromD3 : 1 ; - ULONG HardwareDisabled : 1 ; - ULONG NonDynamic : 1 ; - ULONG WarmEjectSupported : 1 ; - ULONG Reserved : 15 ; - ULONG Address ; - ULONG UINumber ; - DEVICE_POWER_STATE DeviceState[7] ; - SYSTEM_POWER_STATE SystemWake ; - DEVICE_POWER_STATE DeviceWake ; - ULONG D1Latency ; - ULONG D2Latency ; - ULONG D3Latency ; + USHORT Size; + USHORT Version; + ULONG DeviceD1 : 1; + ULONG DeviceD2 : 1; + ULONG LockSupported : 1; + ULONG EjectSupported : 1; + ULONG Removable : 1; + ULONG DockDevice : 1; + ULONG UniqueID : 1; + ULONG SilentInstall : 1; + ULONG RawDeviceOK : 1; + ULONG SurpriseRemovalOK : 1; + ULONG WakeFromD0 : 1; + ULONG WakeFromD1 : 1; + ULONG WakeFromD2 : 1; + ULONG WakeFromD3 : 1; + ULONG HardwareDisabled : 1; + ULONG NonDynamic : 1; + ULONG WarmEjectSupported : 1; + ULONG Reserved : 15; + ULONG Address; + ULONG UINumber; + DEVICE_POWER_STATE DeviceState[7]; + SYSTEM_POWER_STATE SystemWake; + DEVICE_POWER_STATE DeviceWake; + ULONG D1Latency; + ULONG D2Latency; + ULONG D3Latency; }; typedef struct _DEVICE_CAPABILITIES *PDEVICE_CAPABILITIES; struct _POWER_SEQUENCE { - ULONG SequenceD1 ; - ULONG SequenceD2 ; - ULONG SequenceD3 ; + ULONG SequenceD1; + ULONG SequenceD2; + ULONG SequenceD3; }; typedef struct _POWER_SEQUENCE *PPOWER_SEQUENCE; enum __anonenum_BUS_QUERY_ID_TYPE_53 { - BusQueryDeviceID = 0, - BusQueryHardwareIDs = 1, - BusQueryCompatibleIDs = 2, - BusQueryInstanceID = 3, - BusQueryDeviceSerialNumber = 4 -} ; + BusQueryDeviceID = 0, + BusQueryHardwareIDs = 1, + BusQueryCompatibleIDs = 2, + BusQueryInstanceID = 3, + BusQueryDeviceSerialNumber = 4 +}; typedef enum __anonenum_BUS_QUERY_ID_TYPE_53 BUS_QUERY_ID_TYPE; enum __anonenum_DEVICE_TEXT_TYPE_54 { - DeviceTextDescription = 0, - DeviceTextLocationInformation = 1 -} ; + DeviceTextDescription = 0, + DeviceTextLocationInformation = 1 +}; typedef enum __anonenum_DEVICE_TEXT_TYPE_54 DEVICE_TEXT_TYPE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Create_56 { - PIO_SECURITY_CONTEXT SecurityContext ; - ULONG Options ; - USHORT FileAttributes ; - USHORT ShareAccess ; - ULONG EaLength ; + PIO_SECURITY_CONTEXT SecurityContext; + ULONG Options; + USHORT FileAttributes; + USHORT ShareAccess; + ULONG EaLength; }; struct __anonstruct_Read_57 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_Write_58 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_QueryFile_59 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; }; struct __anonstruct____missing_field_name_62 { - BOOLEAN ReplaceIfExists ; - BOOLEAN AdvanceOnly ; + BOOLEAN ReplaceIfExists; + BOOLEAN AdvanceOnly; }; union __anonunion____missing_field_name_61 { - struct __anonstruct____missing_field_name_62 __annonCompField18 ; - ULONG ClusterCount ; - HANDLE DeleteHandle ; + struct __anonstruct____missing_field_name_62 __annonCompField18; + ULONG ClusterCount; + HANDLE DeleteHandle; }; struct __anonstruct_SetFile_60 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; - PFILE_OBJECT FileObject ; - union __anonunion____missing_field_name_61 __annonCompField19 ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; + PFILE_OBJECT FileObject; + union __anonunion____missing_field_name_61 __annonCompField19; }; struct __anonstruct_QueryVolume_63 { - ULONG Length ; - FS_INFORMATION_CLASS FsInformationClass ; + ULONG Length; + FS_INFORMATION_CLASS FsInformationClass; }; struct __anonstruct_DeviceIoControl_64 { - ULONG OutputBufferLength ; - ULONG InputBufferLength ; - ULONG IoControlCode ; - PVOID Type3InputBuffer ; + ULONG OutputBufferLength; + ULONG InputBufferLength; + ULONG IoControlCode; + PVOID Type3InputBuffer; }; struct __anonstruct_QuerySecurity_65 { - SECURITY_INFORMATION SecurityInformation ; - ULONG Length ; + SECURITY_INFORMATION SecurityInformation; + ULONG Length; }; struct __anonstruct_SetSecurity_66 { - SECURITY_INFORMATION SecurityInformation ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; + SECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; }; struct __anonstruct_MountVolume_67 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_VerifyVolume_68 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_Scsi_69 { - struct _SCSI_REQUEST_BLOCK *Srb ; + struct _SCSI_REQUEST_BLOCK *Srb; }; struct __anonstruct_QueryDeviceRelations_70 { - DEVICE_RELATION_TYPE Type ; + DEVICE_RELATION_TYPE Type; }; struct __anonstruct_QueryInterface_71 { - GUID const *InterfaceType ; - USHORT Size ; - USHORT Version ; - PINTERFACE Interface ; - PVOID InterfaceSpecificData ; + GUID const *InterfaceType; + USHORT Size; + USHORT Version; + PINTERFACE Interface; + PVOID InterfaceSpecificData; }; struct __anonstruct_DeviceCapabilities_72 { - PDEVICE_CAPABILITIES Capabilities ; + PDEVICE_CAPABILITIES Capabilities; }; struct __anonstruct_FilterResourceRequirements_73 { - PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList ; + PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; }; struct __anonstruct_ReadWriteConfig_74 { - ULONG WhichSpace ; - PVOID Buffer ; - ULONG Offset ; - ULONG Length ; + ULONG WhichSpace; + PVOID Buffer; + ULONG Offset; + ULONG Length; }; struct __anonstruct_SetLock_75 { - BOOLEAN Lock ; + BOOLEAN Lock; }; struct __anonstruct_QueryId_76 { - BUS_QUERY_ID_TYPE IdType ; + BUS_QUERY_ID_TYPE IdType; }; struct __anonstruct_QueryDeviceText_77 { - DEVICE_TEXT_TYPE DeviceTextType ; - LCID LocaleId ; + DEVICE_TEXT_TYPE DeviceTextType; + LCID LocaleId; }; struct __anonstruct_UsageNotification_78 { - BOOLEAN InPath ; - BOOLEAN Reserved[3] ; - DEVICE_USAGE_NOTIFICATION_TYPE Type ; + BOOLEAN InPath; + BOOLEAN Reserved[3]; + DEVICE_USAGE_NOTIFICATION_TYPE Type; }; struct __anonstruct_WaitWake_79 { - SYSTEM_POWER_STATE PowerState ; + SYSTEM_POWER_STATE PowerState; }; struct __anonstruct_PowerSequence_80 { - PPOWER_SEQUENCE PowerSequence ; + PPOWER_SEQUENCE PowerSequence; }; struct __anonstruct_Power_81 { - ULONG SystemContext ; - POWER_STATE_TYPE Type ; - POWER_STATE State ; - POWER_ACTION ShutdownType ; + ULONG SystemContext; + POWER_STATE_TYPE Type; + POWER_STATE State; + POWER_ACTION ShutdownType; }; struct __anonstruct_StartDevice_82 { - PCM_RESOURCE_LIST AllocatedResources ; - PCM_RESOURCE_LIST AllocatedResourcesTranslated ; + PCM_RESOURCE_LIST AllocatedResources; + PCM_RESOURCE_LIST AllocatedResourcesTranslated; }; struct __anonstruct_WMI_83 { - ULONG_PTR ProviderId ; - PVOID DataPath ; - ULONG BufferSize ; - PVOID Buffer ; + ULONG_PTR ProviderId; + PVOID DataPath; + ULONG BufferSize; + PVOID Buffer; }; struct __anonstruct_Others_84 { - PVOID Argument1 ; - PVOID Argument2 ; - PVOID Argument3 ; - PVOID Argument4 ; + PVOID Argument1; + PVOID Argument2; + PVOID Argument3; + PVOID Argument4; }; union __anonunion_Parameters_55 { - struct __anonstruct_Create_56 Create ; - struct __anonstruct_Read_57 Read ; - struct __anonstruct_Write_58 Write ; - struct __anonstruct_QueryFile_59 QueryFile ; - struct __anonstruct_SetFile_60 SetFile ; - struct __anonstruct_QueryVolume_63 QueryVolume ; - struct __anonstruct_DeviceIoControl_64 DeviceIoControl ; - struct __anonstruct_QuerySecurity_65 QuerySecurity ; - struct __anonstruct_SetSecurity_66 SetSecurity ; - struct __anonstruct_MountVolume_67 MountVolume ; - struct __anonstruct_VerifyVolume_68 VerifyVolume ; - struct __anonstruct_Scsi_69 Scsi ; - struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations ; - struct __anonstruct_QueryInterface_71 QueryInterface ; - struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities ; - struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements ; - struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig ; - struct __anonstruct_SetLock_75 SetLock ; - struct __anonstruct_QueryId_76 QueryId ; - struct __anonstruct_QueryDeviceText_77 QueryDeviceText ; - struct __anonstruct_UsageNotification_78 UsageNotification ; - struct __anonstruct_WaitWake_79 WaitWake ; - struct __anonstruct_PowerSequence_80 PowerSequence ; - struct __anonstruct_Power_81 Power ; - struct __anonstruct_StartDevice_82 StartDevice ; - struct __anonstruct_WMI_83 WMI ; - struct __anonstruct_Others_84 Others ; + struct __anonstruct_Create_56 Create; + struct __anonstruct_Read_57 Read; + struct __anonstruct_Write_58 Write; + struct __anonstruct_QueryFile_59 QueryFile; + struct __anonstruct_SetFile_60 SetFile; + struct __anonstruct_QueryVolume_63 QueryVolume; + struct __anonstruct_DeviceIoControl_64 DeviceIoControl; + struct __anonstruct_QuerySecurity_65 QuerySecurity; + struct __anonstruct_SetSecurity_66 SetSecurity; + struct __anonstruct_MountVolume_67 MountVolume; + struct __anonstruct_VerifyVolume_68 VerifyVolume; + struct __anonstruct_Scsi_69 Scsi; + struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations; + struct __anonstruct_QueryInterface_71 QueryInterface; + struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities; + struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements; + struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig; + struct __anonstruct_SetLock_75 SetLock; + struct __anonstruct_QueryId_76 QueryId; + struct __anonstruct_QueryDeviceText_77 QueryDeviceText; + struct __anonstruct_UsageNotification_78 UsageNotification; + struct __anonstruct_WaitWake_79 WaitWake; + struct __anonstruct_PowerSequence_80 PowerSequence; + struct __anonstruct_Power_81 Power; + struct __anonstruct_StartDevice_82 StartDevice; + struct __anonstruct_WMI_83 WMI; + struct __anonstruct_Others_84 Others; }; struct _IO_STACK_LOCATION { - UCHAR MajorFunction ; - UCHAR MinorFunction ; - UCHAR Flags ; - UCHAR Control ; - union __anonunion_Parameters_55 Parameters ; - PDEVICE_OBJECT DeviceObject ; - PFILE_OBJECT FileObject ; - NTSTATUS (*CompletionRoutine)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - PVOID Context ; + UCHAR MajorFunction; + UCHAR MinorFunction; + UCHAR Flags; + UCHAR Control; + union __anonunion_Parameters_55 Parameters; + PDEVICE_OBJECT DeviceObject; + PFILE_OBJECT FileObject; + NTSTATUS(*CompletionRoutine) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + PVOID Context; }; typedef struct _IO_STACK_LOCATION IO_STACK_LOCATION; typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION; #pragma pack(pop) struct _CONFIGURATION_INFORMATION { - ULONG DiskCount ; - ULONG FloppyCount ; - ULONG CdRomCount ; - ULONG TapeCount ; - ULONG ScsiPortCount ; - ULONG SerialCount ; - ULONG ParallelCount ; - BOOLEAN AtDiskPrimaryAddressClaimed ; - BOOLEAN AtDiskSecondaryAddressClaimed ; - ULONG Version ; - ULONG MediumChangerCount ; + ULONG DiskCount; + ULONG FloppyCount; + ULONG CdRomCount; + ULONG TapeCount; + ULONG ScsiPortCount; + ULONG SerialCount; + ULONG ParallelCount; + BOOLEAN AtDiskPrimaryAddressClaimed; + BOOLEAN AtDiskSecondaryAddressClaimed; + ULONG Version; + ULONG MediumChangerCount; }; typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION; typedef struct _CONFIGURATION_INFORMATION *PCONFIGURATION_INFORMATION; struct _IO_REMOVE_LOCK_COMMON_BLOCK { - BOOLEAN Removed ; - BOOLEAN Reserved[3] ; - LONG IoCount ; - KEVENT RemoveEvent ; + BOOLEAN Removed; + BOOLEAN Reserved[3]; + LONG IoCount; + KEVENT RemoveEvent; }; typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK IO_REMOVE_LOCK_COMMON_BLOCK; struct _IO_REMOVE_LOCK { - IO_REMOVE_LOCK_COMMON_BLOCK Common ; + IO_REMOVE_LOCK_COMMON_BLOCK Common; }; typedef struct _IO_REMOVE_LOCK IO_REMOVE_LOCK; typedef struct _IO_REMOVE_LOCK *PIO_REMOVE_LOCK; struct _OBJECT_HANDLE_INFORMATION { - ULONG HandleAttributes ; - ACCESS_MASK GrantedAccess ; + ULONG HandleAttributes; + ACCESS_MASK GrantedAccess; }; typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION; struct _PARPORT_REMOVAL_RELATIONS { - PDEVICE_OBJECT DeviceObject ; - ULONG Flags ; - PUNICODE_STRING DeviceName ; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + PUNICODE_STRING DeviceName; }; typedef struct _PARPORT_REMOVAL_RELATIONS PARPORT_REMOVAL_RELATIONS; typedef struct _PARPORT_REMOVAL_RELATIONS *PPARPORT_REMOVAL_RELATIONS; struct _PARALLEL_PARCHIP_INFO { - PUCHAR Controller ; - PUCHAR EcrController ; - ULONG HardwareModes ; - NTSTATUS (*ParChipSetMode)(PVOID SetChipContext , UCHAR ChipMode ) ; - NTSTATUS (*ParChipClearMode)(PVOID ClearChipContext , UCHAR ChipMode ) ; - PVOID Context ; - BOOLEAN success ; + PUCHAR Controller; + PUCHAR EcrController; + ULONG HardwareModes; + NTSTATUS (*ParChipSetMode)(PVOID SetChipContext, UCHAR ChipMode); + NTSTATUS (*ParChipClearMode)(PVOID ClearChipContext, UCHAR ChipMode); + PVOID Context; + BOOLEAN success; }; typedef struct _PARALLEL_PARCHIP_INFO PARALLEL_PARCHIP_INFO; struct _PARALLEL_PORT_INFORMATION { - PHYSICAL_ADDRESS OriginalController ; - PUCHAR Controller ; - ULONG SpanOfController ; - BOOLEAN (*TryAllocatePort)(PVOID TryAllocateContext ) ; - void (*FreePort)(PVOID FreeContext ) ; - ULONG (*QueryNumWaiters)(PVOID QueryAllocsContext ) ; - PVOID Context ; + PHYSICAL_ADDRESS OriginalController; + PUCHAR Controller; + ULONG SpanOfController; + BOOLEAN (*TryAllocatePort)(PVOID TryAllocateContext); + void (*FreePort)(PVOID FreeContext); + ULONG (*QueryNumWaiters)(PVOID QueryAllocsContext); + PVOID Context; }; typedef struct _PARALLEL_PORT_INFORMATION PARALLEL_PORT_INFORMATION; typedef struct _PARALLEL_PORT_INFORMATION *PPARALLEL_PORT_INFORMATION; struct _PARALLEL_PNP_INFORMATION { - PHYSICAL_ADDRESS OriginalEcpController ; - PUCHAR EcpController ; - ULONG SpanOfEcpController ; - ULONG PortNumber ; - ULONG HardwareCapabilities ; - NTSTATUS (*TrySetChipMode)(PVOID SetChipContext , UCHAR ChipMode ) ; - NTSTATUS (*ClearChipMode)(PVOID ClearChipContext , UCHAR ChipMode ) ; - ULONG FifoDepth ; - ULONG FifoWidth ; - PHYSICAL_ADDRESS EppControllerPhysicalAddress ; - ULONG SpanOfEppController ; - ULONG Ieee1284_3DeviceCount ; - NTSTATUS (*TrySelectDevice)(PVOID TrySelectContext , PVOID TrySelectCommand ) ; - NTSTATUS (*DeselectDevice)(PVOID DeselectContext , PVOID DeselectCommand ) ; - PVOID Context ; - ULONG CurrentMode ; - PWSTR PortName ; + PHYSICAL_ADDRESS OriginalEcpController; + PUCHAR EcpController; + ULONG SpanOfEcpController; + ULONG PortNumber; + ULONG HardwareCapabilities; + NTSTATUS (*TrySetChipMode)(PVOID SetChipContext, UCHAR ChipMode); + NTSTATUS (*ClearChipMode)(PVOID ClearChipContext, UCHAR ChipMode); + ULONG FifoDepth; + ULONG FifoWidth; + PHYSICAL_ADDRESS EppControllerPhysicalAddress; + ULONG SpanOfEppController; + ULONG Ieee1284_3DeviceCount; + NTSTATUS (*TrySelectDevice)(PVOID TrySelectContext, PVOID TrySelectCommand); + NTSTATUS (*DeselectDevice)(PVOID DeselectContext, PVOID DeselectCommand); + PVOID Context; + ULONG CurrentMode; + PWSTR PortName; }; typedef struct _PARALLEL_PNP_INFORMATION PARALLEL_PNP_INFORMATION; typedef struct _PARALLEL_PNP_INFORMATION *PPARALLEL_PNP_INFORMATION; struct _PARALLEL_1284_COMMAND { - UCHAR ID ; - UCHAR Port ; - ULONG CommandFlags ; + UCHAR ID; + UCHAR Port; + ULONG CommandFlags; }; typedef struct _PARALLEL_1284_COMMAND PARALLEL_1284_COMMAND; typedef struct _PARALLEL_1284_COMMAND *PPARALLEL_1284_COMMAND; struct _PARALLEL_CHIP_MODE { - UCHAR ModeFlags ; - BOOLEAN success ; + UCHAR ModeFlags; + BOOLEAN success; }; typedef struct _PARALLEL_CHIP_MODE PARALLEL_CHIP_MODE; struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE { - BOOLEAN (*InterruptServiceRoutine)(struct _KINTERRUPT *Interrupt , PVOID ServiceContext ) ; - PVOID InterruptServiceContext ; - void (*DeferredPortCheckRoutine)(PVOID DeferredContext ) ; - PVOID DeferredPortCheckContext ; -}; -typedef struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE PARALLEL_INTERRUPT_SERVICE_ROUTINE; -typedef struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE *PPARALLEL_INTERRUPT_SERVICE_ROUTINE; + BOOLEAN(*InterruptServiceRoutine) + (struct _KINTERRUPT *Interrupt, PVOID ServiceContext); + PVOID InterruptServiceContext; + void (*DeferredPortCheckRoutine)(PVOID DeferredContext); + PVOID DeferredPortCheckContext; +}; +typedef struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE + PARALLEL_INTERRUPT_SERVICE_ROUTINE; +typedef struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE + *PPARALLEL_INTERRUPT_SERVICE_ROUTINE; struct _PARALLEL_INTERRUPT_INFORMATION { - PKINTERRUPT InterruptObject ; - BOOLEAN (*TryAllocatePortAtInterruptLevel)(PVOID TryAllocateContext ) ; - void (*FreePortFromInterruptLevel)(PVOID FreeContext ) ; - PVOID Context ; + PKINTERRUPT InterruptObject; + BOOLEAN (*TryAllocatePortAtInterruptLevel)(PVOID TryAllocateContext); + void (*FreePortFromInterruptLevel)(PVOID FreeContext); + PVOID Context; }; typedef struct _PARALLEL_INTERRUPT_INFORMATION PARALLEL_INTERRUPT_INFORMATION; typedef struct _PARALLEL_INTERRUPT_INFORMATION *PPARALLEL_INTERRUPT_INFORMATION; struct _MORE_PARALLEL_PORT_INFORMATION { - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - ULONG InterruptLevel ; - ULONG InterruptVector ; - KAFFINITY InterruptAffinity ; - KINTERRUPT_MODE InterruptMode ; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + ULONG InterruptLevel; + ULONG InterruptVector; + KAFFINITY InterruptAffinity; + KINTERRUPT_MODE InterruptMode; }; typedef struct _MORE_PARALLEL_PORT_INFORMATION MORE_PARALLEL_PORT_INFORMATION; typedef struct _MORE_PARALLEL_PORT_INFORMATION *PMORE_PARALLEL_PORT_INFORMATION; struct __anonstruct_WMIGUIDREGINFO_114 { - LPCGUID Guid ; - ULONG InstanceCount ; - ULONG Flags ; + LPCGUID Guid; + ULONG InstanceCount; + ULONG Flags; }; typedef struct __anonstruct_WMIGUIDREGINFO_114 WMIGUIDREGINFO; typedef struct __anonstruct_WMIGUIDREGINFO_114 *PWMIGUIDREGINFO; enum __anonenum_WMIENABLEDISABLECONTROL_115 { - WmiEventControl = 0, - WmiDataBlockControl = 1 -} ; + WmiEventControl = 0, + WmiDataBlockControl = 1 +}; typedef enum __anonenum_WMIENABLEDISABLECONTROL_115 WMIENABLEDISABLECONTROL; struct _WMILIB_CONTEXT { - ULONG GuidCount ; - PWMIGUIDREGINFO GuidList ; - NTSTATUS (*QueryWmiRegInfo)(PDEVICE_OBJECT DeviceObject , PULONG RegFlags , PUNICODE_STRING InstanceName , - PUNICODE_STRING *RegistryPath , PUNICODE_STRING MofResourceName , - PDEVICE_OBJECT *Pdo ) ; - NTSTATUS (*QueryWmiDataBlock)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray , - ULONG BufferAvail , PUCHAR Buffer ) ; - NTSTATUS (*SetWmiDataBlock)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG BufferSize , PUCHAR Buffer ) ; - NTSTATUS (*SetWmiDataItem)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG DataItemId , ULONG BufferSize , - PUCHAR Buffer ) ; - NTSTATUS (*ExecuteWmiMethod)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG MethodId , ULONG InBufferSize , - ULONG OutBufferSize , PUCHAR Buffer ) ; - NTSTATUS (*WmiFunctionControl)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - WMIENABLEDISABLECONTROL Function , BOOLEAN Enable ) ; + ULONG GuidCount; + PWMIGUIDREGINFO GuidList; + NTSTATUS(*QueryWmiRegInfo) + (PDEVICE_OBJECT DeviceObject, PULONG RegFlags, PUNICODE_STRING InstanceName, + PUNICODE_STRING *RegistryPath, PUNICODE_STRING MofResourceName, + PDEVICE_OBJECT *Pdo); + NTSTATUS(*QueryWmiDataBlock) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG InstanceCount, PULONG InstanceLengthArray, ULONG BufferAvail, + PUCHAR Buffer); + NTSTATUS(*SetWmiDataBlock) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG BufferSize, PUCHAR Buffer); + NTSTATUS(*SetWmiDataItem) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG DataItemId, ULONG BufferSize, PUCHAR Buffer); + NTSTATUS(*ExecuteWmiMethod) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG MethodId, ULONG InBufferSize, ULONG OutBufferSize, PUCHAR Buffer); + NTSTATUS(*WmiFunctionControl) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, + WMIENABLEDISABLECONTROL Function, BOOLEAN Enable); }; typedef struct _WMILIB_CONTEXT WMILIB_CONTEXT; typedef struct _WMILIB_CONTEXT *PWMILIB_CONTEXT; enum __anonenum_SYSCTL_IRP_DISPOSITION_116 { - IrpProcessed = 0, - IrpNotCompleted = 1, - IrpNotWmi = 2, - IrpForward = 3 -} ; + IrpProcessed = 0, + IrpNotCompleted = 1, + IrpNotWmi = 2, + IrpForward = 3 +}; typedef enum __anonenum_SYSCTL_IRP_DISPOSITION_116 SYSCTL_IRP_DISPOSITION; typedef enum __anonenum_SYSCTL_IRP_DISPOSITION_116 *PSYSCTL_IRP_DISPOSITION; struct _PARPORT_WMI_ALLOC_FREE_COUNTS { - ULONG PortAllocates ; - ULONG PortFrees ; + ULONG PortAllocates; + ULONG PortFrees; }; typedef struct _PARPORT_WMI_ALLOC_FREE_COUNTS PARPORT_WMI_ALLOC_FREE_COUNTS; struct _DEVICE_EXTENSION { - ULONG ExtensionSignatureBegin ; - ULONG DeviceStateFlags ; - PDEVICE_OBJECT DeviceObject ; - PDRIVER_OBJECT DriverObject ; - PDEVICE_OBJECT PhysicalDeviceObject ; - PDEVICE_OBJECT ParentDeviceObject ; - LONG OpenCloseRefCount ; - LIST_ENTRY RemovalRelationsList ; - LIST_ENTRY WorkQueue ; - LONG WorkQueueCount ; - PARALLEL_PORT_INFORMATION PortInfo ; - PARALLEL_PNP_INFORMATION PnpInfo ; - ULONG AddressSpace ; - ULONG EcpAddressSpace ; - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - BOOLEAN FoundInterrupt ; - KIRQL InterruptLevel ; - ULONG InterruptVector ; - KAFFINITY InterruptAffinity ; - KINTERRUPT_MODE InterruptMode ; - ULONG DmaChannel ; - ULONG DmaPort ; - USHORT DmaWidth ; - LIST_ENTRY IsrList ; - PKINTERRUPT InterruptObject ; - ULONG InterruptRefCount ; - KDPC FreePortDpc ; - BOOLEAN UnMapRegisters ; - BOOLEAN NationalChecked ; - BOOLEAN NationalChipFound ; - BOOLEAN FilterMode ; - UCHAR EcrPortData ; - PARALLEL_PARCHIP_INFO ChipInfo ; - UNICODE_STRING DeviceName ; - UNICODE_STRING SymbolicLinkName ; - DEVICE_POWER_STATE DeviceState ; - SYSTEM_POWER_STATE SystemState ; - IO_REMOVE_LOCK RemoveLock ; - FAST_MUTEX ExtensionFastMutex ; - FAST_MUTEX OpenCloseMutex ; - WMILIB_CONTEXT WmiLibContext ; - PARPORT_WMI_ALLOC_FREE_COUNTS WmiPortAllocFreeCounts ; - BOOLEAN CheckedForGenericEpp ; - BOOLEAN spare[3] ; - ULONG ExtensionSignatureEnd ; + ULONG ExtensionSignatureBegin; + ULONG DeviceStateFlags; + PDEVICE_OBJECT DeviceObject; + PDRIVER_OBJECT DriverObject; + PDEVICE_OBJECT PhysicalDeviceObject; + PDEVICE_OBJECT ParentDeviceObject; + LONG OpenCloseRefCount; + LIST_ENTRY RemovalRelationsList; + LIST_ENTRY WorkQueue; + LONG WorkQueueCount; + PARALLEL_PORT_INFORMATION PortInfo; + PARALLEL_PNP_INFORMATION PnpInfo; + ULONG AddressSpace; + ULONG EcpAddressSpace; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + BOOLEAN FoundInterrupt; + KIRQL InterruptLevel; + ULONG InterruptVector; + KAFFINITY InterruptAffinity; + KINTERRUPT_MODE InterruptMode; + ULONG DmaChannel; + ULONG DmaPort; + USHORT DmaWidth; + LIST_ENTRY IsrList; + PKINTERRUPT InterruptObject; + ULONG InterruptRefCount; + KDPC FreePortDpc; + BOOLEAN UnMapRegisters; + BOOLEAN NationalChecked; + BOOLEAN NationalChipFound; + BOOLEAN FilterMode; + UCHAR EcrPortData; + PARALLEL_PARCHIP_INFO ChipInfo; + UNICODE_STRING DeviceName; + UNICODE_STRING SymbolicLinkName; + DEVICE_POWER_STATE DeviceState; + SYSTEM_POWER_STATE SystemState; + IO_REMOVE_LOCK RemoveLock; + FAST_MUTEX ExtensionFastMutex; + FAST_MUTEX OpenCloseMutex; + WMILIB_CONTEXT WmiLibContext; + PARPORT_WMI_ALLOC_FREE_COUNTS WmiPortAllocFreeCounts; + BOOLEAN CheckedForGenericEpp; + BOOLEAN spare[3]; + ULONG ExtensionSignatureEnd; }; typedef struct _DEVICE_EXTENSION DEVICE_EXTENSION; typedef struct _DEVICE_EXTENSION *PDEVICE_EXTENSION; struct _SYNCHRONIZED_COUNT_CONTEXT { - PLONG Count ; - LONG NewCount ; + PLONG Count; + LONG NewCount; }; typedef struct _SYNCHRONIZED_COUNT_CONTEXT SYNCHRONIZED_COUNT_CONTEXT; struct _SYNCHRONIZED_LIST_CONTEXT { - PLIST_ENTRY List ; - PLIST_ENTRY NewEntry ; + PLIST_ENTRY List; + PLIST_ENTRY NewEntry; }; typedef struct _SYNCHRONIZED_LIST_CONTEXT SYNCHRONIZED_LIST_CONTEXT; typedef struct _SYNCHRONIZED_LIST_CONTEXT *PSYNCHRONIZED_LIST_CONTEXT; struct _SYNCHRONIZED_DISCONNECT_CONTEXT { - PDEVICE_EXTENSION Extension ; - PPARALLEL_INTERRUPT_SERVICE_ROUTINE IsrInfo ; + PDEVICE_EXTENSION Extension; + PPARALLEL_INTERRUPT_SERVICE_ROUTINE IsrInfo; }; typedef struct _SYNCHRONIZED_DISCONNECT_CONTEXT SYNCHRONIZED_DISCONNECT_CONTEXT; -typedef struct _SYNCHRONIZED_DISCONNECT_CONTEXT *PSYNCHRONIZED_DISCONNECT_CONTEXT; +typedef struct _SYNCHRONIZED_DISCONNECT_CONTEXT + *PSYNCHRONIZED_DISCONNECT_CONTEXT; struct _ISR_LIST_ENTRY { - LIST_ENTRY ListEntry ; - BOOLEAN (*ServiceRoutine)(struct _KINTERRUPT *Interrupt , PVOID ServiceContext ) ; - PVOID ServiceContext ; - void (*DeferredPortCheckRoutine)(PVOID DeferredContext ) ; - PVOID CheckContext ; + LIST_ENTRY ListEntry; + BOOLEAN(*ServiceRoutine) + (struct _KINTERRUPT *Interrupt, PVOID ServiceContext); + PVOID ServiceContext; + void (*DeferredPortCheckRoutine)(PVOID DeferredContext); + PVOID CheckContext; }; typedef struct _ISR_LIST_ENTRY ISR_LIST_ENTRY; typedef struct _ISR_LIST_ENTRY *PISR_LIST_ENTRY; struct _REMOVAL_RELATIONS_LIST_ENTRY { - LIST_ENTRY ListEntry ; - PDEVICE_OBJECT DeviceObject ; - ULONG Flags ; - UNICODE_STRING DeviceName ; + LIST_ENTRY ListEntry; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + UNICODE_STRING DeviceName; }; typedef struct _REMOVAL_RELATIONS_LIST_ENTRY REMOVAL_RELATIONS_LIST_ENTRY; typedef struct _REMOVAL_RELATIONS_LIST_ENTRY *PREMOVAL_RELATIONS_LIST_ENTRY; -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1661,17 +1695,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1679,17 +1713,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1697,17 +1731,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1715,17 +1749,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1733,17 +1767,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1751,17 +1785,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1769,17 +1803,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1787,17 +1821,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1805,17 +1839,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1823,17 +1857,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1841,17 +1875,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1859,17 +1893,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1877,17 +1911,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1895,17 +1929,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1913,17 +1947,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1931,1666 +1965,1733 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -extern void *malloc(unsigned long sz ) ; -extern void *memcpy(void * , void const * , size_t ) ; -extern void *memset(void * , int , size_t ) ; -extern void *memmove(void * , void const * , size_t ) ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; -extern NTSTATUS RtlIntegerToUnicodeString(ULONG Value , - ULONG Base , - PUNICODE_STRING String ) ; -extern NTSTATUS RtlUnicodeStringToInteger(PUNICODE_STRING String , - ULONG Base , - PULONG Value ) ; - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; -extern LONG RtlCompareUnicodeString(PUNICODE_STRING String1 , - PUNICODE_STRING String2 , - BOOLEAN CaseInSensitive ) ; - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; -extern NTSTATUS RtlAppendUnicodeStringToString(PUNICODE_STRING Destination , - PUNICODE_STRING Source ) ; - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; +extern void *memcpy(void *, void const *, size_t); +extern void *memset(void *, int, size_t); +extern void *memmove(void *, void const *, size_t); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +extern NTSTATUS RtlIntegerToUnicodeString(ULONG Value, ULONG Base, + PUNICODE_STRING String); +extern NTSTATUS RtlUnicodeStringToInteger(PUNICODE_STRING String, ULONG Base, + PULONG Value); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +extern LONG RtlCompareUnicodeString(PUNICODE_STRING String1, + PUNICODE_STRING String2, + BOOLEAN CaseInSensitive); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +extern NTSTATUS RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, + PUNICODE_STRING Source); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -extern UCHAR READ_PORT_UCHAR(PUCHAR Port ) ; -extern void WRITE_PORT_UCHAR(PUCHAR Port , UCHAR Value ) ; -extern LONG InterlockedIncrement(PLONG Addend ) ; -extern LONG InterlockedDecrement(PLONG Addend ) ; -extern LONG InterlockedExchange(PLONG Target , - LONG Value ) ; -#pragma warning(disable:4035) +extern UCHAR READ_PORT_UCHAR(PUCHAR Port); +extern void WRITE_PORT_UCHAR(PUCHAR Port, UCHAR Value); +extern LONG InterlockedIncrement(PLONG Addend); +extern LONG InterlockedDecrement(PLONG Addend); +extern LONG InterlockedExchange(PLONG Target, LONG Value); +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -extern void KeInitializeDpc(PRKDPC Dpc , void (*DeferredRoutine)(struct _KDPC *Dpc , - PVOID DeferredContext , - PVOID SystemArgument1 , - PVOID SystemArgument2 ) , - PVOID DeferredContext ) ; -extern BOOLEAN KeInsertQueueDpc(PRKDPC Dpc , PVOID SystemArgument1 , - PVOID SystemArgument2 ) ; -extern BOOLEAN KeSynchronizeExecution(PKINTERRUPT Interrupt , - BOOLEAN (*SynchronizeRoutine)(PVOID SynchronizeContext ) , - PVOID SynchronizeContext ) ; - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; -extern ULONG KeQueryTimeIncrement(void) ; - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; - void ExFreePool(PVOID P ) ; - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; - void MmUnlockPages(PMDL MemoryDescriptorList ) ; - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; - void MmFreeContiguousMemory(PVOID BaseAddress ) ; - void MmResetDriverPaging(PVOID AddressWithinSection ) ; - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) -extern void IoAcquireCancelSpinLock(PKIRQL Irql ) ; -extern PVOID IoAllocateErrorLogEntry(PVOID IoObject , - UCHAR EntrySize ) ; - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; -extern NTSTATUS IoConnectInterrupt(PKINTERRUPT *InterruptObject , - BOOLEAN (*ServiceRoutine)(struct _KINTERRUPT *Interrupt , - PVOID ServiceContext ) , - PVOID ServiceContext , - PKSPIN_LOCK SpinLock , - ULONG Vector , - KIRQL Irql , KIRQL SynchronizeIrql , - KINTERRUPT_MODE InterruptMode , - BOOLEAN ShareVector , - KAFFINITY ProcessorEnableMask , - BOOLEAN FloatingSave ) ; - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; -extern void IoDisconnectInterrupt(PKINTERRUPT InterruptObject ) ; - void IoFreeIrp(PIRP Irp ) ; - void IoFreeMdl(PMDL Mdl ) ; - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; - void IoReleaseCancelSpinLock(KIRQL Irql ) ; -extern NTSTATUS IoReportResourceUsage(PUNICODE_STRING DriverClassName , - PDRIVER_OBJECT DriverObject , - PCM_RESOURCE_LIST DriverList , - ULONG DriverListSize , - PDEVICE_OBJECT DeviceObject , - PCM_RESOURCE_LIST DeviceList , - ULONG DeviceListSize , - BOOLEAN OverrideConflict , - PBOOLEAN ConflictDetected ) ; - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; -extern void IoInitializeRemoveLockEx(PIO_REMOVE_LOCK Lock , - ULONG AllocateTag , - ULONG MaxLockedMinutes , - ULONG HighWatermark , - ULONG RemlockSize ) ; - NTSTATUS IoAcquireRemoveLockEx(PIO_REMOVE_LOCK RemoveLock , - PVOID Tag , - PCSTR File , - ULONG Line , - ULONG RemlockSize ) ; -extern void IoReleaseRemoveLockEx(PIO_REMOVE_LOCK RemoveLock , - PVOID Tag , - ULONG RemlockSize ) ; -extern void IoReleaseRemoveLockAndWaitEx(PIO_REMOVE_LOCK RemoveLock , - PVOID Tag , - ULONG RemlockSize ) ; -extern void IoWriteErrorLogEntry(PVOID ElEntry ) ; -extern NTSTATUS IoWMIRegistrationControl(PDEVICE_OBJECT DeviceObject , - ULONG Action ) ; -extern NTSTATUS IoOpenDeviceRegistryKey(PDEVICE_OBJECT DeviceObject , - ULONG DevInstKeyType , - ACCESS_MASK DesiredAccess , - PHANDLE DevInstRegKey ) ; - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -extern void KeStallExecutionProcessor(ULONG MicroSeconds ) ; -#pragma warning(disable:4200) -#pragma warning(default:4200) -extern NTSTATUS PoRequestPowerIrp(PDEVICE_OBJECT DeviceObject , - UCHAR MinorFunction , - POWER_STATE PowerState , - void (*CompletionFunction)(PDEVICE_OBJECT DeviceObject , - UCHAR MinorFunction , - POWER_STATE PowerState , - PVOID Context , - PIO_STATUS_BLOCK IoStatus ) , - PVOID Context , - PIRP *Irp ) ; -extern POWER_STATE PoSetPowerState(PDEVICE_OBJECT DeviceObject , - POWER_STATE_TYPE Type , - POWER_STATE State ) ; - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void PoStartNextPowerIrp(PIRP Irp ) ; - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; -extern void ObfReferenceObject(PVOID Object ) ; - void ObfDereferenceObject(PVOID Object ) ; - NTSTATUS ZwClose(HANDLE Handle ) ; -extern NTSTATUS ZwQueryValueKey(HANDLE KeyHandle , - PUNICODE_STRING ValueName , - KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass , - PVOID KeyValueInformation , - ULONG Length , - PULONG ResultLength ) ; -extern NTSTATUS ZwSetValueKey(HANDLE KeyHandle , - PUNICODE_STRING ValueName , - ULONG TitleIndex , - ULONG Type , - PVOID Data , - ULONG DataSize ) ; - struct _GUID const GUID_PARALLEL_DEVICE ; - struct _GUID const GUID_PARCLASS_DEVICE ; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +extern void KeInitializeDpc(PRKDPC Dpc, + void (*DeferredRoutine)(struct _KDPC *Dpc, + PVOID DeferredContext, + PVOID SystemArgument1, + PVOID SystemArgument2), + PVOID DeferredContext); +extern BOOLEAN KeInsertQueueDpc(PRKDPC Dpc, PVOID SystemArgument1, + PVOID SystemArgument2); +extern BOOLEAN +KeSynchronizeExecution(PKINTERRUPT Interrupt, + BOOLEAN (*SynchronizeRoutine)(PVOID SynchronizeContext), + PVOID SynchronizeContext); +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +extern ULONG KeQueryTimeIncrement(void); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +void ExFreePool(PVOID P); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +void MmUnlockPages(PMDL MemoryDescriptorList); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmResetDriverPaging(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +extern void IoAcquireCancelSpinLock(PKIRQL Irql); +extern PVOID IoAllocateErrorLogEntry(PVOID IoObject, UCHAR EntrySize); +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +extern NTSTATUS +IoConnectInterrupt(PKINTERRUPT *InterruptObject, + BOOLEAN (*ServiceRoutine)(struct _KINTERRUPT *Interrupt, + PVOID ServiceContext), + PVOID ServiceContext, PKSPIN_LOCK SpinLock, ULONG Vector, + KIRQL Irql, KIRQL SynchronizeIrql, + KINTERRUPT_MODE InterruptMode, BOOLEAN ShareVector, + KAFFINITY ProcessorEnableMask, BOOLEAN FloatingSave); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +extern void IoDisconnectInterrupt(PKINTERRUPT InterruptObject); +void IoFreeIrp(PIRP Irp); +void IoFreeMdl(PMDL Mdl); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +void IoReleaseCancelSpinLock(KIRQL Irql); +extern NTSTATUS +IoReportResourceUsage(PUNICODE_STRING DriverClassName, + PDRIVER_OBJECT DriverObject, PCM_RESOURCE_LIST DriverList, + ULONG DriverListSize, PDEVICE_OBJECT DeviceObject, + PCM_RESOURCE_LIST DeviceList, ULONG DeviceListSize, + BOOLEAN OverrideConflict, PBOOLEAN ConflictDetected); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +extern void IoInitializeRemoveLockEx(PIO_REMOVE_LOCK Lock, ULONG AllocateTag, + ULONG MaxLockedMinutes, + ULONG HighWatermark, ULONG RemlockSize); +NTSTATUS IoAcquireRemoveLockEx(PIO_REMOVE_LOCK RemoveLock, PVOID Tag, + PCSTR File, ULONG Line, ULONG RemlockSize); +extern void IoReleaseRemoveLockEx(PIO_REMOVE_LOCK RemoveLock, PVOID Tag, + ULONG RemlockSize); +extern void IoReleaseRemoveLockAndWaitEx(PIO_REMOVE_LOCK RemoveLock, PVOID Tag, + ULONG RemlockSize); +extern void IoWriteErrorLogEntry(PVOID ElEntry); +extern NTSTATUS IoWMIRegistrationControl(PDEVICE_OBJECT DeviceObject, + ULONG Action); +extern NTSTATUS IoOpenDeviceRegistryKey(PDEVICE_OBJECT DeviceObject, + ULONG DevInstKeyType, + ACCESS_MASK DesiredAccess, + PHANDLE DevInstRegKey); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +extern void KeStallExecutionProcessor(ULONG MicroSeconds); +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +extern NTSTATUS PoRequestPowerIrp( + PDEVICE_OBJECT DeviceObject, UCHAR MinorFunction, POWER_STATE PowerState, + void (*CompletionFunction)(PDEVICE_OBJECT DeviceObject, UCHAR MinorFunction, + POWER_STATE PowerState, PVOID Context, + PIO_STATUS_BLOCK IoStatus), + PVOID Context, PIRP *Irp); +extern POWER_STATE PoSetPowerState(PDEVICE_OBJECT DeviceObject, + POWER_STATE_TYPE Type, POWER_STATE State); +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +extern void ObfReferenceObject(PVOID Object); +void ObfDereferenceObject(PVOID Object); +NTSTATUS ZwClose(HANDLE Handle); +extern NTSTATUS +ZwQueryValueKey(HANDLE KeyHandle, PUNICODE_STRING ValueName, + KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, + PVOID KeyValueInformation, ULONG Length, PULONG ResultLength); +extern NTSTATUS ZwSetValueKey(HANDLE KeyHandle, PUNICODE_STRING ValueName, + ULONG TitleIndex, ULONG Type, PVOID Data, + ULONG DataSize); +struct _GUID const GUID_PARALLEL_DEVICE; +struct _GUID const GUID_PARCLASS_DEVICE; #pragma once -extern NTSTATUS WmiCompleteRequest(PDEVICE_OBJECT DeviceObject , PIRP Irp , NTSTATUS Status , - ULONG BufferUsed , CCHAR PriorityBoost ) ; -NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo , PDEVICE_OBJECT DeviceObject , - PIRP Irp , PSYSCTL_IRP_DISPOSITION IrpDisposition ) ; -void PptCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) ; -ULONG PptDebugLevel ; -ULONG PptBreakOn ; -UNICODE_STRING RegistryPath ; -UCHAR PptDot3Retries ; -union _LARGE_INTEGER const PhysicalZero ; -LONG PortInfoReferenceCount ; -PFAST_MUTEX PortInfoMutex ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -int myStatus ; -int routine ; -void errorFn(void) -{ - - { - ERROR: assert(0); - goto ERROR; -} -} -NTSTATUS PptWmiInitWmi(PDEVICE_OBJECT DeviceObject ) ; -NTSTATUS PptDispatchSystemControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void PptPnpInitDispatchFunctionTable(void) ; -NTSTATUS PptPnpAddDevice(PDRIVER_OBJECT pDriverObject , PDEVICE_OBJECT pPhysicalDeviceObject ) ; -NTSTATUS PptDispatchPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptFailRequest(PIRP Irp , NTSTATUS Status ) ; -NTSTATUS PptDispatchPreProcessIrp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptDispatchPostProcessIrp(void) ; -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING pRegistryPath ) ; -void PptUnload(PDRIVER_OBJECT DriverObject ) ; -NTSTATUS PptSynchCompletionRoutine(PDEVICE_OBJECT DeviceObject , PIRP Irp , PKEVENT Event ) ; -void PptLogError(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT DeviceObject , PHYSICAL_ADDRESS P1 , - PHYSICAL_ADDRESS P2 , ULONG SequenceNumber , UCHAR MajorFunctionCode , - UCHAR RetryCount , ULONG UniqueErrorValue , NTSTATUS FinalStatus , - NTSTATUS SpecificIOStatus ) ; -NTSTATUS PptConnectInterrupt(PDEVICE_EXTENSION Extension ) ; -void PptDisconnectInterrupt(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptDispatchCreate(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptDispatchClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -BOOLEAN PptSynchronizedIncrement(PVOID SyncContext ) ; -BOOLEAN PptSynchronizedDecrement(PVOID SyncContext ) ; -BOOLEAN PptSynchronizedRead(PVOID SyncContext ) ; -BOOLEAN PptSynchronizedQueue(PVOID Context ) ; -BOOLEAN PptSynchronizedDisconnect(PVOID Context ) ; -void PptCancelRoutine(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void PptFreePortDpc(PKDPC Dpc , PVOID Extension , PVOID SystemArgument1 , PVOID SystemArgument2 ) ; -BOOLEAN PptTryAllocatePortAtInterruptLevel(PVOID Context ) ; -void PptFreePortFromInterruptLevel(PVOID Context ) ; -BOOLEAN PptInterruptService(PKINTERRUPT Interrupt , PVOID Extension ) ; -BOOLEAN PptTryAllocatePort(PVOID Extension ) ; -BOOLEAN PptTraversePortCheckList(PVOID Extension ) ; -void PptFreePort(PVOID Extension ) ; -ULONG PptQueryNumWaiters(PVOID Extension ) ; -NTSTATUS PptDispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptDispatchCleanup(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -BOOLEAN PptIsNecR98Machine(void) ; -NTSTATUS PptDispatchPower(PDEVICE_OBJECT pDeviceObject , PIRP pIrp ) ; -void PptRegInitDriverSettings(PUNICODE_STRING RegistryPath___0 ) ; -PWSTR PptGetPortNameFromPhysicalDeviceObject(PDEVICE_OBJECT PhysicalDeviceObject ) ; -PVOID PptSetCancelRoutine(PIRP Irp , void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , - struct _IRP *Irp ) ) ; -NTSTATUS PptAcquireRemoveLockOrFailIrp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void PptDebugDumpPnpIrpInfo(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptAcquireRemoveLock(PIO_REMOVE_LOCK RemoveLock , PVOID Tag ) ; -void PptReleaseRemoveLock(PIO_REMOVE_LOCK RemoveLock , PVOID Tag ) ; -void PptReleaseRemoveLockAndWait(PIO_REMOVE_LOCK RemoveLock , PVOID Tag ) ; -void PptDebugDumpResourceList(PIO_RESOURCE_LIST ResourceList ) ; -void PptDebugDumpResourceRequirementsList(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) ; -NTSTATUS PptDetectChipFilter(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptDetectPortType(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptSetChipMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) ; -NTSTATUS PptClearChipMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) ; -ULONG PptInitiate1284_3(PVOID Extension ) ; -NTSTATUS PptTrySelectDevice(PVOID Context , PVOID TrySelectCommand ) ; -NTSTATUS PptDeselectDevice(PVOID Context , PVOID DeselectCommand ) ; -ULONG Ppt1284_3AssignAddress(PDEVICE_EXTENSION DeviceExtension ) ; -BOOLEAN PptSend1284_3Command(PDEVICE_EXTENSION DeviceExtension , UCHAR Command ) ; -NTSTATUS PptTrySelectLegacyZip(PVOID Context , PVOID TrySelectCommand ) ; -NTSTATUS PptDeselectLegacyZip(PVOID Context , PVOID DeselectCommand ) ; -void PptDumpRemovalRelationsList(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptRegGetDeviceParameterDword(PDEVICE_OBJECT Pdo , PWSTR ParameterName , - PULONG ParameterValue ) ; -NTSTATUS PptRegSetDeviceParameterDword(PDEVICE_OBJECT Pdo , PWSTR ParameterName , - PULONG ParameterValue ) ; -NTSTATUS PptBuildParallelPortDeviceName(ULONG Number , PUNICODE_STRING DeviceName ) ; -NTSTATUS PptInitializeDeviceExtension(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject , - PDEVICE_OBJECT DeviceObject , PUNICODE_STRING UniNameString , - PWSTR PortName , ULONG PortNumber ) ; -NTSTATUS PptGetPortNumberFromLptName(PWSTR PortName , PULONG PortNumber ) ; -PDEVICE_OBJECT PptBuildDeviceObject(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) ; -void PptDetectEppPort(PDEVICE_EXTENSION Extension ) ; -void PptCleanRemovalRelationsList(PDEVICE_EXTENSION Extension ) ; -BOOLEAN CheckPort(PUCHAR wPortAddr , UCHAR bMask , UCHAR bValue , USHORT usTimeDelay ) ; -NTSTATUS PptDispatchCleanup(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - KIRQL cancelIrql ; - - { - extension = DeviceObject->DeviceExtension; - { - } - if (extension->DeviceStateFlags & 4096UL) { - goto targetExit; - } else { - - } - { - IoAcquireCancelSpinLock(& cancelIrql); -/* IoReleaseCancelSpinLock(cancelIrql); */ /* INLINED */ - } - targetExit: - { - myStatus = 0L; - Irp->IoStatus.__annonCompField4.Status = 0L; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); - } - return (0L); -} +extern NTSTATUS WmiCompleteRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp, + NTSTATUS Status, ULONG BufferUsed, + CCHAR PriorityBoost); +NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo, + PDEVICE_OBJECT DeviceObject, PIRP Irp, + PSYSCTL_IRP_DISPOSITION IrpDisposition); +void PptCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +ULONG PptDebugLevel; +ULONG PptBreakOn; +UNICODE_STRING RegistryPath; +UCHAR PptDot3Retries; +union _LARGE_INTEGER const PhysicalZero; +LONG PortInfoReferenceCount; +PFAST_MUTEX PortInfoMutex; +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +int myStatus; +int routine; +void errorFn(void) { + + { + ERROR: + assert(0); + goto ERROR; + } +} +NTSTATUS PptWmiInitWmi(PDEVICE_OBJECT DeviceObject); +NTSTATUS PptDispatchSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PptPnpInitDispatchFunctionTable(void); +NTSTATUS PptPnpAddDevice(PDRIVER_OBJECT pDriverObject, + PDEVICE_OBJECT pPhysicalDeviceObject); +NTSTATUS PptDispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptFailRequest(PIRP Irp, NTSTATUS Status); +NTSTATUS PptDispatchPreProcessIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptDispatchPostProcessIrp(void); +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, + PUNICODE_STRING pRegistryPath); +void PptUnload(PDRIVER_OBJECT DriverObject); +NTSTATUS PptSynchCompletionRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PKEVENT Event); +void PptLogError(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT DeviceObject, + PHYSICAL_ADDRESS P1, PHYSICAL_ADDRESS P2, ULONG SequenceNumber, + UCHAR MajorFunctionCode, UCHAR RetryCount, + ULONG UniqueErrorValue, NTSTATUS FinalStatus, + NTSTATUS SpecificIOStatus); +NTSTATUS PptConnectInterrupt(PDEVICE_EXTENSION Extension); +void PptDisconnectInterrupt(PDEVICE_EXTENSION Extension); +NTSTATUS PptDispatchCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptDispatchClose(PDEVICE_OBJECT DeviceObject, PIRP Irp); +BOOLEAN PptSynchronizedIncrement(PVOID SyncContext); +BOOLEAN PptSynchronizedDecrement(PVOID SyncContext); +BOOLEAN PptSynchronizedRead(PVOID SyncContext); +BOOLEAN PptSynchronizedQueue(PVOID Context); +BOOLEAN PptSynchronizedDisconnect(PVOID Context); +void PptCancelRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PptFreePortDpc(PKDPC Dpc, PVOID Extension, PVOID SystemArgument1, + PVOID SystemArgument2); +BOOLEAN PptTryAllocatePortAtInterruptLevel(PVOID Context); +void PptFreePortFromInterruptLevel(PVOID Context); +BOOLEAN PptInterruptService(PKINTERRUPT Interrupt, PVOID Extension); +BOOLEAN PptTryAllocatePort(PVOID Extension); +BOOLEAN PptTraversePortCheckList(PVOID Extension); +void PptFreePort(PVOID Extension); +ULONG PptQueryNumWaiters(PVOID Extension); +NTSTATUS PptDispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject, + PIRP Irp); +NTSTATUS PptDispatchCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp); +BOOLEAN PptIsNecR98Machine(void); +NTSTATUS PptDispatchPower(PDEVICE_OBJECT pDeviceObject, PIRP pIrp); +void PptRegInitDriverSettings(PUNICODE_STRING RegistryPath___0); +PWSTR PptGetPortNameFromPhysicalDeviceObject( + PDEVICE_OBJECT PhysicalDeviceObject); +PVOID PptSetCancelRoutine( + PIRP Irp, void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp)); +NTSTATUS PptAcquireRemoveLockOrFailIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PptDebugDumpPnpIrpInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptAcquireRemoveLock(PIO_REMOVE_LOCK RemoveLock, PVOID Tag); +void PptReleaseRemoveLock(PIO_REMOVE_LOCK RemoveLock, PVOID Tag); +void PptReleaseRemoveLockAndWait(PIO_REMOVE_LOCK RemoveLock, PVOID Tag); +void PptDebugDumpResourceList(PIO_RESOURCE_LIST ResourceList); +void PptDebugDumpResourceRequirementsList( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList); +NTSTATUS PptDetectChipFilter(PDEVICE_EXTENSION Extension); +NTSTATUS PptDetectPortType(PDEVICE_EXTENSION Extension); +NTSTATUS PptSetChipMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode); +NTSTATUS PptClearChipMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode); +ULONG PptInitiate1284_3(PVOID Extension); +NTSTATUS PptTrySelectDevice(PVOID Context, PVOID TrySelectCommand); +NTSTATUS PptDeselectDevice(PVOID Context, PVOID DeselectCommand); +ULONG Ppt1284_3AssignAddress(PDEVICE_EXTENSION DeviceExtension); +BOOLEAN PptSend1284_3Command(PDEVICE_EXTENSION DeviceExtension, UCHAR Command); +NTSTATUS PptTrySelectLegacyZip(PVOID Context, PVOID TrySelectCommand); +NTSTATUS PptDeselectLegacyZip(PVOID Context, PVOID DeselectCommand); +void PptDumpRemovalRelationsList(PDEVICE_EXTENSION Extension); +NTSTATUS PptRegGetDeviceParameterDword(PDEVICE_OBJECT Pdo, PWSTR ParameterName, + PULONG ParameterValue); +NTSTATUS PptRegSetDeviceParameterDword(PDEVICE_OBJECT Pdo, PWSTR ParameterName, + PULONG ParameterValue); +NTSTATUS PptBuildParallelPortDeviceName(ULONG Number, + PUNICODE_STRING DeviceName); +NTSTATUS PptInitializeDeviceExtension(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject, + PDEVICE_OBJECT DeviceObject, + PUNICODE_STRING UniNameString, + PWSTR PortName, ULONG PortNumber); +NTSTATUS PptGetPortNumberFromLptName(PWSTR PortName, PULONG PortNumber); +PDEVICE_OBJECT PptBuildDeviceObject(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject); +void PptDetectEppPort(PDEVICE_EXTENSION Extension); +void PptCleanRemovalRelationsList(PDEVICE_EXTENSION Extension); +BOOLEAN CheckPort(PUCHAR wPortAddr, UCHAR bMask, UCHAR bValue, + USHORT usTimeDelay); +NTSTATUS PptDispatchCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + KIRQL cancelIrql; + + { + extension = DeviceObject->DeviceExtension; + {} + if (extension->DeviceStateFlags & 4096UL) { + goto targetExit; + } else { + } + { + IoAcquireCancelSpinLock(&cancelIrql); + /* IoReleaseCancelSpinLock(cancelIrql); */ /* INLINED */ + } + targetExit : { + myStatus = 0L; + Irp->IoStatus.__annonCompField4.Status = 0L; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); + } + return (0L); + } } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -PCHAR PnpIrpName[25] = - { "IRP_MN_START_DEVICE 0x00", "IRP_MN_QUERY_REMOVE_DEVICE 0x01", "IRP_MN_REMOVE_DEVICE 0x02", "IRP_MN_CANCEL_REMOVE_DEVICE 0x03", - "IRP_MN_STOP_DEVICE 0x04", "IRP_MN_QUERY_STOP_DEVICE 0x05", "IRP_MN_CANCEL_STOP_DEVICE 0x06", "IRP_MN_QUERY_DEVICE_RELATIONS 0x07", - "IRP_MN_QUERY_INTERFACE 0x08", "IRP_MN_QUERY_CAPABILITIES 0x09", "IRP_MN_QUERY_RESOURCES 0x0A", "IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B", - "IRP_MN_QUERY_DEVICE_TEXT 0x0C", "IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D", " unused MinorFunction 0x0E", "IRP_MN_READ_CONFIG 0x0F", - "IRP_MN_WRITE_CONFIG 0x10", "IRP_MN_EJECT 0x11", "IRP_MN_SET_LOCK 0x12", "IRP_MN_QUERY_ID 0x13", - "IRP_MN_QUERY_PNP_DEVICE_STATE 0x14", "IRP_MN_QUERY_BUS_INFORMATION 0x15", "IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16", "IRP_MN_SURPRISE_REMOVAL 0x17", - "IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18"}; -void PptDebugDumpPnpIrpInfo(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - PIO_STACK_LOCATION irpStack ; - PCHAR irpName ; - - { - extension = DeviceObject->DeviceExtension; - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - if ((int )irpStack->MinorFunction <= 24) { - irpName = PnpIrpName[irpStack->MinorFunction]; - } else { - { - } - irpName = " - MinorFunction > 0x18 - don\'t handle "; - } - { +PCHAR PnpIrpName[25] = {"IRP_MN_START_DEVICE 0x00", + "IRP_MN_QUERY_REMOVE_DEVICE 0x01", + "IRP_MN_REMOVE_DEVICE 0x02", + "IRP_MN_CANCEL_REMOVE_DEVICE 0x03", + "IRP_MN_STOP_DEVICE 0x04", + "IRP_MN_QUERY_STOP_DEVICE 0x05", + "IRP_MN_CANCEL_STOP_DEVICE 0x06", + "IRP_MN_QUERY_DEVICE_RELATIONS 0x07", + "IRP_MN_QUERY_INTERFACE 0x08", + "IRP_MN_QUERY_CAPABILITIES 0x09", + "IRP_MN_QUERY_RESOURCES 0x0A", + "IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B", + "IRP_MN_QUERY_DEVICE_TEXT 0x0C", + "IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D", + " unused MinorFunction 0x0E", + "IRP_MN_READ_CONFIG 0x0F", + "IRP_MN_WRITE_CONFIG 0x10", + "IRP_MN_EJECT 0x11", + "IRP_MN_SET_LOCK 0x12", + "IRP_MN_QUERY_ID 0x13", + "IRP_MN_QUERY_PNP_DEVICE_STATE 0x14", + "IRP_MN_QUERY_BUS_INFORMATION 0x15", + "IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16", + "IRP_MN_SURPRISE_REMOVAL 0x17", + "IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18"}; +void PptDebugDumpPnpIrpInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + PIO_STACK_LOCATION irpStack; + PCHAR irpName; + + { + extension = DeviceObject->DeviceExtension; + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + if ((int)irpStack->MinorFunction <= 24) { + irpName = PnpIrpName[irpStack->MinorFunction]; + } else { + {} + irpName = " - MinorFunction > 0x18 - don\'t handle "; + } + {} + return; } - return; -} } -NTSTATUS PptAcquireRemoveLock(PIO_REMOVE_LOCK RemoveLock , PVOID Tag ) -{ NTSTATUS status ; +NTSTATUS PptAcquireRemoveLock(PIO_REMOVE_LOCK RemoveLock, PVOID Tag) { + NTSTATUS status; { - { - status = IoAcquireRemoveLockEx(RemoveLock, Tag, "debug.c", 69, sizeof(IO_REMOVE_LOCK )); + { + status = IoAcquireRemoveLockEx(RemoveLock, Tag, "debug.c", 69, + sizeof(IO_REMOVE_LOCK)); + } + return (status); } - return (status); } -} -void PptReleaseRemoveLock(PIO_REMOVE_LOCK RemoveLock , PVOID Tag ) -{ +void PptReleaseRemoveLock(PIO_REMOVE_LOCK RemoveLock, PVOID Tag) { { - { - IoReleaseRemoveLockEx(RemoveLock, Tag, sizeof(IO_REMOVE_LOCK )); + { IoReleaseRemoveLockEx(RemoveLock, Tag, sizeof(IO_REMOVE_LOCK)); } + return; } - return; -} } -void PptReleaseRemoveLockAndWait(PIO_REMOVE_LOCK RemoveLock , PVOID Tag ) -{ +void PptReleaseRemoveLockAndWait(PIO_REMOVE_LOCK RemoveLock, PVOID Tag) { { - { - IoReleaseRemoveLockAndWaitEx(RemoveLock, Tag, sizeof(IO_REMOVE_LOCK )); + { IoReleaseRemoveLockAndWaitEx(RemoveLock, Tag, sizeof(IO_REMOVE_LOCK)); } + return; } - return; } -} -void PptDebugDumpResourceList(PIO_RESOURCE_LIST ResourceList ) -{ ULONG count ; - ULONG i ; - PIO_RESOURCE_DESCRIPTOR curDesc ; +void PptDebugDumpResourceList(PIO_RESOURCE_LIST ResourceList) { + ULONG count; + ULONG i; + PIO_RESOURCE_DESCRIPTOR curDesc; { - count = ResourceList->Count; - { - } - i = 0; - curDesc = ResourceList->Descriptors; - { - while (1) { - while_4_continue: /* CIL Label */ ; - if (i < count) { + count = ResourceList->Count; + {} + i = 0; + curDesc = ResourceList->Descriptors; + { + while (1) { + while_4_continue: /* CIL Label */; + if (i < count) { - } else { - goto while_4_break; - } - if (curDesc->Type == 2) { - goto switch_5_2; - } else { - if (curDesc->Type == 4) { - goto switch_5_4; - } else { - if (curDesc->Type == 1) { - goto switch_5_1; } else { - if (curDesc->Type == 0) { - goto switch_5_0; + goto while_4_break; + } + if (curDesc->Type == 2) { + goto switch_5_2; + } else { + if (curDesc->Type == 4) { + goto switch_5_4; } else { - { - goto switch_5_default; - if (0) { - switch_5_2: /* CIL Label */ ; - { - } - goto switch_5_break; - switch_5_4: /* CIL Label */ ; - { - } - goto switch_5_break; - switch_5_1: /* CIL Label */ ; - { - } - goto switch_5_break; - switch_5_0: /* CIL Label */ ; - { - } - goto switch_5_break; - switch_5_default: /* CIL Label */ ; - { - } + if (curDesc->Type == 1) { + goto switch_5_1; } else { - switch_5_break: /* CIL Label */ ; - } + if (curDesc->Type == 0) { + goto switch_5_0; + } else { + { + goto switch_5_default; + if (0) { + switch_5_2: /* CIL Label */; + {} + goto switch_5_break; + switch_5_4: /* CIL Label */; + {} + goto switch_5_break; + switch_5_1: /* CIL Label */; + {} + goto switch_5_break; + switch_5_0: /* CIL Label */; + {} + goto switch_5_break; + switch_5_default: /* CIL Label */; + {} + } else { + switch_5_break: /* CIL Label */; + } + } + } } } } + i += 1UL; + curDesc += 1; } + while_4_break: /* CIL Label */; } - i += 1UL; - curDesc += 1; - } - while_4_break: /* CIL Label */ ; + return; } - return; -} } -void PptDebugDumpResourceRequirementsList(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) -{ ULONG listCount ; - PIO_RESOURCE_LIST curList ; - ULONG i ; +void PptDebugDumpResourceRequirementsList( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList) { + ULONG listCount; + PIO_RESOURCE_LIST curList; + ULONG i; { - listCount = ResourceRequirementsList->AlternativeLists; - { - } - i = 0; - curList = ResourceRequirementsList->List; - { - while (1) { - while_12_continue: /* CIL Label */ ; - if (i < listCount) { - - } else { - goto while_12_break; - } - { - } + listCount = ResourceRequirementsList->AlternativeLists; + {} + i = 0; + curList = ResourceRequirementsList->List; { - PptDebugDumpResourceList(curList); - curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); - i += 1UL; + while (1) { + while_12_continue: /* CIL Label */; + if (i < listCount) { + + } else { + goto while_12_break; + } + {} { + PptDebugDumpResourceList(curList); + curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + + curList->Count); + i += 1UL; + } + } + while_12_break: /* CIL Label */; } + return; } - while_12_break: /* CIL Label */ ; - } - return; -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -void PptLogError(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT DeviceObject , PHYSICAL_ADDRESS P1 , - PHYSICAL_ADDRESS P2 , ULONG SequenceNumber , UCHAR MajorFunctionCode , - UCHAR RetryCount , ULONG UniqueErrorValue , NTSTATUS FinalStatus , - NTSTATUS SpecificIOStatus ) -{ PIO_ERROR_LOG_PACKET ErrorLogEntry ; - PVOID ObjectToUse ; - SHORT DumpToAllocate ; - PVOID tmp ; - - { - { - } - if ((unsigned int )((CHAR *)DeviceObject) != (unsigned int )((CHAR *)((void *)0))) { - ObjectToUse = DeviceObject; - } else { - ObjectToUse = DriverObject; - } - DumpToAllocate = 0; - if (P1.__annonCompField1.LowPart != 0UL) { - DumpToAllocate = (short )sizeof(PHYSICAL_ADDRESS ); - } else { - if (P1.__annonCompField1.HighPart != 0L) { - DumpToAllocate = (short )sizeof(PHYSICAL_ADDRESS ); - } else { - +void PptLogError(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT DeviceObject, + PHYSICAL_ADDRESS P1, PHYSICAL_ADDRESS P2, ULONG SequenceNumber, + UCHAR MajorFunctionCode, UCHAR RetryCount, + ULONG UniqueErrorValue, NTSTATUS FinalStatus, + NTSTATUS SpecificIOStatus) { + PIO_ERROR_LOG_PACKET ErrorLogEntry; + PVOID ObjectToUse; + SHORT DumpToAllocate; + PVOID tmp; + + { + {} + if ((unsigned int)((CHAR *)DeviceObject) != + (unsigned int)((CHAR *)((void *)0))) { + ObjectToUse = DeviceObject; + } else { + ObjectToUse = DriverObject; + } + DumpToAllocate = 0; + if (P1.__annonCompField1.LowPart != 0UL) { + DumpToAllocate = (short)sizeof(PHYSICAL_ADDRESS); + } else { + if (P1.__annonCompField1.HighPart != 0L) { + DumpToAllocate = (short)sizeof(PHYSICAL_ADDRESS); + } else { + } } - } - if (P2.__annonCompField1.LowPart != 0UL) { - DumpToAllocate = (int )DumpToAllocate + (int )((short )sizeof(PHYSICAL_ADDRESS )); - } else { - if (P2.__annonCompField1.HighPart != 0L) { - DumpToAllocate = (int )DumpToAllocate + (int )((short )sizeof(PHYSICAL_ADDRESS )); + if (P2.__annonCompField1.LowPart != 0UL) { + DumpToAllocate = + (int)DumpToAllocate + (int)((short)sizeof(PHYSICAL_ADDRESS)); } else { - + if (P2.__annonCompField1.HighPart != 0L) { + DumpToAllocate = + (int)DumpToAllocate + (int)((short)sizeof(PHYSICAL_ADDRESS)); + } else { + } } - } - { - tmp = IoAllocateErrorLogEntry(ObjectToUse, (unsigned char )(sizeof(IO_ERROR_LOG_PACKET ) + (unsigned int )DumpToAllocate)); - ErrorLogEntry = tmp; - } - if (! ErrorLogEntry) { - return; - } else { - - } - ErrorLogEntry->ErrorCode = SpecificIOStatus; - ErrorLogEntry->SequenceNumber = SequenceNumber; - ErrorLogEntry->MajorFunctionCode = MajorFunctionCode; - ErrorLogEntry->RetryCount = RetryCount; - ErrorLogEntry->UniqueErrorValue = UniqueErrorValue; - ErrorLogEntry->FinalStatus = FinalStatus; - ErrorLogEntry->DumpDataSize = DumpToAllocate; - if (DumpToAllocate) { { - memcpy(ErrorLogEntry->DumpData, & P1, sizeof(PHYSICAL_ADDRESS )); + tmp = IoAllocateErrorLogEntry( + ObjectToUse, (unsigned char)(sizeof(IO_ERROR_LOG_PACKET) + + (unsigned int)DumpToAllocate)); + ErrorLogEntry = tmp; } - if ((unsigned int )DumpToAllocate > sizeof(PHYSICAL_ADDRESS )) { - { - memcpy((UCHAR *)(ErrorLogEntry->DumpData) + sizeof(PHYSICAL_ADDRESS ), & P2, - sizeof(PHYSICAL_ADDRESS )); + if (!ErrorLogEntry) { + return; + } else { + } + ErrorLogEntry->ErrorCode = SpecificIOStatus; + ErrorLogEntry->SequenceNumber = SequenceNumber; + ErrorLogEntry->MajorFunctionCode = MajorFunctionCode; + ErrorLogEntry->RetryCount = RetryCount; + ErrorLogEntry->UniqueErrorValue = UniqueErrorValue; + ErrorLogEntry->FinalStatus = FinalStatus; + ErrorLogEntry->DumpDataSize = DumpToAllocate; + if (DumpToAllocate) { + { memcpy(ErrorLogEntry->DumpData, &P1, sizeof(PHYSICAL_ADDRESS)); } + if ((unsigned int)DumpToAllocate > sizeof(PHYSICAL_ADDRESS)) { + { + memcpy((UCHAR *)(ErrorLogEntry->DumpData) + sizeof(PHYSICAL_ADDRESS), + &P2, sizeof(PHYSICAL_ADDRESS)); + } + } else { } } else { - } - } else { - - } - { - IoWriteErrorLogEntry(ErrorLogEntry); + { IoWriteErrorLogEntry(ErrorLogEntry); } + return; } - return; -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING pRegistryPath ) -{ void *Buffer ; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, + PUNICODE_STRING pRegistryPath) { + void *Buffer; { - { - PptRegInitDriverSettings(pRegistryPath); - Buffer = ExAllocatePoolWithTag(1, pRegistryPath->MaximumLength, 1349673296UL); - } - if ((unsigned int )((void *)0) == (unsigned int )Buffer) { { + PptRegInitDriverSettings(pRegistryPath); + Buffer = + ExAllocatePoolWithTag(1, pRegistryPath->MaximumLength, 1349673296UL); + } + if ((unsigned int)((void *)0) == (unsigned int)Buffer) { + {} + return (-1073741670L); + } else { + { + memset(RegistryPath.Buffer, 0, pRegistryPath->MaximumLength); + RegistryPath.Length = pRegistryPath->Length; + RegistryPath.MaximumLength = pRegistryPath->MaximumLength; + memmove(RegistryPath.Buffer, pRegistryPath->Buffer, + pRegistryPath->Length); + } } - return (-1073741670L); - } else { { - memset(RegistryPath.Buffer, 0, pRegistryPath->MaximumLength); - RegistryPath.Length = pRegistryPath->Length; - RegistryPath.MaximumLength = pRegistryPath->MaximumLength; - memmove(RegistryPath.Buffer, pRegistryPath->Buffer, pRegistryPath->Length); + PptPnpInitDispatchFunctionTable(); + DriverObject->MajorFunction[0] = &PptDispatchCreate; + DriverObject->MajorFunction[2] = &PptDispatchClose; + DriverObject->MajorFunction[15] = &PptDispatchInternalDeviceControl; + DriverObject->MajorFunction[18] = &PptDispatchCleanup; + DriverObject->MajorFunction[27] = &PptDispatchPnp; + DriverObject->MajorFunction[22] = &PptDispatchPower; + DriverObject->MajorFunction[23] = &PptDispatchSystemControl; + (DriverObject->DriverExtension)->AddDevice = &PptPnpAddDevice; + DriverObject->DriverUnload = &PptUnload; } + return (0L); } - { - PptPnpInitDispatchFunctionTable(); - DriverObject->MajorFunction[0] = & PptDispatchCreate; - DriverObject->MajorFunction[2] = & PptDispatchClose; - DriverObject->MajorFunction[15] = & PptDispatchInternalDeviceControl; - DriverObject->MajorFunction[18] = & PptDispatchCleanup; - DriverObject->MajorFunction[27] = & PptDispatchPnp; - DriverObject->MajorFunction[22] = & PptDispatchPower; - DriverObject->MajorFunction[23] = & PptDispatchSystemControl; - (DriverObject->DriverExtension)->AddDevice = & PptPnpAddDevice; - DriverObject->DriverUnload = & PptUnload; - } - return (0L); } -} -void PptUnload(PDRIVER_OBJECT DriverObject ) -{ PDEVICE_OBJECT CurrentDevice ; - PDEVICE_EXTENSION Extension ; - PLIST_ENTRY Head ; - PISR_LIST_ENTRY Entry ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; - PCONFIGURATION_INFORMATION tmp ; +void PptUnload(PDRIVER_OBJECT DriverObject) { + PDEVICE_OBJECT CurrentDevice; + PDEVICE_EXTENSION Extension; + PLIST_ENTRY Head; + PISR_LIST_ENTRY Entry; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; + PCONFIGURATION_INFORMATION tmp; { - { - } - CurrentDevice = DriverObject->DeviceObject; - { - while (1) { - while_17_continue: /* CIL Label */ ; - if (CurrentDevice) { - - } else { - goto while_17_break; - } - Extension = CurrentDevice->DeviceExtension; - if (Extension->InterruptRefCount) { - { - PptDisconnectInterrupt(Extension); - } - } else { - - } + {} + CurrentDevice = DriverObject->DeviceObject; { - while (1) { - while_18_continue: /* CIL Label */ ; - if (! ((unsigned int )Extension->IsrList.Flink == (unsigned int )(& Extension->IsrList))) { + while (1) { + while_17_continue: /* CIL Label */; + if (CurrentDevice) { - } else { - goto while_18_break; + } else { + goto while_17_break; + } + Extension = CurrentDevice->DeviceExtension; + if (Extension->InterruptRefCount) { + { PptDisconnectInterrupt(Extension); } + } else { + } + { + while (1) { + while_18_continue: /* CIL Label */; + if (!((unsigned int)Extension->IsrList.Flink == + (unsigned int)(&Extension->IsrList))) { + + } else { + goto while_18_break; + } + { + Head = Extension->IsrList.Flink; + _EX_Flink = (Extension->IsrList.Flink)->Flink; + _EX_Blink = (Extension->IsrList.Flink)->Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + Entry = (ISR_LIST_ENTRY *)((CHAR *)Head - + (unsigned long)(&((ISR_LIST_ENTRY *)0) + ->ListEntry)); + /* ExFreePool(Entry); */ /* INLINED */ + } + } + while_18_break: /* CIL Label */; + } + { + /* ExFreePool(Extension->DeviceName.Buffer); */ /* INLINED */ + /* IoDeleteDevice(CurrentDevice); */ /* INLINED */ + tmp = IoGetConfigurationInformation(); + tmp->ParallelCount -= 1UL; + CurrentDevice = DriverObject->DeviceObject; + } } + while_17_break: /* CIL Label */; + } + if (PortInfoMutex) { { - Head = Extension->IsrList.Flink; - _EX_Flink = (Extension->IsrList.Flink)->Flink; - _EX_Blink = (Extension->IsrList.Flink)->Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - Entry = (ISR_LIST_ENTRY *)((CHAR *)Head - (unsigned long )(& ((ISR_LIST_ENTRY *)0)->ListEntry)); -/* ExFreePool(Entry); */ /* INLINED */ + /* ExFreePool(PortInfoMutex); */ /* INLINED */ + PortInfoMutex = (void *)0; } + } else { } - while_18_break: /* CIL Label */ ; - } - { -/* ExFreePool(Extension->DeviceName.Buffer); */ /* INLINED */ -/* IoDeleteDevice(CurrentDevice); */ /* INLINED */ - tmp = IoGetConfigurationInformation(); - tmp->ParallelCount -= 1UL; - CurrentDevice = DriverObject->DeviceObject; - } - } - while_17_break: /* CIL Label */ ; - } - if (PortInfoMutex) { - { -/* ExFreePool(PortInfoMutex); */ /* INLINED */ - PortInfoMutex = (void *)0; + { /* RtlFreeUnicodeString(& RegistryPath); */ /* INLINED */ } - } else { - - } - { -/* RtlFreeUnicodeString(& RegistryPath); */ /* INLINED */ + return; } - return; -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -void PptCleanRemovalRelationsList(PDEVICE_EXTENSION Extension ) -{ PLIST_ENTRY listHead ; - PLIST_ENTRY thisListEntry ; - PREMOVAL_RELATIONS_LIST_ENTRY node ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; +void PptCleanRemovalRelationsList(PDEVICE_EXTENSION Extension) { + PLIST_ENTRY listHead; + PLIST_ENTRY thisListEntry; + PREMOVAL_RELATIONS_LIST_ENTRY node; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; { - { - listHead = & Extension->RemovalRelationsList; - thisListEntry = (void *)0; - node = (void *)0; -/* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - { - while (1) { - while_19_continue: /* CIL Label */ ; - if (! ((unsigned int )listHead->Flink == (unsigned int )listHead)) { - - } else { - goto while_19_break; - } - thisListEntry = listHead->Flink; - _EX_Flink = (listHead->Flink)->Flink; - _EX_Blink = (listHead->Flink)->Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - node = (REMOVAL_RELATIONS_LIST_ENTRY *)((CHAR *)thisListEntry - (unsigned long )(& ((REMOVAL_RELATIONS_LIST_ENTRY *)0)->ListEntry)); { + listHead = &Extension->RemovalRelationsList; + thisListEntry = (void *)0; + node = (void *)0; + /* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ } { -/* RtlFreeUnicodeString(& node->DeviceName); */ /* INLINED */ -/* ExFreePool(node); */ /* INLINED */ - } - } - while_19_break: /* CIL Label */ ; - } - { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - return; -} -} -NTSTATUS PptAddPptRemovalRelation(PDEVICE_EXTENSION Extension , PPARPORT_REMOVAL_RELATIONS PptRemovalRelations ) -{ PREMOVAL_RELATIONS_LIST_ENTRY node ; - PVOID tmp ; - PVOID tmp___0 ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_ListHead ; - - { - { - tmp = ExAllocatePoolWithTag(1, sizeof(REMOVAL_RELATIONS_LIST_ENTRY ), 1349673296UL); - node = tmp; - } - { - } - if (! node) { - { - } - return (-1073741670L); - } else { + while (1) { + while_19_continue: /* CIL Label */; + if (!((unsigned int)listHead->Flink == (unsigned int)listHead)) { - } - { - node->DeviceObject = PptRemovalRelations->DeviceObject; - node->Flags = PptRemovalRelations->Flags; - memset(& node->DeviceName, 0, sizeof(UNICODE_STRING )); - tmp___0 = ExAllocatePoolWithTag(1, (PptRemovalRelations->DeviceName)->MaximumLength, - 1349673296UL); - node->DeviceName.Buffer = tmp___0; - } - if (! node->DeviceName.Buffer) { - { + } else { + goto while_19_break; + } + thisListEntry = listHead->Flink; + _EX_Flink = (listHead->Flink)->Flink; + _EX_Blink = (listHead->Flink)->Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + node = (REMOVAL_RELATIONS_LIST_ENTRY + *)((CHAR *)thisListEntry - + (unsigned long)(&((REMOVAL_RELATIONS_LIST_ENTRY *)0) + ->ListEntry)); + {} { + /* RtlFreeUnicodeString(& node->DeviceName); */ /* INLINED */ + /* ExFreePool(node); */ /* INLINED */ + } + } + while_19_break: /* CIL Label */; } { -/* ExFreePool(node); */ /* INLINED */ + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ } - return (-1073741670L); - } else { - - } - { - node->DeviceName.MaximumLength = (PptRemovalRelations->DeviceName)->MaximumLength; -/* RtlCopyUnicodeString(& node->DeviceName, PptRemovalRelations->DeviceName); */ /* INLINED */ -/* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - _EX_ListHead = & Extension->RemovalRelationsList; - _EX_Blink = _EX_ListHead->Blink; - node->ListEntry.Flink = _EX_ListHead; - node->ListEntry.Blink = _EX_Blink; - _EX_Blink->Flink = & node->ListEntry; - _EX_ListHead->Blink = & node->ListEntry; -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + return; } - return (0L); } -} -NTSTATUS PptRemovePptRemovalRelation(PDEVICE_EXTENSION Extension , PPARPORT_REMOVAL_RELATIONS PptRemovalRelations ) -{ PDEVICE_OBJECT callerDevObj ; - PLIST_ENTRY listHead ; - PDEVICE_OBJECT listDevObj ; - PLIST_ENTRY thisListEntry ; - PLIST_ENTRY firstListEntry ; - BOOLEAN found ; - BOOLEAN done ; - PREMOVAL_RELATIONS_LIST_ENTRY node ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; - PLIST_ENTRY _EX_Blink___0 ; - PLIST_ENTRY _EX_ListHead ; +NTSTATUS +PptAddPptRemovalRelation(PDEVICE_EXTENSION Extension, + PPARPORT_REMOVAL_RELATIONS PptRemovalRelations) { + PREMOVAL_RELATIONS_LIST_ENTRY node; + PVOID tmp; + PVOID tmp___0; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_ListHead; { - callerDevObj = PptRemovalRelations->DeviceObject; - listHead = & Extension->RemovalRelationsList; - listDevObj = (void *)0; - thisListEntry = (void *)0; - firstListEntry = (void *)0; - found = 0; - done = 0; - node = (void *)0; - { - } - { -/* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - if ((unsigned int )listHead->Flink == (unsigned int )listHead) { { + tmp = ExAllocatePoolWithTag(1, sizeof(REMOVAL_RELATIONS_LIST_ENTRY), + 1349673296UL); + node = tmp; } - { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + {} + if (!node) { + {} + return (-1073741670L); + } else { } - return (0L); - } else { { + node->DeviceObject = PptRemovalRelations->DeviceObject; + node->Flags = PptRemovalRelations->Flags; + memset(&node->DeviceName, 0, sizeof(UNICODE_STRING)); + tmp___0 = ExAllocatePoolWithTag( + 1, (PptRemovalRelations->DeviceName)->MaximumLength, 1349673296UL); + node->DeviceName.Buffer = tmp___0; + } + if (!node->DeviceName.Buffer) { + {} { /* ExFreePool(node); */ /* INLINED */ + } + return (-1073741670L); + } else { } { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + node->DeviceName.MaximumLength = + (PptRemovalRelations->DeviceName)->MaximumLength; + /* RtlCopyUnicodeString(& node->DeviceName, PptRemovalRelations->DeviceName); */ /* INLINED */ + /* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + _EX_ListHead = &Extension->RemovalRelationsList; + _EX_Blink = _EX_ListHead->Blink; + node->ListEntry.Flink = _EX_ListHead; + node->ListEntry.Blink = _EX_Blink; + _EX_Blink->Flink = &node->ListEntry; + _EX_ListHead->Blink = &node->ListEntry; + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ } + return (0L); } - { -/* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - { - while (1) { - while_27_continue: /* CIL Label */ ; - if (! done) { - - } else { - goto while_27_break; - } - thisListEntry = listHead->Flink; - _EX_Flink = (listHead->Flink)->Flink; - _EX_Blink = (listHead->Flink)->Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - node = (REMOVAL_RELATIONS_LIST_ENTRY *)((CHAR *)thisListEntry - (unsigned long )(& ((REMOVAL_RELATIONS_LIST_ENTRY *)0)->ListEntry)); - if ((unsigned int )node->DeviceObject == (unsigned int )callerDevObj) { - { +} +NTSTATUS +PptRemovePptRemovalRelation(PDEVICE_EXTENSION Extension, + PPARPORT_REMOVAL_RELATIONS PptRemovalRelations) { + PDEVICE_OBJECT callerDevObj; + PLIST_ENTRY listHead; + PDEVICE_OBJECT listDevObj; + PLIST_ENTRY thisListEntry; + PLIST_ENTRY firstListEntry; + BOOLEAN found; + BOOLEAN done; + PREMOVAL_RELATIONS_LIST_ENTRY node; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; + PLIST_ENTRY _EX_Blink___0; + PLIST_ENTRY _EX_ListHead; + + { + callerDevObj = PptRemovalRelations->DeviceObject; + listHead = &Extension->RemovalRelationsList; + listDevObj = (void *)0; + thisListEntry = (void *)0; + firstListEntry = (void *)0; + found = 0; + done = 0; + node = (void *)0; + {} { + /* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + } + if ((unsigned int)listHead->Flink == (unsigned int)listHead) { + {} { + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED + */ } - found = 1; - done = 1; + return (0L); } else { - if ((unsigned int )firstListEntry == (unsigned int )thisListEntry) { - { + {} { + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED + */ + } + } + { + /* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED + */ + } { + while (1) { + while_27_continue: /* CIL Label */; + if (!done) { + + } else { + goto while_27_break; } - done = 1; - } else { - if (! firstListEntry) { - { + thisListEntry = listHead->Flink; + _EX_Flink = (listHead->Flink)->Flink; + _EX_Blink = (listHead->Flink)->Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + node = (REMOVAL_RELATIONS_LIST_ENTRY + *)((CHAR *)thisListEntry - + (unsigned long)(&((REMOVAL_RELATIONS_LIST_ENTRY *)0) + ->ListEntry)); + if ((unsigned int)node->DeviceObject == (unsigned int)callerDevObj) { + {} + found = 1; + done = 1; + } else { + if ((unsigned int)firstListEntry == (unsigned int)thisListEntry) { + {} + done = 1; + } else { + if (!firstListEntry) { + {} + firstListEntry = thisListEntry; + } else { + } } - firstListEntry = thisListEntry; + } + if (!found) { + _EX_ListHead = listHead; + _EX_Blink___0 = _EX_ListHead->Blink; + node->ListEntry.Flink = _EX_ListHead; + node->ListEntry.Blink = _EX_Blink___0; + _EX_Blink___0->Flink = &node->ListEntry; + _EX_ListHead->Blink = &node->ListEntry; } else { - } } + while_27_break: /* CIL Label */; } - if (! found) { - _EX_ListHead = listHead; - _EX_Blink___0 = _EX_ListHead->Blink; - node->ListEntry.Flink = _EX_ListHead; - node->ListEntry.Blink = _EX_Blink___0; - _EX_Blink___0->Flink = & node->ListEntry; - _EX_ListHead->Blink = & node->ListEntry; - } else { - - } - } - while_27_break: /* CIL Label */ ; - } - { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - if (found) { - { -/* RtlFreeUnicodeString(& node->DeviceName); */ /* INLINED */ -/* ExFreePool(node); */ /* INLINED */ - } - } else { - - } - { - } - return (0L); -} -} -void PptDumpRemovalRelationsList(PDEVICE_EXTENSION Extension ) -{ PLIST_ENTRY listHead ; - PLIST_ENTRY thisListEntry ; - PLIST_ENTRY firstListEntry ; - BOOLEAN done ; - PREMOVAL_RELATIONS_LIST_ENTRY node ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; - PLIST_ENTRY _EX_Flink___0 ; - PLIST_ENTRY _EX_ListHead ; - PLIST_ENTRY _EX_Blink___0 ; - PLIST_ENTRY _EX_ListHead___0 ; - - { - listHead = & Extension->RemovalRelationsList; - thisListEntry = (void *)0; - firstListEntry = (void *)0; - done = 0; - node = (void *)0; - { - } - { -/* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - if ((unsigned int )listHead->Flink == (unsigned int )listHead) { - { - } - { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - return; - } else { { + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ } - } - { - while (1) { - while_35_continue: /* CIL Label */ ; - if (! done) { - - } else { - goto while_35_break; - } - thisListEntry = listHead->Flink; - _EX_Flink = (listHead->Flink)->Flink; - _EX_Blink = (listHead->Flink)->Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - node = (REMOVAL_RELATIONS_LIST_ENTRY *)((CHAR *)thisListEntry - (unsigned long )(& ((REMOVAL_RELATIONS_LIST_ENTRY *)0)->ListEntry)); - if ((unsigned int )firstListEntry == (unsigned int )thisListEntry) { - _EX_ListHead = listHead; - _EX_Flink___0 = _EX_ListHead->Flink; - node->ListEntry.Flink = _EX_Flink___0; - node->ListEntry.Blink = _EX_ListHead; - _EX_Flink___0->Blink = & node->ListEntry; - _EX_ListHead->Flink = & node->ListEntry; - done = 1; - { - } - } else { + if (found) { { + /* RtlFreeUnicodeString(& node->DeviceName); */ /* INLINED */ + /* ExFreePool(node); */ /* INLINED */ } - _EX_ListHead___0 = listHead; - _EX_Blink___0 = _EX_ListHead___0->Blink; - node->ListEntry.Flink = _EX_ListHead___0; - node->ListEntry.Blink = _EX_Blink___0; - _EX_Blink___0->Flink = & node->ListEntry; - _EX_ListHead___0->Blink = & node->ListEntry; - } - if (! firstListEntry) { - firstListEntry = thisListEntry; } else { - } + {} + return (0L); } - while_35_break: /* CIL Label */ ; - } - { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - return; -} -} -void PptDumpPptRemovalRelationsStruct(PPARPORT_REMOVAL_RELATIONS PptRemovalRelations ) -{ - - { - return; } -} -NTSTATUS PptDispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION IrpSp ; - PDEVICE_EXTENSION Extension ; - NTSTATUS Status ; - PPARALLEL_PORT_INFORMATION PortInfo ; - PPARALLEL_PNP_INFORMATION PnpInfo ; - PMORE_PARALLEL_PORT_INFORMATION MorePortInfo ; - KIRQL CancelIrql ; - SYNCHRONIZED_COUNT_CONTEXT SyncContext ; - PPARALLEL_INTERRUPT_SERVICE_ROUTINE IsrInfo ; - PPARALLEL_INTERRUPT_INFORMATION InterruptInfo ; - PISR_LIST_ENTRY IsrListEntry ; - SYNCHRONIZED_LIST_CONTEXT ListContext ; - SYNCHRONIZED_DISCONNECT_CONTEXT DisconnectContext ; - BOOLEAN DisconnectInterrupt ; - NTSTATUS tmp ; - PPARPORT_REMOVAL_RELATIONS removalRelations ; - PPARPORT_REMOVAL_RELATIONS removalRelations___0 ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_ListHead ; - ULONG EnableConnectInterruptIoctl ; - PVOID tmp___0 ; - BOOLEAN tmp___1 ; - PLIST_ENTRY _EX_Blink___0 ; - PLIST_ENTRY _EX_ListHead___0 ; - - { - Extension = DeviceObject->DeviceExtension; - { - } - if (Irp->UserEvent) { - - } else { - - } - if (Extension->DeviceStateFlags & 4096UL) { - { +void PptDumpRemovalRelationsList(PDEVICE_EXTENSION Extension) { + PLIST_ENTRY listHead; + PLIST_ENTRY thisListEntry; + PLIST_ENTRY firstListEntry; + BOOLEAN done; + PREMOVAL_RELATIONS_LIST_ENTRY node; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; + PLIST_ENTRY _EX_Flink___0; + PLIST_ENTRY _EX_ListHead; + PLIST_ENTRY _EX_Blink___0; + PLIST_ENTRY _EX_ListHead___0; + + { + listHead = &Extension->RemovalRelationsList; + thisListEntry = (void *)0; + firstListEntry = (void *)0; + done = 0; + node = (void *)0; + {} { + /* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + } + if ((unsigned int)listHead->Flink == (unsigned int)listHead) { + {} { + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED + */ + } + return; + } else { + {} } { - tmp = PptFailRequest(Irp, -1073741738L); - } - return (tmp); - } else { + while (1) { + while_35_continue: /* CIL Label */; + if (!done) { - } - { - Status = PptAcquireRemoveLockOrFailIrp(DeviceObject, Irp); - } - if (! (Status >= 0L)) { + } else { + goto while_35_break; + } + thisListEntry = listHead->Flink; + _EX_Flink = (listHead->Flink)->Flink; + _EX_Blink = (listHead->Flink)->Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + node = (REMOVAL_RELATIONS_LIST_ENTRY + *)((CHAR *)thisListEntry - + (unsigned long)(&((REMOVAL_RELATIONS_LIST_ENTRY *)0) + ->ListEntry)); + if ((unsigned int)firstListEntry == (unsigned int)thisListEntry) { + _EX_ListHead = listHead; + _EX_Flink___0 = _EX_ListHead->Flink; + node->ListEntry.Flink = _EX_Flink___0; + node->ListEntry.Blink = _EX_ListHead; + _EX_Flink___0->Blink = &node->ListEntry; + _EX_ListHead->Flink = &node->ListEntry; + done = 1; + {} + } else { + {} + _EX_ListHead___0 = listHead; + _EX_Blink___0 = _EX_ListHead___0->Blink; + node->ListEntry.Flink = _EX_ListHead___0; + node->ListEntry.Blink = _EX_Blink___0; + _EX_Blink___0->Flink = &node->ListEntry; + _EX_ListHead___0->Blink = &node->ListEntry; + } + if (!firstListEntry) { + firstListEntry = thisListEntry; + } else { + } + } + while_35_break: /* CIL Label */; + } { + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ } - return (Status); - } else { - + return; } - IrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - Irp->IoStatus.Information = 0; - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (50 << 2))) { - goto switch_41_exp_0; - } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (51 << 2))) { - goto switch_41_exp_1; +} +void PptDumpPptRemovalRelationsStruct( + PPARPORT_REMOVAL_RELATIONS PptRemovalRelations) { + + { return; } +} +NTSTATUS PptDispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject, + PIRP Irp) { + PIO_STACK_LOCATION IrpSp; + PDEVICE_EXTENSION Extension; + NTSTATUS Status; + PPARALLEL_PORT_INFORMATION PortInfo; + PPARALLEL_PNP_INFORMATION PnpInfo; + PMORE_PARALLEL_PORT_INFORMATION MorePortInfo; + KIRQL CancelIrql; + SYNCHRONIZED_COUNT_CONTEXT SyncContext; + PPARALLEL_INTERRUPT_SERVICE_ROUTINE IsrInfo; + PPARALLEL_INTERRUPT_INFORMATION InterruptInfo; + PISR_LIST_ENTRY IsrListEntry; + SYNCHRONIZED_LIST_CONTEXT ListContext; + SYNCHRONIZED_DISCONNECT_CONTEXT DisconnectContext; + BOOLEAN DisconnectInterrupt; + NTSTATUS tmp; + PPARPORT_REMOVAL_RELATIONS removalRelations; + PPARPORT_REMOVAL_RELATIONS removalRelations___0; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_ListHead; + ULONG EnableConnectInterruptIoctl; + PVOID tmp___0; + BOOLEAN tmp___1; + PLIST_ENTRY _EX_Blink___0; + PLIST_ENTRY _EX_ListHead___0; + + { + Extension = DeviceObject->DeviceExtension; + {} + if (Irp->UserEvent) { + + } else { + } + if (Extension->DeviceStateFlags & 4096UL) { + {} { tmp = PptFailRequest(Irp, -1073741738L); } + return (tmp); + } else { + } + { Status = PptAcquireRemoveLockOrFailIrp(DeviceObject, Irp); } + if (!(Status >= 0L)) { + {} + return (Status); + } else { + } + IrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + Irp->IoStatus.Information = 0; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (50 << 2))) { + goto switch_41_exp_0; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (40 << 2))) { - goto switch_41_exp_2; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (51 << 2))) { + goto switch_41_exp_1; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (11 << 2))) { - goto switch_41_exp_3; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (40 << 2))) { + goto switch_41_exp_2; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (12 << 2))) { - goto switch_41_exp_4; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (11 << 2))) { + goto switch_41_exp_3; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (15 << 2))) { - goto switch_41_exp_5; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (12 << 2))) { + goto switch_41_exp_4; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (21 << 2))) { - goto switch_41_exp_6; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (15 << 2))) { + goto switch_41_exp_5; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (17 << 2))) { - goto switch_41_exp_7; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (21 << 2))) { + goto switch_41_exp_6; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (13 << 2))) { - goto switch_41_exp_8; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (17 << 2))) { + goto switch_41_exp_7; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (14 << 2))) { - goto switch_41_exp_9; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (13 << 2))) { + goto switch_41_exp_8; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (19 << 2))) { - goto switch_41_exp_10; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (14 << 2))) { + goto switch_41_exp_9; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (20 << 2))) { - goto switch_41_exp_11; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (19 << 2))) { + goto switch_41_exp_10; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (22 << 2))) { - goto switch_41_exp_12; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (20 << 2))) { + goto switch_41_exp_11; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (23 << 2))) { - goto switch_41_exp_13; + if (IrpSp->Parameters.DeviceIoControl + .IoControlCode == + ((22 << 16) | (22 << 2))) { + goto switch_41_exp_12; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (24 << 2))) { - goto switch_41_exp_14; + if (IrpSp->Parameters.DeviceIoControl + .IoControlCode == + ((22 << 16) | (23 << 2))) { + goto switch_41_exp_13; } else { - { - goto switch_41_default; - if (0) { - switch_41_exp_0: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARPORT_REMOVAL_RELATIONS )) { - { - } - Status = -1073741789L; - } else { - { - removalRelations = Irp->AssociatedIrp.SystemBuffer; -/* PptDumpPptRemovalRelationsStruct(removalRelations); */ /* INLINED */ - PptDumpRemovalRelationsList(Extension); - PptAddPptRemovalRelation(Extension, removalRelations); - PptDumpRemovalRelationsList(Extension); - } - { - } - Status = 0L; - } - { - Irp->IoStatus.__annonCompField4.Status = Status; - myStatus = Status; - PptReleaseRemoveLock(& Extension->RemoveLock, Irp); - PptCompleteRequest(Irp, 0); - } - return (Status); - switch_41_exp_1: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARPORT_REMOVAL_RELATIONS )) { - { - } - Status = -1073741789L; - } else { - { - removalRelations___0 = Irp->AssociatedIrp.SystemBuffer; -/* PptDumpPptRemovalRelationsStruct(Irp->AssociatedIrp.SystemBuffer); */ /* INLINED */ - PptDumpRemovalRelationsList(Extension); - PptRemovePptRemovalRelation(Extension, removalRelations___0); - PptDumpRemovalRelationsList(Extension); - } - { - } - Status = 0L; - } - { - Irp->IoStatus.__annonCompField4.Status = Status; - myStatus = Status; - PptReleaseRemoveLock(& Extension->RemoveLock, Irp); - PptCompleteRequest(Irp, 0); - } - return (Status); - switch_41_exp_2: /* CIL Label */ - { - PptFreePort(Extension); - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - PptReleaseRemoveLock(& Extension->RemoveLock, Irp); - PptCompleteRequest(Irp, 0); - } - return (0L); - switch_41_exp_3: /* CIL Label */ + if (IrpSp->Parameters.DeviceIoControl + .IoControlCode == + ((22 << 16) | (24 << 2))) { + goto switch_41_exp_14; + } else { { - IoAcquireCancelSpinLock(& CancelIrql); - } - if (Irp->Cancel) { - Status = -1073741536L; - } else { - SyncContext.Count = & Extension->WorkQueueCount; - if (Extension->InterruptRefCount) { - { - KeSynchronizeExecution(Extension->InterruptObject, - & PptSynchronizedIncrement, - & SyncContext); - } - } else { - { - PptSynchronizedIncrement(& SyncContext); + goto switch_41_default; + if (0) { + switch_41_exp_0: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof( + PARPORT_REMOVAL_RELATIONS)) { + {} + Status = -1073741789L; + } else { + { + removalRelations = + Irp->AssociatedIrp.SystemBuffer; + /* PptDumpPptRemovalRelationsStruct(removalRelations); */ /* INLINED */ + PptDumpRemovalRelationsList( + Extension); + PptAddPptRemovalRelation( + Extension, removalRelations); + PptDumpRemovalRelationsList( + Extension); + } + {} + Status = 0L; } - } - if (SyncContext.NewCount) { { - PptSetCancelRoutine(Irp, & PptCancelRoutine); + Irp->IoStatus.__annonCompField4.Status = + Status; + myStatus = Status; + PptReleaseRemoveLock( + &Extension->RemoveLock, Irp); + PptCompleteRequest(Irp, 0); } - if (pended == 0) { - pended = 1; + return (Status); + switch_41_exp_1: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof( + PARPORT_REMOVAL_RELATIONS)) { + {} + Status = -1073741789L; } else { { - errorFn(); + removalRelations___0 = + Irp->AssociatedIrp.SystemBuffer; + /* PptDumpPptRemovalRelationsStruct(Irp->AssociatedIrp.SystemBuffer); */ /* INLINED */ + PptDumpRemovalRelationsList( + Extension); + PptRemovePptRemovalRelation( + Extension, removalRelations___0); + PptDumpRemovalRelationsList( + Extension); } + {} + Status = 0L; } - (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1; - _EX_ListHead = & Extension->WorkQueue; - _EX_Blink = _EX_ListHead->Blink; - Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink = _EX_ListHead; - Irp->Tail.Overlay.__annonCompField17.ListEntry.Blink = _EX_Blink; - _EX_Blink->Flink = & Irp->Tail.Overlay.__annonCompField17.ListEntry; - _EX_ListHead->Blink = & Irp->Tail.Overlay.__annonCompField17.ListEntry; - Status = 259L; - } else { - Extension->WmiPortAllocFreeCounts.PortAllocates += 1UL; - Status = 0L; - } - } - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - } - goto switch_41_break; - switch_41_exp_4: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(PARALLEL_PORT_INFORMATION )) { - Status = -1073741789L; - } else { - Irp->IoStatus.Information = sizeof(PARALLEL_PORT_INFORMATION ); - PortInfo = Irp->AssociatedIrp.SystemBuffer; - *PortInfo = Extension->PortInfo; - Status = 0L; - } - goto switch_41_break; - switch_41_exp_5: /* CIL Label */ ; - { - } - Status = 0L; - goto switch_41_break; - switch_41_exp_6: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(PARALLEL_PNP_INFORMATION )) { - Status = -1073741789L; - } else { - Irp->IoStatus.Information = sizeof(PARALLEL_PNP_INFORMATION ); - PnpInfo = Irp->AssociatedIrp.SystemBuffer; - *PnpInfo = Extension->PnpInfo; - Status = 0L; - } - goto switch_41_break; - switch_41_exp_7: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(MORE_PARALLEL_PORT_INFORMATION )) { - Status = -1073741789L; - } else { - Irp->IoStatus.Information = sizeof(MORE_PARALLEL_PORT_INFORMATION ); - MorePortInfo = Irp->AssociatedIrp.SystemBuffer; - MorePortInfo->InterfaceType = Extension->InterfaceType; - MorePortInfo->BusNumber = Extension->BusNumber; - MorePortInfo->InterruptLevel = Extension->InterruptLevel; - MorePortInfo->InterruptVector = Extension->InterruptVector; - MorePortInfo->InterruptAffinity = Extension->InterruptAffinity; - MorePortInfo->InterruptMode = Extension->InterruptMode; - Status = 0L; - } - goto switch_41_break; - switch_41_exp_8: /* CIL Label */ ; - { - } - EnableConnectInterruptIoctl = 0; - { - } - if (0UL == EnableConnectInterruptIoctl) { + { + Irp->IoStatus.__annonCompField4.Status = + Status; + myStatus = Status; + PptReleaseRemoveLock( + &Extension->RemoveLock, Irp); + PptCompleteRequest(Irp, 0); + } + return (Status); + switch_41_exp_2 : /* CIL Label */ { + PptFreePort(Extension); + Irp->IoStatus.__annonCompField4.Status = + 0L; + myStatus = 0L; + PptReleaseRemoveLock( + &Extension->RemoveLock, Irp); + PptCompleteRequest(Irp, 0); } - Status = -1073741823L; - goto targetExit; - } else { + return (0L); + switch_41_exp_3 : /* CIL Label */ { + IoAcquireCancelSpinLock(&CancelIrql); } - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARALLEL_INTERRUPT_SERVICE_ROUTINE )) { - Status = -1073741789L; - } else { - if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(PARALLEL_INTERRUPT_INFORMATION )) { - Status = -1073741789L; - } else { - { - IsrInfo = Irp->AssociatedIrp.SystemBuffer; - InterruptInfo = Irp->AssociatedIrp.SystemBuffer; - IoAcquireCancelSpinLock(& CancelIrql); - } - if (Extension->InterruptRefCount) { - { - Extension->InterruptRefCount += 1UL; -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - Status = 0L; - } + if (Irp->Cancel) { + Status = -1073741536L; } else { - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - Status = PptConnectInterrupt(Extension); - } - if (Status >= 0L) { + SyncContext.Count = + &Extension->WorkQueueCount; + if (Extension->InterruptRefCount) { { - IoAcquireCancelSpinLock(& CancelIrql); - Extension->InterruptRefCount += 1UL; -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + KeSynchronizeExecution( + Extension->InterruptObject, + &PptSynchronizedIncrement, + &SyncContext); } } else { - - } - } - if (Status >= 0L) { - { - tmp___0 = ExAllocatePoolWithTag(0, sizeof(ISR_LIST_ENTRY ), - 1349673296UL); - IsrListEntry = tmp___0; + { + PptSynchronizedIncrement( + &SyncContext); + } } - if (IsrListEntry) { + if (SyncContext.NewCount) { { - IsrListEntry->ServiceRoutine = IsrInfo->InterruptServiceRoutine; - IsrListEntry->ServiceContext = IsrInfo->InterruptServiceContext; - IsrListEntry->DeferredPortCheckRoutine = IsrInfo->DeferredPortCheckRoutine; - IsrListEntry->CheckContext = IsrInfo->DeferredPortCheckContext; - ListContext.List = & Extension->IsrList; - ListContext.NewEntry = & IsrListEntry->ListEntry; - KeSynchronizeExecution(Extension->InterruptObject, - & PptSynchronizedQueue, - & ListContext); - InterruptInfo->InterruptObject = Extension->InterruptObject; - InterruptInfo->TryAllocatePortAtInterruptLevel = & PptTryAllocatePortAtInterruptLevel; - InterruptInfo->FreePortFromInterruptLevel = & PptFreePortFromInterruptLevel; - InterruptInfo->Context = Extension; - Irp->IoStatus.Information = sizeof(PARALLEL_INTERRUPT_INFORMATION ); - Status = 0L; + PptSetCancelRoutine( + Irp, &PptCancelRoutine); + } + if (pended == 0) { + pended = 1; + } else { + { errorFn(); } } + (Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16 + .CurrentStackLocation) + ->Control = + (int)(Irp->Tail.Overlay + .__annonCompField17 + .__annonCompField16 + .CurrentStackLocation) + ->Control | + 1; + _EX_ListHead = &Extension->WorkQueue; + _EX_Blink = _EX_ListHead->Blink; + Irp->Tail.Overlay.__annonCompField17 + .ListEntry.Flink = _EX_ListHead; + Irp->Tail.Overlay.__annonCompField17 + .ListEntry.Blink = _EX_Blink; + _EX_Blink->Flink = + &Irp->Tail.Overlay + .__annonCompField17 + .ListEntry; + _EX_ListHead->Blink = + &Irp->Tail.Overlay + .__annonCompField17 + .ListEntry; + Status = 259L; } else { - Status = -1073741670L; + Extension->WmiPortAllocFreeCounts + .PortAllocates += 1UL; + Status = 0L; } - } else { - } - } - } - goto switch_41_break; - switch_41_exp_9: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARALLEL_INTERRUPT_SERVICE_ROUTINE )) { - Status = -1073741789L; - } else { - { - IsrInfo = Irp->AssociatedIrp.SystemBuffer; - IoAcquireCancelSpinLock(& CancelIrql); - } - if (Extension->InterruptRefCount) { { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - DisconnectContext.Extension = Extension; - DisconnectContext.IsrInfo = IsrInfo; - tmp___1 = KeSynchronizeExecution(Extension->InterruptObject, - & PptSynchronizedDisconnect, - & DisconnectContext); + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ } - if (tmp___1) { - { + goto switch_41_break; + switch_41_exp_4: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof( + PARALLEL_PORT_INFORMATION)) { + Status = -1073741789L; + } else { + Irp->IoStatus.Information = + sizeof(PARALLEL_PORT_INFORMATION); + PortInfo = + Irp->AssociatedIrp.SystemBuffer; + *PortInfo = Extension->PortInfo; Status = 0L; - IoAcquireCancelSpinLock(& CancelIrql); - Extension->InterruptRefCount -= 1UL; - } - if (Extension->InterruptRefCount == 0UL) { - DisconnectInterrupt = 1; - } else { - DisconnectInterrupt = 0; - } - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - } + } + goto switch_41_break; + switch_41_exp_5: /* CIL Label */; + {} + Status = 0L; + goto switch_41_break; + switch_41_exp_6: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof( + PARALLEL_PNP_INFORMATION)) { + Status = -1073741789L; } else { - Status = -1073741811L; - DisconnectInterrupt = 0; + Irp->IoStatus.Information = + sizeof(PARALLEL_PNP_INFORMATION); + PnpInfo = + Irp->AssociatedIrp.SystemBuffer; + *PnpInfo = Extension->PnpInfo; + Status = 0L; } - } else { - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - DisconnectInterrupt = 0; - Status = -1073741811L; + goto switch_41_break; + switch_41_exp_7: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof( + MORE_PARALLEL_PORT_INFORMATION)) { + Status = -1073741789L; + } else { + Irp->IoStatus.Information = sizeof( + MORE_PARALLEL_PORT_INFORMATION); + MorePortInfo = + Irp->AssociatedIrp.SystemBuffer; + MorePortInfo->InterfaceType = + Extension->InterfaceType; + MorePortInfo->BusNumber = + Extension->BusNumber; + MorePortInfo->InterruptLevel = + Extension->InterruptLevel; + MorePortInfo->InterruptVector = + Extension->InterruptVector; + MorePortInfo->InterruptAffinity = + Extension->InterruptAffinity; + MorePortInfo->InterruptMode = + Extension->InterruptMode; + Status = 0L; } - } - if (DisconnectInterrupt) { - { - PptDisconnectInterrupt(Extension); + goto switch_41_break; + switch_41_exp_8: /* CIL Label */; + {} + EnableConnectInterruptIoctl = 0; + {} + if (0UL == EnableConnectInterruptIoctl) { + {} + Status = -1073741823L; + goto targetExit; + } else { + {} } - } else { - - } - } - goto switch_41_break; - switch_41_exp_10: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARALLEL_CHIP_MODE )) { - Status = -1073741789L; - } else { - { - } - { - Status = PptSetChipMode(Extension, ((struct _PARALLEL_CHIP_MODE *)Irp->AssociatedIrp.SystemBuffer)->ModeFlags); - } - } - goto switch_41_break; - switch_41_exp_11: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARALLEL_CHIP_MODE )) { - Status = -1073741789L; - } else { - { - } - { - Status = PptClearChipMode(Extension, ((struct _PARALLEL_CHIP_MODE *)Irp->AssociatedIrp.SystemBuffer)->ModeFlags); - } - } - goto switch_41_break; - switch_41_exp_12: /* CIL Label */ ; - { - } - { - Extension->PnpInfo.Ieee1284_3DeviceCount = PptInitiate1284_3(Extension); - Status = 0L; - } - goto switch_41_break; - switch_41_exp_13: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARALLEL_1284_COMMAND )) { - { - } - Status = -1073741789L; - } else { - if (Irp->Cancel) { - Status = -1073741536L; - } else { - { - Status = PptTrySelectDevice(Extension, Irp->AssociatedIrp.SystemBuffer); - IoAcquireCancelSpinLock(& CancelIrql); + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof( + PARALLEL_INTERRUPT_SERVICE_ROUTINE)) { + Status = -1073741789L; + } else { + if (IrpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof( + PARALLEL_INTERRUPT_INFORMATION)) { + Status = -1073741789L; + } else { + { + IsrInfo = + Irp->AssociatedIrp.SystemBuffer; + InterruptInfo = + Irp->AssociatedIrp.SystemBuffer; + IoAcquireCancelSpinLock( + &CancelIrql); + } + if (Extension->InterruptRefCount) { + { + Extension->InterruptRefCount += + 1UL; + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + Status = 0L; + } + } else { + { + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + Status = PptConnectInterrupt( + Extension); + } + if (Status >= 0L) { + { + IoAcquireCancelSpinLock( + &CancelIrql); + Extension->InterruptRefCount += + 1UL; + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } + } else { + } + } + if (Status >= 0L) { + { + tmp___0 = ExAllocatePoolWithTag( + 0, sizeof(ISR_LIST_ENTRY), + 1349673296UL); + IsrListEntry = tmp___0; + } + if (IsrListEntry) { + { + IsrListEntry->ServiceRoutine = + IsrInfo + ->InterruptServiceRoutine; + IsrListEntry->ServiceContext = + IsrInfo + ->InterruptServiceContext; + IsrListEntry + ->DeferredPortCheckRoutine = + IsrInfo + ->DeferredPortCheckRoutine; + IsrListEntry->CheckContext = + IsrInfo + ->DeferredPortCheckContext; + ListContext.List = + &Extension->IsrList; + ListContext.NewEntry = + &IsrListEntry->ListEntry; + KeSynchronizeExecution( + Extension->InterruptObject, + &PptSynchronizedQueue, + &ListContext); + InterruptInfo->InterruptObject = + Extension->InterruptObject; + InterruptInfo + ->TryAllocatePortAtInterruptLevel = + &PptTryAllocatePortAtInterruptLevel; + InterruptInfo + ->FreePortFromInterruptLevel = + &PptFreePortFromInterruptLevel; + InterruptInfo->Context = + Extension; + Irp->IoStatus + .Information = sizeof( + PARALLEL_INTERRUPT_INFORMATION); + Status = 0L; + } + } else { + Status = -1073741670L; + } + } else { + } + } } - if (Status == 259L) { + goto switch_41_break; + switch_41_exp_9: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof( + PARALLEL_INTERRUPT_SERVICE_ROUTINE)) { + Status = -1073741789L; + } else { { - PptSetCancelRoutine(Irp, & PptCancelRoutine); + IsrInfo = + Irp->AssociatedIrp.SystemBuffer; + IoAcquireCancelSpinLock(&CancelIrql); } - if (pended == 0) { - pended = 1; + if (Extension->InterruptRefCount) { + { + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + DisconnectContext.Extension = + Extension; + DisconnectContext.IsrInfo = IsrInfo; + tmp___1 = KeSynchronizeExecution( + Extension->InterruptObject, + &PptSynchronizedDisconnect, + &DisconnectContext); + } + if (tmp___1) { + { + Status = 0L; + IoAcquireCancelSpinLock( + &CancelIrql); + Extension->InterruptRefCount -= + 1UL; + } + if (Extension->InterruptRefCount == + 0UL) { + DisconnectInterrupt = 1; + } else { + DisconnectInterrupt = 0; + } + { + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } + } else { + Status = -1073741811L; + DisconnectInterrupt = 0; + } } else { { - errorFn(); + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + DisconnectInterrupt = 0; + Status = -1073741811L; } } - (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1; - _EX_ListHead___0 = & Extension->WorkQueue; - _EX_Blink___0 = _EX_ListHead___0->Blink; - Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink = _EX_ListHead___0; - Irp->Tail.Overlay.__annonCompField17.ListEntry.Blink = _EX_Blink___0; - _EX_Blink___0->Flink = & Irp->Tail.Overlay.__annonCompField17.ListEntry; - _EX_ListHead___0->Blink = & Irp->Tail.Overlay.__annonCompField17.ListEntry; - { + if (DisconnectInterrupt) { + { PptDisconnectInterrupt(Extension); } + } else { } + } + goto switch_41_break; + switch_41_exp_10: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(PARALLEL_CHIP_MODE)) { + Status = -1073741789L; } else { - + {} { + Status = PptSetChipMode( + Extension, + ((struct _PARALLEL_CHIP_MODE *)Irp + ->AssociatedIrp.SystemBuffer) + ->ModeFlags); + } } - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + goto switch_41_break; + switch_41_exp_11: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(PARALLEL_CHIP_MODE)) { + Status = -1073741789L; + } else { + {} { + Status = PptClearChipMode( + Extension, + ((struct _PARALLEL_CHIP_MODE *)Irp + ->AssociatedIrp.SystemBuffer) + ->ModeFlags); + } } + goto switch_41_break; + switch_41_exp_12: /* CIL Label */; + {} { + Extension->PnpInfo + .Ieee1284_3DeviceCount = + PptInitiate1284_3(Extension); + Status = 0L; + } + goto switch_41_break; + switch_41_exp_13: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof( + PARALLEL_1284_COMMAND)) { + {} + Status = -1073741789L; + } else { + if (Irp->Cancel) { + Status = -1073741536L; + } else { + { + Status = PptTrySelectDevice( + Extension, + Irp->AssociatedIrp + .SystemBuffer); + IoAcquireCancelSpinLock( + &CancelIrql); + } + if (Status == 259L) { + { + PptSetCancelRoutine( + Irp, &PptCancelRoutine); + } + if (pended == 0) { + pended = 1; + } else { + { errorFn(); } + } + (Irp->Tail.Overlay + .__annonCompField17 + .__annonCompField16 + .CurrentStackLocation) + ->Control = + (int)(Irp->Tail.Overlay + .__annonCompField17 + .__annonCompField16 + .CurrentStackLocation) + ->Control | + 1; + _EX_ListHead___0 = + &Extension->WorkQueue; + _EX_Blink___0 = + _EX_ListHead___0->Blink; + Irp->Tail.Overlay.__annonCompField17 + .ListEntry.Flink = + _EX_ListHead___0; + Irp->Tail.Overlay.__annonCompField17 + .ListEntry.Blink = + _EX_Blink___0; + _EX_Blink___0->Flink = + &Irp->Tail.Overlay + .__annonCompField17 + .ListEntry; + _EX_ListHead___0->Blink = + &Irp->Tail.Overlay + .__annonCompField17 + .ListEntry; + {} + } else { + } + { + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } + } + } + goto switch_41_break; + switch_41_exp_14: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof( + PARALLEL_1284_COMMAND)) { + {} + Status = -1073741789L; + } else { + { + Status = PptDeselectDevice( + Extension, + Irp->AssociatedIrp.SystemBuffer); + } + } + goto switch_41_break; + switch_41_default: /* CIL Label */; + {} + Status = -1073741811L; + goto switch_41_break; + } else { + switch_41_break: /* CIL Label */; } } - goto switch_41_break; - switch_41_exp_14: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARALLEL_1284_COMMAND )) { - { - } - Status = -1073741789L; - } else { - { - Status = PptDeselectDevice(Extension, Irp->AssociatedIrp.SystemBuffer); - } - } - goto switch_41_break; - switch_41_default: /* CIL Label */ ; - { - } - Status = -1073741811L; - goto switch_41_break; - } else { - switch_41_break: /* CIL Label */ ; - } } } } @@ -3606,3039 +3707,2752 @@ NTSTATUS PptDispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp } } } - } - targetExit: - if (Status != 259L) { - { - Irp->IoStatus.__annonCompField4.Status = Status; - myStatus = Status; - PptReleaseRemoveLock(& Extension->RemoveLock, Irp); - PptCompleteRequest(Irp, 0); + targetExit: + if (Status != 259L) { + { + Irp->IoStatus.__annonCompField4.Status = Status; + myStatus = Status; + PptReleaseRemoveLock(&Extension->RemoveLock, Irp); + PptCompleteRequest(Irp, 0); + } + } else { } - } else { - + return (Status); } - return (Status); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -BOOLEAN PptIsNecR98Machine(void) -{ UNICODE_STRING Path ; - RTL_QUERY_REGISTRY_TABLE ParamTable[2] ; - NTSTATUS Status ; - UNICODE_STRING identifierString ; - UNICODE_STRING necR98Identifier ; - UNICODE_STRING necR98JIdentifier ; - PVOID tmp ; - LONG tmp___0 ; - LONG tmp___1 ; - - { - { - identifierString.Length = 0; - identifierString.MaximumLength = 32; - tmp = ExAllocatePoolWithTag(1, identifierString.MaximumLength, 1349673296UL); - identifierString.Buffer = tmp; - } - if (! identifierString.Buffer) { - return (0); - } else { - - } - { - memset(ParamTable, 0, sizeof(ParamTable)); - ParamTable[0].Flags = 36; - ParamTable[0].EntryContext = & identifierString; - ParamTable[0].DefaultType = 1; - ParamTable[0].DefaultData = & Path; - ParamTable[0].DefaultLength = 0; - Status = RtlQueryRegistryValues(0, Path.Buffer, ParamTable, (void *)0, (void *)0); - } - if (Status >= 0L) { - { - tmp___0 = RtlCompareUnicodeString(& identifierString, & necR98Identifier, 0); +BOOLEAN PptIsNecR98Machine(void) { + UNICODE_STRING Path; + RTL_QUERY_REGISTRY_TABLE ParamTable[2]; + NTSTATUS Status; + UNICODE_STRING identifierString; + UNICODE_STRING necR98Identifier; + UNICODE_STRING necR98JIdentifier; + PVOID tmp; + LONG tmp___0; + LONG tmp___1; + + { + { + identifierString.Length = 0; + identifierString.MaximumLength = 32; + tmp = ExAllocatePoolWithTag(1, identifierString.MaximumLength, + 1349673296UL); + identifierString.Buffer = tmp; } - if (tmp___0 == 0L) { - goto _L; + if (!identifierString.Buffer) { + return (0); } else { + } + { + memset(ParamTable, 0, sizeof(ParamTable)); + ParamTable[0].Flags = 36; + ParamTable[0].EntryContext = &identifierString; + ParamTable[0].DefaultType = 1; + ParamTable[0].DefaultData = &Path; + ParamTable[0].DefaultLength = 0; + Status = RtlQueryRegistryValues(0, Path.Buffer, ParamTable, (void *)0, + (void *)0); + } + if (Status >= 0L) { { - tmp___1 = RtlCompareUnicodeString(& identifierString, & necR98JIdentifier, 0); + tmp___0 = + RtlCompareUnicodeString(&identifierString, &necR98Identifier, 0); } - if (tmp___1 == 0L) { - _L: /* CIL Label */ + if (tmp___0 == 0L) { + goto _L; + } else { { + tmp___1 = + RtlCompareUnicodeString(&identifierString, &necR98JIdentifier, 0); } - { -/* ExFreePool(identifierString.Buffer); */ /* INLINED */ + if (tmp___1 == 0L) { + _L : /* CIL Label */ + {} + { /* ExFreePool(identifierString.Buffer); */ /* INLINED */ + } + return (1); + } else { } - return (1); - } else { - } + } else { + {} { /* ExFreePool(identifierString.Buffer); */ /* INLINED */ + } + return (0); } - } else { - { - } - { -/* ExFreePool(identifierString.Buffer); */ /* INLINED */ + {} { /* ExFreePool(identifierString.Buffer); */ /* INLINED */ } return (0); } - { - } - { -/* ExFreePool(identifierString.Buffer); */ /* INLINED */ - } - return (0); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -NTSTATUS PptDispatchCreate(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS status ; - NTSTATUS tmp ; +NTSTATUS PptDispatchCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS status; + NTSTATUS tmp; { - extension = DeviceObject->DeviceExtension; - status = 0L; - if (extension->DeviceStateFlags & 4096UL) { - { + extension = DeviceObject->DeviceExtension; + status = 0L; + if (extension->DeviceStateFlags & 4096UL) { + {} { tmp = PptFailRequest(Irp, -1073741738L); } + return (tmp); + } else { } - { - tmp = PptFailRequest(Irp, -1073741738L); + { status = PptAcquireRemoveLockOrFailIrp(DeviceObject, Irp); } + if (!(status >= 0L)) { + {} + return (status); + } else { } - return (tmp); - } else { - - } - { - status = PptAcquireRemoveLockOrFailIrp(DeviceObject, Irp); - } - if (! (status >= 0L)) { { + /* ExAcquireFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ + InterlockedIncrement(&extension->OpenCloseRefCount); + /* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ + } + {} { + PptReleaseRemoveLock(&extension->RemoveLock, Irp); + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); } return (status); - } else { - - } - { -/* ExAcquireFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ - InterlockedIncrement(& extension->OpenCloseRefCount); -/* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ } - { - } - { - PptReleaseRemoveLock(& extension->RemoveLock, Irp); - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); - } - return (status); } -} -NTSTATUS PptDispatchClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS status ; - LONG tmp ; - - { - extension = DeviceObject->DeviceExtension; - if (extension->DeviceStateFlags & 4096UL) { - { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); - } - return (0L); - } else { - - } - { - status = PptAcquireRemoveLock(& extension->RemoveLock, Irp); - } - if (! (status >= 0L)) { - { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); - } - return (0L); - } else { +NTSTATUS PptDispatchClose(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS status; + LONG tmp; - } { -/* ExAcquireFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ - } - if (extension->OpenCloseRefCount > 0L) { - { - tmp = InterlockedDecrement(& extension->OpenCloseRefCount); - } - if (tmp < 0L) { + extension = DeviceObject->DeviceExtension; + if (extension->DeviceStateFlags & 4096UL) { { - InterlockedIncrement(& extension->OpenCloseRefCount); + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); } + return (0L); } else { - } - { -/* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ + { status = PptAcquireRemoveLock(&extension->RemoveLock, Irp); } + if (!(status >= 0L)) { + { + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); + } + return (0L); + } else { } - { + { /* ExAcquireFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ } - } else { - { -/* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ + if (extension->OpenCloseRefCount > 0L) { + { tmp = InterlockedDecrement(&extension->OpenCloseRefCount); } + if (tmp < 0L) { + { InterlockedIncrement(&extension->OpenCloseRefCount); } + } else { + } + { + /* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED + */ + } {} + } else { + { + /* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED + */ + } {} } { + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); + PptReleaseRemoveLock(&extension->RemoveLock, Irp); } + return (0L); } - { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); - PptReleaseRemoveLock(& extension->RemoveLock, Irp); - } - return (0L); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) -static UCHAR ModeQualifier___6[7] = { 170, 85, 0, 255, - 135, 120, 255}; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +static UCHAR ModeQualifier___6[7] = {170, 85, 0, 255, 135, 120, 255}; #pragma once -BOOLEAN PptCheckIfStl1284_3(PDEVICE_EXTENSION DeviceExtension , ULONG ulDaisyIndex , - BOOLEAN bNoStrobe ) ; -BOOLEAN PptCheckIfNon1284_3Present(PDEVICE_EXTENSION Extension ) ; -BOOLEAN PptCheckIfStlProductId(PDEVICE_EXTENSION DeviceExtension , ULONG ulDaisyIndex ) ; -ULONG PptInitiate1284_3(PVOID Extension ) -{ ULONG deviceCount1 ; - ULONG deviceCount2 ; - ULONG loopCount ; - ULONG maxTries ; - - { - deviceCount1 = 0; - deviceCount2 = 0; - loopCount = 0; - maxTries = 3; - { - while (1) { - while_76_continue: /* CIL Label */ ; - { - KeStallExecutionProcessor(5); - deviceCount1 = Ppt1284_3AssignAddress(Extension); - KeStallExecutionProcessor(5); - deviceCount2 = Ppt1284_3AssignAddress(Extension); - } - if (deviceCount1 != deviceCount2) { - loopCount += 1UL; - if (loopCount < maxTries) { +BOOLEAN PptCheckIfStl1284_3(PDEVICE_EXTENSION DeviceExtension, + ULONG ulDaisyIndex, BOOLEAN bNoStrobe); +BOOLEAN PptCheckIfNon1284_3Present(PDEVICE_EXTENSION Extension); +BOOLEAN PptCheckIfStlProductId(PDEVICE_EXTENSION DeviceExtension, + ULONG ulDaisyIndex); +ULONG PptInitiate1284_3(PVOID Extension) { + ULONG deviceCount1; + ULONG deviceCount2; + ULONG loopCount; + ULONG maxTries; + + { + deviceCount1 = 0; + deviceCount2 = 0; + loopCount = 0; + maxTries = 3; + { + while (1) { + while_76_continue: /* CIL Label */; + { + KeStallExecutionProcessor(5); + deviceCount1 = Ppt1284_3AssignAddress(Extension); + KeStallExecutionProcessor(5); + deviceCount2 = Ppt1284_3AssignAddress(Extension); + } + if (deviceCount1 != deviceCount2) { + loopCount += 1UL; + if (loopCount < maxTries) { - } else { - goto while_76_break; + } else { + goto while_76_break; + } + } else { + goto while_76_break; + } } - } else { - goto while_76_break; + while_76_break: /* CIL Label */; } + return (deviceCount2); } - while_76_break: /* CIL Label */ ; - } - return (deviceCount2); } -} -NTSTATUS PptTrySelectDevice(PVOID Context , PVOID TrySelectCommand ) -{ NTSTATUS Status ; - PDEVICE_EXTENSION Extension ; - PPARALLEL_1284_COMMAND Command ; - BOOLEAN success ; - SYNCHRONIZED_COUNT_CONTEXT SyncContext ; - KIRQL CancelIrql ; - UCHAR i ; - UCHAR DeviceID ; - NTSTATUS tmp ; +NTSTATUS PptTrySelectDevice(PVOID Context, PVOID TrySelectCommand) { + NTSTATUS Status; + PDEVICE_EXTENSION Extension; + PPARALLEL_1284_COMMAND Command; + BOOLEAN success; + SYNCHRONIZED_COUNT_CONTEXT SyncContext; + KIRQL CancelIrql; + UCHAR i; + UCHAR DeviceID; + NTSTATUS tmp; { - Status = 0L; - Extension = Context; - Command = TrySelectCommand; - success = 0; - { - } - if (Command->CommandFlags & 4UL) { - { - tmp = PptTrySelectLegacyZip(Context, TrySelectCommand); - } - return (tmp); - } else { - if ((int )Command->ID == 5) { - { - tmp = PptTrySelectLegacyZip(Context, TrySelectCommand); - } + Status = 0L; + Extension = Context; + Command = TrySelectCommand; + success = 0; + {} + if (Command->CommandFlags & 4UL) { + { tmp = PptTrySelectLegacyZip(Context, TrySelectCommand); } return (tmp); } else { - - } - } - DeviceID = Command->ID; - if (! (Command->CommandFlags & 1UL)) { - if ((ULONG )DeviceID > Extension->PnpInfo.Ieee1284_3DeviceCount) { - { + if ((int)Command->ID == 5) { + { tmp = PptTrySelectLegacyZip(Context, TrySelectCommand); } + return (tmp); + } else { } - Status = -1073741811L; - } else { - goto _L___1; } - } else { - _L___1: /* CIL Label */ - if (Command->CommandFlags & 2UL) { - if (! (Command->CommandFlags & 1UL)) { - if ((ULONG )DeviceID < Extension->PnpInfo.Ieee1284_3DeviceCount) { - i = 0; - { - while (1) { - while_79_continue: /* CIL Label */ ; - if ((int )i < (int )PptDot3Retries) { - if (! success) { - - } else { - goto while_79_break; - } - } else { - goto while_79_break; - } - { - success = PptSend1284_3Command(Extension, (unsigned char )(224 | (int )DeviceID)); - KeStallExecutionProcessor(5); - i = (UCHAR )((int )i + 1); - } - } - while_79_break: /* CIL Label */ ; - } - if (success) { - { - } - Status = 0L; - } else { - { - } - Status = -1073741823L; - } - } else { - goto _L; - } + DeviceID = Command->ID; + if (!(Command->CommandFlags & 1UL)) { + if ((ULONG)DeviceID > Extension->PnpInfo.Ieee1284_3DeviceCount) { + {} + Status = -1073741811L; } else { - _L: /* CIL Label */ - { - } - Status = 0L; + goto _L___1; } } else { - { - } - { - IoAcquireCancelSpinLock(& CancelIrql); - SyncContext.Count = & Extension->WorkQueueCount; - } - if (Extension->InterruptRefCount) { - { - KeSynchronizeExecution(Extension->InterruptObject, & PptSynchronizedIncrement, - & SyncContext); - } - } else { - { - PptSynchronizedIncrement(& SyncContext); - } - } - if (SyncContext.NewCount) { - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - Status = 259L; - } - } else { - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - } - { - } - Extension->WmiPortAllocFreeCounts.PortAllocates += 1UL; - if (! (Command->CommandFlags & 1UL)) { - if ((ULONG )DeviceID < Extension->PnpInfo.Ieee1284_3DeviceCount) { + _L___1: /* CIL Label */ + if (Command->CommandFlags & 2UL) { + if (!(Command->CommandFlags & 1UL)) { + if ((ULONG)DeviceID < Extension->PnpInfo.Ieee1284_3DeviceCount) { i = 0; { - while (1) { - while_85_continue: /* CIL Label */ ; - if ((int )i < (int )PptDot3Retries) { - if (! success) { + while (1) { + while_79_continue: /* CIL Label */; + if ((int)i < (int)PptDot3Retries) { + if (!success) { + } else { + goto while_79_break; + } } else { - goto while_85_break; + goto while_79_break; + } + { + success = PptSend1284_3Command( + Extension, (unsigned char)(224 | (int)DeviceID)); + KeStallExecutionProcessor(5); + i = (UCHAR)((int)i + 1); } - } else { - goto while_85_break; - } - { - success = PptSend1284_3Command(Extension, (unsigned char )(224 | (int )DeviceID)); - KeStallExecutionProcessor(5); - i = (UCHAR )((int )i + 1); } - } - while_85_break: /* CIL Label */ ; + while_79_break: /* CIL Label */; } if (success) { - { - } + {} Status = 0L; } else { - { - } + {} Status = -1073741823L; } } else { - goto _L___0; + goto _L; } } else { - _L___0: /* CIL Label */ + _L : /* CIL Label */ + {} + Status = 0L; + } + } else { + {} { + IoAcquireCancelSpinLock(&CancelIrql); + SyncContext.Count = &Extension->WorkQueueCount; + } + if (Extension->InterruptRefCount) { { + KeSynchronizeExecution(Extension->InterruptObject, + &PptSynchronizedIncrement, &SyncContext); + } + } else { + { PptSynchronizedIncrement(&SyncContext); } + } + if (SyncContext.NewCount) { + { + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + Status = 259L; + } + } else { + { + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } {} + Extension->WmiPortAllocFreeCounts.PortAllocates += 1UL; + if (!(Command->CommandFlags & 1UL)) { + if ((ULONG)DeviceID < Extension->PnpInfo.Ieee1284_3DeviceCount) { + i = 0; + { + while (1) { + while_85_continue: /* CIL Label */; + if ((int)i < (int)PptDot3Retries) { + if (!success) { + + } else { + goto while_85_break; + } + } else { + goto while_85_break; + } + { + success = PptSend1284_3Command( + Extension, (unsigned char)(224 | (int)DeviceID)); + KeStallExecutionProcessor(5); + i = (UCHAR)((int)i + 1); + } + } + while_85_break: /* CIL Label */; + } + if (success) { + {} + Status = 0L; + } else { + {} + Status = -1073741823L; + } + } else { + goto _L___0; + } + } else { + _L___0 : /* CIL Label */ + {} + Status = 0L; } - Status = 0L; } } } + return (Status); } - return (Status); -} } -NTSTATUS PptDeselectDevice(PVOID Context , PVOID DeselectCommand ) -{ NTSTATUS Status ; - PDEVICE_EXTENSION Extension ; - PPARALLEL_1284_COMMAND Command ; - BOOLEAN success ; - UCHAR i ; - UCHAR DeviceID ; - NTSTATUS tmp ; +NTSTATUS PptDeselectDevice(PVOID Context, PVOID DeselectCommand) { + NTSTATUS Status; + PDEVICE_EXTENSION Extension; + PPARALLEL_1284_COMMAND Command; + BOOLEAN success; + UCHAR i; + UCHAR DeviceID; + NTSTATUS tmp; { - Status = 0L; - Extension = Context; - Command = DeselectCommand; - success = 0; - { - } - if (Command->CommandFlags & 4UL) { - { - tmp = PptDeselectLegacyZip(Context, DeselectCommand); - } - return (tmp); - } else { - if ((int )Command->ID == 5) { - { - tmp = PptDeselectLegacyZip(Context, DeselectCommand); - } + Status = 0L; + Extension = Context; + Command = DeselectCommand; + success = 0; + {} + if (Command->CommandFlags & 4UL) { + { tmp = PptDeselectLegacyZip(Context, DeselectCommand); } return (tmp); } else { - + if ((int)Command->ID == 5) { + { tmp = PptDeselectLegacyZip(Context, DeselectCommand); } + return (tmp); + } else { + } } - } - DeviceID = Command->ID; - if (! (Command->CommandFlags & 1UL)) { - if ((ULONG )DeviceID > Extension->PnpInfo.Ieee1284_3DeviceCount) { - { + DeviceID = Command->ID; + if (!(Command->CommandFlags & 1UL)) { + if ((ULONG)DeviceID > Extension->PnpInfo.Ieee1284_3DeviceCount) { + {} + Status = -1073741811L; + } else { + goto _L___0; } - Status = -1073741811L; } else { - goto _L___0; - } - } else { - _L___0: /* CIL Label */ - if (! (Command->CommandFlags & 1UL)) { - if ((ULONG )DeviceID < Extension->PnpInfo.Ieee1284_3DeviceCount) { - i = 0; - { - while (1) { - while_91_continue: /* CIL Label */ ; - if ((int )i < (int )PptDot3Retries) { - if (! success) { + _L___0: /* CIL Label */ + if (!(Command->CommandFlags & 1UL)) { + if ((ULONG)DeviceID < Extension->PnpInfo.Ieee1284_3DeviceCount) { + i = 0; + { + while (1) { + while_91_continue: /* CIL Label */; + if ((int)i < (int)PptDot3Retries) { + if (!success) { - } else { - goto while_91_break; + } else { + goto while_91_break; + } + } else { + goto while_91_break; + } + { + success = PptSend1284_3Command(Extension, (unsigned char)48); + KeStallExecutionProcessor(5); + i = (UCHAR)((int)i + 1); + } } - } else { - goto while_91_break; - } - { - success = PptSend1284_3Command(Extension, (unsigned char)48); - KeStallExecutionProcessor(5); - i = (UCHAR )((int )i + 1); + while_91_break: /* CIL Label */; } - } - while_91_break: /* CIL Label */ ; - } - if (success) { - { - } - if (! (Command->CommandFlags & 2UL)) { - { - PptFreePort(Extension); + if (success) { + {} + if (!(Command->CommandFlags & 2UL)) { + { PptFreePort(Extension); } + } else { } + Status = 0L; } else { - + {} + Status = -1073741823L; } - Status = 0L; } else { - { - } - Status = -1073741823L; + goto _L; } } else { - goto _L; - } - } else { - _L: /* CIL Label */ - { - } - if (! (Command->CommandFlags & 2UL)) { - { - PptFreePort(Extension); + _L : /* CIL Label */ + {} + if (!(Command->CommandFlags & 2UL)) { + { PptFreePort(Extension); } + } else { } - } else { - + Status = 0L; } - Status = 0L; } + return (Status); } - return (Status); -} -} -ULONG Ppt1284_3AssignAddress(PDEVICE_EXTENSION DeviceExtension ) -{ UCHAR i = __VERIFIER_nondet_char() ; - UCHAR value ; - UCHAR newvalue ; - UCHAR status ; - PUCHAR CurrentPort ; - PUCHAR CurrentStatus ; - PUCHAR CurrentControl ; - ULONG Delay ; - UCHAR number ; - BOOLEAN lastdevice ; - UCHAR idx ; - UCHAR tmp ; - BOOLEAN bStlNon1284_3Found ; - BOOLEAN bStlNon1284_3Valid ; - BOOLEAN tmp___0 ; - BOOLEAN tmp___1 ; - - { - { - Delay = 5; - number = 0; - lastdevice = 0; - CurrentPort = DeviceExtension->PortInfo.Controller; - CurrentStatus = CurrentPort + 1; - CurrentControl = CurrentPort + 2; - value = READ_PORT_UCHAR(CurrentControl); - newvalue = (unsigned char )(((int )value & -9) | 4); - newvalue = (unsigned char )((int )newvalue & -33); - WRITE_PORT_UCHAR(CurrentControl, newvalue); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 184) == 184) { - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 184) == 24) { - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); +} +ULONG Ppt1284_3AssignAddress(PDEVICE_EXTENSION DeviceExtension) { + UCHAR i = __VERIFIER_nondet_char(); + UCHAR value; + UCHAR newvalue; + UCHAR status; + PUCHAR CurrentPort; + PUCHAR CurrentStatus; + PUCHAR CurrentControl; + ULONG Delay; + UCHAR number; + BOOLEAN lastdevice; + UCHAR idx; + UCHAR tmp; + BOOLEAN bStlNon1284_3Found; + BOOLEAN bStlNon1284_3Valid; + BOOLEAN tmp___0; + BOOLEAN tmp___1; + + { + { + Delay = 5; + number = 0; + lastdevice = 0; + CurrentPort = DeviceExtension->PortInfo.Controller; + CurrentStatus = CurrentPort + 1; + CurrentControl = CurrentPort + 2; + value = READ_PORT_UCHAR(CurrentControl); + newvalue = (unsigned char)(((int)value & -9) | 4); + newvalue = (unsigned char)((int)newvalue & -33); + WRITE_PORT_UCHAR(CurrentControl, newvalue); + WRITE_PORT_UCHAR(CurrentControl, (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); KeStallExecutionProcessor(Delay); status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 48) == 48) { - { + } + if (((int)status & 184) == 184) { + { + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); KeStallExecutionProcessor(Delay); - } + status = READ_PORT_UCHAR(CurrentStatus); + } + if (((int)status & 184) == 24) { { - while (1) { - while_95_continue: /* CIL Label */ ; - if ((int )number < 4) { - if (! lastdevice) { - - } else { - goto while_95_break; - } - } else { - goto while_95_break; - } - { - WRITE_PORT_UCHAR(CurrentPort, number); - number = (unsigned char )((int )number + 1); - KeStallExecutionProcessor(Delay); - tmp = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )tmp & 128) == 0) { - lastdevice = 1; - } else { - - } - { - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - } + status = READ_PORT_UCHAR(CurrentStatus); } - while_95_break: /* CIL Label */ ; - } - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); - } - if (number) { - { - bStlNon1284_3Found = PptCheckIfNon1284_3Present(DeviceExtension); - bStlNon1284_3Valid = 0; - idx = 0; - } + if (((int)status & 48) == 48) { + { KeStallExecutionProcessor(Delay); } { - while (1) { - while_96_continue: /* CIL Label */ ; - if ((int )idx < (int )number) { - - } else { - goto while_96_break; - } - { - tmp___0 = PptCheckIfStl1284_3(DeviceExtension, idx, bStlNon1284_3Found); - } - if (1 == (int )tmp___0) { - goto __Cont; - } else { + while (1) { + while_95_continue: /* CIL Label */; + if ((int)number < 4) { + if (!lastdevice) { - } - if (1 == (int )bStlNon1284_3Found) { + } else { + goto while_95_break; + } + } else { + goto while_95_break; + } { - tmp___1 = PptCheckIfStlProductId(DeviceExtension, idx); + WRITE_PORT_UCHAR(CurrentPort, number); + number = (unsigned char)((int)number + 1); + KeStallExecutionProcessor(Delay); + tmp = READ_PORT_UCHAR(CurrentStatus); } - if (1 == (int )tmp___1) { - bStlNon1284_3Valid = 1; - goto __Cont; + if (((int)tmp & 128) == 0) { + lastdevice = 1; } else { + } + { + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + } + } + while_95_break: /* CIL Label */; + } + { WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); } + if (number) { + { + bStlNon1284_3Found = PptCheckIfNon1284_3Present(DeviceExtension); + bStlNon1284_3Valid = 0; + idx = 0; + } + { + while (1) { + while_96_continue: /* CIL Label */; + if ((int)idx < (int)number) { + } else { + goto while_96_break; + } + { + tmp___0 = PptCheckIfStl1284_3(DeviceExtension, idx, + bStlNon1284_3Found); + } + if (1 == (int)tmp___0) { + goto __Cont; + } else { + } + if (1 == (int)bStlNon1284_3Found) { + { tmp___1 = PptCheckIfStlProductId(DeviceExtension, idx); } + if (1 == (int)tmp___1) { + bStlNon1284_3Valid = 1; + goto __Cont; + } else { + } + } else { + } + goto while_96_break; + __Cont: /* CIL Label */ + idx = (UCHAR)((int)idx + 1); } + while_96_break: /* CIL Label */; + } + if (1 == (int)bStlNon1284_3Valid) { + number = idx; } else { - } - goto while_96_break; - __Cont: /* CIL Label */ - idx = (UCHAR )((int )idx + 1); - } - while_96_break: /* CIL Label */ ; - } - if (1 == (int )bStlNon1284_3Valid) { - number = idx; } else { - } } else { - } } else { - } } else { - } - } else { - - } - { - WRITE_PORT_UCHAR(CurrentControl, value); + { WRITE_PORT_UCHAR(CurrentControl, value); } + return ((unsigned long)number); } - return ((unsigned long )number); -} } -BOOLEAN PptCheckIfNon1284_3Present(PDEVICE_EXTENSION Extension ) -{ BOOLEAN bReturnValue ; - UCHAR i = __VERIFIER_nondet_char() ; - UCHAR value ; - UCHAR newvalue ; - UCHAR status ; - ULONG Delay ; - PUCHAR CurrentPort ; - PUCHAR CurrentStatus ; - PUCHAR CurrentControl ; - UCHAR ucAckStatus ; +BOOLEAN PptCheckIfNon1284_3Present(PDEVICE_EXTENSION Extension) { + BOOLEAN bReturnValue; + UCHAR i = __VERIFIER_nondet_char(); + UCHAR value; + UCHAR newvalue; + UCHAR status; + ULONG Delay; + PUCHAR CurrentPort; + PUCHAR CurrentStatus; + PUCHAR CurrentControl; + UCHAR ucAckStatus; { - { - bReturnValue = 0; - Delay = 3; - CurrentPort = Extension->PortInfo.Controller; - CurrentStatus = CurrentPort + 1; - CurrentControl = CurrentPort + 2; - value = READ_PORT_UCHAR(CurrentControl); - newvalue = (unsigned char )(((int )value & -9) | 4); - newvalue = (unsigned char )((int )newvalue & -33); - WRITE_PORT_UCHAR(CurrentControl, newvalue); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 184) == 184) { { - ucAckStatus = (int )status & 64; - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); + bReturnValue = 0; + Delay = 3; + CurrentPort = Extension->PortInfo.Controller; + CurrentStatus = CurrentPort + 1; + CurrentControl = CurrentPort + 2; + value = READ_PORT_UCHAR(CurrentControl); + newvalue = (unsigned char)(((int)value & -9) | 4); + newvalue = (unsigned char)((int)newvalue & -33); + WRITE_PORT_UCHAR(CurrentControl, newvalue); + WRITE_PORT_UCHAR(CurrentControl, (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); + KeStallExecutionProcessor(Delay); + status = READ_PORT_UCHAR(CurrentStatus); } - if (((int )status & 184) == 24) { - if ((int )ucAckStatus != ((int )status & 64)) { - { - ucAckStatus = (int )status & 64; - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + if (((int)status & 184) == 184) { + { + ucAckStatus = (int)status & 64; + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); KeStallExecutionProcessor(Delay); status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 48) == 48) { - bReturnValue = 1; + } + if (((int)status & 184) == 24) { + if ((int)ucAckStatus != ((int)status & 64)) { + { + ucAckStatus = (int)status & 64; + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + KeStallExecutionProcessor(Delay); + status = READ_PORT_UCHAR(CurrentStatus); + } + if (((int)status & 48) == 48) { + bReturnValue = 1; + } else { + } } else { - } + { WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); } } else { - - } - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); } } else { - } - } else { - - } - { - WRITE_PORT_UCHAR(CurrentControl, value); + { WRITE_PORT_UCHAR(CurrentControl, value); } + return (bReturnValue); } - return (bReturnValue); -} } -BOOLEAN PptCheckIfStl1284_3(PDEVICE_EXTENSION DeviceExtension , ULONG ulDaisyIndex , - BOOLEAN bNoStrobe ) -{ BOOLEAN bReturnValue ; - UCHAR i = __VERIFIER_nondet_char() ; - UCHAR value ; - UCHAR newvalue ; - UCHAR status ; - ULONG Delay ; - UCHAR ucExpectedPattern ; - UCHAR ucReadValue ; - UCHAR ucReadPattern ; - PUCHAR CurrentPort ; - PUCHAR CurrentStatus ; - PUCHAR CurrentControl ; +BOOLEAN PptCheckIfStl1284_3(PDEVICE_EXTENSION DeviceExtension, + ULONG ulDaisyIndex, BOOLEAN bNoStrobe) { + BOOLEAN bReturnValue; + UCHAR i = __VERIFIER_nondet_char(); + UCHAR value; + UCHAR newvalue; + UCHAR status; + ULONG Delay; + UCHAR ucExpectedPattern; + UCHAR ucReadValue; + UCHAR ucReadPattern; + PUCHAR CurrentPort; + PUCHAR CurrentStatus; + PUCHAR CurrentControl; { - { - bReturnValue = 0; - Delay = 3; - CurrentPort = DeviceExtension->PortInfo.Controller; - CurrentStatus = CurrentPort + 1; - CurrentControl = CurrentPort + 2; - value = READ_PORT_UCHAR(CurrentControl); - newvalue = (unsigned char )(((int )value & -9) | 4); - newvalue = (unsigned char )((int )newvalue & -33); - WRITE_PORT_UCHAR(CurrentControl, newvalue); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 184) == 184) { { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 184) == 24) { - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + bReturnValue = 0; + Delay = 3; + CurrentPort = DeviceExtension->PortInfo.Controller; + CurrentStatus = CurrentPort + 1; + CurrentControl = CurrentPort + 2; + value = READ_PORT_UCHAR(CurrentControl); + newvalue = (unsigned char)(((int)value & -9) | 4); + newvalue = (unsigned char)((int)newvalue & -33); + WRITE_PORT_UCHAR(CurrentControl, newvalue); + WRITE_PORT_UCHAR(CurrentControl, (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); KeStallExecutionProcessor(Delay); status = READ_PORT_UCHAR(CurrentStatus); + } + if (((int)status & 184) == 184) { + { + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); + KeStallExecutionProcessor(Delay); + status = READ_PORT_UCHAR(CurrentStatus); } - if (((int )status & 48) == 48) { + if (((int)status & 184) == 24) { { - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentPort, (unsigned char )(136UL | ulDaisyIndex)); - KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + KeStallExecutionProcessor(Delay); + status = READ_PORT_UCHAR(CurrentStatus); } - if (ulDaisyIndex) { - if ((int )bNoStrobe == 0) { - { - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); + if (((int)status & 48) == 48) { + { KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); + WRITE_PORT_UCHAR(CurrentPort, + (unsigned char)(136UL | ulDaisyIndex)); KeStallExecutionProcessor(Delay); - } - } else { - } - } else { - - } - ucExpectedPattern = 240; - bReturnValue = 1; - { - while (1) { - while_97_continue: /* CIL Label */ ; - if (ucExpectedPattern) { - + if (ulDaisyIndex) { + if ((int)bNoStrobe == 0) { + { + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + } + } else { + } } else { - goto while_97_break; } + ucExpectedPattern = 240; + bReturnValue = 1; { - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentPort, (unsigned char )(128UL | ulDaisyIndex)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentPort, (unsigned char )(136UL | ulDaisyIndex)); - KeStallExecutionProcessor(Delay); - ucReadValue = READ_PORT_UCHAR(CurrentStatus); - ucReadPattern = ((int )ucReadValue << 1) & 112; - ucReadPattern = (int )ucReadPattern | ((int )ucReadValue & 128); - } - if ((int )ucReadPattern != (int )ucExpectedPattern) { - bReturnValue = 0; - goto while_97_break; - } else { + while (1) { + while_97_continue: /* CIL Label */; + if (ucExpectedPattern) { + } else { + goto while_97_break; + } + { + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, + (unsigned char)(128UL | ulDaisyIndex)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, + (unsigned char)(136UL | ulDaisyIndex)); + KeStallExecutionProcessor(Delay); + ucReadValue = READ_PORT_UCHAR(CurrentStatus); + ucReadPattern = ((int)ucReadValue << 1) & 112; + ucReadPattern = (int)ucReadPattern | ((int)ucReadValue & 128); + } + if ((int)ucReadPattern != (int)ucExpectedPattern) { + bReturnValue = 0; + goto while_97_break; + } else { + } + ucExpectedPattern = (int)ucExpectedPattern - 16; + } + while_97_break: /* CIL Label */; } - ucExpectedPattern = (int )ucExpectedPattern - 16; - } - while_97_break: /* CIL Label */ ; - } - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); + { WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); } + } else { } } else { - } } else { - - } - } else { - - } - { - WRITE_PORT_UCHAR(CurrentControl, value); - } - return (bReturnValue); -} -} -BOOLEAN PptCheckIfStlProductId(PDEVICE_EXTENSION DeviceExtension , ULONG ulDaisyIndex ) -{ BOOLEAN bReturnValue ; - UCHAR i = __VERIFIER_nondet_char() ; - UCHAR value ; - UCHAR newvalue ; - UCHAR status ; - ULONG Delay ; - UCHAR ucProdIdHiByteHiNibble ; - UCHAR ucProdIdHiByteLoNibble ; - UCHAR ucProdIdLoByteHiNibble ; - UCHAR ucProdIdLoByteLoNibble ; - UCHAR ucProdIdHiByte ; - UCHAR ucProdIdLoByte ; - USHORT usProdId ; - PUCHAR CurrentPort ; - PUCHAR CurrentStatus ; - PUCHAR CurrentControl ; - - { - { - bReturnValue = 0; - Delay = 3; - CurrentPort = DeviceExtension->PortInfo.Controller; - CurrentStatus = CurrentPort + 1; - CurrentControl = CurrentPort + 2; - value = READ_PORT_UCHAR(CurrentControl); - newvalue = (unsigned char )(((int )value & -9) | 4); - newvalue = (unsigned char )((int )newvalue & -33); - WRITE_PORT_UCHAR(CurrentControl, newvalue); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 184) == 184) { - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); } - if (((int )status & 184) == 24) { - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + { WRITE_PORT_UCHAR(CurrentControl, value); } + return (bReturnValue); + } +} +BOOLEAN PptCheckIfStlProductId(PDEVICE_EXTENSION DeviceExtension, + ULONG ulDaisyIndex) { + BOOLEAN bReturnValue; + UCHAR i = __VERIFIER_nondet_char(); + UCHAR value; + UCHAR newvalue; + UCHAR status; + ULONG Delay; + UCHAR ucProdIdHiByteHiNibble; + UCHAR ucProdIdHiByteLoNibble; + UCHAR ucProdIdLoByteHiNibble; + UCHAR ucProdIdLoByteLoNibble; + UCHAR ucProdIdHiByte; + UCHAR ucProdIdLoByte; + USHORT usProdId; + PUCHAR CurrentPort; + PUCHAR CurrentStatus; + PUCHAR CurrentControl; + + { + { + bReturnValue = 0; + Delay = 3; + CurrentPort = DeviceExtension->PortInfo.Controller; + CurrentStatus = CurrentPort + 1; + CurrentControl = CurrentPort + 2; + value = READ_PORT_UCHAR(CurrentControl); + newvalue = (unsigned char)(((int)value & -9) | 4); + newvalue = (unsigned char)((int)newvalue & -33); + WRITE_PORT_UCHAR(CurrentControl, newvalue); + WRITE_PORT_UCHAR(CurrentControl, (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); KeStallExecutionProcessor(Delay); status = READ_PORT_UCHAR(CurrentStatus); + } + if (((int)status & 184) == 184) { + { + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); + KeStallExecutionProcessor(Delay); + status = READ_PORT_UCHAR(CurrentStatus); } - if (((int )status & 48) == 48) { + if (((int)status & 184) == 24) { { - WRITE_PORT_UCHAR(CurrentPort, (unsigned char )(16UL | ulDaisyIndex)); - KeStallExecutionProcessor(Delay); - KeStallExecutionProcessor(Delay); - ucProdIdLoByteHiNibble = READ_PORT_UCHAR(CurrentStatus); - ucProdIdLoByteHiNibble = (int )ucProdIdLoByteHiNibble & 240; - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - ucProdIdLoByteLoNibble = READ_PORT_UCHAR(CurrentStatus); - ucProdIdLoByteLoNibble = (int )ucProdIdLoByteLoNibble >> 4; - ucProdIdLoByte = (int )ucProdIdLoByteHiNibble | (int )ucProdIdLoByteLoNibble; - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - ucProdIdHiByteHiNibble = READ_PORT_UCHAR(CurrentStatus); - ucProdIdHiByteHiNibble = (int )ucProdIdHiByteHiNibble & 240; - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - ucProdIdHiByteLoNibble = READ_PORT_UCHAR(CurrentStatus); - ucProdIdHiByteLoNibble = (int )ucProdIdHiByteLoNibble >> 4; - ucProdIdHiByte = (int )ucProdIdHiByteHiNibble | (int )ucProdIdHiByteLoNibble; - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - usProdId = ((int )ucProdIdHiByte << 8) | (int )ucProdIdLoByte; + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + KeStallExecutionProcessor(Delay); + status = READ_PORT_UCHAR(CurrentStatus); } - if (43775 == (int )usProdId) { - bReturnValue = 1; - } else { - if (43263 == (int )usProdId) { + if (((int)status & 48) == 48) { + { + WRITE_PORT_UCHAR(CurrentPort, (unsigned char)(16UL | ulDaisyIndex)); + KeStallExecutionProcessor(Delay); + KeStallExecutionProcessor(Delay); + ucProdIdLoByteHiNibble = READ_PORT_UCHAR(CurrentStatus); + ucProdIdLoByteHiNibble = (int)ucProdIdLoByteHiNibble & 240; + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + ucProdIdLoByteLoNibble = READ_PORT_UCHAR(CurrentStatus); + ucProdIdLoByteLoNibble = (int)ucProdIdLoByteLoNibble >> 4; + ucProdIdLoByte = + (int)ucProdIdLoByteHiNibble | (int)ucProdIdLoByteLoNibble; + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + ucProdIdHiByteHiNibble = READ_PORT_UCHAR(CurrentStatus); + ucProdIdHiByteHiNibble = (int)ucProdIdHiByteHiNibble & 240; + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + ucProdIdHiByteLoNibble = READ_PORT_UCHAR(CurrentStatus); + ucProdIdHiByteLoNibble = (int)ucProdIdHiByteLoNibble >> 4; + ucProdIdHiByte = + (int)ucProdIdHiByteHiNibble | (int)ucProdIdHiByteLoNibble; + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + usProdId = ((int)ucProdIdHiByte << 8) | (int)ucProdIdLoByte; + } + if (43775 == (int)usProdId) { bReturnValue = 1; } else { - + if (43263 == (int)usProdId) { + bReturnValue = 1; + } else { + } } - } - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); + { WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); } + } else { } } else { - } } else { - - } - } else { - - } - { - WRITE_PORT_UCHAR(CurrentControl, value); - } - return (bReturnValue); -} -} -BOOLEAN PptSend1284_3Command(PDEVICE_EXTENSION DeviceExtension , UCHAR Command ) -{ UCHAR i = __VERIFIER_nondet_char() ; - UCHAR value ; - UCHAR newvalue ; - UCHAR test ; - PUCHAR CurrentPort ; - PUCHAR CurrentStatus ; - PUCHAR CurrentControl ; - ULONG Delay ; - BOOLEAN success ; - UCHAR tmp ; - UCHAR tmp___0 ; - int tmp___3 ; - BOOLEAN tmp___4 ; - UCHAR tmp___5 ; - int tmp___8 ; - BOOLEAN tmp___9 ; - UCHAR tmp___10 ; - int tmp___13 ; - BOOLEAN tmp___14 ; - UCHAR tmp___15 ; - - { - Delay = 3; - success = 0; - CurrentPort = DeviceExtension->PortInfo.Controller; - CurrentStatus = CurrentPort + 1; - CurrentControl = CurrentPort + 2; - test = (unsigned char )((int )Command & 248); - { - } - { - value = READ_PORT_UCHAR(CurrentControl); - newvalue = (unsigned char )(((int )value & -9) | 4); - newvalue = (unsigned char )((int )newvalue & -33); - WRITE_PORT_UCHAR(CurrentControl, newvalue); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); - KeStallExecutionProcessor(Delay); - tmp___15 = READ_PORT_UCHAR(CurrentPort + 1); - } - if (((int )tmp___15 & 184) == 184) { - tmp___13 = 1; - } else { - { - tmp___14 = CheckPort(CurrentPort + 1, 184, (unsigned char)184, 5); - tmp___13 = tmp___14; } - } - if (tmp___13) { - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); - KeStallExecutionProcessor(Delay); - tmp___10 = READ_PORT_UCHAR(CurrentPort + 1); + { WRITE_PORT_UCHAR(CurrentControl, value); } + return (bReturnValue); + } +} +BOOLEAN PptSend1284_3Command(PDEVICE_EXTENSION DeviceExtension, UCHAR Command) { + UCHAR i = __VERIFIER_nondet_char(); + UCHAR value; + UCHAR newvalue; + UCHAR test; + PUCHAR CurrentPort; + PUCHAR CurrentStatus; + PUCHAR CurrentControl; + ULONG Delay; + BOOLEAN success; + UCHAR tmp; + UCHAR tmp___0; + int tmp___3; + BOOLEAN tmp___4; + UCHAR tmp___5; + int tmp___8; + BOOLEAN tmp___9; + UCHAR tmp___10; + int tmp___13; + BOOLEAN tmp___14; + UCHAR tmp___15; + + { + Delay = 3; + success = 0; + CurrentPort = DeviceExtension->PortInfo.Controller; + CurrentStatus = CurrentPort + 1; + CurrentControl = CurrentPort + 2; + test = (unsigned char)((int)Command & 248); + {} { + value = READ_PORT_UCHAR(CurrentControl); + newvalue = (unsigned char)(((int)value & -9) | 4); + newvalue = (unsigned char)((int)newvalue & -33); + WRITE_PORT_UCHAR(CurrentControl, newvalue); + WRITE_PORT_UCHAR(CurrentControl, (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); + KeStallExecutionProcessor(Delay); + tmp___15 = READ_PORT_UCHAR(CurrentPort + 1); } - if (((int )tmp___10 & 184) == 24) { - tmp___8 = 1; + if (((int)tmp___15 & 184) == 184) { + tmp___13 = 1; } else { { - tmp___9 = CheckPort(CurrentPort + 1, 184, (unsigned char)24, 5); - tmp___8 = tmp___9; + tmp___14 = CheckPort(CurrentPort + 1, 184, (unsigned char)184, 5); + tmp___13 = tmp___14; } } - if (tmp___8) { + if (tmp___13) { { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); - KeStallExecutionProcessor(Delay); - tmp___5 = READ_PORT_UCHAR(CurrentPort + 1); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); + KeStallExecutionProcessor(Delay); + tmp___10 = READ_PORT_UCHAR(CurrentPort + 1); } - if (((int )tmp___5 & 48) == 48) { - tmp___3 = 1; + if (((int)tmp___10 & 184) == 24) { + tmp___8 = 1; } else { { - tmp___4 = CheckPort(CurrentPort + 1, 48, (unsigned char)48, 5); - tmp___3 = tmp___4; + tmp___9 = CheckPort(CurrentPort + 1, 184, (unsigned char)24, 5); + tmp___8 = tmp___9; } } - if (tmp___3) { + if (tmp___8) { { - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentPort, Command); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); - KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + KeStallExecutionProcessor(Delay); + tmp___5 = READ_PORT_UCHAR(CurrentPort + 1); } - if (test == 224) { - goto switch_99_224; + if (((int)tmp___5 & 48) == 48) { + tmp___3 = 1; } else { - if (test == 48) { - goto switch_99_48; + { + tmp___4 = CheckPort(CurrentPort + 1, 48, (unsigned char)48, 5); + tmp___3 = tmp___4; + } + } + if (tmp___3) { + { + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, Command); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + } + if (test == 224) { + goto switch_99_224; } else { - { - goto switch_99_default; - if (0) { - switch_99_224: /* CIL Label */ ; - { - } - { - tmp = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )tmp & 8) == 8) { - success = 1; - { - } - } else { - - } - if (! success) { - { - } - } else { - - } - goto switch_99_break; - switch_99_48: /* CIL Label */ + if (test == 48) { + goto switch_99_48; + } else { { - tmp___0 = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )tmp___0 & 8) != 8) { - success = 1; + goto switch_99_default; + if (0) { + switch_99_224: /* CIL Label */; + {} { tmp = READ_PORT_UCHAR(CurrentStatus); } + if (((int)tmp & 8) == 8) { + success = 1; + {} + } else { + } + if (!success) { + {} + } else { + } + goto switch_99_break; + switch_99_48 : /* CIL Label */ { + tmp___0 = READ_PORT_UCHAR(CurrentStatus); } - } else { - - } - if (! success) { - { + if (((int)tmp___0 & 8) != 8) { + success = 1; + {} + } else { + } + if (!success) { + {} + } else { + } + goto switch_99_break; + switch_99_default: /* CIL Label */; + {} { + KeStallExecutionProcessor(Delay); + success = 1; + } + goto switch_99_break; + } else { + switch_99_break: /* CIL Label */; } - } else { - - } - goto switch_99_break; - switch_99_default: /* CIL Label */ ; - { } - { - KeStallExecutionProcessor(Delay); - success = 1; - } - goto switch_99_break; - } else { - switch_99_break: /* CIL Label */ ; - } } } - } - { - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); + { + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); + } + } else { } } else { - } } else { - } - } else { - - } - { - WRITE_PORT_UCHAR(CurrentControl, value); + { WRITE_PORT_UCHAR(CurrentControl, value); } + return (success); } - return (success); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -NTSTATUS PptDetectPortCapabilities(PDEVICE_EXTENSION Extension ) ; -void PptDetectEcpPort(PDEVICE_EXTENSION Extension ) ; -void PptDetectEppPortIfDot3DevicePresent(PDEVICE_EXTENSION Extension ) ; -void PptDetectEppPortIfUserRequested(PDEVICE_EXTENSION Extension ) ; -void PptDetectBytePort(PDEVICE_EXTENSION Extension ) ; -void PptDetermineFifoDepth(PDEVICE_EXTENSION Extension ) ; -void PptDetermineFifoWidth(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptEcrSetMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) ; -NTSTATUS PptEcrClearMode(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptFindNatChip(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptBuildResourceList(PDEVICE_EXTENSION Extension , ULONG Partial , PULONG Addresses , - PCM_RESOURCE_LIST Resources ) ; -NTSTATUS PptSetByteMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) ; -NTSTATUS PptClearByteMode(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptCheckByteMode(PDEVICE_EXTENSION Extension ) ; -int Extension_FilterMode = 0; -NTSTATUS PptDetectChipFilter(PDEVICE_EXTENSION Extension ) -{ NTSTATUS Status ; - KEVENT Event ; - UCHAR ecrLast ; - PUCHAR Controller ; - PUCHAR EcpController ; - PUCHAR wPortECR ; - - { - Status = -1073741810L; - Controller = Extension->PortInfo.Controller; - EcpController = Extension->PnpInfo.EcpController; - { - } - { - Extension->ChipInfo.success = 0; - Extension->ChipInfo.Controller = Controller; - Extension->ChipInfo.EcrController = EcpController; -/* KeInitializeEvent(& Event, 0, 0); */ /* INLINED */ - } - if (Extension_FilterMode) { - if (Extension->PnpInfo.HardwareCapabilities & 1UL) { - { - } - { - Status = (*(Extension->ChipInfo.ParChipSetMode))(Extension->ChipInfo.Context, - 96); - } - if (Status >= 0L) { - { +NTSTATUS PptDetectPortCapabilities(PDEVICE_EXTENSION Extension); +void PptDetectEcpPort(PDEVICE_EXTENSION Extension); +void PptDetectEppPortIfDot3DevicePresent(PDEVICE_EXTENSION Extension); +void PptDetectEppPortIfUserRequested(PDEVICE_EXTENSION Extension); +void PptDetectBytePort(PDEVICE_EXTENSION Extension); +void PptDetermineFifoDepth(PDEVICE_EXTENSION Extension); +void PptDetermineFifoWidth(PDEVICE_EXTENSION Extension); +NTSTATUS PptEcrSetMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode); +NTSTATUS PptEcrClearMode(PDEVICE_EXTENSION Extension); +NTSTATUS PptFindNatChip(PDEVICE_EXTENSION Extension); +NTSTATUS PptBuildResourceList(PDEVICE_EXTENSION Extension, ULONG Partial, + PULONG Addresses, PCM_RESOURCE_LIST Resources); +NTSTATUS PptSetByteMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode); +NTSTATUS PptClearByteMode(PDEVICE_EXTENSION Extension); +NTSTATUS PptCheckByteMode(PDEVICE_EXTENSION Extension); +int Extension_FilterMode = 0; +NTSTATUS PptDetectChipFilter(PDEVICE_EXTENSION Extension) { + NTSTATUS Status; + KEVENT Event; + UCHAR ecrLast; + PUCHAR Controller; + PUCHAR EcpController; + PUCHAR wPortECR; + + { + Status = -1073741810L; + Controller = Extension->PortInfo.Controller; + EcpController = Extension->PnpInfo.EcpController; + {} { + Extension->ChipInfo.success = 0; + Extension->ChipInfo.Controller = Controller; + Extension->ChipInfo.EcrController = EcpController; + /* KeInitializeEvent(& Event, 0, 0); */ /* INLINED */ + } + if (Extension_FilterMode) { + if (Extension->PnpInfo.HardwareCapabilities & 1UL) { + {} { + Status = (*(Extension->ChipInfo.ParChipSetMode))( + Extension->ChipInfo.Context, 96); } - { - wPortECR = EcpController + 2; - ecrLast = READ_PORT_UCHAR(wPortECR); - PptDetermineFifoWidth(Extension); - PptDetermineFifoDepth(Extension); - WRITE_PORT_UCHAR(wPortECR, ecrLast); - Status = (*(Extension->ChipInfo.ParChipClearMode))(Extension->ChipInfo.Context, - 96); + if (Status >= 0L) { + {} { + wPortECR = EcpController + 2; + ecrLast = READ_PORT_UCHAR(wPortECR); + PptDetermineFifoWidth(Extension); + PptDetermineFifoDepth(Extension); + WRITE_PORT_UCHAR(wPortECR, ecrLast); + Status = (*(Extension->ChipInfo.ParChipClearMode))( + Extension->ChipInfo.Context, 96); + } + } else { } } else { - } } else { - } - } else { - - } - { + {} + return (Status); } - return (Status); -} } -NTSTATUS PptDetectPortType(PDEVICE_EXTENSION Extension ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - NTSTATUS Status ; - UNICODE_STRING ParportPath ; - RTL_QUERY_REGISTRY_TABLE RegTable[2] ; - ULONG IdentifierHex ; - ULONG zero ; - - { - IdentifierHex = 12169; - zero = 0; - { - } - { - memset(RegTable, 0, sizeof(RegTable)); - RegTable[0].Flags = 36; - RegTable[0].EntryContext = & IdentifierHex; - RegTable[0].DefaultType = 4; - RegTable[0].DefaultData = & zero; - RegTable[0].DefaultLength = sizeof(ULONG ); - Status = RtlQueryRegistryValues(1, ParportPath.Buffer, RegTable, (void *)0, (void *)0); - } - { - } - { - } - if (Status >= 0L) { - if (IdentifierHex == 0UL) { - - } else { - goto _L; +NTSTATUS PptDetectPortType(PDEVICE_EXTENSION Extension) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + NTSTATUS Status; + UNICODE_STRING ParportPath; + RTL_QUERY_REGISTRY_TABLE RegTable[2]; + ULONG IdentifierHex; + ULONG zero; + + { + IdentifierHex = 12169; + zero = 0; + {} { + memset(RegTable, 0, sizeof(RegTable)); + RegTable[0].Flags = 36; + RegTable[0].EntryContext = &IdentifierHex; + RegTable[0].DefaultType = 4; + RegTable[0].DefaultData = &zero; + RegTable[0].DefaultLength = sizeof(ULONG); + Status = RtlQueryRegistryValues(1, ParportPath.Buffer, RegTable, + (void *)0, (void *)0); } - } else { - _L: /* CIL Label */ - if (Status != -1073741772L) { - { - } - { - } - { - PptDetectEcpPort(Extension); - PptDetectBytePort(Extension); + {} {} + if (Status >= 0L) { + if (IdentifierHex == 0UL) { + + } else { + goto _L; } - if (Extension->PnpInfo.HardwareCapabilities & 9UL) { - return (0L); + } else { + _L: /* CIL Label */ + if (Status != -1073741772L) { + {} {} { + PptDetectEcpPort(Extension); + PptDetectBytePort(Extension); + } + if (Extension->PnpInfo.HardwareCapabilities & 9UL) { + return (0L); + } else { + return (-1073741810L); + } } else { - return (-1073741810L); } + } + IdentifierHex = 12169; + if (__BLAST_NONDET) { + Status = 0L; } else { - + Status = 3221225473UL; } - } - IdentifierHex = 12169; - if (__BLAST_NONDET) { + {} { Status = PptDetectPortCapabilities(Extension); } + {} Status = 0L; - } else { - Status = 3221225473UL; - } - { - } - { - Status = PptDetectPortCapabilities(Extension); - } - { - } - Status = 0L; - { + {} + return (Status); } - return (Status); -} } -NTSTATUS PptDetectPortCapabilities(PDEVICE_EXTENSION Extension ) -{ NTSTATUS Status ; +NTSTATUS PptDetectPortCapabilities(PDEVICE_EXTENSION Extension) { + NTSTATUS Status; { - { - } - { - } - { - PptDetectEcpPort(Extension); - } - if (Extension->PnpInfo.HardwareCapabilities & 1UL) { - if (((unsigned long )Extension->PortInfo.Controller & 15UL) != 12UL) { - { - } - { - Status = PptFindNatChip(Extension); - } - if (Status >= 0L) { - if (! Extension->NationalChipFound) { - { - } - { - } - { - PptDetectEppPortIfDot3DevicePresent(Extension); - } - if (! Extension->CheckedForGenericEpp) { - { - PptDetectEppPortIfUserRequested(Extension); + {} {} { PptDetectEcpPort(Extension); } + if (Extension->PnpInfo.HardwareCapabilities & 1UL) { + if (((unsigned long)Extension->PortInfo.Controller & 15UL) != 12UL) { + {} { Status = PptFindNatChip(Extension); } + if (Status >= 0L) { + if (!Extension->NationalChipFound) { + {} {} { PptDetectEppPortIfDot3DevicePresent(Extension); } + if (!Extension->CheckedForGenericEpp) { + { PptDetectEppPortIfUserRequested(Extension); } + } else { } } else { - + {} + Extension->CheckedForGenericEpp = 1; } } else { - { - } - Extension->CheckedForGenericEpp = 1; } } else { - + goto _L; } } else { - goto _L; - } - } else { - _L: /* CIL Label */ - { + _L : /* CIL Label */ + {} + Extension->CheckedForGenericEpp = 1; } - Extension->CheckedForGenericEpp = 1; - } - { - } - { - PptDetectBytePort(Extension); - } - if (Extension->PnpInfo.HardwareCapabilities & 11UL) { - { + {} { PptDetectBytePort(Extension); } + if (Extension->PnpInfo.HardwareCapabilities & 11UL) { + {} + return (0L); + } else { } - return (0L); - } else { - - } - { + {} + return (-1073741810L); } - return (-1073741810L); -} } -void PptDetectEcpPort(PDEVICE_EXTENSION Extension ) -{ PUCHAR Controller ; - PUCHAR wPortDCR ; - PUCHAR wPortECR ; - UCHAR ecrLast ; - UCHAR ecr ; - UCHAR dcr ; +void PptDetectEcpPort(PDEVICE_EXTENSION Extension) { + PUCHAR Controller; + PUCHAR wPortDCR; + PUCHAR wPortECR; + UCHAR ecrLast; + UCHAR ecr; + UCHAR dcr; { - Controller = Extension->PortInfo.Controller; - wPortDCR = Controller + 2; - if ((unsigned int )((PUCHAR )0) == (unsigned int )Extension->PnpInfo.EcpController) { - { + Controller = Extension->PortInfo.Controller; + wPortDCR = Controller + 2; + if ((unsigned int)((PUCHAR)0) == + (unsigned int)Extension->PnpInfo.EcpController) { + {} + return; + } else { } - return; - } else { - - } - wPortECR = Extension->PnpInfo.EcpController + 2; - { - } - { - } - { - ecr = READ_PORT_UCHAR(wPortECR); - ecrLast = ecr; - } - { - } - { - dcr = (unsigned char)14; - WRITE_PORT_UCHAR(wPortDCR, dcr); - ecr = READ_PORT_UCHAR(wPortECR); - ecrLast = ecr; - } - { - } - if (((int )ecr & 3) == 3) { - goto _L; - } else { - if ((int )ecrLast == 255) { - _L: /* CIL Label */ - { + wPortECR = Extension->PnpInfo.EcpController + 2; + {} {} { + ecr = READ_PORT_UCHAR(wPortECR); + ecrLast = ecr; + } + {} { + dcr = (unsigned char)14; + WRITE_PORT_UCHAR(wPortDCR, dcr); + ecr = READ_PORT_UCHAR(wPortECR); + ecrLast = ecr; + } + {} + if (((int)ecr & 3) == 3) { + goto _L; + } else { + if ((int)ecrLast == 255) { + _L : /* CIL Label */ + {} + { + dcr = (unsigned char)12; + WRITE_PORT_UCHAR(wPortDCR, dcr); + } + return; + } else { } + } + if (((int)ecr & 3) == 2) { { - dcr = (unsigned char)12; - WRITE_PORT_UCHAR(wPortDCR, dcr); + dcr = (unsigned char)12; + WRITE_PORT_UCHAR(wPortDCR, dcr); + ecr = READ_PORT_UCHAR(wPortECR); + } + if (((int)ecr & 3) == 0) { + {} { + dcr = (unsigned char)12; + WRITE_PORT_UCHAR(wPortDCR, dcr); + } + return; + } else { } - return; } else { - } - } - if (((int )ecr & 3) == 2) { { - dcr = (unsigned char)12; - WRITE_PORT_UCHAR(wPortDCR, dcr); - ecr = READ_PORT_UCHAR(wPortECR); + WRITE_PORT_UCHAR(wPortECR, 20); + ecr = READ_PORT_UCHAR(wPortECR); } - if (((int )ecr & 3) == 0) { - { - } - { - dcr = (unsigned char)12; - WRITE_PORT_UCHAR(wPortDCR, dcr); + if (!(((int)ecr & 3) == 1)) { + {} { + dcr = (unsigned char)12; + WRITE_PORT_UCHAR(wPortDCR, dcr); } return; } else { - } - } else { - - } - { - WRITE_PORT_UCHAR(wPortECR, 20); - ecr = READ_PORT_UCHAR(wPortECR); - } - if (! (((int )ecr & 3) == 1)) { { + WRITE_PORT_UCHAR(wPortECR, ecrLast); + ecrLast = READ_PORT_UCHAR(wPortECR); + ecr = (unsigned char)((int)ecrLast & 31); + WRITE_PORT_UCHAR(wPortECR, (unsigned char)((int)ecr | 192)); + PptDetermineFifoWidth(Extension); } - { - dcr = (unsigned char)12; - WRITE_PORT_UCHAR(wPortDCR, dcr); + if (0UL != Extension->PnpInfo.FifoWidth) { + { + Extension->PnpInfo.HardwareCapabilities |= 1UL; + PptDetermineFifoDepth(Extension); + } + {} + } else { } + { WRITE_PORT_UCHAR(wPortECR, ecrLast); } return; - } else { - } +} +void PptDetectEppPortIfDot3DevicePresent(PDEVICE_EXTENSION Extension) { + NTSTATUS status; + PUCHAR Controller; + UCHAR Reverse; + UCHAR Forward; + BOOLEAN daisyChainDevicePresent; + PARALLEL_1284_COMMAND Command; + { - WRITE_PORT_UCHAR(wPortECR, ecrLast); - ecrLast = READ_PORT_UCHAR(wPortECR); - ecr = (unsigned char )((int )ecrLast & 31); - WRITE_PORT_UCHAR(wPortECR, (unsigned char )((int )ecr | 192)); - PptDetermineFifoWidth(Extension); - } - if (0UL != Extension->PnpInfo.FifoWidth) { + Controller = Extension->PortInfo.Controller; + Reverse = (unsigned char)38; + Forward = (unsigned char)6; + daisyChainDevicePresent = 0; + if (0UL == Extension->PnpInfo.Ieee1284_3DeviceCount) { + {} + return; + } else { + } { - Extension->PnpInfo.HardwareCapabilities |= 1UL; - PptDetermineFifoDepth(Extension); + Command.ID = 0; + Command.Port = 0; + Command.CommandFlags = 2UL; + status = PptTrySelectDevice(Extension, &Command); + } + if (!(status >= 0L)) { + {} + return; + } else { } { + PptDetectEppPort(Extension); + Command.ID = 0; + Command.Port = 0; + Command.CommandFlags = 2UL; + status = PptDeselectDevice(Extension, &Command); } - } else { - - } - { - WRITE_PORT_UCHAR(wPortECR, ecrLast); + if (!(status >= 0L)) { + {} + } else { + {} + } + return; } - return; -} } -void PptDetectEppPortIfDot3DevicePresent(PDEVICE_EXTENSION Extension ) -{ NTSTATUS status ; - PUCHAR Controller ; - UCHAR Reverse ; - UCHAR Forward ; - BOOLEAN daisyChainDevicePresent ; - PARALLEL_1284_COMMAND Command ; +void PptDetectEppPortIfUserRequested(PDEVICE_EXTENSION Extension) { + ULONG RequestEppTest; { - Controller = Extension->PortInfo.Controller; - Reverse = (unsigned char)38; - Forward = (unsigned char)6; - daisyChainDevicePresent = 0; - if (0UL == Extension->PnpInfo.Ieee1284_3DeviceCount) { - { + RequestEppTest = 0; + if (RequestEppTest) { + { PptDetectEppPort(Extension); } + } else { } return; - } else { - - } - { - Command.ID = 0; - Command.Port = 0; - Command.CommandFlags = 2UL; - status = PptTrySelectDevice(Extension, & Command); } - if (! (status >= 0L)) { - { - } - return; - } else { +} +void PptDetectEppPort(PDEVICE_EXTENSION Extension) { + PUCHAR Controller; + UCHAR dcr; + UCHAR i = __VERIFIER_nondet_char(); + UCHAR Reverse; + UCHAR Forward; + BOOLEAN daisyChainDevicePresent; + ULONG DisableEppTest; + UCHAR tmp; - } { - PptDetectEppPort(Extension); - Command.ID = 0; - Command.Port = 0; - Command.CommandFlags = 2UL; - status = PptDeselectDevice(Extension, & Command); - } - if (! (status >= 0L)) { - { + Reverse = (unsigned char)38; + Forward = (unsigned char)6; + daisyChainDevicePresent = 0; + DisableEppTest = 0; + {} { + Controller = Extension->PortInfo.Controller; + dcr = READ_PORT_UCHAR(Controller + 2); + Extension->PnpInfo.HardwareCapabilities |= 2UL; } - } else { - { + {} { + PptEcrSetMode(Extension, 148); + WRITE_PORT_UCHAR(Controller + 2, Reverse); + KeStallExecutionProcessor(5); + WRITE_PORT_UCHAR(Controller + 4, i); + WRITE_PORT_UCHAR(Controller + 2, Forward); + KeStallExecutionProcessor(5); + tmp = READ_PORT_UCHAR(Controller); } - } - return; -} -} -void PptDetectEppPortIfUserRequested(PDEVICE_EXTENSION Extension ) -{ ULONG RequestEppTest ; - - { - RequestEppTest = 0; - if (RequestEppTest) { - { - PptDetectEppPort(Extension); + if ((int)tmp != (int)i) { + Extension->PnpInfo.HardwareCapabilities &= 4294967293UL; + } else { } - } else { - - } - return; -} -} -void PptDetectEppPort(PDEVICE_EXTENSION Extension ) -{ PUCHAR Controller ; - UCHAR dcr ; - UCHAR i = __VERIFIER_nondet_char() ; - UCHAR Reverse ; - UCHAR Forward ; - BOOLEAN daisyChainDevicePresent ; - ULONG DisableEppTest ; - UCHAR tmp ; - - { - Reverse = (unsigned char)38; - Forward = (unsigned char)6; - daisyChainDevicePresent = 0; - DisableEppTest = 0; - { - } - { - Controller = Extension->PortInfo.Controller; - dcr = READ_PORT_UCHAR(Controller + 2); - Extension->PnpInfo.HardwareCapabilities |= 2UL; - } - { - } - { - PptEcrSetMode(Extension, 148); - WRITE_PORT_UCHAR(Controller + 2, Reverse); - KeStallExecutionProcessor(5); - WRITE_PORT_UCHAR(Controller + 4, i); - WRITE_PORT_UCHAR(Controller + 2, Forward); - KeStallExecutionProcessor(5); - tmp = READ_PORT_UCHAR(Controller); - } - if ((int )tmp != (int )i) { - Extension->PnpInfo.HardwareCapabilities &= 4294967293UL; - } else { - - } - { - PptEcrClearMode(Extension); - WRITE_PORT_UCHAR(Controller + 2, dcr); - Extension->CheckedForGenericEpp = 1; - } - if (Extension->PnpInfo.HardwareCapabilities & 2UL) { { + PptEcrClearMode(Extension); + WRITE_PORT_UCHAR(Controller + 2, dcr); + Extension->CheckedForGenericEpp = 1; } - } else { - { + if (Extension->PnpInfo.HardwareCapabilities & 2UL) { + {} + } else { + {} } + return; } - return; -} } -void PptDetectBytePort(PDEVICE_EXTENSION Extension ) -{ NTSTATUS Status ; +void PptDetectBytePort(PDEVICE_EXTENSION Extension) { + NTSTATUS Status; { - Status = 0L; - { - } - { - Status = PptSetByteMode(Extension, 52); - } - if (Status >= 0L) { - { - } - Extension->PnpInfo.HardwareCapabilities |= 8UL; - } else { - { + Status = 0L; + {} { Status = PptSetByteMode(Extension, 52); } + if (Status >= 0L) { + {} + Extension->PnpInfo.HardwareCapabilities |= 8UL; + } else { + {} } + { PptClearByteMode(Extension); } + return; } - { - PptClearByteMode(Extension); - } - return; } -} -void PptDetermineFifoDepth(PDEVICE_EXTENSION Extension ) -{ PUCHAR Controller ; - PUCHAR wPortECR ; - PUCHAR wPortDFIFO ; - UCHAR ecr ; - UCHAR ecrLast ; - ULONG wFifoDepth ; - UCHAR writeFifoDepth ; - UCHAR readFifoDepth ; - ULONG limitCount ; - UCHAR testData ; - UCHAR tmp ; - UCHAR tmp___0 ; - - { - { - Controller = Extension->PortInfo.Controller; - wPortECR = Extension->PnpInfo.EcpController + 2; - wPortDFIFO = Extension->PnpInfo.EcpController; - wFifoDepth = 0; - ecrLast = READ_PORT_UCHAR(wPortECR); - WRITE_PORT_UCHAR(wPortECR, 212); - ecr = READ_PORT_UCHAR(wPortECR); - } - if (((int )ecr & 3) == 1) { - writeFifoDepth = 0; - limitCount = 0; - { - while (1) { - while_148_continue: /* CIL Label */ ; +void PptDetermineFifoDepth(PDEVICE_EXTENSION Extension) { + PUCHAR Controller; + PUCHAR wPortECR; + PUCHAR wPortDFIFO; + UCHAR ecr; + UCHAR ecrLast; + ULONG wFifoDepth; + UCHAR writeFifoDepth; + UCHAR readFifoDepth; + ULONG limitCount; + UCHAR testData; + UCHAR tmp; + UCHAR tmp___0; + + { + { + Controller = Extension->PortInfo.Controller; + wPortECR = Extension->PnpInfo.EcpController + 2; + wPortDFIFO = Extension->PnpInfo.EcpController; + wFifoDepth = 0; + ecrLast = READ_PORT_UCHAR(wPortECR); + WRITE_PORT_UCHAR(wPortECR, 212); + ecr = READ_PORT_UCHAR(wPortECR); + } + if (((int)ecr & 3) == 1) { + writeFifoDepth = 0; + limitCount = 0; { - tmp = READ_PORT_UCHAR(wPortECR); - } - if (((int )tmp & 3) != 2) { - if (limitCount <= 4098UL) { + while (1) { + while_148_continue: /* CIL Label */; + { tmp = READ_PORT_UCHAR(wPortECR); } + if (((int)tmp & 3) != 2) { + if (limitCount <= 4098UL) { - } else { - goto while_148_break; + } else { + goto while_148_break; + } + } else { + goto while_148_break; + } + { + WRITE_PORT_UCHAR(wPortDFIFO, + (unsigned char)((int)writeFifoDepth & 255)); + writeFifoDepth = (UCHAR)((int)writeFifoDepth + 1); + limitCount += 1UL; + } } - } else { - goto while_148_break; + while_148_break: /* CIL Label */; } + {} + readFifoDepth = 0; + limitCount = 0; { - WRITE_PORT_UCHAR(wPortDFIFO, (unsigned char )((int )writeFifoDepth & 255)); - writeFifoDepth = (UCHAR )((int )writeFifoDepth + 1); - limitCount += 1UL; - } - } - while_148_break: /* CIL Label */ ; - } - { - } - readFifoDepth = 0; - limitCount = 0; - { - while (1) { - while_150_continue: /* CIL Label */ ; - { - tmp___0 = READ_PORT_UCHAR(wPortECR); - } - if (((int )tmp___0 & 3) != 1) { - if (limitCount <= 4098UL) { + while (1) { + while_150_continue: /* CIL Label */; + { tmp___0 = READ_PORT_UCHAR(wPortECR); } + if (((int)tmp___0 & 3) != 1) { + if (limitCount <= 4098UL) { - } else { - goto while_150_break; + } else { + goto while_150_break; + } + } else { + goto while_150_break; + } + { testData = READ_PORT_UCHAR(wPortDFIFO); } + if ((int)testData != ((int)readFifoDepth & 255)) { + { WRITE_PORT_UCHAR(wPortECR, ecrLast); } + {} + return; + } else { + } + readFifoDepth = (UCHAR)((int)readFifoDepth + 1); + limitCount += 1UL; } - } else { - goto while_150_break; - } - { - testData = READ_PORT_UCHAR(wPortDFIFO); + while_150_break: /* CIL Label */; } - if ((int )testData != ((int )readFifoDepth & 255)) { - { - WRITE_PORT_UCHAR(wPortECR, ecrLast); - } - { - } - return; + {} + if ((int)writeFifoDepth == (int)readFifoDepth) { + wFifoDepth = readFifoDepth; } else { - + { WRITE_PORT_UCHAR(wPortECR, ecrLast); } + {} + return; } - readFifoDepth = (UCHAR )((int )readFifoDepth + 1); - limitCount += 1UL; - } - while_150_break: /* CIL Label */ ; - } - { - } - if ((int )writeFifoDepth == (int )readFifoDepth) { - wFifoDepth = readFifoDepth; } else { - { - WRITE_PORT_UCHAR(wPortECR, ecrLast); - } - { - } + {} { WRITE_PORT_UCHAR(wPortECR, ecrLast); } return; } - } else { - { - } { - WRITE_PORT_UCHAR(wPortECR, ecrLast); + WRITE_PORT_UCHAR(wPortECR, ecrLast); + Extension->PnpInfo.FifoDepth = wFifoDepth; } return; } - { - WRITE_PORT_UCHAR(wPortECR, ecrLast); - Extension->PnpInfo.FifoDepth = wFifoDepth; - } - return; } -} -void PptDetermineFifoWidth(PDEVICE_EXTENSION Extension ) -{ PUCHAR Controller ; - UCHAR bConfigA ; - PUCHAR wPortECR ; +void PptDetermineFifoWidth(PDEVICE_EXTENSION Extension) { + PUCHAR Controller; + UCHAR bConfigA; + PUCHAR wPortECR; { - { - } - { - Controller = Extension->PortInfo.Controller; - wPortECR = Extension->PnpInfo.EcpController + 2; - WRITE_PORT_UCHAR(wPortECR, 244); - bConfigA = READ_PORT_UCHAR(Extension->PnpInfo.EcpController); - Extension->PnpInfo.FifoWidth = (unsigned long )(((int )bConfigA & 112) >> 4); - WRITE_PORT_UCHAR(wPortECR, 20); + {} { + Controller = Extension->PortInfo.Controller; + wPortECR = Extension->PnpInfo.EcpController + 2; + WRITE_PORT_UCHAR(wPortECR, 244); + bConfigA = READ_PORT_UCHAR(Extension->PnpInfo.EcpController); + Extension->PnpInfo.FifoWidth = + (unsigned long)(((int)bConfigA & 112) >> 4); + WRITE_PORT_UCHAR(wPortECR, 20); + } + return; } - return; } -} -NTSTATUS PptSetChipMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) -{ NTSTATUS Status ; - UCHAR EcrMode ; +NTSTATUS PptSetChipMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode) { + NTSTATUS Status; + UCHAR EcrMode; { - Status = 0L; - EcrMode = (unsigned char )((int )ChipMode & -32); - { - } - if (Extension->PnpInfo.CurrentMode != 0UL) { - { - } - Status = -1073741436L; - goto ExitSetChipModeNoChange; - } else { - - } - if (Extension_FilterMode) { - { - } - { - Status = (*(Extension->ChipInfo.ParChipSetMode))(Extension->ChipInfo.Context, - ChipMode); - } - } else { - { + Status = 0L; + EcrMode = (unsigned char)((int)ChipMode & -32); + {} + if (Extension->PnpInfo.CurrentMode != 0UL) { + {} + Status = -1073741436L; + goto ExitSetChipModeNoChange; + } else { } - if ((int )EcrMode == 96) { - if ((Extension->PnpInfo.HardwareCapabilities & 1UL) ^ 1UL) { - { - } - return (-1073741810L); - } else { - + if (Extension_FilterMode) { + {} { + Status = (*(Extension->ChipInfo.ParChipSetMode))( + Extension->ChipInfo.Context, ChipMode); } - { - Status = PptEcrSetMode(Extension, ChipMode); - } - goto ExitSetChipModeWithChanges; } else { - - } - if ((int )EcrMode == 128) { - if ((Extension->PnpInfo.HardwareCapabilities & 2UL) ^ 2UL) { - { + {} + if ((int)EcrMode == 96) { + if ((Extension->PnpInfo.HardwareCapabilities & 1UL) ^ 1UL) { + {} + return (-1073741810L); + } else { } - return (-1073741810L); + { Status = PptEcrSetMode(Extension, ChipMode); } + goto ExitSetChipModeWithChanges; } else { - - } - { - Status = PptEcrSetMode(Extension, ChipMode); } - goto ExitSetChipModeWithChanges; - } else { - - } - if ((int )EcrMode == 32) { - if ((Extension->PnpInfo.HardwareCapabilities & 8UL) ^ 8UL) { - { + if ((int)EcrMode == 128) { + if ((Extension->PnpInfo.HardwareCapabilities & 2UL) ^ 2UL) { + {} + return (-1073741810L); + } else { } - return (-1073741810L); + { Status = PptEcrSetMode(Extension, ChipMode); } + goto ExitSetChipModeWithChanges; } else { - } - { - Status = PptSetByteMode(Extension, ChipMode); + if ((int)EcrMode == 32) { + if ((Extension->PnpInfo.HardwareCapabilities & 8UL) ^ 8UL) { + {} + return (-1073741810L); + } else { + } + { Status = PptSetByteMode(Extension, ChipMode); } + goto ExitSetChipModeWithChanges; + } else { } - goto ExitSetChipModeWithChanges; - } else { - - } - } - ExitSetChipModeWithChanges: - if (Status >= 0L) { - { } - Extension->PnpInfo.CurrentMode = EcrMode; - } else { - { + ExitSetChipModeWithChanges: + if (Status >= 0L) { + {} + Extension->PnpInfo.CurrentMode = EcrMode; + } else { + {} } + ExitSetChipModeNoChange : {} + return (Status); } - ExitSetChipModeNoChange: - { - } - return (Status); -} } -NTSTATUS PptClearChipMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) -{ NTSTATUS Status ; - ULONG EcrMode ; +NTSTATUS PptClearChipMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode) { + NTSTATUS Status; + ULONG EcrMode; { - Status = -1073741823L; - EcrMode = (int )ChipMode & -32; - { - } - if (EcrMode != Extension->PnpInfo.CurrentMode) { - { - } - Status = -1073741436L; - goto ExitClearChipModeNoChange; - } else { - - } - if (Extension_FilterMode) { - { - } - { - Status = (*(Extension->ChipInfo.ParChipClearMode))(Extension->ChipInfo.Context, - ChipMode); - } - } else { - { - } - if (EcrMode == 96UL) { - { - Status = PptEcrClearMode(Extension); - } - goto ExitClearChipModeWithChanges; + Status = -1073741823L; + EcrMode = (int)ChipMode & -32; + {} + if (EcrMode != Extension->PnpInfo.CurrentMode) { + {} + Status = -1073741436L; + goto ExitClearChipModeNoChange; } else { - } - if (EcrMode == 128UL) { - { - Status = PptEcrClearMode(Extension); + if (Extension_FilterMode) { + {} { + Status = (*(Extension->ChipInfo.ParChipClearMode))( + Extension->ChipInfo.Context, ChipMode); } - goto ExitClearChipModeWithChanges; } else { - - } - if (EcrMode == 32UL) { - { - Status = PptClearByteMode(Extension); + {} + if (EcrMode == 96UL) { + { Status = PptEcrClearMode(Extension); } + goto ExitClearChipModeWithChanges; + } else { + } + if (EcrMode == 128UL) { + { Status = PptEcrClearMode(Extension); } + goto ExitClearChipModeWithChanges; + } else { + } + if (EcrMode == 32UL) { + { Status = PptClearByteMode(Extension); } + goto ExitClearChipModeWithChanges; + } else { } - goto ExitClearChipModeWithChanges; - } else { - } - } - ExitClearChipModeWithChanges: - if (Status >= 0L) { - { + ExitClearChipModeWithChanges: + if (Status >= 0L) { + {} + Extension->PnpInfo.CurrentMode = 0; + } else { } - Extension->PnpInfo.CurrentMode = 0; - } else { - - } - ExitClearChipModeNoChange: - { + ExitClearChipModeNoChange : {} + return (Status); } - return (Status); -} } -NTSTATUS PptEcrSetMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) -{ UCHAR ecr ; - PUCHAR Controller ; - PUCHAR wPortECR ; +NTSTATUS PptEcrSetMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode) { + UCHAR ecr; + PUCHAR Controller; + PUCHAR wPortECR; { - { - } - Controller = Extension->PortInfo.Controller; - wPortECR = Extension->PnpInfo.EcpController + 2; - { - } - { - ecr = READ_PORT_UCHAR(wPortECR); - Extension->EcrPortData = ecr; - ecr = (int )ecr & 31; - WRITE_PORT_UCHAR(wPortECR, (unsigned char )((int )ecr | 32)); - WRITE_PORT_UCHAR(wPortECR, ChipMode); - } - { + {} + Controller = Extension->PortInfo.Controller; + wPortECR = Extension->PnpInfo.EcpController + 2; + {} { + ecr = READ_PORT_UCHAR(wPortECR); + Extension->EcrPortData = ecr; + ecr = (int)ecr & 31; + WRITE_PORT_UCHAR(wPortECR, (unsigned char)((int)ecr | 32)); + WRITE_PORT_UCHAR(wPortECR, ChipMode); + } + {} + return (0L); } - return (0L); -} } -NTSTATUS PptSetByteMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) -{ NTSTATUS Status ; +NTSTATUS PptSetByteMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode) { + NTSTATUS Status; { - if (Extension->PnpInfo.HardwareCapabilities & 1UL) { - { - Status = PptEcrSetMode(Extension, ChipMode); + if (Extension->PnpInfo.HardwareCapabilities & 1UL) { + { Status = PptEcrSetMode(Extension, ChipMode); } + } else { } - } else { - - } - { - Status = PptCheckByteMode(Extension); + { Status = PptCheckByteMode(Extension); } + return (Status); } - return (Status); -} } -NTSTATUS PptClearByteMode(PDEVICE_EXTENSION Extension ) -{ NTSTATUS Status ; +NTSTATUS PptClearByteMode(PDEVICE_EXTENSION Extension) { + NTSTATUS Status; { - Status = 0L; - if (Extension->PnpInfo.HardwareCapabilities & 1UL) { - { - Status = PptEcrClearMode(Extension); + Status = 0L; + if (Extension->PnpInfo.HardwareCapabilities & 1UL) { + { Status = PptEcrClearMode(Extension); } + } else { } - } else { - + return (Status); } - return (Status); } -} -NTSTATUS PptCheckByteMode(PDEVICE_EXTENSION Extension ) -{ PUCHAR Controller ; - UCHAR dcr ; - UCHAR tmp ; - UCHAR tmp___0 ; +NTSTATUS PptCheckByteMode(PDEVICE_EXTENSION Extension) { + PUCHAR Controller; + UCHAR dcr; + UCHAR tmp; + UCHAR tmp___0; { - { - Controller = Extension->PortInfo.Controller; - dcr = READ_PORT_UCHAR(Controller + 2); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char )((int )dcr | 32)); - WRITE_PORT_UCHAR(Controller, (unsigned char)85); - tmp___0 = READ_PORT_UCHAR(Controller); - } - if ((int )tmp___0 == 85) { { - WRITE_PORT_UCHAR(Controller, (unsigned char)170); - tmp = READ_PORT_UCHAR(Controller); + Controller = Extension->PortInfo.Controller; + dcr = READ_PORT_UCHAR(Controller + 2); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)((int)dcr | 32)); + WRITE_PORT_UCHAR(Controller, (unsigned char)85); + tmp___0 = READ_PORT_UCHAR(Controller); } - if ((int )tmp == 170) { - return (-1073741823L); + if ((int)tmp___0 == 85) { + { + WRITE_PORT_UCHAR(Controller, (unsigned char)170); + tmp = READ_PORT_UCHAR(Controller); + } + if ((int)tmp == 170) { + return (-1073741823L); + } else { + } } else { - } - } else { - - } - { - WRITE_PORT_UCHAR(Controller + 2, dcr); - } - return (0L); -} -} -NTSTATUS PptEcrClearMode(PDEVICE_EXTENSION Extension ) -{ UCHAR ecr ; - PUCHAR Controller ; - PUCHAR wPortECR ; - - { - { - Controller = Extension->PortInfo.Controller; - ecr = Extension->EcrPortData; - Extension->EcrPortData = 0; - wPortECR = Extension->PnpInfo.EcpController + 2; - WRITE_PORT_UCHAR(wPortECR, (unsigned char )((int )ecr & 31)); - WRITE_PORT_UCHAR(wPortECR, ecr); + { WRITE_PORT_UCHAR(Controller + 2, dcr); } + return (0L); } - return (0L); -} } -NTSTATUS PptFindNatChip(PDEVICE_EXTENSION Extension ) -{ BOOLEAN found ; - BOOLEAN OkToLook ; - BOOLEAN Conflict ; - PUCHAR ChipAddr[4] ; - PUCHAR AddrList[4] ; - PUCHAR PortAddr ; - ULONG_PTR Port ; - UCHAR SaveIdx ; - UCHAR cr ; - UCHAR ii ; - NTSTATUS Status ; - ULONG ResourceDescriptorCount ; - ULONG ResourcesSize ; - PCM_RESOURCE_LIST Resources ; - ULONG NationalChecked ; - ULONG NationalChipFound ; - PVOID tmp ; - UCHAR tmp___0 ; - UCHAR tmp___1 ; - UCHAR tmp___2 ; - UCHAR tmp___3 ; - UCHAR tmp___4 ; - UCHAR tmp___5 ; - UCHAR tmp___6 ; - UCHAR tmp___7 ; - PDEVICE_OBJECT pdo ; +NTSTATUS PptEcrClearMode(PDEVICE_EXTENSION Extension) { + UCHAR ecr; + PUCHAR Controller; + PUCHAR wPortECR; { - found = 0; - OkToLook = 0; - ChipAddr[0] = (UCHAR *)920; - ChipAddr[1] = (UCHAR *)622; - ChipAddr[2] = (UCHAR *)348; - ChipAddr[3] = (UCHAR *)46; - AddrList[0] = (UCHAR *)888; - AddrList[1] = (UCHAR *)956; - AddrList[2] = (UCHAR *)632; - AddrList[3] = (UCHAR *)0; - NationalChecked = 0; - NationalChipFound = 0; - if ((int )Extension->NationalChecked == 1) { { + Controller = Extension->PortInfo.Controller; + ecr = Extension->EcrPortData; + Extension->EcrPortData = 0; + wPortECR = Extension->PnpInfo.EcpController + 2; + WRITE_PORT_UCHAR(wPortECR, (unsigned char)((int)ecr & 31)); + WRITE_PORT_UCHAR(wPortECR, ecr); } return (0L); - } else { - } - Extension->NationalChecked = 1; - if (NationalChecked) { - if (NationalChipFound) { - Extension->NationalChipFound = 1; +} +NTSTATUS PptFindNatChip(PDEVICE_EXTENSION Extension) { + BOOLEAN found; + BOOLEAN OkToLook; + BOOLEAN Conflict; + PUCHAR ChipAddr[4]; + PUCHAR AddrList[4]; + PUCHAR PortAddr; + ULONG_PTR Port; + UCHAR SaveIdx; + UCHAR cr; + UCHAR ii; + NTSTATUS Status; + ULONG ResourceDescriptorCount; + ULONG ResourcesSize; + PCM_RESOURCE_LIST Resources; + ULONG NationalChecked; + ULONG NationalChipFound; + PVOID tmp; + UCHAR tmp___0; + UCHAR tmp___1; + UCHAR tmp___2; + UCHAR tmp___3; + UCHAR tmp___4; + UCHAR tmp___5; + UCHAR tmp___6; + UCHAR tmp___7; + PDEVICE_OBJECT pdo; + + { + found = 0; + OkToLook = 0; + ChipAddr[0] = (UCHAR *)920; + ChipAddr[1] = (UCHAR *)622; + ChipAddr[2] = (UCHAR *)348; + ChipAddr[3] = (UCHAR *)46; + AddrList[0] = (UCHAR *)888; + AddrList[1] = (UCHAR *)956; + AddrList[2] = (UCHAR *)632; + AddrList[3] = (UCHAR *)0; + NationalChecked = 0; + NationalChipFound = 0; + if ((int)Extension->NationalChecked == 1) { + {} + return (0L); + } else { + } + Extension->NationalChecked = 1; + if (NationalChecked) { + if (NationalChipFound) { + Extension->NationalChipFound = 1; + } else { + Extension->NationalChipFound = 0; + } + return (0L); } else { - Extension->NationalChipFound = 0; } - return (0L); - } else { - - } - { - ResourceDescriptorCount = sizeof(ChipAddr) / sizeof(ULONG ); - ResourcesSize = (ULONG )sizeof(CM_RESOURCE_LIST ) + (ResourceDescriptorCount - 1UL) * (ULONG )sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR ); - tmp = ExAllocatePoolWithTag(0, ResourcesSize, 1349673296UL); - Resources = (struct _CM_RESOURCE_LIST *)tmp; - } - if ((unsigned int )Resources == (unsigned int )((void *)0)) { { + ResourceDescriptorCount = sizeof(ChipAddr) / sizeof(ULONG); + ResourcesSize = (ULONG)sizeof(CM_RESOURCE_LIST) + + (ResourceDescriptorCount - 1UL) * + (ULONG)sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); + tmp = ExAllocatePoolWithTag(0, ResourcesSize, 1349673296UL); + Resources = (struct _CM_RESOURCE_LIST *)tmp; } - return (-1073741823L); - } else { - - } - { - memset(Resources, 0, ResourcesSize); - Status = PptBuildResourceList(Extension, sizeof(ChipAddr) / sizeof(ULONG ), ChipAddr, - Resources); - } - if (! (Status >= 0L)) { - { - } - { -/* ExFreePool(Resources); */ /* INLINED */ - } - return (Status); - } else { - - } - { - Status = IoReportResourceUsage((void *)0, Extension->DriverObject, Resources, sizeof(Resources), - Extension->DeviceObject, (void *)0, 0, 0, & Conflict); -/* ExFreePool(Resources); */ /* INLINED */ - } - if (! (Status >= 0L)) { - { + if ((unsigned int)Resources == (unsigned int)((void *)0)) { + {} + return (-1073741823L); + } else { } - return (Status); - } else { - - } - if (Conflict) { { + memset(Resources, 0, ResourcesSize); + Status = PptBuildResourceList(Extension, sizeof(ChipAddr) / sizeof(ULONG), + ChipAddr, Resources); } - return (-1073741823L); - } else { - - } - ii = 0; - { - while (1) { - while_180_continue: /* CIL Label */ ; - if (! found) { - if ((int )ii < 4) { - - } else { - goto while_180_break; + if (!(Status >= 0L)) { + {} { /* ExFreePool(Resources); */ /* INLINED */ } + return (Status); } else { - goto while_180_break; } { - PortAddr = ChipAddr[ii]; - tmp___1 = READ_PORT_UCHAR(PortAddr); + Status = IoReportResourceUsage( + (void *)0, Extension->DriverObject, Resources, sizeof(Resources), + Extension->DeviceObject, (void *)0, 0, 0, &Conflict); + /* ExFreePool(Resources); */ /* INLINED */ } - if ((int )tmp___1 == 136) { - { - tmp___2 = READ_PORT_UCHAR(PortAddr); - } - if ((int )tmp___2 < 32) { - OkToLook = 1; - } else { - goto _L; - } + if (!(Status >= 0L)) { + {} + return (Status); } else { - _L: /* CIL Label */ - { - READ_PORT_UCHAR(PortAddr); - cr = READ_PORT_UCHAR(PortAddr); - } - if ((int )cr != 255) { - { - tmp___0 = READ_PORT_UCHAR(PortAddr); - } - if ((int )tmp___0 == (int )cr) { - OkToLook = 1; - } else { + } + if (Conflict) { + {} + return (-1073741823L); + } else { + } + ii = 0; + { + while (1) { + while_180_continue: /* CIL Label */; + if (!found) { + if ((int)ii < 4) { + } else { + goto while_180_break; + } + } else { + goto while_180_break; } - } else { - - } - } - if (OkToLook) { - { - OkToLook = 0; - WRITE_PORT_UCHAR(PortAddr, 8); - cr = READ_PORT_UCHAR(PortAddr); - } - if ((int )cr == 8) { { - tmp___3 = READ_PORT_UCHAR(PortAddr + 1); - cr = (unsigned char )((int )tmp___3 & 240); + PortAddr = ChipAddr[ii]; + tmp___1 = READ_PORT_UCHAR(PortAddr); } - if ((int )cr == 16) { - goto _L___0; + if ((int)tmp___1 == 136) { + { tmp___2 = READ_PORT_UCHAR(PortAddr); } + if ((int)tmp___2 < 32) { + OkToLook = 1; + } else { + goto _L; + } } else { - if ((int )cr == 80) { - goto _L___0; + _L : /* CIL Label */ + { + READ_PORT_UCHAR(PortAddr); + cr = READ_PORT_UCHAR(PortAddr); + } + if ((int)cr != 255) { + { tmp___0 = READ_PORT_UCHAR(PortAddr); } + if ((int)tmp___0 == (int)cr) { + OkToLook = 1; + } else { + } } else { - if ((int )cr == 112) { + } + } + if (OkToLook) { + { + OkToLook = 0; + WRITE_PORT_UCHAR(PortAddr, 8); + cr = READ_PORT_UCHAR(PortAddr); + } + if ((int)cr == 8) { + { + tmp___3 = READ_PORT_UCHAR(PortAddr + 1); + cr = (unsigned char)((int)tmp___3 & 240); + } + if ((int)cr == 16) { goto _L___0; } else { - if ((int )cr == 48) { + if ((int)cr == 80) { goto _L___0; } else { - if ((int )cr == 32) { + if ((int)cr == 112) { goto _L___0; } else { - if ((int )cr == 144) { + if ((int)cr == 48) { goto _L___0; } else { - if ((int )cr == 176) { + if ((int)cr == 32) { goto _L___0; } else { - if ((int )cr == 96) { - _L___0: /* CIL Label */ - { - found = 1; - WRITE_PORT_UCHAR(PortAddr, 1); - tmp___4 = READ_PORT_UCHAR(PortAddr + 1); - Port = (int )tmp___4 & 3; - } - if ((unsigned int )Extension->PortInfo.Controller == (unsigned int )AddrList[Port]) { - Extension->NationalChipFound = 1; + if ((int)cr == 144) { + goto _L___0; + } else { + if ((int)cr == 176) { + goto _L___0; } else { - + if ((int)cr == 96) { + _L___0 : /* CIL Label */ + { + found = 1; + WRITE_PORT_UCHAR(PortAddr, 1); + tmp___4 = READ_PORT_UCHAR(PortAddr + 1); + Port = (int)tmp___4 & 3; + } + if ((unsigned int)Extension->PortInfo.Controller == + (unsigned int)AddrList[Port]) { + Extension->NationalChipFound = 1; + } else { + } + } else { + } } - } else { - } } } } } } + } else { } + } else { } - } else { - - } - } else { - - } - if (! found) { - { - SaveIdx = READ_PORT_UCHAR(PortAddr); - WRITE_PORT_UCHAR(PortAddr, 32); - WRITE_PORT_UCHAR(PortAddr + 1, 0); - tmp___5 = READ_PORT_UCHAR(PortAddr + 1); - cr = (unsigned char )((int )tmp___5 & 248); - } - if ((int )cr == 192) { - goto _L___1; - } else { - if ((int )cr == 160) { - _L___1: /* CIL Label */ + if (!found) { { - found = 1; - WRITE_PORT_UCHAR(PortAddr, 7); - WRITE_PORT_UCHAR(PortAddr + 1, 4); - WRITE_PORT_UCHAR(PortAddr, 96); - tmp___6 = READ_PORT_UCHAR(PortAddr + 1); - Port = (unsigned long )(((int )tmp___6 << 8) & 65280); - WRITE_PORT_UCHAR(PortAddr, 97); - tmp___7 = READ_PORT_UCHAR(PortAddr + 1); - Port |= (unsigned long )tmp___7; + SaveIdx = READ_PORT_UCHAR(PortAddr); + WRITE_PORT_UCHAR(PortAddr, 32); + WRITE_PORT_UCHAR(PortAddr + 1, 0); + tmp___5 = READ_PORT_UCHAR(PortAddr + 1); + cr = (unsigned char)((int)tmp___5 & 248); } - if ((unsigned int )Extension->PortInfo.Controller == (unsigned int )((UCHAR *)Port)) { - Extension->NationalChipFound = 1; + if ((int)cr == 192) { + goto _L___1; } else { - + if ((int)cr == 160) { + _L___1 : /* CIL Label */ + { + found = 1; + WRITE_PORT_UCHAR(PortAddr, 7); + WRITE_PORT_UCHAR(PortAddr + 1, 4); + WRITE_PORT_UCHAR(PortAddr, 96); + tmp___6 = READ_PORT_UCHAR(PortAddr + 1); + Port = (unsigned long)(((int)tmp___6 << 8) & 65280); + WRITE_PORT_UCHAR(PortAddr, 97); + tmp___7 = READ_PORT_UCHAR(PortAddr + 1); + Port |= (unsigned long)tmp___7; + } + if ((unsigned int)Extension->PortInfo.Controller == + (unsigned int)((UCHAR *)Port)) { + Extension->NationalChipFound = 1; + } else { + } + } else { + { WRITE_PORT_UCHAR(PortAddr, SaveIdx); } + } } } else { - { - WRITE_PORT_UCHAR(PortAddr, SaveIdx); - } } + ii = (UCHAR)((int)ii + 1); } + while_180_break: /* CIL Label */; + } + pdo = Extension->PhysicalDeviceObject; + NationalChecked = 1; + if (Extension->NationalChipFound) { + NationalChipFound = 1; } else { - + NationalChipFound = 0; } - ii = (UCHAR )((int )ii + 1); - } - while_180_break: /* CIL Label */ ; - } - pdo = Extension->PhysicalDeviceObject; - NationalChecked = 1; - if (Extension->NationalChipFound) { - NationalChipFound = 1; - } else { - NationalChipFound = 0; - } - { - Status = IoReportResourceUsage((void *)0, Extension->DriverObject, (void *)0, 0, - Extension->DeviceObject, (void *)0, 0, 0, & Conflict); - } - { + { + Status = IoReportResourceUsage((void *)0, Extension->DriverObject, + (void *)0, 0, Extension->DeviceObject, + (void *)0, 0, 0, &Conflict); + } + {} + return (Status); } - return (Status); -} } -NTSTATUS PptBuildResourceList(PDEVICE_EXTENSION Extension , ULONG Partial , PULONG Addresses , - PCM_RESOURCE_LIST Resources ) -{ UCHAR i ; +NTSTATUS PptBuildResourceList(PDEVICE_EXTENSION Extension, ULONG Partial, + PULONG Addresses, PCM_RESOURCE_LIST Resources) { + UCHAR i; { - Resources->Count = 1; - Resources->List[0].InterfaceType = Extension->InterfaceType; - Resources->List[0].BusNumber = Extension->BusNumber; - Resources->List[0].PartialResourceList.Version = 0; - Resources->List[0].PartialResourceList.Revision = 0; - Resources->List[0].PartialResourceList.Count = Partial; - i = 0; - { - while (1) { - while_182_continue: /* CIL Label */ ; - if ((ULONG )i < Partial) { + Resources->Count = 1; + Resources->List[0].InterfaceType = Extension->InterfaceType; + Resources->List[0].BusNumber = Extension->BusNumber; + Resources->List[0].PartialResourceList.Version = 0; + Resources->List[0].PartialResourceList.Revision = 0; + Resources->List[0].PartialResourceList.Count = Partial; + i = 0; + { + while (1) { + while_182_continue: /* CIL Label */; + if ((ULONG)i < Partial) { - } else { - goto while_182_break; + } else { + goto while_182_break; + } + Resources->List[0].PartialResourceList.PartialDescriptors[i].Type = 1; + Resources->List[0] + .PartialResourceList.PartialDescriptors[i] + .ShareDisposition = 2; + Resources->List[0].PartialResourceList.PartialDescriptors[i].Flags = 1; + Resources->List[0] + .PartialResourceList.PartialDescriptors[i] + .u.Port.Start.QuadPart = *(Addresses + i); + Resources->List[0] + .PartialResourceList.PartialDescriptors[i] + .u.Port.Length = 2UL; + i = (UCHAR)((int)i + 1); + } + while_182_break: /* CIL Label */; } - Resources->List[0].PartialResourceList.PartialDescriptors[i].Type = 1; - Resources->List[0].PartialResourceList.PartialDescriptors[i].ShareDisposition = 2; - Resources->List[0].PartialResourceList.PartialDescriptors[i].Flags = 1; - Resources->List[0].PartialResourceList.PartialDescriptors[i].u.Port.Start.QuadPart = *(Addresses + i); - Resources->List[0].PartialResourceList.PartialDescriptors[i].u.Port.Length = 2UL; - i = (UCHAR )((int )i + 1); - } - while_182_break: /* CIL Label */ ; + return (0L); } - return (0L); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once #pragma once - struct _GUID const GUID_PARALLEL_DEVICE = {2549575408U, 63619, 4560, {175, 31, 0, 0, 248, 0, 132, 92}}; - struct _GUID const GUID_PARCLASS_DEVICE = {2166343333U, 63272, 4560, {165, 55, 0, 0, 248, 117, 62, 209}}; -ULONG PptDebugLevel = 0UL; -ULONG PptBreakOn = 0UL; -UNICODE_STRING RegistryPath = {0, 0, 0}; -LONG PortInfoReferenceCount = -1L; -PFAST_MUTEX PortInfoMutex = (void *)0; -union _LARGE_INTEGER const PhysicalZero = {{0, 0L}}; -UCHAR PptDot3Retries = 5; +struct _GUID const GUID_PARALLEL_DEVICE = { + 2549575408U, 63619, 4560, {175, 31, 0, 0, 248, 0, 132, 92}}; +struct _GUID const GUID_PARCLASS_DEVICE = { + 2166343333U, 63272, 4560, {165, 55, 0, 0, 248, 117, 62, 209}}; +ULONG PptDebugLevel = 0UL; +ULONG PptBreakOn = 0UL; +UNICODE_STRING RegistryPath = {0, 0, 0}; +LONG PortInfoReferenceCount = -1L; +PFAST_MUTEX PortInfoMutex = (void *)0; +union _LARGE_INTEGER const PhysicalZero = {{0, 0L}}; +UCHAR PptDot3Retries = 5; #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -NTSTATUS PptPnpFilterResourceRequirements(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpQueryDeviceRelations(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpQueryStopDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpCancelStopDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpStopDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpQueryRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpCancelRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpSurpriseRemoval(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpUnhandledIrp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpStartValidateResources(PDEVICE_OBJECT DeviceObject , BOOLEAN FoundPort , - BOOLEAN FoundIrq , BOOLEAN FoundDma ) ; -NTSTATUS PptPnpStartScanCmResourceList(PDEVICE_EXTENSION Extension , PIRP Irp , PBOOLEAN FoundPort , - PBOOLEAN FoundIrq , PBOOLEAN FoundDma ) ; -NTSTATUS PptPnpPassThroughPnpIrpAndReleaseRemoveLock(PDEVICE_EXTENSION Extension , - PIRP Irp ) ; -void PptPnpFilterNukeIrqResourceDescriptors(PIO_RESOURCE_LIST IoResourceList ) ; -void PptPnpFilterNukeIrqResourceDescriptorsFromAllLists(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) ; -BOOLEAN PptPnpFilterExistsNonIrqResourceList(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) ; -PVOID PptPnpFilterGetEndOfResourceRequirementsList(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) ; -BOOLEAN PptPnpListContainsIrqResourceDescriptor(PIO_RESOURCE_LIST List ) ; -void PptPnpFilterRemoveIrqResourceLists(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) ; -NTSTATUS PptPnpBounceAndCatchPnpIrp(PDEVICE_EXTENSION Extension , PIRP Irp ) ; -PDEVICE_RELATIONS PptPnpBuildRemovalRelations(PDEVICE_EXTENSION Extension ) -{ PDEVICE_RELATIONS relations ; - PLIST_ENTRY listHead ; - PLIST_ENTRY thisListEntry ; - PLIST_ENTRY firstListEntry ; - BOOLEAN done ; - PREMOVAL_RELATIONS_LIST_ENTRY node ; - ULONG count ; - ULONG i ; - PDEVICE_OBJECT pDevObj ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; - PLIST_ENTRY _EX_Flink___0 ; - PLIST_ENTRY _EX_ListHead ; - PLIST_ENTRY _EX_Blink___0 ; - PLIST_ENTRY _EX_ListHead___0 ; - PVOID tmp ; - PLIST_ENTRY _EX_Blink___1 ; - PLIST_ENTRY _EX_Flink___1 ; - PLIST_ENTRY _EX_Blink___2 ; - PLIST_ENTRY _EX_ListHead___1 ; - - { - relations = (void *)0; - listHead = & Extension->RemovalRelationsList; - thisListEntry = (void *)0; - firstListEntry = (void *)0; - done = 0; - node = (void *)0; - { - } - { -/* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - if ((unsigned int )listHead->Flink == (unsigned int )listHead) { - { - } - goto targetExit; - } else { - - } - count = 0; - { - while (1) { - while_185_continue: /* CIL Label */ ; - if (! done) { - - } else { - goto while_185_break; - } - thisListEntry = listHead->Flink; - _EX_Flink = (listHead->Flink)->Flink; - _EX_Blink = (listHead->Flink)->Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - node = (REMOVAL_RELATIONS_LIST_ENTRY *)((CHAR *)thisListEntry - (unsigned long )(& ((REMOVAL_RELATIONS_LIST_ENTRY *)0)->ListEntry)); - if ((unsigned int )firstListEntry == (unsigned int )thisListEntry) { - _EX_ListHead = listHead; - _EX_Flink___0 = _EX_ListHead->Flink; - node->ListEntry.Flink = _EX_Flink___0; - node->ListEntry.Blink = _EX_ListHead; - _EX_Flink___0->Blink = & node->ListEntry; - _EX_ListHead->Flink = & node->ListEntry; - done = 1; - { - } - } else { - { - } - _EX_ListHead___0 = listHead; - _EX_Blink___0 = _EX_ListHead___0->Blink; - node->ListEntry.Flink = _EX_ListHead___0; - node->ListEntry.Blink = _EX_Blink___0; - _EX_Blink___0->Flink = & node->ListEntry; - _EX_ListHead___0->Blink = & node->ListEntry; - count += 1UL; - } - if (! firstListEntry) { - { - } - firstListEntry = thisListEntry; +NTSTATUS PptPnpFilterResourceRequirements(PDEVICE_OBJECT DeviceObject, + PIRP Irp); +NTSTATUS PptPnpQueryDeviceRelations(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpQueryStopDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpCancelStopDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpStopDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpQueryRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpCancelRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpSurpriseRemoval(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpUnhandledIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpStartValidateResources(PDEVICE_OBJECT DeviceObject, + BOOLEAN FoundPort, BOOLEAN FoundIrq, + BOOLEAN FoundDma); +NTSTATUS PptPnpStartScanCmResourceList(PDEVICE_EXTENSION Extension, PIRP Irp, + PBOOLEAN FoundPort, PBOOLEAN FoundIrq, + PBOOLEAN FoundDma); +NTSTATUS +PptPnpPassThroughPnpIrpAndReleaseRemoveLock(PDEVICE_EXTENSION Extension, + PIRP Irp); +void PptPnpFilterNukeIrqResourceDescriptors(PIO_RESOURCE_LIST IoResourceList); +void PptPnpFilterNukeIrqResourceDescriptorsFromAllLists( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList); +BOOLEAN PptPnpFilterExistsNonIrqResourceList( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList); +PVOID PptPnpFilterGetEndOfResourceRequirementsList( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList); +BOOLEAN PptPnpListContainsIrqResourceDescriptor(PIO_RESOURCE_LIST List); +void PptPnpFilterRemoveIrqResourceLists( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList); +NTSTATUS PptPnpBounceAndCatchPnpIrp(PDEVICE_EXTENSION Extension, PIRP Irp); +PDEVICE_RELATIONS PptPnpBuildRemovalRelations(PDEVICE_EXTENSION Extension) { + PDEVICE_RELATIONS relations; + PLIST_ENTRY listHead; + PLIST_ENTRY thisListEntry; + PLIST_ENTRY firstListEntry; + BOOLEAN done; + PREMOVAL_RELATIONS_LIST_ENTRY node; + ULONG count; + ULONG i; + PDEVICE_OBJECT pDevObj; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; + PLIST_ENTRY _EX_Flink___0; + PLIST_ENTRY _EX_ListHead; + PLIST_ENTRY _EX_Blink___0; + PLIST_ENTRY _EX_ListHead___0; + PVOID tmp; + PLIST_ENTRY _EX_Blink___1; + PLIST_ENTRY _EX_Flink___1; + PLIST_ENTRY _EX_Blink___2; + PLIST_ENTRY _EX_ListHead___1; + + { + relations = (void *)0; + listHead = &Extension->RemovalRelationsList; + thisListEntry = (void *)0; + firstListEntry = (void *)0; + done = 0; + node = (void *)0; + {} { + /* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + } + if ((unsigned int)listHead->Flink == (unsigned int)listHead) { + {} + goto targetExit; } else { - } - } - while_185_break: /* CIL Label */ ; - } - { - } - { - tmp = ExAllocatePoolWithTag(1, (ULONG )sizeof(DEVICE_RELATIONS ) + (count - 1UL) * (ULONG )sizeof(PDEVICE_OBJECT ), - 1349673296UL); - relations = tmp; - } - if (! relations) { + count = 0; { - } - goto targetExit; - } else { + while (1) { + while_185_continue: /* CIL Label */; + if (!done) { - } - relations->Count = count; - i = 0; - { - while (1) { - while_191_continue: /* CIL Label */ ; - if (i < count) { - - } else { - goto while_191_break; + } else { + goto while_185_break; + } + thisListEntry = listHead->Flink; + _EX_Flink = (listHead->Flink)->Flink; + _EX_Blink = (listHead->Flink)->Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + node = (REMOVAL_RELATIONS_LIST_ENTRY + *)((CHAR *)thisListEntry - + (unsigned long)(&((REMOVAL_RELATIONS_LIST_ENTRY *)0) + ->ListEntry)); + if ((unsigned int)firstListEntry == (unsigned int)thisListEntry) { + _EX_ListHead = listHead; + _EX_Flink___0 = _EX_ListHead->Flink; + node->ListEntry.Flink = _EX_Flink___0; + node->ListEntry.Blink = _EX_ListHead; + _EX_Flink___0->Blink = &node->ListEntry; + _EX_ListHead->Flink = &node->ListEntry; + done = 1; + {} + } else { + {} + _EX_ListHead___0 = listHead; + _EX_Blink___0 = _EX_ListHead___0->Blink; + node->ListEntry.Flink = _EX_ListHead___0; + node->ListEntry.Blink = _EX_Blink___0; + _EX_Blink___0->Flink = &node->ListEntry; + _EX_ListHead___0->Blink = &node->ListEntry; + count += 1UL; + } + if (!firstListEntry) { + {} + firstListEntry = thisListEntry; + } else { + } + } + while_185_break: /* CIL Label */; } - thisListEntry = listHead->Flink; - _EX_Flink___1 = (listHead->Flink)->Flink; - _EX_Blink___1 = (listHead->Flink)->Blink; - _EX_Blink___1->Flink = _EX_Flink___1; - _EX_Flink___1->Blink = _EX_Blink___1; - node = (REMOVAL_RELATIONS_LIST_ENTRY *)((CHAR *)thisListEntry - (unsigned long )(& ((REMOVAL_RELATIONS_LIST_ENTRY *)0)->ListEntry)); - { + {} { + tmp = ExAllocatePoolWithTag(1, + (ULONG)sizeof(DEVICE_RELATIONS) + + (count - 1UL) * + (ULONG)sizeof(PDEVICE_OBJECT), + 1349673296UL); + relations = tmp; } - { - pDevObj = node->DeviceObject; - ObfReferenceObject(pDevObj); - relations->Objects[i] = pDevObj; - _EX_ListHead___1 = listHead; - _EX_Blink___2 = _EX_ListHead___1->Blink; - node->ListEntry.Flink = _EX_ListHead___1; - node->ListEntry.Blink = _EX_Blink___2; - _EX_Blink___2->Flink = & node->ListEntry; - _EX_ListHead___1->Blink = & node->ListEntry; - i += 1UL; + if (!relations) { + {} + goto targetExit; + } else { } - } - while_191_break: /* CIL Label */ ; - } - targetExit: - { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - return (relations); -} -} -NTSTATUS PptPnpStartScanPciCardCmResourceList(PDEVICE_EXTENSION Extension , PIRP Irp , - PBOOLEAN FoundPort , PBOOLEAN FoundIrq , - PBOOLEAN FoundDma ) -{ NTSTATUS status ; - PIO_STACK_LOCATION irpStack ; - PCM_RESOURCE_LIST ResourceList ; - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor ; - PCM_PARTIAL_RESOURCE_LIST PartialResourceList ; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor ; - ULONG i ; - ULONG length ; - - { - status = 0L; - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - { - } - *FoundPort = 0; - *FoundIrq = 0; - *FoundDma = 0; - ResourceList = irpStack->Parameters.StartDevice.AllocatedResourcesTranslated; - FullResourceDescriptor = & ResourceList->List[0]; - if (FullResourceDescriptor) { - Extension->InterfaceType = FullResourceDescriptor->InterfaceType; - PartialResourceList = & FullResourceDescriptor->PartialResourceList; + relations->Count = count; i = 0; { - while (1) { - while_194_continue: /* CIL Label */ ; - if (i < PartialResourceList->Count) { + while (1) { + while_191_continue: /* CIL Label */; + if (i < count) { - } else { - goto while_194_break; - } - PartialResourceDescriptor = & PartialResourceList->PartialDescriptors[i]; - if (PartialResourceDescriptor->Type == 1) { - goto switch_195_1; - } else { - if (PartialResourceDescriptor->Type == 6) { - goto switch_195_6; } else { - if (PartialResourceDescriptor->Type == 2) { - goto switch_195_2; + goto while_191_break; + } + thisListEntry = listHead->Flink; + _EX_Flink___1 = (listHead->Flink)->Flink; + _EX_Blink___1 = (listHead->Flink)->Blink; + _EX_Blink___1->Flink = _EX_Flink___1; + _EX_Flink___1->Blink = _EX_Blink___1; + node = (REMOVAL_RELATIONS_LIST_ENTRY + *)((CHAR *)thisListEntry - + (unsigned long)(&((REMOVAL_RELATIONS_LIST_ENTRY *)0) + ->ListEntry)); + {} { + pDevObj = node->DeviceObject; + ObfReferenceObject(pDevObj); + relations->Objects[i] = pDevObj; + _EX_ListHead___1 = listHead; + _EX_Blink___2 = _EX_ListHead___1->Blink; + node->ListEntry.Flink = _EX_ListHead___1; + node->ListEntry.Blink = _EX_Blink___2; + _EX_Blink___2->Flink = &node->ListEntry; + _EX_ListHead___1->Blink = &node->ListEntry; + i += 1UL; + } + } + while_191_break: /* CIL Label */; + } + targetExit : { + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + } + return (relations); + } +} +NTSTATUS PptPnpStartScanPciCardCmResourceList(PDEVICE_EXTENSION Extension, + PIRP Irp, PBOOLEAN FoundPort, + PBOOLEAN FoundIrq, + PBOOLEAN FoundDma) { + NTSTATUS status; + PIO_STACK_LOCATION irpStack; + PCM_RESOURCE_LIST ResourceList; + PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; + PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor; + ULONG i; + ULONG length; + + { + status = 0L; + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + {} *FoundPort = 0; + *FoundIrq = 0; + *FoundDma = 0; + ResourceList = + irpStack->Parameters.StartDevice.AllocatedResourcesTranslated; + FullResourceDescriptor = &ResourceList->List[0]; + if (FullResourceDescriptor) { + Extension->InterfaceType = FullResourceDescriptor->InterfaceType; + PartialResourceList = &FullResourceDescriptor->PartialResourceList; + i = 0; + { + while (1) { + while_194_continue: /* CIL Label */; + if (i < PartialResourceList->Count) { + + } else { + goto while_194_break; + } + PartialResourceDescriptor = + &PartialResourceList->PartialDescriptors[i]; + if (PartialResourceDescriptor->Type == 1) { + goto switch_195_1; } else { - if (PartialResourceDescriptor->Type == 4) { - goto switch_195_4; + if (PartialResourceDescriptor->Type == 6) { + goto switch_195_6; } else { - { - goto switch_195_default; - if (0) { - switch_195_1: /* CIL Label */ - length = PartialResourceDescriptor->u.Port.Length; - if (length == 8) { - goto switch_196_8; + if (PartialResourceDescriptor->Type == 2) { + goto switch_195_2; + } else { + if (PartialResourceDescriptor->Type == 4) { + goto switch_195_4; } else { - if (length == 4) { - goto switch_196_4; - } else { - { - goto switch_196_default; + { + goto switch_195_default; if (0) { - switch_196_8: /* CIL Label */ ; - { - } - Extension->PortInfo.OriginalController = PartialResourceDescriptor->u.Port.Start; - Extension->PortInfo.SpanOfController = PartialResourceDescriptor->u.Port.Length; - Extension->PortInfo.Controller = (UCHAR *)((unsigned long )Extension->PortInfo.OriginalController.QuadPart); - Extension->AddressSpace = PartialResourceDescriptor->Flags; - *FoundPort = 1; - goto switch_196_break; - switch_196_4: /* CIL Label */ ; - { + switch_195_1: /* CIL Label */ + length = PartialResourceDescriptor->u.Port.Length; + if (length == 8) { + goto switch_196_8; + } else { + if (length == 4) { + goto switch_196_4; + } else { + { + goto switch_196_default; + if (0) { + switch_196_8: /* CIL Label */; + {} + Extension->PortInfo.OriginalController = + PartialResourceDescriptor->u.Port.Start; + Extension->PortInfo.SpanOfController = + PartialResourceDescriptor->u.Port.Length; + Extension->PortInfo.Controller = + (UCHAR *)((unsigned long)Extension->PortInfo + .OriginalController.QuadPart); + Extension->AddressSpace = + PartialResourceDescriptor->Flags; + *FoundPort = 1; + goto switch_196_break; + switch_196_4: /* CIL Label */; + {} + Extension->PnpInfo.OriginalEcpController = + PartialResourceDescriptor->u.Port.Start; + Extension->PnpInfo.SpanOfEcpController = + PartialResourceDescriptor->u.Port.Length; + Extension->PnpInfo.EcpController = + (UCHAR *)((unsigned long)Extension->PnpInfo + .OriginalEcpController + .QuadPart); + Extension->EcpAddressSpace = + PartialResourceDescriptor->Flags; + goto switch_196_break; + switch_196_default: /* CIL Label */; + {} + } else { + switch_196_break: /* CIL Label */; + } + } + } } - Extension->PnpInfo.OriginalEcpController = PartialResourceDescriptor->u.Port.Start; - Extension->PnpInfo.SpanOfEcpController = PartialResourceDescriptor->u.Port.Length; - Extension->PnpInfo.EcpController = (UCHAR *)((unsigned long )Extension->PnpInfo.OriginalEcpController.QuadPart); - Extension->EcpAddressSpace = PartialResourceDescriptor->Flags; - goto switch_196_break; - switch_196_default: /* CIL Label */ ; - { + goto switch_195_break; + switch_195_6: /* CIL Label */ + Extension->BusNumber = + PartialResourceDescriptor->u.BusNumber.Start; + goto switch_195_break; + switch_195_2: /* CIL Label */ + *FoundIrq = 1; + Extension->FoundInterrupt = 1; + Extension->InterruptLevel = + (unsigned char) + PartialResourceDescriptor->u.Interrupt.Level; + Extension->InterruptVector = + PartialResourceDescriptor->u.Interrupt.Vector; + Extension->InterruptAffinity = + PartialResourceDescriptor->u.Interrupt.Affinity; + if ((int)PartialResourceDescriptor->Flags & 1) { + Extension->InterruptMode = 1; + } else { + Extension->InterruptMode = 0; } + goto switch_195_break; + switch_195_4: /* CIL Label */ + *FoundDma = 1; + Extension->DmaChannel = + PartialResourceDescriptor->u.Dma.Channel; + Extension->DmaPort = + PartialResourceDescriptor->u.Dma.Port; + Extension->DmaWidth = PartialResourceDescriptor->Flags; + goto switch_195_break; + switch_195_default: /* CIL Label */; + goto switch_195_break; } else { - switch_196_break: /* CIL Label */ ; - } + switch_195_break: /* CIL Label */; } } } - goto switch_195_break; - switch_195_6: /* CIL Label */ - Extension->BusNumber = PartialResourceDescriptor->u.BusNumber.Start; - goto switch_195_break; - switch_195_2: /* CIL Label */ - *FoundIrq = 1; - Extension->FoundInterrupt = 1; - Extension->InterruptLevel = (unsigned char )PartialResourceDescriptor->u.Interrupt.Level; - Extension->InterruptVector = PartialResourceDescriptor->u.Interrupt.Vector; - Extension->InterruptAffinity = PartialResourceDescriptor->u.Interrupt.Affinity; - if ((int )PartialResourceDescriptor->Flags & 1) { - Extension->InterruptMode = 1; - } else { - Extension->InterruptMode = 0; - } - goto switch_195_break; - switch_195_4: /* CIL Label */ - *FoundDma = 1; - Extension->DmaChannel = PartialResourceDescriptor->u.Dma.Channel; - Extension->DmaPort = PartialResourceDescriptor->u.Dma.Port; - Extension->DmaWidth = PartialResourceDescriptor->Flags; - goto switch_195_break; - switch_195_default: /* CIL Label */ ; - goto switch_195_break; - } else { - switch_195_break: /* CIL Label */ ; - } } } } + i += 1UL; } + while_194_break: /* CIL Label */; } - i += 1UL; - } - while_194_break: /* CIL Label */ ; + } else { } - } else { - + return (status); } - return (status); -} } -BOOLEAN PptIsPci(PDEVICE_EXTENSION Extension , PIRP Irp ) -{ NTSTATUS status ; - PIO_STACK_LOCATION irpStack ; - PCM_RESOURCE_LIST ResourceList ; - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor ; - PCM_PARTIAL_RESOURCE_LIST PartialResourceList ; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor ; - ULONG i ; - ULONG portResourceDescriptorCount ; - BOOLEAN largePortRangeFound ; - ULONG rangeLength ; - - { - status = 0L; - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - portResourceDescriptorCount = 0; - largePortRangeFound = 0; - ResourceList = irpStack->Parameters.StartDevice.AllocatedResourcesTranslated; - if ((unsigned int )ResourceList == (unsigned int )((void *)0)) { - { - } - return (0); - } else { - - } - FullResourceDescriptor = & ResourceList->List[0]; - if (FullResourceDescriptor) { - { +BOOLEAN PptIsPci(PDEVICE_EXTENSION Extension, PIRP Irp) { + NTSTATUS status; + PIO_STACK_LOCATION irpStack; + PCM_RESOURCE_LIST ResourceList; + PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; + PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor; + ULONG i; + ULONG portResourceDescriptorCount; + BOOLEAN largePortRangeFound; + ULONG rangeLength; + + { + status = 0L; + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + portResourceDescriptorCount = 0; + largePortRangeFound = 0; + ResourceList = + irpStack->Parameters.StartDevice.AllocatedResourcesTranslated; + if ((unsigned int)ResourceList == (unsigned int)((void *)0)) { + {} + return (0); + } else { } - PartialResourceList = & FullResourceDescriptor->PartialResourceList; - i = 0; - { - while (1) { - while_202_continue: /* CIL Label */ ; - if (i < PartialResourceList->Count) { + FullResourceDescriptor = &ResourceList->List[0]; + if (FullResourceDescriptor) { + {} + PartialResourceList = &FullResourceDescriptor->PartialResourceList; + i = 0; + { + while (1) { + while_202_continue: /* CIL Label */; + if (i < PartialResourceList->Count) { - } else { - goto while_202_break; - } - PartialResourceDescriptor = & PartialResourceList->PartialDescriptors[i]; - if (PartialResourceDescriptor->Type == 1) { - goto switch_203_1; - } else { - { - goto switch_203_default; - if (0) { - switch_203_1: /* CIL Label */ - rangeLength = PartialResourceDescriptor->u.Port.Length; - { + } else { + goto while_202_break; } - portResourceDescriptorCount += 1UL; - if (rangeLength > 8UL) { + PartialResourceDescriptor = + &PartialResourceList->PartialDescriptors[i]; + if (PartialResourceDescriptor->Type == 1) { + goto switch_203_1; + } else { { + goto switch_203_default; + if (0) { + switch_203_1: /* CIL Label */ + rangeLength = PartialResourceDescriptor->u.Port.Length; + {} + portResourceDescriptorCount += 1UL; + if (rangeLength > 8UL) { + {} + largePortRangeFound = 1; + } else { + } + goto switch_203_break; + switch_203_default: /* CIL Label */; + {} + } else { + switch_203_break: /* CIL Label */; + } } - largePortRangeFound = 1; - } else { - - } - goto switch_203_break; - switch_203_default: /* CIL Label */ ; - { } - } else { - switch_203_break: /* CIL Label */ ; - } + i += 1UL; } + while_202_break: /* CIL Label */; } - i += 1UL; - } - while_202_break: /* CIL Label */ ; + } else { } - } else { - - } - if (portResourceDescriptorCount > 2UL) { - goto _L; - } else { - if (1 == (int )largePortRangeFound) { - _L: /* CIL Label */ - { - } - return (1); + if (portResourceDescriptorCount > 2UL) { + goto _L; } else { - { + if (1 == (int)largePortRangeFound) { + _L : /* CIL Label */ + {} + return (1); + } else { + {} + return (0); } - return (0); } } } -} -void PptCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) -{ +void PptCompleteRequest(PIRP Irp, CCHAR PriorityBoost) { { - { - IofCompleteRequest(Irp, PriorityBoost); + { IofCompleteRequest(Irp, PriorityBoost); } + return; } - return; } -} -static PDRIVER_DISPATCH PptPnpDispatchFunctionTable[25] ; -void PptPnpInitDispatchFunctionTable(void) -{ ULONG i = __VERIFIER_nondet_long() ; +static PDRIVER_DISPATCH PptPnpDispatchFunctionTable[25]; +void PptPnpInitDispatchFunctionTable(void) { + ULONG i = __VERIFIER_nondet_long(); { - PptPnpDispatchFunctionTable[i] = & PptPnpUnhandledIrp; - PptPnpDispatchFunctionTable[0] = & PptPnpStartDevice; - PptPnpDispatchFunctionTable[13] = & PptPnpFilterResourceRequirements; - PptPnpDispatchFunctionTable[7] = & PptPnpQueryDeviceRelations; - PptPnpDispatchFunctionTable[5] = & PptPnpQueryStopDevice; - PptPnpDispatchFunctionTable[6] = & PptPnpCancelStopDevice; - PptPnpDispatchFunctionTable[4] = & PptPnpStopDevice; - PptPnpDispatchFunctionTable[1] = & PptPnpQueryRemoveDevice; - PptPnpDispatchFunctionTable[3] = & PptPnpCancelRemoveDevice; - PptPnpDispatchFunctionTable[2] = & PptPnpRemoveDevice; - PptPnpDispatchFunctionTable[23] = & PptPnpSurpriseRemoval; - return; -} + PptPnpDispatchFunctionTable[i] = &PptPnpUnhandledIrp; + PptPnpDispatchFunctionTable[0] = &PptPnpStartDevice; + PptPnpDispatchFunctionTable[13] = &PptPnpFilterResourceRequirements; + PptPnpDispatchFunctionTable[7] = &PptPnpQueryDeviceRelations; + PptPnpDispatchFunctionTable[5] = &PptPnpQueryStopDevice; + PptPnpDispatchFunctionTable[6] = &PptPnpCancelStopDevice; + PptPnpDispatchFunctionTable[4] = &PptPnpStopDevice; + PptPnpDispatchFunctionTable[1] = &PptPnpQueryRemoveDevice; + PptPnpDispatchFunctionTable[3] = &PptPnpCancelRemoveDevice; + PptPnpDispatchFunctionTable[2] = &PptPnpRemoveDevice; + PptPnpDispatchFunctionTable[23] = &PptPnpSurpriseRemoval; + return; + } } -NTSTATUS PptPnpAddDevice(PDRIVER_OBJECT pDriverObject , PDEVICE_OBJECT pPhysicalDeviceObject ) -{ NTSTATUS status ; - PDEVICE_OBJECT parentDevice ; - PDEVICE_OBJECT pDeviceObject ; - PDEVICE_EXTENSION Extension ; - PCONFIGURATION_INFORMATION tmp ; +NTSTATUS PptPnpAddDevice(PDRIVER_OBJECT pDriverObject, + PDEVICE_OBJECT pPhysicalDeviceObject) { + NTSTATUS status; + PDEVICE_OBJECT parentDevice; + PDEVICE_OBJECT pDeviceObject; + PDEVICE_EXTENSION Extension; + PCONFIGURATION_INFORMATION tmp; { - status = 0L; - { - } - { - pDeviceObject = PptBuildDeviceObject(pDriverObject, pPhysicalDeviceObject); - } - if ((unsigned int )((void *)0) == (unsigned int )pDeviceObject) { - { + status = 0L; + {} { + pDeviceObject = + PptBuildDeviceObject(pDriverObject, pPhysicalDeviceObject); } - return (-1073741823L); - } else { - - } - { - Extension = pDeviceObject->DeviceExtension; - status = IoRegisterDeviceInterface(pPhysicalDeviceObject, & GUID_PARALLEL_DEVICE, - (void *)0, & Extension->SymbolicLinkName); - } - if (! (status >= 0L)) { - { + if ((unsigned int)((void *)0) == (unsigned int)pDeviceObject) { + {} + return (-1073741823L); + } else { } { -/* IoDeleteDevice(pDeviceObject); */ /* INLINED */ + Extension = pDeviceObject->DeviceExtension; + status = IoRegisterDeviceInterface(pPhysicalDeviceObject, + &GUID_PARALLEL_DEVICE, (void *)0, + &Extension->SymbolicLinkName); + } + if (!(status >= 0L)) { + {} { /* IoDeleteDevice(pDeviceObject); */ /* INLINED */ + } + return (status); + } else { } - return (status); - } else { - - } - { - parentDevice = IoAttachDeviceToDeviceStack(pDeviceObject, pPhysicalDeviceObject); - } - if ((unsigned int )((void *)0) == (unsigned int )parentDevice) { { + parentDevice = + IoAttachDeviceToDeviceStack(pDeviceObject, pPhysicalDeviceObject); + } + if ((unsigned int)((void *)0) == (unsigned int)parentDevice) { + {} { /* IoDeleteDevice(pDeviceObject); */ /* INLINED */ + } + return (-1073741823L); + } else { } { -/* IoDeleteDevice(pDeviceObject); */ /* INLINED */ + Extension->ParentDeviceObject = parentDevice; + tmp = IoGetConfigurationInformation(); + tmp->ParallelCount += 1UL; + pDeviceObject->Flags &= 4294967167UL; } - return (-1073741823L); - } else { - - } - { - Extension->ParentDeviceObject = parentDevice; - tmp = IoGetConfigurationInformation(); - tmp->ParallelCount += 1UL; - pDeviceObject->Flags &= 4294967167UL; - } - { + {} + return (0L); } - return (0L); } -} -NTSTATUS PptDispatchPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - NTSTATUS status ; - PIO_STACK_LOCATION irpStack ; - UCHAR minorFunction ; +NTSTATUS PptDispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + NTSTATUS status; + PIO_STACK_LOCATION irpStack; + UCHAR minorFunction; { - { - PptDebugDumpPnpIrpInfo(DeviceObject, Irp); - status = PptAcquireRemoveLockOrFailIrp(DeviceObject, Irp); - } - if (status >= 0L) { - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - minorFunction = irpStack->MinorFunction; - if ((int )minorFunction > 24) { - { - status = PptPnpUnhandledIrp(DeviceObject, Irp); - } - } else { - if (__BLAST_NONDET == 0) { - goto switch_214_0; + { + PptDebugDumpPnpIrpInfo(DeviceObject, Irp); + status = PptAcquireRemoveLockOrFailIrp(DeviceObject, Irp); + } + if (status >= 0L) { + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + minorFunction = irpStack->MinorFunction; + if ((int)minorFunction > 24) { + { status = PptPnpUnhandledIrp(DeviceObject, Irp); } } else { - if (__BLAST_NONDET == 1) { - goto switch_214_1; + if (__BLAST_NONDET == 0) { + goto switch_214_0; } else { - if (__BLAST_NONDET == 2) { - goto switch_214_2; + if (__BLAST_NONDET == 1) { + goto switch_214_1; } else { - if (__BLAST_NONDET == 3) { - goto switch_214_3; + if (__BLAST_NONDET == 2) { + goto switch_214_2; } else { - if (__BLAST_NONDET == 4) { - goto switch_214_4; + if (__BLAST_NONDET == 3) { + goto switch_214_3; } else { - if (__BLAST_NONDET == 5) { - goto switch_214_5; + if (__BLAST_NONDET == 4) { + goto switch_214_4; } else { - if (__BLAST_NONDET == 6) { - goto switch_214_6; + if (__BLAST_NONDET == 5) { + goto switch_214_5; } else { - if (__BLAST_NONDET == 7) { - goto switch_214_7; + if (__BLAST_NONDET == 6) { + goto switch_214_6; } else { - if (__BLAST_NONDET == 8) { - goto switch_214_8; + if (__BLAST_NONDET == 7) { + goto switch_214_7; } else { - if (__BLAST_NONDET == 9) { - goto switch_214_9; + if (__BLAST_NONDET == 8) { + goto switch_214_8; } else { - { - goto switch_214_default; - if (0) { - switch_214_0: /* CIL Label */ - { - status = PptPnpUnhandledIrp(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_1: /* CIL Label */ - { - status = PptPnpStartDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_2: /* CIL Label */ - { - status = PptPnpFilterResourceRequirements(DeviceObject, - Irp); - } - goto switch_214_break; - switch_214_3: /* CIL Label */ - { - status = PptPnpQueryDeviceRelations(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_4: /* CIL Label */ - { - status = PptPnpQueryStopDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_5: /* CIL Label */ - { - status = PptPnpCancelStopDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_6: /* CIL Label */ - { - status = PptPnpStopDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_7: /* CIL Label */ - { - status = PptPnpQueryRemoveDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_8: /* CIL Label */ - { - status = PptPnpCancelRemoveDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_9: /* CIL Label */ - { - status = PptPnpRemoveDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_default: /* CIL Label */ + if (__BLAST_NONDET == 9) { + goto switch_214_9; + } else { { - status = PptPnpSurpriseRemoval(DeviceObject, Irp); + goto switch_214_default; + if (0) { + switch_214_0 : /* CIL Label */ + { + status = PptPnpUnhandledIrp(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_1 : /* CIL Label */ + { + status = PptPnpStartDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_2 : /* CIL Label */ + { + status = PptPnpFilterResourceRequirements( + DeviceObject, Irp); + } + goto switch_214_break; + switch_214_3 : /* CIL Label */ + { + status = PptPnpQueryDeviceRelations( + DeviceObject, Irp); + } + goto switch_214_break; + switch_214_4 : /* CIL Label */ + { + status = + PptPnpQueryStopDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_5 : /* CIL Label */ + { + status = + PptPnpCancelStopDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_6 : /* CIL Label */ + { + status = PptPnpStopDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_7 : /* CIL Label */ + { + status = + PptPnpQueryRemoveDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_8 : /* CIL Label */ + { + status = + PptPnpCancelRemoveDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_9 : /* CIL Label */ + { + status = PptPnpRemoveDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_default : /* CIL Label */ + { + status = + PptPnpSurpriseRemoval(DeviceObject, Irp); + } + goto switch_214_break; + } else { + switch_214_break: /* CIL Label */; + } } - goto switch_214_break; - } else { - switch_214_break: /* CIL Label */ ; - } } } } @@ -6650,2973 +6464,2776 @@ NTSTATUS PptDispatchPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } + } else { } - } else { - + return (status); } - return (status); } -} -NTSTATUS PptPnpStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS status ; - BOOLEAN foundPort ; - BOOLEAN foundIrq ; - BOOLEAN foundDma ; +NTSTATUS PptPnpStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS status; + BOOLEAN foundPort; + BOOLEAN foundIrq; + BOOLEAN foundDma; { - { - extension = DeviceObject->DeviceExtension; - foundPort = 0; - foundIrq = 0; - foundDma = 0; - status = PptPnpBounceAndCatchPnpIrp(extension, Irp); - } - if (! (status >= 0L)) { - if (status != -1073741637L) { - goto targetExit; + { + extension = DeviceObject->DeviceExtension; + foundPort = 0; + foundIrq = 0; + foundDma = 0; + status = PptPnpBounceAndCatchPnpIrp(extension, Irp); + } + if (!(status >= 0L)) { + if (status != -1073741637L) { + goto targetExit; + } else { + } } else { - } - } else { - - } - { - status = PptPnpStartScanCmResourceList(extension, Irp, & foundPort, & foundIrq, - & foundDma); - } - if (! (status >= 0L)) { - goto targetExit; - } else { - - } - { - status = PptPnpStartValidateResources(DeviceObject, foundPort, foundIrq, foundDma); - } - if (! (status >= 0L)) { - goto targetExit; - } else { - - } - { - extension->PnpInfo.Ieee1284_3DeviceCount = PptInitiate1284_3(extension); - status = PptDetectChipFilter(extension); - } - if (! (status >= 0L)) { { - PptDetectPortType(extension); + status = PptPnpStartScanCmResourceList(extension, Irp, &foundPort, + &foundIrq, &foundDma); + } + if (!(status >= 0L)) { + goto targetExit; + } else { } - } else { - - } - { - status = PptWmiInitWmi(DeviceObject); - } - if (! (status >= 0L)) { - goto targetExit; - } else { - - } - { - status = IoSetDeviceInterfaceState(& extension->SymbolicLinkName, 1); - } - if (! (status >= 0L)) { - status = -1073741637L; - } else { - - } - targetExit: - if (status >= 0L) { - { -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - extension->DeviceStateFlags |= 1UL; -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - } - } else { - - } - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); - PptReleaseRemoveLock(& extension->RemoveLock, Irp); - } - return (status); -} -} -NTSTATUS PptPnpStartScanCmResourceList(PDEVICE_EXTENSION Extension , PIRP Irp , PBOOLEAN FoundPort , - PBOOLEAN FoundIrq , PBOOLEAN FoundDma ) -{ NTSTATUS status ; - PIO_STACK_LOCATION irpStack ; - PCM_RESOURCE_LIST ResourceList ; - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor ; - PCM_PARTIAL_RESOURCE_LIST PartialResourceList ; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor ; - ULONG i ; - PHYSICAL_ADDRESS start ; - ULONG length ; - BOOLEAN isPci ; - BOOLEAN tmp ; - BOOLEAN tmp___0 ; - BOOLEAN tmp___1 ; - - { - status = 0L; - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - isPci = 0; - *FoundPort = 0; - *FoundIrq = 0; - *FoundDma = 0; - ResourceList = irpStack->Parameters.StartDevice.AllocatedResourcesTranslated; - if ((unsigned int )ResourceList == (unsigned int )((void *)0)) { { + status = PptPnpStartValidateResources(DeviceObject, foundPort, foundIrq, + foundDma); + } + if (!(status >= 0L)) { + goto targetExit; + } else { } - status = -1073741670L; - goto targetExit; - } else { - - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture != 1) { { - tmp = PptIsPci(Extension, Irp); + extension->PnpInfo.Ieee1284_3DeviceCount = PptInitiate1284_3(extension); + status = PptDetectChipFilter(extension); } - if (1 == (int )tmp) { - { - } + if (!(status >= 0L)) { + { PptDetectPortType(extension); } + } else { + } + { status = PptWmiInitWmi(DeviceObject); } + if (!(status >= 0L)) { + goto targetExit; + } else { + } + { status = IoSetDeviceInterfaceState(&extension->SymbolicLinkName, 1); } + if (!(status >= 0L)) { + status = -1073741637L; + } else { + } + targetExit: + if (status >= 0L) { { - status = PptPnpStartScanPciCardCmResourceList(Extension, Irp, FoundPort, FoundIrq, - FoundDma); - isPci = 1; + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED + */ + extension->DeviceStateFlags |= 1UL; + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED + */ } - goto targetExit; } else { - } - } else { - - } - FullResourceDescriptor = & ResourceList->List[0]; - if (FullResourceDescriptor) { - Extension->InterfaceType = FullResourceDescriptor->InterfaceType; - PartialResourceList = & FullResourceDescriptor->PartialResourceList; - i = 0; { - while (1) { - while_217_continue: /* CIL Label */ ; - if (i < PartialResourceList->Count) { - + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); + PptReleaseRemoveLock(&extension->RemoveLock, Irp); + } + return (status); + } +} +NTSTATUS PptPnpStartScanCmResourceList(PDEVICE_EXTENSION Extension, PIRP Irp, + PBOOLEAN FoundPort, PBOOLEAN FoundIrq, + PBOOLEAN FoundDma) { + NTSTATUS status; + PIO_STACK_LOCATION irpStack; + PCM_RESOURCE_LIST ResourceList; + PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; + PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor; + ULONG i; + PHYSICAL_ADDRESS start; + ULONG length; + BOOLEAN isPci; + BOOLEAN tmp; + BOOLEAN tmp___0; + BOOLEAN tmp___1; + + { + status = 0L; + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + isPci = 0; + *FoundPort = 0; + *FoundIrq = 0; + *FoundDma = 0; + ResourceList = + irpStack->Parameters.StartDevice.AllocatedResourcesTranslated; + if ((unsigned int)ResourceList == (unsigned int)((void *)0)) { + {} + status = -1073741670L; + goto targetExit; + } else { + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture != 1) { + { tmp = PptIsPci(Extension, Irp); } + if (1 == (int)tmp) { + {} { + status = PptPnpStartScanPciCardCmResourceList( + Extension, Irp, FoundPort, FoundIrq, FoundDma); + isPci = 1; + } + goto targetExit; } else { - goto while_217_break; } - PartialResourceDescriptor = & PartialResourceList->PartialDescriptors[i]; - if (PartialResourceDescriptor->Type == 1) { - goto switch_218_1; - } else { - if (PartialResourceDescriptor->Type == 6) { - goto switch_218_6; - } else { - if (PartialResourceDescriptor->Type == 2) { - goto switch_218_2; + } else { + } + FullResourceDescriptor = &ResourceList->List[0]; + if (FullResourceDescriptor) { + Extension->InterfaceType = FullResourceDescriptor->InterfaceType; + PartialResourceList = &FullResourceDescriptor->PartialResourceList; + i = 0; + { + while (1) { + while_217_continue: /* CIL Label */; + if (i < PartialResourceList->Count) { + } else { - if (PartialResourceDescriptor->Type == 4) { - goto switch_218_4; + goto while_217_break; + } + PartialResourceDescriptor = + &PartialResourceList->PartialDescriptors[i]; + if (PartialResourceDescriptor->Type == 1) { + goto switch_218_1; + } else { + if (PartialResourceDescriptor->Type == 6) { + goto switch_218_6; } else { - { - goto switch_218_default; - if (0) { - switch_218_1: /* CIL Label */ - start = PartialResourceDescriptor->u.Port.Start; - length = PartialResourceDescriptor->u.Port.Length; - { - } - *FoundPort = 1; - if (Extension->PortInfo.OriginalController.__annonCompField1.LowPart == 0UL) { - if (Extension->PortInfo.OriginalController.__annonCompField1.HighPart == 0L) { - { - } - Extension->PortInfo.OriginalController = PartialResourceDescriptor->u.Port.Start; - Extension->PortInfo.SpanOfController = PartialResourceDescriptor->u.Port.Length; - Extension->PortInfo.Controller = (UCHAR *)((unsigned long )Extension->PortInfo.OriginalController.QuadPart); - Extension->AddressSpace = PartialResourceDescriptor->Flags; - if (Extension->PortInfo.SpanOfController == 4096UL) { - { - tmp___0 = PptIsNecR98Machine(); - } - if (tmp___0) { - Extension->PortInfo.SpanOfController = 8; - } else { - - } - } else { - - } - } else { - goto _L___0; - } + if (PartialResourceDescriptor->Type == 2) { + goto switch_218_2; + } else { + if (PartialResourceDescriptor->Type == 4) { + goto switch_218_4; } else { - _L___0: /* CIL Label */ - if (Extension->PnpInfo.OriginalEcpController.__annonCompField1.LowPart == 0UL) { - if (Extension->PnpInfo.OriginalEcpController.__annonCompField1.HighPart == 0L) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture != 1) { - if (PartialResourceDescriptor->u.Port.Start.__annonCompField1.LowPart < Extension->PortInfo.OriginalController.__annonCompField1.LowPart) { - if (PartialResourceDescriptor->u.Port.Start.__annonCompField1.HighPart < Extension->PortInfo.OriginalController.__annonCompField1.HighPart) { - { + { + goto switch_218_default; + if (0) { + switch_218_1: /* CIL Label */ + start = PartialResourceDescriptor->u.Port.Start; + length = PartialResourceDescriptor->u.Port.Length; + {} *FoundPort = 1; + if (Extension->PortInfo.OriginalController + .__annonCompField1.LowPart == 0UL) { + if (Extension->PortInfo.OriginalController + .__annonCompField1.HighPart == 0L) { + {} + Extension->PortInfo.OriginalController = + PartialResourceDescriptor->u.Port.Start; + Extension->PortInfo.SpanOfController = + PartialResourceDescriptor->u.Port.Length; + Extension->PortInfo.Controller = + (UCHAR *)((unsigned long)Extension->PortInfo + .OriginalController.QuadPart); + Extension->AddressSpace = + PartialResourceDescriptor->Flags; + if (Extension->PortInfo.SpanOfController == 4096UL) { + { tmp___0 = PptIsNecR98Machine(); } + if (tmp___0) { + Extension->PortInfo.SpanOfController = 8; + } else { } - Extension->PnpInfo.OriginalEcpController = Extension->PortInfo.OriginalController; - Extension->PnpInfo.SpanOfEcpController = Extension->PortInfo.SpanOfController; - Extension->PnpInfo.EcpController = Extension->PortInfo.Controller; - Extension->EcpAddressSpace = Extension->AddressSpace; - Extension->PortInfo.OriginalController = PartialResourceDescriptor->u.Port.Start; - Extension->PortInfo.SpanOfController = PartialResourceDescriptor->u.Port.Length; - Extension->PortInfo.Controller = (UCHAR *)((unsigned long )Extension->PortInfo.OriginalController.QuadPart); - Extension->AddressSpace = PartialResourceDescriptor->Flags; - if (Extension->PortInfo.SpanOfController == 4096UL) { - { - tmp___1 = PptIsNecR98Machine(); - } - if (tmp___1) { - Extension->PortInfo.SpanOfController = 8; + } else { + } + } else { + goto _L___0; + } + } else { + _L___0: /* CIL Label */ + if (Extension->PnpInfo.OriginalEcpController + .__annonCompField1.LowPart == 0UL) { + if (Extension->PnpInfo.OriginalEcpController + .__annonCompField1.HighPart == 0L) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture != 1) { + if (PartialResourceDescriptor->u.Port.Start + .__annonCompField1.LowPart < + Extension->PortInfo.OriginalController + .__annonCompField1.LowPart) { + if (PartialResourceDescriptor->u.Port.Start + .__annonCompField1.HighPart < + Extension->PortInfo.OriginalController + .__annonCompField1.HighPart) { + {} + Extension->PnpInfo.OriginalEcpController = + Extension->PortInfo.OriginalController; + Extension->PnpInfo.SpanOfEcpController = + Extension->PortInfo.SpanOfController; + Extension->PnpInfo.EcpController = + Extension->PortInfo.Controller; + Extension->EcpAddressSpace = + Extension->AddressSpace; + Extension->PortInfo.OriginalController = + PartialResourceDescriptor->u.Port.Start; + Extension->PortInfo.SpanOfController = + PartialResourceDescriptor->u.Port.Length; + Extension->PortInfo.Controller = + (UCHAR + *)((unsigned long)Extension->PortInfo + .OriginalController.QuadPart); + Extension->AddressSpace = + PartialResourceDescriptor->Flags; + if (Extension->PortInfo.SpanOfController == + 4096UL) { + { tmp___1 = PptIsNecR98Machine(); } + if (tmp___1) { + Extension->PortInfo.SpanOfController = 8; + } else { + } + } else { + } + } else { + goto _L; + } } else { - + _L : /* CIL Label */ + {} + Extension->PnpInfo.OriginalEcpController = + PartialResourceDescriptor->u.Port.Start; + Extension->PnpInfo.SpanOfEcpController = + PartialResourceDescriptor->u.Port.Length; + Extension->PnpInfo.EcpController = + (UCHAR *)((unsigned long)Extension->PnpInfo + .OriginalEcpController + .QuadPart); + Extension->EcpAddressSpace = + PartialResourceDescriptor->Flags; } } else { - } } else { - goto _L; } } else { - _L: /* CIL Label */ - { - } - Extension->PnpInfo.OriginalEcpController = PartialResourceDescriptor->u.Port.Start; - Extension->PnpInfo.SpanOfEcpController = PartialResourceDescriptor->u.Port.Length; - Extension->PnpInfo.EcpController = (UCHAR *)((unsigned long )Extension->PnpInfo.OriginalEcpController.QuadPart); - Extension->EcpAddressSpace = PartialResourceDescriptor->Flags; } + } + goto switch_218_break; + switch_218_6: /* CIL Label */ + Extension->BusNumber = + PartialResourceDescriptor->u.BusNumber.Start; + goto switch_218_break; + switch_218_2: /* CIL Label */ + *FoundIrq = 1; + Extension->FoundInterrupt = 1; + Extension->InterruptLevel = + (unsigned char) + PartialResourceDescriptor->u.Interrupt.Level; + Extension->InterruptVector = + PartialResourceDescriptor->u.Interrupt.Vector; + Extension->InterruptAffinity = + PartialResourceDescriptor->u.Interrupt.Affinity; + if ((int)PartialResourceDescriptor->Flags & 1) { + Extension->InterruptMode = 1; } else { - + Extension->InterruptMode = 0; } + goto switch_218_break; + switch_218_4: /* CIL Label */ + *FoundDma = 1; + Extension->DmaChannel = + PartialResourceDescriptor->u.Dma.Channel; + Extension->DmaPort = + PartialResourceDescriptor->u.Dma.Port; + Extension->DmaWidth = PartialResourceDescriptor->Flags; + goto switch_218_break; + switch_218_default: /* CIL Label */; + goto switch_218_break; } else { - + switch_218_break: /* CIL Label */; } - } else { - } } - goto switch_218_break; - switch_218_6: /* CIL Label */ - Extension->BusNumber = PartialResourceDescriptor->u.BusNumber.Start; - goto switch_218_break; - switch_218_2: /* CIL Label */ - *FoundIrq = 1; - Extension->FoundInterrupt = 1; - Extension->InterruptLevel = (unsigned char )PartialResourceDescriptor->u.Interrupt.Level; - Extension->InterruptVector = PartialResourceDescriptor->u.Interrupt.Vector; - Extension->InterruptAffinity = PartialResourceDescriptor->u.Interrupt.Affinity; - if ((int )PartialResourceDescriptor->Flags & 1) { - Extension->InterruptMode = 1; - } else { - Extension->InterruptMode = 0; - } - goto switch_218_break; - switch_218_4: /* CIL Label */ - *FoundDma = 1; - Extension->DmaChannel = PartialResourceDescriptor->u.Dma.Channel; - Extension->DmaPort = PartialResourceDescriptor->u.Dma.Port; - Extension->DmaWidth = PartialResourceDescriptor->Flags; - goto switch_218_break; - switch_218_default: /* CIL Label */ ; - goto switch_218_break; - } else { - switch_218_break: /* CIL Label */ ; - } } } } + i += 1UL; } + while_217_break: /* CIL Label */; } - i += 1UL; - } - while_217_break: /* CIL Label */ ; - } - } else { - - } - targetExit: - if (0 == (int )isPci) { - { - } - { - } - { + } else { } - { + targetExit: + if (0 == (int)isPci) { + {} {} {} {} + } else { } - } else { - + return (status); } - return (status); } -} -NTSTATUS PptPnpStartValidateResources(PDEVICE_OBJECT DeviceObject , BOOLEAN FoundPort , - BOOLEAN FoundIrq , BOOLEAN FoundDma ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS status ; +NTSTATUS PptPnpStartValidateResources(PDEVICE_OBJECT DeviceObject, + BOOLEAN FoundPort, BOOLEAN FoundIrq, + BOOLEAN FoundDma) { + PDEVICE_EXTENSION extension; + NTSTATUS status; { - extension = DeviceObject->DeviceExtension; - status = 0L; - if (! FoundPort) { - status = -1073741810L; - } else { - extension->PortInfo.Controller = (UCHAR *)((unsigned long )extension->PortInfo.OriginalController.QuadPart); - if (! extension->PortInfo.Controller) { - { - PptLogError(DeviceObject->DriverObject, DeviceObject, extension->PortInfo.OriginalController, - PhysicalZero, 0, 0, 0, 10, 0L, 4); - status = -1073741709L; - } + extension = DeviceObject->DeviceExtension; + status = 0L; + if (!FoundPort) { + status = -1073741810L; } else { - + extension->PortInfo.Controller = + (UCHAR *)((unsigned long) + extension->PortInfo.OriginalController.QuadPart); + if (!extension->PortInfo.Controller) { + { + PptLogError(DeviceObject->DriverObject, DeviceObject, + extension->PortInfo.OriginalController, PhysicalZero, 0, + 0, 0, 10, 0L, 4); + status = -1073741709L; + } + } else { + } } + return (status); } - return (status); -} } -NTSTATUS PptPnpFilterResourceRequirements(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - ULONG filterResourceMethod ; - PIO_RESOURCE_REQUIREMENTS_LIST pResourceRequirementsIn ; - NTSTATUS status ; - PIO_STACK_LOCATION IrpStack ; - BOOLEAN tmp ; - BOOLEAN tmp___0 ; +NTSTATUS PptPnpFilterResourceRequirements(PDEVICE_OBJECT DeviceObject, + PIRP Irp) { + PDEVICE_EXTENSION extension; + ULONG filterResourceMethod; + PIO_RESOURCE_REQUIREMENTS_LIST pResourceRequirementsIn; + NTSTATUS status; + PIO_STACK_LOCATION IrpStack; + BOOLEAN tmp; + BOOLEAN tmp___0; { - { - extension = DeviceObject->DeviceExtension; - filterResourceMethod = 1; - status = PptPnpBounceAndCatchPnpIrp(extension, Irp); - } - if (! (status >= 0L)) { - if (status != -1073741637L) { - goto targetExit; - } else { - + { + extension = DeviceObject->DeviceExtension; + filterResourceMethod = 1; + status = PptPnpBounceAndCatchPnpIrp(extension, Irp); } - } else { - - } - if (Irp->IoStatus.Information == 0UL) { - IrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - pResourceRequirementsIn = IrpStack->Parameters.FilterResourceRequirements.IoResourceRequirementList; - if ((unsigned int )pResourceRequirementsIn == (unsigned int )((void *)0)) { - goto targetExit; + if (!(status >= 0L)) { + if (status != -1073741637L) { + goto targetExit; + } else { + } } else { - } - } else { - pResourceRequirementsIn = (struct _IO_RESOURCE_REQUIREMENTS_LIST *)Irp->IoStatus.Information; - } - { - } - { - } - { - PptDebugDumpResourceRequirementsList(pResourceRequirementsIn); - } - if (filterResourceMethod == 1) { - goto switch_229_1; - } else { - if (filterResourceMethod == 0) { - goto switch_229_0; - } else { - if (filterResourceMethod == 2) { - goto switch_229_2; + if (Irp->IoStatus.Information == 0UL) { + IrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + pResourceRequirementsIn = IrpStack->Parameters.FilterResourceRequirements + .IoResourceRequirementList; + if ((unsigned int)pResourceRequirementsIn == (unsigned int)((void *)0)) { + goto targetExit; } else { - { - goto switch_229_default; - if (0) { - switch_229_1: /* CIL Label */ ; - { - } - { - tmp = PptPnpFilterExistsNonIrqResourceList(pResourceRequirementsIn); - } - if (tmp) { - { - } - { - PptPnpFilterRemoveIrqResourceLists(pResourceRequirementsIn); - } - } else { - { - } - { - PptPnpFilterNukeIrqResourceDescriptorsFromAllLists(pResourceRequirementsIn); - } - } - { - } - { - PptDebugDumpResourceRequirementsList(pResourceRequirementsIn); - } - goto switch_229_break; - switch_229_0: /* CIL Label */ ; - { - } - { - tmp___0 = PptPnpFilterExistsNonIrqResourceList(pResourceRequirementsIn); - } - if (tmp___0) { - { - } - { - PptPnpFilterRemoveIrqResourceLists(pResourceRequirementsIn); - } - { - } - { - PptDebugDumpResourceRequirementsList(pResourceRequirementsIn); - } - } else { - { - } - } - goto switch_229_break; - switch_229_2: /* CIL Label */ ; - { - } - goto switch_229_break; - switch_229_default: /* CIL Label */ ; + } + } else { + pResourceRequirementsIn = + (struct _IO_RESOURCE_REQUIREMENTS_LIST *)Irp->IoStatus.Information; + } + {} {} { PptDebugDumpResourceRequirementsList(pResourceRequirementsIn); } + if (filterResourceMethod == 1) { + goto switch_229_1; + } else { + if (filterResourceMethod == 0) { + goto switch_229_0; + } else { + if (filterResourceMethod == 2) { + goto switch_229_2; + } else { { + goto switch_229_default; + if (0) { + switch_229_1: /* CIL Label */; + {} { + tmp = PptPnpFilterExistsNonIrqResourceList( + pResourceRequirementsIn); + } + if (tmp) { + {} { + PptPnpFilterRemoveIrqResourceLists(pResourceRequirementsIn); + } + } else { + {} { + PptPnpFilterNukeIrqResourceDescriptorsFromAllLists( + pResourceRequirementsIn); + } + } + {} { + PptDebugDumpResourceRequirementsList(pResourceRequirementsIn); + } + goto switch_229_break; + switch_229_0: /* CIL Label */; + {} { + tmp___0 = PptPnpFilterExistsNonIrqResourceList( + pResourceRequirementsIn); + } + if (tmp___0) { + {} { + PptPnpFilterRemoveIrqResourceLists(pResourceRequirementsIn); + } + {} { + PptDebugDumpResourceRequirementsList(pResourceRequirementsIn); + } + } else { + {} + } + goto switch_229_break; + switch_229_2: /* CIL Label */; + {} + goto switch_229_break; + switch_229_default: /* CIL Label */; + {} + } else { + switch_229_break: /* CIL Label */; + } } - } else { - switch_229_break: /* CIL Label */ ; - } } } } + targetExit : { + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + PptCompleteRequest(Irp, 0); + PptReleaseRemoveLock(&extension->RemoveLock, Irp); } - targetExit: - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - PptCompleteRequest(Irp, 0); - PptReleaseRemoveLock(& extension->RemoveLock, Irp); + return (status); } - return (status); } -} -BOOLEAN PptPnpFilterExistsNonIrqResourceList(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) -{ ULONG listCount ; - PIO_RESOURCE_LIST curList ; - ULONG i ; - ULONG remain ; - PIO_RESOURCE_DESCRIPTOR curDesc ; - BOOLEAN foundIrq ; +BOOLEAN PptPnpFilterExistsNonIrqResourceList( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList) { + ULONG listCount; + PIO_RESOURCE_LIST curList; + ULONG i; + ULONG remain; + PIO_RESOURCE_DESCRIPTOR curDesc; + BOOLEAN foundIrq; { - listCount = ResourceRequirementsList->AlternativeLists; - { - } - i = 0; - curList = ResourceRequirementsList->List; - { - while (1) { - while_241_continue: /* CIL Label */ ; - if (i < listCount) { - - } else { - goto while_241_break; - } - { - } - remain = curList->Count; - curDesc = curList->Descriptors; - foundIrq = 0; + listCount = ResourceRequirementsList->AlternativeLists; + {} + i = 0; + curList = ResourceRequirementsList->List; { - while (1) { - while_243_continue: /* CIL Label */ ; - if (remain) { + while (1) { + while_241_continue: /* CIL Label */; + if (i < listCount) { - } else { - goto while_243_break; - } - { - } - if ((int )curDesc->Type == 2) { - { + } else { + goto while_241_break; } - foundIrq = 1; - goto while_243_break; - } else { + {} + remain = curList->Count; + curDesc = curList->Descriptors; + foundIrq = 0; + { + while (1) { + while_243_continue: /* CIL Label */; + if (remain) { + } else { + goto while_243_break; + } + {} + if ((int)curDesc->Type == 2) { + {} + foundIrq = 1; + goto while_243_break; + } else { + } + curDesc += 1; + remain -= 1UL; + } + while_243_break: /* CIL Label */; + } + if ((int)foundIrq == 0) { + {} + return (1); + } else { + } + curList = + (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); + i += 1UL; } - curDesc += 1; - remain -= 1UL; - } - while_243_break: /* CIL Label */ ; - } - if ((int )foundIrq == 0) { - { - } - return (1); - } else { - + while_241_break: /* CIL Label */; } - curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); - i += 1UL; - } - while_241_break: /* CIL Label */ ; - } - { + {} + return (0); } - return (0); } -} -void PptPnpFilterRemoveIrqResourceLists(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) -{ ULONG listCount ; - PIO_RESOURCE_LIST curList ; - PIO_RESOURCE_LIST nextList ; - ULONG i ; - PCHAR currentEndOfResourceRequirementsList ; - LONG bytesToMove ; - PVOID tmp ; - BOOLEAN tmp___0 ; +void PptPnpFilterRemoveIrqResourceLists( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList) { + ULONG listCount; + PIO_RESOURCE_LIST curList; + PIO_RESOURCE_LIST nextList; + ULONG i; + PCHAR currentEndOfResourceRequirementsList; + LONG bytesToMove; + PVOID tmp; + BOOLEAN tmp___0; { - listCount = ResourceRequirementsList->AlternativeLists; - { - } - { - tmp = PptPnpFilterGetEndOfResourceRequirementsList(ResourceRequirementsList); - currentEndOfResourceRequirementsList = tmp; - i = 0; - curList = ResourceRequirementsList->List; - } - { - while (1) { - while_249_continue: /* CIL Label */ ; - if (i < listCount) { - - } else { - goto while_249_break; - } - { + listCount = ResourceRequirementsList->AlternativeLists; + {} { + tmp = PptPnpFilterGetEndOfResourceRequirementsList( + ResourceRequirementsList); + currentEndOfResourceRequirementsList = tmp; + i = 0; + curList = ResourceRequirementsList->List; } { - } - { - tmp___0 = PptPnpListContainsIrqResourceDescriptor(curList); - } - if (tmp___0) { - { - } - nextList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); - bytesToMove = (long )(currentEndOfResourceRequirementsList - (CHAR *)nextList); - if (bytesToMove > 0L) { - { - memmove(curList, nextList, bytesToMove); - currentEndOfResourceRequirementsList -= (CHAR *)nextList - (CHAR *)curList; - } - } else { + while (1) { + while_249_continue: /* CIL Label */; + if (i < listCount) { + } else { + goto while_249_break; + } + {} {} { tmp___0 = PptPnpListContainsIrqResourceDescriptor(curList); } + if (tmp___0) { + {} + nextList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + + curList->Count); + bytesToMove = + (long)(currentEndOfResourceRequirementsList - (CHAR *)nextList); + if (bytesToMove > 0L) { + { + memmove(curList, nextList, bytesToMove); + currentEndOfResourceRequirementsList -= + (CHAR *)nextList - (CHAR *)curList; + } + } else { + } + listCount -= 1UL; + } else { + {} + curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + + curList->Count); + i += 1UL; + } } - listCount -= 1UL; - } else { - { - } - curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); - i += 1UL; + while_249_break: /* CIL Label */; } + ResourceRequirementsList->AlternativeLists = listCount; + {} + return; } - while_249_break: /* CIL Label */ ; - } - ResourceRequirementsList->AlternativeLists = listCount; - { - } - return; -} } -PVOID PptPnpFilterGetEndOfResourceRequirementsList(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) -{ ULONG listCount ; - PIO_RESOURCE_LIST curList ; - ULONG i ; +PVOID PptPnpFilterGetEndOfResourceRequirementsList( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList) { + ULONG listCount; + PIO_RESOURCE_LIST curList; + ULONG i; { - listCount = ResourceRequirementsList->AlternativeLists; - i = 0; - curList = ResourceRequirementsList->List; - { - while (1) { - while_255_continue: /* CIL Label */ ; - if (i < listCount) { + listCount = ResourceRequirementsList->AlternativeLists; + i = 0; + curList = ResourceRequirementsList->List; + { + while (1) { + while_255_continue: /* CIL Label */; + if (i < listCount) { - } else { - goto while_255_break; + } else { + goto while_255_break; + } + curList = + (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); + i += 1UL; + } + while_255_break: /* CIL Label */; } - curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); - i += 1UL; - } - while_255_break: /* CIL Label */ ; + return ((void *)curList); } - return ((void *)curList); } -} -void PptPnpFilterNukeIrqResourceDescriptorsFromAllLists(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) -{ ULONG listCount ; - ULONG i ; - PIO_RESOURCE_LIST curList ; +void PptPnpFilterNukeIrqResourceDescriptorsFromAllLists( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList) { + ULONG listCount; + ULONG i; + PIO_RESOURCE_LIST curList; { - listCount = ResourceRequirementsList->AlternativeLists; - i = 0; - curList = ResourceRequirementsList->List; - { - } - { - while (1) { - while_257_continue: /* CIL Label */ ; - if (i < listCount) { + listCount = ResourceRequirementsList->AlternativeLists; + i = 0; + curList = ResourceRequirementsList->List; + {} { + while (1) { + while_257_continue: /* CIL Label */; + if (i < listCount) { - } else { - goto while_257_break; - } - { - } - { - PptPnpFilterNukeIrqResourceDescriptors(curList); - curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); - i += 1UL; + } else { + goto while_257_break; + } + {} { + PptPnpFilterNukeIrqResourceDescriptors(curList); + curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + + curList->Count); + i += 1UL; + } + } + while_257_break: /* CIL Label */; } + return; } - while_257_break: /* CIL Label */ ; - } - return; } -} -void PptPnpFilterNukeIrqResourceDescriptors(PIO_RESOURCE_LIST IoResourceList ) -{ PIO_RESOURCE_DESCRIPTOR pIoResourceDescriptorIn ; - ULONG i ; +void PptPnpFilterNukeIrqResourceDescriptors(PIO_RESOURCE_LIST IoResourceList) { + PIO_RESOURCE_DESCRIPTOR pIoResourceDescriptorIn; + ULONG i; { - pIoResourceDescriptorIn = IoResourceList->Descriptors; - i = 0; - { - while (1) { - while_259_continue: /* CIL Label */ ; - if (i < IoResourceList->Count) { + pIoResourceDescriptorIn = IoResourceList->Descriptors; + i = 0; + { + while (1) { + while_259_continue: /* CIL Label */; + if (i < IoResourceList->Count) { - } else { - goto while_259_break; - } - if ((int )pIoResourceDescriptorIn->Type == 2) { - pIoResourceDescriptorIn->Type = 0; - { + } else { + goto while_259_break; + } + if ((int)pIoResourceDescriptorIn->Type == 2) { + pIoResourceDescriptorIn->Type = 0; + {} + } else { + } + pIoResourceDescriptorIn += 1; + i += 1UL; } - } else { - + while_259_break: /* CIL Label */; } - pIoResourceDescriptorIn += 1; - i += 1UL; - } - while_259_break: /* CIL Label */ ; + return; } - return; -} } -NTSTATUS PptPnpQueryDeviceRelations(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - PIO_STACK_LOCATION irpSp ; - DEVICE_RELATION_TYPE type ; - PDEVICE_RELATIONS removalRelations ; - NTSTATUS tmp ; +NTSTATUS PptPnpQueryDeviceRelations(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + PIO_STACK_LOCATION irpSp; + DEVICE_RELATION_TYPE type; + PDEVICE_RELATIONS removalRelations; + NTSTATUS tmp; { - extension = DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - type = irpSp->Parameters.QueryDeviceRelations.Type; - if (type == 3) { - goto switch_261_3; - } else { - if (type == 0) { - goto switch_261_0; + extension = DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + type = irpSp->Parameters.QueryDeviceRelations.Type; + if (type == 3) { + goto switch_261_3; } else { - if (type == 1) { - goto switch_261_1; + if (type == 0) { + goto switch_261_0; } else { - if (type == 2) { - goto switch_261_2; + if (type == 1) { + goto switch_261_1; } else { - if (type == 4) { - goto switch_261_4; + if (type == 2) { + goto switch_261_2; } else { - { - goto switch_261_default; - if (0) { - switch_261_3: /* CIL Label */ ; - { - } + if (type == 4) { + goto switch_261_4; + } else { { - PptDumpRemovalRelationsList(extension); - } - if (Irp->IoStatus.Information) { - { - } - } else { - { - removalRelations = PptPnpBuildRemovalRelations(extension); - } - if (removalRelations) { - { + goto switch_261_default; + if (0) { + switch_261_3: /* CIL Label */; + {} { PptDumpRemovalRelationsList(extension); } + if (Irp->IoStatus.Information) { + {} + } else { + { + removalRelations = PptPnpBuildRemovalRelations(extension); + } + if (removalRelations) { + {} + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + Irp->IoStatus.Information = + (unsigned long)removalRelations; + } else { + {} + } } - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - Irp->IoStatus.Information = (unsigned long )removalRelations; + goto switch_261_break; + switch_261_0: /* CIL Label */; + {} + goto switch_261_break; + switch_261_1: /* CIL Label */; + {} + goto switch_261_break; + switch_261_2: /* CIL Label */; + {} + goto switch_261_break; + switch_261_4: /* CIL Label */; + {} + goto switch_261_break; + switch_261_default: /* CIL Label */; + {} + goto switch_261_break; } else { - { - } + switch_261_break: /* CIL Label */; } } - goto switch_261_break; - switch_261_0: /* CIL Label */ ; - { - } - goto switch_261_break; - switch_261_1: /* CIL Label */ ; - { - } - goto switch_261_break; - switch_261_2: /* CIL Label */ ; - { - } - goto switch_261_break; - switch_261_4: /* CIL Label */ ; - { - } - goto switch_261_break; - switch_261_default: /* CIL Label */ ; - { - } - goto switch_261_break; - } else { - switch_261_break: /* CIL Label */ ; - } } } } } } + { + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock( + DeviceObject->DeviceExtension, Irp); + } + return (tmp); } - { - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(DeviceObject->DeviceExtension, - Irp); - } - return (tmp); } -} -NTSTATUS PptPnpQueryStopDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ NTSTATUS status ; - PDEVICE_EXTENSION extension ; - LONG handlesOpen ; +NTSTATUS PptPnpQueryStopDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + NTSTATUS status; + PDEVICE_EXTENSION extension; + LONG handlesOpen; { - { - status = 0L; - extension = DeviceObject->DeviceExtension; -/* ExAcquireFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ - handlesOpen = extension->OpenCloseRefCount; -/* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ - } - if (handlesOpen > 0L) { { - status = -2147483631L; - PptFailRequest(Irp, status); - PptReleaseRemoveLock(& extension->RemoveLock, Irp); + status = 0L; + extension = DeviceObject->DeviceExtension; + /* ExAcquireFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ + handlesOpen = extension->OpenCloseRefCount; + /* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ } - } else { - { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - status = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - extension->DeviceStateFlags |= 65552UL; -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + if (handlesOpen > 0L) { + { + status = -2147483631L; + PptFailRequest(Irp, status); + PptReleaseRemoveLock(&extension->RemoveLock, Irp); + } + } else { + { + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + status = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED + */ + extension->DeviceStateFlags |= 65552UL; + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED + */ + } } + return (status); } - return (status); -} } -NTSTATUS PptPnpCancelStopDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS tmp ; - - { - { - extension = DeviceObject->DeviceExtension; -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - } - if (extension->DeviceStateFlags & 16UL) { - extension->DeviceStateFlags &= 4294901743UL; - } else { +NTSTATUS PptPnpCancelStopDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS tmp; - } { -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + { + extension = DeviceObject->DeviceExtension; + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + } + if (extension->DeviceStateFlags & 16UL) { + extension->DeviceStateFlags &= 4294901743UL; + } else { + } + { + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + } + return (tmp); } - return (tmp); } -} -NTSTATUS PptPnpStopDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS tmp ; +NTSTATUS PptPnpStopDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS tmp; { - { - extension = DeviceObject->DeviceExtension; -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - extension->DeviceStateFlags |= 32UL; - extension->DeviceStateFlags &= 4294967278UL; -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + { + extension = DeviceObject->DeviceExtension; + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + extension->DeviceStateFlags |= 32UL; + extension->DeviceStateFlags &= 4294967278UL; + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + } + return (tmp); } - return (tmp); -} } -NTSTATUS PptPnpQueryRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS tmp ; +NTSTATUS PptPnpQueryRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS tmp; { - extension = DeviceObject->DeviceExtension; - { - } - { -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - extension->DeviceStateFlags |= 65792UL; -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + extension = DeviceObject->DeviceExtension; + {} { + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + extension->DeviceStateFlags |= 65792UL; + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + } + return (tmp); } - return (tmp); -} } -NTSTATUS PptPnpCancelRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS tmp ; - - { - { - extension = DeviceObject->DeviceExtension; -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - } - if (extension->DeviceStateFlags & 256UL) { - extension->DeviceStateFlags &= 4294901503UL; - } else { +NTSTATUS PptPnpCancelRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS tmp; - } { -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + { + extension = DeviceObject->DeviceExtension; + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + } + if (extension->DeviceStateFlags & 256UL) { + extension->DeviceStateFlags &= 4294901503UL; + } else { + } + { + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + } + return (tmp); } - return (tmp); } -} -NTSTATUS PptPnpRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS status ; +NTSTATUS PptPnpRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS status; { - { - extension = DeviceObject->DeviceExtension; -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - extension->DeviceStateFlags |= 512UL; -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - IoWMIRegistrationControl(DeviceObject, 2); - IoSetDeviceInterfaceState(& extension->SymbolicLinkName, 0); - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - } - if (s == NP) { - s = SKIP1; - } else { { - errorFn(); + extension = DeviceObject->DeviceExtension; + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + extension->DeviceStateFlags |= 512UL; + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + IoWMIRegistrationControl(DeviceObject, 2); + IoSetDeviceInterfaceState(&extension->SymbolicLinkName, 0); + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + } + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - status = IofCallDriver(extension->ParentDeviceObject, Irp); - PptReleaseRemoveLockAndWait(& extension->RemoveLock, Irp); - PptCleanRemovalRelationsList(extension); -/* RtlFreeUnicodeString(& extension->DeviceName); */ /* INLINED */ -/* RtlFreeUnicodeString(& extension->SymbolicLinkName); */ /* INLINED */ - } - if (extension->PnpInfo.PortName) { { -/* ExFreePool(extension->PnpInfo.PortName); */ /* INLINED */ - extension->PnpInfo.PortName = (void *)0; + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + status = IofCallDriver(extension->ParentDeviceObject, Irp); + PptReleaseRemoveLockAndWait(&extension->RemoveLock, Irp); + PptCleanRemovalRelationsList(extension); + /* RtlFreeUnicodeString(& extension->DeviceName); */ /* INLINED */ + /* RtlFreeUnicodeString(& extension->SymbolicLinkName); */ /* INLINED */ } - } else { - - } - { -/* IoDetachDevice(extension->ParentDeviceObject); */ /* INLINED */ -/* IoDeleteDevice(DeviceObject); */ /* INLINED */ + if (extension->PnpInfo.PortName) { + { + /* ExFreePool(extension->PnpInfo.PortName); */ /* INLINED */ + extension->PnpInfo.PortName = (void *)0; + } + } else { + } + { + /* IoDetachDevice(extension->ParentDeviceObject); */ /* INLINED */ + /* IoDeleteDevice(DeviceObject); */ /* INLINED */ + } + return (status); } - return (status); -} } -NTSTATUS PptPnpSurpriseRemoval(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - KIRQL cancelIrql ; - NTSTATUS tmp ; +NTSTATUS PptPnpSurpriseRemoval(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + KIRQL cancelIrql; + NTSTATUS tmp; { - { - extension = DeviceObject->DeviceExtension; -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - extension->DeviceStateFlags |= 4096UL; -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - IoAcquireCancelSpinLock(& cancelIrql); -/* IoReleaseCancelSpinLock(cancelIrql); */ /* INLINED */ - IoSetDeviceInterfaceState(& extension->SymbolicLinkName, 0); - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + { + extension = DeviceObject->DeviceExtension; + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + extension->DeviceStateFlags |= 4096UL; + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + IoAcquireCancelSpinLock(&cancelIrql); + /* IoReleaseCancelSpinLock(cancelIrql); */ /* INLINED */ + IoSetDeviceInterfaceState(&extension->SymbolicLinkName, 0); + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + } + return (tmp); } - return (tmp); } -} -BOOLEAN PptPnpListContainsIrqResourceDescriptor(PIO_RESOURCE_LIST List ) -{ ULONG i ; - PIO_RESOURCE_DESCRIPTOR curDesc ; +BOOLEAN PptPnpListContainsIrqResourceDescriptor(PIO_RESOURCE_LIST List) { + ULONG i; + PIO_RESOURCE_DESCRIPTOR curDesc; { - curDesc = List->Descriptors; - i = 0; - { - while (1) { - while_272_continue: /* CIL Label */ ; - if (i < List->Count) { + curDesc = List->Descriptors; + i = 0; + { + while (1) { + while_272_continue: /* CIL Label */; + if (i < List->Count) { - } else { - goto while_272_break; - } - if ((int )curDesc->Type == 2) { - return (1); - } else { - curDesc += 1; + } else { + goto while_272_break; + } + if ((int)curDesc->Type == 2) { + return (1); + } else { + curDesc += 1; + } + i += 1UL; + } + while_272_break: /* CIL Label */; } - i += 1UL; - } - while_272_break: /* CIL Label */ ; + return (0); } - return (0); -} } -NTSTATUS PptPnpBounceAndCatchPnpIrp(PDEVICE_EXTENSION Extension , PIRP Irp ) -{ NTSTATUS status ; - KEVENT event ; - PDEVICE_OBJECT parentDevObj ; - PIO_STACK_LOCATION irpSp ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___0 ; - - { - parentDevObj = Extension->ParentDeviceObject; - { - } - { -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine)); - nextIrpSp->Control = 0; - } - if (s != NP) { +NTSTATUS PptPnpBounceAndCatchPnpIrp(PDEVICE_EXTENSION Extension, PIRP Irp) { + NTSTATUS status; + KEVENT event; + PDEVICE_OBJECT parentDevObj; + PIO_STACK_LOCATION irpSp; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___0; + + { + parentDevObj = Extension->ParentDeviceObject; + {} { + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + memcpy(nextIrpSp, irpSp, + (long)(&((IO_STACK_LOCATION *)0)->CompletionRoutine)); + nextIrpSp->Control = 0; + } + if (s != NP) { + { errorFn(); } + } else { + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + compFptr = &PptSynchCompletionRoutine; + routine = 0; + } + } { - errorFn(); + irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpSp___0->CompletionRoutine = &PptSynchCompletionRoutine; + irpSp___0->Context = &event; + irpSp___0->Control = 0; + irpSp___0->Control = 64; + irpSp___0->Control = (int)irpSp___0->Control | 128; + irpSp___0->Control = (int)irpSp___0->Control | 32; + status = IofCallDriver(parentDevObj, Irp); + KeWaitForSingleObject(&event, 5, 0, 0, (void *)0); } - } else { - if (compRegistered != 0) { - { - errorFn(); - } + if (status == 259L) { + status = myStatus; } else { - compRegistered = 1; - compFptr = & PptSynchCompletionRoutine; - routine = 0; } + return (status); } - { - irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp___0->CompletionRoutine = & PptSynchCompletionRoutine; - irpSp___0->Context = & event; - irpSp___0->Control = 0; - irpSp___0->Control = 64; - irpSp___0->Control = (int )irpSp___0->Control | 128; - irpSp___0->Control = (int )irpSp___0->Control | 32; - status = IofCallDriver(parentDevObj, Irp); - KeWaitForSingleObject(& event, 5, 0, 0, (void *)0); - } - if (status == 259L) { - status = myStatus; - } else { - - } - return (status); } -} -NTSTATUS PptPnpPassThroughPnpIrpAndReleaseRemoveLock(PDEVICE_EXTENSION Extension , - PIRP Irp ) -{ NTSTATUS status ; +NTSTATUS +PptPnpPassThroughPnpIrpAndReleaseRemoveLock(PDEVICE_EXTENSION Extension, + PIRP Irp) { + NTSTATUS status; { - if (s == NP) { - s = SKIP1; - } else { + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } { - errorFn(); + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + status = IofCallDriver(Extension->ParentDeviceObject, Irp); + PptReleaseRemoveLock(&Extension->RemoveLock, Irp); } + return (status); } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - status = IofCallDriver(Extension->ParentDeviceObject, Irp); - PptReleaseRemoveLock(& Extension->RemoveLock, Irp); - } - return (status); -} } -NTSTATUS PptPnpUnhandledIrp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ NTSTATUS tmp ; +NTSTATUS PptPnpUnhandledIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + NTSTATUS tmp; { - { - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(DeviceObject->DeviceExtension, - Irp); + { + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock( + DeviceObject->DeviceExtension, Irp); + } + return (tmp); } - return (tmp); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -NTSTATUS PptPowerComplete(PDEVICE_OBJECT pDeviceObject , PIRP pIrp , PDEVICE_EXTENSION Extension ) -{ POWER_STATE_TYPE powerType ; - POWER_STATE powerState ; - PIO_STACK_LOCATION pIrpStack ; - - { - pIrpStack = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - powerType = pIrpStack->Parameters.Power.Type; - powerState = pIrpStack->Parameters.Power.State; - if (pIrpStack->MinorFunction == 3) { - goto switch_274_3; - } else { - if (pIrpStack->MinorFunction == 2) { - goto switch_274_2; - } else { - { - goto switch_274_default; - if (0) { - switch_274_3: /* CIL Label */ ; - goto switch_274_break; - switch_274_2: /* CIL Label */ ; +NTSTATUS PptPowerComplete(PDEVICE_OBJECT pDeviceObject, PIRP pIrp, + PDEVICE_EXTENSION Extension) { + POWER_STATE_TYPE powerType; + POWER_STATE powerState; + PIO_STACK_LOCATION pIrpStack; + + { + pIrpStack = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + powerType = pIrpStack->Parameters.Power.Type; + powerState = pIrpStack->Parameters.Power.State; + if (pIrpStack->MinorFunction == 3) { + goto switch_274_3; + } else { + if (pIrpStack->MinorFunction == 2) { + goto switch_274_2; + } else { { - } - if (powerType == 1) { - goto switch_276_1; - } else { - if (powerType == 0) { - goto switch_276_0; - } else { - if (0) { - switch_276_1: /* CIL Label */ ; - if ((int )Extension->DeviceState < (int )powerState.DeviceState) { - + goto switch_274_default; + if (0) { + switch_274_3: /* CIL Label */; + goto switch_274_break; + switch_274_2: /* CIL Label */; + {} + if (powerType == 1) { + goto switch_276_1; + } else { + if (powerType == 0) { + goto switch_276_0; } else { - if ((int )powerState.DeviceState < (int )Extension->DeviceState) { - { - PoSetPowerState(Extension->DeviceObject, powerType, powerState); - } - if (1 == (int )Extension->DeviceState) { + if (0) { + switch_276_1: /* CIL Label */; + if ((int)Extension->DeviceState < + (int)powerState.DeviceState) { } else { + if ((int)powerState.DeviceState < + (int)Extension->DeviceState) { + { + PoSetPowerState(Extension->DeviceObject, powerType, + powerState); + } + if (1 == (int)Extension->DeviceState) { + } else { + } + Extension->DeviceState = powerState.DeviceState; + } else { + } } - Extension->DeviceState = powerState.DeviceState; - } else { - - } - } - goto switch_276_break; - switch_276_0: /* CIL Label */ ; - if ((int )Extension->SystemState < (int )powerState.SystemState) { + goto switch_276_break; + switch_276_0: /* CIL Label */; + if ((int)Extension->SystemState < + (int)powerState.SystemState) { - } else { - if ((int )powerState.SystemState < (int )Extension->SystemState) { - if (1 == (int )powerState.SystemState) { - { - powerState.DeviceState = 1; - PoRequestPowerIrp(Extension->DeviceObject, 2, powerState, (void *)0, - (void *)0, (void *)0); - } } else { - + if ((int)powerState.SystemState < + (int)Extension->SystemState) { + if (1 == (int)powerState.SystemState) { + { + powerState.DeviceState = 1; + PoRequestPowerIrp(Extension->DeviceObject, 2, + powerState, (void *)0, (void *)0, + (void *)0); + } + } else { + } + Extension->SystemState = powerState.SystemState; + } else { + } } - Extension->SystemState = powerState.SystemState; + goto switch_276_break; } else { - + switch_276_break: /* CIL Label */; } } - goto switch_276_break; - } else { - switch_276_break: /* CIL Label */ ; } + goto switch_274_break; + switch_274_default: /* CIL Label */; + } else { + switch_274_break: /* CIL Label */; } } - goto switch_274_break; - switch_274_default: /* CIL Label */ ; - } else { - switch_274_break: /* CIL Label */ ; - } } } + { /* PoStartNextPowerIrp(pIrp); */ /* INLINED */ + } + return (0L); } - { -/* PoStartNextPowerIrp(pIrp); */ /* INLINED */ - } - return (0L); -} } -void InitNEC_98(PDEVICE_EXTENSION Extension ) -{ PUCHAR Controller ; +void InitNEC_98(PDEVICE_EXTENSION Extension) { + PUCHAR Controller; { - { - Controller = Extension->PortInfo.Controller; - WRITE_PORT_UCHAR(Controller + 9, 16); - WRITE_PORT_UCHAR(Controller + 14, 0); - WRITE_PORT_UCHAR(Controller + 2, 4); + { + Controller = Extension->PortInfo.Controller; + WRITE_PORT_UCHAR(Controller + 9, 16); + WRITE_PORT_UCHAR(Controller + 14, 0); + WRITE_PORT_UCHAR(Controller + 2, 4); + } + return; } - return; } -} -NTSTATUS PptDispatchPower(PDEVICE_OBJECT pDeviceObject , PIRP pIrp ) -{ POWER_STATE_TYPE powerType ; - POWER_STATE powerState ; - PIO_STACK_LOCATION pIrpStack ; - NTSTATUS status ; - PDEVICE_EXTENSION Extension ; - BOOLEAN hookit ; - NTSTATUS status___0 ; - NTSTATUS tmp ; - PIO_STACK_LOCATION irpSp ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___0 ; +NTSTATUS PptDispatchPower(PDEVICE_OBJECT pDeviceObject, PIRP pIrp) { + POWER_STATE_TYPE powerType; + POWER_STATE powerState; + PIO_STACK_LOCATION pIrpStack; + NTSTATUS status; + PDEVICE_EXTENSION Extension; + BOOLEAN hookit; + NTSTATUS status___0; + NTSTATUS tmp; + PIO_STACK_LOCATION irpSp; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___0; { - { - status = 0L; - hookit = 0; - Extension = pDeviceObject->DeviceExtension; - pIrpStack = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - tmp = PptAcquireRemoveLock(& Extension->RemoveLock, pIrp); - status___0 = tmp; - } - if (! (status___0 >= 0L)) { { -/* PoStartNextPowerIrp(pIrp); */ /* INLINED */ - pIrp->IoStatus.__annonCompField4.Status = status___0; - PptCompleteRequest(pIrp, 0); + status = 0L; + hookit = 0; + Extension = pDeviceObject->DeviceExtension; + pIrpStack = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + tmp = PptAcquireRemoveLock(&Extension->RemoveLock, pIrp); + status___0 = tmp; + } + if (!(status___0 >= 0L)) { + { + /* PoStartNextPowerIrp(pIrp); */ /* INLINED */ + pIrp->IoStatus.__annonCompField4.Status = status___0; + PptCompleteRequest(pIrp, 0); + } + return (status___0); + } else { } - return (status___0); - } else { - - } - powerType = pIrpStack->Parameters.Power.Type; - powerState = pIrpStack->Parameters.Power.State; - if (pIrpStack->MinorFunction == 3) { - goto switch_277_3; - } else { - if (pIrpStack->MinorFunction == 2) { - goto switch_277_2; + powerType = pIrpStack->Parameters.Power.Type; + powerState = pIrpStack->Parameters.Power.State; + if (pIrpStack->MinorFunction == 3) { + goto switch_277_3; } else { - { - goto switch_277_default; - if (0) { - switch_277_3: /* CIL Label */ - status = 0L; - goto switch_277_break; - switch_277_2: /* CIL Label */ ; + if (pIrpStack->MinorFunction == 2) { + goto switch_277_2; + } else { { - } - if (powerType == 1) { - goto switch_279_1; - } else { - if (powerType == 0) { - goto switch_279_0; - } else { - if (0) { - switch_279_1: /* CIL Label */ ; - if ((int )Extension->DeviceState < (int )powerState.DeviceState) { - { - PoSetPowerState(Extension->DeviceObject, powerType, powerState); - } - if (1 == (int )Extension->DeviceState) { - - } else { - - } - Extension->DeviceState = powerState.DeviceState; + goto switch_277_default; + if (0) { + switch_277_3: /* CIL Label */ + status = 0L; + goto switch_277_break; + switch_277_2: /* CIL Label */; + {} + if (powerType == 1) { + goto switch_279_1; + } else { + if (powerType == 0) { + goto switch_279_0; } else { - if ((int )powerState.DeviceState < (int )Extension->DeviceState) { - hookit = 1; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { + if (0) { + switch_279_1: /* CIL Label */; + if ((int)Extension->DeviceState < + (int)powerState.DeviceState) { { - InitNEC_98(Extension); + PoSetPowerState(Extension->DeviceObject, powerType, + powerState); } - } else { + if (1 == (int)Extension->DeviceState) { + } else { + } + Extension->DeviceState = powerState.DeviceState; + } else { + if ((int)powerState.DeviceState < + (int)Extension->DeviceState) { + hookit = 1; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { InitNEC_98(Extension); } + } else { + } + } else { + } } - } else { - - } - } - goto switch_279_break; - switch_279_0: /* CIL Label */ ; - if ((int )Extension->SystemState < (int )powerState.SystemState) { - if (1 == (int )Extension->SystemState) { - - } else { + goto switch_279_break; + switch_279_0: /* CIL Label */; + if ((int)Extension->SystemState < + (int)powerState.SystemState) { + if (1 == (int)Extension->SystemState) { - } - { - powerState.DeviceState = 4; - PoRequestPowerIrp(Extension->DeviceObject, 2, powerState, (void *)0, - (void *)0, (void *)0); - Extension->SystemState = powerState.SystemState; - } - } else { - if ((int )powerState.SystemState < (int )Extension->SystemState) { - hookit = 1; + } else { + } + { + powerState.DeviceState = 4; + PoRequestPowerIrp(Extension->DeviceObject, 2, powerState, + (void *)0, (void *)0, (void *)0); + Extension->SystemState = powerState.SystemState; + } + } else { + if ((int)powerState.SystemState < + (int)Extension->SystemState) { + hookit = 1; + } else { + } + } + goto switch_279_break; } else { - + switch_279_break: /* CIL Label */; } } - goto switch_279_break; - } else { - switch_279_break: /* CIL Label */ ; } + goto switch_277_break; + switch_277_default: /* CIL Label */ + status = -1073741637L; + } else { + switch_277_break: /* CIL Label */; } } - goto switch_277_break; - switch_277_default: /* CIL Label */ - status = -1073741637L; - } else { - switch_277_break: /* CIL Label */ ; - } } } - } - { - irpSp = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpSp = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine)); - nextIrpSp->Control = 0; - } - if (! (status >= 0L)) { { - pIrp->IoStatus.__annonCompField4.Status = status; -/* PoStartNextPowerIrp(pIrp); */ /* INLINED */ - PptCompleteRequest(pIrp, 0); + irpSp = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + nextIrpSp = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + memcpy(nextIrpSp, irpSp, + (long)(&((IO_STACK_LOCATION *)0)->CompletionRoutine)); + nextIrpSp->Control = 0; } - } else { - if (hookit) { - if (s != NP) { + if (!(status >= 0L)) { + { + pIrp->IoStatus.__annonCompField4.Status = status; + /* PoStartNextPowerIrp(pIrp); */ /* INLINED */ + PptCompleteRequest(pIrp, 0); + } + } else { + if (hookit) { + if (s != NP) { + { errorFn(); } + } else { + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + compFptr = &PptPowerComplete; + routine = 1; + } + } { - errorFn(); + irpSp___0 = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpSp___0->CompletionRoutine = &PptPowerComplete; + irpSp___0->Context = Extension; + irpSp___0->Control = 0; + irpSp___0->Control = 64; + irpSp___0->Control = (int)irpSp___0->Control | 128; + irpSp___0->Control = (int)irpSp___0->Control | 32; + status = PoCallDriver(Extension->ParentDeviceObject, pIrp); } } else { - if (compRegistered != 0) { - { - errorFn(); - } - } else { - compRegistered = 1; - compFptr = & PptPowerComplete; - routine = 1; + { + /* PoStartNextPowerIrp(pIrp); */ /* INLINED */ + status = PoCallDriver(Extension->ParentDeviceObject, pIrp); } } - { - irpSp___0 = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp___0->CompletionRoutine = & PptPowerComplete; - irpSp___0->Context = Extension; - irpSp___0->Control = 0; - irpSp___0->Control = 64; - irpSp___0->Control = (int )irpSp___0->Control | 128; - irpSp___0->Control = (int )irpSp___0->Control | 32; - status = PoCallDriver(Extension->ParentDeviceObject, pIrp); - } - } else { - { -/* PoStartNextPowerIrp(pIrp); */ /* INLINED */ - status = PoCallDriver(Extension->ParentDeviceObject, pIrp); - } } + { PptReleaseRemoveLock(&Extension->RemoveLock, pIrp); } + return (status); } - { - PptReleaseRemoveLock(& Extension->RemoveLock, pIrp); - } - return (status); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) -static UCHAR LegacyZipModeQualifier___11[3] = { 0, 60, 32}; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +static UCHAR LegacyZipModeQualifier___11[3] = {0, 60, 32}; #pragma once -void PptLegacyZipClockDiskModeByte(PUCHAR Controller , UCHAR ModeByte ) -{ - - { - { - WRITE_PORT_UCHAR(Controller, ModeByte); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)6); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); - } - return; -} -} -void PptLegacyZipClockPrtModeByte(PUCHAR Controller , UCHAR ModeByte ) -{ +void PptLegacyZipClockDiskModeByte(PUCHAR Controller, UCHAR ModeByte) { { - { - WRITE_PORT_UCHAR(Controller, ModeByte); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)14); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); + { + WRITE_PORT_UCHAR(Controller, ModeByte); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)6); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); + } + return; } - return; -} } -void PptLegacyZipSetDiskMode(PUCHAR Controller , UCHAR Mode ) -{ ULONG i = __VERIFIER_nondet_long() ; +void PptLegacyZipClockPrtModeByte(PUCHAR Controller, UCHAR ModeByte) { { - { - PptLegacyZipClockDiskModeByte(Controller, LegacyZipModeQualifier___11[i]); - PptLegacyZipClockDiskModeByte(Controller, Mode); + { + WRITE_PORT_UCHAR(Controller, ModeByte); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)14); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); + } + return; } - return; } -} -BOOLEAN PptLegacyZipCheckDevice(PUCHAR Controller ) -{ UCHAR tmp ; - UCHAR tmp___0 ; +void PptLegacyZipSetDiskMode(PUCHAR Controller, UCHAR Mode) { + ULONG i = __VERIFIER_nondet_long(); { - { - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)6); - tmp___0 = READ_PORT_UCHAR(Controller + 1); - } - if (((int )tmp___0 & 8) == 8) { { - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); - tmp = READ_PORT_UCHAR(Controller + 1); - } - if (((int )tmp & 8) != 8) { - return (1); - } else { - + PptLegacyZipClockDiskModeByte(Controller, LegacyZipModeQualifier___11[i]); + PptLegacyZipClockDiskModeByte(Controller, Mode); } - } else { - + return; } - return (0); -} } -NTSTATUS PptTrySelectLegacyZip(PVOID Context , PVOID TrySelectCommand ) -{ PDEVICE_EXTENSION Extension ; - PPARALLEL_1284_COMMAND Command ; - NTSTATUS Status ; - PUCHAR Controller ; - SYNCHRONIZED_COUNT_CONTEXT SyncContext ; - KIRQL CancelIrql ; - BOOLEAN tmp ; +BOOLEAN PptLegacyZipCheckDevice(PUCHAR Controller) { + UCHAR tmp; + UCHAR tmp___0; { - Extension = Context; - Command = TrySelectCommand; - Status = 0L; - Controller = Extension->PortInfo.Controller; - { - } - if (! (Command->CommandFlags & 2UL)) { { + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)6); + tmp___0 = READ_PORT_UCHAR(Controller + 1); } - { - IoAcquireCancelSpinLock(& CancelIrql); - SyncContext.Count = & Extension->WorkQueueCount; - } - if (Extension->InterruptRefCount) { + if (((int)tmp___0 & 8) == 8) { { - KeSynchronizeExecution(Extension->InterruptObject, & PptSynchronizedIncrement, - & SyncContext); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); + tmp = READ_PORT_UCHAR(Controller + 1); } - } else { - { - PptSynchronizedIncrement(& SyncContext); + if (((int)tmp & 8) != 8) { + return (1); + } else { } - } - if (SyncContext.NewCount) { - Status = 259L; } else { - - } - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ } - } else { - + return (0); } - if (Status >= 0L) { - if (Status != 259L) { - if (Command->CommandFlags & 32UL) { +} +NTSTATUS PptTrySelectLegacyZip(PVOID Context, PVOID TrySelectCommand) { + PDEVICE_EXTENSION Extension; + PPARALLEL_1284_COMMAND Command; + NTSTATUS Status; + PUCHAR Controller; + SYNCHRONIZED_COUNT_CONTEXT SyncContext; + KIRQL CancelIrql; + BOOLEAN tmp; + + { + Extension = Context; + Command = TrySelectCommand; + Status = 0L; + Controller = Extension->PortInfo.Controller; + {} + if (!(Command->CommandFlags & 2UL)) { + {} { + IoAcquireCancelSpinLock(&CancelIrql); + SyncContext.Count = &Extension->WorkQueueCount; + } + if (Extension->InterruptRefCount) { { - PptLegacyZipSetDiskMode(Controller, (unsigned char)207); + KeSynchronizeExecution(Extension->InterruptObject, + &PptSynchronizedIncrement, &SyncContext); } } else { - { - PptLegacyZipSetDiskMode(Controller, (unsigned char)143); - } + { PptSynchronizedIncrement(&SyncContext); } } - { - tmp = PptLegacyZipCheckDevice(Controller); + if (SyncContext.NewCount) { + Status = 259L; + } else { } - if (tmp) { - { + { /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } + } else { + } + if (Status >= 0L) { + if (Status != 259L) { + if (Command->CommandFlags & 32UL) { + { PptLegacyZipSetDiskMode(Controller, (unsigned char)207); } + } else { + { PptLegacyZipSetDiskMode(Controller, (unsigned char)143); } } - if (! Extension->CheckedForGenericEpp) { - if (Extension->PnpInfo.HardwareCapabilities & 1UL) { - if (! Extension->NationalChipFound) { - { - PptDetectEppPort(Extension); + { tmp = PptLegacyZipCheckDevice(Controller); } + if (tmp) { + {} + if (!Extension->CheckedForGenericEpp) { + if (Extension->PnpInfo.HardwareCapabilities & 1UL) { + if (!Extension->NationalChipFound) { + { PptDetectEppPort(Extension); } + } else { } } else { - } + Extension->CheckedForGenericEpp = 1; } else { - } - Extension->CheckedForGenericEpp = 1; } else { - + {} { + PptDeselectLegacyZip(Context, TrySelectCommand); + Status = -1073741823L; + } } } else { - { - } - { - PptDeselectLegacyZip(Context, TrySelectCommand); - Status = -1073741823L; - } } } else { - } - } else { - + return (Status); } - return (Status); -} } -NTSTATUS PptDeselectLegacyZip(PVOID Context , PVOID DeselectCommand ) -{ ULONG i = __VERIFIER_nondet_long() ; - PDEVICE_EXTENSION Extension ; - PUCHAR Controller ; - PPARALLEL_1284_COMMAND Command ; +NTSTATUS PptDeselectLegacyZip(PVOID Context, PVOID DeselectCommand) { + ULONG i = __VERIFIER_nondet_long(); + PDEVICE_EXTENSION Extension; + PUCHAR Controller; + PPARALLEL_1284_COMMAND Command; { - Extension = Context; - Controller = Extension->PortInfo.Controller; - Command = DeselectCommand; - { - } - { - PptLegacyZipClockPrtModeByte(Controller, LegacyZipModeQualifier___11[i]); - PptLegacyZipClockPrtModeByte(Controller, (unsigned char)15); - } - if (! (Command->CommandFlags & 2UL)) { - { - PptFreePort(Extension); + Extension = Context; + Controller = Extension->PortInfo.Controller; + Command = DeselectCommand; + {} { + PptLegacyZipClockPrtModeByte(Controller, LegacyZipModeQualifier___11[i]); + PptLegacyZipClockPrtModeByte(Controller, (unsigned char)15); } - } else { - + if (!(Command->CommandFlags & 2UL)) { + { PptFreePort(Extension); } + } else { + } + return (0L); } - return (0L); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -void PptRegInitDriverSettings(PUNICODE_STRING RegistryPath___0 ) -{ NTSTATUS Status ; - RTL_QUERY_REGISTRY_TABLE paramTable[3] ; - PWSTR path ; - ULONG defaultDebugLevel ; - ULONG defaultBreakOn ; - PVOID tmp ; - - { - { - defaultDebugLevel = 0UL; - defaultBreakOn = 0UL; - tmp = ExAllocatePoolWithTag(1, (unsigned int )RegistryPath___0->Length + sizeof(WCHAR ), - 1349673296UL); - path = tmp; - } - if (! path) { - PptDebugLevel = defaultDebugLevel; - PptBreakOn = defaultBreakOn; +void PptRegInitDriverSettings(PUNICODE_STRING RegistryPath___0) { + NTSTATUS Status; + RTL_QUERY_REGISTRY_TABLE paramTable[3]; + PWSTR path; + ULONG defaultDebugLevel; + ULONG defaultBreakOn; + PVOID tmp; + + { + { + defaultDebugLevel = 0UL; + defaultBreakOn = 0UL; + tmp = ExAllocatePoolWithTag( + 1, (unsigned int)RegistryPath___0->Length + sizeof(WCHAR), + 1349673296UL); + path = tmp; + } + if (!path) { + PptDebugLevel = defaultDebugLevel; + PptBreakOn = defaultBreakOn; + return; + } else { + } + { + memmove(path, RegistryPath___0->Buffer, RegistryPath___0->Length); + *(path + (int)RegistryPath___0->Length / 2) = (unsigned short)0; + memset(paramTable, 0, sizeof(paramTable)); + paramTable[0].Flags = 32; + paramTable[0].EntryContext = &PptDebugLevel; + paramTable[0].DefaultType = 4; + paramTable[0].DefaultData = &defaultDebugLevel; + paramTable[0].DefaultLength = sizeof(ULONG); + paramTable[1].Flags = 32; + paramTable[1].EntryContext = &PptBreakOn; + paramTable[1].DefaultType = 4; + paramTable[1].DefaultData = &defaultBreakOn; + paramTable[1].DefaultLength = sizeof(ULONG); + Status = RtlQueryRegistryValues(2147483648U, path, paramTable, (void *)0, + (void *)0); + } + if (!(Status >= 0L)) { + PptDebugLevel = defaultDebugLevel; + PptBreakOn = defaultBreakOn; + } else { + } + { + /* ExFreePool(path); */ /* INLINED */ + } {} return; - } else { - - } - { - memmove(path, RegistryPath___0->Buffer, RegistryPath___0->Length); - *(path + (int )RegistryPath___0->Length / 2) = (unsigned short)0; - memset(paramTable, 0, sizeof(paramTable)); - paramTable[0].Flags = 32; - paramTable[0].EntryContext = & PptDebugLevel; - paramTable[0].DefaultType = 4; - paramTable[0].DefaultData = & defaultDebugLevel; - paramTable[0].DefaultLength = sizeof(ULONG ); - paramTable[1].Flags = 32; - paramTable[1].EntryContext = & PptBreakOn; - paramTable[1].DefaultType = 4; - paramTable[1].DefaultData = & defaultBreakOn; - paramTable[1].DefaultLength = sizeof(ULONG ); - Status = RtlQueryRegistryValues(2147483648U, path, paramTable, (void *)0, (void *)0); - } - if (! (Status >= 0L)) { - PptDebugLevel = defaultDebugLevel; - PptBreakOn = defaultBreakOn; - } else { - - } - { -/* ExFreePool(path); */ /* INLINED */ - } - { } - return; -} } -NTSTATUS PptRegGetDeviceParameterDword(PDEVICE_OBJECT Pdo , PWSTR ParameterName , - PULONG ParameterValue ) -{ NTSTATUS status ; - HANDLE hKey ; - RTL_QUERY_REGISTRY_TABLE queryTable[2] ; - ULONG defaultValue ; +NTSTATUS PptRegGetDeviceParameterDword(PDEVICE_OBJECT Pdo, PWSTR ParameterName, + PULONG ParameterValue) { + NTSTATUS status; + HANDLE hKey; + RTL_QUERY_REGISTRY_TABLE queryTable[2]; + ULONG defaultValue; { - { - status = IoOpenDeviceRegistryKey(Pdo, 1, 131097L, & hKey); - } - if (! (status >= 0L)) { + { status = IoOpenDeviceRegistryKey(Pdo, 1, 131097L, &hKey); } + if (!(status >= 0L)) { + return (status); + } else { + } + { + defaultValue = *ParameterValue; + memset(&queryTable, 0, sizeof(queryTable)); + queryTable[0].Flags = 32; + queryTable[0].Name = ParameterName; + queryTable[0].EntryContext = ParameterValue; + queryTable[0].DefaultType = 4; + queryTable[0].DefaultData = &defaultValue; + queryTable[0].DefaultLength = sizeof(ULONG); + status = RtlQueryRegistryValues(1073741824, hKey, queryTable, (void *)0, + (void *)0); + } + if (!(status >= 0L)) { + *ParameterValue = defaultValue; + } else { + } + { ZwClose(hKey); } return (status); - } else { - - } - { - defaultValue = *ParameterValue; - memset(& queryTable, 0, sizeof(queryTable)); - queryTable[0].Flags = 32; - queryTable[0].Name = ParameterName; - queryTable[0].EntryContext = ParameterValue; - queryTable[0].DefaultType = 4; - queryTable[0].DefaultData = & defaultValue; - queryTable[0].DefaultLength = sizeof(ULONG ); - status = RtlQueryRegistryValues(1073741824, hKey, queryTable, (void *)0, (void *)0); - } - if (! (status >= 0L)) { - *ParameterValue = defaultValue; - } else { - - } - { - ZwClose(hKey); } - return (status); -} } -NTSTATUS PptRegSetDeviceParameterDword(PDEVICE_OBJECT Pdo , PWSTR ParameterName , - PULONG ParameterValue ) -{ NTSTATUS status ; - HANDLE hKey ; - UNICODE_STRING valueName ; +NTSTATUS PptRegSetDeviceParameterDword(PDEVICE_OBJECT Pdo, PWSTR ParameterName, + PULONG ParameterValue) { + NTSTATUS status; + HANDLE hKey; + UNICODE_STRING valueName; { - { - status = IoOpenDeviceRegistryKey(Pdo, 1, 131078L, & hKey); - } - if (! (status >= 0L)) { - { + { status = IoOpenDeviceRegistryKey(Pdo, 1, 131078L, &hKey); } + if (!(status >= 0L)) { + {} + return (status); + } else { } - return (status); - } else { - - } - { -/* RtlInitUnicodeString(& valueName, ParameterName); */ /* INLINED */ - status = ZwSetValueKey(hKey, & valueName, 0, 4, ParameterValue, sizeof(ULONG )); - } - if (! (status >= 0L)) { { + /* RtlInitUnicodeString(& valueName, ParameterName); */ /* INLINED */ + status = + ZwSetValueKey(hKey, &valueName, 0, 4, ParameterValue, sizeof(ULONG)); } - } else { - - } - { - ZwClose(hKey); + if (!(status >= 0L)) { + {} + } else { + } + { ZwClose(hKey); } + return (status); } - return (status); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -NTSTATUS PptFailRequest(PIRP Irp , NTSTATUS Status ) -{ +NTSTATUS PptFailRequest(PIRP Irp, NTSTATUS Status) { { - { - Irp->IoStatus.__annonCompField4.Status = Status; - myStatus = Status; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); + { + Irp->IoStatus.__annonCompField4.Status = Status; + myStatus = Status; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); + } + return (Status); } - return (Status); } -} -NTSTATUS PptAcquireRemoveLockOrFailIrp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - PIO_REMOVE_LOCK removeLock ; - NTSTATUS status ; - NTSTATUS tmp ; +NTSTATUS PptAcquireRemoveLockOrFailIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + PIO_REMOVE_LOCK removeLock; + NTSTATUS status; + NTSTATUS tmp; { - { - extension = DeviceObject->DeviceExtension; - removeLock = & extension->RemoveLock; - tmp = IoAcquireRemoveLockEx(removeLock, Irp, "util.c", 33, sizeof(IO_REMOVE_LOCK )); - status = tmp; - } - if (! (status >= 0L)) { { - PptFailRequest(Irp, status); + extension = DeviceObject->DeviceExtension; + removeLock = &extension->RemoveLock; + tmp = IoAcquireRemoveLockEx(removeLock, Irp, "util.c", 33, + sizeof(IO_REMOVE_LOCK)); + status = tmp; } - } else { - + if (!(status >= 0L)) { + { PptFailRequest(Irp, status); } + } else { + } + return (status); } - return (status); -} } -NTSTATUS PptDispatchPreProcessIrp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION Extension ; - NTSTATUS status ; - NTSTATUS tmp ; +NTSTATUS PptDispatchPreProcessIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION Extension; + NTSTATUS status; + NTSTATUS tmp; { - { - Extension = DeviceObject->DeviceExtension; - tmp = PptAcquireRemoveLock(& Extension->RemoveLock, Irp); - status = tmp; - } - if (! (status >= 0L)) { { - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - PptCompleteRequest(Irp, 0); + Extension = DeviceObject->DeviceExtension; + tmp = PptAcquireRemoveLock(&Extension->RemoveLock, Irp); + status = tmp; } - } else { - + if (!(status >= 0L)) { + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + PptCompleteRequest(Irp, 0); + } + } else { + } + return (status); } - return (status); } -} -NTSTATUS PptDispatchPostProcessIrp(void) -{ +NTSTATUS PptDispatchPostProcessIrp(void) { - { - return (0L); + { return (0L); } } -} -NTSTATUS PptSynchCompletionRoutine(PDEVICE_OBJECT DeviceObject , PIRP Irp , PKEVENT Event ) -{ +NTSTATUS PptSynchCompletionRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PKEVENT Event) { { - { - KeSetEvent(Event, 0, 0); + { KeSetEvent(Event, 0, 0); } + return (-1073741802L); } - return (-1073741802L); } -} -PWSTR PptGetPortNameFromPhysicalDeviceObject(PDEVICE_OBJECT PhysicalDeviceObject ) -{ NTSTATUS status ; - HANDLE hKey ; - PKEY_VALUE_FULL_INFORMATION buffer ; - ULONG bufferLength ; - ULONG resultLength ; - PWSTR valueNameWstr ; - UNICODE_STRING valueName ; - PWSTR portName ; - PVOID tmp ; - PVOID tmp___0 ; +PWSTR PptGetPortNameFromPhysicalDeviceObject( + PDEVICE_OBJECT PhysicalDeviceObject) { + NTSTATUS status; + HANDLE hKey; + PKEY_VALUE_FULL_INFORMATION buffer; + ULONG bufferLength; + ULONG resultLength; + PWSTR valueNameWstr; + UNICODE_STRING valueName; + PWSTR portName; + PVOID tmp; + PVOID tmp___0; { - { - } - { - status = IoOpenDeviceRegistryKey(PhysicalDeviceObject, 1, 2031616L, & hKey); - } - if (! (status >= 0L)) { - { + {} { + status = + IoOpenDeviceRegistryKey(PhysicalDeviceObject, 1, 2031616L, &hKey); } - return ((void *)0); - } else { - - } - { - bufferLength = 0; - buffer = (void *)0; -/* RtlInitUnicodeString(& valueName, valueNameWstr); */ /* INLINED */ - status = -1073741789L; - } - { - while (1) { - while_290_continue: /* CIL Label */ ; - if (status == -1073741789L) { - + if (!(status >= 0L)) { + {} + return ((void *)0); } else { - goto while_290_break; } { - status = ZwQueryValueKey(hKey, & valueName, 1, buffer, bufferLength, & resultLength); + bufferLength = 0; + buffer = (void *)0; + /* RtlInitUnicodeString(& valueName, valueNameWstr); */ /* INLINED */ + status = -1073741789L; } - if (status == -1073741789L) { - if (buffer) { - { -/* ExFreePool(buffer); */ /* INLINED */ - } - } else { + { + while (1) { + while_290_continue: /* CIL Label */; + if (status == -1073741789L) { - } - { - tmp = ExAllocatePoolWithTag(1, resultLength, 1349673296UL); - buffer = tmp; - bufferLength = resultLength; - } - if (! buffer) { - { + } else { + goto while_290_break; } { - ZwClose(hKey); + status = ZwQueryValueKey(hKey, &valueName, 1, buffer, bufferLength, + &resultLength); + } + if (status == -1073741789L) { + if (buffer) { + { /* ExFreePool(buffer); */ /* INLINED */ + } + } else { + } + { + tmp = ExAllocatePoolWithTag(1, resultLength, 1349673296UL); + buffer = tmp; + bufferLength = resultLength; + } + if (!buffer) { + {} { ZwClose(hKey); } + return ((void *)0); + } else { + } + } else { + } + } + while_290_break: /* CIL Label */; + } + { ZwClose(hKey); } + if (!(status >= 0L)) { + if (buffer) { + { /* ExFreePool(buffer); */ /* INLINED */ } - return ((void *)0); } else { - } + {} + return ((void *)0); } else { - } - } - while_290_break: /* CIL Label */ ; - } - { - ZwClose(hKey); - } - if (! (status >= 0L)) { - if (buffer) { - { -/* ExFreePool(buffer); */ /* INLINED */ - } + if (buffer->Type != 1UL) { + goto _L; } else { - + if (!buffer->DataLength) { + _L : /* CIL Label */ + {} + { /* ExFreePool(buffer); */ /* INLINED */ + } + return ((void *)0); + } else { + } } { + tmp___0 = ExAllocatePoolWithTag(1, buffer->DataLength, 1349673296UL); + portName = tmp___0; } - return ((void *)0); - } else { - - } - if (buffer->Type != 1UL) { - goto _L; - } else { - if (! buffer->DataLength) { - _L: /* CIL Label */ - { - } - { -/* ExFreePool(buffer); */ /* INLINED */ + if (!portName) { + {} { /* ExFreePool(buffer); */ /* INLINED */ } return ((void *)0); } else { - - } - } - { - tmp___0 = ExAllocatePoolWithTag(1, buffer->DataLength, 1349673296UL); - portName = tmp___0; - } - if (! portName) { - { } { -/* ExFreePool(buffer); */ /* INLINED */ + memcpy(portName, (UCHAR *)buffer + buffer->DataOffset, + buffer->DataLength); + /* ExFreePool(buffer); */ /* INLINED */ } - return ((void *)0); - } else { - - } - { - memcpy(portName, (UCHAR *)buffer + buffer->DataOffset, buffer->DataLength); -/* ExFreePool(buffer); */ /* INLINED */ + return (portName); } - return (portName); -} } -NTSTATUS PptConnectInterrupt(PDEVICE_EXTENSION Extension ) -{ NTSTATUS Status ; +NTSTATUS PptConnectInterrupt(PDEVICE_EXTENSION Extension) { + NTSTATUS Status; { - Status = 0L; - if (! Extension->FoundInterrupt) { - return (-1073741637L); - } else { - - } - { - Status = IoConnectInterrupt(& Extension->InterruptObject, & PptInterruptService, - Extension, (void *)0, Extension->InterruptVector, Extension->InterruptLevel, - Extension->InterruptLevel, Extension->InterruptMode, - 1, Extension->InterruptAffinity, 0); - } - if (! (Status >= 0L)) { - { - PptLogError((Extension->DeviceObject)->DriverObject, Extension->DeviceObject, - Extension->PortInfo.OriginalController, PhysicalZero, 0, 0, 0, 14, - Status, 20); + Status = 0L; + if (!Extension->FoundInterrupt) { + return (-1073741637L); + } else { } { + Status = IoConnectInterrupt( + &Extension->InterruptObject, &PptInterruptService, Extension, + (void *)0, Extension->InterruptVector, Extension->InterruptLevel, + Extension->InterruptLevel, Extension->InterruptMode, 1, + Extension->InterruptAffinity, 0); } - } else { - + if (!(Status >= 0L)) { + { + PptLogError((Extension->DeviceObject)->DriverObject, + Extension->DeviceObject, + Extension->PortInfo.OriginalController, PhysicalZero, 0, 0, + 0, 14, Status, 20); + } + {} + } else { + } + return (Status); } - return (Status); -} } -void PptDisconnectInterrupt(PDEVICE_EXTENSION Extension ) -{ +void PptDisconnectInterrupt(PDEVICE_EXTENSION Extension) { { - { - IoDisconnectInterrupt(Extension->InterruptObject); + { IoDisconnectInterrupt(Extension->InterruptObject); } + return; } - return; } -} -BOOLEAN PptSynchronizedIncrement(PVOID SyncContext ) -{ +BOOLEAN PptSynchronizedIncrement(PVOID SyncContext) { { - *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count) += 1L; - ((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->NewCount = *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count); - return (1); -} + *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count) += 1L; + ((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->NewCount = + *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count); + return (1); + } } -BOOLEAN PptSynchronizedDecrement(PVOID SyncContext ) -{ +BOOLEAN PptSynchronizedDecrement(PVOID SyncContext) { { - *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count) -= 1L; - ((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->NewCount = *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count); - return (1); -} + *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count) -= 1L; + ((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->NewCount = + *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count); + return (1); + } } -BOOLEAN PptSynchronizedRead(PVOID SyncContext ) -{ +BOOLEAN PptSynchronizedRead(PVOID SyncContext) { { - ((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->NewCount = *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count); - return (1); -} + ((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->NewCount = + *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count); + return (1); + } } -BOOLEAN PptSynchronizedQueue(PVOID Context ) -{ PSYNCHRONIZED_LIST_CONTEXT ListContext ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_ListHead ; +BOOLEAN PptSynchronizedQueue(PVOID Context) { + PSYNCHRONIZED_LIST_CONTEXT ListContext; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_ListHead; { - ListContext = Context; - _EX_ListHead = ListContext->List; - _EX_Blink = _EX_ListHead->Blink; - (ListContext->NewEntry)->Flink = _EX_ListHead; - (ListContext->NewEntry)->Blink = _EX_Blink; - _EX_Blink->Flink = ListContext->NewEntry; - _EX_ListHead->Blink = ListContext->NewEntry; - return (1); -} + ListContext = Context; + _EX_ListHead = ListContext->List; + _EX_Blink = _EX_ListHead->Blink; + (ListContext->NewEntry)->Flink = _EX_ListHead; + (ListContext->NewEntry)->Blink = _EX_Blink; + _EX_Blink->Flink = ListContext->NewEntry; + _EX_ListHead->Blink = ListContext->NewEntry; + return (1); + } } -BOOLEAN PptSynchronizedDisconnect(PVOID Context ) -{ PSYNCHRONIZED_DISCONNECT_CONTEXT DisconnectContext ; - BOOLEAN (*ServiceRoutine)(struct _KINTERRUPT *Interrupt , PVOID ServiceContext ) ; - PVOID ServiceContext ; - PLIST_ENTRY Current ; - PISR_LIST_ENTRY ListEntry ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; +BOOLEAN PptSynchronizedDisconnect(PVOID Context) { + PSYNCHRONIZED_DISCONNECT_CONTEXT DisconnectContext; + BOOLEAN(*ServiceRoutine) + (struct _KINTERRUPT * Interrupt, PVOID ServiceContext); + PVOID ServiceContext; + PLIST_ENTRY Current; + PISR_LIST_ENTRY ListEntry; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; { - DisconnectContext = Context; - ServiceRoutine = (DisconnectContext->IsrInfo)->InterruptServiceRoutine; - ServiceContext = (DisconnectContext->IsrInfo)->InterruptServiceContext; - Current = (DisconnectContext->Extension)->IsrList.Flink; - { - while (1) { - while_296_continue: /* CIL Label */ ; - if ((unsigned int )Current != (unsigned int )(& (DisconnectContext->Extension)->IsrList)) { - - } else { - goto while_296_break; - } - ListEntry = (ISR_LIST_ENTRY *)((CHAR *)Current - (unsigned long )(& ((ISR_LIST_ENTRY *)0)->ListEntry)); - if ((unsigned int )ListEntry->ServiceRoutine == (unsigned int )ServiceRoutine) { - if ((unsigned int )ListEntry->ServiceContext == (unsigned int )ServiceContext) { - _EX_Flink = Current->Flink; - _EX_Blink = Current->Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - return (1); - } else { + DisconnectContext = Context; + ServiceRoutine = (DisconnectContext->IsrInfo)->InterruptServiceRoutine; + ServiceContext = (DisconnectContext->IsrInfo)->InterruptServiceContext; + Current = (DisconnectContext->Extension)->IsrList.Flink; + { + while (1) { + while_296_continue: /* CIL Label */; + if ((unsigned int)Current != + (unsigned int)(&(DisconnectContext->Extension)->IsrList)) { + } else { + goto while_296_break; + } + ListEntry = (ISR_LIST_ENTRY *)((CHAR *)Current - + (unsigned long)(&((ISR_LIST_ENTRY *)0) + ->ListEntry)); + if ((unsigned int)ListEntry->ServiceRoutine == + (unsigned int)ServiceRoutine) { + if ((unsigned int)ListEntry->ServiceContext == + (unsigned int)ServiceContext) { + _EX_Flink = Current->Flink; + _EX_Blink = Current->Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + return (1); + } else { + } + } else { + } + Current = Current->Flink; } - } else { - + while_296_break: /* CIL Label */; } - Current = Current->Flink; - } - while_296_break: /* CIL Label */ ; + return (0); } - return (0); } -} -void PptCancelRoutine(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION Extension ; - SYNCHRONIZED_COUNT_CONTEXT SyncContext ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; +void PptCancelRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION Extension; + SYNCHRONIZED_COUNT_CONTEXT SyncContext; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; { - { - } - Extension = DeviceObject->DeviceExtension; - SyncContext.Count = & Extension->WorkQueueCount; - if (Extension->InterruptRefCount) { - { - KeSynchronizeExecution(Extension->InterruptObject, & PptSynchronizedDecrement, - & SyncContext); + {} + Extension = DeviceObject->DeviceExtension; + SyncContext.Count = &Extension->WorkQueueCount; + if (Extension->InterruptRefCount) { + { + KeSynchronizeExecution(Extension->InterruptObject, + &PptSynchronizedDecrement, &SyncContext); + } + } else { + { PptSynchronizedDecrement(&SyncContext); } } - } else { { - PptSynchronizedDecrement(& SyncContext); + _EX_Flink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink; + _EX_Blink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + /* IoReleaseCancelSpinLock(Irp->CancelIrql); */ /* INLINED */ + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = -1073741536L; + myStatus = -1073741536L; + PptReleaseRemoveLock(&Extension->RemoveLock, Irp); + PptCompleteRequest(Irp, 0); } + return; } - { - _EX_Flink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink; - _EX_Blink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; -/* IoReleaseCancelSpinLock(Irp->CancelIrql); */ /* INLINED */ - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = -1073741536L; - myStatus = -1073741536L; - PptReleaseRemoveLock(& Extension->RemoveLock, Irp); - PptCompleteRequest(Irp, 0); - } - return; -} -} -void PptFreePortDpc(PKDPC Dpc , PVOID Extension , PVOID SystemArgument1 , PVOID SystemArgument2 ) -{ - - { - { - PptFreePort(Extension); - } - return; -} } -BOOLEAN PptTryAllocatePortAtInterruptLevel(PVOID Context ) -{ +void PptFreePortDpc(PKDPC Dpc, PVOID Extension, PVOID SystemArgument1, + PVOID SystemArgument2) { { - if (((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount == -1L) { - ((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount = 0; - ((struct _DEVICE_EXTENSION *)Context)->WmiPortAllocFreeCounts.PortAllocates += 1UL; - return (1); - } else { - return (0); + { PptFreePort(Extension); } + return; } } -} -void PptFreePortFromInterruptLevel(PVOID Context ) -{ +BOOLEAN PptTryAllocatePortAtInterruptLevel(PVOID Context) { { - if (((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount == 0L) { - ((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount = -1; - } else { - { - KeInsertQueueDpc(& ((struct _DEVICE_EXTENSION *)Context)->FreePortDpc, (void *)0, - (void *)0); + if (((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount == -1L) { + ((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount = 0; + ((struct _DEVICE_EXTENSION *)Context) + ->WmiPortAllocFreeCounts.PortAllocates += 1UL; + return (1); + } else { + return (0); } } - return; } -} -BOOLEAN PptInterruptService(PKINTERRUPT Interrupt , PVOID Extension ) -{ PLIST_ENTRY Current ; - PISR_LIST_ENTRY IsrListEntry ; - PDEVICE_EXTENSION DeviceExtension ; - BOOLEAN tmp ; +void PptFreePortFromInterruptLevel(PVOID Context) { { - DeviceExtension = Extension; - Current = DeviceExtension->IsrList.Flink; - { - while (1) { - while_298_continue: /* CIL Label */ ; - if ((unsigned int )Current != (unsigned int )(& DeviceExtension->IsrList)) { - - } else { - goto while_298_break; - } - { - IsrListEntry = (ISR_LIST_ENTRY *)((CHAR *)Current - (unsigned long )(& ((ISR_LIST_ENTRY *)0)->ListEntry)); - tmp = (*(IsrListEntry->ServiceRoutine))(Interrupt, IsrListEntry->ServiceContext); - } - if (tmp) { - return (1); + if (((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount == 0L) { + ((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount = -1; } else { - + { + KeInsertQueueDpc(&((struct _DEVICE_EXTENSION *)Context)->FreePortDpc, + (void *)0, (void *)0); + } } - Current = Current->Flink; - } - while_298_break: /* CIL Label */ ; + return; } - return (0); -} } -BOOLEAN PptTryAllocatePort(PVOID Extension ) -{ PDEVICE_EXTENSION DeviceExtension ; - KIRQL CancelIrql ; - BOOLEAN b ; +BOOLEAN PptInterruptService(PKINTERRUPT Interrupt, PVOID Extension) { + PLIST_ENTRY Current; + PISR_LIST_ENTRY IsrListEntry; + PDEVICE_EXTENSION DeviceExtension; + BOOLEAN tmp; { - DeviceExtension = Extension; - if (DeviceExtension->InterruptRefCount) { - { - b = KeSynchronizeExecution(DeviceExtension->InterruptObject, & PptTryAllocatePortAtInterruptLevel, - DeviceExtension); - } - } else { + DeviceExtension = Extension; + Current = DeviceExtension->IsrList.Flink; { - IoAcquireCancelSpinLock(& CancelIrql); - b = PptTryAllocatePortAtInterruptLevel(DeviceExtension); -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + while (1) { + while_298_continue: /* CIL Label */; + if ((unsigned int)Current != + (unsigned int)(&DeviceExtension->IsrList)) { + + } else { + goto while_298_break; + } + { + IsrListEntry = + (ISR_LIST_ENTRY *)((CHAR *)Current - + (unsigned long)(&((ISR_LIST_ENTRY *)0) + ->ListEntry)); + tmp = (*(IsrListEntry->ServiceRoutine))(Interrupt, + IsrListEntry->ServiceContext); + } + if (tmp) { + return (1); + } else { + } + Current = Current->Flink; + } + while_298_break: /* CIL Label */; } + return (0); } - { - } - return (b); -} } -BOOLEAN PptTraversePortCheckList(PVOID Extension ) -{ PDEVICE_EXTENSION DeviceExtension ; - PLIST_ENTRY Current ; - PISR_LIST_ENTRY CheckEntry ; +BOOLEAN PptTryAllocatePort(PVOID Extension) { + PDEVICE_EXTENSION DeviceExtension; + KIRQL CancelIrql; + BOOLEAN b; { - DeviceExtension = Extension; - if (DeviceExtension->WorkQueueCount >= 0L) { - return (0); - } else { - - } - Current = DeviceExtension->IsrList.Flink; - { - while (1) { - while_300_continue: /* CIL Label */ ; - if ((unsigned int )Current != (unsigned int )(& DeviceExtension->IsrList)) { - + DeviceExtension = Extension; + if (DeviceExtension->InterruptRefCount) { + { + b = KeSynchronizeExecution(DeviceExtension->InterruptObject, + &PptTryAllocatePortAtInterruptLevel, + DeviceExtension); + } } else { - goto while_300_break; - } - CheckEntry = (ISR_LIST_ENTRY *)((CHAR *)Current - (unsigned long )(& ((ISR_LIST_ENTRY *)0)->ListEntry)); - if (CheckEntry->DeferredPortCheckRoutine) { { - (*(CheckEntry->DeferredPortCheckRoutine))(CheckEntry->CheckContext); + IoAcquireCancelSpinLock(&CancelIrql); + b = PptTryAllocatePortAtInterruptLevel(DeviceExtension); + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ } - } else { - } - Current = Current->Flink; + {} + return (b); } - while_300_break: /* CIL Label */ ; - } - return (1); -} } -void PptFreePort(PVOID Extension ) -{ PDEVICE_EXTENSION DeviceExtension ; - SYNCHRONIZED_COUNT_CONTEXT SyncContext ; - KIRQL CancelIrql ; - ULONG InterruptRefCount ; - BOOLEAN Allocated ; +BOOLEAN PptTraversePortCheckList(PVOID Extension) { + PDEVICE_EXTENSION DeviceExtension; + PLIST_ENTRY Current; + PISR_LIST_ENTRY CheckEntry; { - DeviceExtension = Extension; - { - } - { - SyncContext.Count = & DeviceExtension->WorkQueueCount; - IoAcquireCancelSpinLock(& CancelIrql); - } - if (DeviceExtension->InterruptRefCount) { - { - KeSynchronizeExecution(DeviceExtension->InterruptObject, & PptSynchronizedDecrement, - & SyncContext); + DeviceExtension = Extension; + if (DeviceExtension->WorkQueueCount >= 0L) { + return (0); + } else { } - } else { + Current = DeviceExtension->IsrList.Flink; { - PptSynchronizedDecrement(& SyncContext); + while (1) { + while_300_continue: /* CIL Label */; + if ((unsigned int)Current != + (unsigned int)(&DeviceExtension->IsrList)) { + + } else { + goto while_300_break; + } + CheckEntry = (ISR_LIST_ENTRY *)((CHAR *)Current - + (unsigned long)(&((ISR_LIST_ENTRY *)0) + ->ListEntry)); + if (CheckEntry->DeferredPortCheckRoutine) { + { + (*(CheckEntry->DeferredPortCheckRoutine))(CheckEntry->CheckContext); + } + } else { + } + Current = Current->Flink; + } + while_300_break: /* CIL Label */; } + return (1); } - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - DeviceExtension->WmiPortAllocFreeCounts.PortFrees += 1UL; - Allocated = 0; - } - { - while (1) { - while_302_continue: /* CIL Label */ ; - if (! Allocated) { - if (SyncContext.NewCount >= 0L) { +} +void PptFreePort(PVOID Extension) { + PDEVICE_EXTENSION DeviceExtension; + SYNCHRONIZED_COUNT_CONTEXT SyncContext; + KIRQL CancelIrql; + ULONG InterruptRefCount; + BOOLEAN Allocated; - } else { - goto while_302_break; + { + DeviceExtension = Extension; + {} { + SyncContext.Count = &DeviceExtension->WorkQueueCount; + IoAcquireCancelSpinLock(&CancelIrql); + } + if (DeviceExtension->InterruptRefCount) { + { + KeSynchronizeExecution(DeviceExtension->InterruptObject, + &PptSynchronizedDecrement, &SyncContext); } } else { - goto while_302_break; + { PptSynchronizedDecrement(&SyncContext); } + } + { + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + DeviceExtension->WmiPortAllocFreeCounts.PortFrees += 1UL; + Allocated = 0; } - } - while_302_break: /* CIL Label */ ; - } - if (! Allocated) { { - IoAcquireCancelSpinLock(& CancelIrql); - InterruptRefCount = DeviceExtension->InterruptRefCount; -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + while (1) { + while_302_continue: /* CIL Label */; + if (!Allocated) { + if (SyncContext.NewCount >= 0L) { + + } else { + goto while_302_break; + } + } else { + goto while_302_break; + } + } + while_302_break: /* CIL Label */; } - if (InterruptRefCount) { + if (!Allocated) { { - KeSynchronizeExecution(DeviceExtension->InterruptObject, & PptTraversePortCheckList, - DeviceExtension); + IoAcquireCancelSpinLock(&CancelIrql); + InterruptRefCount = DeviceExtension->InterruptRefCount; + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } + if (InterruptRefCount) { + { + KeSynchronizeExecution(DeviceExtension->InterruptObject, + &PptTraversePortCheckList, DeviceExtension); + } + } else { } } else { - } - } else { - + return; } - return; -} } -ULONG PptQueryNumWaiters(PVOID Extension ) -{ PDEVICE_EXTENSION DeviceExtension ; - KIRQL CancelIrql ; - SYNCHRONIZED_COUNT_CONTEXT SyncContext ; - unsigned long tmp ; +ULONG PptQueryNumWaiters(PVOID Extension) { + PDEVICE_EXTENSION DeviceExtension; + KIRQL CancelIrql; + SYNCHRONIZED_COUNT_CONTEXT SyncContext; + unsigned long tmp; { - DeviceExtension = Extension; - SyncContext.Count = & DeviceExtension->WorkQueueCount; - if (DeviceExtension->InterruptRefCount) { - { - KeSynchronizeExecution(DeviceExtension->InterruptObject, & PptSynchronizedRead, - & SyncContext); + DeviceExtension = Extension; + SyncContext.Count = &DeviceExtension->WorkQueueCount; + if (DeviceExtension->InterruptRefCount) { + { + KeSynchronizeExecution(DeviceExtension->InterruptObject, + &PptSynchronizedRead, &SyncContext); + } + } else { + { + IoAcquireCancelSpinLock(&CancelIrql); + PptSynchronizedRead(&SyncContext); + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } } - } else { - { - IoAcquireCancelSpinLock(& CancelIrql); - PptSynchronizedRead(& SyncContext); -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + if (SyncContext.NewCount >= 0L) { + tmp = (unsigned long)SyncContext.NewCount; + } else { + tmp = 0; } + return (tmp); } - if (SyncContext.NewCount >= 0L) { - tmp = (unsigned long )SyncContext.NewCount; - } else { - tmp = 0; - } - return (tmp); } -} -PVOID PptSetCancelRoutine(PIRP Irp , void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , - struct _IRP *Irp ) ) -{ LONG tmp ; +PVOID PptSetCancelRoutine( + PIRP Irp, void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp)) { + LONG tmp; { - { - tmp = InterlockedExchange((LONG *)((PVOID *)(& Irp->CancelRoutine)), (long )((void *)CancelRoutine)); + { + tmp = InterlockedExchange((LONG *)((PVOID *)(&Irp->CancelRoutine)), + (long)((void *)CancelRoutine)); + } + return ((void (*)(struct _DEVICE_OBJECT * DeviceObject, struct _IRP * Irp))( + (void *)tmp)); } - return ((void (*)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ))((void *)tmp)); } -} -extern void KeQueryTickCount(LARGE_INTEGER *i) ; -BOOLEAN CheckPort(PUCHAR wPortAddr , UCHAR bMask , UCHAR bValue , USHORT usTimeDelay ) -{ UCHAR dsr ; - LARGE_INTEGER Wait ; - LARGE_INTEGER Start ; - LARGE_INTEGER End ; - ULONG tmp ; - ULONG tmp___0 ; - - { - { - dsr = READ_PORT_UCHAR(wPortAddr); - } - if (((int )dsr & (int )bMask) == (int )bValue) { - return (1); - } else { +extern void KeQueryTickCount(LARGE_INTEGER *i); +BOOLEAN CheckPort(PUCHAR wPortAddr, UCHAR bMask, UCHAR bValue, + USHORT usTimeDelay) { + UCHAR dsr; + LARGE_INTEGER Wait; + LARGE_INTEGER Start; + LARGE_INTEGER End; + ULONG tmp; + ULONG tmp___0; - } - { - tmp = KeQueryTimeIncrement(); - Wait.QuadPart = (ULONG )(((int )usTimeDelay * 10) * 10) + tmp; - KeQueryTickCount(& Start); - } { - while (1) { - while_303_continue: /* CIL Label */ ; - { - KeQueryTickCount(& End); - dsr = READ_PORT_UCHAR(wPortAddr); - } - if (((int )dsr & (int )bMask) == (int )bValue) { + { dsr = READ_PORT_UCHAR(wPortAddr); } + if (((int)dsr & (int)bMask) == (int)bValue) { return (1); } else { - } { - tmp___0 = KeQueryTimeIncrement(); + tmp = KeQueryTimeIncrement(); + Wait.QuadPart = (ULONG)(((int)usTimeDelay * 10) * 10) + tmp; + KeQueryTickCount(&Start); } - if ((End.QuadPart - Start.QuadPart) * (LONGLONG )tmp___0 > Wait.QuadPart) { - goto CheckPort_TimeOut; - } else { - + { + while (1) { + while_303_continue: /* CIL Label */; + { + KeQueryTickCount(&End); + dsr = READ_PORT_UCHAR(wPortAddr); + } + if (((int)dsr & (int)bMask) == (int)bValue) { + return (1); + } else { + } + { tmp___0 = KeQueryTimeIncrement(); } + if ((End.QuadPart - Start.QuadPart) * (LONGLONG)tmp___0 > + Wait.QuadPart) { + goto CheckPort_TimeOut; + } else { + } + } + while_303_break: /* CIL Label */; } + CheckPort_TimeOut: + return (0); } - while_303_break: /* CIL Label */ ; - } - CheckPort_TimeOut: - return (0); } -} -NTSTATUS PptBuildParallelPortDeviceName(ULONG Number , PUNICODE_STRING DeviceName ) -{ UNICODE_STRING uniDeviceString ; - UNICODE_STRING uniBaseNameString ; - UNICODE_STRING uniPortNumberString ; - WCHAR wcPortNum[10] ; - NTSTATUS status ; - PVOID tmp ; +NTSTATUS PptBuildParallelPortDeviceName(ULONG Number, + PUNICODE_STRING DeviceName) { + UNICODE_STRING uniDeviceString; + UNICODE_STRING uniBaseNameString; + UNICODE_STRING uniPortNumberString; + WCHAR wcPortNum[10]; + NTSTATUS status; + PVOID tmp; { - { - } - { -/* RtlInitUnicodeString(DeviceName, (void *)0); */ /* INLINED */ - uniPortNumberString.Length = 0; - uniPortNumberString.MaximumLength = sizeof(wcPortNum); - uniPortNumberString.Buffer = wcPortNum; - status = RtlIntegerToUnicodeString(Number, 10, & uniPortNumberString); - } - if (! (status >= 0L)) { - { + {} { + /* RtlInitUnicodeString(DeviceName, (void *)0); */ /* INLINED */ + uniPortNumberString.Length = 0; + uniPortNumberString.MaximumLength = sizeof(wcPortNum); + uniPortNumberString.Buffer = wcPortNum; + status = RtlIntegerToUnicodeString(Number, 10, &uniPortNumberString); } - return (status); - } else { - - } - { - DeviceName->MaximumLength = (unsigned short )((unsigned int )(((int )uniDeviceString.Length + (int )uniBaseNameString.Length) + (int )uniPortNumberString.Length) + sizeof((unsigned short)0)); - tmp = ExAllocatePoolWithTag(1, DeviceName->MaximumLength, 1349673296UL); - DeviceName->Buffer = tmp; - } - if ((unsigned int )((void *)0) == (unsigned int )DeviceName->Buffer) { - { + if (!(status >= 0L)) { + {} + return (status); + } else { } - return (-1073741670L); - } else { - - } - { - memset(DeviceName->Buffer, 0, DeviceName->MaximumLength); - RtlAppendUnicodeStringToString(DeviceName, & uniDeviceString); - RtlAppendUnicodeStringToString(DeviceName, & uniBaseNameString); - RtlAppendUnicodeStringToString(DeviceName, & uniPortNumberString); - } - return (0L); -} -} -NTSTATUS PptInitializeDeviceExtension(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject , - PDEVICE_OBJECT DeviceObject , PUNICODE_STRING UniNameString , - PWSTR PortName , ULONG PortNumber ) -{ PDEVICE_EXTENSION Extension ; - ULONG bufferLength ; - PVOID tmp ; - - { - { - Extension = DeviceObject->DeviceExtension; - memset(Extension, 0, sizeof(DEVICE_EXTENSION )); - Extension->ExtensionSignatureBegin = 2022144135; - Extension->ExtensionSignatureEnd = 2272823160U; - Extension->DriverObject = DriverObject; - Extension->PhysicalDeviceObject = PhysicalDeviceObject; - Extension->DeviceObject = DeviceObject; - Extension->PnpInfo.PortNumber = PortNumber; - IoInitializeRemoveLockEx(& Extension->RemoveLock, 1349673296UL, 1, 10, sizeof(IO_REMOVE_LOCK )); - Extension->OpenCloseMutex.Count = 1; - Extension->OpenCloseMutex.Contention = 0; -/* KeInitializeEvent(& Extension->OpenCloseMutex.Event, 1, 0); */ /* INLINED */ - Extension->ExtensionFastMutex.Count = 1; - Extension->ExtensionFastMutex.Contention = 0; -/* KeInitializeEvent(& Extension->ExtensionFastMutex.Event, 1, 0); */ /* INLINED */ - Extension->NationalChipFound = 0; - Extension->NationalChecked = 0; - Extension->WorkQueue.Blink = & Extension->WorkQueue; - Extension->WorkQueue.Flink = Extension->WorkQueue.Blink; - Extension->WorkQueueCount = -1; - Extension->PortInfo.FreePort = & PptFreePort; - Extension->PortInfo.TryAllocatePort = & PptTryAllocatePort; - Extension->PortInfo.QueryNumWaiters = & PptQueryNumWaiters; - Extension->PortInfo.Context = Extension; - Extension->PnpInfo.HardwareCapabilities = 0; - Extension->PnpInfo.TrySetChipMode = & PptSetChipMode; - Extension->PnpInfo.ClearChipMode = & PptClearChipMode; - Extension->PnpInfo.TrySelectDevice = & PptTrySelectDevice; - Extension->PnpInfo.DeselectDevice = & PptDeselectDevice; - Extension->PnpInfo.Context = Extension; - Extension->PnpInfo.PortName = PortName; - Extension->RemovalRelationsList.Blink = & Extension->RemovalRelationsList; - Extension->RemovalRelationsList.Flink = Extension->RemovalRelationsList.Blink; - Extension->IsrList.Blink = & Extension->IsrList; - Extension->IsrList.Flink = Extension->IsrList.Blink; - Extension->InterruptObject = (void *)0; - Extension->InterruptRefCount = 0; - KeInitializeDpc(& Extension->FreePortDpc, & PptFreePortDpc, Extension); - bufferLength = (unsigned int )UniNameString->MaximumLength + sizeof((unsigned short)0); - tmp = ExAllocatePoolWithTag(0, bufferLength, 1349673296UL); - Extension->DeviceName.Buffer = tmp; - } - if (! Extension->DeviceName.Buffer) { - return (-1073741670L); - } else { - - } - { - memset(Extension->DeviceName.Buffer, 0, bufferLength); - Extension->DeviceName.Length = 0; - Extension->DeviceName.MaximumLength = UniNameString->MaximumLength; -/* RtlCopyUnicodeString(& Extension->DeviceName, UniNameString); */ /* INLINED */ - Extension->PnpInfo.CurrentMode = 0; - Extension_FilterMode = 0; - } - return (0L); -} -} -NTSTATUS PptGetPortNumberFromLptName(PWSTR PortName , PULONG PortNumber ) -{ NTSTATUS status ; - UNICODE_STRING str ; - int __BLAST_NONDET = __VERIFIER_nondet_int() ; - - { - if (__BLAST_NONDET) { { + DeviceName->MaximumLength = + (unsigned short)((unsigned int)(((int)uniDeviceString.Length + + (int)uniBaseNameString.Length) + + (int)uniPortNumberString.Length) + + sizeof((unsigned short)0)); + tmp = ExAllocatePoolWithTag(1, DeviceName->MaximumLength, 1349673296UL); + DeviceName->Buffer = tmp; } - return (-1073741823L); - } else { - - } - { -/* RtlInitUnicodeString(& str, PortName + 3); */ /* INLINED */ - status = RtlUnicodeStringToInteger(& str, 10, PortNumber); - } - if (! (status >= 0L)) { - { + if ((unsigned int)((void *)0) == (unsigned int)DeviceName->Buffer) { + {} + return (-1073741670L); + } else { } - return (-1073741823L); - } else { - - } - if (*PortNumber == 0UL) { { + memset(DeviceName->Buffer, 0, DeviceName->MaximumLength); + RtlAppendUnicodeStringToString(DeviceName, &uniDeviceString); + RtlAppendUnicodeStringToString(DeviceName, &uniBaseNameString); + RtlAppendUnicodeStringToString(DeviceName, &uniPortNumberString); } - return (-1073741823L); - } else { - - } - { + return (0L); } - return (0L); -} } -PDEVICE_OBJECT PptBuildDeviceObject(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) -{ UNICODE_STRING uniNameString ; - ULONG portNumber ; - PWSTR portName ; - NTSTATUS status ; - PDEVICE_OBJECT deviceObject ; - - { - uniNameString.Length = 0; - uniNameString.MaximumLength = 0; - uniNameString.Buffer = 0; - portNumber = 0; - portName = (void *)0; - status = 0L; - deviceObject = (void *)0; - { - } - { - portName = PptGetPortNameFromPhysicalDeviceObject(PhysicalDeviceObject); - } - if ((unsigned int )((void *)0) == (unsigned int )portName) { - { +NTSTATUS PptInitializeDeviceExtension(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject, + PDEVICE_OBJECT DeviceObject, + PUNICODE_STRING UniNameString, + PWSTR PortName, ULONG PortNumber) { + PDEVICE_EXTENSION Extension; + ULONG bufferLength; + PVOID tmp; + + { + { + Extension = DeviceObject->DeviceExtension; + memset(Extension, 0, sizeof(DEVICE_EXTENSION)); + Extension->ExtensionSignatureBegin = 2022144135; + Extension->ExtensionSignatureEnd = 2272823160U; + Extension->DriverObject = DriverObject; + Extension->PhysicalDeviceObject = PhysicalDeviceObject; + Extension->DeviceObject = DeviceObject; + Extension->PnpInfo.PortNumber = PortNumber; + IoInitializeRemoveLockEx(&Extension->RemoveLock, 1349673296UL, 1, 10, + sizeof(IO_REMOVE_LOCK)); + Extension->OpenCloseMutex.Count = 1; + Extension->OpenCloseMutex.Contention = 0; + /* KeInitializeEvent(& Extension->OpenCloseMutex.Event, 1, 0); */ /* INLINED + */ + Extension->ExtensionFastMutex.Count = 1; + Extension->ExtensionFastMutex.Contention = 0; + /* KeInitializeEvent(& Extension->ExtensionFastMutex.Event, 1, 0); */ /* INLINED */ + Extension->NationalChipFound = 0; + Extension->NationalChecked = 0; + Extension->WorkQueue.Blink = &Extension->WorkQueue; + Extension->WorkQueue.Flink = Extension->WorkQueue.Blink; + Extension->WorkQueueCount = -1; + Extension->PortInfo.FreePort = &PptFreePort; + Extension->PortInfo.TryAllocatePort = &PptTryAllocatePort; + Extension->PortInfo.QueryNumWaiters = &PptQueryNumWaiters; + Extension->PortInfo.Context = Extension; + Extension->PnpInfo.HardwareCapabilities = 0; + Extension->PnpInfo.TrySetChipMode = &PptSetChipMode; + Extension->PnpInfo.ClearChipMode = &PptClearChipMode; + Extension->PnpInfo.TrySelectDevice = &PptTrySelectDevice; + Extension->PnpInfo.DeselectDevice = &PptDeselectDevice; + Extension->PnpInfo.Context = Extension; + Extension->PnpInfo.PortName = PortName; + Extension->RemovalRelationsList.Blink = &Extension->RemovalRelationsList; + Extension->RemovalRelationsList.Flink = + Extension->RemovalRelationsList.Blink; + Extension->IsrList.Blink = &Extension->IsrList; + Extension->IsrList.Flink = Extension->IsrList.Blink; + Extension->InterruptObject = (void *)0; + Extension->InterruptRefCount = 0; + KeInitializeDpc(&Extension->FreePortDpc, &PptFreePortDpc, Extension); + bufferLength = (unsigned int)UniNameString->MaximumLength + + sizeof((unsigned short)0); + tmp = ExAllocatePoolWithTag(0, bufferLength, 1349673296UL); + Extension->DeviceName.Buffer = tmp; + } + if (!Extension->DeviceName.Buffer) { + return (-1073741670L); + } else { + } + { + memset(Extension->DeviceName.Buffer, 0, bufferLength); + Extension->DeviceName.Length = 0; + Extension->DeviceName.MaximumLength = UniNameString->MaximumLength; + /* RtlCopyUnicodeString(& Extension->DeviceName, UniNameString); */ /* INLINED + */ + Extension->PnpInfo.CurrentMode = 0; + Extension_FilterMode = 0; } - goto targetExit; - } else { - - } - { + return (0L); } +} +NTSTATUS PptGetPortNumberFromLptName(PWSTR PortName, PULONG PortNumber) { + NTSTATUS status; + UNICODE_STRING str; + int __BLAST_NONDET = __VERIFIER_nondet_int(); + { - status = PptGetPortNumberFromLptName(portName, & portNumber); - } - if (! (status >= 0L)) { - { + if (__BLAST_NONDET) { + {} + return (-1073741823L); + } else { } { -/* ExFreePool(portName); */ /* INLINED */ + /* RtlInitUnicodeString(& str, PortName + 3); */ /* INLINED */ + status = RtlUnicodeStringToInteger(&str, 10, PortNumber); } - goto targetExit; - } else { - - } - portNumber -= 1UL; - { - } - { - status = PptBuildParallelPortDeviceName(portNumber, & uniNameString); - } - if (! (status >= 0L)) { - { + if (!(status >= 0L)) { + {} + return (-1073741823L); + } else { } - { -/* ExFreePool(portName); */ /* INLINED */ + if (*PortNumber == 0UL) { + {} + return (-1073741823L); + } else { } - goto targetExit; - } else { - - } - { + {} + return (0L); } +} +PDEVICE_OBJECT PptBuildDeviceObject(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject) { + UNICODE_STRING uniNameString; + ULONG portNumber; + PWSTR portName; + NTSTATUS status; + PDEVICE_OBJECT deviceObject; + { - status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION ), & uniNameString, - 22, 256, 0, & deviceObject); - } - if (-1073741771L == status) { - { + uniNameString.Length = 0; + uniNameString.MaximumLength = 0; + uniNameString.Buffer = 0; + portNumber = 0; + portName = (void *)0; + status = 0L; + deviceObject = (void *)0; + {} { + portName = PptGetPortNameFromPhysicalDeviceObject(PhysicalDeviceObject); } - portNumber = 7; - { - while (1) { - while_319_continue: /* CIL Label */ ; - { -/* RtlFreeUnicodeString(& uniNameString); */ /* INLINED */ - portNumber += 1UL; - status = PptBuildParallelPortDeviceName(portNumber, & uniNameString); - } - if (! (status >= 0L)) { - { - } - { -/* ExFreePool(portName); */ /* INLINED */ - } - goto targetExit; - } else { - + if ((unsigned int)((void *)0) == (unsigned int)portName) { + {} + goto targetExit; + } else { + } + {} { status = PptGetPortNumberFromLptName(portName, &portNumber); } + if (!(status >= 0L)) { + {} { /* ExFreePool(portName); */ /* INLINED */ } - { + goto targetExit; + } else { + } + portNumber -= 1UL; + {} { status = PptBuildParallelPortDeviceName(portNumber, &uniNameString); } + if (!(status >= 0L)) { + {} { /* ExFreePool(portName); */ /* INLINED */ } + goto targetExit; + } else { + } + {} { + status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION), + &uniNameString, 22, 256, 0, &deviceObject); + } + if (-1073741771L == status) { + {} + portNumber = 7; { - status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION ), & uniNameString, - 22, 256, 0, & deviceObject); - } - if (-1073741771L == status) { + while (1) { + while_319_continue: /* CIL Label */; + { + /* RtlFreeUnicodeString(& uniNameString); */ /* INLINED */ + portNumber += 1UL; + status = PptBuildParallelPortDeviceName(portNumber, &uniNameString); + } + if (!(status >= 0L)) { + {} { /* ExFreePool(portName); */ /* INLINED */ + } + goto targetExit; + } else { + } + {} { + status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION), + &uniNameString, 22, 256, 0, &deviceObject); + } + if (-1073741771L == status) { - } else { - goto while_319_break; + } else { + goto while_319_break; + } + } + while_319_break: /* CIL Label */; } + } else { } - while_319_break: /* CIL Label */ ; - } - } else { - - } - if (! (status >= 0L)) { - { + if (!(status >= 0L)) { + {} { + deviceObject = (void *)0; + /* ExFreePool(portName); */ /* INLINED */ + } + goto targetExit; + } else { } { - deviceObject = (void *)0; -/* ExFreePool(portName); */ /* INLINED */ + status = PptInitializeDeviceExtension(DriverObject, PhysicalDeviceObject, + deviceObject, &uniNameString, + portName, portNumber); } - goto targetExit; - } else { - - } - { - status = PptInitializeDeviceExtension(DriverObject, PhysicalDeviceObject, deviceObject, - & uniNameString, portName, portNumber); - } - if (! (status >= 0L)) { - { + if (!(status >= 0L)) { + {} { + /* IoDeleteDevice(deviceObject); */ /* INLINED */ + deviceObject = (void *)0; + /* ExFreePool(portName); */ /* INLINED */ + } + goto targetExit; + } else { } - { -/* IoDeleteDevice(deviceObject); */ /* INLINED */ - deviceObject = (void *)0; -/* ExFreePool(portName); */ /* INLINED */ + if (PhysicalDeviceObject->Flags & 8192UL) { + deviceObject->Flags |= 8192UL; + } else { } - goto targetExit; - } else { - - } - if (PhysicalDeviceObject->Flags & 8192UL) { - deviceObject->Flags |= 8192UL; - } else { - - } - { + {} + targetExit : { /* RtlFreeUnicodeString(& uniNameString); */ /* INLINED */ } - targetExit: - { -/* RtlFreeUnicodeString(& uniNameString); */ /* INLINED */ + return (deviceObject); } - return (deviceObject); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -#pragma warning(disable:4200) -NTSTATUS PptWmiQueryWmiRegInfo(PDEVICE_OBJECT PDevObj , PULONG PRegFlags , PUNICODE_STRING PInstanceName , - PUNICODE_STRING *PRegistryPath , PUNICODE_STRING MofResourceName , - PDEVICE_OBJECT *Pdo ) ; -NTSTATUS PptWmiQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray , - ULONG OutBufferSize , PUCHAR Buffer ) ; -#pragma alloc_text(PAGEPARWMI0,PptWmiInitWmi) -#pragma alloc_text(PAGEPARWMI0,PptDispatchSystemControl) -#pragma alloc_text(PAGEPARWMI0,PptWmiQueryWmiRegInfo) -#pragma alloc_text(PAGEPARWMI0,PptWmiQueryWmiDataBlock) -GUID PptWmiAllocFreeCountsGuid = {1270573546, 26707, 4562, {142, 206, 0, 192, 79, 142, 244, 129}}; -WMIGUIDREGINFO PptWmiGuidList[1] = { {& PptWmiAllocFreeCountsGuid, 1, 0}}; -NTSTATUS PptWmiInitWmi(PDEVICE_OBJECT DeviceObject ) -{ PDEVICE_EXTENSION devExt ; - PWMILIB_CONTEXT wmiContext ; - NTSTATUS tmp ; - - { - { - devExt = DeviceObject->DeviceExtension; - wmiContext = & devExt->WmiLibContext; - wmiContext->GuidCount = sizeof(PptWmiGuidList) / sizeof(WMIGUIDREGINFO ); - wmiContext->GuidList = PptWmiGuidList; - wmiContext->QueryWmiRegInfo = & PptWmiQueryWmiRegInfo; - wmiContext->QueryWmiDataBlock = & PptWmiQueryWmiDataBlock; - wmiContext->SetWmiDataBlock = (void *)0; - wmiContext->SetWmiDataItem = (void *)0; - wmiContext->ExecuteWmiMethod = (void *)0; - wmiContext->WmiFunctionControl = (void *)0; - tmp = IoWMIRegistrationControl(DeviceObject, 1); - } - return (tmp); -} -} -NTSTATUS PptDispatchSystemControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ SYSCTL_IRP_DISPOSITION disposition ; - NTSTATUS status ; - PDEVICE_EXTENSION pDevExt ; - - { - { - pDevExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - status = WmiSystemControl(& pDevExt->WmiLibContext, DeviceObject, Irp, & disposition); - } - if (disposition == 0) { - goto switch_325_0; - } else { - if (disposition == 1) { - goto switch_325_1; - } else { - if (disposition == 3) { - goto switch_325_3; +#pragma warning(disable : 4200) +NTSTATUS PptWmiQueryWmiRegInfo(PDEVICE_OBJECT PDevObj, PULONG PRegFlags, + PUNICODE_STRING PInstanceName, + PUNICODE_STRING *PRegistryPath, + PUNICODE_STRING MofResourceName, + PDEVICE_OBJECT *Pdo); +NTSTATUS PptWmiQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject, PIRP Irp, + ULONG GuidIndex, ULONG InstanceIndex, + ULONG InstanceCount, + PULONG InstanceLengthArray, + ULONG OutBufferSize, PUCHAR Buffer); +#pragma alloc_text(PAGEPARWMI0, PptWmiInitWmi) +#pragma alloc_text(PAGEPARWMI0, PptDispatchSystemControl) +#pragma alloc_text(PAGEPARWMI0, PptWmiQueryWmiRegInfo) +#pragma alloc_text(PAGEPARWMI0, PptWmiQueryWmiDataBlock) +GUID PptWmiAllocFreeCountsGuid = { + 1270573546, 26707, 4562, {142, 206, 0, 192, 79, 142, 244, 129}}; +WMIGUIDREGINFO PptWmiGuidList[1] = {{&PptWmiAllocFreeCountsGuid, 1, 0}}; +NTSTATUS PptWmiInitWmi(PDEVICE_OBJECT DeviceObject) { + PDEVICE_EXTENSION devExt; + PWMILIB_CONTEXT wmiContext; + NTSTATUS tmp; + + { + { + devExt = DeviceObject->DeviceExtension; + wmiContext = &devExt->WmiLibContext; + wmiContext->GuidCount = sizeof(PptWmiGuidList) / sizeof(WMIGUIDREGINFO); + wmiContext->GuidList = PptWmiGuidList; + wmiContext->QueryWmiRegInfo = &PptWmiQueryWmiRegInfo; + wmiContext->QueryWmiDataBlock = &PptWmiQueryWmiDataBlock; + wmiContext->SetWmiDataBlock = (void *)0; + wmiContext->SetWmiDataItem = (void *)0; + wmiContext->ExecuteWmiMethod = (void *)0; + wmiContext->WmiFunctionControl = (void *)0; + tmp = IoWMIRegistrationControl(DeviceObject, 1); + } + return (tmp); + } +} +NTSTATUS PptDispatchSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + SYSCTL_IRP_DISPOSITION disposition; + NTSTATUS status; + PDEVICE_EXTENSION pDevExt; + + { + { + pDevExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + status = WmiSystemControl(&pDevExt->WmiLibContext, DeviceObject, Irp, + &disposition); + } + if (disposition == 0) { + goto switch_325_0; + } else { + if (disposition == 1) { + goto switch_325_1; } else { - if (disposition == 2) { - goto switch_325_2; + if (disposition == 3) { + goto switch_325_3; } else { - { - goto switch_325_default; - if (0) { - switch_325_0: /* CIL Label */ - s = DC; - goto switch_325_break; - switch_325_1: /* CIL Label */ + if (disposition == 2) { + goto switch_325_2; + } else { { - PptCompleteRequest(Irp, 0); - } - goto switch_325_break; - switch_325_3: /* CIL Label */ ; - switch_325_2: /* CIL Label */ ; - if (s == NP) { - s = SKIP1; - } else { + goto switch_325_default; + if (0) { + switch_325_0: /* CIL Label */ + s = DC; + goto switch_325_break; + switch_325_1 : /* CIL Label */ { - errorFn(); + PptCompleteRequest(Irp, 0); } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - status = IofCallDriver(pDevExt->ParentDeviceObject, Irp); - } - goto switch_325_break; - switch_325_default: /* CIL Label */ ; - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); + goto switch_325_break; + switch_325_3: /* CIL Label */; + switch_325_2: /* CIL Label */; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + status = IofCallDriver(pDevExt->ParentDeviceObject, Irp); + } + goto switch_325_break; + switch_325_default: /* CIL Label */; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + status = IofCallDriver(pDevExt->ParentDeviceObject, Irp); + } + goto switch_325_break; + } else { + switch_325_break: /* CIL Label */; } } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - status = IofCallDriver(pDevExt->ParentDeviceObject, Irp); - } - goto switch_325_break; - } else { - switch_325_break: /* CIL Label */ ; - } } } } } + return (status); } - return (status); -} } -NTSTATUS PptWmiQueryWmiRegInfo(PDEVICE_OBJECT PDevObj , PULONG PRegFlags , PUNICODE_STRING PInstanceName , - PUNICODE_STRING *PRegistryPath , PUNICODE_STRING MofResourceName , - PDEVICE_OBJECT *Pdo ) -{ PDEVICE_EXTENSION devExt ; +NTSTATUS PptWmiQueryWmiRegInfo(PDEVICE_OBJECT PDevObj, PULONG PRegFlags, + PUNICODE_STRING PInstanceName, + PUNICODE_STRING *PRegistryPath, + PUNICODE_STRING MofResourceName, + PDEVICE_OBJECT *Pdo) { + PDEVICE_EXTENSION devExt; { - devExt = PDevObj->DeviceExtension; - { + devExt = PDevObj->DeviceExtension; + {} *PRegFlags = 32; + *PRegistryPath = &RegistryPath; + *Pdo = devExt->PhysicalDeviceObject; + return (0L); } - *PRegFlags = 32; - *PRegistryPath = & RegistryPath; - *Pdo = devExt->PhysicalDeviceObject; - return (0L); } -} -NTSTATUS PptWmiQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray , - ULONG OutBufferSize , PUCHAR Buffer ) -{ NTSTATUS status ; - ULONG size ; - PDEVICE_EXTENSION devExt ; +NTSTATUS PptWmiQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject, PIRP Irp, + ULONG GuidIndex, ULONG InstanceIndex, + ULONG InstanceCount, + PULONG InstanceLengthArray, + ULONG OutBufferSize, PUCHAR Buffer) { + NTSTATUS status; + ULONG size; + PDEVICE_EXTENSION devExt; { - size = sizeof(PARPORT_WMI_ALLOC_FREE_COUNTS ); - devExt = DeviceObject->DeviceExtension; - if (GuidIndex == 0) { - goto switch_327_0; - } else { - { - goto switch_327_default; - if (0) { - switch_327_0: /* CIL Label */ ; - if (OutBufferSize < size) { - status = -1073741789L; - goto switch_327_break; - } else { - + size = sizeof(PARPORT_WMI_ALLOC_FREE_COUNTS); + devExt = DeviceObject->DeviceExtension; + if (GuidIndex == 0) { + goto switch_327_0; + } else { + { + goto switch_327_default; + if (0) { + switch_327_0: /* CIL Label */; + if (OutBufferSize < size) { + status = -1073741789L; + goto switch_327_break; + } else { + } + *((struct _PARPORT_WMI_ALLOC_FREE_COUNTS *)Buffer) = + devExt->WmiPortAllocFreeCounts; + *InstanceLengthArray = size; + status = 0L; + goto switch_327_break; + switch_327_default: /* CIL Label */ + status = -1073741163L; + goto switch_327_break; + } else { + switch_327_break: /* CIL Label */; + } } - *((struct _PARPORT_WMI_ALLOC_FREE_COUNTS *)Buffer) = devExt->WmiPortAllocFreeCounts; - *InstanceLengthArray = size; - status = 0L; - goto switch_327_break; - switch_327_default: /* CIL Label */ - status = -1073741163L; - goto switch_327_break; - } else { - switch_327_break: /* CIL Label */ ; - } } + { status = WmiCompleteRequest(DeviceObject, Irp, status, size, 0); } + return (status); } - { - status = WmiCompleteRequest(DeviceObject, Irp, status, size, 0); - } - return (status); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) -void _BLAST_init(void) -{ - - { - UNLOADED = 0; - NP = 1; - DC = 2; - SKIP1 = 3; - SKIP2 = 4; - MPR1 = 5; - MPR3 = 6; - IPC = 7; - s = UNLOADED; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - return; -} -} -IRP *pirp ; -void stub_driver_init(void) -{ - - { - s = NP; - customIrp = 0; - setEventCalled = customIrp; - lowerDriverReturn = setEventCalled; - compRegistered = lowerDriverReturn; - compFptr = compRegistered; - pended = compFptr; - return; -} -} -int main(void) -{ DRIVER_OBJECT d ; - NTSTATUS status = __VERIFIER_nondet_long() ; - int we_should_unload = __VERIFIER_nondet_int() ; - IRP irp ; - int __BLAST_NONDET = __VERIFIER_nondet_int() ; - int irp_choice = __VERIFIER_nondet_int() ; - DEVICE_OBJECT devobj ; - s = __VERIFIER_nondet_int(); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +void _BLAST_init(void) { + + { + UNLOADED = 0; + NP = 1; + DC = 2; + SKIP1 = 3; + SKIP2 = 4; + MPR1 = 5; + MPR3 = 6; + IPC = 7; + s = UNLOADED; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + return; + } +} +IRP *pirp; +void stub_driver_init(void) { { - { - pirp = & irp; - _BLAST_init(); - } - if (status >= 0L) { s = NP; customIrp = 0; setEventCalled = customIrp; @@ -9624,94 +9241,118 @@ int main(void) compRegistered = lowerDriverReturn; compFptr = compRegistered; pended = compFptr; - pirp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (irp_choice == 0) { - pirp->IoStatus.__annonCompField4.Status = -1073741637L; - myStatus = -1073741637L; - } else { + return; + } +} +int main(void) { + DRIVER_OBJECT d; + NTSTATUS status = __VERIFIER_nondet_long(); + int we_should_unload = __VERIFIER_nondet_int(); + IRP irp; + int __BLAST_NONDET = __VERIFIER_nondet_int(); + int irp_choice = __VERIFIER_nondet_int(); + DEVICE_OBJECT devobj; + s = __VERIFIER_nondet_int(); - } + { { - stub_driver_init(); - } - if (! (status >= 0L)) { - return (-1); - } else { - + pirp = &irp; + _BLAST_init(); } - if (__BLAST_NONDET == 0) { - goto switch_328_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_328_1; + if (status >= 0L) { + s = NP; + customIrp = 0; + setEventCalled = customIrp; + lowerDriverReturn = setEventCalled; + compRegistered = lowerDriverReturn; + compFptr = compRegistered; + pended = compFptr; + pirp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (irp_choice == 0) { + pirp->IoStatus.__annonCompField4.Status = -1073741637L; + myStatus = -1073741637L; + } else { + } + { stub_driver_init(); } + if (!(status >= 0L)) { + return (-1); + } else { + } + if (__BLAST_NONDET == 0) { + goto switch_328_0; } else { - if (__BLAST_NONDET == 3) { - goto switch_328_3; + if (__BLAST_NONDET == 1) { + goto switch_328_1; } else { - if (__BLAST_NONDET == 4) { - goto switch_328_4; + if (__BLAST_NONDET == 3) { + goto switch_328_3; } else { - if (__BLAST_NONDET == 5) { - goto switch_328_5; + if (__BLAST_NONDET == 4) { + goto switch_328_4; } else { - if (__BLAST_NONDET == 6) { - goto switch_328_6; + if (__BLAST_NONDET == 5) { + goto switch_328_5; } else { - if (__BLAST_NONDET == 8) { - goto switch_328_8; + if (__BLAST_NONDET == 6) { + goto switch_328_6; } else { - if (__BLAST_NONDET == 11) { - goto switch_328_11; + if (__BLAST_NONDET == 8) { + goto switch_328_8; } else { - { - goto switch_328_default; - if (0) { - switch_328_0: /* CIL Label */ - { - status = PptDispatchCreate(& devobj, pirp); - } - goto switch_328_break; - switch_328_1: /* CIL Label */ - { - status = PptDispatchClose(& devobj, pirp); - } - goto switch_328_break; - switch_328_3: /* CIL Label */ - { - status = PptDispatchPnp(& devobj, pirp); - } - goto switch_328_break; - switch_328_4: /* CIL Label */ - { - status = PptDispatchPower(& devobj, pirp); - } - goto switch_328_break; - switch_328_5: /* CIL Label */ - { - status = PptDispatchCleanup(& devobj, pirp); - } - goto switch_328_break; - switch_328_6: /* CIL Label */ - { - status = PptDispatchSystemControl(& devobj, pirp); - } - goto switch_328_break; - switch_328_8: /* CIL Label */ - { - status = PptDispatchInternalDeviceControl(& devobj, pirp); - } - goto switch_328_break; - switch_328_11: /* CIL Label */ + if (__BLAST_NONDET == 11) { + goto switch_328_11; + } else { { - status = PptDispatchCleanup(& devobj, pirp); + goto switch_328_default; + if (0) { + switch_328_0 : /* CIL Label */ + { + status = PptDispatchCreate(&devobj, pirp); + } + goto switch_328_break; + switch_328_1 : /* CIL Label */ + { + status = PptDispatchClose(&devobj, pirp); + } + goto switch_328_break; + switch_328_3 : /* CIL Label */ + { + status = PptDispatchPnp(&devobj, pirp); + } + goto switch_328_break; + switch_328_4 : /* CIL Label */ + { + status = PptDispatchPower(&devobj, pirp); + } + goto switch_328_break; + switch_328_5 : /* CIL Label */ + { + status = PptDispatchCleanup(&devobj, pirp); + } + goto switch_328_break; + switch_328_6 : /* CIL Label */ + { + status = PptDispatchSystemControl(&devobj, pirp); + } + goto switch_328_break; + switch_328_8 : /* CIL Label */ + { + status = + PptDispatchInternalDeviceControl(&devobj, pirp); + } + goto switch_328_break; + switch_328_11 : /* CIL Label */ + { + status = PptDispatchCleanup(&devobj, pirp); + } + goto switch_328_break; + switch_328_default: /* CIL Label */; + return (-1); + } else { + switch_328_break: /* CIL Label */; + } } - goto switch_328_break; - switch_328_default: /* CIL Label */ ; - return (-1); - } else { - switch_328_break: /* CIL Label */ ; - } } } } @@ -9720,73 +9361,59 @@ int main(void) } } } - } - if (we_should_unload) { - { - PptUnload(& d); + if (we_should_unload) { + { PptUnload(&d); } + } else { } } else { - - } - } else { - - } - if (pended == 1) { - if (s == NP) { - s = NP; - } else { - goto _L___2; } - } else { - _L___2: /* CIL Label */ if (pended == 1) { - if (s == MPR3) { - s = MPR3; + if (s == NP) { + s = NP; } else { - goto _L___1; + goto _L___2; } } else { - _L___1: /* CIL Label */ - if (s == UNLOADED) { - + _L___2: /* CIL Label */ + if (pended == 1) { + if (s == MPR3) { + s = MPR3; + } else { + goto _L___1; + } } else { - if (status == -1L) { + _L___1: /* CIL Label */ + if (s == UNLOADED) { } else { - if (s != SKIP2) { - if (s != IPC) { - if (s != DC) { - { - errorFn(); - } - } else { - goto _L___0; - } - } else { - goto _L___0; - } + if (status == -1L) { + } else { - _L___0: /* CIL Label */ - if (pended == 1) { - if (status != 259L) { - { - errorFn(); + if (s != SKIP2) { + if (s != IPC) { + if (s != DC) { + { errorFn(); } + } else { + goto _L___0; } } else { - + goto _L___0; } } else { - if (s == DC) { - { - errorFn(); + _L___0: /* CIL Label */ + if (pended == 1) { + if (status != 259L) { + { errorFn(); } + } else { } } else { - if (status != (NTSTATUS )lowerDriverReturn) { - { - errorFn(); - } + if (s == DC) { + { errorFn(); } } else { - + if (status != (NTSTATUS)lowerDriverReturn) { + { errorFn(); } + } else { + } } } } @@ -9794,1147 +9421,1014 @@ int main(void) } } } + return (status); } - return (status); -} } -char _SLAM_alloc_dummy ; -void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; -void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) -{ +char _SLAM_alloc_dummy; +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; -void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) -{ +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; -PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , SIZE_T NumberOfBytes , - ULONG Tag ) -{ PVOID x ; - char *tmp ; +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag) { + PVOID x; + char *tmp; { - { - tmp = malloc(NumberOfBytes); - x = tmp; + { + tmp = malloc(NumberOfBytes); + x = tmp; + } + return (x); } - return (x); -} } - void ExFreePool(PVOID P ) ; -void ExFreePool(PVOID P ) -{ +void ExFreePool(PVOID P); +void ExFreePool(PVOID P) { - { - return; -} + { return; } } - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; -PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , BOOLEAN SecondaryBuffer , - BOOLEAN ChargeQuota , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_329_0; - } else { - { - goto switch_329_default; - if (0) { - switch_329_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_329_0; + } else { { - tmp = malloc(sizeof(MDL )); + goto switch_329_default; + if (0) { + switch_329_0 : /* CIL Label */ + { + tmp = malloc(sizeof(MDL)); + } + return ((void *)tmp); + switch_329_default: /* CIL Label */; + return ((void *)0); + } else { + switch_329_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_329_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_329_break: /* CIL Label */ ; - } } } } -} - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; -PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , PDEVICE_OBJECT TargetDevice ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_330_0; - } else { - { - goto switch_330_default; - if (0) { - switch_330_0: /* CIL Label */ ; - return (TargetDevice); - switch_330_default: /* CIL Label */ ; - return ((void *)0); + if (__BLAST_NONDET == 0) { + goto switch_330_0; } else { - switch_330_break: /* CIL Label */ ; - } + { + goto switch_330_default; + if (0) { + switch_330_0: /* CIL Label */; + return (TargetDevice); + switch_330_default: /* CIL Label */; + return ((void *)0); + } else { + switch_330_break: /* CIL Label */; + } + } } } } -} - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , PDEVICE_OBJECT DeviceObject , - PVOID Buffer , ULONG Length , PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - customIrp = 1; - if (__BLAST_NONDET == 0) { - goto switch_331_0; - } else { - { - goto switch_331_default; - if (0) { - switch_331_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET == 0) { + goto switch_331_0; + } else { { - tmp = malloc(sizeof(IRP )); + goto switch_331_default; + if (0) { + switch_331_0 : /* CIL Label */ + { + tmp = malloc(sizeof(IRP)); + } + return ((void *)tmp); + switch_331_default: /* CIL Label */; + return ((void *)0); + } else { + switch_331_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_331_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_331_break: /* CIL Label */ ; - } } } } -} - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , BOOLEAN InternalDeviceIoControl , - PKEVENT Event , PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - customIrp = 1; - if (__BLAST_NONDET == 0) { - goto switch_332_0; - } else { - { - goto switch_332_default; - if (0) { - switch_332_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET == 0) { + goto switch_332_0; + } else { { - tmp = malloc(sizeof(IRP )); + goto switch_332_default; + if (0) { + switch_332_0 : /* CIL Label */ + { + tmp = malloc(sizeof(IRP)); + } + return ((void *)tmp); + switch_332_default: /* CIL Label */; + return ((void *)0); + } else { + switch_332_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_332_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_332_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; -NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_333_0; - } else { - { - goto switch_333_default; - if (0) { - switch_333_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_333_0; + } else { { - tmp = malloc(sizeof(DEVICE_OBJECT )); - *DeviceObject = (void *)tmp; + goto switch_333_default; + if (0) { + switch_333_0 : /* CIL Label */ + { + tmp = malloc(sizeof(DEVICE_OBJECT)); + *DeviceObject = (void *)tmp; + } + return (0L); + switch_333_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_333_break: /* CIL Label */; + } } - return (0L); - switch_333_default: /* CIL Label */ ; - return (-1073741823L); - } else { - switch_333_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; -NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , PUNICODE_STRING DeviceName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_334_0; - } else { - { - goto switch_334_default; - if (0) { - switch_334_0: /* CIL Label */ ; - return (0L); - switch_334_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_334_0; } else { - switch_334_break: /* CIL Label */ ; - } + { + goto switch_334_default; + if (0) { + switch_334_0: /* CIL Label */; + return (0L); + switch_334_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_334_break: /* CIL Label */; + } + } } } } -} - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; -void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) -{ +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject) { - { - return; -} + { return; } } - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_335_0; - } else { - { - goto switch_335_default; - if (0) { - switch_335_0: /* CIL Label */ ; - return (0L); - switch_335_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_335_0; } else { - switch_335_break: /* CIL Label */ ; - } + { + goto switch_335_default; + if (0) { + switch_335_0: /* CIL Label */; + return (0L); + switch_335_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_335_break: /* CIL Label */; + } + } } } } -} - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; -void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) -{ +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice) { - { - return; + { return; } } -} - void IoFreeIrp(PIRP Irp ) ; -void IoFreeIrp(PIRP Irp ) -{ +void IoFreeIrp(PIRP Irp); +void IoFreeIrp(PIRP Irp) { - { - return; + { return; } } -} - void IoFreeMdl(PMDL Mdl ) ; -void IoFreeMdl(PMDL Mdl ) -{ +void IoFreeMdl(PMDL Mdl); +void IoFreeMdl(PMDL Mdl) { - { - return; + { return; } } -} - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; -PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) -{ char *tmp ; +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) { + char *tmp; { - { - tmp = malloc(sizeof(CONFIGURATION_INFORMATION )); + { tmp = malloc(sizeof(CONFIGURATION_INFORMATION)); } + return ((void *)tmp); } - return ((void *)tmp); } -} - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; -NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , PULONG BusNumber , PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_336_0; - } else { - { - goto switch_336_default; - if (0) { - switch_336_0: /* CIL Label */ ; - return (0L); - switch_336_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_336_0; } else { - switch_336_break: /* CIL Label */ ; - } + { + goto switch_336_default; + if (0) { + switch_336_0: /* CIL Label */; + return (0L); + switch_336_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_336_break: /* CIL Label */; + } + } } } } -} - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_337_0; - } else { - { - goto switch_337_default; - if (0) { - switch_337_0: /* CIL Label */ ; - return (0L); - switch_337_default: /* CIL Label */ ; - return (-1073741808L); + if (__BLAST_NONDET == 0) { + goto switch_337_0; } else { - switch_337_break: /* CIL Label */ ; - } + { + goto switch_337_default; + if (0) { + switch_337_0: /* CIL Label */; + return (0L); + switch_337_default: /* CIL Label */; + return (-1073741808L); + } else { + switch_337_break: /* CIL Label */; + } + } } } } -} - void IoReleaseCancelSpinLock(KIRQL Irql ) ; -void IoReleaseCancelSpinLock(KIRQL Irql ) -{ +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoReleaseCancelSpinLock(KIRQL Irql) { - { - return; -} + { return; } } - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , BOOLEAN Enable ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_338_0; - } else { - { - goto switch_338_default; - if (0) { - switch_338_0: /* CIL Label */ ; - return (0L); - switch_338_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_338_0; } else { - switch_338_break: /* CIL Label */ ; - } + { + goto switch_338_default; + if (0) { + switch_338_0: /* CIL Label */; + return (0L); + switch_338_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_338_break: /* CIL Label */; + } + } } } } -} - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; -void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) -{ +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject) { - { - return; + { return; } } -} -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { - if (s == NP) { - s = MPR1; - } else { - { - errorFn(); + if (s == NP) { + s = MPR1; + } else { + { errorFn(); } } + return; } - return; -} } - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - NTSTATUS returnVal2 ; - int compRetStatus ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; - NTSTATUS tmp___0 ; +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + NTSTATUS returnVal2; + int compRetStatus; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; + NTSTATUS tmp___0; { - if (compRegistered) { - if (routine == 0) { - { - tmp = PptSynchCompletionRoutine(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - } else { - if (routine == 1) { + if (compRegistered) { + if (routine == 0) { { - tmp___0 = PptPowerComplete(DeviceObject, Irp, lcontext); - compRetStatus = tmp___0; + tmp = PptSynchCompletionRoutine(DeviceObject, Irp, lcontext); + compRetStatus = tmp; } } else { - + if (routine == 1) { + { + tmp___0 = PptPowerComplete(DeviceObject, Irp, lcontext); + compRetStatus = tmp___0; + } + } else { + } } - } - if ((long )compRetStatus == -1073741802L) { - { - stubMoreProcessingRequired(); + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET == 0) { - goto switch_339_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_339_1; + if (__BLAST_NONDET == 0) { + goto switch_339_0; } else { - { - goto switch_339_default; - if (0) { - switch_339_0: /* CIL Label */ - returnVal2 = 0L; - goto switch_339_break; - switch_339_1: /* CIL Label */ - returnVal2 = -1073741823L; - goto switch_339_break; - switch_339_default: /* CIL Label */ - returnVal2 = 259L; - goto switch_339_break; + if (__BLAST_NONDET == 1) { + goto switch_339_1; } else { - switch_339_break: /* CIL Label */ ; - } + { + goto switch_339_default; + if (0) { + switch_339_0: /* CIL Label */ + returnVal2 = 0L; + goto switch_339_break; + switch_339_1: /* CIL Label */ + returnVal2 = -1073741823L; + goto switch_339_break; + switch_339_default: /* CIL Label */ + returnVal2 = 259L; + goto switch_339_break; + } else { + switch_339_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal2; - } else { - if (s == MPR1) { - if (returnVal2 == 259L) { - s = MPR3; - lowerDriverReturn = returnVal2; - } else { - s = NP; - lowerDriverReturn = returnVal2; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal2; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal2; + if (s == MPR1) { + if (returnVal2 == 259L) { + s = MPR3; + lowerDriverReturn = returnVal2; + } else { + s = NP; + lowerDriverReturn = returnVal2; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal2; + } else { + { errorFn(); } } } } + return (returnVal2); } - return (returnVal2); } -} - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; -void IofCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) -{ +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost) { { - if (s == NP) { - s = DC; - } else { - { - errorFn(); + if (s == NP) { + s = DC; + } else { + { errorFn(); } } + return; } - return; -} } - KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ; -KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) -{ +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock); +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock) { - { - return ((unsigned char)0); -} + { return ((unsigned char)0); } } - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; -NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , BOOLEAN Alertable , PLARGE_INTEGER Interval ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_340_0; - } else { - { - goto switch_340_default; - if (0) { - switch_340_0: /* CIL Label */ ; - return (0L); - switch_340_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_340_0; } else { - switch_340_break: /* CIL Label */ ; - } + { + goto switch_340_default; + if (0) { + switch_340_0: /* CIL Label */; + return (0L); + switch_340_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_340_break: /* CIL Label */; + } + } } } } -} - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; -void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , BOOLEAN State ) -{ +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State) { - { - return; + { return; } } -} - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; -void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , LONG Count , LONG Limit ) -{ +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit) { - { - return; + { return; } } -} - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; -void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) -{ +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock) { - { - return; + { return; } } -} - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; -LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , LONG Adjustment , - BOOLEAN Wait ) -{ LONG r = __VERIFIER_nondet_long() ; +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait) { + LONG r = __VERIFIER_nondet_long(); - { - return (r); + { return (r); } } -} - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; -void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , KIRQL NewIrql ) -{ +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql) { - { - return; + { return; } } -} - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; -LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , BOOLEAN Wait ) -{ LONG l = __VERIFIER_nondet_long() ; +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait) { + LONG l = __VERIFIER_nondet_long(); { - setEventCalled = 1; - return (l); -} + setEventCalled = 1; + return (l); + } } - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; -NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , PLARGE_INTEGER Timeout ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (s == MPR3) { - if (setEventCalled == 1) { - s = NP; - setEventCalled = 0; - } else { - goto _L; - } - } else { - _L: /* CIL Label */ - if (customIrp == 1) { - s = NP; - customIrp = 0; + if (s == MPR3) { + if (setEventCalled == 1) { + s = NP; + setEventCalled = 0; + } else { + goto _L; + } } else { - if (s == MPR3) { - { - errorFn(); - } + _L: /* CIL Label */ + if (customIrp == 1) { + s = NP; + customIrp = 0; } else { - + if (s == MPR3) { + { errorFn(); } + } else { + } } } - } - if (__BLAST_NONDET == 0) { - goto switch_341_0; - } else { - { - goto switch_341_default; - if (0) { - switch_341_0: /* CIL Label */ ; - return (0L); - switch_341_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_341_0; } else { - switch_341_break: /* CIL Label */ ; - } + { + goto switch_341_default; + if (0) { + switch_341_0: /* CIL Label */; + return (0L); + switch_341_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_341_break: /* CIL Label */; + } + } } } } -} - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; -PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , PHYSICAL_ADDRESS HighestAcceptableAddress ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_342_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_342_1; + if (__BLAST_NONDET == 0) { + goto switch_342_0; } else { - if (0) { - switch_342_0: /* CIL Label */ + if (__BLAST_NONDET == 1) { + goto switch_342_1; + } else { + if (0) { + switch_342_0 : /* CIL Label */ { - tmp = malloc(NumberOfBytes); + tmp = malloc(NumberOfBytes); + } + return (tmp); + switch_342_1: /* CIL Label */; + return ((void *)0); + } else { + switch_342_break: /* CIL Label */; } - return (tmp); - switch_342_1: /* CIL Label */ ; - return ((void *)0); - } else { - switch_342_break: /* CIL Label */ ; } } + return ((void *)0); } - return ((void *)0); -} } - void MmFreeContiguousMemory(PVOID BaseAddress ) ; -void MmFreeContiguousMemory(PVOID BaseAddress ) -{ +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmFreeContiguousMemory(PVOID BaseAddress) { - { - return; -} + { return; } } - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; -PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , PVOID BaseAddress , - ULONG BugCheckOnFailure , MM_PAGE_PRIORITY Priority ) -{ +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority) { - { - return ((void *)0); -} + { return ((void *)0); } } - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; -PVOID MmPageEntireDriver(PVOID AddressWithinSection ) -{ +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection) { - { - return ((void *)0); -} + { return ((void *)0); } } - void MmResetDriverPaging(PVOID AddressWithinSection ) ; -void MmResetDriverPaging(PVOID AddressWithinSection ) -{ +void MmResetDriverPaging(PVOID AddressWithinSection); +void MmResetDriverPaging(PVOID AddressWithinSection) { - { - return; -} + { return; } } - void MmUnlockPages(PMDL MemoryDescriptorList ) ; -void MmUnlockPages(PMDL MemoryDescriptorList ) -{ +void MmUnlockPages(PMDL MemoryDescriptorList); +void MmUnlockPages(PMDL MemoryDescriptorList) { - { - return; -} + { return; } } - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; -NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , ACCESS_MASK DesiredAccess , POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , PVOID *Object , POBJECT_HANDLE_INFORMATION HandleInformation ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_343_0; - } else { - { - goto switch_343_default; - if (0) { - switch_343_0: /* CIL Label */ ; - return (0L); - switch_343_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_343_0; } else { - switch_343_break: /* CIL Label */ ; - } + { + goto switch_343_default; + if (0) { + switch_343_0: /* CIL Label */; + return (0L); + switch_343_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_343_break: /* CIL Label */; + } + } } } } -} - void ObfDereferenceObject(PVOID Object ) ; -void ObfDereferenceObject(PVOID Object ) -{ +void ObfDereferenceObject(PVOID Object); +void ObfDereferenceObject(PVOID Object) { - { - return; + { return; } } -} - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - int compRetStatus ; - NTSTATUS returnVal ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; - NTSTATUS tmp___0 ; +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + int compRetStatus; + NTSTATUS returnVal; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; + NTSTATUS tmp___0; { - if (compRegistered) { - if (routine == 0) { - { - tmp = PptSynchCompletionRoutine(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - } else { - if (routine == 1) { + if (compRegistered) { + if (routine == 0) { { - tmp___0 = PptPowerComplete(DeviceObject, Irp, lcontext); - compRetStatus = tmp___0; + tmp = PptSynchCompletionRoutine(DeviceObject, Irp, lcontext); + compRetStatus = tmp; } } else { - + if (routine == 1) { + { + tmp___0 = PptPowerComplete(DeviceObject, Irp, lcontext); + compRetStatus = tmp___0; + } + } else { + } } - } - if ((long )compRetStatus == -1073741802L) { - { - stubMoreProcessingRequired(); + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET == 0) { - goto switch_344_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_344_1; + if (__BLAST_NONDET == 0) { + goto switch_344_0; } else { - { - goto switch_344_default; - if (0) { - switch_344_0: /* CIL Label */ - returnVal = 0L; - goto switch_344_break; - switch_344_1: /* CIL Label */ - returnVal = -1073741823L; - goto switch_344_break; - switch_344_default: /* CIL Label */ - returnVal = 259L; - goto switch_344_break; + if (__BLAST_NONDET == 1) { + goto switch_344_1; } else { - switch_344_break: /* CIL Label */ ; - } + { + goto switch_344_default; + if (0) { + switch_344_0: /* CIL Label */ + returnVal = 0L; + goto switch_344_break; + switch_344_1: /* CIL Label */ + returnVal = -1073741823L; + goto switch_344_break; + switch_344_default: /* CIL Label */ + returnVal = 259L; + goto switch_344_break; + } else { + switch_344_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal; - } else { - if (s == MPR1) { - if (returnVal == 259L) { - s = MPR3; - lowerDriverReturn = returnVal; - } else { - s = NP; - lowerDriverReturn = returnVal; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal; + if (s == MPR1) { + if (returnVal == 259L) { + s = MPR3; + lowerDriverReturn = returnVal; + } else { + s = NP; + lowerDriverReturn = returnVal; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal; + } else { + { errorFn(); } } } } + return (returnVal); } - return (returnVal); -} } - void PoStartNextPowerIrp(PIRP Irp ) ; -void PoStartNextPowerIrp(PIRP Irp ) -{ +void PoStartNextPowerIrp(PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp) { - { - return; -} + { return; } } - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; -NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , ULONG DesiredAccess , POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , PCLIENT_ID ClientId , void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_345_0; - } else { - { - goto switch_345_default; - if (0) { - switch_345_0: /* CIL Label */ ; - return (0L); - switch_345_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_345_0; } else { - switch_345_break: /* CIL Label */ ; - } + { + goto switch_345_default; + if (0) { + switch_345_0: /* CIL Label */; + return (0L); + switch_345_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_345_break: /* CIL Label */; + } + } } } } -} - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_346_0; - } else { - { - goto switch_346_default; - if (0) { - switch_346_0: /* CIL Label */ ; - return (0L); - switch_346_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_346_0; } else { - switch_346_break: /* CIL Label */ ; - } + { + goto switch_346_default; + if (0) { + switch_346_0: /* CIL Label */; + return (0L); + switch_346_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_346_break: /* CIL Label */; + } + } } } } -} - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; -NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_347_0; - } else { - { - goto switch_347_default; - if (0) { - switch_347_0: /* CIL Label */ ; - return (0L); - switch_347_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_347_0; } else { - switch_347_break: /* CIL Label */ ; - } + { + goto switch_347_default; + if (0) { + switch_347_0: /* CIL Label */; + return (0L); + switch_347_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_347_break: /* CIL Label */; + } + } } } } -} - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; -SIZE_T RtlCompareMemory(void const *Source1 , void const *Source2 , - SIZE_T Length ) -{ SIZE_T r = __VERIFIER_nondet_long() ; +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length) { + SIZE_T r = __VERIFIER_nondet_long(); - { - return (r); + { return (r); } } -} - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; -void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) -{ +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString) { - { - return; + { return; } } -} - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; -NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , PCWSTR ValueName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_348_0; - } else { - { - goto switch_348_default; - if (0) { - switch_348_0: /* CIL Label */ ; - return (0L); - switch_348_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_348_0; } else { - switch_348_break: /* CIL Label */ ; - } + { + goto switch_348_default; + if (0) { + switch_348_0: /* CIL Label */; + return (0L); + switch_348_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_348_break: /* CIL Label */; + } + } } } } -} - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; -void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) -{ +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString) { - { - return; -} + { return; } } - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; -void RtlInitString(PSTRING DestinationString , PCSZ SourceString ) -{ +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString) { - { - return; -} + { return; } } - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; -void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) -{ +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString) { - { - return; -} + { return; } } - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; -NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , PVOID Environment ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_349_0; - } else { - { - goto switch_349_default; - if (0) { - switch_349_0: /* CIL Label */ ; - return (0L); - switch_349_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_349_0; } else { - switch_349_break: /* CIL Label */ ; - } + { + goto switch_349_default; + if (0) { + switch_349_0: /* CIL Label */; + return (0L); + switch_349_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_349_break: /* CIL Label */; + } + } } } } -} - NTSTATUS ZwClose(HANDLE Handle ) ; -NTSTATUS ZwClose(HANDLE Handle ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS ZwClose(HANDLE Handle); +NTSTATUS ZwClose(HANDLE Handle) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_350_0; - } else { - { - goto switch_350_default; - if (0) { - switch_350_0: /* CIL Label */ ; - return (0L); - switch_350_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_350_0; } else { - switch_350_break: /* CIL Label */ ; - } + { + goto switch_350_default; + if (0) { + switch_350_0: /* CIL Label */; + return (0L); + switch_350_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_350_break: /* CIL Label */; + } + } } } } -} -NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo , PDEVICE_OBJECT DeviceObject , - PIRP Irp , PSYSCTL_IRP_DISPOSITION IrpDisposition ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo, + PDEVICE_OBJECT DeviceObject, PIRP Irp, + PSYSCTL_IRP_DISPOSITION IrpDisposition) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_351_0; - } else { - { - goto switch_351_default; - if (0) { - switch_351_0: /* CIL Label */ - return (0L); - switch_351_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_351_0; } else { - switch_351_break: /* CIL Label */ ; - } + { + goto switch_351_default; + if (0) { + switch_351_0: /* CIL Label */ + return (0L); + switch_351_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_351_break: /* CIL Label */; + } + } } } } -} - NTSTATUS IoAcquireRemoveLockEx(PIO_REMOVE_LOCK RemoveLock , - PVOID Tag , - PCSTR File , - ULONG Line , - ULONG RemlockSize ) ; -NTSTATUS IoAcquireRemoveLockEx(PIO_REMOVE_LOCK RemoveLock , - PVOID Tag , PCSTR File , - ULONG Line , ULONG RemlockSize ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoAcquireRemoveLockEx(PIO_REMOVE_LOCK RemoveLock, PVOID Tag, + PCSTR File, ULONG Line, ULONG RemlockSize); +NTSTATUS IoAcquireRemoveLockEx(PIO_REMOVE_LOCK RemoveLock, PVOID Tag, + PCSTR File, ULONG Line, ULONG RemlockSize) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET) { - return (0L); - } else { - return (-1073741738L); + if (__BLAST_NONDET) { + return (0L); + } else { + return (-1073741738L); + } } } -} diff --git a/test/ntdrivers/parport_true.i.cil.c b/test/ntdrivers/parport_true.i.cil.c index a472bedb3..44af56f2d 100644 --- a/test/ntdrivers/parport_true.i.cil.c +++ b/test/ntdrivers/parport_true.i.cil.c @@ -9,7 +9,7 @@ extern void *__VERIFIER_nondet_pointer(void); /* Generated by CIL v. 1.3.6 */ /* print_CIL_Input is true */ -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) typedef unsigned short wchar_t; typedef unsigned long ULONG_PTR; @@ -21,9 +21,9 @@ typedef short SHORT; typedef long LONG; typedef wchar_t WCHAR; typedef WCHAR *PWSTR; -typedef WCHAR const *PCWSTR; +typedef WCHAR const *PCWSTR; typedef CHAR *PCHAR; -typedef CHAR const *PCSTR; +typedef CHAR const *PCSTR; typedef LONG *PLONG; typedef unsigned char UCHAR; typedef unsigned short USHORT; @@ -38,81 +38,78 @@ typedef ULONG LCID; typedef LONG NTSTATUS; typedef long long LONGLONG; struct __anonstruct____missing_field_name_1 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; struct __anonstruct_u_2 { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; union _LARGE_INTEGER { - struct __anonstruct____missing_field_name_1 __annonCompField1 ; - struct __anonstruct_u_2 u ; - LONGLONG QuadPart ; + struct __anonstruct____missing_field_name_1 __annonCompField1; + struct __anonstruct_u_2 u; + LONGLONG QuadPart; }; typedef union _LARGE_INTEGER LARGE_INTEGER; typedef LARGE_INTEGER *PLARGE_INTEGER; struct _LUID { - ULONG LowPart ; - LONG HighPart ; + ULONG LowPart; + LONG HighPart; }; typedef struct _LUID LUID; typedef LARGE_INTEGER PHYSICAL_ADDRESS; -enum _EVENT_TYPE { - NotificationEvent = 0, - SynchronizationEvent = 1 -} ; +enum _EVENT_TYPE { NotificationEvent = 0, SynchronizationEvent = 1 }; typedef enum _EVENT_TYPE EVENT_TYPE; -typedef char const *PCSZ; +typedef char const *PCSZ; struct _STRING { - USHORT Length ; - USHORT MaximumLength ; - PCHAR Buffer ; + USHORT Length; + USHORT MaximumLength; + PCHAR Buffer; }; typedef struct _STRING STRING; typedef STRING *PSTRING; typedef PSTRING PANSI_STRING; struct _UNICODE_STRING { - USHORT Length ; - USHORT MaximumLength ; - PWSTR Buffer ; + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; }; typedef struct _UNICODE_STRING UNICODE_STRING; typedef UNICODE_STRING *PUNICODE_STRING; typedef UCHAR BOOLEAN; typedef BOOLEAN *PBOOLEAN; struct _LIST_ENTRY { - struct _LIST_ENTRY *Flink ; - struct _LIST_ENTRY *Blink ; + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; }; typedef struct _LIST_ENTRY LIST_ENTRY; typedef struct _LIST_ENTRY *PLIST_ENTRY; struct _OBJECT_ATTRIBUTES { - ULONG Length ; - HANDLE RootDirectory ; - PUNICODE_STRING ObjectName ; - ULONG Attributes ; - PVOID SecurityDescriptor ; - PVOID SecurityQualityOfService ; + ULONG Length; + HANDLE RootDirectory; + PUNICODE_STRING ObjectName; + ULONG Attributes; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; }; typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES; typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; struct _GUID { - unsigned long Data1 ; - unsigned short Data2 ; - unsigned short Data3 ; - unsigned char Data4[8] ; + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; }; typedef struct _GUID GUID; -typedef GUID const *LPCGUID; +typedef GUID const *LPCGUID; typedef unsigned int size_t; typedef UCHAR KIRQL; typedef KIRQL *PKIRQL; enum _NT_PRODUCT_TYPE { - NtProductWinNt = 1, - NtProductLanManNt = 2, - NtProductServer = 3 -} ; + NtProductWinNt = 1, + NtProductLanManNt = 2, + NtProductServer = 3 +}; typedef enum _NT_PRODUCT_TYPE NT_PRODUCT_TYPE; struct _KTHREAD; typedef struct _KTHREAD *PKTHREAD; @@ -129,83 +126,86 @@ typedef struct _OBJECT_TYPE *POBJECT_TYPE; typedef CCHAR KPROCESSOR_MODE; struct _KAPC; struct _KAPC; -typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ); +typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); struct _KAPC { - CSHORT Type ; - CSHORT Size ; - ULONG Spare0 ; - struct _KTHREAD *Thread ; - LIST_ENTRY ApcListEntry ; - void (*KernelRoutine)(struct _KAPC *Apc , PKNORMAL_ROUTINE *NormalRoutine , PVOID *NormalContext , - PVOID *SystemArgument1 , PVOID *SystemArgument2 ) ; - void (*RundownRoutine)(struct _KAPC *Apc ) ; - void (*NormalRoutine)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ) ; - PVOID NormalContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - CCHAR ApcStateIndex ; - KPROCESSOR_MODE ApcMode ; - BOOLEAN Inserted ; + CSHORT Type; + CSHORT Size; + ULONG Spare0; + struct _KTHREAD *Thread; + LIST_ENTRY ApcListEntry; + void (*KernelRoutine)(struct _KAPC *Apc, PKNORMAL_ROUTINE *NormalRoutine, + PVOID *NormalContext, PVOID *SystemArgument1, + PVOID *SystemArgument2); + void (*RundownRoutine)(struct _KAPC *Apc); + void (*NormalRoutine)(PVOID NormalContext, PVOID SystemArgument1, + PVOID SystemArgument2); + PVOID NormalContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + CCHAR ApcStateIndex; + KPROCESSOR_MODE ApcMode; + BOOLEAN Inserted; }; typedef struct _KAPC KAPC; struct _KDPC; struct _KDPC; struct _KDPC { - CSHORT Type ; - UCHAR Number ; - UCHAR Importance ; - LIST_ENTRY DpcListEntry ; - void (*DeferredRoutine)(struct _KDPC *Dpc , PVOID DeferredContext , PVOID SystemArgument1 , - PVOID SystemArgument2 ) ; - PVOID DeferredContext ; - PVOID SystemArgument1 ; - PVOID SystemArgument2 ; - PULONG_PTR Lock ; + CSHORT Type; + UCHAR Number; + UCHAR Importance; + LIST_ENTRY DpcListEntry; + void (*DeferredRoutine)(struct _KDPC *Dpc, PVOID DeferredContext, + PVOID SystemArgument1, PVOID SystemArgument2); + PVOID DeferredContext; + PVOID SystemArgument1; + PVOID SystemArgument2; + PULONG_PTR Lock; }; typedef struct _KDPC KDPC; typedef struct _KDPC *PKDPC; typedef struct _KDPC *PRKDPC; struct _MDL { - struct _MDL *Next ; - CSHORT Size ; - CSHORT MdlFlags ; - struct _EPROCESS *Process ; - PVOID MappedSystemVa ; - PVOID StartVa ; - ULONG ByteCount ; - ULONG ByteOffset ; + struct _MDL *Next; + CSHORT Size; + CSHORT MdlFlags; + struct _EPROCESS *Process; + PVOID MappedSystemVa; + PVOID StartVa; + ULONG ByteCount; + ULONG ByteOffset; }; typedef struct _MDL MDL; typedef struct _MDL *PMDL; typedef PVOID PACCESS_TOKEN; typedef PVOID PSECURITY_DESCRIPTOR; typedef ULONG ACCESS_MASK; -#pragma pack(push,4) +#pragma pack(push, 4) struct _LUID_AND_ATTRIBUTES { - LUID Luid ; - ULONG Attributes ; + LUID Luid; + ULONG Attributes; }; typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES; #pragma pack(pop) struct _PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[1] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[1]; }; typedef struct _PRIVILEGE_SET PRIVILEGE_SET; enum _SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous = 0, - SecurityIdentification = 1, - SecurityImpersonation = 2, - SecurityDelegation = 3 -} ; + SecurityAnonymous = 0, + SecurityIdentification = 1, + SecurityImpersonation = 2, + SecurityDelegation = 3 +}; typedef enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL; typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE; struct _SECURITY_QUALITY_OF_SERVICE { - ULONG Length ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode ; - BOOLEAN EffectiveOnly ; + ULONG Length; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; + BOOLEAN EffectiveOnly; }; typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE; typedef ULONG SECURITY_INFORMATION; @@ -214,641 +214,635 @@ typedef LONG KPRIORITY; typedef ULONG_PTR KSPIN_LOCK; typedef KSPIN_LOCK *PKSPIN_LOCK; struct _RTL_QUERY_REGISTRY_TABLE { - NTSTATUS (*QueryRoutine)(PWSTR ValueName , ULONG ValueType , - PVOID ValueData , ULONG ValueLength , - PVOID Context , PVOID EntryContext ) ; - ULONG Flags ; - PWSTR Name ; - PVOID EntryContext ; - ULONG DefaultType ; - PVOID DefaultData ; - ULONG DefaultLength ; + NTSTATUS(*QueryRoutine) + (PWSTR ValueName, ULONG ValueType, PVOID ValueData, ULONG ValueLength, + PVOID Context, PVOID EntryContext); + ULONG Flags; + PWSTR Name; + PVOID EntryContext; + ULONG DefaultType; + PVOID DefaultData; + ULONG DefaultLength; }; typedef struct _RTL_QUERY_REGISTRY_TABLE RTL_QUERY_REGISTRY_TABLE; typedef struct _RTL_QUERY_REGISTRY_TABLE *PRTL_QUERY_REGISTRY_TABLE; union __anonunion____missing_field_name_6 { - NTSTATUS Status ; - PVOID Pointer ; + NTSTATUS Status; + PVOID Pointer; }; struct _IO_STATUS_BLOCK { - union __anonunion____missing_field_name_6 __annonCompField4 ; - ULONG_PTR Information ; + union __anonunion____missing_field_name_6 __annonCompField4; + ULONG_PTR Information; }; typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK; typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK; enum _FILE_INFORMATION_CLASS { - FileDirectoryInformation = 1, - FileFullDirectoryInformation = 2, - FileBothDirectoryInformation = 3, - FileBasicInformation = 4, - FileStandardInformation = 5, - FileInternalInformation = 6, - FileEaInformation = 7, - FileAccessInformation = 8, - FileNameInformation = 9, - FileRenameInformation = 10, - FileLinkInformation = 11, - FileNamesInformation = 12, - FileDispositionInformation = 13, - FilePositionInformation = 14, - FileFullEaInformation = 15, - FileModeInformation = 16, - FileAlignmentInformation = 17, - FileAllInformation = 18, - FileAllocationInformation = 19, - FileEndOfFileInformation = 20, - FileAlternateNameInformation = 21, - FileStreamInformation = 22, - FilePipeInformation = 23, - FilePipeLocalInformation = 24, - FilePipeRemoteInformation = 25, - FileMailslotQueryInformation = 26, - FileMailslotSetInformation = 27, - FileCompressionInformation = 28, - FileObjectIdInformation = 29, - FileCompletionInformation = 30, - FileMoveClusterInformation = 31, - FileQuotaInformation = 32, - FileReparsePointInformation = 33, - FileNetworkOpenInformation = 34, - FileAttributeTagInformation = 35, - FileTrackingInformation = 36, - FileMaximumInformation = 37 -} ; + FileDirectoryInformation = 1, + FileFullDirectoryInformation = 2, + FileBothDirectoryInformation = 3, + FileBasicInformation = 4, + FileStandardInformation = 5, + FileInternalInformation = 6, + FileEaInformation = 7, + FileAccessInformation = 8, + FileNameInformation = 9, + FileRenameInformation = 10, + FileLinkInformation = 11, + FileNamesInformation = 12, + FileDispositionInformation = 13, + FilePositionInformation = 14, + FileFullEaInformation = 15, + FileModeInformation = 16, + FileAlignmentInformation = 17, + FileAllInformation = 18, + FileAllocationInformation = 19, + FileEndOfFileInformation = 20, + FileAlternateNameInformation = 21, + FileStreamInformation = 22, + FilePipeInformation = 23, + FilePipeLocalInformation = 24, + FilePipeRemoteInformation = 25, + FileMailslotQueryInformation = 26, + FileMailslotSetInformation = 27, + FileCompressionInformation = 28, + FileObjectIdInformation = 29, + FileCompletionInformation = 30, + FileMoveClusterInformation = 31, + FileQuotaInformation = 32, + FileReparsePointInformation = 33, + FileNetworkOpenInformation = 34, + FileAttributeTagInformation = 35, + FileTrackingInformation = 36, + FileMaximumInformation = 37 +}; typedef enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS; struct _FILE_BASIC_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + ULONG FileAttributes; }; typedef struct _FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION; struct _FILE_STANDARD_INFORMATION { - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG NumberOfLinks ; - BOOLEAN DeletePending ; - BOOLEAN Directory ; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG NumberOfLinks; + BOOLEAN DeletePending; + BOOLEAN Directory; }; typedef struct _FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION; struct _FILE_NETWORK_OPEN_INFORMATION { - LARGE_INTEGER CreationTime ; - LARGE_INTEGER LastAccessTime ; - LARGE_INTEGER LastWriteTime ; - LARGE_INTEGER ChangeTime ; - LARGE_INTEGER AllocationSize ; - LARGE_INTEGER EndOfFile ; - ULONG FileAttributes ; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG FileAttributes; }; typedef struct _FILE_NETWORK_OPEN_INFORMATION *PFILE_NETWORK_OPEN_INFORMATION; enum _FSINFOCLASS { - FileFsVolumeInformation = 1, - FileFsLabelInformation = 2, - FileFsSizeInformation = 3, - FileFsDeviceInformation = 4, - FileFsAttributeInformation = 5, - FileFsControlInformation = 6, - FileFsFullSizeInformation = 7, - FileFsObjectIdInformation = 8, - FileFsMaximumInformation = 9 -} ; + FileFsVolumeInformation = 1, + FileFsLabelInformation = 2, + FileFsSizeInformation = 3, + FileFsDeviceInformation = 4, + FileFsAttributeInformation = 5, + FileFsControlInformation = 6, + FileFsFullSizeInformation = 7, + FileFsObjectIdInformation = 8, + FileFsMaximumInformation = 9 +}; typedef enum _FSINFOCLASS FS_INFORMATION_CLASS; enum _INTERFACE_TYPE { - InterfaceTypeUndefined = -1, - Internal = 0, - Isa = 1, - Eisa = 2, - MicroChannel = 3, - TurboChannel = 4, - PCIBus = 5, - VMEBus = 6, - NuBus = 7, - PCMCIABus = 8, - CBus = 9, - MPIBus = 10, - MPSABus = 11, - ProcessorInternal = 12, - InternalPowerBus = 13, - PNPISABus = 14, - PNPBus = 15, - MaximumInterfaceType = 16 -} ; + InterfaceTypeUndefined = -1, + Internal = 0, + Isa = 1, + Eisa = 2, + MicroChannel = 3, + TurboChannel = 4, + PCIBus = 5, + VMEBus = 6, + NuBus = 7, + PCMCIABus = 8, + CBus = 9, + MPIBus = 10, + MPSABus = 11, + ProcessorInternal = 12, + InternalPowerBus = 13, + PNPISABus = 14, + PNPBus = 15, + MaximumInterfaceType = 16 +}; typedef enum _INTERFACE_TYPE INTERFACE_TYPE; typedef enum _INTERFACE_TYPE *PINTERFACE_TYPE; struct _IO_ERROR_LOG_PACKET { - UCHAR MajorFunctionCode ; - UCHAR RetryCount ; - USHORT DumpDataSize ; - USHORT NumberOfStrings ; - USHORT StringOffset ; - USHORT EventCategory ; - NTSTATUS ErrorCode ; - ULONG UniqueErrorValue ; - NTSTATUS FinalStatus ; - ULONG SequenceNumber ; - ULONG IoControlCode ; - LARGE_INTEGER DeviceOffset ; - ULONG DumpData[1] ; + UCHAR MajorFunctionCode; + UCHAR RetryCount; + USHORT DumpDataSize; + USHORT NumberOfStrings; + USHORT StringOffset; + USHORT EventCategory; + NTSTATUS ErrorCode; + ULONG UniqueErrorValue; + NTSTATUS FinalStatus; + ULONG SequenceNumber; + ULONG IoControlCode; + LARGE_INTEGER DeviceOffset; + ULONG DumpData[1]; }; typedef struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET; typedef struct _IO_ERROR_LOG_PACKET *PIO_ERROR_LOG_PACKET; struct _KEY_VALUE_FULL_INFORMATION { - ULONG TitleIndex ; - ULONG Type ; - ULONG DataOffset ; - ULONG DataLength ; - ULONG NameLength ; - WCHAR Name[1] ; + ULONG TitleIndex; + ULONG Type; + ULONG DataOffset; + ULONG DataLength; + ULONG NameLength; + WCHAR Name[1]; }; typedef struct _KEY_VALUE_FULL_INFORMATION *PKEY_VALUE_FULL_INFORMATION; enum _KEY_VALUE_INFORMATION_CLASS { - KeyValueBasicInformation = 0, - KeyValueFullInformation = 1, - KeyValuePartialInformation = 2, - KeyValueFullInformationAlign64 = 3, - KeyValuePartialInformationAlign64 = 4 -} ; + KeyValueBasicInformation = 0, + KeyValueFullInformation = 1, + KeyValuePartialInformation = 2, + KeyValueFullInformationAlign64 = 3, + KeyValuePartialInformationAlign64 = 4 +}; typedef enum _KEY_VALUE_INFORMATION_CLASS KEY_VALUE_INFORMATION_CLASS; struct _CLIENT_ID { - HANDLE UniqueProcess ; - HANDLE UniqueThread ; + HANDLE UniqueProcess; + HANDLE UniqueThread; }; typedef struct _CLIENT_ID CLIENT_ID; typedef CLIENT_ID *PCLIENT_ID; enum _SYSTEM_POWER_STATE { - PowerSystemUnspecified = 0, - PowerSystemWorking = 1, - PowerSystemSleeping1 = 2, - PowerSystemSleeping2 = 3, - PowerSystemSleeping3 = 4, - PowerSystemHibernate = 5, - PowerSystemShutdown = 6, - PowerSystemMaximum = 7 -} ; + PowerSystemUnspecified = 0, + PowerSystemWorking = 1, + PowerSystemSleeping1 = 2, + PowerSystemSleeping2 = 3, + PowerSystemSleeping3 = 4, + PowerSystemHibernate = 5, + PowerSystemShutdown = 6, + PowerSystemMaximum = 7 +}; typedef enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE; enum __anonenum_POWER_ACTION_11 { - PowerActionNone = 0, - PowerActionReserved = 1, - PowerActionSleep = 2, - PowerActionHibernate = 3, - PowerActionShutdown = 4, - PowerActionShutdownReset = 5, - PowerActionShutdownOff = 6, - PowerActionWarmEject = 7 -} ; + PowerActionNone = 0, + PowerActionReserved = 1, + PowerActionSleep = 2, + PowerActionHibernate = 3, + PowerActionShutdown = 4, + PowerActionShutdownReset = 5, + PowerActionShutdownOff = 6, + PowerActionWarmEject = 7 +}; typedef enum __anonenum_POWER_ACTION_11 POWER_ACTION; enum _DEVICE_POWER_STATE { - PowerDeviceUnspecified = 0, - PowerDeviceD0 = 1, - PowerDeviceD1 = 2, - PowerDeviceD2 = 3, - PowerDeviceD3 = 4, - PowerDeviceMaximum = 5 -} ; + PowerDeviceUnspecified = 0, + PowerDeviceD0 = 1, + PowerDeviceD1 = 2, + PowerDeviceD2 = 3, + PowerDeviceD3 = 4, + PowerDeviceMaximum = 5 +}; typedef enum _DEVICE_POWER_STATE DEVICE_POWER_STATE; union _POWER_STATE { - SYSTEM_POWER_STATE SystemState ; - DEVICE_POWER_STATE DeviceState ; + SYSTEM_POWER_STATE SystemState; + DEVICE_POWER_STATE DeviceState; }; typedef union _POWER_STATE POWER_STATE; -enum _POWER_STATE_TYPE { - SystemPowerState = 0, - DevicePowerState = 1 -} ; +enum _POWER_STATE_TYPE { SystemPowerState = 0, DevicePowerState = 1 }; typedef enum _POWER_STATE_TYPE POWER_STATE_TYPE; struct _KSYSTEM_TIME { - ULONG LowPart ; - LONG High1Time ; - LONG High2Time ; + ULONG LowPart; + LONG High1Time; + LONG High2Time; }; typedef struct _KSYSTEM_TIME KSYSTEM_TIME; enum _ALTERNATIVE_ARCHITECTURE_TYPE { - StandardDesign = 0, - NEC98x86 = 1, - EndAlternatives = 2 -} ; + StandardDesign = 0, + NEC98x86 = 1, + EndAlternatives = 2 +}; typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE ALTERNATIVE_ARCHITECTURE_TYPE; struct _KUSER_SHARED_DATA { - ULONG volatile TickCountLow ; - ULONG TickCountMultiplier ; - KSYSTEM_TIME volatile InterruptTime ; - KSYSTEM_TIME volatile SystemTime ; - KSYSTEM_TIME volatile TimeZoneBias ; - USHORT ImageNumberLow ; - USHORT ImageNumberHigh ; - WCHAR NtSystemRoot[260] ; - ULONG MaxStackTraceDepth ; - ULONG CryptoExponent ; - ULONG TimeZoneId ; - ULONG Reserved2[8] ; - NT_PRODUCT_TYPE NtProductType ; - BOOLEAN ProductTypeIsValid ; - ULONG NtMajorVersion ; - ULONG NtMinorVersion ; - BOOLEAN ProcessorFeatures[64] ; - ULONG Reserved1 ; - ULONG Reserved3 ; - ULONG volatile TimeSlip ; - ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture ; - LARGE_INTEGER SystemExpirationDate ; - ULONG SuiteMask ; - BOOLEAN KdDebuggerEnabled ; + ULONG volatile TickCountLow; + ULONG TickCountMultiplier; + KSYSTEM_TIME volatile InterruptTime; + KSYSTEM_TIME volatile SystemTime; + KSYSTEM_TIME volatile TimeZoneBias; + USHORT ImageNumberLow; + USHORT ImageNumberHigh; + WCHAR NtSystemRoot[260]; + ULONG MaxStackTraceDepth; + ULONG CryptoExponent; + ULONG TimeZoneId; + ULONG Reserved2[8]; + NT_PRODUCT_TYPE NtProductType; + BOOLEAN ProductTypeIsValid; + ULONG NtMajorVersion; + ULONG NtMinorVersion; + BOOLEAN ProcessorFeatures[64]; + ULONG Reserved1; + ULONG Reserved3; + ULONG volatile TimeSlip; + ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture; + LARGE_INTEGER SystemExpirationDate; + ULONG SuiteMask; + BOOLEAN KdDebuggerEnabled; }; typedef struct _KUSER_SHARED_DATA KUSER_SHARED_DATA; typedef PVOID PASSIGNED_RESOURCE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Generic_16 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Port_17 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Interrupt_18 { - ULONG Level ; - ULONG Vector ; - ULONG Affinity ; + ULONG Level; + ULONG Vector; + ULONG Affinity; }; struct __anonstruct_Memory_19 { - PHYSICAL_ADDRESS Start ; - ULONG Length ; + PHYSICAL_ADDRESS Start; + ULONG Length; }; struct __anonstruct_Dma_20 { - ULONG Channel ; - ULONG Port ; - ULONG Reserved1 ; + ULONG Channel; + ULONG Port; + ULONG Reserved1; }; struct __anonstruct_DevicePrivate_21 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_22 { - ULONG Start ; - ULONG Length ; - ULONG Reserved ; + ULONG Start; + ULONG Length; + ULONG Reserved; }; struct __anonstruct_DeviceSpecificData_23 { - ULONG DataSize ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG DataSize; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_15 { - struct __anonstruct_Generic_16 Generic ; - struct __anonstruct_Port_17 Port ; - struct __anonstruct_Interrupt_18 Interrupt ; - struct __anonstruct_Memory_19 Memory ; - struct __anonstruct_Dma_20 Dma ; - struct __anonstruct_DevicePrivate_21 DevicePrivate ; - struct __anonstruct_BusNumber_22 BusNumber ; - struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData ; + struct __anonstruct_Generic_16 Generic; + struct __anonstruct_Port_17 Port; + struct __anonstruct_Interrupt_18 Interrupt; + struct __anonstruct_Memory_19 Memory; + struct __anonstruct_Dma_20 Dma; + struct __anonstruct_DevicePrivate_21 DevicePrivate; + struct __anonstruct_BusNumber_22 BusNumber; + struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData; }; struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { - UCHAR Type ; - UCHAR ShareDisposition ; - USHORT Flags ; - union __anonunion_u_15 u ; + UCHAR Type; + UCHAR ShareDisposition; + USHORT Flags; + union __anonunion_u_15 u; }; typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR; typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR *PCM_PARTIAL_RESOURCE_DESCRIPTOR; #pragma pack(pop) struct _CM_PARTIAL_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; }; typedef struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST; typedef struct _CM_PARTIAL_RESOURCE_LIST *PCM_PARTIAL_RESOURCE_LIST; struct _CM_FULL_RESOURCE_DESCRIPTOR { - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - CM_PARTIAL_RESOURCE_LIST PartialResourceList ; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; }; typedef struct _CM_FULL_RESOURCE_DESCRIPTOR CM_FULL_RESOURCE_DESCRIPTOR; typedef struct _CM_FULL_RESOURCE_DESCRIPTOR *PCM_FULL_RESOURCE_DESCRIPTOR; struct _CM_RESOURCE_LIST { - ULONG Count ; - CM_FULL_RESOURCE_DESCRIPTOR List[1] ; + ULONG Count; + CM_FULL_RESOURCE_DESCRIPTOR List[1]; }; typedef struct _CM_RESOURCE_LIST CM_RESOURCE_LIST; typedef struct _CM_RESOURCE_LIST *PCM_RESOURCE_LIST; -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct __anonstruct_Port_25 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Memory_26 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_Interrupt_27 { - ULONG MinimumVector ; - ULONG MaximumVector ; + ULONG MinimumVector; + ULONG MaximumVector; }; struct __anonstruct_Dma_28 { - ULONG MinimumChannel ; - ULONG MaximumChannel ; + ULONG MinimumChannel; + ULONG MaximumChannel; }; struct __anonstruct_Generic_29 { - ULONG Length ; - ULONG Alignment ; - PHYSICAL_ADDRESS MinimumAddress ; - PHYSICAL_ADDRESS MaximumAddress ; + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; }; struct __anonstruct_DevicePrivate_30 { - ULONG Data[3] ; + ULONG Data[3]; }; struct __anonstruct_BusNumber_31 { - ULONG Length ; - ULONG MinBusNumber ; - ULONG MaxBusNumber ; - ULONG Reserved ; + ULONG Length; + ULONG MinBusNumber; + ULONG MaxBusNumber; + ULONG Reserved; }; struct __anonstruct_AssignedResource_32 { - PASSIGNED_RESOURCE AssignedResource ; + PASSIGNED_RESOURCE AssignedResource; }; struct __anonstruct_SubAllocateFrom_33 { - UCHAR Type ; - UCHAR Reserved[3] ; - PASSIGNED_RESOURCE AssignedResource ; - PHYSICAL_ADDRESS Transformation ; + UCHAR Type; + UCHAR Reserved[3]; + PASSIGNED_RESOURCE AssignedResource; + PHYSICAL_ADDRESS Transformation; }; struct __anonstruct_ConfigData_34 { - ULONG Priority ; - ULONG Reserved1 ; - ULONG Reserved2 ; + ULONG Priority; + ULONG Reserved1; + ULONG Reserved2; }; union __anonunion_u_24 { - struct __anonstruct_Port_25 Port ; - struct __anonstruct_Memory_26 Memory ; - struct __anonstruct_Interrupt_27 Interrupt ; - struct __anonstruct_Dma_28 Dma ; - struct __anonstruct_Generic_29 Generic ; - struct __anonstruct_DevicePrivate_30 DevicePrivate ; - struct __anonstruct_BusNumber_31 BusNumber ; - struct __anonstruct_AssignedResource_32 AssignedResource ; - struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom ; - struct __anonstruct_ConfigData_34 ConfigData ; + struct __anonstruct_Port_25 Port; + struct __anonstruct_Memory_26 Memory; + struct __anonstruct_Interrupt_27 Interrupt; + struct __anonstruct_Dma_28 Dma; + struct __anonstruct_Generic_29 Generic; + struct __anonstruct_DevicePrivate_30 DevicePrivate; + struct __anonstruct_BusNumber_31 BusNumber; + struct __anonstruct_AssignedResource_32 AssignedResource; + struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom; + struct __anonstruct_ConfigData_34 ConfigData; }; struct _IO_RESOURCE_DESCRIPTOR { - UCHAR Option ; - UCHAR Type ; - UCHAR ShareDisposition ; - UCHAR Spare1 ; - USHORT Flags ; - USHORT Spare2 ; - union __anonunion_u_24 u ; + UCHAR Option; + UCHAR Type; + UCHAR ShareDisposition; + UCHAR Spare1; + USHORT Flags; + USHORT Spare2; + union __anonunion_u_24 u; }; typedef struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR; typedef struct _IO_RESOURCE_DESCRIPTOR *PIO_RESOURCE_DESCRIPTOR; struct _IO_RESOURCE_LIST { - USHORT Version ; - USHORT Revision ; - ULONG Count ; - IO_RESOURCE_DESCRIPTOR Descriptors[1] ; + USHORT Version; + USHORT Revision; + ULONG Count; + IO_RESOURCE_DESCRIPTOR Descriptors[1]; }; typedef struct _IO_RESOURCE_LIST IO_RESOURCE_LIST; typedef struct _IO_RESOURCE_LIST *PIO_RESOURCE_LIST; struct _IO_RESOURCE_REQUIREMENTS_LIST { - ULONG ListSize ; - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - ULONG SlotNumber ; - ULONG Reserved[3] ; - ULONG AlternativeLists ; - IO_RESOURCE_LIST List[1] ; + ULONG ListSize; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + ULONG SlotNumber; + ULONG Reserved[3]; + ULONG AlternativeLists; + IO_RESOURCE_LIST List[1]; }; typedef struct _IO_RESOURCE_REQUIREMENTS_LIST *PIO_RESOURCE_REQUIREMENTS_LIST; enum _CONFIGURATION_TYPE { - ArcSystem = 0, - CentralProcessor = 1, - FloatingPointProcessor = 2, - PrimaryIcache = 3, - PrimaryDcache = 4, - SecondaryIcache = 5, - SecondaryDcache = 6, - SecondaryCache = 7, - EisaAdapter = 8, - TcAdapter = 9, - ScsiAdapter = 10, - DtiAdapter = 11, - MultiFunctionAdapter = 12, - DiskController = 13, - TapeController = 14, - CdromController = 15, - WormController = 16, - SerialController = 17, - NetworkController = 18, - DisplayController = 19, - ParallelController = 20, - PointerController = 21, - KeyboardController = 22, - AudioController = 23, - OtherController = 24, - DiskPeripheral = 25, - FloppyDiskPeripheral = 26, - TapePeripheral = 27, - ModemPeripheral = 28, - MonitorPeripheral = 29, - PrinterPeripheral = 30, - PointerPeripheral = 31, - KeyboardPeripheral = 32, - TerminalPeripheral = 33, - OtherPeripheral = 34, - LinePeripheral = 35, - NetworkPeripheral = 36, - SystemMemory = 37, - DockingInformation = 38, - RealModeIrqRoutingTable = 39, - MaximumType = 40 -} ; + ArcSystem = 0, + CentralProcessor = 1, + FloatingPointProcessor = 2, + PrimaryIcache = 3, + PrimaryDcache = 4, + SecondaryIcache = 5, + SecondaryDcache = 6, + SecondaryCache = 7, + EisaAdapter = 8, + TcAdapter = 9, + ScsiAdapter = 10, + DtiAdapter = 11, + MultiFunctionAdapter = 12, + DiskController = 13, + TapeController = 14, + CdromController = 15, + WormController = 16, + SerialController = 17, + NetworkController = 18, + DisplayController = 19, + ParallelController = 20, + PointerController = 21, + KeyboardController = 22, + AudioController = 23, + OtherController = 24, + DiskPeripheral = 25, + FloppyDiskPeripheral = 26, + TapePeripheral = 27, + ModemPeripheral = 28, + MonitorPeripheral = 29, + PrinterPeripheral = 30, + PointerPeripheral = 31, + KeyboardPeripheral = 32, + TerminalPeripheral = 33, + OtherPeripheral = 34, + LinePeripheral = 35, + NetworkPeripheral = 36, + SystemMemory = 37, + DockingInformation = 38, + RealModeIrqRoutingTable = 39, + MaximumType = 40 +}; typedef enum _CONFIGURATION_TYPE CONFIGURATION_TYPE; typedef enum _CONFIGURATION_TYPE *PCONFIGURATION_TYPE; -enum _KINTERRUPT_MODE { - LevelSensitive = 0, - Latched = 1 -} ; +enum _KINTERRUPT_MODE { LevelSensitive = 0, Latched = 1 }; typedef enum _KINTERRUPT_MODE KINTERRUPT_MODE; enum _KWAIT_REASON { - Executive = 0, - FreePage = 1, - PageIn = 2, - PoolAllocation = 3, - DelayExecution = 4, - Suspended = 5, - UserRequest = 6, - WrExecutive = 7, - WrFreePage = 8, - WrPageIn = 9, - WrPoolAllocation = 10, - WrDelayExecution = 11, - WrSuspended = 12, - WrUserRequest = 13, - WrEventPair = 14, - WrQueue = 15, - WrLpcReceive = 16, - WrLpcReply = 17, - WrVirtualMemory = 18, - WrPageOut = 19, - WrRendezvous = 20, - Spare2 = 21, - Spare3 = 22, - Spare4 = 23, - Spare5 = 24, - Spare6 = 25, - WrKernel = 26, - MaximumWaitReason = 27 -} ; + Executive = 0, + FreePage = 1, + PageIn = 2, + PoolAllocation = 3, + DelayExecution = 4, + Suspended = 5, + UserRequest = 6, + WrExecutive = 7, + WrFreePage = 8, + WrPageIn = 9, + WrPoolAllocation = 10, + WrDelayExecution = 11, + WrSuspended = 12, + WrUserRequest = 13, + WrEventPair = 14, + WrQueue = 15, + WrLpcReceive = 16, + WrLpcReply = 17, + WrVirtualMemory = 18, + WrPageOut = 19, + WrRendezvous = 20, + Spare2 = 21, + Spare3 = 22, + Spare4 = 23, + Spare5 = 24, + Spare6 = 25, + WrKernel = 26, + MaximumWaitReason = 27 +}; typedef enum _KWAIT_REASON KWAIT_REASON; struct _DISPATCHER_HEADER { - UCHAR Type ; - UCHAR Absolute ; - UCHAR Size ; - UCHAR Inserted ; - LONG SignalState ; - LIST_ENTRY WaitListHead ; + UCHAR Type; + UCHAR Absolute; + UCHAR Size; + UCHAR Inserted; + LONG SignalState; + LIST_ENTRY WaitListHead; }; typedef struct _DISPATCHER_HEADER DISPATCHER_HEADER; struct _KDEVICE_QUEUE { - CSHORT Type ; - CSHORT Size ; - LIST_ENTRY DeviceListHead ; - KSPIN_LOCK Lock ; - BOOLEAN Busy ; + CSHORT Type; + CSHORT Size; + LIST_ENTRY DeviceListHead; + KSPIN_LOCK Lock; + BOOLEAN Busy; }; typedef struct _KDEVICE_QUEUE KDEVICE_QUEUE; struct _KDEVICE_QUEUE_ENTRY { - LIST_ENTRY DeviceListEntry ; - ULONG SortKey ; - BOOLEAN Inserted ; + LIST_ENTRY DeviceListEntry; + ULONG SortKey; + BOOLEAN Inserted; }; typedef struct _KDEVICE_QUEUE_ENTRY KDEVICE_QUEUE_ENTRY; struct _KEVENT { - DISPATCHER_HEADER Header ; + DISPATCHER_HEADER Header; }; typedef struct _KEVENT KEVENT; typedef struct _KEVENT *PKEVENT; typedef struct _KEVENT *PRKEVENT; struct _KSEMAPHORE { - DISPATCHER_HEADER Header ; - LONG Limit ; + DISPATCHER_HEADER Header; + LONG Limit; }; typedef struct _KSEMAPHORE *PKSEMAPHORE; typedef struct _KSEMAPHORE *PRKSEMAPHORE; enum _MEMORY_CACHING_TYPE { - MmNonCached = 0, - MmCached = 1, - MmWriteCombined = 2, - MmHardwareCoherentCached = 3, - MmNonCachedUnordered = 4, - MmUSWCCached = 5, - MmMaximumCacheType = 6 -} ; + MmNonCached = 0, + MmCached = 1, + MmWriteCombined = 2, + MmHardwareCoherentCached = 3, + MmNonCachedUnordered = 4, + MmUSWCCached = 5, + MmMaximumCacheType = 6 +}; typedef enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE; enum _POOL_TYPE { - NonPagedPool = 0, - PagedPool = 1, - NonPagedPoolMustSucceed = 2, - DontUseThisType = 3, - NonPagedPoolCacheAligned = 4, - PagedPoolCacheAligned = 5, - NonPagedPoolCacheAlignedMustS = 6, - MaxPoolType = 7, - NonPagedPoolSession = 32, - PagedPoolSession = 33, - NonPagedPoolMustSucceedSession = 34, - DontUseThisTypeSession = 35, - NonPagedPoolCacheAlignedSession = 36, - PagedPoolCacheAlignedSession = 37, - NonPagedPoolCacheAlignedMustSSession = 38 -} ; + NonPagedPool = 0, + PagedPool = 1, + NonPagedPoolMustSucceed = 2, + DontUseThisType = 3, + NonPagedPoolCacheAligned = 4, + PagedPoolCacheAligned = 5, + NonPagedPoolCacheAlignedMustS = 6, + MaxPoolType = 7, + NonPagedPoolSession = 32, + PagedPoolSession = 33, + NonPagedPoolMustSucceedSession = 34, + DontUseThisTypeSession = 35, + NonPagedPoolCacheAlignedSession = 36, + PagedPoolCacheAlignedSession = 37, + NonPagedPoolCacheAlignedMustSSession = 38 +}; typedef enum _POOL_TYPE POOL_TYPE; struct _FAST_MUTEX { - LONG Count ; - PKTHREAD Owner ; - ULONG Contention ; - KEVENT Event ; - ULONG OldIrql ; + LONG Count; + PKTHREAD Owner; + ULONG Contention; + KEVENT Event; + ULONG OldIrql; }; typedef struct _FAST_MUTEX FAST_MUTEX; typedef struct _FAST_MUTEX *PFAST_MUTEX; typedef ULONG_PTR ERESOURCE_THREAD; union __anonunion____missing_field_name_38 { - LONG OwnerCount ; - ULONG TableSize ; + LONG OwnerCount; + ULONG TableSize; }; struct _OWNER_ENTRY { - ERESOURCE_THREAD OwnerThread ; - union __anonunion____missing_field_name_38 __annonCompField10 ; + ERESOURCE_THREAD OwnerThread; + union __anonunion____missing_field_name_38 __annonCompField10; }; typedef struct _OWNER_ENTRY OWNER_ENTRY; typedef struct _OWNER_ENTRY *POWNER_ENTRY; union __anonunion____missing_field_name_39 { - PVOID Address ; - ULONG_PTR CreatorBackTraceIndex ; + PVOID Address; + ULONG_PTR CreatorBackTraceIndex; }; struct _ERESOURCE { - LIST_ENTRY SystemResourcesList ; - POWNER_ENTRY OwnerTable ; - SHORT ActiveCount ; - USHORT Flag ; - PKSEMAPHORE SharedWaiters ; - PKEVENT ExclusiveWaiters ; - OWNER_ENTRY OwnerThreads[2] ; - ULONG ContentionCount ; - USHORT NumberOfSharedWaiters ; - USHORT NumberOfExclusiveWaiters ; - union __anonunion____missing_field_name_39 __annonCompField11 ; - KSPIN_LOCK SpinLock ; + LIST_ENTRY SystemResourcesList; + POWNER_ENTRY OwnerTable; + SHORT ActiveCount; + USHORT Flag; + PKSEMAPHORE SharedWaiters; + PKEVENT ExclusiveWaiters; + OWNER_ENTRY OwnerThreads[2]; + ULONG ContentionCount; + USHORT NumberOfSharedWaiters; + USHORT NumberOfExclusiveWaiters; + union __anonunion____missing_field_name_39 __annonCompField11; + KSPIN_LOCK SpinLock; }; enum _MM_PAGE_PRIORITY { - LowPagePriority = 0, - NormalPagePriority = 16, - HighPagePriority = 32 -} ; + LowPagePriority = 0, + NormalPagePriority = 16, + HighPagePriority = 32 +}; typedef enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY; struct _DRIVER_OBJECT; struct _DRIVER_OBJECT; struct _SECURITY_SUBJECT_CONTEXT { - PACCESS_TOKEN ClientToken ; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ; - PACCESS_TOKEN PrimaryToken ; - PVOID ProcessAuditId ; + PACCESS_TOKEN ClientToken; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + PACCESS_TOKEN PrimaryToken; + PVOID ProcessAuditId; }; typedef struct _SECURITY_SUBJECT_CONTEXT SECURITY_SUBJECT_CONTEXT; struct _INITIAL_PRIVILEGE_SET { - ULONG PrivilegeCount ; - ULONG Control ; - LUID_AND_ATTRIBUTES Privilege[3] ; + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[3]; }; typedef struct _INITIAL_PRIVILEGE_SET INITIAL_PRIVILEGE_SET; union __anonunion_Privileges_40 { - INITIAL_PRIVILEGE_SET InitialPrivilegeSet ; - PRIVILEGE_SET PrivilegeSet ; + INITIAL_PRIVILEGE_SET InitialPrivilegeSet; + PRIVILEGE_SET PrivilegeSet; }; struct _ACCESS_STATE { - LUID OperationID ; - BOOLEAN SecurityEvaluated ; - BOOLEAN GenerateAudit ; - BOOLEAN GenerateOnClose ; - BOOLEAN PrivilegesAllocated ; - ULONG Flags ; - ACCESS_MASK RemainingDesiredAccess ; - ACCESS_MASK PreviouslyGrantedAccess ; - ACCESS_MASK OriginalDesiredAccess ; - SECURITY_SUBJECT_CONTEXT SubjectSecurityContext ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - PVOID AuxData ; - union __anonunion_Privileges_40 Privileges ; - BOOLEAN AuditPrivileges ; - UNICODE_STRING ObjectName ; - UNICODE_STRING ObjectTypeName ; + LUID OperationID; + BOOLEAN SecurityEvaluated; + BOOLEAN GenerateAudit; + BOOLEAN GenerateOnClose; + BOOLEAN PrivilegesAllocated; + ULONG Flags; + ACCESS_MASK RemainingDesiredAccess; + ACCESS_MASK PreviouslyGrantedAccess; + ACCESS_MASK OriginalDesiredAccess; + SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PVOID AuxData; + union __anonunion_Privileges_40 Privileges; + BOOLEAN AuditPrivileges; + UNICODE_STRING ObjectName; + UNICODE_STRING ObjectTypeName; }; typedef struct _ACCESS_STATE *PACCESS_STATE; struct _DEVICE_OBJECT; @@ -860,800 +854,840 @@ struct _IRP; struct _IRP; struct _SCSI_REQUEST_BLOCK; struct _SCSI_REQUEST_BLOCK; -typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ); +typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp); struct _COMPRESSED_DATA_INFO; struct _FAST_IO_DISPATCH { - ULONG SizeOfFastIoDispatch ; - BOOLEAN (*FastIoCheckIfPossible)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , - BOOLEAN CheckForReadOperation , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryBasicInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_BASIC_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryStandardInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PFILE_STANDARD_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoLock)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - BOOLEAN FailImmediately , BOOLEAN ExclusiveLock , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockSingle)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAll)(struct _FILE_OBJECT *FileObject , PEPROCESS ProcessId , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoUnlockAllByKey)(struct _FILE_OBJECT *FileObject , PVOID ProcessId , - ULONG Key , PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoDeviceControl)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , ULONG IoControlCode , - PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ; - void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice , struct _DEVICE_OBJECT *TargetDevice ) ; - BOOLEAN (*FastIoQueryNetworkOpenInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait , - struct _FILE_NETWORK_OPEN_INFORMATION *Buffer , - struct _IO_STATUS_BLOCK *IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForModWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER EndingOffset , - struct _ERESOURCE **ResourceToRelease , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadComplete)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*PrepareMdlWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteComplete)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoReadCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , PMDL *MdlChain , - PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoWriteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - ULONG Length , ULONG LockKey , PVOID Buffer , - PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo , - ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlReadCompleteCompressed)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , - struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*MdlWriteCompleteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset , - PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ; - BOOLEAN (*FastIoQueryOpen)(struct _IRP *Irp , PFILE_NETWORK_OPEN_INFORMATION NetworkInformation , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForModWrite)(struct _FILE_OBJECT *FileObject , struct _ERESOURCE *ResourceToRelease , - struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*AcquireForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; - NTSTATUS (*ReleaseForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ; + ULONG SizeOfFastIoDispatch; + BOOLEAN(*FastIoCheckIfPossible) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, BOOLEAN CheckForReadOperation, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryBasicInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_BASIC_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryStandardInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + PFILE_STANDARD_INFORMATION Buffer, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoLock) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + BOOLEAN FailImmediately, BOOLEAN ExclusiveLock, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockSingle) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, + PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAll) + (struct _FILE_OBJECT *FileObject, PEPROCESS ProcessId, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoUnlockAllByKey) + (struct _FILE_OBJECT *FileObject, PVOID ProcessId, ULONG Key, + PIO_STATUS_BLOCK IoStatus, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoDeviceControl) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, PVOID InputBuffer, + ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength, + ULONG IoControlCode, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject); + void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice, + struct _DEVICE_OBJECT *TargetDevice); + BOOLEAN(*FastIoQueryNetworkOpenInfo) + (struct _FILE_OBJECT *FileObject, BOOLEAN Wait, + struct _FILE_NETWORK_OPEN_INFORMATION *Buffer, + struct _IO_STATUS_BLOCK *IoStatus, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForModWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER EndingOffset, + struct _ERESOURCE **ResourceToRelease, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlRead) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadComplete) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*PrepareMdlWrite) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteComplete) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoReadCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoWriteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, ULONG Length, + ULONG LockKey, PVOID Buffer, PMDL *MdlChain, PIO_STATUS_BLOCK IoStatus, + struct _COMPRESSED_DATA_INFO *CompressedDataInfo, + ULONG CompressedDataInfoLength, struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlReadCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*MdlWriteCompleteCompressed) + (struct _FILE_OBJECT *FileObject, PLARGE_INTEGER FileOffset, PMDL MdlChain, + struct _DEVICE_OBJECT *DeviceObject); + BOOLEAN(*FastIoQueryOpen) + (struct _IRP *Irp, PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForModWrite) + (struct _FILE_OBJECT *FileObject, struct _ERESOURCE *ResourceToRelease, + struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*AcquireForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); + NTSTATUS(*ReleaseForCcFlush) + (struct _FILE_OBJECT *FileObject, struct _DEVICE_OBJECT *DeviceObject); }; typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH; enum _IO_ALLOCATION_ACTION { - KeepObject = 1, - DeallocateObject = 2, - DeallocateObjectKeepRegisters = 3 -} ; + KeepObject = 1, + DeallocateObject = 2, + DeallocateObjectKeepRegisters = 3 +}; typedef enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION; struct _IO_SECURITY_CONTEXT { - PSECURITY_QUALITY_OF_SERVICE SecurityQos ; - PACCESS_STATE AccessState ; - ACCESS_MASK DesiredAccess ; - ULONG FullCreateOptions ; + PSECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_STATE AccessState; + ACCESS_MASK DesiredAccess; + ULONG FullCreateOptions; }; typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT; struct _VPB { - CSHORT Type ; - CSHORT Size ; - USHORT Flags ; - USHORT VolumeLabelLength ; - struct _DEVICE_OBJECT *DeviceObject ; - struct _DEVICE_OBJECT *RealDevice ; - ULONG SerialNumber ; - ULONG ReferenceCount ; - WCHAR VolumeLabel[(32U * sizeof(WCHAR )) / sizeof(WCHAR )] ; + CSHORT Type; + CSHORT Size; + USHORT Flags; + USHORT VolumeLabelLength; + struct _DEVICE_OBJECT *DeviceObject; + struct _DEVICE_OBJECT *RealDevice; + ULONG SerialNumber; + ULONG ReferenceCount; + WCHAR VolumeLabel[(32U * sizeof(WCHAR)) / sizeof(WCHAR)]; }; typedef struct _VPB *PVPB; struct _WAIT_CONTEXT_BLOCK { - KDEVICE_QUEUE_ENTRY WaitQueueEntry ; - IO_ALLOCATION_ACTION (*DeviceRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp , - PVOID MapRegisterBase , PVOID Context ) ; - PVOID DeviceContext ; - ULONG NumberOfMapRegisters ; - PVOID DeviceObject ; - PVOID CurrentIrp ; - PKDPC BufferChainingDpc ; + KDEVICE_QUEUE_ENTRY WaitQueueEntry; + IO_ALLOCATION_ACTION(*DeviceRoutine) + (struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp, PVOID MapRegisterBase, + PVOID Context); + PVOID DeviceContext; + ULONG NumberOfMapRegisters; + PVOID DeviceObject; + PVOID CurrentIrp; + PKDPC BufferChainingDpc; }; typedef struct _WAIT_CONTEXT_BLOCK WAIT_CONTEXT_BLOCK; union __anonunion_Queue_43 { - LIST_ENTRY ListEntry ; - WAIT_CONTEXT_BLOCK Wcb ; + LIST_ENTRY ListEntry; + WAIT_CONTEXT_BLOCK Wcb; }; struct _DEVOBJ_EXTENSION; struct _DEVICE_OBJECT { - CSHORT Type ; - USHORT Size ; - LONG ReferenceCount ; - struct _DRIVER_OBJECT *DriverObject ; - struct _DEVICE_OBJECT *NextDevice ; - struct _DEVICE_OBJECT *AttachedDevice ; - struct _IRP *CurrentIrp ; - PIO_TIMER Timer ; - ULONG Flags ; - ULONG Characteristics ; - PVPB Vpb ; - PVOID DeviceExtension ; - ULONG DeviceType ; - CCHAR StackSize ; - union __anonunion_Queue_43 Queue ; - ULONG AlignmentRequirement ; - KDEVICE_QUEUE DeviceQueue ; - KDPC Dpc ; - ULONG ActiveThreadCount ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; - KEVENT DeviceLock ; - USHORT SectorSize ; - USHORT Spare1 ; - struct _DEVOBJ_EXTENSION *DeviceObjectExtension ; - PVOID Reserved ; + CSHORT Type; + USHORT Size; + LONG ReferenceCount; + struct _DRIVER_OBJECT *DriverObject; + struct _DEVICE_OBJECT *NextDevice; + struct _DEVICE_OBJECT *AttachedDevice; + struct _IRP *CurrentIrp; + PIO_TIMER Timer; + ULONG Flags; + ULONG Characteristics; + PVPB Vpb; + PVOID DeviceExtension; + ULONG DeviceType; + CCHAR StackSize; + union __anonunion_Queue_43 Queue; + ULONG AlignmentRequirement; + KDEVICE_QUEUE DeviceQueue; + KDPC Dpc; + ULONG ActiveThreadCount; + PSECURITY_DESCRIPTOR SecurityDescriptor; + KEVENT DeviceLock; + USHORT SectorSize; + USHORT Spare1; + struct _DEVOBJ_EXTENSION *DeviceObjectExtension; + PVOID Reserved; }; typedef struct _DEVICE_OBJECT DEVICE_OBJECT; typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; struct _DEVOBJ_EXTENSION { - CSHORT Type ; - USHORT Size ; - PDEVICE_OBJECT DeviceObject ; + CSHORT Type; + USHORT Size; + PDEVICE_OBJECT DeviceObject; }; struct _DRIVER_EXTENSION { - struct _DRIVER_OBJECT *DriverObject ; - NTSTATUS (*AddDevice)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ; - ULONG Count ; - UNICODE_STRING ServiceKeyName ; + struct _DRIVER_OBJECT *DriverObject; + NTSTATUS(*AddDevice) + (struct _DRIVER_OBJECT *DriverObject, + struct _DEVICE_OBJECT *PhysicalDeviceObject); + ULONG Count; + UNICODE_STRING ServiceKeyName; }; typedef struct _DRIVER_EXTENSION *PDRIVER_EXTENSION; struct _DRIVER_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - ULONG Flags ; - PVOID DriverStart ; - ULONG DriverSize ; - PVOID DriverSection ; - PDRIVER_EXTENSION DriverExtension ; - UNICODE_STRING DriverName ; - PUNICODE_STRING HardwareDatabase ; - PFAST_IO_DISPATCH FastIoDispatch ; - NTSTATUS (*DriverInit)(struct _DRIVER_OBJECT *DriverObject , PUNICODE_STRING RegistryPath ) ; - void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject ) ; - PDRIVER_DISPATCH MajorFunction[28] ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + PVOID DriverStart; + ULONG DriverSize; + PVOID DriverSection; + PDRIVER_EXTENSION DriverExtension; + UNICODE_STRING DriverName; + PUNICODE_STRING HardwareDatabase; + PFAST_IO_DISPATCH FastIoDispatch; + NTSTATUS(*DriverInit) + (struct _DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath); + void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject); + PDRIVER_DISPATCH MajorFunction[28]; }; typedef struct _DRIVER_OBJECT DRIVER_OBJECT; typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; struct _SECTION_OBJECT_POINTERS { - PVOID DataSectionObject ; - PVOID SharedCacheMap ; - PVOID ImageSectionObject ; + PVOID DataSectionObject; + PVOID SharedCacheMap; + PVOID ImageSectionObject; }; typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS; typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS; struct _IO_COMPLETION_CONTEXT { - PVOID Port ; - PVOID Key ; + PVOID Port; + PVOID Key; }; typedef struct _IO_COMPLETION_CONTEXT *PIO_COMPLETION_CONTEXT; struct _FILE_OBJECT { - CSHORT Type ; - CSHORT Size ; - PDEVICE_OBJECT DeviceObject ; - PVPB Vpb ; - PVOID FsContext ; - PVOID FsContext2 ; - PSECTION_OBJECT_POINTERS SectionObjectPointer ; - PVOID PrivateCacheMap ; - NTSTATUS FinalStatus ; - struct _FILE_OBJECT *RelatedFileObject ; - BOOLEAN LockOperation ; - BOOLEAN DeletePending ; - BOOLEAN ReadAccess ; - BOOLEAN WriteAccess ; - BOOLEAN DeleteAccess ; - BOOLEAN SharedRead ; - BOOLEAN SharedWrite ; - BOOLEAN SharedDelete ; - ULONG Flags ; - UNICODE_STRING FileName ; - LARGE_INTEGER CurrentByteOffset ; - ULONG Waiters ; - ULONG Busy ; - PVOID LastLock ; - KEVENT Lock ; - KEVENT Event ; - PIO_COMPLETION_CONTEXT CompletionContext ; + CSHORT Type; + CSHORT Size; + PDEVICE_OBJECT DeviceObject; + PVPB Vpb; + PVOID FsContext; + PVOID FsContext2; + PSECTION_OBJECT_POINTERS SectionObjectPointer; + PVOID PrivateCacheMap; + NTSTATUS FinalStatus; + struct _FILE_OBJECT *RelatedFileObject; + BOOLEAN LockOperation; + BOOLEAN DeletePending; + BOOLEAN ReadAccess; + BOOLEAN WriteAccess; + BOOLEAN DeleteAccess; + BOOLEAN SharedRead; + BOOLEAN SharedWrite; + BOOLEAN SharedDelete; + ULONG Flags; + UNICODE_STRING FileName; + LARGE_INTEGER CurrentByteOffset; + ULONG Waiters; + ULONG Busy; + PVOID LastLock; + KEVENT Lock; + KEVENT Event; + PIO_COMPLETION_CONTEXT CompletionContext; }; typedef struct _FILE_OBJECT *PFILE_OBJECT; union __anonunion_AssociatedIrp_44 { - struct _IRP *MasterIrp ; - LONG IrpCount ; - PVOID SystemBuffer ; + struct _IRP *MasterIrp; + LONG IrpCount; + PVOID SystemBuffer; }; struct __anonstruct_AsynchronousParameters_46 { - void (*UserApcRoutine)(PVOID ApcContext , PIO_STATUS_BLOCK IoStatusBlock , - ULONG Reserved ) ; - PVOID UserApcContext ; + void (*UserApcRoutine)(PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, + ULONG Reserved); + PVOID UserApcContext; }; union __anonunion_Overlay_45 { - struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters ; - LARGE_INTEGER AllocationSize ; + struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters; + LARGE_INTEGER AllocationSize; }; struct __anonstruct____missing_field_name_50 { - PVOID DriverContext[4] ; + PVOID DriverContext[4]; }; union __anonunion____missing_field_name_49 { - KDEVICE_QUEUE_ENTRY DeviceQueueEntry ; - struct __anonstruct____missing_field_name_50 __annonCompField14 ; + KDEVICE_QUEUE_ENTRY DeviceQueueEntry; + struct __anonstruct____missing_field_name_50 __annonCompField14; }; struct _IO_STACK_LOCATION; union __anonunion____missing_field_name_52 { - struct _IO_STACK_LOCATION *CurrentStackLocation ; - ULONG PacketType ; + struct _IO_STACK_LOCATION *CurrentStackLocation; + ULONG PacketType; }; struct __anonstruct____missing_field_name_51 { - LIST_ENTRY ListEntry ; - union __anonunion____missing_field_name_52 __annonCompField16 ; + LIST_ENTRY ListEntry; + union __anonunion____missing_field_name_52 __annonCompField16; }; struct __anonstruct_Overlay_48 { - union __anonunion____missing_field_name_49 __annonCompField15 ; - PETHREAD Thread ; - PCHAR AuxiliaryBuffer ; - struct __anonstruct____missing_field_name_51 __annonCompField17 ; - PFILE_OBJECT OriginalFileObject ; + union __anonunion____missing_field_name_49 __annonCompField15; + PETHREAD Thread; + PCHAR AuxiliaryBuffer; + struct __anonstruct____missing_field_name_51 __annonCompField17; + PFILE_OBJECT OriginalFileObject; }; union __anonunion_Tail_47 { - struct __anonstruct_Overlay_48 Overlay ; - KAPC Apc ; - PVOID CompletionKey ; + struct __anonstruct_Overlay_48 Overlay; + KAPC Apc; + PVOID CompletionKey; }; struct _IRP { - CSHORT Type ; - USHORT Size ; - PMDL MdlAddress ; - ULONG Flags ; - union __anonunion_AssociatedIrp_44 AssociatedIrp ; - LIST_ENTRY ThreadListEntry ; - IO_STATUS_BLOCK IoStatus ; - KPROCESSOR_MODE RequestorMode ; - BOOLEAN PendingReturned ; - CHAR StackCount ; - CHAR CurrentLocation ; - BOOLEAN Cancel ; - KIRQL CancelIrql ; - CCHAR ApcEnvironment ; - UCHAR AllocationFlags ; - PIO_STATUS_BLOCK UserIosb ; - PKEVENT UserEvent ; - union __anonunion_Overlay_45 Overlay ; - void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ; - PVOID UserBuffer ; - union __anonunion_Tail_47 Tail ; + CSHORT Type; + USHORT Size; + PMDL MdlAddress; + ULONG Flags; + union __anonunion_AssociatedIrp_44 AssociatedIrp; + LIST_ENTRY ThreadListEntry; + IO_STATUS_BLOCK IoStatus; + KPROCESSOR_MODE RequestorMode; + BOOLEAN PendingReturned; + CHAR StackCount; + CHAR CurrentLocation; + BOOLEAN Cancel; + KIRQL CancelIrql; + CCHAR ApcEnvironment; + UCHAR AllocationFlags; + PIO_STATUS_BLOCK UserIosb; + PKEVENT UserEvent; + union __anonunion_Overlay_45 Overlay; + void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject, struct _IRP *Irp); + PVOID UserBuffer; + union __anonunion_Tail_47 Tail; }; typedef struct _IRP IRP; typedef struct _IRP *PIRP; enum _DEVICE_RELATION_TYPE { - BusRelations = 0, - EjectionRelations = 1, - PowerRelations = 2, - RemovalRelations = 3, - TargetDeviceRelation = 4 -} ; + BusRelations = 0, + EjectionRelations = 1, + PowerRelations = 2, + RemovalRelations = 3, + TargetDeviceRelation = 4 +}; typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE; struct _DEVICE_RELATIONS { - ULONG Count ; - PDEVICE_OBJECT Objects[1] ; + ULONG Count; + PDEVICE_OBJECT Objects[1]; }; typedef struct _DEVICE_RELATIONS DEVICE_RELATIONS; typedef struct _DEVICE_RELATIONS *PDEVICE_RELATIONS; enum _DEVICE_USAGE_NOTIFICATION_TYPE { - DeviceUsageTypeUndefined = 0, - DeviceUsageTypePaging = 1, - DeviceUsageTypeHibernation = 2, - DeviceUsageTypeDumpFile = 3 -} ; + DeviceUsageTypeUndefined = 0, + DeviceUsageTypePaging = 1, + DeviceUsageTypeHibernation = 2, + DeviceUsageTypeDumpFile = 3 +}; typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE; struct _INTERFACE { - USHORT Size ; - USHORT Version ; - PVOID Context ; - void (*InterfaceReference)(PVOID Context ) ; - void (*InterfaceDereference)(PVOID Context ) ; + USHORT Size; + USHORT Version; + PVOID Context; + void (*InterfaceReference)(PVOID Context); + void (*InterfaceDereference)(PVOID Context); }; typedef struct _INTERFACE *PINTERFACE; struct _DEVICE_CAPABILITIES { - USHORT Size ; - USHORT Version ; - ULONG DeviceD1 : 1 ; - ULONG DeviceD2 : 1 ; - ULONG LockSupported : 1 ; - ULONG EjectSupported : 1 ; - ULONG Removable : 1 ; - ULONG DockDevice : 1 ; - ULONG UniqueID : 1 ; - ULONG SilentInstall : 1 ; - ULONG RawDeviceOK : 1 ; - ULONG SurpriseRemovalOK : 1 ; - ULONG WakeFromD0 : 1 ; - ULONG WakeFromD1 : 1 ; - ULONG WakeFromD2 : 1 ; - ULONG WakeFromD3 : 1 ; - ULONG HardwareDisabled : 1 ; - ULONG NonDynamic : 1 ; - ULONG WarmEjectSupported : 1 ; - ULONG Reserved : 15 ; - ULONG Address ; - ULONG UINumber ; - DEVICE_POWER_STATE DeviceState[7] ; - SYSTEM_POWER_STATE SystemWake ; - DEVICE_POWER_STATE DeviceWake ; - ULONG D1Latency ; - ULONG D2Latency ; - ULONG D3Latency ; + USHORT Size; + USHORT Version; + ULONG DeviceD1 : 1; + ULONG DeviceD2 : 1; + ULONG LockSupported : 1; + ULONG EjectSupported : 1; + ULONG Removable : 1; + ULONG DockDevice : 1; + ULONG UniqueID : 1; + ULONG SilentInstall : 1; + ULONG RawDeviceOK : 1; + ULONG SurpriseRemovalOK : 1; + ULONG WakeFromD0 : 1; + ULONG WakeFromD1 : 1; + ULONG WakeFromD2 : 1; + ULONG WakeFromD3 : 1; + ULONG HardwareDisabled : 1; + ULONG NonDynamic : 1; + ULONG WarmEjectSupported : 1; + ULONG Reserved : 15; + ULONG Address; + ULONG UINumber; + DEVICE_POWER_STATE DeviceState[7]; + SYSTEM_POWER_STATE SystemWake; + DEVICE_POWER_STATE DeviceWake; + ULONG D1Latency; + ULONG D2Latency; + ULONG D3Latency; }; typedef struct _DEVICE_CAPABILITIES *PDEVICE_CAPABILITIES; struct _POWER_SEQUENCE { - ULONG SequenceD1 ; - ULONG SequenceD2 ; - ULONG SequenceD3 ; + ULONG SequenceD1; + ULONG SequenceD2; + ULONG SequenceD3; }; typedef struct _POWER_SEQUENCE *PPOWER_SEQUENCE; enum __anonenum_BUS_QUERY_ID_TYPE_53 { - BusQueryDeviceID = 0, - BusQueryHardwareIDs = 1, - BusQueryCompatibleIDs = 2, - BusQueryInstanceID = 3, - BusQueryDeviceSerialNumber = 4 -} ; + BusQueryDeviceID = 0, + BusQueryHardwareIDs = 1, + BusQueryCompatibleIDs = 2, + BusQueryInstanceID = 3, + BusQueryDeviceSerialNumber = 4 +}; typedef enum __anonenum_BUS_QUERY_ID_TYPE_53 BUS_QUERY_ID_TYPE; enum __anonenum_DEVICE_TEXT_TYPE_54 { - DeviceTextDescription = 0, - DeviceTextLocationInformation = 1 -} ; + DeviceTextDescription = 0, + DeviceTextLocationInformation = 1 +}; typedef enum __anonenum_DEVICE_TEXT_TYPE_54 DEVICE_TEXT_TYPE; -#pragma pack(push,4) +#pragma pack(push, 4) struct __anonstruct_Create_56 { - PIO_SECURITY_CONTEXT SecurityContext ; - ULONG Options ; - USHORT FileAttributes ; - USHORT ShareAccess ; - ULONG EaLength ; + PIO_SECURITY_CONTEXT SecurityContext; + ULONG Options; + USHORT FileAttributes; + USHORT ShareAccess; + ULONG EaLength; }; struct __anonstruct_Read_57 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_Write_58 { - ULONG Length ; - ULONG Key ; - LARGE_INTEGER ByteOffset ; + ULONG Length; + ULONG Key; + LARGE_INTEGER ByteOffset; }; struct __anonstruct_QueryFile_59 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; }; struct __anonstruct____missing_field_name_62 { - BOOLEAN ReplaceIfExists ; - BOOLEAN AdvanceOnly ; + BOOLEAN ReplaceIfExists; + BOOLEAN AdvanceOnly; }; union __anonunion____missing_field_name_61 { - struct __anonstruct____missing_field_name_62 __annonCompField18 ; - ULONG ClusterCount ; - HANDLE DeleteHandle ; + struct __anonstruct____missing_field_name_62 __annonCompField18; + ULONG ClusterCount; + HANDLE DeleteHandle; }; struct __anonstruct_SetFile_60 { - ULONG Length ; - FILE_INFORMATION_CLASS FileInformationClass ; - PFILE_OBJECT FileObject ; - union __anonunion____missing_field_name_61 __annonCompField19 ; + ULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; + PFILE_OBJECT FileObject; + union __anonunion____missing_field_name_61 __annonCompField19; }; struct __anonstruct_QueryVolume_63 { - ULONG Length ; - FS_INFORMATION_CLASS FsInformationClass ; + ULONG Length; + FS_INFORMATION_CLASS FsInformationClass; }; struct __anonstruct_DeviceIoControl_64 { - ULONG OutputBufferLength ; - ULONG InputBufferLength ; - ULONG IoControlCode ; - PVOID Type3InputBuffer ; + ULONG OutputBufferLength; + ULONG InputBufferLength; + ULONG IoControlCode; + PVOID Type3InputBuffer; }; struct __anonstruct_QuerySecurity_65 { - SECURITY_INFORMATION SecurityInformation ; - ULONG Length ; + SECURITY_INFORMATION SecurityInformation; + ULONG Length; }; struct __anonstruct_SetSecurity_66 { - SECURITY_INFORMATION SecurityInformation ; - PSECURITY_DESCRIPTOR SecurityDescriptor ; + SECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; }; struct __anonstruct_MountVolume_67 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_VerifyVolume_68 { - PVPB Vpb ; - PDEVICE_OBJECT DeviceObject ; + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; }; struct __anonstruct_Scsi_69 { - struct _SCSI_REQUEST_BLOCK *Srb ; + struct _SCSI_REQUEST_BLOCK *Srb; }; struct __anonstruct_QueryDeviceRelations_70 { - DEVICE_RELATION_TYPE Type ; + DEVICE_RELATION_TYPE Type; }; struct __anonstruct_QueryInterface_71 { - GUID const *InterfaceType ; - USHORT Size ; - USHORT Version ; - PINTERFACE Interface ; - PVOID InterfaceSpecificData ; + GUID const *InterfaceType; + USHORT Size; + USHORT Version; + PINTERFACE Interface; + PVOID InterfaceSpecificData; }; struct __anonstruct_DeviceCapabilities_72 { - PDEVICE_CAPABILITIES Capabilities ; + PDEVICE_CAPABILITIES Capabilities; }; struct __anonstruct_FilterResourceRequirements_73 { - PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList ; + PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; }; struct __anonstruct_ReadWriteConfig_74 { - ULONG WhichSpace ; - PVOID Buffer ; - ULONG Offset ; - ULONG Length ; + ULONG WhichSpace; + PVOID Buffer; + ULONG Offset; + ULONG Length; }; struct __anonstruct_SetLock_75 { - BOOLEAN Lock ; + BOOLEAN Lock; }; struct __anonstruct_QueryId_76 { - BUS_QUERY_ID_TYPE IdType ; + BUS_QUERY_ID_TYPE IdType; }; struct __anonstruct_QueryDeviceText_77 { - DEVICE_TEXT_TYPE DeviceTextType ; - LCID LocaleId ; + DEVICE_TEXT_TYPE DeviceTextType; + LCID LocaleId; }; struct __anonstruct_UsageNotification_78 { - BOOLEAN InPath ; - BOOLEAN Reserved[3] ; - DEVICE_USAGE_NOTIFICATION_TYPE Type ; + BOOLEAN InPath; + BOOLEAN Reserved[3]; + DEVICE_USAGE_NOTIFICATION_TYPE Type; }; struct __anonstruct_WaitWake_79 { - SYSTEM_POWER_STATE PowerState ; + SYSTEM_POWER_STATE PowerState; }; struct __anonstruct_PowerSequence_80 { - PPOWER_SEQUENCE PowerSequence ; + PPOWER_SEQUENCE PowerSequence; }; struct __anonstruct_Power_81 { - ULONG SystemContext ; - POWER_STATE_TYPE Type ; - POWER_STATE State ; - POWER_ACTION ShutdownType ; + ULONG SystemContext; + POWER_STATE_TYPE Type; + POWER_STATE State; + POWER_ACTION ShutdownType; }; struct __anonstruct_StartDevice_82 { - PCM_RESOURCE_LIST AllocatedResources ; - PCM_RESOURCE_LIST AllocatedResourcesTranslated ; + PCM_RESOURCE_LIST AllocatedResources; + PCM_RESOURCE_LIST AllocatedResourcesTranslated; }; struct __anonstruct_WMI_83 { - ULONG_PTR ProviderId ; - PVOID DataPath ; - ULONG BufferSize ; - PVOID Buffer ; + ULONG_PTR ProviderId; + PVOID DataPath; + ULONG BufferSize; + PVOID Buffer; }; struct __anonstruct_Others_84 { - PVOID Argument1 ; - PVOID Argument2 ; - PVOID Argument3 ; - PVOID Argument4 ; + PVOID Argument1; + PVOID Argument2; + PVOID Argument3; + PVOID Argument4; }; union __anonunion_Parameters_55 { - struct __anonstruct_Create_56 Create ; - struct __anonstruct_Read_57 Read ; - struct __anonstruct_Write_58 Write ; - struct __anonstruct_QueryFile_59 QueryFile ; - struct __anonstruct_SetFile_60 SetFile ; - struct __anonstruct_QueryVolume_63 QueryVolume ; - struct __anonstruct_DeviceIoControl_64 DeviceIoControl ; - struct __anonstruct_QuerySecurity_65 QuerySecurity ; - struct __anonstruct_SetSecurity_66 SetSecurity ; - struct __anonstruct_MountVolume_67 MountVolume ; - struct __anonstruct_VerifyVolume_68 VerifyVolume ; - struct __anonstruct_Scsi_69 Scsi ; - struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations ; - struct __anonstruct_QueryInterface_71 QueryInterface ; - struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities ; - struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements ; - struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig ; - struct __anonstruct_SetLock_75 SetLock ; - struct __anonstruct_QueryId_76 QueryId ; - struct __anonstruct_QueryDeviceText_77 QueryDeviceText ; - struct __anonstruct_UsageNotification_78 UsageNotification ; - struct __anonstruct_WaitWake_79 WaitWake ; - struct __anonstruct_PowerSequence_80 PowerSequence ; - struct __anonstruct_Power_81 Power ; - struct __anonstruct_StartDevice_82 StartDevice ; - struct __anonstruct_WMI_83 WMI ; - struct __anonstruct_Others_84 Others ; + struct __anonstruct_Create_56 Create; + struct __anonstruct_Read_57 Read; + struct __anonstruct_Write_58 Write; + struct __anonstruct_QueryFile_59 QueryFile; + struct __anonstruct_SetFile_60 SetFile; + struct __anonstruct_QueryVolume_63 QueryVolume; + struct __anonstruct_DeviceIoControl_64 DeviceIoControl; + struct __anonstruct_QuerySecurity_65 QuerySecurity; + struct __anonstruct_SetSecurity_66 SetSecurity; + struct __anonstruct_MountVolume_67 MountVolume; + struct __anonstruct_VerifyVolume_68 VerifyVolume; + struct __anonstruct_Scsi_69 Scsi; + struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations; + struct __anonstruct_QueryInterface_71 QueryInterface; + struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities; + struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements; + struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig; + struct __anonstruct_SetLock_75 SetLock; + struct __anonstruct_QueryId_76 QueryId; + struct __anonstruct_QueryDeviceText_77 QueryDeviceText; + struct __anonstruct_UsageNotification_78 UsageNotification; + struct __anonstruct_WaitWake_79 WaitWake; + struct __anonstruct_PowerSequence_80 PowerSequence; + struct __anonstruct_Power_81 Power; + struct __anonstruct_StartDevice_82 StartDevice; + struct __anonstruct_WMI_83 WMI; + struct __anonstruct_Others_84 Others; }; struct _IO_STACK_LOCATION { - UCHAR MajorFunction ; - UCHAR MinorFunction ; - UCHAR Flags ; - UCHAR Control ; - union __anonunion_Parameters_55 Parameters ; - PDEVICE_OBJECT DeviceObject ; - PFILE_OBJECT FileObject ; - NTSTATUS (*CompletionRoutine)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; - PVOID Context ; + UCHAR MajorFunction; + UCHAR MinorFunction; + UCHAR Flags; + UCHAR Control; + union __anonunion_Parameters_55 Parameters; + PDEVICE_OBJECT DeviceObject; + PFILE_OBJECT FileObject; + NTSTATUS(*CompletionRoutine) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); + PVOID Context; }; typedef struct _IO_STACK_LOCATION IO_STACK_LOCATION; typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION; #pragma pack(pop) struct _CONFIGURATION_INFORMATION { - ULONG DiskCount ; - ULONG FloppyCount ; - ULONG CdRomCount ; - ULONG TapeCount ; - ULONG ScsiPortCount ; - ULONG SerialCount ; - ULONG ParallelCount ; - BOOLEAN AtDiskPrimaryAddressClaimed ; - BOOLEAN AtDiskSecondaryAddressClaimed ; - ULONG Version ; - ULONG MediumChangerCount ; + ULONG DiskCount; + ULONG FloppyCount; + ULONG CdRomCount; + ULONG TapeCount; + ULONG ScsiPortCount; + ULONG SerialCount; + ULONG ParallelCount; + BOOLEAN AtDiskPrimaryAddressClaimed; + BOOLEAN AtDiskSecondaryAddressClaimed; + ULONG Version; + ULONG MediumChangerCount; }; typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION; typedef struct _CONFIGURATION_INFORMATION *PCONFIGURATION_INFORMATION; struct _IO_REMOVE_LOCK_COMMON_BLOCK { - BOOLEAN Removed ; - BOOLEAN Reserved[3] ; - LONG IoCount ; - KEVENT RemoveEvent ; + BOOLEAN Removed; + BOOLEAN Reserved[3]; + LONG IoCount; + KEVENT RemoveEvent; }; typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK IO_REMOVE_LOCK_COMMON_BLOCK; struct _IO_REMOVE_LOCK { - IO_REMOVE_LOCK_COMMON_BLOCK Common ; + IO_REMOVE_LOCK_COMMON_BLOCK Common; }; typedef struct _IO_REMOVE_LOCK IO_REMOVE_LOCK; typedef struct _IO_REMOVE_LOCK *PIO_REMOVE_LOCK; struct _OBJECT_HANDLE_INFORMATION { - ULONG HandleAttributes ; - ACCESS_MASK GrantedAccess ; + ULONG HandleAttributes; + ACCESS_MASK GrantedAccess; }; typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION; struct _PARPORT_REMOVAL_RELATIONS { - PDEVICE_OBJECT DeviceObject ; - ULONG Flags ; - PUNICODE_STRING DeviceName ; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + PUNICODE_STRING DeviceName; }; typedef struct _PARPORT_REMOVAL_RELATIONS PARPORT_REMOVAL_RELATIONS; typedef struct _PARPORT_REMOVAL_RELATIONS *PPARPORT_REMOVAL_RELATIONS; struct _PARALLEL_PARCHIP_INFO { - PUCHAR Controller ; - PUCHAR EcrController ; - ULONG HardwareModes ; - NTSTATUS (*ParChipSetMode)(PVOID SetChipContext , UCHAR ChipMode ) ; - NTSTATUS (*ParChipClearMode)(PVOID ClearChipContext , UCHAR ChipMode ) ; - PVOID Context ; - BOOLEAN success ; + PUCHAR Controller; + PUCHAR EcrController; + ULONG HardwareModes; + NTSTATUS (*ParChipSetMode)(PVOID SetChipContext, UCHAR ChipMode); + NTSTATUS (*ParChipClearMode)(PVOID ClearChipContext, UCHAR ChipMode); + PVOID Context; + BOOLEAN success; }; typedef struct _PARALLEL_PARCHIP_INFO PARALLEL_PARCHIP_INFO; struct _PARALLEL_PORT_INFORMATION { - PHYSICAL_ADDRESS OriginalController ; - PUCHAR Controller ; - ULONG SpanOfController ; - BOOLEAN (*TryAllocatePort)(PVOID TryAllocateContext ) ; - void (*FreePort)(PVOID FreeContext ) ; - ULONG (*QueryNumWaiters)(PVOID QueryAllocsContext ) ; - PVOID Context ; + PHYSICAL_ADDRESS OriginalController; + PUCHAR Controller; + ULONG SpanOfController; + BOOLEAN (*TryAllocatePort)(PVOID TryAllocateContext); + void (*FreePort)(PVOID FreeContext); + ULONG (*QueryNumWaiters)(PVOID QueryAllocsContext); + PVOID Context; }; typedef struct _PARALLEL_PORT_INFORMATION PARALLEL_PORT_INFORMATION; typedef struct _PARALLEL_PORT_INFORMATION *PPARALLEL_PORT_INFORMATION; struct _PARALLEL_PNP_INFORMATION { - PHYSICAL_ADDRESS OriginalEcpController ; - PUCHAR EcpController ; - ULONG SpanOfEcpController ; - ULONG PortNumber ; - ULONG HardwareCapabilities ; - NTSTATUS (*TrySetChipMode)(PVOID SetChipContext , UCHAR ChipMode ) ; - NTSTATUS (*ClearChipMode)(PVOID ClearChipContext , UCHAR ChipMode ) ; - ULONG FifoDepth ; - ULONG FifoWidth ; - PHYSICAL_ADDRESS EppControllerPhysicalAddress ; - ULONG SpanOfEppController ; - ULONG Ieee1284_3DeviceCount ; - NTSTATUS (*TrySelectDevice)(PVOID TrySelectContext , PVOID TrySelectCommand ) ; - NTSTATUS (*DeselectDevice)(PVOID DeselectContext , PVOID DeselectCommand ) ; - PVOID Context ; - ULONG CurrentMode ; - PWSTR PortName ; + PHYSICAL_ADDRESS OriginalEcpController; + PUCHAR EcpController; + ULONG SpanOfEcpController; + ULONG PortNumber; + ULONG HardwareCapabilities; + NTSTATUS (*TrySetChipMode)(PVOID SetChipContext, UCHAR ChipMode); + NTSTATUS (*ClearChipMode)(PVOID ClearChipContext, UCHAR ChipMode); + ULONG FifoDepth; + ULONG FifoWidth; + PHYSICAL_ADDRESS EppControllerPhysicalAddress; + ULONG SpanOfEppController; + ULONG Ieee1284_3DeviceCount; + NTSTATUS (*TrySelectDevice)(PVOID TrySelectContext, PVOID TrySelectCommand); + NTSTATUS (*DeselectDevice)(PVOID DeselectContext, PVOID DeselectCommand); + PVOID Context; + ULONG CurrentMode; + PWSTR PortName; }; typedef struct _PARALLEL_PNP_INFORMATION PARALLEL_PNP_INFORMATION; typedef struct _PARALLEL_PNP_INFORMATION *PPARALLEL_PNP_INFORMATION; struct _PARALLEL_1284_COMMAND { - UCHAR ID ; - UCHAR Port ; - ULONG CommandFlags ; + UCHAR ID; + UCHAR Port; + ULONG CommandFlags; }; typedef struct _PARALLEL_1284_COMMAND PARALLEL_1284_COMMAND; typedef struct _PARALLEL_1284_COMMAND *PPARALLEL_1284_COMMAND; struct _PARALLEL_CHIP_MODE { - UCHAR ModeFlags ; - BOOLEAN success ; + UCHAR ModeFlags; + BOOLEAN success; }; typedef struct _PARALLEL_CHIP_MODE PARALLEL_CHIP_MODE; struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE { - BOOLEAN (*InterruptServiceRoutine)(struct _KINTERRUPT *Interrupt , PVOID ServiceContext ) ; - PVOID InterruptServiceContext ; - void (*DeferredPortCheckRoutine)(PVOID DeferredContext ) ; - PVOID DeferredPortCheckContext ; -}; -typedef struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE PARALLEL_INTERRUPT_SERVICE_ROUTINE; -typedef struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE *PPARALLEL_INTERRUPT_SERVICE_ROUTINE; + BOOLEAN(*InterruptServiceRoutine) + (struct _KINTERRUPT *Interrupt, PVOID ServiceContext); + PVOID InterruptServiceContext; + void (*DeferredPortCheckRoutine)(PVOID DeferredContext); + PVOID DeferredPortCheckContext; +}; +typedef struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE + PARALLEL_INTERRUPT_SERVICE_ROUTINE; +typedef struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE + *PPARALLEL_INTERRUPT_SERVICE_ROUTINE; struct _PARALLEL_INTERRUPT_INFORMATION { - PKINTERRUPT InterruptObject ; - BOOLEAN (*TryAllocatePortAtInterruptLevel)(PVOID TryAllocateContext ) ; - void (*FreePortFromInterruptLevel)(PVOID FreeContext ) ; - PVOID Context ; + PKINTERRUPT InterruptObject; + BOOLEAN (*TryAllocatePortAtInterruptLevel)(PVOID TryAllocateContext); + void (*FreePortFromInterruptLevel)(PVOID FreeContext); + PVOID Context; }; typedef struct _PARALLEL_INTERRUPT_INFORMATION PARALLEL_INTERRUPT_INFORMATION; typedef struct _PARALLEL_INTERRUPT_INFORMATION *PPARALLEL_INTERRUPT_INFORMATION; struct _MORE_PARALLEL_PORT_INFORMATION { - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - ULONG InterruptLevel ; - ULONG InterruptVector ; - KAFFINITY InterruptAffinity ; - KINTERRUPT_MODE InterruptMode ; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + ULONG InterruptLevel; + ULONG InterruptVector; + KAFFINITY InterruptAffinity; + KINTERRUPT_MODE InterruptMode; }; typedef struct _MORE_PARALLEL_PORT_INFORMATION MORE_PARALLEL_PORT_INFORMATION; typedef struct _MORE_PARALLEL_PORT_INFORMATION *PMORE_PARALLEL_PORT_INFORMATION; struct __anonstruct_WMIGUIDREGINFO_114 { - LPCGUID Guid ; - ULONG InstanceCount ; - ULONG Flags ; + LPCGUID Guid; + ULONG InstanceCount; + ULONG Flags; }; typedef struct __anonstruct_WMIGUIDREGINFO_114 WMIGUIDREGINFO; typedef struct __anonstruct_WMIGUIDREGINFO_114 *PWMIGUIDREGINFO; enum __anonenum_WMIENABLEDISABLECONTROL_115 { - WmiEventControl = 0, - WmiDataBlockControl = 1 -} ; + WmiEventControl = 0, + WmiDataBlockControl = 1 +}; typedef enum __anonenum_WMIENABLEDISABLECONTROL_115 WMIENABLEDISABLECONTROL; struct _WMILIB_CONTEXT { - ULONG GuidCount ; - PWMIGUIDREGINFO GuidList ; - NTSTATUS (*QueryWmiRegInfo)(PDEVICE_OBJECT DeviceObject , PULONG RegFlags , PUNICODE_STRING InstanceName , - PUNICODE_STRING *RegistryPath , PUNICODE_STRING MofResourceName , - PDEVICE_OBJECT *Pdo ) ; - NTSTATUS (*QueryWmiDataBlock)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray , - ULONG BufferAvail , PUCHAR Buffer ) ; - NTSTATUS (*SetWmiDataBlock)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG BufferSize , PUCHAR Buffer ) ; - NTSTATUS (*SetWmiDataItem)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG DataItemId , ULONG BufferSize , - PUCHAR Buffer ) ; - NTSTATUS (*ExecuteWmiMethod)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG MethodId , ULONG InBufferSize , - ULONG OutBufferSize , PUCHAR Buffer ) ; - NTSTATUS (*WmiFunctionControl)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - WMIENABLEDISABLECONTROL Function , BOOLEAN Enable ) ; + ULONG GuidCount; + PWMIGUIDREGINFO GuidList; + NTSTATUS(*QueryWmiRegInfo) + (PDEVICE_OBJECT DeviceObject, PULONG RegFlags, PUNICODE_STRING InstanceName, + PUNICODE_STRING *RegistryPath, PUNICODE_STRING MofResourceName, + PDEVICE_OBJECT *Pdo); + NTSTATUS(*QueryWmiDataBlock) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG InstanceCount, PULONG InstanceLengthArray, ULONG BufferAvail, + PUCHAR Buffer); + NTSTATUS(*SetWmiDataBlock) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG BufferSize, PUCHAR Buffer); + NTSTATUS(*SetWmiDataItem) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG DataItemId, ULONG BufferSize, PUCHAR Buffer); + NTSTATUS(*ExecuteWmiMethod) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, ULONG InstanceIndex, + ULONG MethodId, ULONG InBufferSize, ULONG OutBufferSize, PUCHAR Buffer); + NTSTATUS(*WmiFunctionControl) + (PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG GuidIndex, + WMIENABLEDISABLECONTROL Function, BOOLEAN Enable); }; typedef struct _WMILIB_CONTEXT WMILIB_CONTEXT; typedef struct _WMILIB_CONTEXT *PWMILIB_CONTEXT; enum __anonenum_SYSCTL_IRP_DISPOSITION_116 { - IrpProcessed = 0, - IrpNotCompleted = 1, - IrpNotWmi = 2, - IrpForward = 3 -} ; + IrpProcessed = 0, + IrpNotCompleted = 1, + IrpNotWmi = 2, + IrpForward = 3 +}; typedef enum __anonenum_SYSCTL_IRP_DISPOSITION_116 SYSCTL_IRP_DISPOSITION; typedef enum __anonenum_SYSCTL_IRP_DISPOSITION_116 *PSYSCTL_IRP_DISPOSITION; struct _PARPORT_WMI_ALLOC_FREE_COUNTS { - ULONG PortAllocates ; - ULONG PortFrees ; + ULONG PortAllocates; + ULONG PortFrees; }; typedef struct _PARPORT_WMI_ALLOC_FREE_COUNTS PARPORT_WMI_ALLOC_FREE_COUNTS; struct _DEVICE_EXTENSION { - ULONG ExtensionSignatureBegin ; - ULONG DeviceStateFlags ; - PDEVICE_OBJECT DeviceObject ; - PDRIVER_OBJECT DriverObject ; - PDEVICE_OBJECT PhysicalDeviceObject ; - PDEVICE_OBJECT ParentDeviceObject ; - LONG OpenCloseRefCount ; - LIST_ENTRY RemovalRelationsList ; - LIST_ENTRY WorkQueue ; - LONG WorkQueueCount ; - PARALLEL_PORT_INFORMATION PortInfo ; - PARALLEL_PNP_INFORMATION PnpInfo ; - ULONG AddressSpace ; - ULONG EcpAddressSpace ; - INTERFACE_TYPE InterfaceType ; - ULONG BusNumber ; - BOOLEAN FoundInterrupt ; - KIRQL InterruptLevel ; - ULONG InterruptVector ; - KAFFINITY InterruptAffinity ; - KINTERRUPT_MODE InterruptMode ; - ULONG DmaChannel ; - ULONG DmaPort ; - USHORT DmaWidth ; - LIST_ENTRY IsrList ; - PKINTERRUPT InterruptObject ; - ULONG InterruptRefCount ; - KDPC FreePortDpc ; - BOOLEAN UnMapRegisters ; - BOOLEAN NationalChecked ; - BOOLEAN NationalChipFound ; - BOOLEAN FilterMode ; - UCHAR EcrPortData ; - PARALLEL_PARCHIP_INFO ChipInfo ; - UNICODE_STRING DeviceName ; - UNICODE_STRING SymbolicLinkName ; - DEVICE_POWER_STATE DeviceState ; - SYSTEM_POWER_STATE SystemState ; - IO_REMOVE_LOCK RemoveLock ; - FAST_MUTEX ExtensionFastMutex ; - FAST_MUTEX OpenCloseMutex ; - WMILIB_CONTEXT WmiLibContext ; - PARPORT_WMI_ALLOC_FREE_COUNTS WmiPortAllocFreeCounts ; - BOOLEAN CheckedForGenericEpp ; - BOOLEAN spare[3] ; - ULONG ExtensionSignatureEnd ; + ULONG ExtensionSignatureBegin; + ULONG DeviceStateFlags; + PDEVICE_OBJECT DeviceObject; + PDRIVER_OBJECT DriverObject; + PDEVICE_OBJECT PhysicalDeviceObject; + PDEVICE_OBJECT ParentDeviceObject; + LONG OpenCloseRefCount; + LIST_ENTRY RemovalRelationsList; + LIST_ENTRY WorkQueue; + LONG WorkQueueCount; + PARALLEL_PORT_INFORMATION PortInfo; + PARALLEL_PNP_INFORMATION PnpInfo; + ULONG AddressSpace; + ULONG EcpAddressSpace; + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + BOOLEAN FoundInterrupt; + KIRQL InterruptLevel; + ULONG InterruptVector; + KAFFINITY InterruptAffinity; + KINTERRUPT_MODE InterruptMode; + ULONG DmaChannel; + ULONG DmaPort; + USHORT DmaWidth; + LIST_ENTRY IsrList; + PKINTERRUPT InterruptObject; + ULONG InterruptRefCount; + KDPC FreePortDpc; + BOOLEAN UnMapRegisters; + BOOLEAN NationalChecked; + BOOLEAN NationalChipFound; + BOOLEAN FilterMode; + UCHAR EcrPortData; + PARALLEL_PARCHIP_INFO ChipInfo; + UNICODE_STRING DeviceName; + UNICODE_STRING SymbolicLinkName; + DEVICE_POWER_STATE DeviceState; + SYSTEM_POWER_STATE SystemState; + IO_REMOVE_LOCK RemoveLock; + FAST_MUTEX ExtensionFastMutex; + FAST_MUTEX OpenCloseMutex; + WMILIB_CONTEXT WmiLibContext; + PARPORT_WMI_ALLOC_FREE_COUNTS WmiPortAllocFreeCounts; + BOOLEAN CheckedForGenericEpp; + BOOLEAN spare[3]; + ULONG ExtensionSignatureEnd; }; typedef struct _DEVICE_EXTENSION DEVICE_EXTENSION; typedef struct _DEVICE_EXTENSION *PDEVICE_EXTENSION; struct _SYNCHRONIZED_COUNT_CONTEXT { - PLONG Count ; - LONG NewCount ; + PLONG Count; + LONG NewCount; }; typedef struct _SYNCHRONIZED_COUNT_CONTEXT SYNCHRONIZED_COUNT_CONTEXT; struct _SYNCHRONIZED_LIST_CONTEXT { - PLIST_ENTRY List ; - PLIST_ENTRY NewEntry ; + PLIST_ENTRY List; + PLIST_ENTRY NewEntry; }; typedef struct _SYNCHRONIZED_LIST_CONTEXT SYNCHRONIZED_LIST_CONTEXT; typedef struct _SYNCHRONIZED_LIST_CONTEXT *PSYNCHRONIZED_LIST_CONTEXT; struct _SYNCHRONIZED_DISCONNECT_CONTEXT { - PDEVICE_EXTENSION Extension ; - PPARALLEL_INTERRUPT_SERVICE_ROUTINE IsrInfo ; + PDEVICE_EXTENSION Extension; + PPARALLEL_INTERRUPT_SERVICE_ROUTINE IsrInfo; }; typedef struct _SYNCHRONIZED_DISCONNECT_CONTEXT SYNCHRONIZED_DISCONNECT_CONTEXT; -typedef struct _SYNCHRONIZED_DISCONNECT_CONTEXT *PSYNCHRONIZED_DISCONNECT_CONTEXT; +typedef struct _SYNCHRONIZED_DISCONNECT_CONTEXT + *PSYNCHRONIZED_DISCONNECT_CONTEXT; struct _ISR_LIST_ENTRY { - LIST_ENTRY ListEntry ; - BOOLEAN (*ServiceRoutine)(struct _KINTERRUPT *Interrupt , PVOID ServiceContext ) ; - PVOID ServiceContext ; - void (*DeferredPortCheckRoutine)(PVOID DeferredContext ) ; - PVOID CheckContext ; + LIST_ENTRY ListEntry; + BOOLEAN(*ServiceRoutine) + (struct _KINTERRUPT *Interrupt, PVOID ServiceContext); + PVOID ServiceContext; + void (*DeferredPortCheckRoutine)(PVOID DeferredContext); + PVOID CheckContext; }; typedef struct _ISR_LIST_ENTRY ISR_LIST_ENTRY; typedef struct _ISR_LIST_ENTRY *PISR_LIST_ENTRY; struct _REMOVAL_RELATIONS_LIST_ENTRY { - LIST_ENTRY ListEntry ; - PDEVICE_OBJECT DeviceObject ; - ULONG Flags ; - UNICODE_STRING DeviceName ; + LIST_ENTRY ListEntry; + PDEVICE_OBJECT DeviceObject; + ULONG Flags; + UNICODE_STRING DeviceName; }; typedef struct _REMOVAL_RELATIONS_LIST_ENTRY REMOVAL_RELATIONS_LIST_ENTRY; typedef struct _REMOVAL_RELATIONS_LIST_ENTRY *PREMOVAL_RELATIONS_LIST_ENTRY; -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1661,17 +1695,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1679,17 +1713,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1697,17 +1731,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1715,17 +1749,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1733,17 +1767,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1751,17 +1785,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1769,17 +1803,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1787,17 +1821,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1805,17 +1839,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1823,17 +1857,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1841,17 +1875,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1859,17 +1893,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1877,17 +1911,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1895,17 +1929,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1913,17 +1947,17 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,8) +#pragma pack(push, 8) #pragma pack(pop) struct _KAPC; struct _KDPC; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) -#pragma pack(push,1) +#pragma pack(push, 1) #pragma pack(pop) struct _DRIVER_OBJECT; struct _DEVICE_OBJECT; @@ -1931,1666 +1965,1733 @@ struct _DRIVER_OBJECT; struct _FILE_OBJECT; struct _IRP; struct _SCSI_REQUEST_BLOCK; -#pragma pack(push,4) +#pragma pack(push, 4) #pragma pack(pop) #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -extern void *malloc(unsigned long sz ) ; -extern void *memcpy(void * , void const * , size_t ) ; -extern void *memset(void * , int , size_t ) ; -extern void *memmove(void * , void const * , size_t ) ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; -extern NTSTATUS RtlIntegerToUnicodeString(ULONG Value , - ULONG Base , - PUNICODE_STRING String ) ; -extern NTSTATUS RtlUnicodeStringToInteger(PUNICODE_STRING String , - ULONG Base , - PULONG Value ) ; - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; -extern LONG RtlCompareUnicodeString(PUNICODE_STRING String1 , - PUNICODE_STRING String2 , - BOOLEAN CaseInSensitive ) ; - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; -extern NTSTATUS RtlAppendUnicodeStringToString(PUNICODE_STRING Destination , - PUNICODE_STRING Source ) ; - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; +extern void *memcpy(void *, void const *, size_t); +extern void *memset(void *, int, size_t); +extern void *memmove(void *, void const *, size_t); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +extern NTSTATUS RtlIntegerToUnicodeString(ULONG Value, ULONG Base, + PUNICODE_STRING String); +extern NTSTATUS RtlUnicodeStringToInteger(PUNICODE_STRING String, ULONG Base, + PULONG Value); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +extern LONG RtlCompareUnicodeString(PUNICODE_STRING String1, + PUNICODE_STRING String2, + BOOLEAN CaseInSensitive); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +extern NTSTATUS RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, + PUNICODE_STRING Source); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -extern UCHAR READ_PORT_UCHAR(PUCHAR Port ) ; -extern void WRITE_PORT_UCHAR(PUCHAR Port , UCHAR Value ) ; -extern LONG InterlockedIncrement(PLONG Addend ) ; -extern LONG InterlockedDecrement(PLONG Addend ) ; -extern LONG InterlockedExchange(PLONG Target , - LONG Value ) ; -#pragma warning(disable:4035) +extern UCHAR READ_PORT_UCHAR(PUCHAR Port); +extern void WRITE_PORT_UCHAR(PUCHAR Port, UCHAR Value); +extern LONG InterlockedIncrement(PLONG Addend); +extern LONG InterlockedDecrement(PLONG Addend); +extern LONG InterlockedExchange(PLONG Target, LONG Value); +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -extern void KeInitializeDpc(PRKDPC Dpc , void (*DeferredRoutine)(struct _KDPC *Dpc , - PVOID DeferredContext , - PVOID SystemArgument1 , - PVOID SystemArgument2 ) , - PVOID DeferredContext ) ; -extern BOOLEAN KeInsertQueueDpc(PRKDPC Dpc , PVOID SystemArgument1 , - PVOID SystemArgument2 ) ; -extern BOOLEAN KeSynchronizeExecution(PKINTERRUPT Interrupt , - BOOLEAN (*SynchronizeRoutine)(PVOID SynchronizeContext ) , - PVOID SynchronizeContext ) ; - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; -extern ULONG KeQueryTimeIncrement(void) ; - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; - void ExFreePool(PVOID P ) ; - void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; - void MmUnlockPages(PMDL MemoryDescriptorList ) ; - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; - void MmFreeContiguousMemory(PVOID BaseAddress ) ; - void MmResetDriverPaging(PVOID AddressWithinSection ) ; - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -#pragma warning(disable:4103) -#pragma warning(disable:4103) -extern void IoAcquireCancelSpinLock(PKIRQL Irql ) ; -extern PVOID IoAllocateErrorLogEntry(PVOID IoObject , - UCHAR EntrySize ) ; - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; -extern NTSTATUS IoConnectInterrupt(PKINTERRUPT *InterruptObject , - BOOLEAN (*ServiceRoutine)(struct _KINTERRUPT *Interrupt , - PVOID ServiceContext ) , - PVOID ServiceContext , - PKSPIN_LOCK SpinLock , - ULONG Vector , - KIRQL Irql , KIRQL SynchronizeIrql , - KINTERRUPT_MODE InterruptMode , - BOOLEAN ShareVector , - KAFFINITY ProcessorEnableMask , - BOOLEAN FloatingSave ) ; - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; -extern void IoDisconnectInterrupt(PKINTERRUPT InterruptObject ) ; - void IoFreeIrp(PIRP Irp ) ; - void IoFreeMdl(PMDL Mdl ) ; - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; - void IoReleaseCancelSpinLock(KIRQL Irql ) ; -extern NTSTATUS IoReportResourceUsage(PUNICODE_STRING DriverClassName , - PDRIVER_OBJECT DriverObject , - PCM_RESOURCE_LIST DriverList , - ULONG DriverListSize , - PDEVICE_OBJECT DeviceObject , - PCM_RESOURCE_LIST DeviceList , - ULONG DeviceListSize , - BOOLEAN OverrideConflict , - PBOOLEAN ConflictDetected ) ; - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; -extern void IoInitializeRemoveLockEx(PIO_REMOVE_LOCK Lock , - ULONG AllocateTag , - ULONG MaxLockedMinutes , - ULONG HighWatermark , - ULONG RemlockSize ) ; - NTSTATUS IoAcquireRemoveLockEx(PIO_REMOVE_LOCK RemoveLock , - PVOID Tag , - PCSTR File , - ULONG Line , - ULONG RemlockSize ) ; -extern void IoReleaseRemoveLockEx(PIO_REMOVE_LOCK RemoveLock , - PVOID Tag , - ULONG RemlockSize ) ; -extern void IoReleaseRemoveLockAndWaitEx(PIO_REMOVE_LOCK RemoveLock , - PVOID Tag , - ULONG RemlockSize ) ; -extern void IoWriteErrorLogEntry(PVOID ElEntry ) ; -extern NTSTATUS IoWMIRegistrationControl(PDEVICE_OBJECT DeviceObject , - ULONG Action ) ; -extern NTSTATUS IoOpenDeviceRegistryKey(PDEVICE_OBJECT DeviceObject , - ULONG DevInstKeyType , - ACCESS_MASK DesiredAccess , - PHANDLE DevInstRegKey ) ; - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -extern void KeStallExecutionProcessor(ULONG MicroSeconds ) ; -#pragma warning(disable:4200) -#pragma warning(default:4200) -extern NTSTATUS PoRequestPowerIrp(PDEVICE_OBJECT DeviceObject , - UCHAR MinorFunction , - POWER_STATE PowerState , - void (*CompletionFunction)(PDEVICE_OBJECT DeviceObject , - UCHAR MinorFunction , - POWER_STATE PowerState , - PVOID Context , - PIO_STATUS_BLOCK IoStatus ) , - PVOID Context , - PIRP *Irp ) ; -extern POWER_STATE PoSetPowerState(PDEVICE_OBJECT DeviceObject , - POWER_STATE_TYPE Type , - POWER_STATE State ) ; - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; - void PoStartNextPowerIrp(PIRP Irp ) ; - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; -extern void ObfReferenceObject(PVOID Object ) ; - void ObfDereferenceObject(PVOID Object ) ; - NTSTATUS ZwClose(HANDLE Handle ) ; -extern NTSTATUS ZwQueryValueKey(HANDLE KeyHandle , - PUNICODE_STRING ValueName , - KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass , - PVOID KeyValueInformation , - ULONG Length , - PULONG ResultLength ) ; -extern NTSTATUS ZwSetValueKey(HANDLE KeyHandle , - PUNICODE_STRING ValueName , - ULONG TitleIndex , - ULONG Type , - PVOID Data , - ULONG DataSize ) ; - struct _GUID const GUID_PARALLEL_DEVICE ; - struct _GUID const GUID_PARCLASS_DEVICE ; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +extern void KeInitializeDpc(PRKDPC Dpc, + void (*DeferredRoutine)(struct _KDPC *Dpc, + PVOID DeferredContext, + PVOID SystemArgument1, + PVOID SystemArgument2), + PVOID DeferredContext); +extern BOOLEAN KeInsertQueueDpc(PRKDPC Dpc, PVOID SystemArgument1, + PVOID SystemArgument2); +extern BOOLEAN +KeSynchronizeExecution(PKINTERRUPT Interrupt, + BOOLEAN (*SynchronizeRoutine)(PVOID SynchronizeContext), + PVOID SynchronizeContext); +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +extern ULONG KeQueryTimeIncrement(void); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +void ExFreePool(PVOID P); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +void MmUnlockPages(PMDL MemoryDescriptorList); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmResetDriverPaging(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +extern void IoAcquireCancelSpinLock(PKIRQL Irql); +extern PVOID IoAllocateErrorLogEntry(PVOID IoObject, UCHAR EntrySize); +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +extern NTSTATUS +IoConnectInterrupt(PKINTERRUPT *InterruptObject, + BOOLEAN (*ServiceRoutine)(struct _KINTERRUPT *Interrupt, + PVOID ServiceContext), + PVOID ServiceContext, PKSPIN_LOCK SpinLock, ULONG Vector, + KIRQL Irql, KIRQL SynchronizeIrql, + KINTERRUPT_MODE InterruptMode, BOOLEAN ShareVector, + KAFFINITY ProcessorEnableMask, BOOLEAN FloatingSave); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +extern void IoDisconnectInterrupt(PKINTERRUPT InterruptObject); +void IoFreeIrp(PIRP Irp); +void IoFreeMdl(PMDL Mdl); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +void IoReleaseCancelSpinLock(KIRQL Irql); +extern NTSTATUS +IoReportResourceUsage(PUNICODE_STRING DriverClassName, + PDRIVER_OBJECT DriverObject, PCM_RESOURCE_LIST DriverList, + ULONG DriverListSize, PDEVICE_OBJECT DeviceObject, + PCM_RESOURCE_LIST DeviceList, ULONG DeviceListSize, + BOOLEAN OverrideConflict, PBOOLEAN ConflictDetected); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +extern void IoInitializeRemoveLockEx(PIO_REMOVE_LOCK Lock, ULONG AllocateTag, + ULONG MaxLockedMinutes, + ULONG HighWatermark, ULONG RemlockSize); +NTSTATUS IoAcquireRemoveLockEx(PIO_REMOVE_LOCK RemoveLock, PVOID Tag, + PCSTR File, ULONG Line, ULONG RemlockSize); +extern void IoReleaseRemoveLockEx(PIO_REMOVE_LOCK RemoveLock, PVOID Tag, + ULONG RemlockSize); +extern void IoReleaseRemoveLockAndWaitEx(PIO_REMOVE_LOCK RemoveLock, PVOID Tag, + ULONG RemlockSize); +extern void IoWriteErrorLogEntry(PVOID ElEntry); +extern NTSTATUS IoWMIRegistrationControl(PDEVICE_OBJECT DeviceObject, + ULONG Action); +extern NTSTATUS IoOpenDeviceRegistryKey(PDEVICE_OBJECT DeviceObject, + ULONG DevInstKeyType, + ACCESS_MASK DesiredAccess, + PHANDLE DevInstRegKey); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +extern void KeStallExecutionProcessor(ULONG MicroSeconds); +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +extern NTSTATUS PoRequestPowerIrp( + PDEVICE_OBJECT DeviceObject, UCHAR MinorFunction, POWER_STATE PowerState, + void (*CompletionFunction)(PDEVICE_OBJECT DeviceObject, UCHAR MinorFunction, + POWER_STATE PowerState, PVOID Context, + PIO_STATUS_BLOCK IoStatus), + PVOID Context, PIRP *Irp); +extern POWER_STATE PoSetPowerState(PDEVICE_OBJECT DeviceObject, + POWER_STATE_TYPE Type, POWER_STATE State); +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +extern void ObfReferenceObject(PVOID Object); +void ObfDereferenceObject(PVOID Object); +NTSTATUS ZwClose(HANDLE Handle); +extern NTSTATUS +ZwQueryValueKey(HANDLE KeyHandle, PUNICODE_STRING ValueName, + KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, + PVOID KeyValueInformation, ULONG Length, PULONG ResultLength); +extern NTSTATUS ZwSetValueKey(HANDLE KeyHandle, PUNICODE_STRING ValueName, + ULONG TitleIndex, ULONG Type, PVOID Data, + ULONG DataSize); +struct _GUID const GUID_PARALLEL_DEVICE; +struct _GUID const GUID_PARCLASS_DEVICE; #pragma once -extern NTSTATUS WmiCompleteRequest(PDEVICE_OBJECT DeviceObject , PIRP Irp , NTSTATUS Status , - ULONG BufferUsed , CCHAR PriorityBoost ) ; -NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo , PDEVICE_OBJECT DeviceObject , - PIRP Irp , PSYSCTL_IRP_DISPOSITION IrpDisposition ) ; -void PptCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) ; -ULONG PptDebugLevel ; -ULONG PptBreakOn ; -UNICODE_STRING RegistryPath ; -UCHAR PptDot3Retries ; -union _LARGE_INTEGER const PhysicalZero ; -LONG PortInfoReferenceCount ; -PFAST_MUTEX PortInfoMutex ; -int s ; -int UNLOADED ; -int NP ; -int DC ; -int SKIP1 ; -int SKIP2 ; -int MPR1 ; -int MPR3 ; -int IPC ; -int pended ; -NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ; -int compRegistered ; -int lowerDriverReturn ; -int setEventCalled ; -int customIrp ; -int myStatus ; -int routine ; -void errorFn(void) -{ - - { - ERROR: assert(0); - goto ERROR; -} -} -NTSTATUS PptWmiInitWmi(PDEVICE_OBJECT DeviceObject ) ; -NTSTATUS PptDispatchSystemControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void PptPnpInitDispatchFunctionTable(void) ; -NTSTATUS PptPnpAddDevice(PDRIVER_OBJECT pDriverObject , PDEVICE_OBJECT pPhysicalDeviceObject ) ; -NTSTATUS PptDispatchPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptFailRequest(PIRP Irp , NTSTATUS Status ) ; -NTSTATUS PptDispatchPreProcessIrp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptDispatchPostProcessIrp(void) ; -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING pRegistryPath ) ; -void PptUnload(PDRIVER_OBJECT DriverObject ) ; -NTSTATUS PptSynchCompletionRoutine(PDEVICE_OBJECT DeviceObject , PIRP Irp , PKEVENT Event ) ; -void PptLogError(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT DeviceObject , PHYSICAL_ADDRESS P1 , - PHYSICAL_ADDRESS P2 , ULONG SequenceNumber , UCHAR MajorFunctionCode , - UCHAR RetryCount , ULONG UniqueErrorValue , NTSTATUS FinalStatus , - NTSTATUS SpecificIOStatus ) ; -NTSTATUS PptConnectInterrupt(PDEVICE_EXTENSION Extension ) ; -void PptDisconnectInterrupt(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptDispatchCreate(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptDispatchClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -BOOLEAN PptSynchronizedIncrement(PVOID SyncContext ) ; -BOOLEAN PptSynchronizedDecrement(PVOID SyncContext ) ; -BOOLEAN PptSynchronizedRead(PVOID SyncContext ) ; -BOOLEAN PptSynchronizedQueue(PVOID Context ) ; -BOOLEAN PptSynchronizedDisconnect(PVOID Context ) ; -void PptCancelRoutine(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void PptFreePortDpc(PKDPC Dpc , PVOID Extension , PVOID SystemArgument1 , PVOID SystemArgument2 ) ; -BOOLEAN PptTryAllocatePortAtInterruptLevel(PVOID Context ) ; -void PptFreePortFromInterruptLevel(PVOID Context ) ; -BOOLEAN PptInterruptService(PKINTERRUPT Interrupt , PVOID Extension ) ; -BOOLEAN PptTryAllocatePort(PVOID Extension ) ; -BOOLEAN PptTraversePortCheckList(PVOID Extension ) ; -void PptFreePort(PVOID Extension ) ; -ULONG PptQueryNumWaiters(PVOID Extension ) ; -NTSTATUS PptDispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptDispatchCleanup(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -BOOLEAN PptIsNecR98Machine(void) ; -NTSTATUS PptDispatchPower(PDEVICE_OBJECT pDeviceObject , PIRP pIrp ) ; -void PptRegInitDriverSettings(PUNICODE_STRING RegistryPath___0 ) ; -PWSTR PptGetPortNameFromPhysicalDeviceObject(PDEVICE_OBJECT PhysicalDeviceObject ) ; -PVOID PptSetCancelRoutine(PIRP Irp , void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , - struct _IRP *Irp ) ) ; -NTSTATUS PptAcquireRemoveLockOrFailIrp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -void PptDebugDumpPnpIrpInfo(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptAcquireRemoveLock(PIO_REMOVE_LOCK RemoveLock , PVOID Tag ) ; -void PptReleaseRemoveLock(PIO_REMOVE_LOCK RemoveLock , PVOID Tag ) ; -void PptReleaseRemoveLockAndWait(PIO_REMOVE_LOCK RemoveLock , PVOID Tag ) ; -void PptDebugDumpResourceList(PIO_RESOURCE_LIST ResourceList ) ; -void PptDebugDumpResourceRequirementsList(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) ; -NTSTATUS PptDetectChipFilter(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptDetectPortType(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptSetChipMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) ; -NTSTATUS PptClearChipMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) ; -ULONG PptInitiate1284_3(PVOID Extension ) ; -NTSTATUS PptTrySelectDevice(PVOID Context , PVOID TrySelectCommand ) ; -NTSTATUS PptDeselectDevice(PVOID Context , PVOID DeselectCommand ) ; -ULONG Ppt1284_3AssignAddress(PDEVICE_EXTENSION DeviceExtension ) ; -BOOLEAN PptSend1284_3Command(PDEVICE_EXTENSION DeviceExtension , UCHAR Command ) ; -NTSTATUS PptTrySelectLegacyZip(PVOID Context , PVOID TrySelectCommand ) ; -NTSTATUS PptDeselectLegacyZip(PVOID Context , PVOID DeselectCommand ) ; -void PptDumpRemovalRelationsList(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptRegGetDeviceParameterDword(PDEVICE_OBJECT Pdo , PWSTR ParameterName , - PULONG ParameterValue ) ; -NTSTATUS PptRegSetDeviceParameterDword(PDEVICE_OBJECT Pdo , PWSTR ParameterName , - PULONG ParameterValue ) ; -NTSTATUS PptBuildParallelPortDeviceName(ULONG Number , PUNICODE_STRING DeviceName ) ; -NTSTATUS PptInitializeDeviceExtension(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject , - PDEVICE_OBJECT DeviceObject , PUNICODE_STRING UniNameString , - PWSTR PortName , ULONG PortNumber ) ; -NTSTATUS PptGetPortNumberFromLptName(PWSTR PortName , PULONG PortNumber ) ; -PDEVICE_OBJECT PptBuildDeviceObject(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) ; -void PptDetectEppPort(PDEVICE_EXTENSION Extension ) ; -void PptCleanRemovalRelationsList(PDEVICE_EXTENSION Extension ) ; -BOOLEAN CheckPort(PUCHAR wPortAddr , UCHAR bMask , UCHAR bValue , USHORT usTimeDelay ) ; -NTSTATUS PptDispatchCleanup(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - KIRQL cancelIrql ; - - { - extension = DeviceObject->DeviceExtension; - { - } - if (extension->DeviceStateFlags & 4096UL) { - goto targetExit; - } else { - - } - { - IoAcquireCancelSpinLock(& cancelIrql); -/* IoReleaseCancelSpinLock(cancelIrql); */ /* INLINED */ - } - targetExit: - { - myStatus = 0L; - Irp->IoStatus.__annonCompField4.Status = 0L; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); - } - return (0L); -} +extern NTSTATUS WmiCompleteRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp, + NTSTATUS Status, ULONG BufferUsed, + CCHAR PriorityBoost); +NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo, + PDEVICE_OBJECT DeviceObject, PIRP Irp, + PSYSCTL_IRP_DISPOSITION IrpDisposition); +void PptCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +ULONG PptDebugLevel; +ULONG PptBreakOn; +UNICODE_STRING RegistryPath; +UCHAR PptDot3Retries; +union _LARGE_INTEGER const PhysicalZero; +LONG PortInfoReferenceCount; +PFAST_MUTEX PortInfoMutex; +int s; +int UNLOADED; +int NP; +int DC; +int SKIP1; +int SKIP2; +int MPR1; +int MPR3; +int IPC; +int pended; +NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context); +int compRegistered; +int lowerDriverReturn; +int setEventCalled; +int customIrp; +int myStatus; +int routine; +void errorFn(void) { + + { + ERROR: + assert(0); + goto ERROR; + } +} +NTSTATUS PptWmiInitWmi(PDEVICE_OBJECT DeviceObject); +NTSTATUS PptDispatchSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PptPnpInitDispatchFunctionTable(void); +NTSTATUS PptPnpAddDevice(PDRIVER_OBJECT pDriverObject, + PDEVICE_OBJECT pPhysicalDeviceObject); +NTSTATUS PptDispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptFailRequest(PIRP Irp, NTSTATUS Status); +NTSTATUS PptDispatchPreProcessIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptDispatchPostProcessIrp(void); +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, + PUNICODE_STRING pRegistryPath); +void PptUnload(PDRIVER_OBJECT DriverObject); +NTSTATUS PptSynchCompletionRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PKEVENT Event); +void PptLogError(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT DeviceObject, + PHYSICAL_ADDRESS P1, PHYSICAL_ADDRESS P2, ULONG SequenceNumber, + UCHAR MajorFunctionCode, UCHAR RetryCount, + ULONG UniqueErrorValue, NTSTATUS FinalStatus, + NTSTATUS SpecificIOStatus); +NTSTATUS PptConnectInterrupt(PDEVICE_EXTENSION Extension); +void PptDisconnectInterrupt(PDEVICE_EXTENSION Extension); +NTSTATUS PptDispatchCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptDispatchClose(PDEVICE_OBJECT DeviceObject, PIRP Irp); +BOOLEAN PptSynchronizedIncrement(PVOID SyncContext); +BOOLEAN PptSynchronizedDecrement(PVOID SyncContext); +BOOLEAN PptSynchronizedRead(PVOID SyncContext); +BOOLEAN PptSynchronizedQueue(PVOID Context); +BOOLEAN PptSynchronizedDisconnect(PVOID Context); +void PptCancelRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PptFreePortDpc(PKDPC Dpc, PVOID Extension, PVOID SystemArgument1, + PVOID SystemArgument2); +BOOLEAN PptTryAllocatePortAtInterruptLevel(PVOID Context); +void PptFreePortFromInterruptLevel(PVOID Context); +BOOLEAN PptInterruptService(PKINTERRUPT Interrupt, PVOID Extension); +BOOLEAN PptTryAllocatePort(PVOID Extension); +BOOLEAN PptTraversePortCheckList(PVOID Extension); +void PptFreePort(PVOID Extension); +ULONG PptQueryNumWaiters(PVOID Extension); +NTSTATUS PptDispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject, + PIRP Irp); +NTSTATUS PptDispatchCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp); +BOOLEAN PptIsNecR98Machine(void); +NTSTATUS PptDispatchPower(PDEVICE_OBJECT pDeviceObject, PIRP pIrp); +void PptRegInitDriverSettings(PUNICODE_STRING RegistryPath___0); +PWSTR PptGetPortNameFromPhysicalDeviceObject( + PDEVICE_OBJECT PhysicalDeviceObject); +PVOID PptSetCancelRoutine( + PIRP Irp, void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp)); +NTSTATUS PptAcquireRemoveLockOrFailIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp); +void PptDebugDumpPnpIrpInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptAcquireRemoveLock(PIO_REMOVE_LOCK RemoveLock, PVOID Tag); +void PptReleaseRemoveLock(PIO_REMOVE_LOCK RemoveLock, PVOID Tag); +void PptReleaseRemoveLockAndWait(PIO_REMOVE_LOCK RemoveLock, PVOID Tag); +void PptDebugDumpResourceList(PIO_RESOURCE_LIST ResourceList); +void PptDebugDumpResourceRequirementsList( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList); +NTSTATUS PptDetectChipFilter(PDEVICE_EXTENSION Extension); +NTSTATUS PptDetectPortType(PDEVICE_EXTENSION Extension); +NTSTATUS PptSetChipMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode); +NTSTATUS PptClearChipMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode); +ULONG PptInitiate1284_3(PVOID Extension); +NTSTATUS PptTrySelectDevice(PVOID Context, PVOID TrySelectCommand); +NTSTATUS PptDeselectDevice(PVOID Context, PVOID DeselectCommand); +ULONG Ppt1284_3AssignAddress(PDEVICE_EXTENSION DeviceExtension); +BOOLEAN PptSend1284_3Command(PDEVICE_EXTENSION DeviceExtension, UCHAR Command); +NTSTATUS PptTrySelectLegacyZip(PVOID Context, PVOID TrySelectCommand); +NTSTATUS PptDeselectLegacyZip(PVOID Context, PVOID DeselectCommand); +void PptDumpRemovalRelationsList(PDEVICE_EXTENSION Extension); +NTSTATUS PptRegGetDeviceParameterDword(PDEVICE_OBJECT Pdo, PWSTR ParameterName, + PULONG ParameterValue); +NTSTATUS PptRegSetDeviceParameterDword(PDEVICE_OBJECT Pdo, PWSTR ParameterName, + PULONG ParameterValue); +NTSTATUS PptBuildParallelPortDeviceName(ULONG Number, + PUNICODE_STRING DeviceName); +NTSTATUS PptInitializeDeviceExtension(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject, + PDEVICE_OBJECT DeviceObject, + PUNICODE_STRING UniNameString, + PWSTR PortName, ULONG PortNumber); +NTSTATUS PptGetPortNumberFromLptName(PWSTR PortName, PULONG PortNumber); +PDEVICE_OBJECT PptBuildDeviceObject(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject); +void PptDetectEppPort(PDEVICE_EXTENSION Extension); +void PptCleanRemovalRelationsList(PDEVICE_EXTENSION Extension); +BOOLEAN CheckPort(PUCHAR wPortAddr, UCHAR bMask, UCHAR bValue, + USHORT usTimeDelay); +NTSTATUS PptDispatchCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + KIRQL cancelIrql; + + { + extension = DeviceObject->DeviceExtension; + {} + if (extension->DeviceStateFlags & 4096UL) { + goto targetExit; + } else { + } + { + IoAcquireCancelSpinLock(&cancelIrql); + /* IoReleaseCancelSpinLock(cancelIrql); */ /* INLINED */ + } + targetExit : { + myStatus = 0L; + Irp->IoStatus.__annonCompField4.Status = 0L; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); + } + return (0L); + } } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -PCHAR PnpIrpName[25] = - { "IRP_MN_START_DEVICE 0x00", "IRP_MN_QUERY_REMOVE_DEVICE 0x01", "IRP_MN_REMOVE_DEVICE 0x02", "IRP_MN_CANCEL_REMOVE_DEVICE 0x03", - "IRP_MN_STOP_DEVICE 0x04", "IRP_MN_QUERY_STOP_DEVICE 0x05", "IRP_MN_CANCEL_STOP_DEVICE 0x06", "IRP_MN_QUERY_DEVICE_RELATIONS 0x07", - "IRP_MN_QUERY_INTERFACE 0x08", "IRP_MN_QUERY_CAPABILITIES 0x09", "IRP_MN_QUERY_RESOURCES 0x0A", "IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B", - "IRP_MN_QUERY_DEVICE_TEXT 0x0C", "IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D", " unused MinorFunction 0x0E", "IRP_MN_READ_CONFIG 0x0F", - "IRP_MN_WRITE_CONFIG 0x10", "IRP_MN_EJECT 0x11", "IRP_MN_SET_LOCK 0x12", "IRP_MN_QUERY_ID 0x13", - "IRP_MN_QUERY_PNP_DEVICE_STATE 0x14", "IRP_MN_QUERY_BUS_INFORMATION 0x15", "IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16", "IRP_MN_SURPRISE_REMOVAL 0x17", - "IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18"}; -void PptDebugDumpPnpIrpInfo(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - PIO_STACK_LOCATION irpStack ; - PCHAR irpName ; - - { - extension = DeviceObject->DeviceExtension; - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - if ((int )irpStack->MinorFunction <= 24) { - irpName = PnpIrpName[irpStack->MinorFunction]; - } else { - { - } - irpName = " - MinorFunction > 0x18 - don\'t handle "; - } - { +PCHAR PnpIrpName[25] = {"IRP_MN_START_DEVICE 0x00", + "IRP_MN_QUERY_REMOVE_DEVICE 0x01", + "IRP_MN_REMOVE_DEVICE 0x02", + "IRP_MN_CANCEL_REMOVE_DEVICE 0x03", + "IRP_MN_STOP_DEVICE 0x04", + "IRP_MN_QUERY_STOP_DEVICE 0x05", + "IRP_MN_CANCEL_STOP_DEVICE 0x06", + "IRP_MN_QUERY_DEVICE_RELATIONS 0x07", + "IRP_MN_QUERY_INTERFACE 0x08", + "IRP_MN_QUERY_CAPABILITIES 0x09", + "IRP_MN_QUERY_RESOURCES 0x0A", + "IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B", + "IRP_MN_QUERY_DEVICE_TEXT 0x0C", + "IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D", + " unused MinorFunction 0x0E", + "IRP_MN_READ_CONFIG 0x0F", + "IRP_MN_WRITE_CONFIG 0x10", + "IRP_MN_EJECT 0x11", + "IRP_MN_SET_LOCK 0x12", + "IRP_MN_QUERY_ID 0x13", + "IRP_MN_QUERY_PNP_DEVICE_STATE 0x14", + "IRP_MN_QUERY_BUS_INFORMATION 0x15", + "IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16", + "IRP_MN_SURPRISE_REMOVAL 0x17", + "IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18"}; +void PptDebugDumpPnpIrpInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + PIO_STACK_LOCATION irpStack; + PCHAR irpName; + + { + extension = DeviceObject->DeviceExtension; + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + if ((int)irpStack->MinorFunction <= 24) { + irpName = PnpIrpName[irpStack->MinorFunction]; + } else { + {} + irpName = " - MinorFunction > 0x18 - don\'t handle "; + } + {} + return; } - return; -} } -NTSTATUS PptAcquireRemoveLock(PIO_REMOVE_LOCK RemoveLock , PVOID Tag ) -{ NTSTATUS status ; +NTSTATUS PptAcquireRemoveLock(PIO_REMOVE_LOCK RemoveLock, PVOID Tag) { + NTSTATUS status; { - { - status = IoAcquireRemoveLockEx(RemoveLock, Tag, "debug.c", 69, sizeof(IO_REMOVE_LOCK )); + { + status = IoAcquireRemoveLockEx(RemoveLock, Tag, "debug.c", 69, + sizeof(IO_REMOVE_LOCK)); + } + return (status); } - return (status); } -} -void PptReleaseRemoveLock(PIO_REMOVE_LOCK RemoveLock , PVOID Tag ) -{ +void PptReleaseRemoveLock(PIO_REMOVE_LOCK RemoveLock, PVOID Tag) { { - { - IoReleaseRemoveLockEx(RemoveLock, Tag, sizeof(IO_REMOVE_LOCK )); + { IoReleaseRemoveLockEx(RemoveLock, Tag, sizeof(IO_REMOVE_LOCK)); } + return; } - return; -} } -void PptReleaseRemoveLockAndWait(PIO_REMOVE_LOCK RemoveLock , PVOID Tag ) -{ +void PptReleaseRemoveLockAndWait(PIO_REMOVE_LOCK RemoveLock, PVOID Tag) { { - { - IoReleaseRemoveLockAndWaitEx(RemoveLock, Tag, sizeof(IO_REMOVE_LOCK )); + { IoReleaseRemoveLockAndWaitEx(RemoveLock, Tag, sizeof(IO_REMOVE_LOCK)); } + return; } - return; } -} -void PptDebugDumpResourceList(PIO_RESOURCE_LIST ResourceList ) -{ ULONG count ; - ULONG i ; - PIO_RESOURCE_DESCRIPTOR curDesc ; +void PptDebugDumpResourceList(PIO_RESOURCE_LIST ResourceList) { + ULONG count; + ULONG i; + PIO_RESOURCE_DESCRIPTOR curDesc; { - count = ResourceList->Count; - { - } - i = 0; - curDesc = ResourceList->Descriptors; - { - while (1) { - while_4_continue: /* CIL Label */ ; - if (i < count) { + count = ResourceList->Count; + {} + i = 0; + curDesc = ResourceList->Descriptors; + { + while (1) { + while_4_continue: /* CIL Label */; + if (i < count) { - } else { - goto while_4_break; - } - if (curDesc->Type == 2) { - goto switch_5_2; - } else { - if (curDesc->Type == 4) { - goto switch_5_4; - } else { - if (curDesc->Type == 1) { - goto switch_5_1; } else { - if (curDesc->Type == 0) { - goto switch_5_0; + goto while_4_break; + } + if (curDesc->Type == 2) { + goto switch_5_2; + } else { + if (curDesc->Type == 4) { + goto switch_5_4; } else { - { - goto switch_5_default; - if (0) { - switch_5_2: /* CIL Label */ ; - { - } - goto switch_5_break; - switch_5_4: /* CIL Label */ ; - { - } - goto switch_5_break; - switch_5_1: /* CIL Label */ ; - { - } - goto switch_5_break; - switch_5_0: /* CIL Label */ ; - { - } - goto switch_5_break; - switch_5_default: /* CIL Label */ ; - { - } + if (curDesc->Type == 1) { + goto switch_5_1; } else { - switch_5_break: /* CIL Label */ ; - } + if (curDesc->Type == 0) { + goto switch_5_0; + } else { + { + goto switch_5_default; + if (0) { + switch_5_2: /* CIL Label */; + {} + goto switch_5_break; + switch_5_4: /* CIL Label */; + {} + goto switch_5_break; + switch_5_1: /* CIL Label */; + {} + goto switch_5_break; + switch_5_0: /* CIL Label */; + {} + goto switch_5_break; + switch_5_default: /* CIL Label */; + {} + } else { + switch_5_break: /* CIL Label */; + } + } + } } } } + i += 1UL; + curDesc += 1; } + while_4_break: /* CIL Label */; } - i += 1UL; - curDesc += 1; - } - while_4_break: /* CIL Label */ ; + return; } - return; -} } -void PptDebugDumpResourceRequirementsList(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) -{ ULONG listCount ; - PIO_RESOURCE_LIST curList ; - ULONG i ; +void PptDebugDumpResourceRequirementsList( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList) { + ULONG listCount; + PIO_RESOURCE_LIST curList; + ULONG i; { - listCount = ResourceRequirementsList->AlternativeLists; - { - } - i = 0; - curList = ResourceRequirementsList->List; - { - while (1) { - while_12_continue: /* CIL Label */ ; - if (i < listCount) { - - } else { - goto while_12_break; - } - { - } + listCount = ResourceRequirementsList->AlternativeLists; + {} + i = 0; + curList = ResourceRequirementsList->List; { - PptDebugDumpResourceList(curList); - curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); - i += 1UL; + while (1) { + while_12_continue: /* CIL Label */; + if (i < listCount) { + + } else { + goto while_12_break; + } + {} { + PptDebugDumpResourceList(curList); + curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + + curList->Count); + i += 1UL; + } + } + while_12_break: /* CIL Label */; } + return; } - while_12_break: /* CIL Label */ ; - } - return; -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -void PptLogError(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT DeviceObject , PHYSICAL_ADDRESS P1 , - PHYSICAL_ADDRESS P2 , ULONG SequenceNumber , UCHAR MajorFunctionCode , - UCHAR RetryCount , ULONG UniqueErrorValue , NTSTATUS FinalStatus , - NTSTATUS SpecificIOStatus ) -{ PIO_ERROR_LOG_PACKET ErrorLogEntry ; - PVOID ObjectToUse ; - SHORT DumpToAllocate ; - PVOID tmp ; - - { - { - } - if ((unsigned int )((CHAR *)DeviceObject) != (unsigned int )((CHAR *)((void *)0))) { - ObjectToUse = DeviceObject; - } else { - ObjectToUse = DriverObject; - } - DumpToAllocate = 0; - if (P1.__annonCompField1.LowPart != 0UL) { - DumpToAllocate = (short )sizeof(PHYSICAL_ADDRESS ); - } else { - if (P1.__annonCompField1.HighPart != 0L) { - DumpToAllocate = (short )sizeof(PHYSICAL_ADDRESS ); - } else { - +void PptLogError(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT DeviceObject, + PHYSICAL_ADDRESS P1, PHYSICAL_ADDRESS P2, ULONG SequenceNumber, + UCHAR MajorFunctionCode, UCHAR RetryCount, + ULONG UniqueErrorValue, NTSTATUS FinalStatus, + NTSTATUS SpecificIOStatus) { + PIO_ERROR_LOG_PACKET ErrorLogEntry; + PVOID ObjectToUse; + SHORT DumpToAllocate; + PVOID tmp; + + { + {} + if ((unsigned int)((CHAR *)DeviceObject) != + (unsigned int)((CHAR *)((void *)0))) { + ObjectToUse = DeviceObject; + } else { + ObjectToUse = DriverObject; + } + DumpToAllocate = 0; + if (P1.__annonCompField1.LowPart != 0UL) { + DumpToAllocate = (short)sizeof(PHYSICAL_ADDRESS); + } else { + if (P1.__annonCompField1.HighPart != 0L) { + DumpToAllocate = (short)sizeof(PHYSICAL_ADDRESS); + } else { + } } - } - if (P2.__annonCompField1.LowPart != 0UL) { - DumpToAllocate = (int )DumpToAllocate + (int )((short )sizeof(PHYSICAL_ADDRESS )); - } else { - if (P2.__annonCompField1.HighPart != 0L) { - DumpToAllocate = (int )DumpToAllocate + (int )((short )sizeof(PHYSICAL_ADDRESS )); + if (P2.__annonCompField1.LowPart != 0UL) { + DumpToAllocate = + (int)DumpToAllocate + (int)((short)sizeof(PHYSICAL_ADDRESS)); } else { - + if (P2.__annonCompField1.HighPart != 0L) { + DumpToAllocate = + (int)DumpToAllocate + (int)((short)sizeof(PHYSICAL_ADDRESS)); + } else { + } } - } - { - tmp = IoAllocateErrorLogEntry(ObjectToUse, (unsigned char )(sizeof(IO_ERROR_LOG_PACKET ) + (unsigned int )DumpToAllocate)); - ErrorLogEntry = tmp; - } - if (! ErrorLogEntry) { - return; - } else { - - } - ErrorLogEntry->ErrorCode = SpecificIOStatus; - ErrorLogEntry->SequenceNumber = SequenceNumber; - ErrorLogEntry->MajorFunctionCode = MajorFunctionCode; - ErrorLogEntry->RetryCount = RetryCount; - ErrorLogEntry->UniqueErrorValue = UniqueErrorValue; - ErrorLogEntry->FinalStatus = FinalStatus; - ErrorLogEntry->DumpDataSize = DumpToAllocate; - if (DumpToAllocate) { { - memcpy(ErrorLogEntry->DumpData, & P1, sizeof(PHYSICAL_ADDRESS )); + tmp = IoAllocateErrorLogEntry( + ObjectToUse, (unsigned char)(sizeof(IO_ERROR_LOG_PACKET) + + (unsigned int)DumpToAllocate)); + ErrorLogEntry = tmp; } - if ((unsigned int )DumpToAllocate > sizeof(PHYSICAL_ADDRESS )) { - { - memcpy((UCHAR *)(ErrorLogEntry->DumpData) + sizeof(PHYSICAL_ADDRESS ), & P2, - sizeof(PHYSICAL_ADDRESS )); + if (!ErrorLogEntry) { + return; + } else { + } + ErrorLogEntry->ErrorCode = SpecificIOStatus; + ErrorLogEntry->SequenceNumber = SequenceNumber; + ErrorLogEntry->MajorFunctionCode = MajorFunctionCode; + ErrorLogEntry->RetryCount = RetryCount; + ErrorLogEntry->UniqueErrorValue = UniqueErrorValue; + ErrorLogEntry->FinalStatus = FinalStatus; + ErrorLogEntry->DumpDataSize = DumpToAllocate; + if (DumpToAllocate) { + { memcpy(ErrorLogEntry->DumpData, &P1, sizeof(PHYSICAL_ADDRESS)); } + if ((unsigned int)DumpToAllocate > sizeof(PHYSICAL_ADDRESS)) { + { + memcpy((UCHAR *)(ErrorLogEntry->DumpData) + sizeof(PHYSICAL_ADDRESS), + &P2, sizeof(PHYSICAL_ADDRESS)); + } + } else { } } else { - } - } else { - - } - { - IoWriteErrorLogEntry(ErrorLogEntry); + { IoWriteErrorLogEntry(ErrorLogEntry); } + return; } - return; -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING pRegistryPath ) -{ void *Buffer ; +NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, + PUNICODE_STRING pRegistryPath) { + void *Buffer; { - { - PptRegInitDriverSettings(pRegistryPath); - Buffer = ExAllocatePoolWithTag(1, pRegistryPath->MaximumLength, 1349673296UL); - } - if ((unsigned int )((void *)0) == (unsigned int )Buffer) { { + PptRegInitDriverSettings(pRegistryPath); + Buffer = + ExAllocatePoolWithTag(1, pRegistryPath->MaximumLength, 1349673296UL); + } + if ((unsigned int)((void *)0) == (unsigned int)Buffer) { + {} + return (-1073741670L); + } else { + { + memset(RegistryPath.Buffer, 0, pRegistryPath->MaximumLength); + RegistryPath.Length = pRegistryPath->Length; + RegistryPath.MaximumLength = pRegistryPath->MaximumLength; + memmove(RegistryPath.Buffer, pRegistryPath->Buffer, + pRegistryPath->Length); + } } - return (-1073741670L); - } else { { - memset(RegistryPath.Buffer, 0, pRegistryPath->MaximumLength); - RegistryPath.Length = pRegistryPath->Length; - RegistryPath.MaximumLength = pRegistryPath->MaximumLength; - memmove(RegistryPath.Buffer, pRegistryPath->Buffer, pRegistryPath->Length); + PptPnpInitDispatchFunctionTable(); + DriverObject->MajorFunction[0] = &PptDispatchCreate; + DriverObject->MajorFunction[2] = &PptDispatchClose; + DriverObject->MajorFunction[15] = &PptDispatchInternalDeviceControl; + DriverObject->MajorFunction[18] = &PptDispatchCleanup; + DriverObject->MajorFunction[27] = &PptDispatchPnp; + DriverObject->MajorFunction[22] = &PptDispatchPower; + DriverObject->MajorFunction[23] = &PptDispatchSystemControl; + (DriverObject->DriverExtension)->AddDevice = &PptPnpAddDevice; + DriverObject->DriverUnload = &PptUnload; } + return (0L); } - { - PptPnpInitDispatchFunctionTable(); - DriverObject->MajorFunction[0] = & PptDispatchCreate; - DriverObject->MajorFunction[2] = & PptDispatchClose; - DriverObject->MajorFunction[15] = & PptDispatchInternalDeviceControl; - DriverObject->MajorFunction[18] = & PptDispatchCleanup; - DriverObject->MajorFunction[27] = & PptDispatchPnp; - DriverObject->MajorFunction[22] = & PptDispatchPower; - DriverObject->MajorFunction[23] = & PptDispatchSystemControl; - (DriverObject->DriverExtension)->AddDevice = & PptPnpAddDevice; - DriverObject->DriverUnload = & PptUnload; - } - return (0L); } -} -void PptUnload(PDRIVER_OBJECT DriverObject ) -{ PDEVICE_OBJECT CurrentDevice ; - PDEVICE_EXTENSION Extension ; - PLIST_ENTRY Head ; - PISR_LIST_ENTRY Entry ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; - PCONFIGURATION_INFORMATION tmp ; +void PptUnload(PDRIVER_OBJECT DriverObject) { + PDEVICE_OBJECT CurrentDevice; + PDEVICE_EXTENSION Extension; + PLIST_ENTRY Head; + PISR_LIST_ENTRY Entry; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; + PCONFIGURATION_INFORMATION tmp; { - { - } - CurrentDevice = DriverObject->DeviceObject; - { - while (1) { - while_17_continue: /* CIL Label */ ; - if (CurrentDevice) { - - } else { - goto while_17_break; - } - Extension = CurrentDevice->DeviceExtension; - if (Extension->InterruptRefCount) { - { - PptDisconnectInterrupt(Extension); - } - } else { - - } + {} + CurrentDevice = DriverObject->DeviceObject; { - while (1) { - while_18_continue: /* CIL Label */ ; - if (! ((unsigned int )Extension->IsrList.Flink == (unsigned int )(& Extension->IsrList))) { + while (1) { + while_17_continue: /* CIL Label */; + if (CurrentDevice) { - } else { - goto while_18_break; + } else { + goto while_17_break; + } + Extension = CurrentDevice->DeviceExtension; + if (Extension->InterruptRefCount) { + { PptDisconnectInterrupt(Extension); } + } else { + } + { + while (1) { + while_18_continue: /* CIL Label */; + if (!((unsigned int)Extension->IsrList.Flink == + (unsigned int)(&Extension->IsrList))) { + + } else { + goto while_18_break; + } + { + Head = Extension->IsrList.Flink; + _EX_Flink = (Extension->IsrList.Flink)->Flink; + _EX_Blink = (Extension->IsrList.Flink)->Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + Entry = (ISR_LIST_ENTRY *)((CHAR *)Head - + (unsigned long)(&((ISR_LIST_ENTRY *)0) + ->ListEntry)); + /* ExFreePool(Entry); */ /* INLINED */ + } + } + while_18_break: /* CIL Label */; + } + { + /* ExFreePool(Extension->DeviceName.Buffer); */ /* INLINED */ + /* IoDeleteDevice(CurrentDevice); */ /* INLINED */ + tmp = IoGetConfigurationInformation(); + tmp->ParallelCount -= 1UL; + CurrentDevice = DriverObject->DeviceObject; + } } + while_17_break: /* CIL Label */; + } + if (PortInfoMutex) { { - Head = Extension->IsrList.Flink; - _EX_Flink = (Extension->IsrList.Flink)->Flink; - _EX_Blink = (Extension->IsrList.Flink)->Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - Entry = (ISR_LIST_ENTRY *)((CHAR *)Head - (unsigned long )(& ((ISR_LIST_ENTRY *)0)->ListEntry)); -/* ExFreePool(Entry); */ /* INLINED */ + /* ExFreePool(PortInfoMutex); */ /* INLINED */ + PortInfoMutex = (void *)0; } + } else { } - while_18_break: /* CIL Label */ ; - } - { -/* ExFreePool(Extension->DeviceName.Buffer); */ /* INLINED */ -/* IoDeleteDevice(CurrentDevice); */ /* INLINED */ - tmp = IoGetConfigurationInformation(); - tmp->ParallelCount -= 1UL; - CurrentDevice = DriverObject->DeviceObject; - } - } - while_17_break: /* CIL Label */ ; - } - if (PortInfoMutex) { - { -/* ExFreePool(PortInfoMutex); */ /* INLINED */ - PortInfoMutex = (void *)0; + { /* RtlFreeUnicodeString(& RegistryPath); */ /* INLINED */ } - } else { - - } - { -/* RtlFreeUnicodeString(& RegistryPath); */ /* INLINED */ + return; } - return; -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -void PptCleanRemovalRelationsList(PDEVICE_EXTENSION Extension ) -{ PLIST_ENTRY listHead ; - PLIST_ENTRY thisListEntry ; - PREMOVAL_RELATIONS_LIST_ENTRY node ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; +void PptCleanRemovalRelationsList(PDEVICE_EXTENSION Extension) { + PLIST_ENTRY listHead; + PLIST_ENTRY thisListEntry; + PREMOVAL_RELATIONS_LIST_ENTRY node; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; { - { - listHead = & Extension->RemovalRelationsList; - thisListEntry = (void *)0; - node = (void *)0; -/* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - { - while (1) { - while_19_continue: /* CIL Label */ ; - if (! ((unsigned int )listHead->Flink == (unsigned int )listHead)) { - - } else { - goto while_19_break; - } - thisListEntry = listHead->Flink; - _EX_Flink = (listHead->Flink)->Flink; - _EX_Blink = (listHead->Flink)->Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - node = (REMOVAL_RELATIONS_LIST_ENTRY *)((CHAR *)thisListEntry - (unsigned long )(& ((REMOVAL_RELATIONS_LIST_ENTRY *)0)->ListEntry)); { + listHead = &Extension->RemovalRelationsList; + thisListEntry = (void *)0; + node = (void *)0; + /* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ } { -/* RtlFreeUnicodeString(& node->DeviceName); */ /* INLINED */ -/* ExFreePool(node); */ /* INLINED */ - } - } - while_19_break: /* CIL Label */ ; - } - { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - return; -} -} -NTSTATUS PptAddPptRemovalRelation(PDEVICE_EXTENSION Extension , PPARPORT_REMOVAL_RELATIONS PptRemovalRelations ) -{ PREMOVAL_RELATIONS_LIST_ENTRY node ; - PVOID tmp ; - PVOID tmp___0 ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_ListHead ; - - { - { - tmp = ExAllocatePoolWithTag(1, sizeof(REMOVAL_RELATIONS_LIST_ENTRY ), 1349673296UL); - node = tmp; - } - { - } - if (! node) { - { - } - return (-1073741670L); - } else { + while (1) { + while_19_continue: /* CIL Label */; + if (!((unsigned int)listHead->Flink == (unsigned int)listHead)) { - } - { - node->DeviceObject = PptRemovalRelations->DeviceObject; - node->Flags = PptRemovalRelations->Flags; - memset(& node->DeviceName, 0, sizeof(UNICODE_STRING )); - tmp___0 = ExAllocatePoolWithTag(1, (PptRemovalRelations->DeviceName)->MaximumLength, - 1349673296UL); - node->DeviceName.Buffer = tmp___0; - } - if (! node->DeviceName.Buffer) { - { + } else { + goto while_19_break; + } + thisListEntry = listHead->Flink; + _EX_Flink = (listHead->Flink)->Flink; + _EX_Blink = (listHead->Flink)->Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + node = (REMOVAL_RELATIONS_LIST_ENTRY + *)((CHAR *)thisListEntry - + (unsigned long)(&((REMOVAL_RELATIONS_LIST_ENTRY *)0) + ->ListEntry)); + {} { + /* RtlFreeUnicodeString(& node->DeviceName); */ /* INLINED */ + /* ExFreePool(node); */ /* INLINED */ + } + } + while_19_break: /* CIL Label */; } { -/* ExFreePool(node); */ /* INLINED */ + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ } - return (-1073741670L); - } else { - - } - { - node->DeviceName.MaximumLength = (PptRemovalRelations->DeviceName)->MaximumLength; -/* RtlCopyUnicodeString(& node->DeviceName, PptRemovalRelations->DeviceName); */ /* INLINED */ -/* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - _EX_ListHead = & Extension->RemovalRelationsList; - _EX_Blink = _EX_ListHead->Blink; - node->ListEntry.Flink = _EX_ListHead; - node->ListEntry.Blink = _EX_Blink; - _EX_Blink->Flink = & node->ListEntry; - _EX_ListHead->Blink = & node->ListEntry; -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + return; } - return (0L); } -} -NTSTATUS PptRemovePptRemovalRelation(PDEVICE_EXTENSION Extension , PPARPORT_REMOVAL_RELATIONS PptRemovalRelations ) -{ PDEVICE_OBJECT callerDevObj ; - PLIST_ENTRY listHead ; - PDEVICE_OBJECT listDevObj ; - PLIST_ENTRY thisListEntry ; - PLIST_ENTRY firstListEntry ; - BOOLEAN found ; - BOOLEAN done ; - PREMOVAL_RELATIONS_LIST_ENTRY node ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; - PLIST_ENTRY _EX_Blink___0 ; - PLIST_ENTRY _EX_ListHead ; +NTSTATUS +PptAddPptRemovalRelation(PDEVICE_EXTENSION Extension, + PPARPORT_REMOVAL_RELATIONS PptRemovalRelations) { + PREMOVAL_RELATIONS_LIST_ENTRY node; + PVOID tmp; + PVOID tmp___0; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_ListHead; { - callerDevObj = PptRemovalRelations->DeviceObject; - listHead = & Extension->RemovalRelationsList; - listDevObj = (void *)0; - thisListEntry = (void *)0; - firstListEntry = (void *)0; - found = 0; - done = 0; - node = (void *)0; - { - } - { -/* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - if ((unsigned int )listHead->Flink == (unsigned int )listHead) { { + tmp = ExAllocatePoolWithTag(1, sizeof(REMOVAL_RELATIONS_LIST_ENTRY), + 1349673296UL); + node = tmp; } - { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + {} + if (!node) { + {} + return (-1073741670L); + } else { } - return (0L); - } else { { + node->DeviceObject = PptRemovalRelations->DeviceObject; + node->Flags = PptRemovalRelations->Flags; + memset(&node->DeviceName, 0, sizeof(UNICODE_STRING)); + tmp___0 = ExAllocatePoolWithTag( + 1, (PptRemovalRelations->DeviceName)->MaximumLength, 1349673296UL); + node->DeviceName.Buffer = tmp___0; + } + if (!node->DeviceName.Buffer) { + {} { /* ExFreePool(node); */ /* INLINED */ + } + return (-1073741670L); + } else { } { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + node->DeviceName.MaximumLength = + (PptRemovalRelations->DeviceName)->MaximumLength; + /* RtlCopyUnicodeString(& node->DeviceName, PptRemovalRelations->DeviceName); */ /* INLINED */ + /* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + _EX_ListHead = &Extension->RemovalRelationsList; + _EX_Blink = _EX_ListHead->Blink; + node->ListEntry.Flink = _EX_ListHead; + node->ListEntry.Blink = _EX_Blink; + _EX_Blink->Flink = &node->ListEntry; + _EX_ListHead->Blink = &node->ListEntry; + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ } + return (0L); } - { -/* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - { - while (1) { - while_27_continue: /* CIL Label */ ; - if (! done) { - - } else { - goto while_27_break; - } - thisListEntry = listHead->Flink; - _EX_Flink = (listHead->Flink)->Flink; - _EX_Blink = (listHead->Flink)->Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - node = (REMOVAL_RELATIONS_LIST_ENTRY *)((CHAR *)thisListEntry - (unsigned long )(& ((REMOVAL_RELATIONS_LIST_ENTRY *)0)->ListEntry)); - if ((unsigned int )node->DeviceObject == (unsigned int )callerDevObj) { - { +} +NTSTATUS +PptRemovePptRemovalRelation(PDEVICE_EXTENSION Extension, + PPARPORT_REMOVAL_RELATIONS PptRemovalRelations) { + PDEVICE_OBJECT callerDevObj; + PLIST_ENTRY listHead; + PDEVICE_OBJECT listDevObj; + PLIST_ENTRY thisListEntry; + PLIST_ENTRY firstListEntry; + BOOLEAN found; + BOOLEAN done; + PREMOVAL_RELATIONS_LIST_ENTRY node; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; + PLIST_ENTRY _EX_Blink___0; + PLIST_ENTRY _EX_ListHead; + + { + callerDevObj = PptRemovalRelations->DeviceObject; + listHead = &Extension->RemovalRelationsList; + listDevObj = (void *)0; + thisListEntry = (void *)0; + firstListEntry = (void *)0; + found = 0; + done = 0; + node = (void *)0; + {} { + /* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + } + if ((unsigned int)listHead->Flink == (unsigned int)listHead) { + {} { + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED + */ } - found = 1; - done = 1; + return (0L); } else { - if ((unsigned int )firstListEntry == (unsigned int )thisListEntry) { - { + {} { + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED + */ + } + } + { + /* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED + */ + } { + while (1) { + while_27_continue: /* CIL Label */; + if (!done) { + + } else { + goto while_27_break; } - done = 1; - } else { - if (! firstListEntry) { - { + thisListEntry = listHead->Flink; + _EX_Flink = (listHead->Flink)->Flink; + _EX_Blink = (listHead->Flink)->Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + node = (REMOVAL_RELATIONS_LIST_ENTRY + *)((CHAR *)thisListEntry - + (unsigned long)(&((REMOVAL_RELATIONS_LIST_ENTRY *)0) + ->ListEntry)); + if ((unsigned int)node->DeviceObject == (unsigned int)callerDevObj) { + {} + found = 1; + done = 1; + } else { + if ((unsigned int)firstListEntry == (unsigned int)thisListEntry) { + {} + done = 1; + } else { + if (!firstListEntry) { + {} + firstListEntry = thisListEntry; + } else { + } } - firstListEntry = thisListEntry; + } + if (!found) { + _EX_ListHead = listHead; + _EX_Blink___0 = _EX_ListHead->Blink; + node->ListEntry.Flink = _EX_ListHead; + node->ListEntry.Blink = _EX_Blink___0; + _EX_Blink___0->Flink = &node->ListEntry; + _EX_ListHead->Blink = &node->ListEntry; } else { - } } + while_27_break: /* CIL Label */; } - if (! found) { - _EX_ListHead = listHead; - _EX_Blink___0 = _EX_ListHead->Blink; - node->ListEntry.Flink = _EX_ListHead; - node->ListEntry.Blink = _EX_Blink___0; - _EX_Blink___0->Flink = & node->ListEntry; - _EX_ListHead->Blink = & node->ListEntry; - } else { - - } - } - while_27_break: /* CIL Label */ ; - } - { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - if (found) { - { -/* RtlFreeUnicodeString(& node->DeviceName); */ /* INLINED */ -/* ExFreePool(node); */ /* INLINED */ - } - } else { - - } - { - } - return (0L); -} -} -void PptDumpRemovalRelationsList(PDEVICE_EXTENSION Extension ) -{ PLIST_ENTRY listHead ; - PLIST_ENTRY thisListEntry ; - PLIST_ENTRY firstListEntry ; - BOOLEAN done ; - PREMOVAL_RELATIONS_LIST_ENTRY node ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; - PLIST_ENTRY _EX_Flink___0 ; - PLIST_ENTRY _EX_ListHead ; - PLIST_ENTRY _EX_Blink___0 ; - PLIST_ENTRY _EX_ListHead___0 ; - - { - listHead = & Extension->RemovalRelationsList; - thisListEntry = (void *)0; - firstListEntry = (void *)0; - done = 0; - node = (void *)0; - { - } - { -/* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - if ((unsigned int )listHead->Flink == (unsigned int )listHead) { - { - } - { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - return; - } else { { + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ } - } - { - while (1) { - while_35_continue: /* CIL Label */ ; - if (! done) { - - } else { - goto while_35_break; - } - thisListEntry = listHead->Flink; - _EX_Flink = (listHead->Flink)->Flink; - _EX_Blink = (listHead->Flink)->Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - node = (REMOVAL_RELATIONS_LIST_ENTRY *)((CHAR *)thisListEntry - (unsigned long )(& ((REMOVAL_RELATIONS_LIST_ENTRY *)0)->ListEntry)); - if ((unsigned int )firstListEntry == (unsigned int )thisListEntry) { - _EX_ListHead = listHead; - _EX_Flink___0 = _EX_ListHead->Flink; - node->ListEntry.Flink = _EX_Flink___0; - node->ListEntry.Blink = _EX_ListHead; - _EX_Flink___0->Blink = & node->ListEntry; - _EX_ListHead->Flink = & node->ListEntry; - done = 1; - { - } - } else { + if (found) { { + /* RtlFreeUnicodeString(& node->DeviceName); */ /* INLINED */ + /* ExFreePool(node); */ /* INLINED */ } - _EX_ListHead___0 = listHead; - _EX_Blink___0 = _EX_ListHead___0->Blink; - node->ListEntry.Flink = _EX_ListHead___0; - node->ListEntry.Blink = _EX_Blink___0; - _EX_Blink___0->Flink = & node->ListEntry; - _EX_ListHead___0->Blink = & node->ListEntry; - } - if (! firstListEntry) { - firstListEntry = thisListEntry; } else { - } + {} + return (0L); } - while_35_break: /* CIL Label */ ; - } - { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - return; -} -} -void PptDumpPptRemovalRelationsStruct(PPARPORT_REMOVAL_RELATIONS PptRemovalRelations ) -{ - - { - return; } -} -NTSTATUS PptDispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PIO_STACK_LOCATION IrpSp ; - PDEVICE_EXTENSION Extension ; - NTSTATUS Status ; - PPARALLEL_PORT_INFORMATION PortInfo ; - PPARALLEL_PNP_INFORMATION PnpInfo ; - PMORE_PARALLEL_PORT_INFORMATION MorePortInfo ; - KIRQL CancelIrql ; - SYNCHRONIZED_COUNT_CONTEXT SyncContext ; - PPARALLEL_INTERRUPT_SERVICE_ROUTINE IsrInfo ; - PPARALLEL_INTERRUPT_INFORMATION InterruptInfo ; - PISR_LIST_ENTRY IsrListEntry ; - SYNCHRONIZED_LIST_CONTEXT ListContext ; - SYNCHRONIZED_DISCONNECT_CONTEXT DisconnectContext ; - BOOLEAN DisconnectInterrupt ; - NTSTATUS tmp ; - PPARPORT_REMOVAL_RELATIONS removalRelations ; - PPARPORT_REMOVAL_RELATIONS removalRelations___0 ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_ListHead ; - ULONG EnableConnectInterruptIoctl ; - PVOID tmp___0 ; - BOOLEAN tmp___1 ; - PLIST_ENTRY _EX_Blink___0 ; - PLIST_ENTRY _EX_ListHead___0 ; - - { - Extension = DeviceObject->DeviceExtension; - { - } - if (Irp->UserEvent) { - - } else { - - } - if (Extension->DeviceStateFlags & 4096UL) { - { +void PptDumpRemovalRelationsList(PDEVICE_EXTENSION Extension) { + PLIST_ENTRY listHead; + PLIST_ENTRY thisListEntry; + PLIST_ENTRY firstListEntry; + BOOLEAN done; + PREMOVAL_RELATIONS_LIST_ENTRY node; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; + PLIST_ENTRY _EX_Flink___0; + PLIST_ENTRY _EX_ListHead; + PLIST_ENTRY _EX_Blink___0; + PLIST_ENTRY _EX_ListHead___0; + + { + listHead = &Extension->RemovalRelationsList; + thisListEntry = (void *)0; + firstListEntry = (void *)0; + done = 0; + node = (void *)0; + {} { + /* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + } + if ((unsigned int)listHead->Flink == (unsigned int)listHead) { + {} { + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED + */ + } + return; + } else { + {} } { - tmp = PptFailRequest(Irp, -1073741738L); - } - return (tmp); - } else { + while (1) { + while_35_continue: /* CIL Label */; + if (!done) { - } - { - Status = PptAcquireRemoveLockOrFailIrp(DeviceObject, Irp); - } - if (! (Status >= 0L)) { + } else { + goto while_35_break; + } + thisListEntry = listHead->Flink; + _EX_Flink = (listHead->Flink)->Flink; + _EX_Blink = (listHead->Flink)->Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + node = (REMOVAL_RELATIONS_LIST_ENTRY + *)((CHAR *)thisListEntry - + (unsigned long)(&((REMOVAL_RELATIONS_LIST_ENTRY *)0) + ->ListEntry)); + if ((unsigned int)firstListEntry == (unsigned int)thisListEntry) { + _EX_ListHead = listHead; + _EX_Flink___0 = _EX_ListHead->Flink; + node->ListEntry.Flink = _EX_Flink___0; + node->ListEntry.Blink = _EX_ListHead; + _EX_Flink___0->Blink = &node->ListEntry; + _EX_ListHead->Flink = &node->ListEntry; + done = 1; + {} + } else { + {} + _EX_ListHead___0 = listHead; + _EX_Blink___0 = _EX_ListHead___0->Blink; + node->ListEntry.Flink = _EX_ListHead___0; + node->ListEntry.Blink = _EX_Blink___0; + _EX_Blink___0->Flink = &node->ListEntry; + _EX_ListHead___0->Blink = &node->ListEntry; + } + if (!firstListEntry) { + firstListEntry = thisListEntry; + } else { + } + } + while_35_break: /* CIL Label */; + } { + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ } - return (Status); - } else { - + return; } - IrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - Irp->IoStatus.Information = 0; - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (50 << 2))) { - goto switch_41_exp_0; - } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (51 << 2))) { - goto switch_41_exp_1; +} +void PptDumpPptRemovalRelationsStruct( + PPARPORT_REMOVAL_RELATIONS PptRemovalRelations) { + + { return; } +} +NTSTATUS PptDispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject, + PIRP Irp) { + PIO_STACK_LOCATION IrpSp; + PDEVICE_EXTENSION Extension; + NTSTATUS Status; + PPARALLEL_PORT_INFORMATION PortInfo; + PPARALLEL_PNP_INFORMATION PnpInfo; + PMORE_PARALLEL_PORT_INFORMATION MorePortInfo; + KIRQL CancelIrql; + SYNCHRONIZED_COUNT_CONTEXT SyncContext; + PPARALLEL_INTERRUPT_SERVICE_ROUTINE IsrInfo; + PPARALLEL_INTERRUPT_INFORMATION InterruptInfo; + PISR_LIST_ENTRY IsrListEntry; + SYNCHRONIZED_LIST_CONTEXT ListContext; + SYNCHRONIZED_DISCONNECT_CONTEXT DisconnectContext; + BOOLEAN DisconnectInterrupt; + NTSTATUS tmp; + PPARPORT_REMOVAL_RELATIONS removalRelations; + PPARPORT_REMOVAL_RELATIONS removalRelations___0; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_ListHead; + ULONG EnableConnectInterruptIoctl; + PVOID tmp___0; + BOOLEAN tmp___1; + PLIST_ENTRY _EX_Blink___0; + PLIST_ENTRY _EX_ListHead___0; + + { + Extension = DeviceObject->DeviceExtension; + {} + if (Irp->UserEvent) { + + } else { + } + if (Extension->DeviceStateFlags & 4096UL) { + {} { tmp = PptFailRequest(Irp, -1073741738L); } + return (tmp); + } else { + } + { Status = PptAcquireRemoveLockOrFailIrp(DeviceObject, Irp); } + if (!(Status >= 0L)) { + {} + return (Status); + } else { + } + IrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + Irp->IoStatus.Information = 0; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (50 << 2))) { + goto switch_41_exp_0; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (40 << 2))) { - goto switch_41_exp_2; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (51 << 2))) { + goto switch_41_exp_1; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (11 << 2))) { - goto switch_41_exp_3; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (40 << 2))) { + goto switch_41_exp_2; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (12 << 2))) { - goto switch_41_exp_4; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (11 << 2))) { + goto switch_41_exp_3; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (15 << 2))) { - goto switch_41_exp_5; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (12 << 2))) { + goto switch_41_exp_4; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (21 << 2))) { - goto switch_41_exp_6; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (15 << 2))) { + goto switch_41_exp_5; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (17 << 2))) { - goto switch_41_exp_7; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (21 << 2))) { + goto switch_41_exp_6; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (13 << 2))) { - goto switch_41_exp_8; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (17 << 2))) { + goto switch_41_exp_7; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (14 << 2))) { - goto switch_41_exp_9; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (13 << 2))) { + goto switch_41_exp_8; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (19 << 2))) { - goto switch_41_exp_10; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (14 << 2))) { + goto switch_41_exp_9; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (20 << 2))) { - goto switch_41_exp_11; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (19 << 2))) { + goto switch_41_exp_10; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (22 << 2))) { - goto switch_41_exp_12; + if (IrpSp->Parameters.DeviceIoControl.IoControlCode == + ((22 << 16) | (20 << 2))) { + goto switch_41_exp_11; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (23 << 2))) { - goto switch_41_exp_13; + if (IrpSp->Parameters.DeviceIoControl + .IoControlCode == + ((22 << 16) | (22 << 2))) { + goto switch_41_exp_12; } else { - if (IrpSp->Parameters.DeviceIoControl.IoControlCode == ((22 << 16) | (24 << 2))) { - goto switch_41_exp_14; + if (IrpSp->Parameters.DeviceIoControl + .IoControlCode == + ((22 << 16) | (23 << 2))) { + goto switch_41_exp_13; } else { - { - goto switch_41_default; - if (0) { - switch_41_exp_0: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARPORT_REMOVAL_RELATIONS )) { - { - } - Status = -1073741789L; - } else { - { - removalRelations = Irp->AssociatedIrp.SystemBuffer; -/* PptDumpPptRemovalRelationsStruct(removalRelations); */ /* INLINED */ - PptDumpRemovalRelationsList(Extension); - PptAddPptRemovalRelation(Extension, removalRelations); - PptDumpRemovalRelationsList(Extension); - } - { - } - Status = 0L; - } - { - Irp->IoStatus.__annonCompField4.Status = Status; - myStatus = Status; - PptReleaseRemoveLock(& Extension->RemoveLock, Irp); - PptCompleteRequest(Irp, 0); - } - return (Status); - switch_41_exp_1: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARPORT_REMOVAL_RELATIONS )) { - { - } - Status = -1073741789L; - } else { - { - removalRelations___0 = Irp->AssociatedIrp.SystemBuffer; -/* PptDumpPptRemovalRelationsStruct(Irp->AssociatedIrp.SystemBuffer); */ /* INLINED */ - PptDumpRemovalRelationsList(Extension); - PptRemovePptRemovalRelation(Extension, removalRelations___0); - PptDumpRemovalRelationsList(Extension); - } - { - } - Status = 0L; - } - { - Irp->IoStatus.__annonCompField4.Status = Status; - myStatus = Status; - PptReleaseRemoveLock(& Extension->RemoveLock, Irp); - PptCompleteRequest(Irp, 0); - } - return (Status); - switch_41_exp_2: /* CIL Label */ - { - PptFreePort(Extension); - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - PptReleaseRemoveLock(& Extension->RemoveLock, Irp); - PptCompleteRequest(Irp, 0); - } - return (0L); - switch_41_exp_3: /* CIL Label */ + if (IrpSp->Parameters.DeviceIoControl + .IoControlCode == + ((22 << 16) | (24 << 2))) { + goto switch_41_exp_14; + } else { { - IoAcquireCancelSpinLock(& CancelIrql); - } - if (Irp->Cancel) { - Status = -1073741536L; - } else { - SyncContext.Count = & Extension->WorkQueueCount; - if (Extension->InterruptRefCount) { - { - KeSynchronizeExecution(Extension->InterruptObject, - & PptSynchronizedIncrement, - & SyncContext); - } - } else { - { - PptSynchronizedIncrement(& SyncContext); + goto switch_41_default; + if (0) { + switch_41_exp_0: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof( + PARPORT_REMOVAL_RELATIONS)) { + {} + Status = -1073741789L; + } else { + { + removalRelations = + Irp->AssociatedIrp.SystemBuffer; + /* PptDumpPptRemovalRelationsStruct(removalRelations); */ /* INLINED */ + PptDumpRemovalRelationsList( + Extension); + PptAddPptRemovalRelation( + Extension, removalRelations); + PptDumpRemovalRelationsList( + Extension); + } + {} + Status = 0L; } - } - if (SyncContext.NewCount) { { - PptSetCancelRoutine(Irp, & PptCancelRoutine); + Irp->IoStatus.__annonCompField4.Status = + Status; + myStatus = Status; + PptReleaseRemoveLock( + &Extension->RemoveLock, Irp); + PptCompleteRequest(Irp, 0); } - if (pended == 0) { - pended = 1; + return (Status); + switch_41_exp_1: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof( + PARPORT_REMOVAL_RELATIONS)) { + {} + Status = -1073741789L; } else { { - errorFn(); + removalRelations___0 = + Irp->AssociatedIrp.SystemBuffer; + /* PptDumpPptRemovalRelationsStruct(Irp->AssociatedIrp.SystemBuffer); */ /* INLINED */ + PptDumpRemovalRelationsList( + Extension); + PptRemovePptRemovalRelation( + Extension, removalRelations___0); + PptDumpRemovalRelationsList( + Extension); } + {} + Status = 0L; } - (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1; - _EX_ListHead = & Extension->WorkQueue; - _EX_Blink = _EX_ListHead->Blink; - Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink = _EX_ListHead; - Irp->Tail.Overlay.__annonCompField17.ListEntry.Blink = _EX_Blink; - _EX_Blink->Flink = & Irp->Tail.Overlay.__annonCompField17.ListEntry; - _EX_ListHead->Blink = & Irp->Tail.Overlay.__annonCompField17.ListEntry; - Status = 259L; - } else { - Extension->WmiPortAllocFreeCounts.PortAllocates += 1UL; - Status = 0L; - } - } - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - } - goto switch_41_break; - switch_41_exp_4: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(PARALLEL_PORT_INFORMATION )) { - Status = -1073741789L; - } else { - Irp->IoStatus.Information = sizeof(PARALLEL_PORT_INFORMATION ); - PortInfo = Irp->AssociatedIrp.SystemBuffer; - *PortInfo = Extension->PortInfo; - Status = 0L; - } - goto switch_41_break; - switch_41_exp_5: /* CIL Label */ ; - { - } - Status = 0L; - goto switch_41_break; - switch_41_exp_6: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(PARALLEL_PNP_INFORMATION )) { - Status = -1073741789L; - } else { - Irp->IoStatus.Information = sizeof(PARALLEL_PNP_INFORMATION ); - PnpInfo = Irp->AssociatedIrp.SystemBuffer; - *PnpInfo = Extension->PnpInfo; - Status = 0L; - } - goto switch_41_break; - switch_41_exp_7: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(MORE_PARALLEL_PORT_INFORMATION )) { - Status = -1073741789L; - } else { - Irp->IoStatus.Information = sizeof(MORE_PARALLEL_PORT_INFORMATION ); - MorePortInfo = Irp->AssociatedIrp.SystemBuffer; - MorePortInfo->InterfaceType = Extension->InterfaceType; - MorePortInfo->BusNumber = Extension->BusNumber; - MorePortInfo->InterruptLevel = Extension->InterruptLevel; - MorePortInfo->InterruptVector = Extension->InterruptVector; - MorePortInfo->InterruptAffinity = Extension->InterruptAffinity; - MorePortInfo->InterruptMode = Extension->InterruptMode; - Status = 0L; - } - goto switch_41_break; - switch_41_exp_8: /* CIL Label */ ; - { - } - EnableConnectInterruptIoctl = 0; - { - } - if (0UL == EnableConnectInterruptIoctl) { + { + Irp->IoStatus.__annonCompField4.Status = + Status; + myStatus = Status; + PptReleaseRemoveLock( + &Extension->RemoveLock, Irp); + PptCompleteRequest(Irp, 0); + } + return (Status); + switch_41_exp_2 : /* CIL Label */ { + PptFreePort(Extension); + Irp->IoStatus.__annonCompField4.Status = + 0L; + myStatus = 0L; + PptReleaseRemoveLock( + &Extension->RemoveLock, Irp); + PptCompleteRequest(Irp, 0); } - Status = -1073741823L; - goto targetExit; - } else { + return (0L); + switch_41_exp_3 : /* CIL Label */ { + IoAcquireCancelSpinLock(&CancelIrql); } - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARALLEL_INTERRUPT_SERVICE_ROUTINE )) { - Status = -1073741789L; - } else { - if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(PARALLEL_INTERRUPT_INFORMATION )) { - Status = -1073741789L; - } else { - { - IsrInfo = Irp->AssociatedIrp.SystemBuffer; - InterruptInfo = Irp->AssociatedIrp.SystemBuffer; - IoAcquireCancelSpinLock(& CancelIrql); - } - if (Extension->InterruptRefCount) { - { - Extension->InterruptRefCount += 1UL; -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - Status = 0L; - } + if (Irp->Cancel) { + Status = -1073741536L; } else { - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - Status = PptConnectInterrupt(Extension); - } - if (Status >= 0L) { + SyncContext.Count = + &Extension->WorkQueueCount; + if (Extension->InterruptRefCount) { { - IoAcquireCancelSpinLock(& CancelIrql); - Extension->InterruptRefCount += 1UL; -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + KeSynchronizeExecution( + Extension->InterruptObject, + &PptSynchronizedIncrement, + &SyncContext); } } else { - - } - } - if (Status >= 0L) { - { - tmp___0 = ExAllocatePoolWithTag(0, sizeof(ISR_LIST_ENTRY ), - 1349673296UL); - IsrListEntry = tmp___0; + { + PptSynchronizedIncrement( + &SyncContext); + } } - if (IsrListEntry) { + if (SyncContext.NewCount) { { - IsrListEntry->ServiceRoutine = IsrInfo->InterruptServiceRoutine; - IsrListEntry->ServiceContext = IsrInfo->InterruptServiceContext; - IsrListEntry->DeferredPortCheckRoutine = IsrInfo->DeferredPortCheckRoutine; - IsrListEntry->CheckContext = IsrInfo->DeferredPortCheckContext; - ListContext.List = & Extension->IsrList; - ListContext.NewEntry = & IsrListEntry->ListEntry; - KeSynchronizeExecution(Extension->InterruptObject, - & PptSynchronizedQueue, - & ListContext); - InterruptInfo->InterruptObject = Extension->InterruptObject; - InterruptInfo->TryAllocatePortAtInterruptLevel = & PptTryAllocatePortAtInterruptLevel; - InterruptInfo->FreePortFromInterruptLevel = & PptFreePortFromInterruptLevel; - InterruptInfo->Context = Extension; - Irp->IoStatus.Information = sizeof(PARALLEL_INTERRUPT_INFORMATION ); - Status = 0L; + PptSetCancelRoutine( + Irp, &PptCancelRoutine); + } + if (pended == 0) { + pended = 1; + } else { + { errorFn(); } } + (Irp->Tail.Overlay.__annonCompField17 + .__annonCompField16 + .CurrentStackLocation) + ->Control = + (int)(Irp->Tail.Overlay + .__annonCompField17 + .__annonCompField16 + .CurrentStackLocation) + ->Control | + 1; + _EX_ListHead = &Extension->WorkQueue; + _EX_Blink = _EX_ListHead->Blink; + Irp->Tail.Overlay.__annonCompField17 + .ListEntry.Flink = _EX_ListHead; + Irp->Tail.Overlay.__annonCompField17 + .ListEntry.Blink = _EX_Blink; + _EX_Blink->Flink = + &Irp->Tail.Overlay + .__annonCompField17 + .ListEntry; + _EX_ListHead->Blink = + &Irp->Tail.Overlay + .__annonCompField17 + .ListEntry; + Status = 259L; } else { - Status = -1073741670L; + Extension->WmiPortAllocFreeCounts + .PortAllocates += 1UL; + Status = 0L; } - } else { - } - } - } - goto switch_41_break; - switch_41_exp_9: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARALLEL_INTERRUPT_SERVICE_ROUTINE )) { - Status = -1073741789L; - } else { - { - IsrInfo = Irp->AssociatedIrp.SystemBuffer; - IoAcquireCancelSpinLock(& CancelIrql); - } - if (Extension->InterruptRefCount) { { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - DisconnectContext.Extension = Extension; - DisconnectContext.IsrInfo = IsrInfo; - tmp___1 = KeSynchronizeExecution(Extension->InterruptObject, - & PptSynchronizedDisconnect, - & DisconnectContext); + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ } - if (tmp___1) { - { + goto switch_41_break; + switch_41_exp_4: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof( + PARALLEL_PORT_INFORMATION)) { + Status = -1073741789L; + } else { + Irp->IoStatus.Information = + sizeof(PARALLEL_PORT_INFORMATION); + PortInfo = + Irp->AssociatedIrp.SystemBuffer; + *PortInfo = Extension->PortInfo; Status = 0L; - IoAcquireCancelSpinLock(& CancelIrql); - Extension->InterruptRefCount -= 1UL; - } - if (Extension->InterruptRefCount == 0UL) { - DisconnectInterrupt = 1; - } else { - DisconnectInterrupt = 0; - } - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - } + } + goto switch_41_break; + switch_41_exp_5: /* CIL Label */; + {} + Status = 0L; + goto switch_41_break; + switch_41_exp_6: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof( + PARALLEL_PNP_INFORMATION)) { + Status = -1073741789L; } else { - Status = -1073741811L; - DisconnectInterrupt = 0; + Irp->IoStatus.Information = + sizeof(PARALLEL_PNP_INFORMATION); + PnpInfo = + Irp->AssociatedIrp.SystemBuffer; + *PnpInfo = Extension->PnpInfo; + Status = 0L; } - } else { - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - DisconnectInterrupt = 0; - Status = -1073741811L; + goto switch_41_break; + switch_41_exp_7: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof( + MORE_PARALLEL_PORT_INFORMATION)) { + Status = -1073741789L; + } else { + Irp->IoStatus.Information = sizeof( + MORE_PARALLEL_PORT_INFORMATION); + MorePortInfo = + Irp->AssociatedIrp.SystemBuffer; + MorePortInfo->InterfaceType = + Extension->InterfaceType; + MorePortInfo->BusNumber = + Extension->BusNumber; + MorePortInfo->InterruptLevel = + Extension->InterruptLevel; + MorePortInfo->InterruptVector = + Extension->InterruptVector; + MorePortInfo->InterruptAffinity = + Extension->InterruptAffinity; + MorePortInfo->InterruptMode = + Extension->InterruptMode; + Status = 0L; } - } - if (DisconnectInterrupt) { - { - PptDisconnectInterrupt(Extension); + goto switch_41_break; + switch_41_exp_8: /* CIL Label */; + {} + EnableConnectInterruptIoctl = 0; + {} + if (0UL == EnableConnectInterruptIoctl) { + {} + Status = -1073741823L; + goto targetExit; + } else { + {} } - } else { - - } - } - goto switch_41_break; - switch_41_exp_10: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARALLEL_CHIP_MODE )) { - Status = -1073741789L; - } else { - { - } - { - Status = PptSetChipMode(Extension, ((struct _PARALLEL_CHIP_MODE *)Irp->AssociatedIrp.SystemBuffer)->ModeFlags); - } - } - goto switch_41_break; - switch_41_exp_11: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARALLEL_CHIP_MODE )) { - Status = -1073741789L; - } else { - { - } - { - Status = PptClearChipMode(Extension, ((struct _PARALLEL_CHIP_MODE *)Irp->AssociatedIrp.SystemBuffer)->ModeFlags); - } - } - goto switch_41_break; - switch_41_exp_12: /* CIL Label */ ; - { - } - { - Extension->PnpInfo.Ieee1284_3DeviceCount = PptInitiate1284_3(Extension); - Status = 0L; - } - goto switch_41_break; - switch_41_exp_13: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARALLEL_1284_COMMAND )) { - { - } - Status = -1073741789L; - } else { - if (Irp->Cancel) { - Status = -1073741536L; - } else { - { - Status = PptTrySelectDevice(Extension, Irp->AssociatedIrp.SystemBuffer); - IoAcquireCancelSpinLock(& CancelIrql); + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof( + PARALLEL_INTERRUPT_SERVICE_ROUTINE)) { + Status = -1073741789L; + } else { + if (IrpSp->Parameters.DeviceIoControl + .OutputBufferLength < + (ULONG)sizeof( + PARALLEL_INTERRUPT_INFORMATION)) { + Status = -1073741789L; + } else { + { + IsrInfo = + Irp->AssociatedIrp.SystemBuffer; + InterruptInfo = + Irp->AssociatedIrp.SystemBuffer; + IoAcquireCancelSpinLock( + &CancelIrql); + } + if (Extension->InterruptRefCount) { + { + Extension->InterruptRefCount += + 1UL; + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + Status = 0L; + } + } else { + { + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + Status = PptConnectInterrupt( + Extension); + } + if (Status >= 0L) { + { + IoAcquireCancelSpinLock( + &CancelIrql); + Extension->InterruptRefCount += + 1UL; + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } + } else { + } + } + if (Status >= 0L) { + { + tmp___0 = ExAllocatePoolWithTag( + 0, sizeof(ISR_LIST_ENTRY), + 1349673296UL); + IsrListEntry = tmp___0; + } + if (IsrListEntry) { + { + IsrListEntry->ServiceRoutine = + IsrInfo + ->InterruptServiceRoutine; + IsrListEntry->ServiceContext = + IsrInfo + ->InterruptServiceContext; + IsrListEntry + ->DeferredPortCheckRoutine = + IsrInfo + ->DeferredPortCheckRoutine; + IsrListEntry->CheckContext = + IsrInfo + ->DeferredPortCheckContext; + ListContext.List = + &Extension->IsrList; + ListContext.NewEntry = + &IsrListEntry->ListEntry; + KeSynchronizeExecution( + Extension->InterruptObject, + &PptSynchronizedQueue, + &ListContext); + InterruptInfo->InterruptObject = + Extension->InterruptObject; + InterruptInfo + ->TryAllocatePortAtInterruptLevel = + &PptTryAllocatePortAtInterruptLevel; + InterruptInfo + ->FreePortFromInterruptLevel = + &PptFreePortFromInterruptLevel; + InterruptInfo->Context = + Extension; + Irp->IoStatus + .Information = sizeof( + PARALLEL_INTERRUPT_INFORMATION); + Status = 0L; + } + } else { + Status = -1073741670L; + } + } else { + } + } } - if (Status == 259L) { + goto switch_41_break; + switch_41_exp_9: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof( + PARALLEL_INTERRUPT_SERVICE_ROUTINE)) { + Status = -1073741789L; + } else { { - PptSetCancelRoutine(Irp, & PptCancelRoutine); + IsrInfo = + Irp->AssociatedIrp.SystemBuffer; + IoAcquireCancelSpinLock(&CancelIrql); } - if (pended == 0) { - pended = 1; + if (Extension->InterruptRefCount) { + { + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + DisconnectContext.Extension = + Extension; + DisconnectContext.IsrInfo = IsrInfo; + tmp___1 = KeSynchronizeExecution( + Extension->InterruptObject, + &PptSynchronizedDisconnect, + &DisconnectContext); + } + if (tmp___1) { + { + Status = 0L; + IoAcquireCancelSpinLock( + &CancelIrql); + Extension->InterruptRefCount -= + 1UL; + } + if (Extension->InterruptRefCount == + 0UL) { + DisconnectInterrupt = 1; + } else { + DisconnectInterrupt = 0; + } + { + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } + } else { + Status = -1073741811L; + DisconnectInterrupt = 0; + } } else { { - errorFn(); + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + DisconnectInterrupt = 0; + Status = -1073741811L; } } - (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1; - _EX_ListHead___0 = & Extension->WorkQueue; - _EX_Blink___0 = _EX_ListHead___0->Blink; - Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink = _EX_ListHead___0; - Irp->Tail.Overlay.__annonCompField17.ListEntry.Blink = _EX_Blink___0; - _EX_Blink___0->Flink = & Irp->Tail.Overlay.__annonCompField17.ListEntry; - _EX_ListHead___0->Blink = & Irp->Tail.Overlay.__annonCompField17.ListEntry; - { + if (DisconnectInterrupt) { + { PptDisconnectInterrupt(Extension); } + } else { } + } + goto switch_41_break; + switch_41_exp_10: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(PARALLEL_CHIP_MODE)) { + Status = -1073741789L; } else { - + {} { + Status = PptSetChipMode( + Extension, + ((struct _PARALLEL_CHIP_MODE *)Irp + ->AssociatedIrp.SystemBuffer) + ->ModeFlags); + } } - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + goto switch_41_break; + switch_41_exp_11: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof(PARALLEL_CHIP_MODE)) { + Status = -1073741789L; + } else { + {} { + Status = PptClearChipMode( + Extension, + ((struct _PARALLEL_CHIP_MODE *)Irp + ->AssociatedIrp.SystemBuffer) + ->ModeFlags); + } } + goto switch_41_break; + switch_41_exp_12: /* CIL Label */; + {} { + Extension->PnpInfo + .Ieee1284_3DeviceCount = + PptInitiate1284_3(Extension); + Status = 0L; + } + goto switch_41_break; + switch_41_exp_13: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof( + PARALLEL_1284_COMMAND)) { + {} + Status = -1073741789L; + } else { + if (Irp->Cancel) { + Status = -1073741536L; + } else { + { + Status = PptTrySelectDevice( + Extension, + Irp->AssociatedIrp + .SystemBuffer); + IoAcquireCancelSpinLock( + &CancelIrql); + } + if (Status == 259L) { + { + PptSetCancelRoutine( + Irp, &PptCancelRoutine); + } + if (pended == 0) { + pended = 1; + } else { + { errorFn(); } + } + (Irp->Tail.Overlay + .__annonCompField17 + .__annonCompField16 + .CurrentStackLocation) + ->Control = + (int)(Irp->Tail.Overlay + .__annonCompField17 + .__annonCompField16 + .CurrentStackLocation) + ->Control | + 1; + _EX_ListHead___0 = + &Extension->WorkQueue; + _EX_Blink___0 = + _EX_ListHead___0->Blink; + Irp->Tail.Overlay.__annonCompField17 + .ListEntry.Flink = + _EX_ListHead___0; + Irp->Tail.Overlay.__annonCompField17 + .ListEntry.Blink = + _EX_Blink___0; + _EX_Blink___0->Flink = + &Irp->Tail.Overlay + .__annonCompField17 + .ListEntry; + _EX_ListHead___0->Blink = + &Irp->Tail.Overlay + .__annonCompField17 + .ListEntry; + {} + } else { + } + { + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } + } + } + goto switch_41_break; + switch_41_exp_14: /* CIL Label */; + {} + if (IrpSp->Parameters.DeviceIoControl + .InputBufferLength < + (ULONG)sizeof( + PARALLEL_1284_COMMAND)) { + {} + Status = -1073741789L; + } else { + { + Status = PptDeselectDevice( + Extension, + Irp->AssociatedIrp.SystemBuffer); + } + } + goto switch_41_break; + switch_41_default: /* CIL Label */; + {} + Status = -1073741811L; + goto switch_41_break; + } else { + switch_41_break: /* CIL Label */; } } - goto switch_41_break; - switch_41_exp_14: /* CIL Label */ ; - { - } - if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(PARALLEL_1284_COMMAND )) { - { - } - Status = -1073741789L; - } else { - { - Status = PptDeselectDevice(Extension, Irp->AssociatedIrp.SystemBuffer); - } - } - goto switch_41_break; - switch_41_default: /* CIL Label */ ; - { - } - Status = -1073741811L; - goto switch_41_break; - } else { - switch_41_break: /* CIL Label */ ; - } } } } @@ -3606,3039 +3707,2752 @@ NTSTATUS PptDispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp } } } - } - targetExit: - if (Status != 259L) { - { - Irp->IoStatus.__annonCompField4.Status = Status; - myStatus = Status; - PptReleaseRemoveLock(& Extension->RemoveLock, Irp); - PptCompleteRequest(Irp, 0); + targetExit: + if (Status != 259L) { + { + Irp->IoStatus.__annonCompField4.Status = Status; + myStatus = Status; + PptReleaseRemoveLock(&Extension->RemoveLock, Irp); + PptCompleteRequest(Irp, 0); + } + } else { } - } else { - + return (Status); } - return (Status); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -BOOLEAN PptIsNecR98Machine(void) -{ UNICODE_STRING Path ; - RTL_QUERY_REGISTRY_TABLE ParamTable[2] ; - NTSTATUS Status ; - UNICODE_STRING identifierString ; - UNICODE_STRING necR98Identifier ; - UNICODE_STRING necR98JIdentifier ; - PVOID tmp ; - LONG tmp___0 ; - LONG tmp___1 ; - - { - { - identifierString.Length = 0; - identifierString.MaximumLength = 32; - tmp = ExAllocatePoolWithTag(1, identifierString.MaximumLength, 1349673296UL); - identifierString.Buffer = tmp; - } - if (! identifierString.Buffer) { - return (0); - } else { - - } - { - memset(ParamTable, 0, sizeof(ParamTable)); - ParamTable[0].Flags = 36; - ParamTable[0].EntryContext = & identifierString; - ParamTable[0].DefaultType = 1; - ParamTable[0].DefaultData = & Path; - ParamTable[0].DefaultLength = 0; - Status = RtlQueryRegistryValues(0, Path.Buffer, ParamTable, (void *)0, (void *)0); - } - if (Status >= 0L) { - { - tmp___0 = RtlCompareUnicodeString(& identifierString, & necR98Identifier, 0); +BOOLEAN PptIsNecR98Machine(void) { + UNICODE_STRING Path; + RTL_QUERY_REGISTRY_TABLE ParamTable[2]; + NTSTATUS Status; + UNICODE_STRING identifierString; + UNICODE_STRING necR98Identifier; + UNICODE_STRING necR98JIdentifier; + PVOID tmp; + LONG tmp___0; + LONG tmp___1; + + { + { + identifierString.Length = 0; + identifierString.MaximumLength = 32; + tmp = ExAllocatePoolWithTag(1, identifierString.MaximumLength, + 1349673296UL); + identifierString.Buffer = tmp; } - if (tmp___0 == 0L) { - goto _L; + if (!identifierString.Buffer) { + return (0); } else { + } + { + memset(ParamTable, 0, sizeof(ParamTable)); + ParamTable[0].Flags = 36; + ParamTable[0].EntryContext = &identifierString; + ParamTable[0].DefaultType = 1; + ParamTable[0].DefaultData = &Path; + ParamTable[0].DefaultLength = 0; + Status = RtlQueryRegistryValues(0, Path.Buffer, ParamTable, (void *)0, + (void *)0); + } + if (Status >= 0L) { { - tmp___1 = RtlCompareUnicodeString(& identifierString, & necR98JIdentifier, 0); + tmp___0 = + RtlCompareUnicodeString(&identifierString, &necR98Identifier, 0); } - if (tmp___1 == 0L) { - _L: /* CIL Label */ + if (tmp___0 == 0L) { + goto _L; + } else { { + tmp___1 = + RtlCompareUnicodeString(&identifierString, &necR98JIdentifier, 0); } - { -/* ExFreePool(identifierString.Buffer); */ /* INLINED */ + if (tmp___1 == 0L) { + _L : /* CIL Label */ + {} + { /* ExFreePool(identifierString.Buffer); */ /* INLINED */ + } + return (1); + } else { } - return (1); - } else { - } + } else { + {} { /* ExFreePool(identifierString.Buffer); */ /* INLINED */ + } + return (0); } - } else { - { - } - { -/* ExFreePool(identifierString.Buffer); */ /* INLINED */ + {} { /* ExFreePool(identifierString.Buffer); */ /* INLINED */ } return (0); } - { - } - { -/* ExFreePool(identifierString.Buffer); */ /* INLINED */ - } - return (0); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -NTSTATUS PptDispatchCreate(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS status ; - NTSTATUS tmp ; +NTSTATUS PptDispatchCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS status; + NTSTATUS tmp; { - extension = DeviceObject->DeviceExtension; - status = 0L; - if (extension->DeviceStateFlags & 4096UL) { - { + extension = DeviceObject->DeviceExtension; + status = 0L; + if (extension->DeviceStateFlags & 4096UL) { + {} { tmp = PptFailRequest(Irp, -1073741738L); } + return (tmp); + } else { } - { - tmp = PptFailRequest(Irp, -1073741738L); + { status = PptAcquireRemoveLockOrFailIrp(DeviceObject, Irp); } + if (!(status >= 0L)) { + {} + return (status); + } else { } - return (tmp); - } else { - - } - { - status = PptAcquireRemoveLockOrFailIrp(DeviceObject, Irp); - } - if (! (status >= 0L)) { { + /* ExAcquireFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ + InterlockedIncrement(&extension->OpenCloseRefCount); + /* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ + } + {} { + PptReleaseRemoveLock(&extension->RemoveLock, Irp); + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); } return (status); - } else { - - } - { -/* ExAcquireFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ - InterlockedIncrement(& extension->OpenCloseRefCount); -/* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ } - { - } - { - PptReleaseRemoveLock(& extension->RemoveLock, Irp); - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); - } - return (status); } -} -NTSTATUS PptDispatchClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS status ; - LONG tmp ; - - { - extension = DeviceObject->DeviceExtension; - if (extension->DeviceStateFlags & 4096UL) { - { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); - } - return (0L); - } else { - - } - { - status = PptAcquireRemoveLock(& extension->RemoveLock, Irp); - } - if (! (status >= 0L)) { - { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); - } - return (0L); - } else { +NTSTATUS PptDispatchClose(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS status; + LONG tmp; - } { -/* ExAcquireFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ - } - if (extension->OpenCloseRefCount > 0L) { - { - tmp = InterlockedDecrement(& extension->OpenCloseRefCount); - } - if (tmp < 0L) { + extension = DeviceObject->DeviceExtension; + if (extension->DeviceStateFlags & 4096UL) { { - InterlockedIncrement(& extension->OpenCloseRefCount); + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); } + return (0L); } else { - } - { -/* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ + { status = PptAcquireRemoveLock(&extension->RemoveLock, Irp); } + if (!(status >= 0L)) { + { + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); + } + return (0L); + } else { } - { + { /* ExAcquireFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ } - } else { - { -/* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ + if (extension->OpenCloseRefCount > 0L) { + { tmp = InterlockedDecrement(&extension->OpenCloseRefCount); } + if (tmp < 0L) { + { InterlockedIncrement(&extension->OpenCloseRefCount); } + } else { + } + { + /* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED + */ + } {} + } else { + { + /* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED + */ + } {} } { + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); + PptReleaseRemoveLock(&extension->RemoveLock, Irp); } + return (0L); } - { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); - PptReleaseRemoveLock(& extension->RemoveLock, Irp); - } - return (0L); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) -static UCHAR ModeQualifier___6[7] = { 170, 85, 0, 255, - 135, 120, 255}; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +static UCHAR ModeQualifier___6[7] = {170, 85, 0, 255, 135, 120, 255}; #pragma once -BOOLEAN PptCheckIfStl1284_3(PDEVICE_EXTENSION DeviceExtension , ULONG ulDaisyIndex , - BOOLEAN bNoStrobe ) ; -BOOLEAN PptCheckIfNon1284_3Present(PDEVICE_EXTENSION Extension ) ; -BOOLEAN PptCheckIfStlProductId(PDEVICE_EXTENSION DeviceExtension , ULONG ulDaisyIndex ) ; -ULONG PptInitiate1284_3(PVOID Extension ) -{ ULONG deviceCount1 ; - ULONG deviceCount2 ; - ULONG loopCount ; - ULONG maxTries ; - - { - deviceCount1 = 0; - deviceCount2 = 0; - loopCount = 0; - maxTries = 3; - { - while (1) { - while_76_continue: /* CIL Label */ ; - { - KeStallExecutionProcessor(5); - deviceCount1 = Ppt1284_3AssignAddress(Extension); - KeStallExecutionProcessor(5); - deviceCount2 = Ppt1284_3AssignAddress(Extension); - } - if (deviceCount1 != deviceCount2) { - loopCount += 1UL; - if (loopCount < maxTries) { +BOOLEAN PptCheckIfStl1284_3(PDEVICE_EXTENSION DeviceExtension, + ULONG ulDaisyIndex, BOOLEAN bNoStrobe); +BOOLEAN PptCheckIfNon1284_3Present(PDEVICE_EXTENSION Extension); +BOOLEAN PptCheckIfStlProductId(PDEVICE_EXTENSION DeviceExtension, + ULONG ulDaisyIndex); +ULONG PptInitiate1284_3(PVOID Extension) { + ULONG deviceCount1; + ULONG deviceCount2; + ULONG loopCount; + ULONG maxTries; + + { + deviceCount1 = 0; + deviceCount2 = 0; + loopCount = 0; + maxTries = 3; + { + while (1) { + while_76_continue: /* CIL Label */; + { + KeStallExecutionProcessor(5); + deviceCount1 = Ppt1284_3AssignAddress(Extension); + KeStallExecutionProcessor(5); + deviceCount2 = Ppt1284_3AssignAddress(Extension); + } + if (deviceCount1 != deviceCount2) { + loopCount += 1UL; + if (loopCount < maxTries) { - } else { - goto while_76_break; + } else { + goto while_76_break; + } + } else { + goto while_76_break; + } } - } else { - goto while_76_break; + while_76_break: /* CIL Label */; } + return (deviceCount2); } - while_76_break: /* CIL Label */ ; - } - return (deviceCount2); } -} -NTSTATUS PptTrySelectDevice(PVOID Context , PVOID TrySelectCommand ) -{ NTSTATUS Status ; - PDEVICE_EXTENSION Extension ; - PPARALLEL_1284_COMMAND Command ; - BOOLEAN success ; - SYNCHRONIZED_COUNT_CONTEXT SyncContext ; - KIRQL CancelIrql ; - UCHAR i ; - UCHAR DeviceID ; - NTSTATUS tmp ; +NTSTATUS PptTrySelectDevice(PVOID Context, PVOID TrySelectCommand) { + NTSTATUS Status; + PDEVICE_EXTENSION Extension; + PPARALLEL_1284_COMMAND Command; + BOOLEAN success; + SYNCHRONIZED_COUNT_CONTEXT SyncContext; + KIRQL CancelIrql; + UCHAR i; + UCHAR DeviceID; + NTSTATUS tmp; { - Status = 0L; - Extension = Context; - Command = TrySelectCommand; - success = 0; - { - } - if (Command->CommandFlags & 4UL) { - { - tmp = PptTrySelectLegacyZip(Context, TrySelectCommand); - } - return (tmp); - } else { - if ((int )Command->ID == 5) { - { - tmp = PptTrySelectLegacyZip(Context, TrySelectCommand); - } + Status = 0L; + Extension = Context; + Command = TrySelectCommand; + success = 0; + {} + if (Command->CommandFlags & 4UL) { + { tmp = PptTrySelectLegacyZip(Context, TrySelectCommand); } return (tmp); } else { - - } - } - DeviceID = Command->ID; - if (! (Command->CommandFlags & 1UL)) { - if ((ULONG )DeviceID > Extension->PnpInfo.Ieee1284_3DeviceCount) { - { + if ((int)Command->ID == 5) { + { tmp = PptTrySelectLegacyZip(Context, TrySelectCommand); } + return (tmp); + } else { } - Status = -1073741811L; - } else { - goto _L___1; } - } else { - _L___1: /* CIL Label */ - if (Command->CommandFlags & 2UL) { - if (! (Command->CommandFlags & 1UL)) { - if ((ULONG )DeviceID < Extension->PnpInfo.Ieee1284_3DeviceCount) { - i = 0; - { - while (1) { - while_79_continue: /* CIL Label */ ; - if ((int )i < (int )PptDot3Retries) { - if (! success) { - - } else { - goto while_79_break; - } - } else { - goto while_79_break; - } - { - success = PptSend1284_3Command(Extension, (unsigned char )(224 | (int )DeviceID)); - KeStallExecutionProcessor(5); - i = (UCHAR )((int )i + 1); - } - } - while_79_break: /* CIL Label */ ; - } - if (success) { - { - } - Status = 0L; - } else { - { - } - Status = -1073741823L; - } - } else { - goto _L; - } + DeviceID = Command->ID; + if (!(Command->CommandFlags & 1UL)) { + if ((ULONG)DeviceID > Extension->PnpInfo.Ieee1284_3DeviceCount) { + {} + Status = -1073741811L; } else { - _L: /* CIL Label */ - { - } - Status = 0L; + goto _L___1; } } else { - { - } - { - IoAcquireCancelSpinLock(& CancelIrql); - SyncContext.Count = & Extension->WorkQueueCount; - } - if (Extension->InterruptRefCount) { - { - KeSynchronizeExecution(Extension->InterruptObject, & PptSynchronizedIncrement, - & SyncContext); - } - } else { - { - PptSynchronizedIncrement(& SyncContext); - } - } - if (SyncContext.NewCount) { - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - Status = 259L; - } - } else { - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - } - { - } - Extension->WmiPortAllocFreeCounts.PortAllocates += 1UL; - if (! (Command->CommandFlags & 1UL)) { - if ((ULONG )DeviceID < Extension->PnpInfo.Ieee1284_3DeviceCount) { + _L___1: /* CIL Label */ + if (Command->CommandFlags & 2UL) { + if (!(Command->CommandFlags & 1UL)) { + if ((ULONG)DeviceID < Extension->PnpInfo.Ieee1284_3DeviceCount) { i = 0; { - while (1) { - while_85_continue: /* CIL Label */ ; - if ((int )i < (int )PptDot3Retries) { - if (! success) { + while (1) { + while_79_continue: /* CIL Label */; + if ((int)i < (int)PptDot3Retries) { + if (!success) { + } else { + goto while_79_break; + } } else { - goto while_85_break; + goto while_79_break; + } + { + success = PptSend1284_3Command( + Extension, (unsigned char)(224 | (int)DeviceID)); + KeStallExecutionProcessor(5); + i = (UCHAR)((int)i + 1); } - } else { - goto while_85_break; - } - { - success = PptSend1284_3Command(Extension, (unsigned char )(224 | (int )DeviceID)); - KeStallExecutionProcessor(5); - i = (UCHAR )((int )i + 1); } - } - while_85_break: /* CIL Label */ ; + while_79_break: /* CIL Label */; } if (success) { - { - } + {} Status = 0L; } else { - { - } + {} Status = -1073741823L; } } else { - goto _L___0; + goto _L; } } else { - _L___0: /* CIL Label */ + _L : /* CIL Label */ + {} + Status = 0L; + } + } else { + {} { + IoAcquireCancelSpinLock(&CancelIrql); + SyncContext.Count = &Extension->WorkQueueCount; + } + if (Extension->InterruptRefCount) { { + KeSynchronizeExecution(Extension->InterruptObject, + &PptSynchronizedIncrement, &SyncContext); + } + } else { + { PptSynchronizedIncrement(&SyncContext); } + } + if (SyncContext.NewCount) { + { + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + Status = 259L; + } + } else { + { + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } {} + Extension->WmiPortAllocFreeCounts.PortAllocates += 1UL; + if (!(Command->CommandFlags & 1UL)) { + if ((ULONG)DeviceID < Extension->PnpInfo.Ieee1284_3DeviceCount) { + i = 0; + { + while (1) { + while_85_continue: /* CIL Label */; + if ((int)i < (int)PptDot3Retries) { + if (!success) { + + } else { + goto while_85_break; + } + } else { + goto while_85_break; + } + { + success = PptSend1284_3Command( + Extension, (unsigned char)(224 | (int)DeviceID)); + KeStallExecutionProcessor(5); + i = (UCHAR)((int)i + 1); + } + } + while_85_break: /* CIL Label */; + } + if (success) { + {} + Status = 0L; + } else { + {} + Status = -1073741823L; + } + } else { + goto _L___0; + } + } else { + _L___0 : /* CIL Label */ + {} + Status = 0L; } - Status = 0L; } } } + return (Status); } - return (Status); -} } -NTSTATUS PptDeselectDevice(PVOID Context , PVOID DeselectCommand ) -{ NTSTATUS Status ; - PDEVICE_EXTENSION Extension ; - PPARALLEL_1284_COMMAND Command ; - BOOLEAN success ; - UCHAR i ; - UCHAR DeviceID ; - NTSTATUS tmp ; +NTSTATUS PptDeselectDevice(PVOID Context, PVOID DeselectCommand) { + NTSTATUS Status; + PDEVICE_EXTENSION Extension; + PPARALLEL_1284_COMMAND Command; + BOOLEAN success; + UCHAR i; + UCHAR DeviceID; + NTSTATUS tmp; { - Status = 0L; - Extension = Context; - Command = DeselectCommand; - success = 0; - { - } - if (Command->CommandFlags & 4UL) { - { - tmp = PptDeselectLegacyZip(Context, DeselectCommand); - } - return (tmp); - } else { - if ((int )Command->ID == 5) { - { - tmp = PptDeselectLegacyZip(Context, DeselectCommand); - } + Status = 0L; + Extension = Context; + Command = DeselectCommand; + success = 0; + {} + if (Command->CommandFlags & 4UL) { + { tmp = PptDeselectLegacyZip(Context, DeselectCommand); } return (tmp); } else { - + if ((int)Command->ID == 5) { + { tmp = PptDeselectLegacyZip(Context, DeselectCommand); } + return (tmp); + } else { + } } - } - DeviceID = Command->ID; - if (! (Command->CommandFlags & 1UL)) { - if ((ULONG )DeviceID > Extension->PnpInfo.Ieee1284_3DeviceCount) { - { + DeviceID = Command->ID; + if (!(Command->CommandFlags & 1UL)) { + if ((ULONG)DeviceID > Extension->PnpInfo.Ieee1284_3DeviceCount) { + {} + Status = -1073741811L; + } else { + goto _L___0; } - Status = -1073741811L; } else { - goto _L___0; - } - } else { - _L___0: /* CIL Label */ - if (! (Command->CommandFlags & 1UL)) { - if ((ULONG )DeviceID < Extension->PnpInfo.Ieee1284_3DeviceCount) { - i = 0; - { - while (1) { - while_91_continue: /* CIL Label */ ; - if ((int )i < (int )PptDot3Retries) { - if (! success) { + _L___0: /* CIL Label */ + if (!(Command->CommandFlags & 1UL)) { + if ((ULONG)DeviceID < Extension->PnpInfo.Ieee1284_3DeviceCount) { + i = 0; + { + while (1) { + while_91_continue: /* CIL Label */; + if ((int)i < (int)PptDot3Retries) { + if (!success) { - } else { - goto while_91_break; + } else { + goto while_91_break; + } + } else { + goto while_91_break; + } + { + success = PptSend1284_3Command(Extension, (unsigned char)48); + KeStallExecutionProcessor(5); + i = (UCHAR)((int)i + 1); + } } - } else { - goto while_91_break; - } - { - success = PptSend1284_3Command(Extension, (unsigned char)48); - KeStallExecutionProcessor(5); - i = (UCHAR )((int )i + 1); + while_91_break: /* CIL Label */; } - } - while_91_break: /* CIL Label */ ; - } - if (success) { - { - } - if (! (Command->CommandFlags & 2UL)) { - { - PptFreePort(Extension); + if (success) { + {} + if (!(Command->CommandFlags & 2UL)) { + { PptFreePort(Extension); } + } else { } + Status = 0L; } else { - + {} + Status = -1073741823L; } - Status = 0L; } else { - { - } - Status = -1073741823L; + goto _L; } } else { - goto _L; - } - } else { - _L: /* CIL Label */ - { - } - if (! (Command->CommandFlags & 2UL)) { - { - PptFreePort(Extension); + _L : /* CIL Label */ + {} + if (!(Command->CommandFlags & 2UL)) { + { PptFreePort(Extension); } + } else { } - } else { - + Status = 0L; } - Status = 0L; } + return (Status); } - return (Status); -} -} -ULONG Ppt1284_3AssignAddress(PDEVICE_EXTENSION DeviceExtension ) -{ UCHAR i = __VERIFIER_nondet_char() ; - UCHAR value ; - UCHAR newvalue ; - UCHAR status ; - PUCHAR CurrentPort ; - PUCHAR CurrentStatus ; - PUCHAR CurrentControl ; - ULONG Delay ; - UCHAR number ; - BOOLEAN lastdevice ; - UCHAR idx ; - UCHAR tmp ; - BOOLEAN bStlNon1284_3Found ; - BOOLEAN bStlNon1284_3Valid ; - BOOLEAN tmp___0 ; - BOOLEAN tmp___1 ; - - { - { - Delay = 5; - number = 0; - lastdevice = 0; - CurrentPort = DeviceExtension->PortInfo.Controller; - CurrentStatus = CurrentPort + 1; - CurrentControl = CurrentPort + 2; - value = READ_PORT_UCHAR(CurrentControl); - newvalue = (unsigned char )(((int )value & -9) | 4); - newvalue = (unsigned char )((int )newvalue & -33); - WRITE_PORT_UCHAR(CurrentControl, newvalue); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 184) == 184) { - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 184) == 24) { - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); +} +ULONG Ppt1284_3AssignAddress(PDEVICE_EXTENSION DeviceExtension) { + UCHAR i = __VERIFIER_nondet_char(); + UCHAR value; + UCHAR newvalue; + UCHAR status; + PUCHAR CurrentPort; + PUCHAR CurrentStatus; + PUCHAR CurrentControl; + ULONG Delay; + UCHAR number; + BOOLEAN lastdevice; + UCHAR idx; + UCHAR tmp; + BOOLEAN bStlNon1284_3Found; + BOOLEAN bStlNon1284_3Valid; + BOOLEAN tmp___0; + BOOLEAN tmp___1; + + { + { + Delay = 5; + number = 0; + lastdevice = 0; + CurrentPort = DeviceExtension->PortInfo.Controller; + CurrentStatus = CurrentPort + 1; + CurrentControl = CurrentPort + 2; + value = READ_PORT_UCHAR(CurrentControl); + newvalue = (unsigned char)(((int)value & -9) | 4); + newvalue = (unsigned char)((int)newvalue & -33); + WRITE_PORT_UCHAR(CurrentControl, newvalue); + WRITE_PORT_UCHAR(CurrentControl, (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); KeStallExecutionProcessor(Delay); status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 48) == 48) { - { + } + if (((int)status & 184) == 184) { + { + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); KeStallExecutionProcessor(Delay); - } + status = READ_PORT_UCHAR(CurrentStatus); + } + if (((int)status & 184) == 24) { { - while (1) { - while_95_continue: /* CIL Label */ ; - if ((int )number < 4) { - if (! lastdevice) { - - } else { - goto while_95_break; - } - } else { - goto while_95_break; - } - { - WRITE_PORT_UCHAR(CurrentPort, number); - number = (unsigned char )((int )number + 1); - KeStallExecutionProcessor(Delay); - tmp = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )tmp & 128) == 0) { - lastdevice = 1; - } else { - - } - { - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - } + status = READ_PORT_UCHAR(CurrentStatus); } - while_95_break: /* CIL Label */ ; - } - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); - } - if (number) { - { - bStlNon1284_3Found = PptCheckIfNon1284_3Present(DeviceExtension); - bStlNon1284_3Valid = 0; - idx = 0; - } + if (((int)status & 48) == 48) { + { KeStallExecutionProcessor(Delay); } { - while (1) { - while_96_continue: /* CIL Label */ ; - if ((int )idx < (int )number) { - - } else { - goto while_96_break; - } - { - tmp___0 = PptCheckIfStl1284_3(DeviceExtension, idx, bStlNon1284_3Found); - } - if (1 == (int )tmp___0) { - goto __Cont; - } else { + while (1) { + while_95_continue: /* CIL Label */; + if ((int)number < 4) { + if (!lastdevice) { - } - if (1 == (int )bStlNon1284_3Found) { + } else { + goto while_95_break; + } + } else { + goto while_95_break; + } { - tmp___1 = PptCheckIfStlProductId(DeviceExtension, idx); + WRITE_PORT_UCHAR(CurrentPort, number); + number = (unsigned char)((int)number + 1); + KeStallExecutionProcessor(Delay); + tmp = READ_PORT_UCHAR(CurrentStatus); } - if (1 == (int )tmp___1) { - bStlNon1284_3Valid = 1; - goto __Cont; + if (((int)tmp & 128) == 0) { + lastdevice = 1; } else { + } + { + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + } + } + while_95_break: /* CIL Label */; + } + { WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); } + if (number) { + { + bStlNon1284_3Found = PptCheckIfNon1284_3Present(DeviceExtension); + bStlNon1284_3Valid = 0; + idx = 0; + } + { + while (1) { + while_96_continue: /* CIL Label */; + if ((int)idx < (int)number) { + } else { + goto while_96_break; + } + { + tmp___0 = PptCheckIfStl1284_3(DeviceExtension, idx, + bStlNon1284_3Found); + } + if (1 == (int)tmp___0) { + goto __Cont; + } else { + } + if (1 == (int)bStlNon1284_3Found) { + { tmp___1 = PptCheckIfStlProductId(DeviceExtension, idx); } + if (1 == (int)tmp___1) { + bStlNon1284_3Valid = 1; + goto __Cont; + } else { + } + } else { + } + goto while_96_break; + __Cont: /* CIL Label */ + idx = (UCHAR)((int)idx + 1); } + while_96_break: /* CIL Label */; + } + if (1 == (int)bStlNon1284_3Valid) { + number = idx; } else { - } - goto while_96_break; - __Cont: /* CIL Label */ - idx = (UCHAR )((int )idx + 1); - } - while_96_break: /* CIL Label */ ; - } - if (1 == (int )bStlNon1284_3Valid) { - number = idx; } else { - } } else { - } } else { - } } else { - } - } else { - - } - { - WRITE_PORT_UCHAR(CurrentControl, value); + { WRITE_PORT_UCHAR(CurrentControl, value); } + return ((unsigned long)number); } - return ((unsigned long )number); -} } -BOOLEAN PptCheckIfNon1284_3Present(PDEVICE_EXTENSION Extension ) -{ BOOLEAN bReturnValue ; - UCHAR i = __VERIFIER_nondet_char() ; - UCHAR value ; - UCHAR newvalue ; - UCHAR status ; - ULONG Delay ; - PUCHAR CurrentPort ; - PUCHAR CurrentStatus ; - PUCHAR CurrentControl ; - UCHAR ucAckStatus ; +BOOLEAN PptCheckIfNon1284_3Present(PDEVICE_EXTENSION Extension) { + BOOLEAN bReturnValue; + UCHAR i = __VERIFIER_nondet_char(); + UCHAR value; + UCHAR newvalue; + UCHAR status; + ULONG Delay; + PUCHAR CurrentPort; + PUCHAR CurrentStatus; + PUCHAR CurrentControl; + UCHAR ucAckStatus; { - { - bReturnValue = 0; - Delay = 3; - CurrentPort = Extension->PortInfo.Controller; - CurrentStatus = CurrentPort + 1; - CurrentControl = CurrentPort + 2; - value = READ_PORT_UCHAR(CurrentControl); - newvalue = (unsigned char )(((int )value & -9) | 4); - newvalue = (unsigned char )((int )newvalue & -33); - WRITE_PORT_UCHAR(CurrentControl, newvalue); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 184) == 184) { { - ucAckStatus = (int )status & 64; - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); + bReturnValue = 0; + Delay = 3; + CurrentPort = Extension->PortInfo.Controller; + CurrentStatus = CurrentPort + 1; + CurrentControl = CurrentPort + 2; + value = READ_PORT_UCHAR(CurrentControl); + newvalue = (unsigned char)(((int)value & -9) | 4); + newvalue = (unsigned char)((int)newvalue & -33); + WRITE_PORT_UCHAR(CurrentControl, newvalue); + WRITE_PORT_UCHAR(CurrentControl, (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); + KeStallExecutionProcessor(Delay); + status = READ_PORT_UCHAR(CurrentStatus); } - if (((int )status & 184) == 24) { - if ((int )ucAckStatus != ((int )status & 64)) { - { - ucAckStatus = (int )status & 64; - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + if (((int)status & 184) == 184) { + { + ucAckStatus = (int)status & 64; + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); KeStallExecutionProcessor(Delay); status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 48) == 48) { - bReturnValue = 1; + } + if (((int)status & 184) == 24) { + if ((int)ucAckStatus != ((int)status & 64)) { + { + ucAckStatus = (int)status & 64; + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + KeStallExecutionProcessor(Delay); + status = READ_PORT_UCHAR(CurrentStatus); + } + if (((int)status & 48) == 48) { + bReturnValue = 1; + } else { + } } else { - } + { WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); } } else { - - } - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); } } else { - } - } else { - - } - { - WRITE_PORT_UCHAR(CurrentControl, value); + { WRITE_PORT_UCHAR(CurrentControl, value); } + return (bReturnValue); } - return (bReturnValue); -} } -BOOLEAN PptCheckIfStl1284_3(PDEVICE_EXTENSION DeviceExtension , ULONG ulDaisyIndex , - BOOLEAN bNoStrobe ) -{ BOOLEAN bReturnValue ; - UCHAR i = __VERIFIER_nondet_char() ; - UCHAR value ; - UCHAR newvalue ; - UCHAR status ; - ULONG Delay ; - UCHAR ucExpectedPattern ; - UCHAR ucReadValue ; - UCHAR ucReadPattern ; - PUCHAR CurrentPort ; - PUCHAR CurrentStatus ; - PUCHAR CurrentControl ; +BOOLEAN PptCheckIfStl1284_3(PDEVICE_EXTENSION DeviceExtension, + ULONG ulDaisyIndex, BOOLEAN bNoStrobe) { + BOOLEAN bReturnValue; + UCHAR i = __VERIFIER_nondet_char(); + UCHAR value; + UCHAR newvalue; + UCHAR status; + ULONG Delay; + UCHAR ucExpectedPattern; + UCHAR ucReadValue; + UCHAR ucReadPattern; + PUCHAR CurrentPort; + PUCHAR CurrentStatus; + PUCHAR CurrentControl; { - { - bReturnValue = 0; - Delay = 3; - CurrentPort = DeviceExtension->PortInfo.Controller; - CurrentStatus = CurrentPort + 1; - CurrentControl = CurrentPort + 2; - value = READ_PORT_UCHAR(CurrentControl); - newvalue = (unsigned char )(((int )value & -9) | 4); - newvalue = (unsigned char )((int )newvalue & -33); - WRITE_PORT_UCHAR(CurrentControl, newvalue); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 184) == 184) { { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 184) == 24) { - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + bReturnValue = 0; + Delay = 3; + CurrentPort = DeviceExtension->PortInfo.Controller; + CurrentStatus = CurrentPort + 1; + CurrentControl = CurrentPort + 2; + value = READ_PORT_UCHAR(CurrentControl); + newvalue = (unsigned char)(((int)value & -9) | 4); + newvalue = (unsigned char)((int)newvalue & -33); + WRITE_PORT_UCHAR(CurrentControl, newvalue); + WRITE_PORT_UCHAR(CurrentControl, (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); KeStallExecutionProcessor(Delay); status = READ_PORT_UCHAR(CurrentStatus); + } + if (((int)status & 184) == 184) { + { + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); + KeStallExecutionProcessor(Delay); + status = READ_PORT_UCHAR(CurrentStatus); } - if (((int )status & 48) == 48) { + if (((int)status & 184) == 24) { { - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentPort, (unsigned char )(136UL | ulDaisyIndex)); - KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + KeStallExecutionProcessor(Delay); + status = READ_PORT_UCHAR(CurrentStatus); } - if (ulDaisyIndex) { - if ((int )bNoStrobe == 0) { - { - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); + if (((int)status & 48) == 48) { + { KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); + WRITE_PORT_UCHAR(CurrentPort, + (unsigned char)(136UL | ulDaisyIndex)); KeStallExecutionProcessor(Delay); - } - } else { - } - } else { - - } - ucExpectedPattern = 240; - bReturnValue = 1; - { - while (1) { - while_97_continue: /* CIL Label */ ; - if (ucExpectedPattern) { - + if (ulDaisyIndex) { + if ((int)bNoStrobe == 0) { + { + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + } + } else { + } } else { - goto while_97_break; } + ucExpectedPattern = 240; + bReturnValue = 1; { - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentPort, (unsigned char )(128UL | ulDaisyIndex)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentPort, (unsigned char )(136UL | ulDaisyIndex)); - KeStallExecutionProcessor(Delay); - ucReadValue = READ_PORT_UCHAR(CurrentStatus); - ucReadPattern = ((int )ucReadValue << 1) & 112; - ucReadPattern = (int )ucReadPattern | ((int )ucReadValue & 128); - } - if ((int )ucReadPattern != (int )ucExpectedPattern) { - bReturnValue = 0; - goto while_97_break; - } else { + while (1) { + while_97_continue: /* CIL Label */; + if (ucExpectedPattern) { + } else { + goto while_97_break; + } + { + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, + (unsigned char)(128UL | ulDaisyIndex)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, + (unsigned char)(136UL | ulDaisyIndex)); + KeStallExecutionProcessor(Delay); + ucReadValue = READ_PORT_UCHAR(CurrentStatus); + ucReadPattern = ((int)ucReadValue << 1) & 112; + ucReadPattern = (int)ucReadPattern | ((int)ucReadValue & 128); + } + if ((int)ucReadPattern != (int)ucExpectedPattern) { + bReturnValue = 0; + goto while_97_break; + } else { + } + ucExpectedPattern = (int)ucExpectedPattern - 16; + } + while_97_break: /* CIL Label */; } - ucExpectedPattern = (int )ucExpectedPattern - 16; - } - while_97_break: /* CIL Label */ ; - } - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); + { WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); } + } else { } } else { - } } else { - - } - } else { - - } - { - WRITE_PORT_UCHAR(CurrentControl, value); - } - return (bReturnValue); -} -} -BOOLEAN PptCheckIfStlProductId(PDEVICE_EXTENSION DeviceExtension , ULONG ulDaisyIndex ) -{ BOOLEAN bReturnValue ; - UCHAR i = __VERIFIER_nondet_char() ; - UCHAR value ; - UCHAR newvalue ; - UCHAR status ; - ULONG Delay ; - UCHAR ucProdIdHiByteHiNibble ; - UCHAR ucProdIdHiByteLoNibble ; - UCHAR ucProdIdLoByteHiNibble ; - UCHAR ucProdIdLoByteLoNibble ; - UCHAR ucProdIdHiByte ; - UCHAR ucProdIdLoByte ; - USHORT usProdId ; - PUCHAR CurrentPort ; - PUCHAR CurrentStatus ; - PUCHAR CurrentControl ; - - { - { - bReturnValue = 0; - Delay = 3; - CurrentPort = DeviceExtension->PortInfo.Controller; - CurrentStatus = CurrentPort + 1; - CurrentControl = CurrentPort + 2; - value = READ_PORT_UCHAR(CurrentControl); - newvalue = (unsigned char )(((int )value & -9) | 4); - newvalue = (unsigned char )((int )newvalue & -33); - WRITE_PORT_UCHAR(CurrentControl, newvalue); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )status & 184) == 184) { - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); - KeStallExecutionProcessor(Delay); - status = READ_PORT_UCHAR(CurrentStatus); } - if (((int )status & 184) == 24) { - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + { WRITE_PORT_UCHAR(CurrentControl, value); } + return (bReturnValue); + } +} +BOOLEAN PptCheckIfStlProductId(PDEVICE_EXTENSION DeviceExtension, + ULONG ulDaisyIndex) { + BOOLEAN bReturnValue; + UCHAR i = __VERIFIER_nondet_char(); + UCHAR value; + UCHAR newvalue; + UCHAR status; + ULONG Delay; + UCHAR ucProdIdHiByteHiNibble; + UCHAR ucProdIdHiByteLoNibble; + UCHAR ucProdIdLoByteHiNibble; + UCHAR ucProdIdLoByteLoNibble; + UCHAR ucProdIdHiByte; + UCHAR ucProdIdLoByte; + USHORT usProdId; + PUCHAR CurrentPort; + PUCHAR CurrentStatus; + PUCHAR CurrentControl; + + { + { + bReturnValue = 0; + Delay = 3; + CurrentPort = DeviceExtension->PortInfo.Controller; + CurrentStatus = CurrentPort + 1; + CurrentControl = CurrentPort + 2; + value = READ_PORT_UCHAR(CurrentControl); + newvalue = (unsigned char)(((int)value & -9) | 4); + newvalue = (unsigned char)((int)newvalue & -33); + WRITE_PORT_UCHAR(CurrentControl, newvalue); + WRITE_PORT_UCHAR(CurrentControl, (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); KeStallExecutionProcessor(Delay); status = READ_PORT_UCHAR(CurrentStatus); + } + if (((int)status & 184) == 184) { + { + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); + KeStallExecutionProcessor(Delay); + status = READ_PORT_UCHAR(CurrentStatus); } - if (((int )status & 48) == 48) { + if (((int)status & 184) == 24) { { - WRITE_PORT_UCHAR(CurrentPort, (unsigned char )(16UL | ulDaisyIndex)); - KeStallExecutionProcessor(Delay); - KeStallExecutionProcessor(Delay); - ucProdIdLoByteHiNibble = READ_PORT_UCHAR(CurrentStatus); - ucProdIdLoByteHiNibble = (int )ucProdIdLoByteHiNibble & 240; - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - ucProdIdLoByteLoNibble = READ_PORT_UCHAR(CurrentStatus); - ucProdIdLoByteLoNibble = (int )ucProdIdLoByteLoNibble >> 4; - ucProdIdLoByte = (int )ucProdIdLoByteHiNibble | (int )ucProdIdLoByteLoNibble; - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - ucProdIdHiByteHiNibble = READ_PORT_UCHAR(CurrentStatus); - ucProdIdHiByteHiNibble = (int )ucProdIdHiByteHiNibble & 240; - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - ucProdIdHiByteLoNibble = READ_PORT_UCHAR(CurrentStatus); - ucProdIdHiByteLoNibble = (int )ucProdIdHiByteLoNibble >> 4; - ucProdIdHiByte = (int )ucProdIdHiByteHiNibble | (int )ucProdIdHiByteLoNibble; - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - usProdId = ((int )ucProdIdHiByte << 8) | (int )ucProdIdLoByte; + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + KeStallExecutionProcessor(Delay); + status = READ_PORT_UCHAR(CurrentStatus); } - if (43775 == (int )usProdId) { - bReturnValue = 1; - } else { - if (43263 == (int )usProdId) { + if (((int)status & 48) == 48) { + { + WRITE_PORT_UCHAR(CurrentPort, (unsigned char)(16UL | ulDaisyIndex)); + KeStallExecutionProcessor(Delay); + KeStallExecutionProcessor(Delay); + ucProdIdLoByteHiNibble = READ_PORT_UCHAR(CurrentStatus); + ucProdIdLoByteHiNibble = (int)ucProdIdLoByteHiNibble & 240; + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + ucProdIdLoByteLoNibble = READ_PORT_UCHAR(CurrentStatus); + ucProdIdLoByteLoNibble = (int)ucProdIdLoByteLoNibble >> 4; + ucProdIdLoByte = + (int)ucProdIdLoByteHiNibble | (int)ucProdIdLoByteLoNibble; + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + ucProdIdHiByteHiNibble = READ_PORT_UCHAR(CurrentStatus); + ucProdIdHiByteHiNibble = (int)ucProdIdHiByteHiNibble & 240; + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + ucProdIdHiByteLoNibble = READ_PORT_UCHAR(CurrentStatus); + ucProdIdHiByteLoNibble = (int)ucProdIdHiByteLoNibble >> 4; + ucProdIdHiByte = + (int)ucProdIdHiByteHiNibble | (int)ucProdIdHiByteLoNibble; + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + usProdId = ((int)ucProdIdHiByte << 8) | (int)ucProdIdLoByte; + } + if (43775 == (int)usProdId) { bReturnValue = 1; } else { - + if (43263 == (int)usProdId) { + bReturnValue = 1; + } else { + } } - } - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); + { WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); } + } else { } } else { - } } else { - - } - } else { - - } - { - WRITE_PORT_UCHAR(CurrentControl, value); - } - return (bReturnValue); -} -} -BOOLEAN PptSend1284_3Command(PDEVICE_EXTENSION DeviceExtension , UCHAR Command ) -{ UCHAR i = __VERIFIER_nondet_char() ; - UCHAR value ; - UCHAR newvalue ; - UCHAR test ; - PUCHAR CurrentPort ; - PUCHAR CurrentStatus ; - PUCHAR CurrentControl ; - ULONG Delay ; - BOOLEAN success ; - UCHAR tmp ; - UCHAR tmp___0 ; - int tmp___3 ; - BOOLEAN tmp___4 ; - UCHAR tmp___5 ; - int tmp___8 ; - BOOLEAN tmp___9 ; - UCHAR tmp___10 ; - int tmp___13 ; - BOOLEAN tmp___14 ; - UCHAR tmp___15 ; - - { - Delay = 3; - success = 0; - CurrentPort = DeviceExtension->PortInfo.Controller; - CurrentStatus = CurrentPort + 1; - CurrentControl = CurrentPort + 2; - test = (unsigned char )((int )Command & 248); - { - } - { - value = READ_PORT_UCHAR(CurrentControl); - newvalue = (unsigned char )(((int )value & -9) | 4); - newvalue = (unsigned char )((int )newvalue & -33); - WRITE_PORT_UCHAR(CurrentControl, newvalue); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); - KeStallExecutionProcessor(Delay); - tmp___15 = READ_PORT_UCHAR(CurrentPort + 1); - } - if (((int )tmp___15 & 184) == 184) { - tmp___13 = 1; - } else { - { - tmp___14 = CheckPort(CurrentPort + 1, 184, (unsigned char)184, 5); - tmp___13 = tmp___14; } - } - if (tmp___13) { - { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); - KeStallExecutionProcessor(Delay); - tmp___10 = READ_PORT_UCHAR(CurrentPort + 1); + { WRITE_PORT_UCHAR(CurrentControl, value); } + return (bReturnValue); + } +} +BOOLEAN PptSend1284_3Command(PDEVICE_EXTENSION DeviceExtension, UCHAR Command) { + UCHAR i = __VERIFIER_nondet_char(); + UCHAR value; + UCHAR newvalue; + UCHAR test; + PUCHAR CurrentPort; + PUCHAR CurrentStatus; + PUCHAR CurrentControl; + ULONG Delay; + BOOLEAN success; + UCHAR tmp; + UCHAR tmp___0; + int tmp___3; + BOOLEAN tmp___4; + UCHAR tmp___5; + int tmp___8; + BOOLEAN tmp___9; + UCHAR tmp___10; + int tmp___13; + BOOLEAN tmp___14; + UCHAR tmp___15; + + { + Delay = 3; + success = 0; + CurrentPort = DeviceExtension->PortInfo.Controller; + CurrentStatus = CurrentPort + 1; + CurrentControl = CurrentPort + 2; + test = (unsigned char)((int)Command & 248); + {} { + value = READ_PORT_UCHAR(CurrentControl); + newvalue = (unsigned char)(((int)value & -9) | 4); + newvalue = (unsigned char)((int)newvalue & -33); + WRITE_PORT_UCHAR(CurrentControl, newvalue); + WRITE_PORT_UCHAR(CurrentControl, (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[i]); + KeStallExecutionProcessor(Delay); + tmp___15 = READ_PORT_UCHAR(CurrentPort + 1); } - if (((int )tmp___10 & 184) == 24) { - tmp___8 = 1; + if (((int)tmp___15 & 184) == 184) { + tmp___13 = 1; } else { { - tmp___9 = CheckPort(CurrentPort + 1, 184, (unsigned char)24, 5); - tmp___8 = tmp___9; + tmp___14 = CheckPort(CurrentPort + 1, 184, (unsigned char)184, 5); + tmp___13 = tmp___14; } } - if (tmp___8) { + if (tmp___13) { { - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); - KeStallExecutionProcessor(Delay); - tmp___5 = READ_PORT_UCHAR(CurrentPort + 1); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[4]); + KeStallExecutionProcessor(Delay); + tmp___10 = READ_PORT_UCHAR(CurrentPort + 1); } - if (((int )tmp___5 & 48) == 48) { - tmp___3 = 1; + if (((int)tmp___10 & 184) == 24) { + tmp___8 = 1; } else { { - tmp___4 = CheckPort(CurrentPort + 1, 48, (unsigned char)48, 5); - tmp___3 = tmp___4; + tmp___9 = CheckPort(CurrentPort + 1, 184, (unsigned char)24, 5); + tmp___8 = tmp___9; } } - if (tmp___3) { + if (tmp___8) { { - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentPort, Command); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue | 1)); - KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[5]); + KeStallExecutionProcessor(Delay); + tmp___5 = READ_PORT_UCHAR(CurrentPort + 1); } - if (test == 224) { - goto switch_99_224; + if (((int)tmp___5 & 48) == 48) { + tmp___3 = 1; } else { - if (test == 48) { - goto switch_99_48; + { + tmp___4 = CheckPort(CurrentPort + 1, 48, (unsigned char)48, 5); + tmp___3 = tmp___4; + } + } + if (tmp___3) { + { + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, Command); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue | 1)); + KeStallExecutionProcessor(Delay); + } + if (test == 224) { + goto switch_99_224; } else { - { - goto switch_99_default; - if (0) { - switch_99_224: /* CIL Label */ ; - { - } - { - tmp = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )tmp & 8) == 8) { - success = 1; - { - } - } else { - - } - if (! success) { - { - } - } else { - - } - goto switch_99_break; - switch_99_48: /* CIL Label */ + if (test == 48) { + goto switch_99_48; + } else { { - tmp___0 = READ_PORT_UCHAR(CurrentStatus); - } - if (((int )tmp___0 & 8) != 8) { - success = 1; + goto switch_99_default; + if (0) { + switch_99_224: /* CIL Label */; + {} { tmp = READ_PORT_UCHAR(CurrentStatus); } + if (((int)tmp & 8) == 8) { + success = 1; + {} + } else { + } + if (!success) { + {} + } else { + } + goto switch_99_break; + switch_99_48 : /* CIL Label */ { + tmp___0 = READ_PORT_UCHAR(CurrentStatus); } - } else { - - } - if (! success) { - { + if (((int)tmp___0 & 8) != 8) { + success = 1; + {} + } else { + } + if (!success) { + {} + } else { + } + goto switch_99_break; + switch_99_default: /* CIL Label */; + {} { + KeStallExecutionProcessor(Delay); + success = 1; + } + goto switch_99_break; + } else { + switch_99_break: /* CIL Label */; } - } else { - - } - goto switch_99_break; - switch_99_default: /* CIL Label */ ; - { } - { - KeStallExecutionProcessor(Delay); - success = 1; - } - goto switch_99_break; - } else { - switch_99_break: /* CIL Label */ ; - } } } - } - { - WRITE_PORT_UCHAR(CurrentControl, (unsigned char )((int )newvalue & -2)); - KeStallExecutionProcessor(Delay); - WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); + { + WRITE_PORT_UCHAR(CurrentControl, + (unsigned char)((int)newvalue & -2)); + KeStallExecutionProcessor(Delay); + WRITE_PORT_UCHAR(CurrentPort, ModeQualifier___6[6]); + } + } else { } } else { - } } else { - } - } else { - - } - { - WRITE_PORT_UCHAR(CurrentControl, value); + { WRITE_PORT_UCHAR(CurrentControl, value); } + return (success); } - return (success); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -NTSTATUS PptDetectPortCapabilities(PDEVICE_EXTENSION Extension ) ; -void PptDetectEcpPort(PDEVICE_EXTENSION Extension ) ; -void PptDetectEppPortIfDot3DevicePresent(PDEVICE_EXTENSION Extension ) ; -void PptDetectEppPortIfUserRequested(PDEVICE_EXTENSION Extension ) ; -void PptDetectBytePort(PDEVICE_EXTENSION Extension ) ; -void PptDetermineFifoDepth(PDEVICE_EXTENSION Extension ) ; -void PptDetermineFifoWidth(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptEcrSetMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) ; -NTSTATUS PptEcrClearMode(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptFindNatChip(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptBuildResourceList(PDEVICE_EXTENSION Extension , ULONG Partial , PULONG Addresses , - PCM_RESOURCE_LIST Resources ) ; -NTSTATUS PptSetByteMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) ; -NTSTATUS PptClearByteMode(PDEVICE_EXTENSION Extension ) ; -NTSTATUS PptCheckByteMode(PDEVICE_EXTENSION Extension ) ; -int Extension_FilterMode = 0; -NTSTATUS PptDetectChipFilter(PDEVICE_EXTENSION Extension ) -{ NTSTATUS Status ; - KEVENT Event ; - UCHAR ecrLast ; - PUCHAR Controller ; - PUCHAR EcpController ; - PUCHAR wPortECR ; - - { - Status = -1073741810L; - Controller = Extension->PortInfo.Controller; - EcpController = Extension->PnpInfo.EcpController; - { - } - { - Extension->ChipInfo.success = 0; - Extension->ChipInfo.Controller = Controller; - Extension->ChipInfo.EcrController = EcpController; -/* KeInitializeEvent(& Event, 0, 0); */ /* INLINED */ - } - if (Extension_FilterMode) { - if (Extension->PnpInfo.HardwareCapabilities & 1UL) { - { - } - { - Status = (*(Extension->ChipInfo.ParChipSetMode))(Extension->ChipInfo.Context, - 96); - } - if (Status >= 0L) { - { +NTSTATUS PptDetectPortCapabilities(PDEVICE_EXTENSION Extension); +void PptDetectEcpPort(PDEVICE_EXTENSION Extension); +void PptDetectEppPortIfDot3DevicePresent(PDEVICE_EXTENSION Extension); +void PptDetectEppPortIfUserRequested(PDEVICE_EXTENSION Extension); +void PptDetectBytePort(PDEVICE_EXTENSION Extension); +void PptDetermineFifoDepth(PDEVICE_EXTENSION Extension); +void PptDetermineFifoWidth(PDEVICE_EXTENSION Extension); +NTSTATUS PptEcrSetMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode); +NTSTATUS PptEcrClearMode(PDEVICE_EXTENSION Extension); +NTSTATUS PptFindNatChip(PDEVICE_EXTENSION Extension); +NTSTATUS PptBuildResourceList(PDEVICE_EXTENSION Extension, ULONG Partial, + PULONG Addresses, PCM_RESOURCE_LIST Resources); +NTSTATUS PptSetByteMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode); +NTSTATUS PptClearByteMode(PDEVICE_EXTENSION Extension); +NTSTATUS PptCheckByteMode(PDEVICE_EXTENSION Extension); +int Extension_FilterMode = 0; +NTSTATUS PptDetectChipFilter(PDEVICE_EXTENSION Extension) { + NTSTATUS Status; + KEVENT Event; + UCHAR ecrLast; + PUCHAR Controller; + PUCHAR EcpController; + PUCHAR wPortECR; + + { + Status = -1073741810L; + Controller = Extension->PortInfo.Controller; + EcpController = Extension->PnpInfo.EcpController; + {} { + Extension->ChipInfo.success = 0; + Extension->ChipInfo.Controller = Controller; + Extension->ChipInfo.EcrController = EcpController; + /* KeInitializeEvent(& Event, 0, 0); */ /* INLINED */ + } + if (Extension_FilterMode) { + if (Extension->PnpInfo.HardwareCapabilities & 1UL) { + {} { + Status = (*(Extension->ChipInfo.ParChipSetMode))( + Extension->ChipInfo.Context, 96); } - { - wPortECR = EcpController + 2; - ecrLast = READ_PORT_UCHAR(wPortECR); - PptDetermineFifoWidth(Extension); - PptDetermineFifoDepth(Extension); - WRITE_PORT_UCHAR(wPortECR, ecrLast); - Status = (*(Extension->ChipInfo.ParChipClearMode))(Extension->ChipInfo.Context, - 96); + if (Status >= 0L) { + {} { + wPortECR = EcpController + 2; + ecrLast = READ_PORT_UCHAR(wPortECR); + PptDetermineFifoWidth(Extension); + PptDetermineFifoDepth(Extension); + WRITE_PORT_UCHAR(wPortECR, ecrLast); + Status = (*(Extension->ChipInfo.ParChipClearMode))( + Extension->ChipInfo.Context, 96); + } + } else { } } else { - } } else { - } - } else { - - } - { + {} + return (Status); } - return (Status); -} } -NTSTATUS PptDetectPortType(PDEVICE_EXTENSION Extension ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - NTSTATUS Status ; - UNICODE_STRING ParportPath ; - RTL_QUERY_REGISTRY_TABLE RegTable[2] ; - ULONG IdentifierHex ; - ULONG zero ; - - { - IdentifierHex = 12169; - zero = 0; - { - } - { - memset(RegTable, 0, sizeof(RegTable)); - RegTable[0].Flags = 36; - RegTable[0].EntryContext = & IdentifierHex; - RegTable[0].DefaultType = 4; - RegTable[0].DefaultData = & zero; - RegTable[0].DefaultLength = sizeof(ULONG ); - Status = RtlQueryRegistryValues(1, ParportPath.Buffer, RegTable, (void *)0, (void *)0); - } - { - } - { - } - if (Status >= 0L) { - if (IdentifierHex == 0UL) { - - } else { - goto _L; +NTSTATUS PptDetectPortType(PDEVICE_EXTENSION Extension) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + NTSTATUS Status; + UNICODE_STRING ParportPath; + RTL_QUERY_REGISTRY_TABLE RegTable[2]; + ULONG IdentifierHex; + ULONG zero; + + { + IdentifierHex = 12169; + zero = 0; + {} { + memset(RegTable, 0, sizeof(RegTable)); + RegTable[0].Flags = 36; + RegTable[0].EntryContext = &IdentifierHex; + RegTable[0].DefaultType = 4; + RegTable[0].DefaultData = &zero; + RegTable[0].DefaultLength = sizeof(ULONG); + Status = RtlQueryRegistryValues(1, ParportPath.Buffer, RegTable, + (void *)0, (void *)0); } - } else { - _L: /* CIL Label */ - if (Status != -1073741772L) { - { - } - { - } - { - PptDetectEcpPort(Extension); - PptDetectBytePort(Extension); + {} {} + if (Status >= 0L) { + if (IdentifierHex == 0UL) { + + } else { + goto _L; } - if (Extension->PnpInfo.HardwareCapabilities & 9UL) { - return (0L); + } else { + _L: /* CIL Label */ + if (Status != -1073741772L) { + {} {} { + PptDetectEcpPort(Extension); + PptDetectBytePort(Extension); + } + if (Extension->PnpInfo.HardwareCapabilities & 9UL) { + return (0L); + } else { + return (-1073741810L); + } } else { - return (-1073741810L); } + } + IdentifierHex = 12169; + if (__BLAST_NONDET) { + Status = 0L; } else { - + Status = 3221225473UL; } - } - IdentifierHex = 12169; - if (__BLAST_NONDET) { + {} { Status = PptDetectPortCapabilities(Extension); } + {} Status = 0L; - } else { - Status = 3221225473UL; - } - { - } - { - Status = PptDetectPortCapabilities(Extension); - } - { - } - Status = 0L; - { + {} + return (Status); } - return (Status); -} } -NTSTATUS PptDetectPortCapabilities(PDEVICE_EXTENSION Extension ) -{ NTSTATUS Status ; +NTSTATUS PptDetectPortCapabilities(PDEVICE_EXTENSION Extension) { + NTSTATUS Status; { - { - } - { - } - { - PptDetectEcpPort(Extension); - } - if (Extension->PnpInfo.HardwareCapabilities & 1UL) { - if (((unsigned long )Extension->PortInfo.Controller & 15UL) != 12UL) { - { - } - { - Status = PptFindNatChip(Extension); - } - if (Status >= 0L) { - if (! Extension->NationalChipFound) { - { - } - { - } - { - PptDetectEppPortIfDot3DevicePresent(Extension); - } - if (! Extension->CheckedForGenericEpp) { - { - PptDetectEppPortIfUserRequested(Extension); + {} {} { PptDetectEcpPort(Extension); } + if (Extension->PnpInfo.HardwareCapabilities & 1UL) { + if (((unsigned long)Extension->PortInfo.Controller & 15UL) != 12UL) { + {} { Status = PptFindNatChip(Extension); } + if (Status >= 0L) { + if (!Extension->NationalChipFound) { + {} {} { PptDetectEppPortIfDot3DevicePresent(Extension); } + if (!Extension->CheckedForGenericEpp) { + { PptDetectEppPortIfUserRequested(Extension); } + } else { } } else { - + {} + Extension->CheckedForGenericEpp = 1; } } else { - { - } - Extension->CheckedForGenericEpp = 1; } } else { - + goto _L; } } else { - goto _L; - } - } else { - _L: /* CIL Label */ - { + _L : /* CIL Label */ + {} + Extension->CheckedForGenericEpp = 1; } - Extension->CheckedForGenericEpp = 1; - } - { - } - { - PptDetectBytePort(Extension); - } - if (Extension->PnpInfo.HardwareCapabilities & 11UL) { - { + {} { PptDetectBytePort(Extension); } + if (Extension->PnpInfo.HardwareCapabilities & 11UL) { + {} + return (0L); + } else { } - return (0L); - } else { - - } - { + {} + return (-1073741810L); } - return (-1073741810L); -} } -void PptDetectEcpPort(PDEVICE_EXTENSION Extension ) -{ PUCHAR Controller ; - PUCHAR wPortDCR ; - PUCHAR wPortECR ; - UCHAR ecrLast ; - UCHAR ecr ; - UCHAR dcr ; +void PptDetectEcpPort(PDEVICE_EXTENSION Extension) { + PUCHAR Controller; + PUCHAR wPortDCR; + PUCHAR wPortECR; + UCHAR ecrLast; + UCHAR ecr; + UCHAR dcr; { - Controller = Extension->PortInfo.Controller; - wPortDCR = Controller + 2; - if ((unsigned int )((PUCHAR )0) == (unsigned int )Extension->PnpInfo.EcpController) { - { + Controller = Extension->PortInfo.Controller; + wPortDCR = Controller + 2; + if ((unsigned int)((PUCHAR)0) == + (unsigned int)Extension->PnpInfo.EcpController) { + {} + return; + } else { } - return; - } else { - - } - wPortECR = Extension->PnpInfo.EcpController + 2; - { - } - { - } - { - ecr = READ_PORT_UCHAR(wPortECR); - ecrLast = ecr; - } - { - } - { - dcr = (unsigned char)14; - WRITE_PORT_UCHAR(wPortDCR, dcr); - ecr = READ_PORT_UCHAR(wPortECR); - ecrLast = ecr; - } - { - } - if (((int )ecr & 3) == 3) { - goto _L; - } else { - if ((int )ecrLast == 255) { - _L: /* CIL Label */ - { + wPortECR = Extension->PnpInfo.EcpController + 2; + {} {} { + ecr = READ_PORT_UCHAR(wPortECR); + ecrLast = ecr; + } + {} { + dcr = (unsigned char)14; + WRITE_PORT_UCHAR(wPortDCR, dcr); + ecr = READ_PORT_UCHAR(wPortECR); + ecrLast = ecr; + } + {} + if (((int)ecr & 3) == 3) { + goto _L; + } else { + if ((int)ecrLast == 255) { + _L : /* CIL Label */ + {} + { + dcr = (unsigned char)12; + WRITE_PORT_UCHAR(wPortDCR, dcr); + } + return; + } else { } + } + if (((int)ecr & 3) == 2) { { - dcr = (unsigned char)12; - WRITE_PORT_UCHAR(wPortDCR, dcr); + dcr = (unsigned char)12; + WRITE_PORT_UCHAR(wPortDCR, dcr); + ecr = READ_PORT_UCHAR(wPortECR); + } + if (((int)ecr & 3) == 0) { + {} { + dcr = (unsigned char)12; + WRITE_PORT_UCHAR(wPortDCR, dcr); + } + return; + } else { } - return; } else { - } - } - if (((int )ecr & 3) == 2) { { - dcr = (unsigned char)12; - WRITE_PORT_UCHAR(wPortDCR, dcr); - ecr = READ_PORT_UCHAR(wPortECR); + WRITE_PORT_UCHAR(wPortECR, 20); + ecr = READ_PORT_UCHAR(wPortECR); } - if (((int )ecr & 3) == 0) { - { - } - { - dcr = (unsigned char)12; - WRITE_PORT_UCHAR(wPortDCR, dcr); + if (!(((int)ecr & 3) == 1)) { + {} { + dcr = (unsigned char)12; + WRITE_PORT_UCHAR(wPortDCR, dcr); } return; } else { - } - } else { - - } - { - WRITE_PORT_UCHAR(wPortECR, 20); - ecr = READ_PORT_UCHAR(wPortECR); - } - if (! (((int )ecr & 3) == 1)) { { + WRITE_PORT_UCHAR(wPortECR, ecrLast); + ecrLast = READ_PORT_UCHAR(wPortECR); + ecr = (unsigned char)((int)ecrLast & 31); + WRITE_PORT_UCHAR(wPortECR, (unsigned char)((int)ecr | 192)); + PptDetermineFifoWidth(Extension); } - { - dcr = (unsigned char)12; - WRITE_PORT_UCHAR(wPortDCR, dcr); + if (0UL != Extension->PnpInfo.FifoWidth) { + { + Extension->PnpInfo.HardwareCapabilities |= 1UL; + PptDetermineFifoDepth(Extension); + } + {} + } else { } + { WRITE_PORT_UCHAR(wPortECR, ecrLast); } return; - } else { - } +} +void PptDetectEppPortIfDot3DevicePresent(PDEVICE_EXTENSION Extension) { + NTSTATUS status; + PUCHAR Controller; + UCHAR Reverse; + UCHAR Forward; + BOOLEAN daisyChainDevicePresent; + PARALLEL_1284_COMMAND Command; + { - WRITE_PORT_UCHAR(wPortECR, ecrLast); - ecrLast = READ_PORT_UCHAR(wPortECR); - ecr = (unsigned char )((int )ecrLast & 31); - WRITE_PORT_UCHAR(wPortECR, (unsigned char )((int )ecr | 192)); - PptDetermineFifoWidth(Extension); - } - if (0UL != Extension->PnpInfo.FifoWidth) { + Controller = Extension->PortInfo.Controller; + Reverse = (unsigned char)38; + Forward = (unsigned char)6; + daisyChainDevicePresent = 0; + if (0UL == Extension->PnpInfo.Ieee1284_3DeviceCount) { + {} + return; + } else { + } { - Extension->PnpInfo.HardwareCapabilities |= 1UL; - PptDetermineFifoDepth(Extension); + Command.ID = 0; + Command.Port = 0; + Command.CommandFlags = 2UL; + status = PptTrySelectDevice(Extension, &Command); + } + if (!(status >= 0L)) { + {} + return; + } else { } { + PptDetectEppPort(Extension); + Command.ID = 0; + Command.Port = 0; + Command.CommandFlags = 2UL; + status = PptDeselectDevice(Extension, &Command); } - } else { - - } - { - WRITE_PORT_UCHAR(wPortECR, ecrLast); + if (!(status >= 0L)) { + {} + } else { + {} + } + return; } - return; -} } -void PptDetectEppPortIfDot3DevicePresent(PDEVICE_EXTENSION Extension ) -{ NTSTATUS status ; - PUCHAR Controller ; - UCHAR Reverse ; - UCHAR Forward ; - BOOLEAN daisyChainDevicePresent ; - PARALLEL_1284_COMMAND Command ; +void PptDetectEppPortIfUserRequested(PDEVICE_EXTENSION Extension) { + ULONG RequestEppTest; { - Controller = Extension->PortInfo.Controller; - Reverse = (unsigned char)38; - Forward = (unsigned char)6; - daisyChainDevicePresent = 0; - if (0UL == Extension->PnpInfo.Ieee1284_3DeviceCount) { - { + RequestEppTest = 0; + if (RequestEppTest) { + { PptDetectEppPort(Extension); } + } else { } return; - } else { - - } - { - Command.ID = 0; - Command.Port = 0; - Command.CommandFlags = 2UL; - status = PptTrySelectDevice(Extension, & Command); } - if (! (status >= 0L)) { - { - } - return; - } else { +} +void PptDetectEppPort(PDEVICE_EXTENSION Extension) { + PUCHAR Controller; + UCHAR dcr; + UCHAR i = __VERIFIER_nondet_char(); + UCHAR Reverse; + UCHAR Forward; + BOOLEAN daisyChainDevicePresent; + ULONG DisableEppTest; + UCHAR tmp; - } { - PptDetectEppPort(Extension); - Command.ID = 0; - Command.Port = 0; - Command.CommandFlags = 2UL; - status = PptDeselectDevice(Extension, & Command); - } - if (! (status >= 0L)) { - { + Reverse = (unsigned char)38; + Forward = (unsigned char)6; + daisyChainDevicePresent = 0; + DisableEppTest = 0; + {} { + Controller = Extension->PortInfo.Controller; + dcr = READ_PORT_UCHAR(Controller + 2); + Extension->PnpInfo.HardwareCapabilities |= 2UL; } - } else { - { + {} { + PptEcrSetMode(Extension, 148); + WRITE_PORT_UCHAR(Controller + 2, Reverse); + KeStallExecutionProcessor(5); + WRITE_PORT_UCHAR(Controller + 4, i); + WRITE_PORT_UCHAR(Controller + 2, Forward); + KeStallExecutionProcessor(5); + tmp = READ_PORT_UCHAR(Controller); } - } - return; -} -} -void PptDetectEppPortIfUserRequested(PDEVICE_EXTENSION Extension ) -{ ULONG RequestEppTest ; - - { - RequestEppTest = 0; - if (RequestEppTest) { - { - PptDetectEppPort(Extension); + if ((int)tmp != (int)i) { + Extension->PnpInfo.HardwareCapabilities &= 4294967293UL; + } else { } - } else { - - } - return; -} -} -void PptDetectEppPort(PDEVICE_EXTENSION Extension ) -{ PUCHAR Controller ; - UCHAR dcr ; - UCHAR i = __VERIFIER_nondet_char() ; - UCHAR Reverse ; - UCHAR Forward ; - BOOLEAN daisyChainDevicePresent ; - ULONG DisableEppTest ; - UCHAR tmp ; - - { - Reverse = (unsigned char)38; - Forward = (unsigned char)6; - daisyChainDevicePresent = 0; - DisableEppTest = 0; - { - } - { - Controller = Extension->PortInfo.Controller; - dcr = READ_PORT_UCHAR(Controller + 2); - Extension->PnpInfo.HardwareCapabilities |= 2UL; - } - { - } - { - PptEcrSetMode(Extension, 148); - WRITE_PORT_UCHAR(Controller + 2, Reverse); - KeStallExecutionProcessor(5); - WRITE_PORT_UCHAR(Controller + 4, i); - WRITE_PORT_UCHAR(Controller + 2, Forward); - KeStallExecutionProcessor(5); - tmp = READ_PORT_UCHAR(Controller); - } - if ((int )tmp != (int )i) { - Extension->PnpInfo.HardwareCapabilities &= 4294967293UL; - } else { - - } - { - PptEcrClearMode(Extension); - WRITE_PORT_UCHAR(Controller + 2, dcr); - Extension->CheckedForGenericEpp = 1; - } - if (Extension->PnpInfo.HardwareCapabilities & 2UL) { { + PptEcrClearMode(Extension); + WRITE_PORT_UCHAR(Controller + 2, dcr); + Extension->CheckedForGenericEpp = 1; } - } else { - { + if (Extension->PnpInfo.HardwareCapabilities & 2UL) { + {} + } else { + {} } + return; } - return; -} } -void PptDetectBytePort(PDEVICE_EXTENSION Extension ) -{ NTSTATUS Status ; +void PptDetectBytePort(PDEVICE_EXTENSION Extension) { + NTSTATUS Status; { - Status = 0L; - { - } - { - Status = PptSetByteMode(Extension, 52); - } - if (Status >= 0L) { - { - } - Extension->PnpInfo.HardwareCapabilities |= 8UL; - } else { - { + Status = 0L; + {} { Status = PptSetByteMode(Extension, 52); } + if (Status >= 0L) { + {} + Extension->PnpInfo.HardwareCapabilities |= 8UL; + } else { + {} } + { PptClearByteMode(Extension); } + return; } - { - PptClearByteMode(Extension); - } - return; } -} -void PptDetermineFifoDepth(PDEVICE_EXTENSION Extension ) -{ PUCHAR Controller ; - PUCHAR wPortECR ; - PUCHAR wPortDFIFO ; - UCHAR ecr ; - UCHAR ecrLast ; - ULONG wFifoDepth ; - UCHAR writeFifoDepth ; - UCHAR readFifoDepth ; - ULONG limitCount ; - UCHAR testData ; - UCHAR tmp ; - UCHAR tmp___0 ; - - { - { - Controller = Extension->PortInfo.Controller; - wPortECR = Extension->PnpInfo.EcpController + 2; - wPortDFIFO = Extension->PnpInfo.EcpController; - wFifoDepth = 0; - ecrLast = READ_PORT_UCHAR(wPortECR); - WRITE_PORT_UCHAR(wPortECR, 212); - ecr = READ_PORT_UCHAR(wPortECR); - } - if (((int )ecr & 3) == 1) { - writeFifoDepth = 0; - limitCount = 0; - { - while (1) { - while_148_continue: /* CIL Label */ ; +void PptDetermineFifoDepth(PDEVICE_EXTENSION Extension) { + PUCHAR Controller; + PUCHAR wPortECR; + PUCHAR wPortDFIFO; + UCHAR ecr; + UCHAR ecrLast; + ULONG wFifoDepth; + UCHAR writeFifoDepth; + UCHAR readFifoDepth; + ULONG limitCount; + UCHAR testData; + UCHAR tmp; + UCHAR tmp___0; + + { + { + Controller = Extension->PortInfo.Controller; + wPortECR = Extension->PnpInfo.EcpController + 2; + wPortDFIFO = Extension->PnpInfo.EcpController; + wFifoDepth = 0; + ecrLast = READ_PORT_UCHAR(wPortECR); + WRITE_PORT_UCHAR(wPortECR, 212); + ecr = READ_PORT_UCHAR(wPortECR); + } + if (((int)ecr & 3) == 1) { + writeFifoDepth = 0; + limitCount = 0; { - tmp = READ_PORT_UCHAR(wPortECR); - } - if (((int )tmp & 3) != 2) { - if (limitCount <= 4098UL) { + while (1) { + while_148_continue: /* CIL Label */; + { tmp = READ_PORT_UCHAR(wPortECR); } + if (((int)tmp & 3) != 2) { + if (limitCount <= 4098UL) { - } else { - goto while_148_break; + } else { + goto while_148_break; + } + } else { + goto while_148_break; + } + { + WRITE_PORT_UCHAR(wPortDFIFO, + (unsigned char)((int)writeFifoDepth & 255)); + writeFifoDepth = (UCHAR)((int)writeFifoDepth + 1); + limitCount += 1UL; + } } - } else { - goto while_148_break; + while_148_break: /* CIL Label */; } + {} + readFifoDepth = 0; + limitCount = 0; { - WRITE_PORT_UCHAR(wPortDFIFO, (unsigned char )((int )writeFifoDepth & 255)); - writeFifoDepth = (UCHAR )((int )writeFifoDepth + 1); - limitCount += 1UL; - } - } - while_148_break: /* CIL Label */ ; - } - { - } - readFifoDepth = 0; - limitCount = 0; - { - while (1) { - while_150_continue: /* CIL Label */ ; - { - tmp___0 = READ_PORT_UCHAR(wPortECR); - } - if (((int )tmp___0 & 3) != 1) { - if (limitCount <= 4098UL) { + while (1) { + while_150_continue: /* CIL Label */; + { tmp___0 = READ_PORT_UCHAR(wPortECR); } + if (((int)tmp___0 & 3) != 1) { + if (limitCount <= 4098UL) { - } else { - goto while_150_break; + } else { + goto while_150_break; + } + } else { + goto while_150_break; + } + { testData = READ_PORT_UCHAR(wPortDFIFO); } + if ((int)testData != ((int)readFifoDepth & 255)) { + { WRITE_PORT_UCHAR(wPortECR, ecrLast); } + {} + return; + } else { + } + readFifoDepth = (UCHAR)((int)readFifoDepth + 1); + limitCount += 1UL; } - } else { - goto while_150_break; - } - { - testData = READ_PORT_UCHAR(wPortDFIFO); + while_150_break: /* CIL Label */; } - if ((int )testData != ((int )readFifoDepth & 255)) { - { - WRITE_PORT_UCHAR(wPortECR, ecrLast); - } - { - } - return; + {} + if ((int)writeFifoDepth == (int)readFifoDepth) { + wFifoDepth = readFifoDepth; } else { - + { WRITE_PORT_UCHAR(wPortECR, ecrLast); } + {} + return; } - readFifoDepth = (UCHAR )((int )readFifoDepth + 1); - limitCount += 1UL; - } - while_150_break: /* CIL Label */ ; - } - { - } - if ((int )writeFifoDepth == (int )readFifoDepth) { - wFifoDepth = readFifoDepth; } else { - { - WRITE_PORT_UCHAR(wPortECR, ecrLast); - } - { - } + {} { WRITE_PORT_UCHAR(wPortECR, ecrLast); } return; } - } else { - { - } { - WRITE_PORT_UCHAR(wPortECR, ecrLast); + WRITE_PORT_UCHAR(wPortECR, ecrLast); + Extension->PnpInfo.FifoDepth = wFifoDepth; } return; } - { - WRITE_PORT_UCHAR(wPortECR, ecrLast); - Extension->PnpInfo.FifoDepth = wFifoDepth; - } - return; } -} -void PptDetermineFifoWidth(PDEVICE_EXTENSION Extension ) -{ PUCHAR Controller ; - UCHAR bConfigA ; - PUCHAR wPortECR ; +void PptDetermineFifoWidth(PDEVICE_EXTENSION Extension) { + PUCHAR Controller; + UCHAR bConfigA; + PUCHAR wPortECR; { - { - } - { - Controller = Extension->PortInfo.Controller; - wPortECR = Extension->PnpInfo.EcpController + 2; - WRITE_PORT_UCHAR(wPortECR, 244); - bConfigA = READ_PORT_UCHAR(Extension->PnpInfo.EcpController); - Extension->PnpInfo.FifoWidth = (unsigned long )(((int )bConfigA & 112) >> 4); - WRITE_PORT_UCHAR(wPortECR, 20); + {} { + Controller = Extension->PortInfo.Controller; + wPortECR = Extension->PnpInfo.EcpController + 2; + WRITE_PORT_UCHAR(wPortECR, 244); + bConfigA = READ_PORT_UCHAR(Extension->PnpInfo.EcpController); + Extension->PnpInfo.FifoWidth = + (unsigned long)(((int)bConfigA & 112) >> 4); + WRITE_PORT_UCHAR(wPortECR, 20); + } + return; } - return; } -} -NTSTATUS PptSetChipMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) -{ NTSTATUS Status ; - UCHAR EcrMode ; +NTSTATUS PptSetChipMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode) { + NTSTATUS Status; + UCHAR EcrMode; { - Status = 0L; - EcrMode = (unsigned char )((int )ChipMode & -32); - { - } - if (Extension->PnpInfo.CurrentMode != 0UL) { - { - } - Status = -1073741436L; - goto ExitSetChipModeNoChange; - } else { - - } - if (Extension_FilterMode) { - { - } - { - Status = (*(Extension->ChipInfo.ParChipSetMode))(Extension->ChipInfo.Context, - ChipMode); - } - } else { - { + Status = 0L; + EcrMode = (unsigned char)((int)ChipMode & -32); + {} + if (Extension->PnpInfo.CurrentMode != 0UL) { + {} + Status = -1073741436L; + goto ExitSetChipModeNoChange; + } else { } - if ((int )EcrMode == 96) { - if ((Extension->PnpInfo.HardwareCapabilities & 1UL) ^ 1UL) { - { - } - return (-1073741810L); - } else { - + if (Extension_FilterMode) { + {} { + Status = (*(Extension->ChipInfo.ParChipSetMode))( + Extension->ChipInfo.Context, ChipMode); } - { - Status = PptEcrSetMode(Extension, ChipMode); - } - goto ExitSetChipModeWithChanges; } else { - - } - if ((int )EcrMode == 128) { - if ((Extension->PnpInfo.HardwareCapabilities & 2UL) ^ 2UL) { - { + {} + if ((int)EcrMode == 96) { + if ((Extension->PnpInfo.HardwareCapabilities & 1UL) ^ 1UL) { + {} + return (-1073741810L); + } else { } - return (-1073741810L); + { Status = PptEcrSetMode(Extension, ChipMode); } + goto ExitSetChipModeWithChanges; } else { - - } - { - Status = PptEcrSetMode(Extension, ChipMode); } - goto ExitSetChipModeWithChanges; - } else { - - } - if ((int )EcrMode == 32) { - if ((Extension->PnpInfo.HardwareCapabilities & 8UL) ^ 8UL) { - { + if ((int)EcrMode == 128) { + if ((Extension->PnpInfo.HardwareCapabilities & 2UL) ^ 2UL) { + {} + return (-1073741810L); + } else { } - return (-1073741810L); + { Status = PptEcrSetMode(Extension, ChipMode); } + goto ExitSetChipModeWithChanges; } else { - } - { - Status = PptSetByteMode(Extension, ChipMode); + if ((int)EcrMode == 32) { + if ((Extension->PnpInfo.HardwareCapabilities & 8UL) ^ 8UL) { + {} + return (-1073741810L); + } else { + } + { Status = PptSetByteMode(Extension, ChipMode); } + goto ExitSetChipModeWithChanges; + } else { } - goto ExitSetChipModeWithChanges; - } else { - - } - } - ExitSetChipModeWithChanges: - if (Status >= 0L) { - { } - Extension->PnpInfo.CurrentMode = EcrMode; - } else { - { + ExitSetChipModeWithChanges: + if (Status >= 0L) { + {} + Extension->PnpInfo.CurrentMode = EcrMode; + } else { + {} } + ExitSetChipModeNoChange : {} + return (Status); } - ExitSetChipModeNoChange: - { - } - return (Status); -} } -NTSTATUS PptClearChipMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) -{ NTSTATUS Status ; - ULONG EcrMode ; +NTSTATUS PptClearChipMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode) { + NTSTATUS Status; + ULONG EcrMode; { - Status = -1073741823L; - EcrMode = (int )ChipMode & -32; - { - } - if (EcrMode != Extension->PnpInfo.CurrentMode) { - { - } - Status = -1073741436L; - goto ExitClearChipModeNoChange; - } else { - - } - if (Extension_FilterMode) { - { - } - { - Status = (*(Extension->ChipInfo.ParChipClearMode))(Extension->ChipInfo.Context, - ChipMode); - } - } else { - { - } - if (EcrMode == 96UL) { - { - Status = PptEcrClearMode(Extension); - } - goto ExitClearChipModeWithChanges; + Status = -1073741823L; + EcrMode = (int)ChipMode & -32; + {} + if (EcrMode != Extension->PnpInfo.CurrentMode) { + {} + Status = -1073741436L; + goto ExitClearChipModeNoChange; } else { - } - if (EcrMode == 128UL) { - { - Status = PptEcrClearMode(Extension); + if (Extension_FilterMode) { + {} { + Status = (*(Extension->ChipInfo.ParChipClearMode))( + Extension->ChipInfo.Context, ChipMode); } - goto ExitClearChipModeWithChanges; } else { - - } - if (EcrMode == 32UL) { - { - Status = PptClearByteMode(Extension); + {} + if (EcrMode == 96UL) { + { Status = PptEcrClearMode(Extension); } + goto ExitClearChipModeWithChanges; + } else { + } + if (EcrMode == 128UL) { + { Status = PptEcrClearMode(Extension); } + goto ExitClearChipModeWithChanges; + } else { + } + if (EcrMode == 32UL) { + { Status = PptClearByteMode(Extension); } + goto ExitClearChipModeWithChanges; + } else { } - goto ExitClearChipModeWithChanges; - } else { - } - } - ExitClearChipModeWithChanges: - if (Status >= 0L) { - { + ExitClearChipModeWithChanges: + if (Status >= 0L) { + {} + Extension->PnpInfo.CurrentMode = 0; + } else { } - Extension->PnpInfo.CurrentMode = 0; - } else { - - } - ExitClearChipModeNoChange: - { + ExitClearChipModeNoChange : {} + return (Status); } - return (Status); -} } -NTSTATUS PptEcrSetMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) -{ UCHAR ecr ; - PUCHAR Controller ; - PUCHAR wPortECR ; +NTSTATUS PptEcrSetMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode) { + UCHAR ecr; + PUCHAR Controller; + PUCHAR wPortECR; { - { - } - Controller = Extension->PortInfo.Controller; - wPortECR = Extension->PnpInfo.EcpController + 2; - { - } - { - ecr = READ_PORT_UCHAR(wPortECR); - Extension->EcrPortData = ecr; - ecr = (int )ecr & 31; - WRITE_PORT_UCHAR(wPortECR, (unsigned char )((int )ecr | 32)); - WRITE_PORT_UCHAR(wPortECR, ChipMode); - } - { + {} + Controller = Extension->PortInfo.Controller; + wPortECR = Extension->PnpInfo.EcpController + 2; + {} { + ecr = READ_PORT_UCHAR(wPortECR); + Extension->EcrPortData = ecr; + ecr = (int)ecr & 31; + WRITE_PORT_UCHAR(wPortECR, (unsigned char)((int)ecr | 32)); + WRITE_PORT_UCHAR(wPortECR, ChipMode); + } + {} + return (0L); } - return (0L); -} } -NTSTATUS PptSetByteMode(PDEVICE_EXTENSION Extension , UCHAR ChipMode ) -{ NTSTATUS Status ; +NTSTATUS PptSetByteMode(PDEVICE_EXTENSION Extension, UCHAR ChipMode) { + NTSTATUS Status; { - if (Extension->PnpInfo.HardwareCapabilities & 1UL) { - { - Status = PptEcrSetMode(Extension, ChipMode); + if (Extension->PnpInfo.HardwareCapabilities & 1UL) { + { Status = PptEcrSetMode(Extension, ChipMode); } + } else { } - } else { - - } - { - Status = PptCheckByteMode(Extension); + { Status = PptCheckByteMode(Extension); } + return (Status); } - return (Status); -} } -NTSTATUS PptClearByteMode(PDEVICE_EXTENSION Extension ) -{ NTSTATUS Status ; +NTSTATUS PptClearByteMode(PDEVICE_EXTENSION Extension) { + NTSTATUS Status; { - Status = 0L; - if (Extension->PnpInfo.HardwareCapabilities & 1UL) { - { - Status = PptEcrClearMode(Extension); + Status = 0L; + if (Extension->PnpInfo.HardwareCapabilities & 1UL) { + { Status = PptEcrClearMode(Extension); } + } else { } - } else { - + return (Status); } - return (Status); } -} -NTSTATUS PptCheckByteMode(PDEVICE_EXTENSION Extension ) -{ PUCHAR Controller ; - UCHAR dcr ; - UCHAR tmp ; - UCHAR tmp___0 ; +NTSTATUS PptCheckByteMode(PDEVICE_EXTENSION Extension) { + PUCHAR Controller; + UCHAR dcr; + UCHAR tmp; + UCHAR tmp___0; { - { - Controller = Extension->PortInfo.Controller; - dcr = READ_PORT_UCHAR(Controller + 2); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char )((int )dcr | 32)); - WRITE_PORT_UCHAR(Controller, (unsigned char)85); - tmp___0 = READ_PORT_UCHAR(Controller); - } - if ((int )tmp___0 == 85) { { - WRITE_PORT_UCHAR(Controller, (unsigned char)170); - tmp = READ_PORT_UCHAR(Controller); + Controller = Extension->PortInfo.Controller; + dcr = READ_PORT_UCHAR(Controller + 2); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)((int)dcr | 32)); + WRITE_PORT_UCHAR(Controller, (unsigned char)85); + tmp___0 = READ_PORT_UCHAR(Controller); } - if ((int )tmp == 170) { - return (-1073741823L); + if ((int)tmp___0 == 85) { + { + WRITE_PORT_UCHAR(Controller, (unsigned char)170); + tmp = READ_PORT_UCHAR(Controller); + } + if ((int)tmp == 170) { + return (-1073741823L); + } else { + } } else { - } - } else { - - } - { - WRITE_PORT_UCHAR(Controller + 2, dcr); - } - return (0L); -} -} -NTSTATUS PptEcrClearMode(PDEVICE_EXTENSION Extension ) -{ UCHAR ecr ; - PUCHAR Controller ; - PUCHAR wPortECR ; - - { - { - Controller = Extension->PortInfo.Controller; - ecr = Extension->EcrPortData; - Extension->EcrPortData = 0; - wPortECR = Extension->PnpInfo.EcpController + 2; - WRITE_PORT_UCHAR(wPortECR, (unsigned char )((int )ecr & 31)); - WRITE_PORT_UCHAR(wPortECR, ecr); + { WRITE_PORT_UCHAR(Controller + 2, dcr); } + return (0L); } - return (0L); -} } -NTSTATUS PptFindNatChip(PDEVICE_EXTENSION Extension ) -{ BOOLEAN found ; - BOOLEAN OkToLook ; - BOOLEAN Conflict ; - PUCHAR ChipAddr[4] ; - PUCHAR AddrList[4] ; - PUCHAR PortAddr ; - ULONG_PTR Port ; - UCHAR SaveIdx ; - UCHAR cr ; - UCHAR ii ; - NTSTATUS Status ; - ULONG ResourceDescriptorCount ; - ULONG ResourcesSize ; - PCM_RESOURCE_LIST Resources ; - ULONG NationalChecked ; - ULONG NationalChipFound ; - PVOID tmp ; - UCHAR tmp___0 ; - UCHAR tmp___1 ; - UCHAR tmp___2 ; - UCHAR tmp___3 ; - UCHAR tmp___4 ; - UCHAR tmp___5 ; - UCHAR tmp___6 ; - UCHAR tmp___7 ; - PDEVICE_OBJECT pdo ; +NTSTATUS PptEcrClearMode(PDEVICE_EXTENSION Extension) { + UCHAR ecr; + PUCHAR Controller; + PUCHAR wPortECR; { - found = 0; - OkToLook = 0; - ChipAddr[0] = (UCHAR *)920; - ChipAddr[1] = (UCHAR *)622; - ChipAddr[2] = (UCHAR *)348; - ChipAddr[3] = (UCHAR *)46; - AddrList[0] = (UCHAR *)888; - AddrList[1] = (UCHAR *)956; - AddrList[2] = (UCHAR *)632; - AddrList[3] = (UCHAR *)0; - NationalChecked = 0; - NationalChipFound = 0; - if ((int )Extension->NationalChecked == 1) { { + Controller = Extension->PortInfo.Controller; + ecr = Extension->EcrPortData; + Extension->EcrPortData = 0; + wPortECR = Extension->PnpInfo.EcpController + 2; + WRITE_PORT_UCHAR(wPortECR, (unsigned char)((int)ecr & 31)); + WRITE_PORT_UCHAR(wPortECR, ecr); } return (0L); - } else { - } - Extension->NationalChecked = 1; - if (NationalChecked) { - if (NationalChipFound) { - Extension->NationalChipFound = 1; +} +NTSTATUS PptFindNatChip(PDEVICE_EXTENSION Extension) { + BOOLEAN found; + BOOLEAN OkToLook; + BOOLEAN Conflict; + PUCHAR ChipAddr[4]; + PUCHAR AddrList[4]; + PUCHAR PortAddr; + ULONG_PTR Port; + UCHAR SaveIdx; + UCHAR cr; + UCHAR ii; + NTSTATUS Status; + ULONG ResourceDescriptorCount; + ULONG ResourcesSize; + PCM_RESOURCE_LIST Resources; + ULONG NationalChecked; + ULONG NationalChipFound; + PVOID tmp; + UCHAR tmp___0; + UCHAR tmp___1; + UCHAR tmp___2; + UCHAR tmp___3; + UCHAR tmp___4; + UCHAR tmp___5; + UCHAR tmp___6; + UCHAR tmp___7; + PDEVICE_OBJECT pdo; + + { + found = 0; + OkToLook = 0; + ChipAddr[0] = (UCHAR *)920; + ChipAddr[1] = (UCHAR *)622; + ChipAddr[2] = (UCHAR *)348; + ChipAddr[3] = (UCHAR *)46; + AddrList[0] = (UCHAR *)888; + AddrList[1] = (UCHAR *)956; + AddrList[2] = (UCHAR *)632; + AddrList[3] = (UCHAR *)0; + NationalChecked = 0; + NationalChipFound = 0; + if ((int)Extension->NationalChecked == 1) { + {} + return (0L); + } else { + } + Extension->NationalChecked = 1; + if (NationalChecked) { + if (NationalChipFound) { + Extension->NationalChipFound = 1; + } else { + Extension->NationalChipFound = 0; + } + return (0L); } else { - Extension->NationalChipFound = 0; } - return (0L); - } else { - - } - { - ResourceDescriptorCount = sizeof(ChipAddr) / sizeof(ULONG ); - ResourcesSize = (ULONG )sizeof(CM_RESOURCE_LIST ) + (ResourceDescriptorCount - 1UL) * (ULONG )sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR ); - tmp = ExAllocatePoolWithTag(0, ResourcesSize, 1349673296UL); - Resources = (struct _CM_RESOURCE_LIST *)tmp; - } - if ((unsigned int )Resources == (unsigned int )((void *)0)) { { + ResourceDescriptorCount = sizeof(ChipAddr) / sizeof(ULONG); + ResourcesSize = (ULONG)sizeof(CM_RESOURCE_LIST) + + (ResourceDescriptorCount - 1UL) * + (ULONG)sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); + tmp = ExAllocatePoolWithTag(0, ResourcesSize, 1349673296UL); + Resources = (struct _CM_RESOURCE_LIST *)tmp; } - return (-1073741823L); - } else { - - } - { - memset(Resources, 0, ResourcesSize); - Status = PptBuildResourceList(Extension, sizeof(ChipAddr) / sizeof(ULONG ), ChipAddr, - Resources); - } - if (! (Status >= 0L)) { - { - } - { -/* ExFreePool(Resources); */ /* INLINED */ - } - return (Status); - } else { - - } - { - Status = IoReportResourceUsage((void *)0, Extension->DriverObject, Resources, sizeof(Resources), - Extension->DeviceObject, (void *)0, 0, 0, & Conflict); -/* ExFreePool(Resources); */ /* INLINED */ - } - if (! (Status >= 0L)) { - { + if ((unsigned int)Resources == (unsigned int)((void *)0)) { + {} + return (-1073741823L); + } else { } - return (Status); - } else { - - } - if (Conflict) { { + memset(Resources, 0, ResourcesSize); + Status = PptBuildResourceList(Extension, sizeof(ChipAddr) / sizeof(ULONG), + ChipAddr, Resources); } - return (-1073741823L); - } else { - - } - ii = 0; - { - while (1) { - while_180_continue: /* CIL Label */ ; - if (! found) { - if ((int )ii < 4) { - - } else { - goto while_180_break; + if (!(Status >= 0L)) { + {} { /* ExFreePool(Resources); */ /* INLINED */ } + return (Status); } else { - goto while_180_break; } { - PortAddr = ChipAddr[ii]; - tmp___1 = READ_PORT_UCHAR(PortAddr); + Status = IoReportResourceUsage( + (void *)0, Extension->DriverObject, Resources, sizeof(Resources), + Extension->DeviceObject, (void *)0, 0, 0, &Conflict); + /* ExFreePool(Resources); */ /* INLINED */ } - if ((int )tmp___1 == 136) { - { - tmp___2 = READ_PORT_UCHAR(PortAddr); - } - if ((int )tmp___2 < 32) { - OkToLook = 1; - } else { - goto _L; - } + if (!(Status >= 0L)) { + {} + return (Status); } else { - _L: /* CIL Label */ - { - READ_PORT_UCHAR(PortAddr); - cr = READ_PORT_UCHAR(PortAddr); - } - if ((int )cr != 255) { - { - tmp___0 = READ_PORT_UCHAR(PortAddr); - } - if ((int )tmp___0 == (int )cr) { - OkToLook = 1; - } else { + } + if (Conflict) { + {} + return (-1073741823L); + } else { + } + ii = 0; + { + while (1) { + while_180_continue: /* CIL Label */; + if (!found) { + if ((int)ii < 4) { + } else { + goto while_180_break; + } + } else { + goto while_180_break; } - } else { - - } - } - if (OkToLook) { - { - OkToLook = 0; - WRITE_PORT_UCHAR(PortAddr, 8); - cr = READ_PORT_UCHAR(PortAddr); - } - if ((int )cr == 8) { { - tmp___3 = READ_PORT_UCHAR(PortAddr + 1); - cr = (unsigned char )((int )tmp___3 & 240); + PortAddr = ChipAddr[ii]; + tmp___1 = READ_PORT_UCHAR(PortAddr); } - if ((int )cr == 16) { - goto _L___0; + if ((int)tmp___1 == 136) { + { tmp___2 = READ_PORT_UCHAR(PortAddr); } + if ((int)tmp___2 < 32) { + OkToLook = 1; + } else { + goto _L; + } } else { - if ((int )cr == 80) { - goto _L___0; + _L : /* CIL Label */ + { + READ_PORT_UCHAR(PortAddr); + cr = READ_PORT_UCHAR(PortAddr); + } + if ((int)cr != 255) { + { tmp___0 = READ_PORT_UCHAR(PortAddr); } + if ((int)tmp___0 == (int)cr) { + OkToLook = 1; + } else { + } } else { - if ((int )cr == 112) { + } + } + if (OkToLook) { + { + OkToLook = 0; + WRITE_PORT_UCHAR(PortAddr, 8); + cr = READ_PORT_UCHAR(PortAddr); + } + if ((int)cr == 8) { + { + tmp___3 = READ_PORT_UCHAR(PortAddr + 1); + cr = (unsigned char)((int)tmp___3 & 240); + } + if ((int)cr == 16) { goto _L___0; } else { - if ((int )cr == 48) { + if ((int)cr == 80) { goto _L___0; } else { - if ((int )cr == 32) { + if ((int)cr == 112) { goto _L___0; } else { - if ((int )cr == 144) { + if ((int)cr == 48) { goto _L___0; } else { - if ((int )cr == 176) { + if ((int)cr == 32) { goto _L___0; } else { - if ((int )cr == 96) { - _L___0: /* CIL Label */ - { - found = 1; - WRITE_PORT_UCHAR(PortAddr, 1); - tmp___4 = READ_PORT_UCHAR(PortAddr + 1); - Port = (int )tmp___4 & 3; - } - if ((unsigned int )Extension->PortInfo.Controller == (unsigned int )AddrList[Port]) { - Extension->NationalChipFound = 1; + if ((int)cr == 144) { + goto _L___0; + } else { + if ((int)cr == 176) { + goto _L___0; } else { - + if ((int)cr == 96) { + _L___0 : /* CIL Label */ + { + found = 1; + WRITE_PORT_UCHAR(PortAddr, 1); + tmp___4 = READ_PORT_UCHAR(PortAddr + 1); + Port = (int)tmp___4 & 3; + } + if ((unsigned int)Extension->PortInfo.Controller == + (unsigned int)AddrList[Port]) { + Extension->NationalChipFound = 1; + } else { + } + } else { + } } - } else { - } } } } } } + } else { } + } else { } - } else { - - } - } else { - - } - if (! found) { - { - SaveIdx = READ_PORT_UCHAR(PortAddr); - WRITE_PORT_UCHAR(PortAddr, 32); - WRITE_PORT_UCHAR(PortAddr + 1, 0); - tmp___5 = READ_PORT_UCHAR(PortAddr + 1); - cr = (unsigned char )((int )tmp___5 & 248); - } - if ((int )cr == 192) { - goto _L___1; - } else { - if ((int )cr == 160) { - _L___1: /* CIL Label */ + if (!found) { { - found = 1; - WRITE_PORT_UCHAR(PortAddr, 7); - WRITE_PORT_UCHAR(PortAddr + 1, 4); - WRITE_PORT_UCHAR(PortAddr, 96); - tmp___6 = READ_PORT_UCHAR(PortAddr + 1); - Port = (unsigned long )(((int )tmp___6 << 8) & 65280); - WRITE_PORT_UCHAR(PortAddr, 97); - tmp___7 = READ_PORT_UCHAR(PortAddr + 1); - Port |= (unsigned long )tmp___7; + SaveIdx = READ_PORT_UCHAR(PortAddr); + WRITE_PORT_UCHAR(PortAddr, 32); + WRITE_PORT_UCHAR(PortAddr + 1, 0); + tmp___5 = READ_PORT_UCHAR(PortAddr + 1); + cr = (unsigned char)((int)tmp___5 & 248); } - if ((unsigned int )Extension->PortInfo.Controller == (unsigned int )((UCHAR *)Port)) { - Extension->NationalChipFound = 1; + if ((int)cr == 192) { + goto _L___1; } else { - + if ((int)cr == 160) { + _L___1 : /* CIL Label */ + { + found = 1; + WRITE_PORT_UCHAR(PortAddr, 7); + WRITE_PORT_UCHAR(PortAddr + 1, 4); + WRITE_PORT_UCHAR(PortAddr, 96); + tmp___6 = READ_PORT_UCHAR(PortAddr + 1); + Port = (unsigned long)(((int)tmp___6 << 8) & 65280); + WRITE_PORT_UCHAR(PortAddr, 97); + tmp___7 = READ_PORT_UCHAR(PortAddr + 1); + Port |= (unsigned long)tmp___7; + } + if ((unsigned int)Extension->PortInfo.Controller == + (unsigned int)((UCHAR *)Port)) { + Extension->NationalChipFound = 1; + } else { + } + } else { + { WRITE_PORT_UCHAR(PortAddr, SaveIdx); } + } } } else { - { - WRITE_PORT_UCHAR(PortAddr, SaveIdx); - } } + ii = (UCHAR)((int)ii + 1); } + while_180_break: /* CIL Label */; + } + pdo = Extension->PhysicalDeviceObject; + NationalChecked = 1; + if (Extension->NationalChipFound) { + NationalChipFound = 1; } else { - + NationalChipFound = 0; } - ii = (UCHAR )((int )ii + 1); - } - while_180_break: /* CIL Label */ ; - } - pdo = Extension->PhysicalDeviceObject; - NationalChecked = 1; - if (Extension->NationalChipFound) { - NationalChipFound = 1; - } else { - NationalChipFound = 0; - } - { - Status = IoReportResourceUsage((void *)0, Extension->DriverObject, (void *)0, 0, - Extension->DeviceObject, (void *)0, 0, 0, & Conflict); - } - { + { + Status = IoReportResourceUsage((void *)0, Extension->DriverObject, + (void *)0, 0, Extension->DeviceObject, + (void *)0, 0, 0, &Conflict); + } + {} + return (Status); } - return (Status); -} } -NTSTATUS PptBuildResourceList(PDEVICE_EXTENSION Extension , ULONG Partial , PULONG Addresses , - PCM_RESOURCE_LIST Resources ) -{ UCHAR i ; +NTSTATUS PptBuildResourceList(PDEVICE_EXTENSION Extension, ULONG Partial, + PULONG Addresses, PCM_RESOURCE_LIST Resources) { + UCHAR i; { - Resources->Count = 1; - Resources->List[0].InterfaceType = Extension->InterfaceType; - Resources->List[0].BusNumber = Extension->BusNumber; - Resources->List[0].PartialResourceList.Version = 0; - Resources->List[0].PartialResourceList.Revision = 0; - Resources->List[0].PartialResourceList.Count = Partial; - i = 0; - { - while (1) { - while_182_continue: /* CIL Label */ ; - if ((ULONG )i < Partial) { + Resources->Count = 1; + Resources->List[0].InterfaceType = Extension->InterfaceType; + Resources->List[0].BusNumber = Extension->BusNumber; + Resources->List[0].PartialResourceList.Version = 0; + Resources->List[0].PartialResourceList.Revision = 0; + Resources->List[0].PartialResourceList.Count = Partial; + i = 0; + { + while (1) { + while_182_continue: /* CIL Label */; + if ((ULONG)i < Partial) { - } else { - goto while_182_break; + } else { + goto while_182_break; + } + Resources->List[0].PartialResourceList.PartialDescriptors[i].Type = 1; + Resources->List[0] + .PartialResourceList.PartialDescriptors[i] + .ShareDisposition = 2; + Resources->List[0].PartialResourceList.PartialDescriptors[i].Flags = 1; + Resources->List[0] + .PartialResourceList.PartialDescriptors[i] + .u.Port.Start.QuadPart = *(Addresses + i); + Resources->List[0] + .PartialResourceList.PartialDescriptors[i] + .u.Port.Length = 2UL; + i = (UCHAR)((int)i + 1); + } + while_182_break: /* CIL Label */; } - Resources->List[0].PartialResourceList.PartialDescriptors[i].Type = 1; - Resources->List[0].PartialResourceList.PartialDescriptors[i].ShareDisposition = 2; - Resources->List[0].PartialResourceList.PartialDescriptors[i].Flags = 1; - Resources->List[0].PartialResourceList.PartialDescriptors[i].u.Port.Start.QuadPart = *(Addresses + i); - Resources->List[0].PartialResourceList.PartialDescriptors[i].u.Port.Length = 2UL; - i = (UCHAR )((int )i + 1); - } - while_182_break: /* CIL Label */ ; + return (0L); } - return (0L); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once #pragma once - struct _GUID const GUID_PARALLEL_DEVICE = {2549575408U, 63619, 4560, {175, 31, 0, 0, 248, 0, 132, 92}}; - struct _GUID const GUID_PARCLASS_DEVICE = {2166343333U, 63272, 4560, {165, 55, 0, 0, 248, 117, 62, 209}}; -ULONG PptDebugLevel = 0UL; -ULONG PptBreakOn = 0UL; -UNICODE_STRING RegistryPath = {0, 0, 0}; -LONG PortInfoReferenceCount = -1L; -PFAST_MUTEX PortInfoMutex = (void *)0; -union _LARGE_INTEGER const PhysicalZero = {{0, 0L}}; -UCHAR PptDot3Retries = 5; +struct _GUID const GUID_PARALLEL_DEVICE = { + 2549575408U, 63619, 4560, {175, 31, 0, 0, 248, 0, 132, 92}}; +struct _GUID const GUID_PARCLASS_DEVICE = { + 2166343333U, 63272, 4560, {165, 55, 0, 0, 248, 117, 62, 209}}; +ULONG PptDebugLevel = 0UL; +ULONG PptBreakOn = 0UL; +UNICODE_STRING RegistryPath = {0, 0, 0}; +LONG PortInfoReferenceCount = -1L; +PFAST_MUTEX PortInfoMutex = (void *)0; +union _LARGE_INTEGER const PhysicalZero = {{0, 0L}}; +UCHAR PptDot3Retries = 5; #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -NTSTATUS PptPnpFilterResourceRequirements(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpQueryDeviceRelations(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpQueryStopDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpCancelStopDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpStopDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpQueryRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpCancelRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpSurpriseRemoval(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpUnhandledIrp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ; -NTSTATUS PptPnpStartValidateResources(PDEVICE_OBJECT DeviceObject , BOOLEAN FoundPort , - BOOLEAN FoundIrq , BOOLEAN FoundDma ) ; -NTSTATUS PptPnpStartScanCmResourceList(PDEVICE_EXTENSION Extension , PIRP Irp , PBOOLEAN FoundPort , - PBOOLEAN FoundIrq , PBOOLEAN FoundDma ) ; -NTSTATUS PptPnpPassThroughPnpIrpAndReleaseRemoveLock(PDEVICE_EXTENSION Extension , - PIRP Irp ) ; -void PptPnpFilterNukeIrqResourceDescriptors(PIO_RESOURCE_LIST IoResourceList ) ; -void PptPnpFilterNukeIrqResourceDescriptorsFromAllLists(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) ; -BOOLEAN PptPnpFilterExistsNonIrqResourceList(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) ; -PVOID PptPnpFilterGetEndOfResourceRequirementsList(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) ; -BOOLEAN PptPnpListContainsIrqResourceDescriptor(PIO_RESOURCE_LIST List ) ; -void PptPnpFilterRemoveIrqResourceLists(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) ; -NTSTATUS PptPnpBounceAndCatchPnpIrp(PDEVICE_EXTENSION Extension , PIRP Irp ) ; -PDEVICE_RELATIONS PptPnpBuildRemovalRelations(PDEVICE_EXTENSION Extension ) -{ PDEVICE_RELATIONS relations ; - PLIST_ENTRY listHead ; - PLIST_ENTRY thisListEntry ; - PLIST_ENTRY firstListEntry ; - BOOLEAN done ; - PREMOVAL_RELATIONS_LIST_ENTRY node ; - ULONG count ; - ULONG i ; - PDEVICE_OBJECT pDevObj ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; - PLIST_ENTRY _EX_Flink___0 ; - PLIST_ENTRY _EX_ListHead ; - PLIST_ENTRY _EX_Blink___0 ; - PLIST_ENTRY _EX_ListHead___0 ; - PVOID tmp ; - PLIST_ENTRY _EX_Blink___1 ; - PLIST_ENTRY _EX_Flink___1 ; - PLIST_ENTRY _EX_Blink___2 ; - PLIST_ENTRY _EX_ListHead___1 ; - - { - relations = (void *)0; - listHead = & Extension->RemovalRelationsList; - thisListEntry = (void *)0; - firstListEntry = (void *)0; - done = 0; - node = (void *)0; - { - } - { -/* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - if ((unsigned int )listHead->Flink == (unsigned int )listHead) { - { - } - goto targetExit; - } else { - - } - count = 0; - { - while (1) { - while_185_continue: /* CIL Label */ ; - if (! done) { - - } else { - goto while_185_break; - } - thisListEntry = listHead->Flink; - _EX_Flink = (listHead->Flink)->Flink; - _EX_Blink = (listHead->Flink)->Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - node = (REMOVAL_RELATIONS_LIST_ENTRY *)((CHAR *)thisListEntry - (unsigned long )(& ((REMOVAL_RELATIONS_LIST_ENTRY *)0)->ListEntry)); - if ((unsigned int )firstListEntry == (unsigned int )thisListEntry) { - _EX_ListHead = listHead; - _EX_Flink___0 = _EX_ListHead->Flink; - node->ListEntry.Flink = _EX_Flink___0; - node->ListEntry.Blink = _EX_ListHead; - _EX_Flink___0->Blink = & node->ListEntry; - _EX_ListHead->Flink = & node->ListEntry; - done = 1; - { - } - } else { - { - } - _EX_ListHead___0 = listHead; - _EX_Blink___0 = _EX_ListHead___0->Blink; - node->ListEntry.Flink = _EX_ListHead___0; - node->ListEntry.Blink = _EX_Blink___0; - _EX_Blink___0->Flink = & node->ListEntry; - _EX_ListHead___0->Blink = & node->ListEntry; - count += 1UL; - } - if (! firstListEntry) { - { - } - firstListEntry = thisListEntry; +NTSTATUS PptPnpFilterResourceRequirements(PDEVICE_OBJECT DeviceObject, + PIRP Irp); +NTSTATUS PptPnpQueryDeviceRelations(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpQueryStopDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpCancelStopDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpStopDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpQueryRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpCancelRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpSurpriseRemoval(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpUnhandledIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PptPnpStartValidateResources(PDEVICE_OBJECT DeviceObject, + BOOLEAN FoundPort, BOOLEAN FoundIrq, + BOOLEAN FoundDma); +NTSTATUS PptPnpStartScanCmResourceList(PDEVICE_EXTENSION Extension, PIRP Irp, + PBOOLEAN FoundPort, PBOOLEAN FoundIrq, + PBOOLEAN FoundDma); +NTSTATUS +PptPnpPassThroughPnpIrpAndReleaseRemoveLock(PDEVICE_EXTENSION Extension, + PIRP Irp); +void PptPnpFilterNukeIrqResourceDescriptors(PIO_RESOURCE_LIST IoResourceList); +void PptPnpFilterNukeIrqResourceDescriptorsFromAllLists( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList); +BOOLEAN PptPnpFilterExistsNonIrqResourceList( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList); +PVOID PptPnpFilterGetEndOfResourceRequirementsList( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList); +BOOLEAN PptPnpListContainsIrqResourceDescriptor(PIO_RESOURCE_LIST List); +void PptPnpFilterRemoveIrqResourceLists( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList); +NTSTATUS PptPnpBounceAndCatchPnpIrp(PDEVICE_EXTENSION Extension, PIRP Irp); +PDEVICE_RELATIONS PptPnpBuildRemovalRelations(PDEVICE_EXTENSION Extension) { + PDEVICE_RELATIONS relations; + PLIST_ENTRY listHead; + PLIST_ENTRY thisListEntry; + PLIST_ENTRY firstListEntry; + BOOLEAN done; + PREMOVAL_RELATIONS_LIST_ENTRY node; + ULONG count; + ULONG i; + PDEVICE_OBJECT pDevObj; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; + PLIST_ENTRY _EX_Flink___0; + PLIST_ENTRY _EX_ListHead; + PLIST_ENTRY _EX_Blink___0; + PLIST_ENTRY _EX_ListHead___0; + PVOID tmp; + PLIST_ENTRY _EX_Blink___1; + PLIST_ENTRY _EX_Flink___1; + PLIST_ENTRY _EX_Blink___2; + PLIST_ENTRY _EX_ListHead___1; + + { + relations = (void *)0; + listHead = &Extension->RemovalRelationsList; + thisListEntry = (void *)0; + firstListEntry = (void *)0; + done = 0; + node = (void *)0; + {} { + /* ExAcquireFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + } + if ((unsigned int)listHead->Flink == (unsigned int)listHead) { + {} + goto targetExit; } else { - } - } - while_185_break: /* CIL Label */ ; - } - { - } - { - tmp = ExAllocatePoolWithTag(1, (ULONG )sizeof(DEVICE_RELATIONS ) + (count - 1UL) * (ULONG )sizeof(PDEVICE_OBJECT ), - 1349673296UL); - relations = tmp; - } - if (! relations) { + count = 0; { - } - goto targetExit; - } else { + while (1) { + while_185_continue: /* CIL Label */; + if (!done) { - } - relations->Count = count; - i = 0; - { - while (1) { - while_191_continue: /* CIL Label */ ; - if (i < count) { - - } else { - goto while_191_break; + } else { + goto while_185_break; + } + thisListEntry = listHead->Flink; + _EX_Flink = (listHead->Flink)->Flink; + _EX_Blink = (listHead->Flink)->Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + node = (REMOVAL_RELATIONS_LIST_ENTRY + *)((CHAR *)thisListEntry - + (unsigned long)(&((REMOVAL_RELATIONS_LIST_ENTRY *)0) + ->ListEntry)); + if ((unsigned int)firstListEntry == (unsigned int)thisListEntry) { + _EX_ListHead = listHead; + _EX_Flink___0 = _EX_ListHead->Flink; + node->ListEntry.Flink = _EX_Flink___0; + node->ListEntry.Blink = _EX_ListHead; + _EX_Flink___0->Blink = &node->ListEntry; + _EX_ListHead->Flink = &node->ListEntry; + done = 1; + {} + } else { + {} + _EX_ListHead___0 = listHead; + _EX_Blink___0 = _EX_ListHead___0->Blink; + node->ListEntry.Flink = _EX_ListHead___0; + node->ListEntry.Blink = _EX_Blink___0; + _EX_Blink___0->Flink = &node->ListEntry; + _EX_ListHead___0->Blink = &node->ListEntry; + count += 1UL; + } + if (!firstListEntry) { + {} + firstListEntry = thisListEntry; + } else { + } + } + while_185_break: /* CIL Label */; } - thisListEntry = listHead->Flink; - _EX_Flink___1 = (listHead->Flink)->Flink; - _EX_Blink___1 = (listHead->Flink)->Blink; - _EX_Blink___1->Flink = _EX_Flink___1; - _EX_Flink___1->Blink = _EX_Blink___1; - node = (REMOVAL_RELATIONS_LIST_ENTRY *)((CHAR *)thisListEntry - (unsigned long )(& ((REMOVAL_RELATIONS_LIST_ENTRY *)0)->ListEntry)); - { + {} { + tmp = ExAllocatePoolWithTag(1, + (ULONG)sizeof(DEVICE_RELATIONS) + + (count - 1UL) * + (ULONG)sizeof(PDEVICE_OBJECT), + 1349673296UL); + relations = tmp; } - { - pDevObj = node->DeviceObject; - ObfReferenceObject(pDevObj); - relations->Objects[i] = pDevObj; - _EX_ListHead___1 = listHead; - _EX_Blink___2 = _EX_ListHead___1->Blink; - node->ListEntry.Flink = _EX_ListHead___1; - node->ListEntry.Blink = _EX_Blink___2; - _EX_Blink___2->Flink = & node->ListEntry; - _EX_ListHead___1->Blink = & node->ListEntry; - i += 1UL; + if (!relations) { + {} + goto targetExit; + } else { } - } - while_191_break: /* CIL Label */ ; - } - targetExit: - { -/* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ - } - return (relations); -} -} -NTSTATUS PptPnpStartScanPciCardCmResourceList(PDEVICE_EXTENSION Extension , PIRP Irp , - PBOOLEAN FoundPort , PBOOLEAN FoundIrq , - PBOOLEAN FoundDma ) -{ NTSTATUS status ; - PIO_STACK_LOCATION irpStack ; - PCM_RESOURCE_LIST ResourceList ; - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor ; - PCM_PARTIAL_RESOURCE_LIST PartialResourceList ; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor ; - ULONG i ; - ULONG length ; - - { - status = 0L; - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - { - } - *FoundPort = 0; - *FoundIrq = 0; - *FoundDma = 0; - ResourceList = irpStack->Parameters.StartDevice.AllocatedResourcesTranslated; - FullResourceDescriptor = & ResourceList->List[0]; - if (FullResourceDescriptor) { - Extension->InterfaceType = FullResourceDescriptor->InterfaceType; - PartialResourceList = & FullResourceDescriptor->PartialResourceList; + relations->Count = count; i = 0; { - while (1) { - while_194_continue: /* CIL Label */ ; - if (i < PartialResourceList->Count) { + while (1) { + while_191_continue: /* CIL Label */; + if (i < count) { - } else { - goto while_194_break; - } - PartialResourceDescriptor = & PartialResourceList->PartialDescriptors[i]; - if (PartialResourceDescriptor->Type == 1) { - goto switch_195_1; - } else { - if (PartialResourceDescriptor->Type == 6) { - goto switch_195_6; } else { - if (PartialResourceDescriptor->Type == 2) { - goto switch_195_2; + goto while_191_break; + } + thisListEntry = listHead->Flink; + _EX_Flink___1 = (listHead->Flink)->Flink; + _EX_Blink___1 = (listHead->Flink)->Blink; + _EX_Blink___1->Flink = _EX_Flink___1; + _EX_Flink___1->Blink = _EX_Blink___1; + node = (REMOVAL_RELATIONS_LIST_ENTRY + *)((CHAR *)thisListEntry - + (unsigned long)(&((REMOVAL_RELATIONS_LIST_ENTRY *)0) + ->ListEntry)); + {} { + pDevObj = node->DeviceObject; + ObfReferenceObject(pDevObj); + relations->Objects[i] = pDevObj; + _EX_ListHead___1 = listHead; + _EX_Blink___2 = _EX_ListHead___1->Blink; + node->ListEntry.Flink = _EX_ListHead___1; + node->ListEntry.Blink = _EX_Blink___2; + _EX_Blink___2->Flink = &node->ListEntry; + _EX_ListHead___1->Blink = &node->ListEntry; + i += 1UL; + } + } + while_191_break: /* CIL Label */; + } + targetExit : { + /* ExReleaseFastMutex(& Extension->ExtensionFastMutex); */ /* INLINED */ + } + return (relations); + } +} +NTSTATUS PptPnpStartScanPciCardCmResourceList(PDEVICE_EXTENSION Extension, + PIRP Irp, PBOOLEAN FoundPort, + PBOOLEAN FoundIrq, + PBOOLEAN FoundDma) { + NTSTATUS status; + PIO_STACK_LOCATION irpStack; + PCM_RESOURCE_LIST ResourceList; + PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; + PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor; + ULONG i; + ULONG length; + + { + status = 0L; + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + {} *FoundPort = 0; + *FoundIrq = 0; + *FoundDma = 0; + ResourceList = + irpStack->Parameters.StartDevice.AllocatedResourcesTranslated; + FullResourceDescriptor = &ResourceList->List[0]; + if (FullResourceDescriptor) { + Extension->InterfaceType = FullResourceDescriptor->InterfaceType; + PartialResourceList = &FullResourceDescriptor->PartialResourceList; + i = 0; + { + while (1) { + while_194_continue: /* CIL Label */; + if (i < PartialResourceList->Count) { + + } else { + goto while_194_break; + } + PartialResourceDescriptor = + &PartialResourceList->PartialDescriptors[i]; + if (PartialResourceDescriptor->Type == 1) { + goto switch_195_1; } else { - if (PartialResourceDescriptor->Type == 4) { - goto switch_195_4; + if (PartialResourceDescriptor->Type == 6) { + goto switch_195_6; } else { - { - goto switch_195_default; - if (0) { - switch_195_1: /* CIL Label */ - length = PartialResourceDescriptor->u.Port.Length; - if (length == 8) { - goto switch_196_8; + if (PartialResourceDescriptor->Type == 2) { + goto switch_195_2; + } else { + if (PartialResourceDescriptor->Type == 4) { + goto switch_195_4; } else { - if (length == 4) { - goto switch_196_4; - } else { - { - goto switch_196_default; + { + goto switch_195_default; if (0) { - switch_196_8: /* CIL Label */ ; - { - } - Extension->PortInfo.OriginalController = PartialResourceDescriptor->u.Port.Start; - Extension->PortInfo.SpanOfController = PartialResourceDescriptor->u.Port.Length; - Extension->PortInfo.Controller = (UCHAR *)((unsigned long )Extension->PortInfo.OriginalController.QuadPart); - Extension->AddressSpace = PartialResourceDescriptor->Flags; - *FoundPort = 1; - goto switch_196_break; - switch_196_4: /* CIL Label */ ; - { + switch_195_1: /* CIL Label */ + length = PartialResourceDescriptor->u.Port.Length; + if (length == 8) { + goto switch_196_8; + } else { + if (length == 4) { + goto switch_196_4; + } else { + { + goto switch_196_default; + if (0) { + switch_196_8: /* CIL Label */; + {} + Extension->PortInfo.OriginalController = + PartialResourceDescriptor->u.Port.Start; + Extension->PortInfo.SpanOfController = + PartialResourceDescriptor->u.Port.Length; + Extension->PortInfo.Controller = + (UCHAR *)((unsigned long)Extension->PortInfo + .OriginalController.QuadPart); + Extension->AddressSpace = + PartialResourceDescriptor->Flags; + *FoundPort = 1; + goto switch_196_break; + switch_196_4: /* CIL Label */; + {} + Extension->PnpInfo.OriginalEcpController = + PartialResourceDescriptor->u.Port.Start; + Extension->PnpInfo.SpanOfEcpController = + PartialResourceDescriptor->u.Port.Length; + Extension->PnpInfo.EcpController = + (UCHAR *)((unsigned long)Extension->PnpInfo + .OriginalEcpController + .QuadPart); + Extension->EcpAddressSpace = + PartialResourceDescriptor->Flags; + goto switch_196_break; + switch_196_default: /* CIL Label */; + {} + } else { + switch_196_break: /* CIL Label */; + } + } + } } - Extension->PnpInfo.OriginalEcpController = PartialResourceDescriptor->u.Port.Start; - Extension->PnpInfo.SpanOfEcpController = PartialResourceDescriptor->u.Port.Length; - Extension->PnpInfo.EcpController = (UCHAR *)((unsigned long )Extension->PnpInfo.OriginalEcpController.QuadPart); - Extension->EcpAddressSpace = PartialResourceDescriptor->Flags; - goto switch_196_break; - switch_196_default: /* CIL Label */ ; - { + goto switch_195_break; + switch_195_6: /* CIL Label */ + Extension->BusNumber = + PartialResourceDescriptor->u.BusNumber.Start; + goto switch_195_break; + switch_195_2: /* CIL Label */ + *FoundIrq = 1; + Extension->FoundInterrupt = 1; + Extension->InterruptLevel = + (unsigned char) + PartialResourceDescriptor->u.Interrupt.Level; + Extension->InterruptVector = + PartialResourceDescriptor->u.Interrupt.Vector; + Extension->InterruptAffinity = + PartialResourceDescriptor->u.Interrupt.Affinity; + if ((int)PartialResourceDescriptor->Flags & 1) { + Extension->InterruptMode = 1; + } else { + Extension->InterruptMode = 0; } + goto switch_195_break; + switch_195_4: /* CIL Label */ + *FoundDma = 1; + Extension->DmaChannel = + PartialResourceDescriptor->u.Dma.Channel; + Extension->DmaPort = + PartialResourceDescriptor->u.Dma.Port; + Extension->DmaWidth = PartialResourceDescriptor->Flags; + goto switch_195_break; + switch_195_default: /* CIL Label */; + goto switch_195_break; } else { - switch_196_break: /* CIL Label */ ; - } + switch_195_break: /* CIL Label */; } } } - goto switch_195_break; - switch_195_6: /* CIL Label */ - Extension->BusNumber = PartialResourceDescriptor->u.BusNumber.Start; - goto switch_195_break; - switch_195_2: /* CIL Label */ - *FoundIrq = 1; - Extension->FoundInterrupt = 1; - Extension->InterruptLevel = (unsigned char )PartialResourceDescriptor->u.Interrupt.Level; - Extension->InterruptVector = PartialResourceDescriptor->u.Interrupt.Vector; - Extension->InterruptAffinity = PartialResourceDescriptor->u.Interrupt.Affinity; - if ((int )PartialResourceDescriptor->Flags & 1) { - Extension->InterruptMode = 1; - } else { - Extension->InterruptMode = 0; - } - goto switch_195_break; - switch_195_4: /* CIL Label */ - *FoundDma = 1; - Extension->DmaChannel = PartialResourceDescriptor->u.Dma.Channel; - Extension->DmaPort = PartialResourceDescriptor->u.Dma.Port; - Extension->DmaWidth = PartialResourceDescriptor->Flags; - goto switch_195_break; - switch_195_default: /* CIL Label */ ; - goto switch_195_break; - } else { - switch_195_break: /* CIL Label */ ; - } } } } + i += 1UL; } + while_194_break: /* CIL Label */; } - i += 1UL; - } - while_194_break: /* CIL Label */ ; + } else { } - } else { - + return (status); } - return (status); -} } -BOOLEAN PptIsPci(PDEVICE_EXTENSION Extension , PIRP Irp ) -{ NTSTATUS status ; - PIO_STACK_LOCATION irpStack ; - PCM_RESOURCE_LIST ResourceList ; - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor ; - PCM_PARTIAL_RESOURCE_LIST PartialResourceList ; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor ; - ULONG i ; - ULONG portResourceDescriptorCount ; - BOOLEAN largePortRangeFound ; - ULONG rangeLength ; - - { - status = 0L; - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - portResourceDescriptorCount = 0; - largePortRangeFound = 0; - ResourceList = irpStack->Parameters.StartDevice.AllocatedResourcesTranslated; - if ((unsigned int )ResourceList == (unsigned int )((void *)0)) { - { - } - return (0); - } else { - - } - FullResourceDescriptor = & ResourceList->List[0]; - if (FullResourceDescriptor) { - { +BOOLEAN PptIsPci(PDEVICE_EXTENSION Extension, PIRP Irp) { + NTSTATUS status; + PIO_STACK_LOCATION irpStack; + PCM_RESOURCE_LIST ResourceList; + PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; + PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor; + ULONG i; + ULONG portResourceDescriptorCount; + BOOLEAN largePortRangeFound; + ULONG rangeLength; + + { + status = 0L; + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + portResourceDescriptorCount = 0; + largePortRangeFound = 0; + ResourceList = + irpStack->Parameters.StartDevice.AllocatedResourcesTranslated; + if ((unsigned int)ResourceList == (unsigned int)((void *)0)) { + {} + return (0); + } else { } - PartialResourceList = & FullResourceDescriptor->PartialResourceList; - i = 0; - { - while (1) { - while_202_continue: /* CIL Label */ ; - if (i < PartialResourceList->Count) { + FullResourceDescriptor = &ResourceList->List[0]; + if (FullResourceDescriptor) { + {} + PartialResourceList = &FullResourceDescriptor->PartialResourceList; + i = 0; + { + while (1) { + while_202_continue: /* CIL Label */; + if (i < PartialResourceList->Count) { - } else { - goto while_202_break; - } - PartialResourceDescriptor = & PartialResourceList->PartialDescriptors[i]; - if (PartialResourceDescriptor->Type == 1) { - goto switch_203_1; - } else { - { - goto switch_203_default; - if (0) { - switch_203_1: /* CIL Label */ - rangeLength = PartialResourceDescriptor->u.Port.Length; - { + } else { + goto while_202_break; } - portResourceDescriptorCount += 1UL; - if (rangeLength > 8UL) { + PartialResourceDescriptor = + &PartialResourceList->PartialDescriptors[i]; + if (PartialResourceDescriptor->Type == 1) { + goto switch_203_1; + } else { { + goto switch_203_default; + if (0) { + switch_203_1: /* CIL Label */ + rangeLength = PartialResourceDescriptor->u.Port.Length; + {} + portResourceDescriptorCount += 1UL; + if (rangeLength > 8UL) { + {} + largePortRangeFound = 1; + } else { + } + goto switch_203_break; + switch_203_default: /* CIL Label */; + {} + } else { + switch_203_break: /* CIL Label */; + } } - largePortRangeFound = 1; - } else { - - } - goto switch_203_break; - switch_203_default: /* CIL Label */ ; - { } - } else { - switch_203_break: /* CIL Label */ ; - } + i += 1UL; } + while_202_break: /* CIL Label */; } - i += 1UL; - } - while_202_break: /* CIL Label */ ; + } else { } - } else { - - } - if (portResourceDescriptorCount > 2UL) { - goto _L; - } else { - if (1 == (int )largePortRangeFound) { - _L: /* CIL Label */ - { - } - return (1); + if (portResourceDescriptorCount > 2UL) { + goto _L; } else { - { + if (1 == (int)largePortRangeFound) { + _L : /* CIL Label */ + {} + return (1); + } else { + {} + return (0); } - return (0); } } } -} -void PptCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) -{ +void PptCompleteRequest(PIRP Irp, CCHAR PriorityBoost) { { - { - IofCompleteRequest(Irp, PriorityBoost); + { IofCompleteRequest(Irp, PriorityBoost); } + return; } - return; } -} -static PDRIVER_DISPATCH PptPnpDispatchFunctionTable[25] ; -void PptPnpInitDispatchFunctionTable(void) -{ ULONG i = __VERIFIER_nondet_long() ; +static PDRIVER_DISPATCH PptPnpDispatchFunctionTable[25]; +void PptPnpInitDispatchFunctionTable(void) { + ULONG i = __VERIFIER_nondet_long(); { - PptPnpDispatchFunctionTable[i] = & PptPnpUnhandledIrp; - PptPnpDispatchFunctionTable[0] = & PptPnpStartDevice; - PptPnpDispatchFunctionTable[13] = & PptPnpFilterResourceRequirements; - PptPnpDispatchFunctionTable[7] = & PptPnpQueryDeviceRelations; - PptPnpDispatchFunctionTable[5] = & PptPnpQueryStopDevice; - PptPnpDispatchFunctionTable[6] = & PptPnpCancelStopDevice; - PptPnpDispatchFunctionTable[4] = & PptPnpStopDevice; - PptPnpDispatchFunctionTable[1] = & PptPnpQueryRemoveDevice; - PptPnpDispatchFunctionTable[3] = & PptPnpCancelRemoveDevice; - PptPnpDispatchFunctionTable[2] = & PptPnpRemoveDevice; - PptPnpDispatchFunctionTable[23] = & PptPnpSurpriseRemoval; - return; -} + PptPnpDispatchFunctionTable[i] = &PptPnpUnhandledIrp; + PptPnpDispatchFunctionTable[0] = &PptPnpStartDevice; + PptPnpDispatchFunctionTable[13] = &PptPnpFilterResourceRequirements; + PptPnpDispatchFunctionTable[7] = &PptPnpQueryDeviceRelations; + PptPnpDispatchFunctionTable[5] = &PptPnpQueryStopDevice; + PptPnpDispatchFunctionTable[6] = &PptPnpCancelStopDevice; + PptPnpDispatchFunctionTable[4] = &PptPnpStopDevice; + PptPnpDispatchFunctionTable[1] = &PptPnpQueryRemoveDevice; + PptPnpDispatchFunctionTable[3] = &PptPnpCancelRemoveDevice; + PptPnpDispatchFunctionTable[2] = &PptPnpRemoveDevice; + PptPnpDispatchFunctionTable[23] = &PptPnpSurpriseRemoval; + return; + } } -NTSTATUS PptPnpAddDevice(PDRIVER_OBJECT pDriverObject , PDEVICE_OBJECT pPhysicalDeviceObject ) -{ NTSTATUS status ; - PDEVICE_OBJECT parentDevice ; - PDEVICE_OBJECT pDeviceObject ; - PDEVICE_EXTENSION Extension ; - PCONFIGURATION_INFORMATION tmp ; +NTSTATUS PptPnpAddDevice(PDRIVER_OBJECT pDriverObject, + PDEVICE_OBJECT pPhysicalDeviceObject) { + NTSTATUS status; + PDEVICE_OBJECT parentDevice; + PDEVICE_OBJECT pDeviceObject; + PDEVICE_EXTENSION Extension; + PCONFIGURATION_INFORMATION tmp; { - status = 0L; - { - } - { - pDeviceObject = PptBuildDeviceObject(pDriverObject, pPhysicalDeviceObject); - } - if ((unsigned int )((void *)0) == (unsigned int )pDeviceObject) { - { + status = 0L; + {} { + pDeviceObject = + PptBuildDeviceObject(pDriverObject, pPhysicalDeviceObject); } - return (-1073741823L); - } else { - - } - { - Extension = pDeviceObject->DeviceExtension; - status = IoRegisterDeviceInterface(pPhysicalDeviceObject, & GUID_PARALLEL_DEVICE, - (void *)0, & Extension->SymbolicLinkName); - } - if (! (status >= 0L)) { - { + if ((unsigned int)((void *)0) == (unsigned int)pDeviceObject) { + {} + return (-1073741823L); + } else { } { -/* IoDeleteDevice(pDeviceObject); */ /* INLINED */ + Extension = pDeviceObject->DeviceExtension; + status = IoRegisterDeviceInterface(pPhysicalDeviceObject, + &GUID_PARALLEL_DEVICE, (void *)0, + &Extension->SymbolicLinkName); + } + if (!(status >= 0L)) { + {} { /* IoDeleteDevice(pDeviceObject); */ /* INLINED */ + } + return (status); + } else { } - return (status); - } else { - - } - { - parentDevice = IoAttachDeviceToDeviceStack(pDeviceObject, pPhysicalDeviceObject); - } - if ((unsigned int )((void *)0) == (unsigned int )parentDevice) { { + parentDevice = + IoAttachDeviceToDeviceStack(pDeviceObject, pPhysicalDeviceObject); + } + if ((unsigned int)((void *)0) == (unsigned int)parentDevice) { + {} { /* IoDeleteDevice(pDeviceObject); */ /* INLINED */ + } + return (-1073741823L); + } else { } { -/* IoDeleteDevice(pDeviceObject); */ /* INLINED */ + Extension->ParentDeviceObject = parentDevice; + tmp = IoGetConfigurationInformation(); + tmp->ParallelCount += 1UL; + pDeviceObject->Flags &= 4294967167UL; } - return (-1073741823L); - } else { - - } - { - Extension->ParentDeviceObject = parentDevice; - tmp = IoGetConfigurationInformation(); - tmp->ParallelCount += 1UL; - pDeviceObject->Flags &= 4294967167UL; - } - { + {} + return (0L); } - return (0L); } -} -NTSTATUS PptDispatchPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - NTSTATUS status ; - PIO_STACK_LOCATION irpStack ; - UCHAR minorFunction ; +NTSTATUS PptDispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + NTSTATUS status; + PIO_STACK_LOCATION irpStack; + UCHAR minorFunction; { - { - PptDebugDumpPnpIrpInfo(DeviceObject, Irp); - status = PptAcquireRemoveLockOrFailIrp(DeviceObject, Irp); - } - if (status >= 0L) { - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - minorFunction = irpStack->MinorFunction; - if ((int )minorFunction > 24) { - { - status = PptPnpUnhandledIrp(DeviceObject, Irp); - } - } else { - if (__BLAST_NONDET == 0) { - goto switch_214_0; + { + PptDebugDumpPnpIrpInfo(DeviceObject, Irp); + status = PptAcquireRemoveLockOrFailIrp(DeviceObject, Irp); + } + if (status >= 0L) { + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + minorFunction = irpStack->MinorFunction; + if ((int)minorFunction > 24) { + { status = PptPnpUnhandledIrp(DeviceObject, Irp); } } else { - if (__BLAST_NONDET == 1) { - goto switch_214_1; + if (__BLAST_NONDET == 0) { + goto switch_214_0; } else { - if (__BLAST_NONDET == 2) { - goto switch_214_2; + if (__BLAST_NONDET == 1) { + goto switch_214_1; } else { - if (__BLAST_NONDET == 3) { - goto switch_214_3; + if (__BLAST_NONDET == 2) { + goto switch_214_2; } else { - if (__BLAST_NONDET == 4) { - goto switch_214_4; + if (__BLAST_NONDET == 3) { + goto switch_214_3; } else { - if (__BLAST_NONDET == 5) { - goto switch_214_5; + if (__BLAST_NONDET == 4) { + goto switch_214_4; } else { - if (__BLAST_NONDET == 6) { - goto switch_214_6; + if (__BLAST_NONDET == 5) { + goto switch_214_5; } else { - if (__BLAST_NONDET == 7) { - goto switch_214_7; + if (__BLAST_NONDET == 6) { + goto switch_214_6; } else { - if (__BLAST_NONDET == 8) { - goto switch_214_8; + if (__BLAST_NONDET == 7) { + goto switch_214_7; } else { - if (__BLAST_NONDET == 9) { - goto switch_214_9; + if (__BLAST_NONDET == 8) { + goto switch_214_8; } else { - { - goto switch_214_default; - if (0) { - switch_214_0: /* CIL Label */ - { - status = PptPnpUnhandledIrp(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_1: /* CIL Label */ - { - status = PptPnpStartDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_2: /* CIL Label */ - { - status = PptPnpFilterResourceRequirements(DeviceObject, - Irp); - } - goto switch_214_break; - switch_214_3: /* CIL Label */ - { - status = PptPnpQueryDeviceRelations(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_4: /* CIL Label */ - { - status = PptPnpQueryStopDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_5: /* CIL Label */ - { - status = PptPnpCancelStopDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_6: /* CIL Label */ - { - status = PptPnpStopDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_7: /* CIL Label */ - { - status = PptPnpQueryRemoveDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_8: /* CIL Label */ - { - status = PptPnpCancelRemoveDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_9: /* CIL Label */ - { - status = PptPnpRemoveDevice(DeviceObject, Irp); - } - goto switch_214_break; - switch_214_default: /* CIL Label */ + if (__BLAST_NONDET == 9) { + goto switch_214_9; + } else { { - status = PptPnpSurpriseRemoval(DeviceObject, Irp); + goto switch_214_default; + if (0) { + switch_214_0 : /* CIL Label */ + { + status = PptPnpUnhandledIrp(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_1 : /* CIL Label */ + { + status = PptPnpStartDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_2 : /* CIL Label */ + { + status = PptPnpFilterResourceRequirements( + DeviceObject, Irp); + } + goto switch_214_break; + switch_214_3 : /* CIL Label */ + { + status = PptPnpQueryDeviceRelations( + DeviceObject, Irp); + } + goto switch_214_break; + switch_214_4 : /* CIL Label */ + { + status = + PptPnpQueryStopDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_5 : /* CIL Label */ + { + status = + PptPnpCancelStopDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_6 : /* CIL Label */ + { + status = PptPnpStopDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_7 : /* CIL Label */ + { + status = + PptPnpQueryRemoveDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_8 : /* CIL Label */ + { + status = + PptPnpCancelRemoveDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_9 : /* CIL Label */ + { + status = PptPnpRemoveDevice(DeviceObject, Irp); + } + goto switch_214_break; + switch_214_default : /* CIL Label */ + { + status = + PptPnpSurpriseRemoval(DeviceObject, Irp); + } + goto switch_214_break; + } else { + switch_214_break: /* CIL Label */; + } } - goto switch_214_break; - } else { - switch_214_break: /* CIL Label */ ; - } } } } @@ -6650,2973 +6464,2776 @@ NTSTATUS PptDispatchPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) } } } + } else { } - } else { - + return (status); } - return (status); -} } -NTSTATUS PptPnpStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS status ; - BOOLEAN foundPort ; - BOOLEAN foundIrq ; - BOOLEAN foundDma ; +NTSTATUS PptPnpStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS status; + BOOLEAN foundPort; + BOOLEAN foundIrq; + BOOLEAN foundDma; { - { - extension = DeviceObject->DeviceExtension; - foundPort = 0; - foundIrq = 0; - foundDma = 0; - status = PptPnpBounceAndCatchPnpIrp(extension, Irp); - } - if (! (status >= 0L)) { - if (status != -1073741637L) { - goto targetExit; + { + extension = DeviceObject->DeviceExtension; + foundPort = 0; + foundIrq = 0; + foundDma = 0; + status = PptPnpBounceAndCatchPnpIrp(extension, Irp); + } + if (!(status >= 0L)) { + if (status != -1073741637L) { + goto targetExit; + } else { + } } else { - } - } else { - - } - { - status = PptPnpStartScanCmResourceList(extension, Irp, & foundPort, & foundIrq, - & foundDma); - } - if (! (status >= 0L)) { - goto targetExit; - } else { - - } - { - status = PptPnpStartValidateResources(DeviceObject, foundPort, foundIrq, foundDma); - } - if (! (status >= 0L)) { - goto targetExit; - } else { - - } - { - extension->PnpInfo.Ieee1284_3DeviceCount = PptInitiate1284_3(extension); - status = PptDetectChipFilter(extension); - } - if (! (status >= 0L)) { { - PptDetectPortType(extension); + status = PptPnpStartScanCmResourceList(extension, Irp, &foundPort, + &foundIrq, &foundDma); + } + if (!(status >= 0L)) { + goto targetExit; + } else { } - } else { - - } - { - status = PptWmiInitWmi(DeviceObject); - } - if (! (status >= 0L)) { - goto targetExit; - } else { - - } - { - status = IoSetDeviceInterfaceState(& extension->SymbolicLinkName, 1); - } - if (! (status >= 0L)) { - status = -1073741637L; - } else { - - } - targetExit: - if (status >= 0L) { - { -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - extension->DeviceStateFlags |= 1UL; -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - } - } else { - - } - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); - PptReleaseRemoveLock(& extension->RemoveLock, Irp); - } - return (status); -} -} -NTSTATUS PptPnpStartScanCmResourceList(PDEVICE_EXTENSION Extension , PIRP Irp , PBOOLEAN FoundPort , - PBOOLEAN FoundIrq , PBOOLEAN FoundDma ) -{ NTSTATUS status ; - PIO_STACK_LOCATION irpStack ; - PCM_RESOURCE_LIST ResourceList ; - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor ; - PCM_PARTIAL_RESOURCE_LIST PartialResourceList ; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor ; - ULONG i ; - PHYSICAL_ADDRESS start ; - ULONG length ; - BOOLEAN isPci ; - BOOLEAN tmp ; - BOOLEAN tmp___0 ; - BOOLEAN tmp___1 ; - - { - status = 0L; - irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - isPci = 0; - *FoundPort = 0; - *FoundIrq = 0; - *FoundDma = 0; - ResourceList = irpStack->Parameters.StartDevice.AllocatedResourcesTranslated; - if ((unsigned int )ResourceList == (unsigned int )((void *)0)) { { + status = PptPnpStartValidateResources(DeviceObject, foundPort, foundIrq, + foundDma); + } + if (!(status >= 0L)) { + goto targetExit; + } else { } - status = -1073741670L; - goto targetExit; - } else { - - } - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture != 1) { { - tmp = PptIsPci(Extension, Irp); + extension->PnpInfo.Ieee1284_3DeviceCount = PptInitiate1284_3(extension); + status = PptDetectChipFilter(extension); } - if (1 == (int )tmp) { - { - } + if (!(status >= 0L)) { + { PptDetectPortType(extension); } + } else { + } + { status = PptWmiInitWmi(DeviceObject); } + if (!(status >= 0L)) { + goto targetExit; + } else { + } + { status = IoSetDeviceInterfaceState(&extension->SymbolicLinkName, 1); } + if (!(status >= 0L)) { + status = -1073741637L; + } else { + } + targetExit: + if (status >= 0L) { { - status = PptPnpStartScanPciCardCmResourceList(Extension, Irp, FoundPort, FoundIrq, - FoundDma); - isPci = 1; + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED + */ + extension->DeviceStateFlags |= 1UL; + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED + */ } - goto targetExit; } else { - } - } else { - - } - FullResourceDescriptor = & ResourceList->List[0]; - if (FullResourceDescriptor) { - Extension->InterfaceType = FullResourceDescriptor->InterfaceType; - PartialResourceList = & FullResourceDescriptor->PartialResourceList; - i = 0; { - while (1) { - while_217_continue: /* CIL Label */ ; - if (i < PartialResourceList->Count) { - + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); + PptReleaseRemoveLock(&extension->RemoveLock, Irp); + } + return (status); + } +} +NTSTATUS PptPnpStartScanCmResourceList(PDEVICE_EXTENSION Extension, PIRP Irp, + PBOOLEAN FoundPort, PBOOLEAN FoundIrq, + PBOOLEAN FoundDma) { + NTSTATUS status; + PIO_STACK_LOCATION irpStack; + PCM_RESOURCE_LIST ResourceList; + PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; + PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor; + ULONG i; + PHYSICAL_ADDRESS start; + ULONG length; + BOOLEAN isPci; + BOOLEAN tmp; + BOOLEAN tmp___0; + BOOLEAN tmp___1; + + { + status = 0L; + irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + isPci = 0; + *FoundPort = 0; + *FoundIrq = 0; + *FoundDma = 0; + ResourceList = + irpStack->Parameters.StartDevice.AllocatedResourcesTranslated; + if ((unsigned int)ResourceList == (unsigned int)((void *)0)) { + {} + status = -1073741670L; + goto targetExit; + } else { + } + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture != 1) { + { tmp = PptIsPci(Extension, Irp); } + if (1 == (int)tmp) { + {} { + status = PptPnpStartScanPciCardCmResourceList( + Extension, Irp, FoundPort, FoundIrq, FoundDma); + isPci = 1; + } + goto targetExit; } else { - goto while_217_break; } - PartialResourceDescriptor = & PartialResourceList->PartialDescriptors[i]; - if (PartialResourceDescriptor->Type == 1) { - goto switch_218_1; - } else { - if (PartialResourceDescriptor->Type == 6) { - goto switch_218_6; - } else { - if (PartialResourceDescriptor->Type == 2) { - goto switch_218_2; + } else { + } + FullResourceDescriptor = &ResourceList->List[0]; + if (FullResourceDescriptor) { + Extension->InterfaceType = FullResourceDescriptor->InterfaceType; + PartialResourceList = &FullResourceDescriptor->PartialResourceList; + i = 0; + { + while (1) { + while_217_continue: /* CIL Label */; + if (i < PartialResourceList->Count) { + } else { - if (PartialResourceDescriptor->Type == 4) { - goto switch_218_4; + goto while_217_break; + } + PartialResourceDescriptor = + &PartialResourceList->PartialDescriptors[i]; + if (PartialResourceDescriptor->Type == 1) { + goto switch_218_1; + } else { + if (PartialResourceDescriptor->Type == 6) { + goto switch_218_6; } else { - { - goto switch_218_default; - if (0) { - switch_218_1: /* CIL Label */ - start = PartialResourceDescriptor->u.Port.Start; - length = PartialResourceDescriptor->u.Port.Length; - { - } - *FoundPort = 1; - if (Extension->PortInfo.OriginalController.__annonCompField1.LowPart == 0UL) { - if (Extension->PortInfo.OriginalController.__annonCompField1.HighPart == 0L) { - { - } - Extension->PortInfo.OriginalController = PartialResourceDescriptor->u.Port.Start; - Extension->PortInfo.SpanOfController = PartialResourceDescriptor->u.Port.Length; - Extension->PortInfo.Controller = (UCHAR *)((unsigned long )Extension->PortInfo.OriginalController.QuadPart); - Extension->AddressSpace = PartialResourceDescriptor->Flags; - if (Extension->PortInfo.SpanOfController == 4096UL) { - { - tmp___0 = PptIsNecR98Machine(); - } - if (tmp___0) { - Extension->PortInfo.SpanOfController = 8; - } else { - - } - } else { - - } - } else { - goto _L___0; - } + if (PartialResourceDescriptor->Type == 2) { + goto switch_218_2; + } else { + if (PartialResourceDescriptor->Type == 4) { + goto switch_218_4; } else { - _L___0: /* CIL Label */ - if (Extension->PnpInfo.OriginalEcpController.__annonCompField1.LowPart == 0UL) { - if (Extension->PnpInfo.OriginalEcpController.__annonCompField1.HighPart == 0L) { - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture != 1) { - if (PartialResourceDescriptor->u.Port.Start.__annonCompField1.LowPart < Extension->PortInfo.OriginalController.__annonCompField1.LowPart) { - if (PartialResourceDescriptor->u.Port.Start.__annonCompField1.HighPart < Extension->PortInfo.OriginalController.__annonCompField1.HighPart) { - { + { + goto switch_218_default; + if (0) { + switch_218_1: /* CIL Label */ + start = PartialResourceDescriptor->u.Port.Start; + length = PartialResourceDescriptor->u.Port.Length; + {} *FoundPort = 1; + if (Extension->PortInfo.OriginalController + .__annonCompField1.LowPart == 0UL) { + if (Extension->PortInfo.OriginalController + .__annonCompField1.HighPart == 0L) { + {} + Extension->PortInfo.OriginalController = + PartialResourceDescriptor->u.Port.Start; + Extension->PortInfo.SpanOfController = + PartialResourceDescriptor->u.Port.Length; + Extension->PortInfo.Controller = + (UCHAR *)((unsigned long)Extension->PortInfo + .OriginalController.QuadPart); + Extension->AddressSpace = + PartialResourceDescriptor->Flags; + if (Extension->PortInfo.SpanOfController == 4096UL) { + { tmp___0 = PptIsNecR98Machine(); } + if (tmp___0) { + Extension->PortInfo.SpanOfController = 8; + } else { } - Extension->PnpInfo.OriginalEcpController = Extension->PortInfo.OriginalController; - Extension->PnpInfo.SpanOfEcpController = Extension->PortInfo.SpanOfController; - Extension->PnpInfo.EcpController = Extension->PortInfo.Controller; - Extension->EcpAddressSpace = Extension->AddressSpace; - Extension->PortInfo.OriginalController = PartialResourceDescriptor->u.Port.Start; - Extension->PortInfo.SpanOfController = PartialResourceDescriptor->u.Port.Length; - Extension->PortInfo.Controller = (UCHAR *)((unsigned long )Extension->PortInfo.OriginalController.QuadPart); - Extension->AddressSpace = PartialResourceDescriptor->Flags; - if (Extension->PortInfo.SpanOfController == 4096UL) { - { - tmp___1 = PptIsNecR98Machine(); - } - if (tmp___1) { - Extension->PortInfo.SpanOfController = 8; + } else { + } + } else { + goto _L___0; + } + } else { + _L___0: /* CIL Label */ + if (Extension->PnpInfo.OriginalEcpController + .__annonCompField1.LowPart == 0UL) { + if (Extension->PnpInfo.OriginalEcpController + .__annonCompField1.HighPart == 0L) { + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture != 1) { + if (PartialResourceDescriptor->u.Port.Start + .__annonCompField1.LowPart < + Extension->PortInfo.OriginalController + .__annonCompField1.LowPart) { + if (PartialResourceDescriptor->u.Port.Start + .__annonCompField1.HighPart < + Extension->PortInfo.OriginalController + .__annonCompField1.HighPart) { + {} + Extension->PnpInfo.OriginalEcpController = + Extension->PortInfo.OriginalController; + Extension->PnpInfo.SpanOfEcpController = + Extension->PortInfo.SpanOfController; + Extension->PnpInfo.EcpController = + Extension->PortInfo.Controller; + Extension->EcpAddressSpace = + Extension->AddressSpace; + Extension->PortInfo.OriginalController = + PartialResourceDescriptor->u.Port.Start; + Extension->PortInfo.SpanOfController = + PartialResourceDescriptor->u.Port.Length; + Extension->PortInfo.Controller = + (UCHAR + *)((unsigned long)Extension->PortInfo + .OriginalController.QuadPart); + Extension->AddressSpace = + PartialResourceDescriptor->Flags; + if (Extension->PortInfo.SpanOfController == + 4096UL) { + { tmp___1 = PptIsNecR98Machine(); } + if (tmp___1) { + Extension->PortInfo.SpanOfController = 8; + } else { + } + } else { + } + } else { + goto _L; + } } else { - + _L : /* CIL Label */ + {} + Extension->PnpInfo.OriginalEcpController = + PartialResourceDescriptor->u.Port.Start; + Extension->PnpInfo.SpanOfEcpController = + PartialResourceDescriptor->u.Port.Length; + Extension->PnpInfo.EcpController = + (UCHAR *)((unsigned long)Extension->PnpInfo + .OriginalEcpController + .QuadPart); + Extension->EcpAddressSpace = + PartialResourceDescriptor->Flags; } } else { - } } else { - goto _L; } } else { - _L: /* CIL Label */ - { - } - Extension->PnpInfo.OriginalEcpController = PartialResourceDescriptor->u.Port.Start; - Extension->PnpInfo.SpanOfEcpController = PartialResourceDescriptor->u.Port.Length; - Extension->PnpInfo.EcpController = (UCHAR *)((unsigned long )Extension->PnpInfo.OriginalEcpController.QuadPart); - Extension->EcpAddressSpace = PartialResourceDescriptor->Flags; } + } + goto switch_218_break; + switch_218_6: /* CIL Label */ + Extension->BusNumber = + PartialResourceDescriptor->u.BusNumber.Start; + goto switch_218_break; + switch_218_2: /* CIL Label */ + *FoundIrq = 1; + Extension->FoundInterrupt = 1; + Extension->InterruptLevel = + (unsigned char) + PartialResourceDescriptor->u.Interrupt.Level; + Extension->InterruptVector = + PartialResourceDescriptor->u.Interrupt.Vector; + Extension->InterruptAffinity = + PartialResourceDescriptor->u.Interrupt.Affinity; + if ((int)PartialResourceDescriptor->Flags & 1) { + Extension->InterruptMode = 1; } else { - + Extension->InterruptMode = 0; } + goto switch_218_break; + switch_218_4: /* CIL Label */ + *FoundDma = 1; + Extension->DmaChannel = + PartialResourceDescriptor->u.Dma.Channel; + Extension->DmaPort = + PartialResourceDescriptor->u.Dma.Port; + Extension->DmaWidth = PartialResourceDescriptor->Flags; + goto switch_218_break; + switch_218_default: /* CIL Label */; + goto switch_218_break; } else { - + switch_218_break: /* CIL Label */; } - } else { - } } - goto switch_218_break; - switch_218_6: /* CIL Label */ - Extension->BusNumber = PartialResourceDescriptor->u.BusNumber.Start; - goto switch_218_break; - switch_218_2: /* CIL Label */ - *FoundIrq = 1; - Extension->FoundInterrupt = 1; - Extension->InterruptLevel = (unsigned char )PartialResourceDescriptor->u.Interrupt.Level; - Extension->InterruptVector = PartialResourceDescriptor->u.Interrupt.Vector; - Extension->InterruptAffinity = PartialResourceDescriptor->u.Interrupt.Affinity; - if ((int )PartialResourceDescriptor->Flags & 1) { - Extension->InterruptMode = 1; - } else { - Extension->InterruptMode = 0; - } - goto switch_218_break; - switch_218_4: /* CIL Label */ - *FoundDma = 1; - Extension->DmaChannel = PartialResourceDescriptor->u.Dma.Channel; - Extension->DmaPort = PartialResourceDescriptor->u.Dma.Port; - Extension->DmaWidth = PartialResourceDescriptor->Flags; - goto switch_218_break; - switch_218_default: /* CIL Label */ ; - goto switch_218_break; - } else { - switch_218_break: /* CIL Label */ ; - } } } } + i += 1UL; } - } - i += 1UL; - } - while_217_break: /* CIL Label */ ; - } - } else { - - } - targetExit: - if (0 == (int )isPci) { - { - } - { - } - { - } - { - } - } else { - - } - return (status); -} -} -NTSTATUS PptPnpStartValidateResources(PDEVICE_OBJECT DeviceObject , BOOLEAN FoundPort , - BOOLEAN FoundIrq , BOOLEAN FoundDma ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS status ; - - { - extension = DeviceObject->DeviceExtension; - status = 0L; - if (! FoundPort) { - status = -1073741810L; - } else { - extension->PortInfo.Controller = (UCHAR *)((unsigned long )extension->PortInfo.OriginalController.QuadPart); - if (! extension->PortInfo.Controller) { - { - PptLogError(DeviceObject->DriverObject, DeviceObject, extension->PortInfo.OriginalController, - PhysicalZero, 0, 0, 0, 10, 0L, 4); - status = -1073741709L; + while_217_break: /* CIL Label */; } } else { - - } - } - return (status); -} -} -NTSTATUS PptPnpFilterResourceRequirements(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - ULONG filterResourceMethod ; - PIO_RESOURCE_REQUIREMENTS_LIST pResourceRequirementsIn ; - NTSTATUS status ; - PIO_STACK_LOCATION IrpStack ; - BOOLEAN tmp ; - BOOLEAN tmp___0 ; - - { - { - extension = DeviceObject->DeviceExtension; - filterResourceMethod = 1; - status = PptPnpBounceAndCatchPnpIrp(extension, Irp); - } - if (! (status >= 0L)) { - if (status != -1073741637L) { - goto targetExit; - } else { - - } - } else { - - } - if (Irp->IoStatus.Information == 0UL) { - IrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - pResourceRequirementsIn = IrpStack->Parameters.FilterResourceRequirements.IoResourceRequirementList; - if ((unsigned int )pResourceRequirementsIn == (unsigned int )((void *)0)) { - goto targetExit; - } else { - - } - } else { - pResourceRequirementsIn = (struct _IO_RESOURCE_REQUIREMENTS_LIST *)Irp->IoStatus.Information; - } - { - } - { - } - { - PptDebugDumpResourceRequirementsList(pResourceRequirementsIn); - } - if (filterResourceMethod == 1) { - goto switch_229_1; - } else { - if (filterResourceMethod == 0) { - goto switch_229_0; - } else { - if (filterResourceMethod == 2) { - goto switch_229_2; - } else { - { - goto switch_229_default; - if (0) { - switch_229_1: /* CIL Label */ ; - { - } - { - tmp = PptPnpFilterExistsNonIrqResourceList(pResourceRequirementsIn); - } - if (tmp) { - { - } - { - PptPnpFilterRemoveIrqResourceLists(pResourceRequirementsIn); - } - } else { - { - } - { - PptPnpFilterNukeIrqResourceDescriptorsFromAllLists(pResourceRequirementsIn); - } - } - { - } - { - PptDebugDumpResourceRequirementsList(pResourceRequirementsIn); - } - goto switch_229_break; - switch_229_0: /* CIL Label */ ; - { - } - { - tmp___0 = PptPnpFilterExistsNonIrqResourceList(pResourceRequirementsIn); - } - if (tmp___0) { - { - } - { - PptPnpFilterRemoveIrqResourceLists(pResourceRequirementsIn); - } - { - } - { - PptDebugDumpResourceRequirementsList(pResourceRequirementsIn); - } - } else { - { - } - } - goto switch_229_break; - switch_229_2: /* CIL Label */ ; - { - } - goto switch_229_break; - switch_229_default: /* CIL Label */ ; - { - } - } else { - switch_229_break: /* CIL Label */ ; - } - } - } - } - } - targetExit: - { - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - PptCompleteRequest(Irp, 0); - PptReleaseRemoveLock(& extension->RemoveLock, Irp); - } - return (status); -} -} -BOOLEAN PptPnpFilterExistsNonIrqResourceList(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) -{ ULONG listCount ; - PIO_RESOURCE_LIST curList ; - ULONG i ; - ULONG remain ; - PIO_RESOURCE_DESCRIPTOR curDesc ; - BOOLEAN foundIrq ; - - { - listCount = ResourceRequirementsList->AlternativeLists; - { - } - i = 0; - curList = ResourceRequirementsList->List; - { - while (1) { - while_241_continue: /* CIL Label */ ; - if (i < listCount) { - - } else { - goto while_241_break; - } - { - } - remain = curList->Count; - curDesc = curList->Descriptors; - foundIrq = 0; - { - while (1) { - while_243_continue: /* CIL Label */ ; - if (remain) { - - } else { - goto while_243_break; - } - { - } - if ((int )curDesc->Type == 2) { - { - } - foundIrq = 1; - goto while_243_break; - } else { - - } - curDesc += 1; - remain -= 1UL; - } - while_243_break: /* CIL Label */ ; - } - if ((int )foundIrq == 0) { - { - } - return (1); - } else { - - } - curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); - i += 1UL; - } - while_241_break: /* CIL Label */ ; - } - { - } - return (0); -} -} -void PptPnpFilterRemoveIrqResourceLists(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) -{ ULONG listCount ; - PIO_RESOURCE_LIST curList ; - PIO_RESOURCE_LIST nextList ; - ULONG i ; - PCHAR currentEndOfResourceRequirementsList ; - LONG bytesToMove ; - PVOID tmp ; - BOOLEAN tmp___0 ; - - { - listCount = ResourceRequirementsList->AlternativeLists; - { - } - { - tmp = PptPnpFilterGetEndOfResourceRequirementsList(ResourceRequirementsList); - currentEndOfResourceRequirementsList = tmp; - i = 0; - curList = ResourceRequirementsList->List; - } - { - while (1) { - while_249_continue: /* CIL Label */ ; - if (i < listCount) { - - } else { - goto while_249_break; - } - { - } - { - } - { - tmp___0 = PptPnpListContainsIrqResourceDescriptor(curList); - } - if (tmp___0) { - { - } - nextList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); - bytesToMove = (long )(currentEndOfResourceRequirementsList - (CHAR *)nextList); - if (bytesToMove > 0L) { - { - memmove(curList, nextList, bytesToMove); - currentEndOfResourceRequirementsList -= (CHAR *)nextList - (CHAR *)curList; - } - } else { - - } - listCount -= 1UL; - } else { - { - } - curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); - i += 1UL; - } - } - while_249_break: /* CIL Label */ ; - } - ResourceRequirementsList->AlternativeLists = listCount; - { - } - return; -} -} -PVOID PptPnpFilterGetEndOfResourceRequirementsList(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) -{ ULONG listCount ; - PIO_RESOURCE_LIST curList ; - ULONG i ; - - { - listCount = ResourceRequirementsList->AlternativeLists; - i = 0; - curList = ResourceRequirementsList->List; - { - while (1) { - while_255_continue: /* CIL Label */ ; - if (i < listCount) { - + } + targetExit: + if (0 == (int)isPci) { + {} {} {} {} } else { - goto while_255_break; } - curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); - i += 1UL; - } - while_255_break: /* CIL Label */ ; + return (status); } - return ((void *)curList); -} } -void PptPnpFilterNukeIrqResourceDescriptorsFromAllLists(PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList ) -{ ULONG listCount ; - ULONG i ; - PIO_RESOURCE_LIST curList ; +NTSTATUS PptPnpStartValidateResources(PDEVICE_OBJECT DeviceObject, + BOOLEAN FoundPort, BOOLEAN FoundIrq, + BOOLEAN FoundDma) { + PDEVICE_EXTENSION extension; + NTSTATUS status; { - listCount = ResourceRequirementsList->AlternativeLists; - i = 0; - curList = ResourceRequirementsList->List; - { - } - { - while (1) { - while_257_continue: /* CIL Label */ ; - if (i < listCount) { - + extension = DeviceObject->DeviceExtension; + status = 0L; + if (!FoundPort) { + status = -1073741810L; } else { - goto while_257_break; - } - { - } - { - PptPnpFilterNukeIrqResourceDescriptors(curList); - curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); - i += 1UL; + extension->PortInfo.Controller = + (UCHAR *)((unsigned long) + extension->PortInfo.OriginalController.QuadPart); + if (!extension->PortInfo.Controller) { + { + PptLogError(DeviceObject->DriverObject, DeviceObject, + extension->PortInfo.OriginalController, PhysicalZero, 0, + 0, 0, 10, 0L, 4); + status = -1073741709L; + } + } else { + } } + return (status); } - while_257_break: /* CIL Label */ ; - } - return; } -} -void PptPnpFilterNukeIrqResourceDescriptors(PIO_RESOURCE_LIST IoResourceList ) -{ PIO_RESOURCE_DESCRIPTOR pIoResourceDescriptorIn ; - ULONG i ; +NTSTATUS PptPnpFilterResourceRequirements(PDEVICE_OBJECT DeviceObject, + PIRP Irp) { + PDEVICE_EXTENSION extension; + ULONG filterResourceMethod; + PIO_RESOURCE_REQUIREMENTS_LIST pResourceRequirementsIn; + NTSTATUS status; + PIO_STACK_LOCATION IrpStack; + BOOLEAN tmp; + BOOLEAN tmp___0; { - pIoResourceDescriptorIn = IoResourceList->Descriptors; - i = 0; - { - while (1) { - while_259_continue: /* CIL Label */ ; - if (i < IoResourceList->Count) { - + { + extension = DeviceObject->DeviceExtension; + filterResourceMethod = 1; + status = PptPnpBounceAndCatchPnpIrp(extension, Irp); + } + if (!(status >= 0L)) { + if (status != -1073741637L) { + goto targetExit; + } else { + } } else { - goto while_259_break; } - if ((int )pIoResourceDescriptorIn->Type == 2) { - pIoResourceDescriptorIn->Type = 0; - { + if (Irp->IoStatus.Information == 0UL) { + IrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + pResourceRequirementsIn = IrpStack->Parameters.FilterResourceRequirements + .IoResourceRequirementList; + if ((unsigned int)pResourceRequirementsIn == (unsigned int)((void *)0)) { + goto targetExit; + } else { } } else { - + pResourceRequirementsIn = + (struct _IO_RESOURCE_REQUIREMENTS_LIST *)Irp->IoStatus.Information; } - pIoResourceDescriptorIn += 1; - i += 1UL; - } - while_259_break: /* CIL Label */ ; - } - return; -} -} -NTSTATUS PptPnpQueryDeviceRelations(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - PIO_STACK_LOCATION irpSp ; - DEVICE_RELATION_TYPE type ; - PDEVICE_RELATIONS removalRelations ; - NTSTATUS tmp ; - - { - extension = DeviceObject->DeviceExtension; - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - type = irpSp->Parameters.QueryDeviceRelations.Type; - if (type == 3) { - goto switch_261_3; - } else { - if (type == 0) { - goto switch_261_0; + {} {} { PptDebugDumpResourceRequirementsList(pResourceRequirementsIn); } + if (filterResourceMethod == 1) { + goto switch_229_1; } else { - if (type == 1) { - goto switch_261_1; + if (filterResourceMethod == 0) { + goto switch_229_0; } else { - if (type == 2) { - goto switch_261_2; + if (filterResourceMethod == 2) { + goto switch_229_2; } else { - if (type == 4) { - goto switch_261_4; - } else { - { - goto switch_261_default; + { + goto switch_229_default; if (0) { - switch_261_3: /* CIL Label */ ; - { + switch_229_1: /* CIL Label */; + {} { + tmp = PptPnpFilterExistsNonIrqResourceList( + pResourceRequirementsIn); } - { - PptDumpRemovalRelationsList(extension); - } - if (Irp->IoStatus.Information) { - { + if (tmp) { + {} { + PptPnpFilterRemoveIrqResourceLists(pResourceRequirementsIn); } } else { - { - removalRelations = PptPnpBuildRemovalRelations(extension); - } - if (removalRelations) { - { - } - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - Irp->IoStatus.Information = (unsigned long )removalRelations; - } else { - { - } + {} { + PptPnpFilterNukeIrqResourceDescriptorsFromAllLists( + pResourceRequirementsIn); } } - goto switch_261_break; - switch_261_0: /* CIL Label */ ; - { - } - goto switch_261_break; - switch_261_1: /* CIL Label */ ; - { - } - goto switch_261_break; - switch_261_2: /* CIL Label */ ; - { + {} { + PptDebugDumpResourceRequirementsList(pResourceRequirementsIn); } - goto switch_261_break; - switch_261_4: /* CIL Label */ ; - { + goto switch_229_break; + switch_229_0: /* CIL Label */; + {} { + tmp___0 = PptPnpFilterExistsNonIrqResourceList( + pResourceRequirementsIn); } - goto switch_261_break; - switch_261_default: /* CIL Label */ ; - { + if (tmp___0) { + {} { + PptPnpFilterRemoveIrqResourceLists(pResourceRequirementsIn); + } + {} { + PptDebugDumpResourceRequirementsList(pResourceRequirementsIn); + } + } else { + {} } - goto switch_261_break; + goto switch_229_break; + switch_229_2: /* CIL Label */; + {} + goto switch_229_break; + switch_229_default: /* CIL Label */; + {} } else { - switch_261_break: /* CIL Label */ ; - } + switch_229_break: /* CIL Label */; } } } } } + targetExit : { + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + PptCompleteRequest(Irp, 0); + PptReleaseRemoveLock(&extension->RemoveLock, Irp); } - { - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(DeviceObject->DeviceExtension, - Irp); + return (status); } - return (tmp); } -} -NTSTATUS PptPnpQueryStopDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ NTSTATUS status ; - PDEVICE_EXTENSION extension ; - LONG handlesOpen ; +BOOLEAN PptPnpFilterExistsNonIrqResourceList( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList) { + ULONG listCount; + PIO_RESOURCE_LIST curList; + ULONG i; + ULONG remain; + PIO_RESOURCE_DESCRIPTOR curDesc; + BOOLEAN foundIrq; { - { - status = 0L; - extension = DeviceObject->DeviceExtension; -/* ExAcquireFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ - handlesOpen = extension->OpenCloseRefCount; -/* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ - } - if (handlesOpen > 0L) { - { - status = -2147483631L; - PptFailRequest(Irp, status); - PptReleaseRemoveLock(& extension->RemoveLock, Irp); - } - } else { + listCount = ResourceRequirementsList->AlternativeLists; + {} + i = 0; + curList = ResourceRequirementsList->List; { - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - status = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - extension->DeviceStateFlags |= 65552UL; -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + while (1) { + while_241_continue: /* CIL Label */; + if (i < listCount) { + + } else { + goto while_241_break; + } + {} + remain = curList->Count; + curDesc = curList->Descriptors; + foundIrq = 0; + { + while (1) { + while_243_continue: /* CIL Label */; + if (remain) { + + } else { + goto while_243_break; + } + {} + if ((int)curDesc->Type == 2) { + {} + foundIrq = 1; + goto while_243_break; + } else { + } + curDesc += 1; + remain -= 1UL; + } + while_243_break: /* CIL Label */; + } + if ((int)foundIrq == 0) { + {} + return (1); + } else { + } + curList = + (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); + i += 1UL; + } + while_241_break: /* CIL Label */; } + {} + return (0); } - return (status); } -} -NTSTATUS PptPnpCancelStopDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS tmp ; +void PptPnpFilterRemoveIrqResourceLists( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList) { + ULONG listCount; + PIO_RESOURCE_LIST curList; + PIO_RESOURCE_LIST nextList; + ULONG i; + PCHAR currentEndOfResourceRequirementsList; + LONG bytesToMove; + PVOID tmp; + BOOLEAN tmp___0; { - { - extension = DeviceObject->DeviceExtension; -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - } - if (extension->DeviceStateFlags & 16UL) { - extension->DeviceStateFlags &= 4294901743UL; - } else { + listCount = ResourceRequirementsList->AlternativeLists; + {} { + tmp = PptPnpFilterGetEndOfResourceRequirementsList( + ResourceRequirementsList); + currentEndOfResourceRequirementsList = tmp; + i = 0; + curList = ResourceRequirementsList->List; + } + { + while (1) { + while_249_continue: /* CIL Label */; + if (i < listCount) { + } else { + goto while_249_break; + } + {} {} { tmp___0 = PptPnpListContainsIrqResourceDescriptor(curList); } + if (tmp___0) { + {} + nextList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + + curList->Count); + bytesToMove = + (long)(currentEndOfResourceRequirementsList - (CHAR *)nextList); + if (bytesToMove > 0L) { + { + memmove(curList, nextList, bytesToMove); + currentEndOfResourceRequirementsList -= + (CHAR *)nextList - (CHAR *)curList; + } + } else { + } + listCount -= 1UL; + } else { + {} + curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + + curList->Count); + i += 1UL; + } + } + while_249_break: /* CIL Label */; + } + ResourceRequirementsList->AlternativeLists = listCount; + {} + return; } - { -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); - } - return (tmp); } -} -NTSTATUS PptPnpStopDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS tmp ; +PVOID PptPnpFilterGetEndOfResourceRequirementsList( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList) { + ULONG listCount; + PIO_RESOURCE_LIST curList; + ULONG i; { - { - extension = DeviceObject->DeviceExtension; -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - extension->DeviceStateFlags |= 32UL; - extension->DeviceStateFlags &= 4294967278UL; -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + listCount = ResourceRequirementsList->AlternativeLists; + i = 0; + curList = ResourceRequirementsList->List; + { + while (1) { + while_255_continue: /* CIL Label */; + if (i < listCount) { + + } else { + goto while_255_break; + } + curList = + (struct _IO_RESOURCE_LIST *)(curList->Descriptors + curList->Count); + i += 1UL; + } + while_255_break: /* CIL Label */; + } + return ((void *)curList); } - return (tmp); -} } -NTSTATUS PptPnpQueryRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS tmp ; +void PptPnpFilterNukeIrqResourceDescriptorsFromAllLists( + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList) { + ULONG listCount; + ULONG i; + PIO_RESOURCE_LIST curList; { - extension = DeviceObject->DeviceExtension; - { - } - { -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - extension->DeviceStateFlags |= 65792UL; -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + listCount = ResourceRequirementsList->AlternativeLists; + i = 0; + curList = ResourceRequirementsList->List; + {} { + while (1) { + while_257_continue: /* CIL Label */; + if (i < listCount) { + + } else { + goto while_257_break; + } + {} { + PptPnpFilterNukeIrqResourceDescriptors(curList); + curList = (struct _IO_RESOURCE_LIST *)(curList->Descriptors + + curList->Count); + i += 1UL; + } + } + while_257_break: /* CIL Label */; + } + return; } - return (tmp); -} } -NTSTATUS PptPnpCancelRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS tmp ; +void PptPnpFilterNukeIrqResourceDescriptors(PIO_RESOURCE_LIST IoResourceList) { + PIO_RESOURCE_DESCRIPTOR pIoResourceDescriptorIn; + ULONG i; { - { - extension = DeviceObject->DeviceExtension; -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - } - if (extension->DeviceStateFlags & 256UL) { - extension->DeviceStateFlags &= 4294901503UL; - } else { + pIoResourceDescriptorIn = IoResourceList->Descriptors; + i = 0; + { + while (1) { + while_259_continue: /* CIL Label */; + if (i < IoResourceList->Count) { + } else { + goto while_259_break; + } + if ((int)pIoResourceDescriptorIn->Type == 2) { + pIoResourceDescriptorIn->Type = 0; + {} + } else { + } + pIoResourceDescriptorIn += 1; + i += 1UL; + } + while_259_break: /* CIL Label */; + } + return; } +} +NTSTATUS PptPnpQueryDeviceRelations(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + PIO_STACK_LOCATION irpSp; + DEVICE_RELATION_TYPE type; + PDEVICE_RELATIONS removalRelations; + NTSTATUS tmp; + { -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + extension = DeviceObject->DeviceExtension; + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + type = irpSp->Parameters.QueryDeviceRelations.Type; + if (type == 3) { + goto switch_261_3; + } else { + if (type == 0) { + goto switch_261_0; + } else { + if (type == 1) { + goto switch_261_1; + } else { + if (type == 2) { + goto switch_261_2; + } else { + if (type == 4) { + goto switch_261_4; + } else { + { + goto switch_261_default; + if (0) { + switch_261_3: /* CIL Label */; + {} { PptDumpRemovalRelationsList(extension); } + if (Irp->IoStatus.Information) { + {} + } else { + { + removalRelations = PptPnpBuildRemovalRelations(extension); + } + if (removalRelations) { + {} + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + Irp->IoStatus.Information = + (unsigned long)removalRelations; + } else { + {} + } + } + goto switch_261_break; + switch_261_0: /* CIL Label */; + {} + goto switch_261_break; + switch_261_1: /* CIL Label */; + {} + goto switch_261_break; + switch_261_2: /* CIL Label */; + {} + goto switch_261_break; + switch_261_4: /* CIL Label */; + {} + goto switch_261_break; + switch_261_default: /* CIL Label */; + {} + goto switch_261_break; + } else { + switch_261_break: /* CIL Label */; + } + } + } + } + } + } + } + { + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock( + DeviceObject->DeviceExtension, Irp); + } + return (tmp); } - return (tmp); } -} -NTSTATUS PptPnpRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - NTSTATUS status ; +NTSTATUS PptPnpQueryStopDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + NTSTATUS status; + PDEVICE_EXTENSION extension; + LONG handlesOpen; { - { - extension = DeviceObject->DeviceExtension; -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - extension->DeviceStateFlags |= 512UL; -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - IoWMIRegistrationControl(DeviceObject, 2); - IoSetDeviceInterfaceState(& extension->SymbolicLinkName, 0); - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - } - if (s == NP) { - s = SKIP1; - } else { { - errorFn(); + status = 0L; + extension = DeviceObject->DeviceExtension; + /* ExAcquireFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ + handlesOpen = extension->OpenCloseRefCount; + /* ExReleaseFastMutex(& extension->OpenCloseMutex); */ /* INLINED */ + } + if (handlesOpen > 0L) { + { + status = -2147483631L; + PptFailRequest(Irp, status); + PptReleaseRemoveLock(&extension->RemoveLock, Irp); + } + } else { + { + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + status = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED + */ + extension->DeviceStateFlags |= 65552UL; + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED + */ + } } + return (status); } +} +NTSTATUS PptPnpCancelStopDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS tmp; + { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - status = IofCallDriver(extension->ParentDeviceObject, Irp); - PptReleaseRemoveLockAndWait(& extension->RemoveLock, Irp); - PptCleanRemovalRelationsList(extension); -/* RtlFreeUnicodeString(& extension->DeviceName); */ /* INLINED */ -/* RtlFreeUnicodeString(& extension->SymbolicLinkName); */ /* INLINED */ - } - if (extension->PnpInfo.PortName) { { -/* ExFreePool(extension->PnpInfo.PortName); */ /* INLINED */ - extension->PnpInfo.PortName = (void *)0; + extension = DeviceObject->DeviceExtension; + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ } - } else { - + if (extension->DeviceStateFlags & 16UL) { + extension->DeviceStateFlags &= 4294901743UL; + } else { + } + { + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + } + return (tmp); } +} +NTSTATUS PptPnpStopDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS tmp; + { -/* IoDetachDevice(extension->ParentDeviceObject); */ /* INLINED */ -/* IoDeleteDevice(DeviceObject); */ /* INLINED */ + { + extension = DeviceObject->DeviceExtension; + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + extension->DeviceStateFlags |= 32UL; + extension->DeviceStateFlags &= 4294967278UL; + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + } + return (tmp); } - return (status); -} } -NTSTATUS PptPnpSurpriseRemoval(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - KIRQL cancelIrql ; - NTSTATUS tmp ; +NTSTATUS PptPnpQueryRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS tmp; { - { - extension = DeviceObject->DeviceExtension; -/* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - extension->DeviceStateFlags |= 4096UL; -/* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ - IoAcquireCancelSpinLock(& cancelIrql); -/* IoReleaseCancelSpinLock(cancelIrql); */ /* INLINED */ - IoSetDeviceInterfaceState(& extension->SymbolicLinkName, 0); - Irp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + extension = DeviceObject->DeviceExtension; + {} { + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + extension->DeviceStateFlags |= 65792UL; + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + } + return (tmp); } - return (tmp); -} } -BOOLEAN PptPnpListContainsIrqResourceDescriptor(PIO_RESOURCE_LIST List ) -{ ULONG i ; - PIO_RESOURCE_DESCRIPTOR curDesc ; +NTSTATUS PptPnpCancelRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS tmp; { - curDesc = List->Descriptors; - i = 0; - { - while (1) { - while_272_continue: /* CIL Label */ ; - if (i < List->Count) { - - } else { - goto while_272_break; + { + extension = DeviceObject->DeviceExtension; + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ } - if ((int )curDesc->Type == 2) { - return (1); + if (extension->DeviceStateFlags & 256UL) { + extension->DeviceStateFlags &= 4294901503UL; } else { - curDesc += 1; } - i += 1UL; - } - while_272_break: /* CIL Label */ ; + { + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + } + return (tmp); } - return (0); -} } -NTSTATUS PptPnpBounceAndCatchPnpIrp(PDEVICE_EXTENSION Extension , PIRP Irp ) -{ NTSTATUS status ; - KEVENT event ; - PDEVICE_OBJECT parentDevObj ; - PIO_STACK_LOCATION irpSp ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___0 ; +NTSTATUS PptPnpRemoveDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + NTSTATUS status; { - parentDevObj = Extension->ParentDeviceObject; - { - } - { -/* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ - irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine)); - nextIrpSp->Control = 0; - } - if (s != NP) { { - errorFn(); + extension = DeviceObject->DeviceExtension; + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + extension->DeviceStateFlags |= 512UL; + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + IoWMIRegistrationControl(DeviceObject, 2); + IoSetDeviceInterfaceState(&extension->SymbolicLinkName, 0); + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + } + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + status = IofCallDriver(extension->ParentDeviceObject, Irp); + PptReleaseRemoveLockAndWait(&extension->RemoveLock, Irp); + PptCleanRemovalRelationsList(extension); + /* RtlFreeUnicodeString(& extension->DeviceName); */ /* INLINED */ + /* RtlFreeUnicodeString(& extension->SymbolicLinkName); */ /* INLINED */ } - } else { - if (compRegistered != 0) { + if (extension->PnpInfo.PortName) { { - errorFn(); + /* ExFreePool(extension->PnpInfo.PortName); */ /* INLINED */ + extension->PnpInfo.PortName = (void *)0; } } else { - compRegistered = 1; - compFptr = & PptSynchCompletionRoutine; - routine = 0; } + { + /* IoDetachDevice(extension->ParentDeviceObject); */ /* INLINED */ + /* IoDeleteDevice(DeviceObject); */ /* INLINED */ + } + return (status); } +} +NTSTATUS PptPnpSurpriseRemoval(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + KIRQL cancelIrql; + NTSTATUS tmp; + { - irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp___0->CompletionRoutine = & PptSynchCompletionRoutine; - irpSp___0->Context = & event; - irpSp___0->Control = 0; - irpSp___0->Control = 64; - irpSp___0->Control = (int )irpSp___0->Control | 128; - irpSp___0->Control = (int )irpSp___0->Control | 32; - status = IofCallDriver(parentDevObj, Irp); - KeWaitForSingleObject(& event, 5, 0, 0, (void *)0); + { + extension = DeviceObject->DeviceExtension; + /* ExAcquireFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + extension->DeviceStateFlags |= 4096UL; + /* ExReleaseFastMutex(& extension->ExtensionFastMutex); */ /* INLINED */ + IoAcquireCancelSpinLock(&cancelIrql); + /* IoReleaseCancelSpinLock(cancelIrql); */ /* INLINED */ + IoSetDeviceInterfaceState(&extension->SymbolicLinkName, 0); + Irp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(extension, Irp); + } + return (tmp); } - if (status == 259L) { - status = myStatus; - } else { +} +BOOLEAN PptPnpListContainsIrqResourceDescriptor(PIO_RESOURCE_LIST List) { + ULONG i; + PIO_RESOURCE_DESCRIPTOR curDesc; + { + curDesc = List->Descriptors; + i = 0; + { + while (1) { + while_272_continue: /* CIL Label */; + if (i < List->Count) { + + } else { + goto while_272_break; + } + if ((int)curDesc->Type == 2) { + return (1); + } else { + curDesc += 1; + } + i += 1UL; + } + while_272_break: /* CIL Label */; + } + return (0); } - return (status); } +NTSTATUS PptPnpBounceAndCatchPnpIrp(PDEVICE_EXTENSION Extension, PIRP Irp) { + NTSTATUS status; + KEVENT event; + PDEVICE_OBJECT parentDevObj; + PIO_STACK_LOCATION irpSp; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___0; + + { + parentDevObj = Extension->ParentDeviceObject; + {} { + /* KeInitializeEvent(& event, 0, 0); */ /* INLINED */ + irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + memcpy(nextIrpSp, irpSp, + (long)(&((IO_STACK_LOCATION *)0)->CompletionRoutine)); + nextIrpSp->Control = 0; + } + if (s != NP) { + { errorFn(); } + } else { + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + compFptr = &PptSynchCompletionRoutine; + routine = 0; + } + } + { + irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpSp___0->CompletionRoutine = &PptSynchCompletionRoutine; + irpSp___0->Context = &event; + irpSp___0->Control = 0; + irpSp___0->Control = 64; + irpSp___0->Control = (int)irpSp___0->Control | 128; + irpSp___0->Control = (int)irpSp___0->Control | 32; + status = IofCallDriver(parentDevObj, Irp); + KeWaitForSingleObject(&event, 5, 0, 0, (void *)0); + } + if (status == 259L) { + status = myStatus; + } else { + } + return (status); + } } -NTSTATUS PptPnpPassThroughPnpIrpAndReleaseRemoveLock(PDEVICE_EXTENSION Extension , - PIRP Irp ) -{ NTSTATUS status ; +NTSTATUS +PptPnpPassThroughPnpIrpAndReleaseRemoveLock(PDEVICE_EXTENSION Extension, + PIRP Irp) { + NTSTATUS status; { - if (s == NP) { - s = SKIP1; - } else { + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } { - errorFn(); + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + status = IofCallDriver(Extension->ParentDeviceObject, Irp); + PptReleaseRemoveLock(&Extension->RemoveLock, Irp); } + return (status); } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - status = IofCallDriver(Extension->ParentDeviceObject, Irp); - PptReleaseRemoveLock(& Extension->RemoveLock, Irp); - } - return (status); } -} -NTSTATUS PptPnpUnhandledIrp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ NTSTATUS tmp ; +NTSTATUS PptPnpUnhandledIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + NTSTATUS tmp; { - { - tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock(DeviceObject->DeviceExtension, - Irp); + { + tmp = PptPnpPassThroughPnpIrpAndReleaseRemoveLock( + DeviceObject->DeviceExtension, Irp); + } + return (tmp); } - return (tmp); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -NTSTATUS PptPowerComplete(PDEVICE_OBJECT pDeviceObject , PIRP pIrp , PDEVICE_EXTENSION Extension ) -{ POWER_STATE_TYPE powerType ; - POWER_STATE powerState ; - PIO_STACK_LOCATION pIrpStack ; - - { - pIrpStack = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - powerType = pIrpStack->Parameters.Power.Type; - powerState = pIrpStack->Parameters.Power.State; - if (pIrpStack->MinorFunction == 3) { - goto switch_274_3; - } else { - if (pIrpStack->MinorFunction == 2) { - goto switch_274_2; - } else { - { - goto switch_274_default; - if (0) { - switch_274_3: /* CIL Label */ ; - goto switch_274_break; - switch_274_2: /* CIL Label */ ; +NTSTATUS PptPowerComplete(PDEVICE_OBJECT pDeviceObject, PIRP pIrp, + PDEVICE_EXTENSION Extension) { + POWER_STATE_TYPE powerType; + POWER_STATE powerState; + PIO_STACK_LOCATION pIrpStack; + + { + pIrpStack = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + powerType = pIrpStack->Parameters.Power.Type; + powerState = pIrpStack->Parameters.Power.State; + if (pIrpStack->MinorFunction == 3) { + goto switch_274_3; + } else { + if (pIrpStack->MinorFunction == 2) { + goto switch_274_2; + } else { { - } - if (powerType == 1) { - goto switch_276_1; - } else { - if (powerType == 0) { - goto switch_276_0; - } else { - if (0) { - switch_276_1: /* CIL Label */ ; - if ((int )Extension->DeviceState < (int )powerState.DeviceState) { - + goto switch_274_default; + if (0) { + switch_274_3: /* CIL Label */; + goto switch_274_break; + switch_274_2: /* CIL Label */; + {} + if (powerType == 1) { + goto switch_276_1; + } else { + if (powerType == 0) { + goto switch_276_0; } else { - if ((int )powerState.DeviceState < (int )Extension->DeviceState) { - { - PoSetPowerState(Extension->DeviceObject, powerType, powerState); - } - if (1 == (int )Extension->DeviceState) { + if (0) { + switch_276_1: /* CIL Label */; + if ((int)Extension->DeviceState < + (int)powerState.DeviceState) { } else { + if ((int)powerState.DeviceState < + (int)Extension->DeviceState) { + { + PoSetPowerState(Extension->DeviceObject, powerType, + powerState); + } + if (1 == (int)Extension->DeviceState) { + } else { + } + Extension->DeviceState = powerState.DeviceState; + } else { + } } - Extension->DeviceState = powerState.DeviceState; - } else { - - } - } - goto switch_276_break; - switch_276_0: /* CIL Label */ ; - if ((int )Extension->SystemState < (int )powerState.SystemState) { + goto switch_276_break; + switch_276_0: /* CIL Label */; + if ((int)Extension->SystemState < + (int)powerState.SystemState) { - } else { - if ((int )powerState.SystemState < (int )Extension->SystemState) { - if (1 == (int )powerState.SystemState) { - { - powerState.DeviceState = 1; - PoRequestPowerIrp(Extension->DeviceObject, 2, powerState, (void *)0, - (void *)0, (void *)0); - } } else { - + if ((int)powerState.SystemState < + (int)Extension->SystemState) { + if (1 == (int)powerState.SystemState) { + { + powerState.DeviceState = 1; + PoRequestPowerIrp(Extension->DeviceObject, 2, + powerState, (void *)0, (void *)0, + (void *)0); + } + } else { + } + Extension->SystemState = powerState.SystemState; + } else { + } } - Extension->SystemState = powerState.SystemState; + goto switch_276_break; } else { - + switch_276_break: /* CIL Label */; } } - goto switch_276_break; - } else { - switch_276_break: /* CIL Label */ ; } + goto switch_274_break; + switch_274_default: /* CIL Label */; + } else { + switch_274_break: /* CIL Label */; } } - goto switch_274_break; - switch_274_default: /* CIL Label */ ; - } else { - switch_274_break: /* CIL Label */ ; - } } } + { /* PoStartNextPowerIrp(pIrp); */ /* INLINED */ + } + return (0L); } - { -/* PoStartNextPowerIrp(pIrp); */ /* INLINED */ - } - return (0L); } -} -void InitNEC_98(PDEVICE_EXTENSION Extension ) -{ PUCHAR Controller ; +void InitNEC_98(PDEVICE_EXTENSION Extension) { + PUCHAR Controller; { - { - Controller = Extension->PortInfo.Controller; - WRITE_PORT_UCHAR(Controller + 9, 16); - WRITE_PORT_UCHAR(Controller + 14, 0); - WRITE_PORT_UCHAR(Controller + 2, 4); + { + Controller = Extension->PortInfo.Controller; + WRITE_PORT_UCHAR(Controller + 9, 16); + WRITE_PORT_UCHAR(Controller + 14, 0); + WRITE_PORT_UCHAR(Controller + 2, 4); + } + return; } - return; -} } -NTSTATUS PptDispatchPower(PDEVICE_OBJECT pDeviceObject , PIRP pIrp ) -{ POWER_STATE_TYPE powerType ; - POWER_STATE powerState ; - PIO_STACK_LOCATION pIrpStack ; - NTSTATUS status ; - PDEVICE_EXTENSION Extension ; - BOOLEAN hookit ; - NTSTATUS status___0 ; - NTSTATUS tmp ; - PIO_STACK_LOCATION irpSp ; - PIO_STACK_LOCATION nextIrpSp ; - PIO_STACK_LOCATION irpSp___0 ; +NTSTATUS PptDispatchPower(PDEVICE_OBJECT pDeviceObject, PIRP pIrp) { + POWER_STATE_TYPE powerType; + POWER_STATE powerState; + PIO_STACK_LOCATION pIrpStack; + NTSTATUS status; + PDEVICE_EXTENSION Extension; + BOOLEAN hookit; + NTSTATUS status___0; + NTSTATUS tmp; + PIO_STACK_LOCATION irpSp; + PIO_STACK_LOCATION nextIrpSp; + PIO_STACK_LOCATION irpSp___0; { - { - status = 0L; - hookit = 0; - Extension = pDeviceObject->DeviceExtension; - pIrpStack = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - tmp = PptAcquireRemoveLock(& Extension->RemoveLock, pIrp); - status___0 = tmp; - } - if (! (status___0 >= 0L)) { { -/* PoStartNextPowerIrp(pIrp); */ /* INLINED */ - pIrp->IoStatus.__annonCompField4.Status = status___0; - PptCompleteRequest(pIrp, 0); + status = 0L; + hookit = 0; + Extension = pDeviceObject->DeviceExtension; + pIrpStack = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + tmp = PptAcquireRemoveLock(&Extension->RemoveLock, pIrp); + status___0 = tmp; + } + if (!(status___0 >= 0L)) { + { + /* PoStartNextPowerIrp(pIrp); */ /* INLINED */ + pIrp->IoStatus.__annonCompField4.Status = status___0; + PptCompleteRequest(pIrp, 0); + } + return (status___0); + } else { } - return (status___0); - } else { - - } - powerType = pIrpStack->Parameters.Power.Type; - powerState = pIrpStack->Parameters.Power.State; - if (pIrpStack->MinorFunction == 3) { - goto switch_277_3; - } else { - if (pIrpStack->MinorFunction == 2) { - goto switch_277_2; + powerType = pIrpStack->Parameters.Power.Type; + powerState = pIrpStack->Parameters.Power.State; + if (pIrpStack->MinorFunction == 3) { + goto switch_277_3; } else { - { - goto switch_277_default; - if (0) { - switch_277_3: /* CIL Label */ - status = 0L; - goto switch_277_break; - switch_277_2: /* CIL Label */ ; + if (pIrpStack->MinorFunction == 2) { + goto switch_277_2; + } else { { - } - if (powerType == 1) { - goto switch_279_1; - } else { - if (powerType == 0) { - goto switch_279_0; - } else { - if (0) { - switch_279_1: /* CIL Label */ ; - if ((int )Extension->DeviceState < (int )powerState.DeviceState) { - { - PoSetPowerState(Extension->DeviceObject, powerType, powerState); - } - if (1 == (int )Extension->DeviceState) { - - } else { - - } - Extension->DeviceState = powerState.DeviceState; + goto switch_277_default; + if (0) { + switch_277_3: /* CIL Label */ + status = 0L; + goto switch_277_break; + switch_277_2: /* CIL Label */; + {} + if (powerType == 1) { + goto switch_279_1; + } else { + if (powerType == 0) { + goto switch_279_0; } else { - if ((int )powerState.DeviceState < (int )Extension->DeviceState) { - hookit = 1; - if ((int )((KUSER_SHARED_DATA * const )4292804608U)->AlternativeArchitecture == 1) { + if (0) { + switch_279_1: /* CIL Label */; + if ((int)Extension->DeviceState < + (int)powerState.DeviceState) { { - InitNEC_98(Extension); + PoSetPowerState(Extension->DeviceObject, powerType, + powerState); } - } else { + if (1 == (int)Extension->DeviceState) { + } else { + } + Extension->DeviceState = powerState.DeviceState; + } else { + if ((int)powerState.DeviceState < + (int)Extension->DeviceState) { + hookit = 1; + if ((int)((KUSER_SHARED_DATA * const)4292804608U) + ->AlternativeArchitecture == 1) { + { InitNEC_98(Extension); } + } else { + } + } else { + } } - } else { - - } - } - goto switch_279_break; - switch_279_0: /* CIL Label */ ; - if ((int )Extension->SystemState < (int )powerState.SystemState) { - if (1 == (int )Extension->SystemState) { - - } else { + goto switch_279_break; + switch_279_0: /* CIL Label */; + if ((int)Extension->SystemState < + (int)powerState.SystemState) { + if (1 == (int)Extension->SystemState) { - } - { - powerState.DeviceState = 4; - PoRequestPowerIrp(Extension->DeviceObject, 2, powerState, (void *)0, - (void *)0, (void *)0); - Extension->SystemState = powerState.SystemState; - } - } else { - if ((int )powerState.SystemState < (int )Extension->SystemState) { - hookit = 1; + } else { + } + { + powerState.DeviceState = 4; + PoRequestPowerIrp(Extension->DeviceObject, 2, powerState, + (void *)0, (void *)0, (void *)0); + Extension->SystemState = powerState.SystemState; + } + } else { + if ((int)powerState.SystemState < + (int)Extension->SystemState) { + hookit = 1; + } else { + } + } + goto switch_279_break; } else { - + switch_279_break: /* CIL Label */; } } - goto switch_279_break; - } else { - switch_279_break: /* CIL Label */ ; } + goto switch_277_break; + switch_277_default: /* CIL Label */ + status = -1073741637L; + } else { + switch_277_break: /* CIL Label */; } } - goto switch_277_break; - switch_277_default: /* CIL Label */ - status = -1073741637L; - } else { - switch_277_break: /* CIL Label */ ; - } } } - } - { - irpSp = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation; - nextIrpSp = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine)); - nextIrpSp->Control = 0; - } - if (! (status >= 0L)) { { - pIrp->IoStatus.__annonCompField4.Status = status; -/* PoStartNextPowerIrp(pIrp); */ /* INLINED */ - PptCompleteRequest(pIrp, 0); + irpSp = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation; + nextIrpSp = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + memcpy(nextIrpSp, irpSp, + (long)(&((IO_STACK_LOCATION *)0)->CompletionRoutine)); + nextIrpSp->Control = 0; } - } else { - if (hookit) { - if (s != NP) { + if (!(status >= 0L)) { + { + pIrp->IoStatus.__annonCompField4.Status = status; + /* PoStartNextPowerIrp(pIrp); */ /* INLINED */ + PptCompleteRequest(pIrp, 0); + } + } else { + if (hookit) { + if (s != NP) { + { errorFn(); } + } else { + if (compRegistered != 0) { + { errorFn(); } + } else { + compRegistered = 1; + compFptr = &PptPowerComplete; + routine = 1; + } + } { - errorFn(); + irpSp___0 = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation - + 1; + irpSp___0->CompletionRoutine = &PptPowerComplete; + irpSp___0->Context = Extension; + irpSp___0->Control = 0; + irpSp___0->Control = 64; + irpSp___0->Control = (int)irpSp___0->Control | 128; + irpSp___0->Control = (int)irpSp___0->Control | 32; + status = PoCallDriver(Extension->ParentDeviceObject, pIrp); } } else { - if (compRegistered != 0) { - { - errorFn(); - } - } else { - compRegistered = 1; - compFptr = & PptPowerComplete; - routine = 1; + { + /* PoStartNextPowerIrp(pIrp); */ /* INLINED */ + status = PoCallDriver(Extension->ParentDeviceObject, pIrp); } } - { - irpSp___0 = pIrp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1; - irpSp___0->CompletionRoutine = & PptPowerComplete; - irpSp___0->Context = Extension; - irpSp___0->Control = 0; - irpSp___0->Control = 64; - irpSp___0->Control = (int )irpSp___0->Control | 128; - irpSp___0->Control = (int )irpSp___0->Control | 32; - status = PoCallDriver(Extension->ParentDeviceObject, pIrp); - } - } else { - { -/* PoStartNextPowerIrp(pIrp); */ /* INLINED */ - status = PoCallDriver(Extension->ParentDeviceObject, pIrp); - } } + { PptReleaseRemoveLock(&Extension->RemoveLock, pIrp); } + return (status); } - { - PptReleaseRemoveLock(& Extension->RemoveLock, pIrp); - } - return (status); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) -static UCHAR LegacyZipModeQualifier___11[3] = { 0, 60, 32}; +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +static UCHAR LegacyZipModeQualifier___11[3] = {0, 60, 32}; #pragma once -void PptLegacyZipClockDiskModeByte(PUCHAR Controller , UCHAR ModeByte ) -{ - - { - { - WRITE_PORT_UCHAR(Controller, ModeByte); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)6); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); - } - return; -} -} -void PptLegacyZipClockPrtModeByte(PUCHAR Controller , UCHAR ModeByte ) -{ +void PptLegacyZipClockDiskModeByte(PUCHAR Controller, UCHAR ModeByte) { { - { - WRITE_PORT_UCHAR(Controller, ModeByte); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)14); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); + { + WRITE_PORT_UCHAR(Controller, ModeByte); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)6); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); + } + return; } - return; } -} -void PptLegacyZipSetDiskMode(PUCHAR Controller , UCHAR Mode ) -{ ULONG i = __VERIFIER_nondet_long() ; +void PptLegacyZipClockPrtModeByte(PUCHAR Controller, UCHAR ModeByte) { { - { - PptLegacyZipClockDiskModeByte(Controller, LegacyZipModeQualifier___11[i]); - PptLegacyZipClockDiskModeByte(Controller, Mode); + { + WRITE_PORT_UCHAR(Controller, ModeByte); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)14); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)12); + } + return; } - return; -} } -BOOLEAN PptLegacyZipCheckDevice(PUCHAR Controller ) -{ UCHAR tmp ; - UCHAR tmp___0 ; +void PptLegacyZipSetDiskMode(PUCHAR Controller, UCHAR Mode) { + ULONG i = __VERIFIER_nondet_long(); { - { - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)6); - tmp___0 = READ_PORT_UCHAR(Controller + 1); - } - if (((int )tmp___0 & 8) == 8) { { - WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); - tmp = READ_PORT_UCHAR(Controller + 1); - } - if (((int )tmp & 8) != 8) { - return (1); - } else { - + PptLegacyZipClockDiskModeByte(Controller, LegacyZipModeQualifier___11[i]); + PptLegacyZipClockDiskModeByte(Controller, Mode); } - } else { - + return; } - return (0); } -} -NTSTATUS PptTrySelectLegacyZip(PVOID Context , PVOID TrySelectCommand ) -{ PDEVICE_EXTENSION Extension ; - PPARALLEL_1284_COMMAND Command ; - NTSTATUS Status ; - PUCHAR Controller ; - SYNCHRONIZED_COUNT_CONTEXT SyncContext ; - KIRQL CancelIrql ; - BOOLEAN tmp ; +BOOLEAN PptLegacyZipCheckDevice(PUCHAR Controller) { + UCHAR tmp; + UCHAR tmp___0; { - Extension = Context; - Command = TrySelectCommand; - Status = 0L; - Controller = Extension->PortInfo.Controller; - { - } - if (! (Command->CommandFlags & 2UL)) { - { - } { - IoAcquireCancelSpinLock(& CancelIrql); - SyncContext.Count = & Extension->WorkQueueCount; + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)6); + tmp___0 = READ_PORT_UCHAR(Controller + 1); } - if (Extension->InterruptRefCount) { + if (((int)tmp___0 & 8) == 8) { { - KeSynchronizeExecution(Extension->InterruptObject, & PptSynchronizedIncrement, - & SyncContext); + WRITE_PORT_UCHAR(Controller + 2, (unsigned char)4); + tmp = READ_PORT_UCHAR(Controller + 1); } - } else { - { - PptSynchronizedIncrement(& SyncContext); + if (((int)tmp & 8) != 8) { + return (1); + } else { } - } - if (SyncContext.NewCount) { - Status = 259L; } else { - - } - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ } - } else { - + return (0); } - if (Status >= 0L) { - if (Status != 259L) { - if (Command->CommandFlags & 32UL) { +} +NTSTATUS PptTrySelectLegacyZip(PVOID Context, PVOID TrySelectCommand) { + PDEVICE_EXTENSION Extension; + PPARALLEL_1284_COMMAND Command; + NTSTATUS Status; + PUCHAR Controller; + SYNCHRONIZED_COUNT_CONTEXT SyncContext; + KIRQL CancelIrql; + BOOLEAN tmp; + + { + Extension = Context; + Command = TrySelectCommand; + Status = 0L; + Controller = Extension->PortInfo.Controller; + {} + if (!(Command->CommandFlags & 2UL)) { + {} { + IoAcquireCancelSpinLock(&CancelIrql); + SyncContext.Count = &Extension->WorkQueueCount; + } + if (Extension->InterruptRefCount) { { - PptLegacyZipSetDiskMode(Controller, (unsigned char)207); + KeSynchronizeExecution(Extension->InterruptObject, + &PptSynchronizedIncrement, &SyncContext); } } else { - { - PptLegacyZipSetDiskMode(Controller, (unsigned char)143); - } + { PptSynchronizedIncrement(&SyncContext); } } - { - tmp = PptLegacyZipCheckDevice(Controller); + if (SyncContext.NewCount) { + Status = 259L; + } else { } - if (tmp) { - { + { /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } + } else { + } + if (Status >= 0L) { + if (Status != 259L) { + if (Command->CommandFlags & 32UL) { + { PptLegacyZipSetDiskMode(Controller, (unsigned char)207); } + } else { + { PptLegacyZipSetDiskMode(Controller, (unsigned char)143); } } - if (! Extension->CheckedForGenericEpp) { - if (Extension->PnpInfo.HardwareCapabilities & 1UL) { - if (! Extension->NationalChipFound) { - { - PptDetectEppPort(Extension); + { tmp = PptLegacyZipCheckDevice(Controller); } + if (tmp) { + {} + if (!Extension->CheckedForGenericEpp) { + if (Extension->PnpInfo.HardwareCapabilities & 1UL) { + if (!Extension->NationalChipFound) { + { PptDetectEppPort(Extension); } + } else { } } else { - } + Extension->CheckedForGenericEpp = 1; } else { - } - Extension->CheckedForGenericEpp = 1; } else { - + {} { + PptDeselectLegacyZip(Context, TrySelectCommand); + Status = -1073741823L; + } } } else { - { - } - { - PptDeselectLegacyZip(Context, TrySelectCommand); - Status = -1073741823L; - } } } else { - - } - } else { - - } - return (Status); -} -} -NTSTATUS PptDeselectLegacyZip(PVOID Context , PVOID DeselectCommand ) -{ ULONG i = __VERIFIER_nondet_long() ; - PDEVICE_EXTENSION Extension ; - PUCHAR Controller ; - PPARALLEL_1284_COMMAND Command ; - - { - Extension = Context; - Controller = Extension->PortInfo.Controller; - Command = DeselectCommand; - { - } - { - PptLegacyZipClockPrtModeByte(Controller, LegacyZipModeQualifier___11[i]); - PptLegacyZipClockPrtModeByte(Controller, (unsigned char)15); - } - if (! (Command->CommandFlags & 2UL)) { - { - PptFreePort(Extension); } - } else { - - } - return (0L); -} -} -#pragma once -#pragma once -#pragma once -#pragma once -#pragma warning(push) -#pragma warning(disable:4035) -#pragma warning(pop) -#pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(push) -#pragma warning(disable:4035) -#pragma warning(pop) -#pragma warning(disable:4035) -#pragma warning(push) -#pragma warning(disable:4164) -#pragma function(_enable) -#pragma function(_disable) -#pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) -#pragma once -void PptRegInitDriverSettings(PUNICODE_STRING RegistryPath___0 ) -{ NTSTATUS Status ; - RTL_QUERY_REGISTRY_TABLE paramTable[3] ; - PWSTR path ; - ULONG defaultDebugLevel ; - ULONG defaultBreakOn ; - PVOID tmp ; - - { - { - defaultDebugLevel = 0UL; - defaultBreakOn = 0UL; - tmp = ExAllocatePoolWithTag(1, (unsigned int )RegistryPath___0->Length + sizeof(WCHAR ), - 1349673296UL); - path = tmp; - } - if (! path) { - PptDebugLevel = defaultDebugLevel; - PptBreakOn = defaultBreakOn; - return; - } else { - - } - { - memmove(path, RegistryPath___0->Buffer, RegistryPath___0->Length); - *(path + (int )RegistryPath___0->Length / 2) = (unsigned short)0; - memset(paramTable, 0, sizeof(paramTable)); - paramTable[0].Flags = 32; - paramTable[0].EntryContext = & PptDebugLevel; - paramTable[0].DefaultType = 4; - paramTable[0].DefaultData = & defaultDebugLevel; - paramTable[0].DefaultLength = sizeof(ULONG ); - paramTable[1].Flags = 32; - paramTable[1].EntryContext = & PptBreakOn; - paramTable[1].DefaultType = 4; - paramTable[1].DefaultData = & defaultBreakOn; - paramTable[1].DefaultLength = sizeof(ULONG ); - Status = RtlQueryRegistryValues(2147483648U, path, paramTable, (void *)0, (void *)0); - } - if (! (Status >= 0L)) { - PptDebugLevel = defaultDebugLevel; - PptBreakOn = defaultBreakOn; - } else { - - } - { -/* ExFreePool(path); */ /* INLINED */ - } - { + return (Status); } - return; -} } -NTSTATUS PptRegGetDeviceParameterDword(PDEVICE_OBJECT Pdo , PWSTR ParameterName , - PULONG ParameterValue ) -{ NTSTATUS status ; - HANDLE hKey ; - RTL_QUERY_REGISTRY_TABLE queryTable[2] ; - ULONG defaultValue ; - - { - { - status = IoOpenDeviceRegistryKey(Pdo, 1, 131097L, & hKey); - } - if (! (status >= 0L)) { - return (status); - } else { - - } - { - defaultValue = *ParameterValue; - memset(& queryTable, 0, sizeof(queryTable)); - queryTable[0].Flags = 32; - queryTable[0].Name = ParameterName; - queryTable[0].EntryContext = ParameterValue; - queryTable[0].DefaultType = 4; - queryTable[0].DefaultData = & defaultValue; - queryTable[0].DefaultLength = sizeof(ULONG ); - status = RtlQueryRegistryValues(1073741824, hKey, queryTable, (void *)0, (void *)0); - } - if (! (status >= 0L)) { - *ParameterValue = defaultValue; - } else { +NTSTATUS PptDeselectLegacyZip(PVOID Context, PVOID DeselectCommand) { + ULONG i = __VERIFIER_nondet_long(); + PDEVICE_EXTENSION Extension; + PUCHAR Controller; + PPARALLEL_1284_COMMAND Command; - } { - ZwClose(hKey); + Extension = Context; + Controller = Extension->PortInfo.Controller; + Command = DeselectCommand; + {} { + PptLegacyZipClockPrtModeByte(Controller, LegacyZipModeQualifier___11[i]); + PptLegacyZipClockPrtModeByte(Controller, (unsigned char)15); + } + if (!(Command->CommandFlags & 2UL)) { + { PptFreePort(Extension); } + } else { + } + return (0L); } - return (status); } +#pragma once +#pragma once +#pragma once +#pragma once +#pragma warning(push) +#pragma warning(disable : 4035) +#pragma warning(pop) +#pragma once +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(push) +#pragma warning(disable : 4035) +#pragma warning(pop) +#pragma warning(disable : 4035) +#pragma warning(push) +#pragma warning(disable : 4164) +#pragma function(_enable) +#pragma function(_disable) +#pragma warning(pop) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +#pragma once +void PptRegInitDriverSettings(PUNICODE_STRING RegistryPath___0) { + NTSTATUS Status; + RTL_QUERY_REGISTRY_TABLE paramTable[3]; + PWSTR path; + ULONG defaultDebugLevel; + ULONG defaultBreakOn; + PVOID tmp; + + { + { + defaultDebugLevel = 0UL; + defaultBreakOn = 0UL; + tmp = ExAllocatePoolWithTag( + 1, (unsigned int)RegistryPath___0->Length + sizeof(WCHAR), + 1349673296UL); + path = tmp; + } + if (!path) { + PptDebugLevel = defaultDebugLevel; + PptBreakOn = defaultBreakOn; + return; + } else { + } + { + memmove(path, RegistryPath___0->Buffer, RegistryPath___0->Length); + *(path + (int)RegistryPath___0->Length / 2) = (unsigned short)0; + memset(paramTable, 0, sizeof(paramTable)); + paramTable[0].Flags = 32; + paramTable[0].EntryContext = &PptDebugLevel; + paramTable[0].DefaultType = 4; + paramTable[0].DefaultData = &defaultDebugLevel; + paramTable[0].DefaultLength = sizeof(ULONG); + paramTable[1].Flags = 32; + paramTable[1].EntryContext = &PptBreakOn; + paramTable[1].DefaultType = 4; + paramTable[1].DefaultData = &defaultBreakOn; + paramTable[1].DefaultLength = sizeof(ULONG); + Status = RtlQueryRegistryValues(2147483648U, path, paramTable, (void *)0, + (void *)0); + } + if (!(Status >= 0L)) { + PptDebugLevel = defaultDebugLevel; + PptBreakOn = defaultBreakOn; + } else { + } + { + /* ExFreePool(path); */ /* INLINED */ + } {} + return; + } } -NTSTATUS PptRegSetDeviceParameterDword(PDEVICE_OBJECT Pdo , PWSTR ParameterName , - PULONG ParameterValue ) -{ NTSTATUS status ; - HANDLE hKey ; - UNICODE_STRING valueName ; +NTSTATUS PptRegGetDeviceParameterDword(PDEVICE_OBJECT Pdo, PWSTR ParameterName, + PULONG ParameterValue) { + NTSTATUS status; + HANDLE hKey; + RTL_QUERY_REGISTRY_TABLE queryTable[2]; + ULONG defaultValue; { - { - status = IoOpenDeviceRegistryKey(Pdo, 1, 131078L, & hKey); - } - if (! (status >= 0L)) { + { status = IoOpenDeviceRegistryKey(Pdo, 1, 131097L, &hKey); } + if (!(status >= 0L)) { + return (status); + } else { + } { + defaultValue = *ParameterValue; + memset(&queryTable, 0, sizeof(queryTable)); + queryTable[0].Flags = 32; + queryTable[0].Name = ParameterName; + queryTable[0].EntryContext = ParameterValue; + queryTable[0].DefaultType = 4; + queryTable[0].DefaultData = &defaultValue; + queryTable[0].DefaultLength = sizeof(ULONG); + status = RtlQueryRegistryValues(1073741824, hKey, queryTable, (void *)0, + (void *)0); } + if (!(status >= 0L)) { + *ParameterValue = defaultValue; + } else { + } + { ZwClose(hKey); } return (status); - } else { - } +} +NTSTATUS PptRegSetDeviceParameterDword(PDEVICE_OBJECT Pdo, PWSTR ParameterName, + PULONG ParameterValue) { + NTSTATUS status; + HANDLE hKey; + UNICODE_STRING valueName; + { -/* RtlInitUnicodeString(& valueName, ParameterName); */ /* INLINED */ - status = ZwSetValueKey(hKey, & valueName, 0, 4, ParameterValue, sizeof(ULONG )); - } - if (! (status >= 0L)) { + { status = IoOpenDeviceRegistryKey(Pdo, 1, 131078L, &hKey); } + if (!(status >= 0L)) { + {} + return (status); + } else { + } { + /* RtlInitUnicodeString(& valueName, ParameterName); */ /* INLINED */ + status = + ZwSetValueKey(hKey, &valueName, 0, 4, ParameterValue, sizeof(ULONG)); } - } else { - - } - { - ZwClose(hKey); + if (!(status >= 0L)) { + {} + } else { + } + { ZwClose(hKey); } + return (status); } - return (status); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -NTSTATUS PptFailRequest(PIRP Irp , NTSTATUS Status ) -{ +NTSTATUS PptFailRequest(PIRP Irp, NTSTATUS Status) { { - { - Irp->IoStatus.__annonCompField4.Status = Status; - myStatus = Status; - Irp->IoStatus.Information = 0; - PptCompleteRequest(Irp, 0); + { + Irp->IoStatus.__annonCompField4.Status = Status; + myStatus = Status; + Irp->IoStatus.Information = 0; + PptCompleteRequest(Irp, 0); + } + return (Status); } - return (Status); -} } -NTSTATUS PptAcquireRemoveLockOrFailIrp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION extension ; - PIO_REMOVE_LOCK removeLock ; - NTSTATUS status ; - NTSTATUS tmp ; +NTSTATUS PptAcquireRemoveLockOrFailIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION extension; + PIO_REMOVE_LOCK removeLock; + NTSTATUS status; + NTSTATUS tmp; { - { - extension = DeviceObject->DeviceExtension; - removeLock = & extension->RemoveLock; - tmp = IoAcquireRemoveLockEx(removeLock, Irp, "util.c", 33, sizeof(IO_REMOVE_LOCK )); - status = tmp; - } - if (! (status >= 0L)) { { - PptFailRequest(Irp, status); + extension = DeviceObject->DeviceExtension; + removeLock = &extension->RemoveLock; + tmp = IoAcquireRemoveLockEx(removeLock, Irp, "util.c", 33, + sizeof(IO_REMOVE_LOCK)); + status = tmp; } - } else { - + if (!(status >= 0L)) { + { PptFailRequest(Irp, status); } + } else { + } + return (status); } - return (status); } -} -NTSTATUS PptDispatchPreProcessIrp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION Extension ; - NTSTATUS status ; - NTSTATUS tmp ; +NTSTATUS PptDispatchPreProcessIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION Extension; + NTSTATUS status; + NTSTATUS tmp; { - { - Extension = DeviceObject->DeviceExtension; - tmp = PptAcquireRemoveLock(& Extension->RemoveLock, Irp); - status = tmp; - } - if (! (status >= 0L)) { { - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = status; - myStatus = status; - PptCompleteRequest(Irp, 0); + Extension = DeviceObject->DeviceExtension; + tmp = PptAcquireRemoveLock(&Extension->RemoveLock, Irp); + status = tmp; } - } else { - + if (!(status >= 0L)) { + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = status; + myStatus = status; + PptCompleteRequest(Irp, 0); + } + } else { + } + return (status); } - return (status); -} } -NTSTATUS PptDispatchPostProcessIrp(void) -{ +NTSTATUS PptDispatchPostProcessIrp(void) { - { - return (0L); -} + { return (0L); } } -NTSTATUS PptSynchCompletionRoutine(PDEVICE_OBJECT DeviceObject , PIRP Irp , PKEVENT Event ) -{ +NTSTATUS PptSynchCompletionRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp, + PKEVENT Event) { { - { - KeSetEvent(Event, 0, 0); + { KeSetEvent(Event, 0, 0); } + return (-1073741802L); } - return (-1073741802L); -} } -PWSTR PptGetPortNameFromPhysicalDeviceObject(PDEVICE_OBJECT PhysicalDeviceObject ) -{ NTSTATUS status ; - HANDLE hKey ; - PKEY_VALUE_FULL_INFORMATION buffer ; - ULONG bufferLength ; - ULONG resultLength ; - PWSTR valueNameWstr ; - UNICODE_STRING valueName ; - PWSTR portName ; - PVOID tmp ; - PVOID tmp___0 ; +PWSTR PptGetPortNameFromPhysicalDeviceObject( + PDEVICE_OBJECT PhysicalDeviceObject) { + NTSTATUS status; + HANDLE hKey; + PKEY_VALUE_FULL_INFORMATION buffer; + ULONG bufferLength; + ULONG resultLength; + PWSTR valueNameWstr; + UNICODE_STRING valueName; + PWSTR portName; + PVOID tmp; + PVOID tmp___0; { - { - } - { - status = IoOpenDeviceRegistryKey(PhysicalDeviceObject, 1, 2031616L, & hKey); - } - if (! (status >= 0L)) { - { + {} { + status = + IoOpenDeviceRegistryKey(PhysicalDeviceObject, 1, 2031616L, &hKey); } - return ((void *)0); - } else { - - } - { - bufferLength = 0; - buffer = (void *)0; -/* RtlInitUnicodeString(& valueName, valueNameWstr); */ /* INLINED */ - status = -1073741789L; - } - { - while (1) { - while_290_continue: /* CIL Label */ ; - if (status == -1073741789L) { - + if (!(status >= 0L)) { + {} + return ((void *)0); } else { - goto while_290_break; } { - status = ZwQueryValueKey(hKey, & valueName, 1, buffer, bufferLength, & resultLength); + bufferLength = 0; + buffer = (void *)0; + /* RtlInitUnicodeString(& valueName, valueNameWstr); */ /* INLINED */ + status = -1073741789L; } - if (status == -1073741789L) { - if (buffer) { - { -/* ExFreePool(buffer); */ /* INLINED */ - } - } else { + { + while (1) { + while_290_continue: /* CIL Label */; + if (status == -1073741789L) { - } - { - tmp = ExAllocatePoolWithTag(1, resultLength, 1349673296UL); - buffer = tmp; - bufferLength = resultLength; - } - if (! buffer) { - { + } else { + goto while_290_break; } { - ZwClose(hKey); + status = ZwQueryValueKey(hKey, &valueName, 1, buffer, bufferLength, + &resultLength); + } + if (status == -1073741789L) { + if (buffer) { + { /* ExFreePool(buffer); */ /* INLINED */ + } + } else { + } + { + tmp = ExAllocatePoolWithTag(1, resultLength, 1349673296UL); + buffer = tmp; + bufferLength = resultLength; + } + if (!buffer) { + {} { ZwClose(hKey); } + return ((void *)0); + } else { + } + } else { + } + } + while_290_break: /* CIL Label */; + } + { ZwClose(hKey); } + if (!(status >= 0L)) { + if (buffer) { + { /* ExFreePool(buffer); */ /* INLINED */ } - return ((void *)0); } else { - } + {} + return ((void *)0); } else { - } - } - while_290_break: /* CIL Label */ ; - } - { - ZwClose(hKey); - } - if (! (status >= 0L)) { - if (buffer) { - { -/* ExFreePool(buffer); */ /* INLINED */ - } + if (buffer->Type != 1UL) { + goto _L; } else { - + if (!buffer->DataLength) { + _L : /* CIL Label */ + {} + { /* ExFreePool(buffer); */ /* INLINED */ + } + return ((void *)0); + } else { + } } { + tmp___0 = ExAllocatePoolWithTag(1, buffer->DataLength, 1349673296UL); + portName = tmp___0; } - return ((void *)0); - } else { - - } - if (buffer->Type != 1UL) { - goto _L; - } else { - if (! buffer->DataLength) { - _L: /* CIL Label */ - { - } - { -/* ExFreePool(buffer); */ /* INLINED */ + if (!portName) { + {} { /* ExFreePool(buffer); */ /* INLINED */ } return ((void *)0); } else { - - } - } - { - tmp___0 = ExAllocatePoolWithTag(1, buffer->DataLength, 1349673296UL); - portName = tmp___0; - } - if (! portName) { - { } { -/* ExFreePool(buffer); */ /* INLINED */ + memcpy(portName, (UCHAR *)buffer + buffer->DataOffset, + buffer->DataLength); + /* ExFreePool(buffer); */ /* INLINED */ } - return ((void *)0); - } else { - - } - { - memcpy(portName, (UCHAR *)buffer + buffer->DataOffset, buffer->DataLength); -/* ExFreePool(buffer); */ /* INLINED */ + return (portName); } - return (portName); } -} -NTSTATUS PptConnectInterrupt(PDEVICE_EXTENSION Extension ) -{ NTSTATUS Status ; - - { - Status = 0L; - if (! Extension->FoundInterrupt) { - return (-1073741637L); - } else { +NTSTATUS PptConnectInterrupt(PDEVICE_EXTENSION Extension) { + NTSTATUS Status; - } { - Status = IoConnectInterrupt(& Extension->InterruptObject, & PptInterruptService, - Extension, (void *)0, Extension->InterruptVector, Extension->InterruptLevel, - Extension->InterruptLevel, Extension->InterruptMode, - 1, Extension->InterruptAffinity, 0); - } - if (! (Status >= 0L)) { - { - PptLogError((Extension->DeviceObject)->DriverObject, Extension->DeviceObject, - Extension->PortInfo.OriginalController, PhysicalZero, 0, 0, 0, 14, - Status, 20); + Status = 0L; + if (!Extension->FoundInterrupt) { + return (-1073741637L); + } else { } { + Status = IoConnectInterrupt( + &Extension->InterruptObject, &PptInterruptService, Extension, + (void *)0, Extension->InterruptVector, Extension->InterruptLevel, + Extension->InterruptLevel, Extension->InterruptMode, 1, + Extension->InterruptAffinity, 0); } - } else { - + if (!(Status >= 0L)) { + { + PptLogError((Extension->DeviceObject)->DriverObject, + Extension->DeviceObject, + Extension->PortInfo.OriginalController, PhysicalZero, 0, 0, + 0, 14, Status, 20); + } + {} + } else { + } + return (Status); } - return (Status); } -} -void PptDisconnectInterrupt(PDEVICE_EXTENSION Extension ) -{ +void PptDisconnectInterrupt(PDEVICE_EXTENSION Extension) { { - { - IoDisconnectInterrupt(Extension->InterruptObject); + { IoDisconnectInterrupt(Extension->InterruptObject); } + return; } - return; -} } -BOOLEAN PptSynchronizedIncrement(PVOID SyncContext ) -{ +BOOLEAN PptSynchronizedIncrement(PVOID SyncContext) { { - *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count) += 1L; - ((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->NewCount = *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count); - return (1); -} + *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count) += 1L; + ((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->NewCount = + *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count); + return (1); + } } -BOOLEAN PptSynchronizedDecrement(PVOID SyncContext ) -{ +BOOLEAN PptSynchronizedDecrement(PVOID SyncContext) { { - *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count) -= 1L; - ((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->NewCount = *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count); - return (1); -} + *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count) -= 1L; + ((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->NewCount = + *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count); + return (1); + } } -BOOLEAN PptSynchronizedRead(PVOID SyncContext ) -{ +BOOLEAN PptSynchronizedRead(PVOID SyncContext) { { - ((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->NewCount = *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count); - return (1); -} + ((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->NewCount = + *(((struct _SYNCHRONIZED_COUNT_CONTEXT *)SyncContext)->Count); + return (1); + } } -BOOLEAN PptSynchronizedQueue(PVOID Context ) -{ PSYNCHRONIZED_LIST_CONTEXT ListContext ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_ListHead ; +BOOLEAN PptSynchronizedQueue(PVOID Context) { + PSYNCHRONIZED_LIST_CONTEXT ListContext; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_ListHead; { - ListContext = Context; - _EX_ListHead = ListContext->List; - _EX_Blink = _EX_ListHead->Blink; - (ListContext->NewEntry)->Flink = _EX_ListHead; - (ListContext->NewEntry)->Blink = _EX_Blink; - _EX_Blink->Flink = ListContext->NewEntry; - _EX_ListHead->Blink = ListContext->NewEntry; - return (1); -} + ListContext = Context; + _EX_ListHead = ListContext->List; + _EX_Blink = _EX_ListHead->Blink; + (ListContext->NewEntry)->Flink = _EX_ListHead; + (ListContext->NewEntry)->Blink = _EX_Blink; + _EX_Blink->Flink = ListContext->NewEntry; + _EX_ListHead->Blink = ListContext->NewEntry; + return (1); + } } -BOOLEAN PptSynchronizedDisconnect(PVOID Context ) -{ PSYNCHRONIZED_DISCONNECT_CONTEXT DisconnectContext ; - BOOLEAN (*ServiceRoutine)(struct _KINTERRUPT *Interrupt , PVOID ServiceContext ) ; - PVOID ServiceContext ; - PLIST_ENTRY Current ; - PISR_LIST_ENTRY ListEntry ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; +BOOLEAN PptSynchronizedDisconnect(PVOID Context) { + PSYNCHRONIZED_DISCONNECT_CONTEXT DisconnectContext; + BOOLEAN(*ServiceRoutine) + (struct _KINTERRUPT * Interrupt, PVOID ServiceContext); + PVOID ServiceContext; + PLIST_ENTRY Current; + PISR_LIST_ENTRY ListEntry; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; { - DisconnectContext = Context; - ServiceRoutine = (DisconnectContext->IsrInfo)->InterruptServiceRoutine; - ServiceContext = (DisconnectContext->IsrInfo)->InterruptServiceContext; - Current = (DisconnectContext->Extension)->IsrList.Flink; - { - while (1) { - while_296_continue: /* CIL Label */ ; - if ((unsigned int )Current != (unsigned int )(& (DisconnectContext->Extension)->IsrList)) { - - } else { - goto while_296_break; - } - ListEntry = (ISR_LIST_ENTRY *)((CHAR *)Current - (unsigned long )(& ((ISR_LIST_ENTRY *)0)->ListEntry)); - if ((unsigned int )ListEntry->ServiceRoutine == (unsigned int )ServiceRoutine) { - if ((unsigned int )ListEntry->ServiceContext == (unsigned int )ServiceContext) { - _EX_Flink = Current->Flink; - _EX_Blink = Current->Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; - return (1); - } else { + DisconnectContext = Context; + ServiceRoutine = (DisconnectContext->IsrInfo)->InterruptServiceRoutine; + ServiceContext = (DisconnectContext->IsrInfo)->InterruptServiceContext; + Current = (DisconnectContext->Extension)->IsrList.Flink; + { + while (1) { + while_296_continue: /* CIL Label */; + if ((unsigned int)Current != + (unsigned int)(&(DisconnectContext->Extension)->IsrList)) { + } else { + goto while_296_break; + } + ListEntry = (ISR_LIST_ENTRY *)((CHAR *)Current - + (unsigned long)(&((ISR_LIST_ENTRY *)0) + ->ListEntry)); + if ((unsigned int)ListEntry->ServiceRoutine == + (unsigned int)ServiceRoutine) { + if ((unsigned int)ListEntry->ServiceContext == + (unsigned int)ServiceContext) { + _EX_Flink = Current->Flink; + _EX_Blink = Current->Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + return (1); + } else { + } + } else { + } + Current = Current->Flink; } - } else { - + while_296_break: /* CIL Label */; } - Current = Current->Flink; - } - while_296_break: /* CIL Label */ ; + return (0); } - return (0); -} } -void PptCancelRoutine(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ PDEVICE_EXTENSION Extension ; - SYNCHRONIZED_COUNT_CONTEXT SyncContext ; - PLIST_ENTRY _EX_Blink ; - PLIST_ENTRY _EX_Flink ; +void PptCancelRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDEVICE_EXTENSION Extension; + SYNCHRONIZED_COUNT_CONTEXT SyncContext; + PLIST_ENTRY _EX_Blink; + PLIST_ENTRY _EX_Flink; { - { - } - Extension = DeviceObject->DeviceExtension; - SyncContext.Count = & Extension->WorkQueueCount; - if (Extension->InterruptRefCount) { - { - KeSynchronizeExecution(Extension->InterruptObject, & PptSynchronizedDecrement, - & SyncContext); + {} + Extension = DeviceObject->DeviceExtension; + SyncContext.Count = &Extension->WorkQueueCount; + if (Extension->InterruptRefCount) { + { + KeSynchronizeExecution(Extension->InterruptObject, + &PptSynchronizedDecrement, &SyncContext); + } + } else { + { PptSynchronizedDecrement(&SyncContext); } } - } else { { - PptSynchronizedDecrement(& SyncContext); + _EX_Flink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink; + _EX_Blink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Blink; + _EX_Blink->Flink = _EX_Flink; + _EX_Flink->Blink = _EX_Blink; + /* IoReleaseCancelSpinLock(Irp->CancelIrql); */ /* INLINED */ + Irp->IoStatus.Information = 0; + Irp->IoStatus.__annonCompField4.Status = -1073741536L; + myStatus = -1073741536L; + PptReleaseRemoveLock(&Extension->RemoveLock, Irp); + PptCompleteRequest(Irp, 0); } + return; } +} +void PptFreePortDpc(PKDPC Dpc, PVOID Extension, PVOID SystemArgument1, + PVOID SystemArgument2) { + { - _EX_Flink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Flink; - _EX_Blink = Irp->Tail.Overlay.__annonCompField17.ListEntry.Blink; - _EX_Blink->Flink = _EX_Flink; - _EX_Flink->Blink = _EX_Blink; -/* IoReleaseCancelSpinLock(Irp->CancelIrql); */ /* INLINED */ - Irp->IoStatus.Information = 0; - Irp->IoStatus.__annonCompField4.Status = -1073741536L; - myStatus = -1073741536L; - PptReleaseRemoveLock(& Extension->RemoveLock, Irp); - PptCompleteRequest(Irp, 0); + { PptFreePort(Extension); } + return; } - return; -} } -void PptFreePortDpc(PKDPC Dpc , PVOID Extension , PVOID SystemArgument1 , PVOID SystemArgument2 ) -{ +BOOLEAN PptTryAllocatePortAtInterruptLevel(PVOID Context) { { - { - PptFreePort(Extension); + if (((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount == -1L) { + ((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount = 0; + ((struct _DEVICE_EXTENSION *)Context) + ->WmiPortAllocFreeCounts.PortAllocates += 1UL; + return (1); + } else { + return (0); + } } - return; -} } -BOOLEAN PptTryAllocatePortAtInterruptLevel(PVOID Context ) -{ +void PptFreePortFromInterruptLevel(PVOID Context) { { - if (((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount == -1L) { - ((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount = 0; - ((struct _DEVICE_EXTENSION *)Context)->WmiPortAllocFreeCounts.PortAllocates += 1UL; - return (1); - } else { - return (0); + if (((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount == 0L) { + ((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount = -1; + } else { + { + KeInsertQueueDpc(&((struct _DEVICE_EXTENSION *)Context)->FreePortDpc, + (void *)0, (void *)0); + } + } + return; } } -} -void PptFreePortFromInterruptLevel(PVOID Context ) -{ +BOOLEAN PptInterruptService(PKINTERRUPT Interrupt, PVOID Extension) { + PLIST_ENTRY Current; + PISR_LIST_ENTRY IsrListEntry; + PDEVICE_EXTENSION DeviceExtension; + BOOLEAN tmp; { - if (((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount == 0L) { - ((struct _DEVICE_EXTENSION *)Context)->WorkQueueCount = -1; - } else { + DeviceExtension = Extension; + Current = DeviceExtension->IsrList.Flink; { - KeInsertQueueDpc(& ((struct _DEVICE_EXTENSION *)Context)->FreePortDpc, (void *)0, - (void *)0); + while (1) { + while_298_continue: /* CIL Label */; + if ((unsigned int)Current != + (unsigned int)(&DeviceExtension->IsrList)) { + + } else { + goto while_298_break; + } + { + IsrListEntry = + (ISR_LIST_ENTRY *)((CHAR *)Current - + (unsigned long)(&((ISR_LIST_ENTRY *)0) + ->ListEntry)); + tmp = (*(IsrListEntry->ServiceRoutine))(Interrupt, + IsrListEntry->ServiceContext); + } + if (tmp) { + return (1); + } else { + } + Current = Current->Flink; + } + while_298_break: /* CIL Label */; } + return (0); } - return; -} } -BOOLEAN PptInterruptService(PKINTERRUPT Interrupt , PVOID Extension ) -{ PLIST_ENTRY Current ; - PISR_LIST_ENTRY IsrListEntry ; - PDEVICE_EXTENSION DeviceExtension ; - BOOLEAN tmp ; +BOOLEAN PptTryAllocatePort(PVOID Extension) { + PDEVICE_EXTENSION DeviceExtension; + KIRQL CancelIrql; + BOOLEAN b; { - DeviceExtension = Extension; - Current = DeviceExtension->IsrList.Flink; - { - while (1) { - while_298_continue: /* CIL Label */ ; - if ((unsigned int )Current != (unsigned int )(& DeviceExtension->IsrList)) { - - } else { - goto while_298_break; - } - { - IsrListEntry = (ISR_LIST_ENTRY *)((CHAR *)Current - (unsigned long )(& ((ISR_LIST_ENTRY *)0)->ListEntry)); - tmp = (*(IsrListEntry->ServiceRoutine))(Interrupt, IsrListEntry->ServiceContext); - } - if (tmp) { - return (1); + DeviceExtension = Extension; + if (DeviceExtension->InterruptRefCount) { + { + b = KeSynchronizeExecution(DeviceExtension->InterruptObject, + &PptTryAllocatePortAtInterruptLevel, + DeviceExtension); + } } else { - + { + IoAcquireCancelSpinLock(&CancelIrql); + b = PptTryAllocatePortAtInterruptLevel(DeviceExtension); + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } } - Current = Current->Flink; + {} + return (b); } - while_298_break: /* CIL Label */ ; - } - return (0); -} } -BOOLEAN PptTryAllocatePort(PVOID Extension ) -{ PDEVICE_EXTENSION DeviceExtension ; - KIRQL CancelIrql ; - BOOLEAN b ; +BOOLEAN PptTraversePortCheckList(PVOID Extension) { + PDEVICE_EXTENSION DeviceExtension; + PLIST_ENTRY Current; + PISR_LIST_ENTRY CheckEntry; { - DeviceExtension = Extension; - if (DeviceExtension->InterruptRefCount) { - { - b = KeSynchronizeExecution(DeviceExtension->InterruptObject, & PptTryAllocatePortAtInterruptLevel, - DeviceExtension); + DeviceExtension = Extension; + if (DeviceExtension->WorkQueueCount >= 0L) { + return (0); + } else { } - } else { + Current = DeviceExtension->IsrList.Flink; { - IoAcquireCancelSpinLock(& CancelIrql); - b = PptTryAllocatePortAtInterruptLevel(DeviceExtension); -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + while (1) { + while_300_continue: /* CIL Label */; + if ((unsigned int)Current != + (unsigned int)(&DeviceExtension->IsrList)) { + + } else { + goto while_300_break; + } + CheckEntry = (ISR_LIST_ENTRY *)((CHAR *)Current - + (unsigned long)(&((ISR_LIST_ENTRY *)0) + ->ListEntry)); + if (CheckEntry->DeferredPortCheckRoutine) { + { + (*(CheckEntry->DeferredPortCheckRoutine))(CheckEntry->CheckContext); + } + } else { + } + Current = Current->Flink; + } + while_300_break: /* CIL Label */; } + return (1); } - { - } - return (b); } -} -BOOLEAN PptTraversePortCheckList(PVOID Extension ) -{ PDEVICE_EXTENSION DeviceExtension ; - PLIST_ENTRY Current ; - PISR_LIST_ENTRY CheckEntry ; - - { - DeviceExtension = Extension; - if (DeviceExtension->WorkQueueCount >= 0L) { - return (0); - } else { +void PptFreePort(PVOID Extension) { + PDEVICE_EXTENSION DeviceExtension; + SYNCHRONIZED_COUNT_CONTEXT SyncContext; + KIRQL CancelIrql; + ULONG InterruptRefCount; + BOOLEAN Allocated; - } - Current = DeviceExtension->IsrList.Flink; { - while (1) { - while_300_continue: /* CIL Label */ ; - if ((unsigned int )Current != (unsigned int )(& DeviceExtension->IsrList)) { - - } else { - goto while_300_break; + DeviceExtension = Extension; + {} { + SyncContext.Count = &DeviceExtension->WorkQueueCount; + IoAcquireCancelSpinLock(&CancelIrql); } - CheckEntry = (ISR_LIST_ENTRY *)((CHAR *)Current - (unsigned long )(& ((ISR_LIST_ENTRY *)0)->ListEntry)); - if (CheckEntry->DeferredPortCheckRoutine) { + if (DeviceExtension->InterruptRefCount) { { - (*(CheckEntry->DeferredPortCheckRoutine))(CheckEntry->CheckContext); + KeSynchronizeExecution(DeviceExtension->InterruptObject, + &PptSynchronizedDecrement, &SyncContext); } } else { - + { PptSynchronizedDecrement(&SyncContext); } } - Current = Current->Flink; - } - while_300_break: /* CIL Label */ ; - } - return (1); -} -} -void PptFreePort(PVOID Extension ) -{ PDEVICE_EXTENSION DeviceExtension ; - SYNCHRONIZED_COUNT_CONTEXT SyncContext ; - KIRQL CancelIrql ; - ULONG InterruptRefCount ; - BOOLEAN Allocated ; - - { - DeviceExtension = Extension; - { - } - { - SyncContext.Count = & DeviceExtension->WorkQueueCount; - IoAcquireCancelSpinLock(& CancelIrql); - } - if (DeviceExtension->InterruptRefCount) { { - KeSynchronizeExecution(DeviceExtension->InterruptObject, & PptSynchronizedDecrement, - & SyncContext); + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + DeviceExtension->WmiPortAllocFreeCounts.PortFrees += 1UL; + Allocated = 0; } - } else { { - PptSynchronizedDecrement(& SyncContext); - } - } - { -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ - DeviceExtension->WmiPortAllocFreeCounts.PortFrees += 1UL; - Allocated = 0; - } - { - while (1) { - while_302_continue: /* CIL Label */ ; - if (! Allocated) { - if (SyncContext.NewCount >= 0L) { + while (1) { + while_302_continue: /* CIL Label */; + if (!Allocated) { + if (SyncContext.NewCount >= 0L) { - } else { - goto while_302_break; + } else { + goto while_302_break; + } + } else { + goto while_302_break; + } } - } else { - goto while_302_break; - } - } - while_302_break: /* CIL Label */ ; - } - if (! Allocated) { - { - IoAcquireCancelSpinLock(& CancelIrql); - InterruptRefCount = DeviceExtension->InterruptRefCount; -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + while_302_break: /* CIL Label */; } - if (InterruptRefCount) { + if (!Allocated) { { - KeSynchronizeExecution(DeviceExtension->InterruptObject, & PptTraversePortCheckList, - DeviceExtension); + IoAcquireCancelSpinLock(&CancelIrql); + InterruptRefCount = DeviceExtension->InterruptRefCount; + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } + if (InterruptRefCount) { + { + KeSynchronizeExecution(DeviceExtension->InterruptObject, + &PptTraversePortCheckList, DeviceExtension); + } + } else { } } else { - } - } else { - + return; } - return; } -} -ULONG PptQueryNumWaiters(PVOID Extension ) -{ PDEVICE_EXTENSION DeviceExtension ; - KIRQL CancelIrql ; - SYNCHRONIZED_COUNT_CONTEXT SyncContext ; - unsigned long tmp ; +ULONG PptQueryNumWaiters(PVOID Extension) { + PDEVICE_EXTENSION DeviceExtension; + KIRQL CancelIrql; + SYNCHRONIZED_COUNT_CONTEXT SyncContext; + unsigned long tmp; { - DeviceExtension = Extension; - SyncContext.Count = & DeviceExtension->WorkQueueCount; - if (DeviceExtension->InterruptRefCount) { - { - KeSynchronizeExecution(DeviceExtension->InterruptObject, & PptSynchronizedRead, - & SyncContext); + DeviceExtension = Extension; + SyncContext.Count = &DeviceExtension->WorkQueueCount; + if (DeviceExtension->InterruptRefCount) { + { + KeSynchronizeExecution(DeviceExtension->InterruptObject, + &PptSynchronizedRead, &SyncContext); + } + } else { + { + IoAcquireCancelSpinLock(&CancelIrql); + PptSynchronizedRead(&SyncContext); + /* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + } } - } else { - { - IoAcquireCancelSpinLock(& CancelIrql); - PptSynchronizedRead(& SyncContext); -/* IoReleaseCancelSpinLock(CancelIrql); */ /* INLINED */ + if (SyncContext.NewCount >= 0L) { + tmp = (unsigned long)SyncContext.NewCount; + } else { + tmp = 0; } + return (tmp); } - if (SyncContext.NewCount >= 0L) { - tmp = (unsigned long )SyncContext.NewCount; - } else { - tmp = 0; - } - return (tmp); -} } -PVOID PptSetCancelRoutine(PIRP Irp , void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , - struct _IRP *Irp ) ) -{ LONG tmp ; +PVOID PptSetCancelRoutine( + PIRP Irp, void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp)) { + LONG tmp; { - { - tmp = InterlockedExchange((LONG *)((PVOID *)(& Irp->CancelRoutine)), (long )((void *)CancelRoutine)); + { + tmp = InterlockedExchange((LONG *)((PVOID *)(&Irp->CancelRoutine)), + (long)((void *)CancelRoutine)); + } + return ((void (*)(struct _DEVICE_OBJECT * DeviceObject, struct _IRP * Irp))( + (void *)tmp)); } - return ((void (*)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ))((void *)tmp)); -} } -extern void KeQueryTickCount(LARGE_INTEGER *i) ; -BOOLEAN CheckPort(PUCHAR wPortAddr , UCHAR bMask , UCHAR bValue , USHORT usTimeDelay ) -{ UCHAR dsr ; - LARGE_INTEGER Wait ; - LARGE_INTEGER Start ; - LARGE_INTEGER End ; - ULONG tmp ; - ULONG tmp___0 ; - - { - { - dsr = READ_PORT_UCHAR(wPortAddr); - } - if (((int )dsr & (int )bMask) == (int )bValue) { - return (1); - } else { +extern void KeQueryTickCount(LARGE_INTEGER *i); +BOOLEAN CheckPort(PUCHAR wPortAddr, UCHAR bMask, UCHAR bValue, + USHORT usTimeDelay) { + UCHAR dsr; + LARGE_INTEGER Wait; + LARGE_INTEGER Start; + LARGE_INTEGER End; + ULONG tmp; + ULONG tmp___0; - } - { - tmp = KeQueryTimeIncrement(); - Wait.QuadPart = (ULONG )(((int )usTimeDelay * 10) * 10) + tmp; - KeQueryTickCount(& Start); - } { - while (1) { - while_303_continue: /* CIL Label */ ; - { - KeQueryTickCount(& End); - dsr = READ_PORT_UCHAR(wPortAddr); - } - if (((int )dsr & (int )bMask) == (int )bValue) { + { dsr = READ_PORT_UCHAR(wPortAddr); } + if (((int)dsr & (int)bMask) == (int)bValue) { return (1); } else { - } { - tmp___0 = KeQueryTimeIncrement(); + tmp = KeQueryTimeIncrement(); + Wait.QuadPart = (ULONG)(((int)usTimeDelay * 10) * 10) + tmp; + KeQueryTickCount(&Start); } - if ((End.QuadPart - Start.QuadPart) * (LONGLONG )tmp___0 > Wait.QuadPart) { - goto CheckPort_TimeOut; - } else { - + { + while (1) { + while_303_continue: /* CIL Label */; + { + KeQueryTickCount(&End); + dsr = READ_PORT_UCHAR(wPortAddr); + } + if (((int)dsr & (int)bMask) == (int)bValue) { + return (1); + } else { + } + { tmp___0 = KeQueryTimeIncrement(); } + if ((End.QuadPart - Start.QuadPart) * (LONGLONG)tmp___0 > + Wait.QuadPart) { + goto CheckPort_TimeOut; + } else { + } + } + while_303_break: /* CIL Label */; } + CheckPort_TimeOut: + return (0); } - while_303_break: /* CIL Label */ ; - } - CheckPort_TimeOut: - return (0); -} } -NTSTATUS PptBuildParallelPortDeviceName(ULONG Number , PUNICODE_STRING DeviceName ) -{ UNICODE_STRING uniDeviceString ; - UNICODE_STRING uniBaseNameString ; - UNICODE_STRING uniPortNumberString ; - WCHAR wcPortNum[10] ; - NTSTATUS status ; - PVOID tmp ; +NTSTATUS PptBuildParallelPortDeviceName(ULONG Number, + PUNICODE_STRING DeviceName) { + UNICODE_STRING uniDeviceString; + UNICODE_STRING uniBaseNameString; + UNICODE_STRING uniPortNumberString; + WCHAR wcPortNum[10]; + NTSTATUS status; + PVOID tmp; { - { - } - { -/* RtlInitUnicodeString(DeviceName, (void *)0); */ /* INLINED */ - uniPortNumberString.Length = 0; - uniPortNumberString.MaximumLength = sizeof(wcPortNum); - uniPortNumberString.Buffer = wcPortNum; - status = RtlIntegerToUnicodeString(Number, 10, & uniPortNumberString); - } - if (! (status >= 0L)) { - { + {} { + /* RtlInitUnicodeString(DeviceName, (void *)0); */ /* INLINED */ + uniPortNumberString.Length = 0; + uniPortNumberString.MaximumLength = sizeof(wcPortNum); + uniPortNumberString.Buffer = wcPortNum; + status = RtlIntegerToUnicodeString(Number, 10, &uniPortNumberString); } - return (status); - } else { - - } - { - DeviceName->MaximumLength = (unsigned short )((unsigned int )(((int )uniDeviceString.Length + (int )uniBaseNameString.Length) + (int )uniPortNumberString.Length) + sizeof((unsigned short)0)); - tmp = ExAllocatePoolWithTag(1, DeviceName->MaximumLength, 1349673296UL); - DeviceName->Buffer = tmp; - } - if ((unsigned int )((void *)0) == (unsigned int )DeviceName->Buffer) { - { + if (!(status >= 0L)) { + {} + return (status); + } else { } - return (-1073741670L); - } else { - - } - { - memset(DeviceName->Buffer, 0, DeviceName->MaximumLength); - RtlAppendUnicodeStringToString(DeviceName, & uniDeviceString); - RtlAppendUnicodeStringToString(DeviceName, & uniBaseNameString); - RtlAppendUnicodeStringToString(DeviceName, & uniPortNumberString); - } - return (0L); -} -} -NTSTATUS PptInitializeDeviceExtension(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject , - PDEVICE_OBJECT DeviceObject , PUNICODE_STRING UniNameString , - PWSTR PortName , ULONG PortNumber ) -{ PDEVICE_EXTENSION Extension ; - ULONG bufferLength ; - PVOID tmp ; - - { - { - Extension = DeviceObject->DeviceExtension; - memset(Extension, 0, sizeof(DEVICE_EXTENSION )); - Extension->ExtensionSignatureBegin = 2022144135; - Extension->ExtensionSignatureEnd = 2272823160U; - Extension->DriverObject = DriverObject; - Extension->PhysicalDeviceObject = PhysicalDeviceObject; - Extension->DeviceObject = DeviceObject; - Extension->PnpInfo.PortNumber = PortNumber; - IoInitializeRemoveLockEx(& Extension->RemoveLock, 1349673296UL, 1, 10, sizeof(IO_REMOVE_LOCK )); - Extension->OpenCloseMutex.Count = 1; - Extension->OpenCloseMutex.Contention = 0; -/* KeInitializeEvent(& Extension->OpenCloseMutex.Event, 1, 0); */ /* INLINED */ - Extension->ExtensionFastMutex.Count = 1; - Extension->ExtensionFastMutex.Contention = 0; -/* KeInitializeEvent(& Extension->ExtensionFastMutex.Event, 1, 0); */ /* INLINED */ - Extension->NationalChipFound = 0; - Extension->NationalChecked = 0; - Extension->WorkQueue.Blink = & Extension->WorkQueue; - Extension->WorkQueue.Flink = Extension->WorkQueue.Blink; - Extension->WorkQueueCount = -1; - Extension->PortInfo.FreePort = & PptFreePort; - Extension->PortInfo.TryAllocatePort = & PptTryAllocatePort; - Extension->PortInfo.QueryNumWaiters = & PptQueryNumWaiters; - Extension->PortInfo.Context = Extension; - Extension->PnpInfo.HardwareCapabilities = 0; - Extension->PnpInfo.TrySetChipMode = & PptSetChipMode; - Extension->PnpInfo.ClearChipMode = & PptClearChipMode; - Extension->PnpInfo.TrySelectDevice = & PptTrySelectDevice; - Extension->PnpInfo.DeselectDevice = & PptDeselectDevice; - Extension->PnpInfo.Context = Extension; - Extension->PnpInfo.PortName = PortName; - Extension->RemovalRelationsList.Blink = & Extension->RemovalRelationsList; - Extension->RemovalRelationsList.Flink = Extension->RemovalRelationsList.Blink; - Extension->IsrList.Blink = & Extension->IsrList; - Extension->IsrList.Flink = Extension->IsrList.Blink; - Extension->InterruptObject = (void *)0; - Extension->InterruptRefCount = 0; - KeInitializeDpc(& Extension->FreePortDpc, & PptFreePortDpc, Extension); - bufferLength = (unsigned int )UniNameString->MaximumLength + sizeof((unsigned short)0); - tmp = ExAllocatePoolWithTag(0, bufferLength, 1349673296UL); - Extension->DeviceName.Buffer = tmp; - } - if (! Extension->DeviceName.Buffer) { - return (-1073741670L); - } else { - - } - { - memset(Extension->DeviceName.Buffer, 0, bufferLength); - Extension->DeviceName.Length = 0; - Extension->DeviceName.MaximumLength = UniNameString->MaximumLength; -/* RtlCopyUnicodeString(& Extension->DeviceName, UniNameString); */ /* INLINED */ - Extension->PnpInfo.CurrentMode = 0; - Extension_FilterMode = 0; - } - return (0L); -} -} -NTSTATUS PptGetPortNumberFromLptName(PWSTR PortName , PULONG PortNumber ) -{ NTSTATUS status ; - UNICODE_STRING str ; - int __BLAST_NONDET = __VERIFIER_nondet_int() ; - - { - if (__BLAST_NONDET) { { + DeviceName->MaximumLength = + (unsigned short)((unsigned int)(((int)uniDeviceString.Length + + (int)uniBaseNameString.Length) + + (int)uniPortNumberString.Length) + + sizeof((unsigned short)0)); + tmp = ExAllocatePoolWithTag(1, DeviceName->MaximumLength, 1349673296UL); + DeviceName->Buffer = tmp; } - return (-1073741823L); - } else { - - } - { -/* RtlInitUnicodeString(& str, PortName + 3); */ /* INLINED */ - status = RtlUnicodeStringToInteger(& str, 10, PortNumber); - } - if (! (status >= 0L)) { - { + if ((unsigned int)((void *)0) == (unsigned int)DeviceName->Buffer) { + {} + return (-1073741670L); + } else { } - return (-1073741823L); - } else { - - } - if (*PortNumber == 0UL) { { + memset(DeviceName->Buffer, 0, DeviceName->MaximumLength); + RtlAppendUnicodeStringToString(DeviceName, &uniDeviceString); + RtlAppendUnicodeStringToString(DeviceName, &uniBaseNameString); + RtlAppendUnicodeStringToString(DeviceName, &uniPortNumberString); } - return (-1073741823L); - } else { - - } - { + return (0L); } - return (0L); } -} -PDEVICE_OBJECT PptBuildDeviceObject(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) -{ UNICODE_STRING uniNameString ; - ULONG portNumber ; - PWSTR portName ; - NTSTATUS status ; - PDEVICE_OBJECT deviceObject ; - - { - uniNameString.Length = 0; - uniNameString.MaximumLength = 0; - uniNameString.Buffer = 0; - portNumber = 0; - portName = (void *)0; - status = 0L; - deviceObject = (void *)0; - { - } - { - portName = PptGetPortNameFromPhysicalDeviceObject(PhysicalDeviceObject); - } - if ((unsigned int )((void *)0) == (unsigned int )portName) { - { +NTSTATUS PptInitializeDeviceExtension(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject, + PDEVICE_OBJECT DeviceObject, + PUNICODE_STRING UniNameString, + PWSTR PortName, ULONG PortNumber) { + PDEVICE_EXTENSION Extension; + ULONG bufferLength; + PVOID tmp; + + { + { + Extension = DeviceObject->DeviceExtension; + memset(Extension, 0, sizeof(DEVICE_EXTENSION)); + Extension->ExtensionSignatureBegin = 2022144135; + Extension->ExtensionSignatureEnd = 2272823160U; + Extension->DriverObject = DriverObject; + Extension->PhysicalDeviceObject = PhysicalDeviceObject; + Extension->DeviceObject = DeviceObject; + Extension->PnpInfo.PortNumber = PortNumber; + IoInitializeRemoveLockEx(&Extension->RemoveLock, 1349673296UL, 1, 10, + sizeof(IO_REMOVE_LOCK)); + Extension->OpenCloseMutex.Count = 1; + Extension->OpenCloseMutex.Contention = 0; + /* KeInitializeEvent(& Extension->OpenCloseMutex.Event, 1, 0); */ /* INLINED + */ + Extension->ExtensionFastMutex.Count = 1; + Extension->ExtensionFastMutex.Contention = 0; + /* KeInitializeEvent(& Extension->ExtensionFastMutex.Event, 1, 0); */ /* INLINED */ + Extension->NationalChipFound = 0; + Extension->NationalChecked = 0; + Extension->WorkQueue.Blink = &Extension->WorkQueue; + Extension->WorkQueue.Flink = Extension->WorkQueue.Blink; + Extension->WorkQueueCount = -1; + Extension->PortInfo.FreePort = &PptFreePort; + Extension->PortInfo.TryAllocatePort = &PptTryAllocatePort; + Extension->PortInfo.QueryNumWaiters = &PptQueryNumWaiters; + Extension->PortInfo.Context = Extension; + Extension->PnpInfo.HardwareCapabilities = 0; + Extension->PnpInfo.TrySetChipMode = &PptSetChipMode; + Extension->PnpInfo.ClearChipMode = &PptClearChipMode; + Extension->PnpInfo.TrySelectDevice = &PptTrySelectDevice; + Extension->PnpInfo.DeselectDevice = &PptDeselectDevice; + Extension->PnpInfo.Context = Extension; + Extension->PnpInfo.PortName = PortName; + Extension->RemovalRelationsList.Blink = &Extension->RemovalRelationsList; + Extension->RemovalRelationsList.Flink = + Extension->RemovalRelationsList.Blink; + Extension->IsrList.Blink = &Extension->IsrList; + Extension->IsrList.Flink = Extension->IsrList.Blink; + Extension->InterruptObject = (void *)0; + Extension->InterruptRefCount = 0; + KeInitializeDpc(&Extension->FreePortDpc, &PptFreePortDpc, Extension); + bufferLength = (unsigned int)UniNameString->MaximumLength + + sizeof((unsigned short)0); + tmp = ExAllocatePoolWithTag(0, bufferLength, 1349673296UL); + Extension->DeviceName.Buffer = tmp; + } + if (!Extension->DeviceName.Buffer) { + return (-1073741670L); + } else { + } + { + memset(Extension->DeviceName.Buffer, 0, bufferLength); + Extension->DeviceName.Length = 0; + Extension->DeviceName.MaximumLength = UniNameString->MaximumLength; + /* RtlCopyUnicodeString(& Extension->DeviceName, UniNameString); */ /* INLINED + */ + Extension->PnpInfo.CurrentMode = 0; + Extension_FilterMode = 0; } - goto targetExit; - } else { - - } - { + return (0L); } +} +NTSTATUS PptGetPortNumberFromLptName(PWSTR PortName, PULONG PortNumber) { + NTSTATUS status; + UNICODE_STRING str; + int __BLAST_NONDET = __VERIFIER_nondet_int(); + { - status = PptGetPortNumberFromLptName(portName, & portNumber); - } - if (! (status >= 0L)) { - { + if (__BLAST_NONDET) { + {} + return (-1073741823L); + } else { } { -/* ExFreePool(portName); */ /* INLINED */ + /* RtlInitUnicodeString(& str, PortName + 3); */ /* INLINED */ + status = RtlUnicodeStringToInteger(&str, 10, PortNumber); } - goto targetExit; - } else { - - } - portNumber -= 1UL; - { - } - { - status = PptBuildParallelPortDeviceName(portNumber, & uniNameString); - } - if (! (status >= 0L)) { - { + if (!(status >= 0L)) { + {} + return (-1073741823L); + } else { } - { -/* ExFreePool(portName); */ /* INLINED */ + if (*PortNumber == 0UL) { + {} + return (-1073741823L); + } else { } - goto targetExit; - } else { - - } - { + {} + return (0L); } +} +PDEVICE_OBJECT PptBuildDeviceObject(PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT PhysicalDeviceObject) { + UNICODE_STRING uniNameString; + ULONG portNumber; + PWSTR portName; + NTSTATUS status; + PDEVICE_OBJECT deviceObject; + { - status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION ), & uniNameString, - 22, 256, 0, & deviceObject); - } - if (-1073741771L == status) { - { + uniNameString.Length = 0; + uniNameString.MaximumLength = 0; + uniNameString.Buffer = 0; + portNumber = 0; + portName = (void *)0; + status = 0L; + deviceObject = (void *)0; + {} { + portName = PptGetPortNameFromPhysicalDeviceObject(PhysicalDeviceObject); } - portNumber = 7; - { - while (1) { - while_319_continue: /* CIL Label */ ; - { -/* RtlFreeUnicodeString(& uniNameString); */ /* INLINED */ - portNumber += 1UL; - status = PptBuildParallelPortDeviceName(portNumber, & uniNameString); - } - if (! (status >= 0L)) { - { - } - { -/* ExFreePool(portName); */ /* INLINED */ - } - goto targetExit; - } else { - + if ((unsigned int)((void *)0) == (unsigned int)portName) { + {} + goto targetExit; + } else { + } + {} { status = PptGetPortNumberFromLptName(portName, &portNumber); } + if (!(status >= 0L)) { + {} { /* ExFreePool(portName); */ /* INLINED */ } - { + goto targetExit; + } else { + } + portNumber -= 1UL; + {} { status = PptBuildParallelPortDeviceName(portNumber, &uniNameString); } + if (!(status >= 0L)) { + {} { /* ExFreePool(portName); */ /* INLINED */ } + goto targetExit; + } else { + } + {} { + status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION), + &uniNameString, 22, 256, 0, &deviceObject); + } + if (-1073741771L == status) { + {} + portNumber = 7; { - status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION ), & uniNameString, - 22, 256, 0, & deviceObject); - } - if (-1073741771L == status) { + while (1) { + while_319_continue: /* CIL Label */; + { + /* RtlFreeUnicodeString(& uniNameString); */ /* INLINED */ + portNumber += 1UL; + status = PptBuildParallelPortDeviceName(portNumber, &uniNameString); + } + if (!(status >= 0L)) { + {} { /* ExFreePool(portName); */ /* INLINED */ + } + goto targetExit; + } else { + } + {} { + status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION), + &uniNameString, 22, 256, 0, &deviceObject); + } + if (-1073741771L == status) { - } else { - goto while_319_break; + } else { + goto while_319_break; + } + } + while_319_break: /* CIL Label */; } + } else { } - while_319_break: /* CIL Label */ ; - } - } else { - - } - if (! (status >= 0L)) { - { + if (!(status >= 0L)) { + {} { + deviceObject = (void *)0; + /* ExFreePool(portName); */ /* INLINED */ + } + goto targetExit; + } else { } { - deviceObject = (void *)0; -/* ExFreePool(portName); */ /* INLINED */ + status = PptInitializeDeviceExtension(DriverObject, PhysicalDeviceObject, + deviceObject, &uniNameString, + portName, portNumber); } - goto targetExit; - } else { - - } - { - status = PptInitializeDeviceExtension(DriverObject, PhysicalDeviceObject, deviceObject, - & uniNameString, portName, portNumber); - } - if (! (status >= 0L)) { - { + if (!(status >= 0L)) { + {} { + /* IoDeleteDevice(deviceObject); */ /* INLINED */ + deviceObject = (void *)0; + /* ExFreePool(portName); */ /* INLINED */ + } + goto targetExit; + } else { } - { -/* IoDeleteDevice(deviceObject); */ /* INLINED */ - deviceObject = (void *)0; -/* ExFreePool(portName); */ /* INLINED */ + if (PhysicalDeviceObject->Flags & 8192UL) { + deviceObject->Flags |= 8192UL; + } else { } - goto targetExit; - } else { - - } - if (PhysicalDeviceObject->Flags & 8192UL) { - deviceObject->Flags |= 8192UL; - } else { - + {} + targetExit : { /* RtlFreeUnicodeString(& uniNameString); */ /* INLINED */ } - { - } - targetExit: - { -/* RtlFreeUnicodeString(& uniNameString); */ /* INLINED */ + return (deviceObject); } - return (deviceObject); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) #pragma once -#pragma warning(disable:4200) -NTSTATUS PptWmiQueryWmiRegInfo(PDEVICE_OBJECT PDevObj , PULONG PRegFlags , PUNICODE_STRING PInstanceName , - PUNICODE_STRING *PRegistryPath , PUNICODE_STRING MofResourceName , - PDEVICE_OBJECT *Pdo ) ; -NTSTATUS PptWmiQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray , - ULONG OutBufferSize , PUCHAR Buffer ) ; -#pragma alloc_text(PAGEPARWMI0,PptWmiInitWmi) -#pragma alloc_text(PAGEPARWMI0,PptDispatchSystemControl) -#pragma alloc_text(PAGEPARWMI0,PptWmiQueryWmiRegInfo) -#pragma alloc_text(PAGEPARWMI0,PptWmiQueryWmiDataBlock) -GUID PptWmiAllocFreeCountsGuid = {1270573546, 26707, 4562, {142, 206, 0, 192, 79, 142, 244, 129}}; -WMIGUIDREGINFO PptWmiGuidList[1] = { {& PptWmiAllocFreeCountsGuid, 1, 0}}; -NTSTATUS PptWmiInitWmi(PDEVICE_OBJECT DeviceObject ) -{ PDEVICE_EXTENSION devExt ; - PWMILIB_CONTEXT wmiContext ; - NTSTATUS tmp ; - - { - { - devExt = DeviceObject->DeviceExtension; - wmiContext = & devExt->WmiLibContext; - wmiContext->GuidCount = sizeof(PptWmiGuidList) / sizeof(WMIGUIDREGINFO ); - wmiContext->GuidList = PptWmiGuidList; - wmiContext->QueryWmiRegInfo = & PptWmiQueryWmiRegInfo; - wmiContext->QueryWmiDataBlock = & PptWmiQueryWmiDataBlock; - wmiContext->SetWmiDataBlock = (void *)0; - wmiContext->SetWmiDataItem = (void *)0; - wmiContext->ExecuteWmiMethod = (void *)0; - wmiContext->WmiFunctionControl = (void *)0; - tmp = IoWMIRegistrationControl(DeviceObject, 1); - } - return (tmp); -} -} -NTSTATUS PptDispatchSystemControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ SYSCTL_IRP_DISPOSITION disposition ; - NTSTATUS status ; - PDEVICE_EXTENSION pDevExt ; - - { - { - pDevExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; - status = WmiSystemControl(& pDevExt->WmiLibContext, DeviceObject, Irp, & disposition); - } - if (disposition == 0) { - goto switch_325_0; - } else { - if (disposition == 1) { - goto switch_325_1; - } else { - if (disposition == 3) { - goto switch_325_3; +#pragma warning(disable : 4200) +NTSTATUS PptWmiQueryWmiRegInfo(PDEVICE_OBJECT PDevObj, PULONG PRegFlags, + PUNICODE_STRING PInstanceName, + PUNICODE_STRING *PRegistryPath, + PUNICODE_STRING MofResourceName, + PDEVICE_OBJECT *Pdo); +NTSTATUS PptWmiQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject, PIRP Irp, + ULONG GuidIndex, ULONG InstanceIndex, + ULONG InstanceCount, + PULONG InstanceLengthArray, + ULONG OutBufferSize, PUCHAR Buffer); +#pragma alloc_text(PAGEPARWMI0, PptWmiInitWmi) +#pragma alloc_text(PAGEPARWMI0, PptDispatchSystemControl) +#pragma alloc_text(PAGEPARWMI0, PptWmiQueryWmiRegInfo) +#pragma alloc_text(PAGEPARWMI0, PptWmiQueryWmiDataBlock) +GUID PptWmiAllocFreeCountsGuid = { + 1270573546, 26707, 4562, {142, 206, 0, 192, 79, 142, 244, 129}}; +WMIGUIDREGINFO PptWmiGuidList[1] = {{&PptWmiAllocFreeCountsGuid, 1, 0}}; +NTSTATUS PptWmiInitWmi(PDEVICE_OBJECT DeviceObject) { + PDEVICE_EXTENSION devExt; + PWMILIB_CONTEXT wmiContext; + NTSTATUS tmp; + + { + { + devExt = DeviceObject->DeviceExtension; + wmiContext = &devExt->WmiLibContext; + wmiContext->GuidCount = sizeof(PptWmiGuidList) / sizeof(WMIGUIDREGINFO); + wmiContext->GuidList = PptWmiGuidList; + wmiContext->QueryWmiRegInfo = &PptWmiQueryWmiRegInfo; + wmiContext->QueryWmiDataBlock = &PptWmiQueryWmiDataBlock; + wmiContext->SetWmiDataBlock = (void *)0; + wmiContext->SetWmiDataItem = (void *)0; + wmiContext->ExecuteWmiMethod = (void *)0; + wmiContext->WmiFunctionControl = (void *)0; + tmp = IoWMIRegistrationControl(DeviceObject, 1); + } + return (tmp); + } +} +NTSTATUS PptDispatchSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + SYSCTL_IRP_DISPOSITION disposition; + NTSTATUS status; + PDEVICE_EXTENSION pDevExt; + + { + { + pDevExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension; + status = WmiSystemControl(&pDevExt->WmiLibContext, DeviceObject, Irp, + &disposition); + } + if (disposition == 0) { + goto switch_325_0; + } else { + if (disposition == 1) { + goto switch_325_1; } else { - if (disposition == 2) { - goto switch_325_2; + if (disposition == 3) { + goto switch_325_3; } else { - { - goto switch_325_default; - if (0) { - switch_325_0: /* CIL Label */ - s = DC; - goto switch_325_break; - switch_325_1: /* CIL Label */ + if (disposition == 2) { + goto switch_325_2; + } else { { - PptCompleteRequest(Irp, 0); - } - goto switch_325_break; - switch_325_3: /* CIL Label */ ; - switch_325_2: /* CIL Label */ ; - if (s == NP) { - s = SKIP1; - } else { + goto switch_325_default; + if (0) { + switch_325_0: /* CIL Label */ + s = DC; + goto switch_325_break; + switch_325_1 : /* CIL Label */ { - errorFn(); + PptCompleteRequest(Irp, 0); } - } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - status = IofCallDriver(pDevExt->ParentDeviceObject, Irp); - } - goto switch_325_break; - switch_325_default: /* CIL Label */ ; - if (s == NP) { - s = SKIP1; - } else { - { - errorFn(); + goto switch_325_break; + switch_325_3: /* CIL Label */; + switch_325_2: /* CIL Label */; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + status = IofCallDriver(pDevExt->ParentDeviceObject, Irp); + } + goto switch_325_break; + switch_325_default: /* CIL Label */; + if (s == NP) { + s = SKIP1; + } else { + { errorFn(); } + } + { + Irp->CurrentLocation = (CHAR)((int)Irp->CurrentLocation + 1); + Irp->Tail.Overlay.__annonCompField17.__annonCompField16 + .CurrentStackLocation += 1; + status = IofCallDriver(pDevExt->ParentDeviceObject, Irp); + } + goto switch_325_break; + } else { + switch_325_break: /* CIL Label */; } } - { - Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1); - Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1; - status = IofCallDriver(pDevExt->ParentDeviceObject, Irp); - } - goto switch_325_break; - } else { - switch_325_break: /* CIL Label */ ; - } } } } } + return (status); } - return (status); } -} -NTSTATUS PptWmiQueryWmiRegInfo(PDEVICE_OBJECT PDevObj , PULONG PRegFlags , PUNICODE_STRING PInstanceName , - PUNICODE_STRING *PRegistryPath , PUNICODE_STRING MofResourceName , - PDEVICE_OBJECT *Pdo ) -{ PDEVICE_EXTENSION devExt ; +NTSTATUS PptWmiQueryWmiRegInfo(PDEVICE_OBJECT PDevObj, PULONG PRegFlags, + PUNICODE_STRING PInstanceName, + PUNICODE_STRING *PRegistryPath, + PUNICODE_STRING MofResourceName, + PDEVICE_OBJECT *Pdo) { + PDEVICE_EXTENSION devExt; { - devExt = PDevObj->DeviceExtension; - { + devExt = PDevObj->DeviceExtension; + {} *PRegFlags = 32; + *PRegistryPath = &RegistryPath; + *Pdo = devExt->PhysicalDeviceObject; + return (0L); } - *PRegFlags = 32; - *PRegistryPath = & RegistryPath; - *Pdo = devExt->PhysicalDeviceObject; - return (0L); -} } -NTSTATUS PptWmiQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex , - ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray , - ULONG OutBufferSize , PUCHAR Buffer ) -{ NTSTATUS status ; - ULONG size ; - PDEVICE_EXTENSION devExt ; +NTSTATUS PptWmiQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject, PIRP Irp, + ULONG GuidIndex, ULONG InstanceIndex, + ULONG InstanceCount, + PULONG InstanceLengthArray, + ULONG OutBufferSize, PUCHAR Buffer) { + NTSTATUS status; + ULONG size; + PDEVICE_EXTENSION devExt; { - size = sizeof(PARPORT_WMI_ALLOC_FREE_COUNTS ); - devExt = DeviceObject->DeviceExtension; - if (GuidIndex == 0) { - goto switch_327_0; - } else { - { - goto switch_327_default; - if (0) { - switch_327_0: /* CIL Label */ ; - if (OutBufferSize < size) { - status = -1073741789L; - goto switch_327_break; - } else { - + size = sizeof(PARPORT_WMI_ALLOC_FREE_COUNTS); + devExt = DeviceObject->DeviceExtension; + if (GuidIndex == 0) { + goto switch_327_0; + } else { + { + goto switch_327_default; + if (0) { + switch_327_0: /* CIL Label */; + if (OutBufferSize < size) { + status = -1073741789L; + goto switch_327_break; + } else { + } + *((struct _PARPORT_WMI_ALLOC_FREE_COUNTS *)Buffer) = + devExt->WmiPortAllocFreeCounts; + *InstanceLengthArray = size; + status = 0L; + goto switch_327_break; + switch_327_default: /* CIL Label */ + status = -1073741163L; + goto switch_327_break; + } else { + switch_327_break: /* CIL Label */; + } } - *((struct _PARPORT_WMI_ALLOC_FREE_COUNTS *)Buffer) = devExt->WmiPortAllocFreeCounts; - *InstanceLengthArray = size; - status = 0L; - goto switch_327_break; - switch_327_default: /* CIL Label */ - status = -1073741163L; - goto switch_327_break; - } else { - switch_327_break: /* CIL Label */ ; } - } - } - { - status = WmiCompleteRequest(DeviceObject, Irp, status, size, 0); + { status = WmiCompleteRequest(DeviceObject, Irp, status, size, 0); } + return (status); } - return (status); -} } #pragma once #pragma once #pragma once #pragma once #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) #pragma once -#pragma warning(disable:4103) -#pragma warning(disable:4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) #pragma warning(push) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(pop) -#pragma warning(disable:4035) +#pragma warning(disable : 4035) #pragma warning(push) -#pragma warning(disable:4164) +#pragma warning(disable : 4164) #pragma function(_enable) #pragma function(_disable) #pragma warning(pop) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4103) -#pragma warning(disable:4200) -#pragma warning(default:4200) -void _BLAST_init(void) -{ - - { - UNLOADED = 0; - NP = 1; - DC = 2; - SKIP1 = 3; - SKIP2 = 4; - MPR1 = 5; - MPR3 = 6; - IPC = 7; - s = UNLOADED; - pended = 0; - compFptr = 0; - compRegistered = 0; - lowerDriverReturn = 0; - setEventCalled = 0; - customIrp = 0; - return; -} -} -IRP *pirp ; -void stub_driver_init(void) -{ - - { - s = NP; - customIrp = 0; - setEventCalled = customIrp; - lowerDriverReturn = setEventCalled; - compRegistered = lowerDriverReturn; - compFptr = compRegistered; - pended = compFptr; - return; -} -} -int main(void) -{ DRIVER_OBJECT d ; - NTSTATUS status = __VERIFIER_nondet_long() ; - int we_should_unload = __VERIFIER_nondet_int() ; - IRP irp ; - int __BLAST_NONDET = __VERIFIER_nondet_int() ; - int irp_choice = __VERIFIER_nondet_int() ; - DEVICE_OBJECT devobj ; - s = __VERIFIER_nondet_int(); +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4103) +#pragma warning(disable : 4200) +#pragma warning(default : 4200) +void _BLAST_init(void) { + + { + UNLOADED = 0; + NP = 1; + DC = 2; + SKIP1 = 3; + SKIP2 = 4; + MPR1 = 5; + MPR3 = 6; + IPC = 7; + s = UNLOADED; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + return; + } +} +IRP *pirp; +void stub_driver_init(void) { { - { - pirp = & irp; - _BLAST_init(); - } - if (status >= 0L) { s = NP; customIrp = 0; setEventCalled = customIrp; @@ -9624,94 +9241,118 @@ int main(void) compRegistered = lowerDriverReturn; compFptr = compRegistered; pended = compFptr; - pirp->IoStatus.__annonCompField4.Status = 0L; - myStatus = 0L; - if (irp_choice == 0) { - pirp->IoStatus.__annonCompField4.Status = -1073741637L; - myStatus = -1073741637L; - } else { + return; + } +} +int main(void) { + DRIVER_OBJECT d; + NTSTATUS status = __VERIFIER_nondet_long(); + int we_should_unload = __VERIFIER_nondet_int(); + IRP irp; + int __BLAST_NONDET = __VERIFIER_nondet_int(); + int irp_choice = __VERIFIER_nondet_int(); + DEVICE_OBJECT devobj; + s = __VERIFIER_nondet_int(); - } + { { - stub_driver_init(); - } - if (! (status >= 0L)) { - return (-1); - } else { - + pirp = &irp; + _BLAST_init(); } - if (__BLAST_NONDET == 0) { - goto switch_328_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_328_1; + if (status >= 0L) { + s = NP; + customIrp = 0; + setEventCalled = customIrp; + lowerDriverReturn = setEventCalled; + compRegistered = lowerDriverReturn; + compFptr = compRegistered; + pended = compFptr; + pirp->IoStatus.__annonCompField4.Status = 0L; + myStatus = 0L; + if (irp_choice == 0) { + pirp->IoStatus.__annonCompField4.Status = -1073741637L; + myStatus = -1073741637L; + } else { + } + { stub_driver_init(); } + if (!(status >= 0L)) { + return (-1); } else { - if (__BLAST_NONDET == 3) { - goto switch_328_3; + } + if (__BLAST_NONDET == 0) { + goto switch_328_0; + } else { + if (__BLAST_NONDET == 1) { + goto switch_328_1; } else { - if (__BLAST_NONDET == 4) { - goto switch_328_4; + if (__BLAST_NONDET == 3) { + goto switch_328_3; } else { - if (__BLAST_NONDET == 5) { - goto switch_328_5; + if (__BLAST_NONDET == 4) { + goto switch_328_4; } else { - if (__BLAST_NONDET == 6) { - goto switch_328_6; + if (__BLAST_NONDET == 5) { + goto switch_328_5; } else { - if (__BLAST_NONDET == 8) { - goto switch_328_8; + if (__BLAST_NONDET == 6) { + goto switch_328_6; } else { - if (__BLAST_NONDET == 11) { - goto switch_328_11; + if (__BLAST_NONDET == 8) { + goto switch_328_8; } else { - { - goto switch_328_default; - if (0) { - switch_328_0: /* CIL Label */ - { - status = PptDispatchCreate(& devobj, pirp); - } - goto switch_328_break; - switch_328_1: /* CIL Label */ - { - status = PptDispatchClose(& devobj, pirp); - } - goto switch_328_break; - switch_328_3: /* CIL Label */ - { - status = PptDispatchPnp(& devobj, pirp); - } - goto switch_328_break; - switch_328_4: /* CIL Label */ - { - status = PptDispatchPower(& devobj, pirp); - } - goto switch_328_break; - switch_328_5: /* CIL Label */ - { - status = PptDispatchCleanup(& devobj, pirp); - } - goto switch_328_break; - switch_328_6: /* CIL Label */ - { - status = PptDispatchSystemControl(& devobj, pirp); - } - goto switch_328_break; - switch_328_8: /* CIL Label */ - { - status = PptDispatchInternalDeviceControl(& devobj, pirp); - } - goto switch_328_break; - switch_328_11: /* CIL Label */ + if (__BLAST_NONDET == 11) { + goto switch_328_11; + } else { { - status = PptDispatchCleanup(& devobj, pirp); + goto switch_328_default; + if (0) { + switch_328_0 : /* CIL Label */ + { + status = PptDispatchCreate(&devobj, pirp); + } + goto switch_328_break; + switch_328_1 : /* CIL Label */ + { + status = PptDispatchClose(&devobj, pirp); + } + goto switch_328_break; + switch_328_3 : /* CIL Label */ + { + status = PptDispatchPnp(&devobj, pirp); + } + goto switch_328_break; + switch_328_4 : /* CIL Label */ + { + status = PptDispatchPower(&devobj, pirp); + } + goto switch_328_break; + switch_328_5 : /* CIL Label */ + { + status = PptDispatchCleanup(&devobj, pirp); + } + goto switch_328_break; + switch_328_6 : /* CIL Label */ + { + status = PptDispatchSystemControl(&devobj, pirp); + } + goto switch_328_break; + switch_328_8 : /* CIL Label */ + { + status = + PptDispatchInternalDeviceControl(&devobj, pirp); + } + goto switch_328_break; + switch_328_11 : /* CIL Label */ + { + status = PptDispatchCleanup(&devobj, pirp); + } + goto switch_328_break; + switch_328_default: /* CIL Label */; + return (-1); + } else { + switch_328_break: /* CIL Label */; + } } - goto switch_328_break; - switch_328_default: /* CIL Label */ ; - return (-1); - } else { - switch_328_break: /* CIL Label */ ; - } } } } @@ -9720,77 +9361,62 @@ int main(void) } } } - } - if (we_should_unload) { - { - PptUnload(& d); + if (we_should_unload) { + { PptUnload(&d); } + } else { } } else { - - } - } else { - - } - if (pended == 1) { - if (s == NP) { - s = NP; - } else { - goto _L___2; } - } else { - _L___2: /* CIL Label */ if (pended == 1) { - if (s == MPR3) { - s = MPR3; + if (s == NP) { + s = NP; } else { - goto _L___1; + goto _L___2; } } else { - _L___1: /* CIL Label */ - if (s == UNLOADED) { - + _L___2: /* CIL Label */ + if (pended == 1) { + if (s == MPR3) { + s = MPR3; + } else { + goto _L___1; + } } else { - if (status == -1L) { + _L___1: /* CIL Label */ + if (s == UNLOADED) { } else { - if (s != SKIP2) { - if (s != IPC) { - if (s != DC) { - { - errorFn(); - } - } else { - goto _L___0; - } - } else { - goto _L___0; - } + if (status == -1L) { + } else { - _L___0: /* CIL Label */ - if (pended == 1) { - if (status != 259L) { - { - errorFn(); + if (s != SKIP2) { + if (s != IPC) { + if (s != DC) { + { errorFn(); } + } else { + goto _L___0; } } else { - + goto _L___0; } } else { - if (s == DC) { - if (status == 259L) { - { - errorFn(); - } + _L___0: /* CIL Label */ + if (pended == 1) { + if (status != 259L) { + { errorFn(); } } else { - } } else { - if (status != (NTSTATUS )lowerDriverReturn) { - { - errorFn(); + if (s == DC) { + if (status == 259L) { + { errorFn(); } + } else { } } else { - + if (status != (NTSTATUS)lowerDriverReturn) { + { errorFn(); } + } else { + } } } } @@ -9798,1147 +9424,1014 @@ int main(void) } } } + return (status); } - return (status); -} } -char _SLAM_alloc_dummy ; -void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ; -void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) -{ +char _SLAM_alloc_dummy; +void ExAcquireFastMutex(PFAST_MUTEX FastMutex); +void ExAcquireFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ; -void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) -{ +void ExReleaseFastMutex(PFAST_MUTEX FastMutex); +void ExReleaseFastMutex(PFAST_MUTEX FastMutex) { - { - return; -} + { return; } } - PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , - SIZE_T NumberOfBytes , - ULONG Tag ) ; -PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , SIZE_T NumberOfBytes , - ULONG Tag ) -{ PVOID x ; - char *tmp ; +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag); +PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType, SIZE_T NumberOfBytes, + ULONG Tag) { + PVOID x; + char *tmp; { - { - tmp = malloc(NumberOfBytes); - x = tmp; + { + tmp = malloc(NumberOfBytes); + x = tmp; + } + return (x); } - return (x); -} } - void ExFreePool(PVOID P ) ; -void ExFreePool(PVOID P ) -{ +void ExFreePool(PVOID P); +void ExFreePool(PVOID P) { - { - return; -} + { return; } } - PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead , - PLIST_ENTRY ListEntry , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead, + PLIST_ENTRY ListEntry, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) ; -PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead , - PKSPIN_LOCK Lock ) -{ +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock); +PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead, + PKSPIN_LOCK Lock) { - { - return ((void *)0); -} + { return ((void *)0); } } - PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , - BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota , - PIRP Irp ) ; -PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , BOOLEAN SecondaryBuffer , - BOOLEAN ChargeQuota , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp); +PMDL IoAllocateMdl(PVOID VirtualAddress, ULONG Length, BOOLEAN SecondaryBuffer, + BOOLEAN ChargeQuota, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_329_0; - } else { - { - goto switch_329_default; - if (0) { - switch_329_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_329_0; + } else { { - tmp = malloc(sizeof(MDL )); + goto switch_329_default; + if (0) { + switch_329_0 : /* CIL Label */ + { + tmp = malloc(sizeof(MDL)); + } + return ((void *)tmp); + switch_329_default: /* CIL Label */; + return ((void *)0); + } else { + switch_329_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_329_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_329_break: /* CIL Label */ ; - } } } } -} - PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , - PDEVICE_OBJECT TargetDevice ) ; -PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , PDEVICE_OBJECT TargetDevice ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice); +PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice, + PDEVICE_OBJECT TargetDevice) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_330_0; - } else { - { - goto switch_330_default; - if (0) { - switch_330_0: /* CIL Label */ ; - return (TargetDevice); - switch_330_default: /* CIL Label */ ; - return ((void *)0); + if (__BLAST_NONDET == 0) { + goto switch_330_0; } else { - switch_330_break: /* CIL Label */ ; - } + { + goto switch_330_default; + if (0) { + switch_330_0: /* CIL Label */; + return (TargetDevice); + switch_330_default: /* CIL Label */; + return ((void *)0); + } else { + switch_330_break: /* CIL Label */; + } + } } } } -} - PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , - PDEVICE_OBJECT DeviceObject , - PVOID Buffer , - ULONG Length , - PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , PDEVICE_OBJECT DeviceObject , - PVOID Buffer , ULONG Length , PLARGE_INTEGER StartingOffset , - PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction, + PDEVICE_OBJECT DeviceObject, PVOID Buffer, + ULONG Length, PLARGE_INTEGER StartingOffset, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - customIrp = 1; - if (__BLAST_NONDET == 0) { - goto switch_331_0; - } else { - { - goto switch_331_default; - if (0) { - switch_331_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET == 0) { + goto switch_331_0; + } else { { - tmp = malloc(sizeof(IRP )); + goto switch_331_default; + if (0) { + switch_331_0 : /* CIL Label */ + { + tmp = malloc(sizeof(IRP)); + } + return ((void *)tmp); + switch_331_default: /* CIL Label */; + return ((void *)0); + } else { + switch_331_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_331_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_331_break: /* CIL Label */ ; - } } } } -} - PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , - PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , - ULONG InputBufferLength , - PVOID OutputBuffer , - ULONG OutputBufferLength , - BOOLEAN InternalDeviceIoControl , - PKEVENT Event , - PIO_STATUS_BLOCK IoStatusBlock ) ; -PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , PDEVICE_OBJECT DeviceObject , - PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer , - ULONG OutputBufferLength , BOOLEAN InternalDeviceIoControl , - PKEVENT Event , PIO_STATUS_BLOCK IoStatusBlock ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock); +PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode, + PDEVICE_OBJECT DeviceObject, + PVOID InputBuffer, ULONG InputBufferLength, + PVOID OutputBuffer, ULONG OutputBufferLength, + BOOLEAN InternalDeviceIoControl, + PKEVENT Event, + PIO_STATUS_BLOCK IoStatusBlock) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - customIrp = 1; - if (__BLAST_NONDET == 0) { - goto switch_332_0; - } else { - { - goto switch_332_default; - if (0) { - switch_332_0: /* CIL Label */ + customIrp = 1; + if (__BLAST_NONDET == 0) { + goto switch_332_0; + } else { { - tmp = malloc(sizeof(IRP )); + goto switch_332_default; + if (0) { + switch_332_0 : /* CIL Label */ + { + tmp = malloc(sizeof(IRP)); + } + return ((void *)tmp); + switch_332_default: /* CIL Label */; + return ((void *)0); + } else { + switch_332_break: /* CIL Label */; + } } - return ((void *)tmp); - switch_332_default: /* CIL Label */ ; - return ((void *)0); - } else { - switch_332_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , - ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , - ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ; -NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , ULONG DeviceExtensionSize , - PUNICODE_STRING DeviceName , ULONG DeviceType , ULONG DeviceCharacteristics , - BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject); +NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject, ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, ULONG DeviceType, + ULONG DeviceCharacteristics, BOOLEAN Exclusive, + PDEVICE_OBJECT *DeviceObject) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_333_0; - } else { - { - goto switch_333_default; - if (0) { - switch_333_0: /* CIL Label */ + if (__BLAST_NONDET == 0) { + goto switch_333_0; + } else { { - tmp = malloc(sizeof(DEVICE_OBJECT )); - *DeviceObject = (void *)tmp; + goto switch_333_default; + if (0) { + switch_333_0 : /* CIL Label */ + { + tmp = malloc(sizeof(DEVICE_OBJECT)); + *DeviceObject = (void *)tmp; + } + return (0L); + switch_333_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_333_break: /* CIL Label */; + } } - return (0L); - switch_333_default: /* CIL Label */ ; - return (-1073741823L); - } else { - switch_333_break: /* CIL Label */ ; - } } } } -} - NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , - PUNICODE_STRING DeviceName ) ; -NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , PUNICODE_STRING DeviceName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName); +NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName, + PUNICODE_STRING DeviceName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_334_0; - } else { - { - goto switch_334_default; - if (0) { - switch_334_0: /* CIL Label */ ; - return (0L); - switch_334_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_334_0; } else { - switch_334_break: /* CIL Label */ ; - } + { + goto switch_334_default; + if (0) { + switch_334_0: /* CIL Label */; + return (0L); + switch_334_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_334_break: /* CIL Label */; + } + } } } } -} - void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ; -void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) -{ +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject); +void IoDeleteDevice(PDEVICE_OBJECT DeviceObject) { - { - return; -} + { return; } } - NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_335_0; - } else { - { - goto switch_335_default; - if (0) { - switch_335_0: /* CIL Label */ ; - return (0L); - switch_335_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_335_0; } else { - switch_335_break: /* CIL Label */ ; - } + { + goto switch_335_default; + if (0) { + switch_335_0: /* CIL Label */; + return (0L); + switch_335_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_335_break: /* CIL Label */; + } + } } } } -} - void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ; -void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) -{ +void IoDetachDevice(PDEVICE_OBJECT TargetDevice); +void IoDetachDevice(PDEVICE_OBJECT TargetDevice) { - { - return; + { return; } } -} - void IoFreeIrp(PIRP Irp ) ; -void IoFreeIrp(PIRP Irp ) -{ +void IoFreeIrp(PIRP Irp); +void IoFreeIrp(PIRP Irp) { - { - return; + { return; } } -} - void IoFreeMdl(PMDL Mdl ) ; -void IoFreeMdl(PMDL Mdl ) -{ +void IoFreeMdl(PMDL Mdl); +void IoFreeMdl(PMDL Mdl) { - { - return; + { return; } } -} - PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ; -PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) -{ char *tmp ; +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void); +PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) { + char *tmp; { - { - tmp = malloc(sizeof(CONFIGURATION_INFORMATION )); + { tmp = malloc(sizeof(CONFIGURATION_INFORMATION)); } + return ((void *)tmp); } - return ((void *)tmp); } -} - NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , - PULONG BusNumber , - PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , - PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , - NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) ; -NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , PULONG BusNumber , PCONFIGURATION_TYPE ControllerType , - PULONG ControllerNumber , PCONFIGURATION_TYPE PeripheralType , - PULONG PeripheralNumber , NTSTATUS (*CalloutRoutine)(PVOID Context , - PUNICODE_STRING PathName , - INTERFACE_TYPE BusType , - ULONG BusNumber , - PKEY_VALUE_FULL_INFORMATION *BusInformation , - CONFIGURATION_TYPE ControllerType , - ULONG ControllerNumber , - PKEY_VALUE_FULL_INFORMATION *ControllerInformation , - CONFIGURATION_TYPE PeripheralType , - ULONG PeripheralNumber , - PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) , - PVOID Context ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context); +NTSTATUS IoQueryDeviceDescription( + PINTERFACE_TYPE BusType, PULONG BusNumber, + PCONFIGURATION_TYPE ControllerType, PULONG ControllerNumber, + PCONFIGURATION_TYPE PeripheralType, PULONG PeripheralNumber, + NTSTATUS (*CalloutRoutine)( + PVOID Context, PUNICODE_STRING PathName, INTERFACE_TYPE BusType, + ULONG BusNumber, PKEY_VALUE_FULL_INFORMATION *BusInformation, + CONFIGURATION_TYPE ControllerType, ULONG ControllerNumber, + PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + CONFIGURATION_TYPE PeripheralType, ULONG PeripheralNumber, + PKEY_VALUE_FULL_INFORMATION *PeripheralInformation), + PVOID Context) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_336_0; - } else { - { - goto switch_336_default; - if (0) { - switch_336_0: /* CIL Label */ ; - return (0L); - switch_336_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_336_0; } else { - switch_336_break: /* CIL Label */ ; - } + { + goto switch_336_default; + if (0) { + switch_336_0: /* CIL Label */; + return (0L); + switch_336_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_336_break: /* CIL Label */; + } + } } } } -} - NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) ; -NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject , - GUID const *InterfaceClassGuid , - PUNICODE_STRING ReferenceString , - PUNICODE_STRING SymbolicLinkName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName); +NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject, + GUID const *InterfaceClassGuid, + PUNICODE_STRING ReferenceString, + PUNICODE_STRING SymbolicLinkName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_337_0; - } else { - { - goto switch_337_default; - if (0) { - switch_337_0: /* CIL Label */ ; - return (0L); - switch_337_default: /* CIL Label */ ; - return (-1073741808L); + if (__BLAST_NONDET == 0) { + goto switch_337_0; } else { - switch_337_break: /* CIL Label */ ; - } + { + goto switch_337_default; + if (0) { + switch_337_0: /* CIL Label */; + return (0L); + switch_337_default: /* CIL Label */; + return (-1073741808L); + } else { + switch_337_break: /* CIL Label */; + } + } } } } -} - void IoReleaseCancelSpinLock(KIRQL Irql ) ; -void IoReleaseCancelSpinLock(KIRQL Irql ) -{ +void IoReleaseCancelSpinLock(KIRQL Irql); +void IoReleaseCancelSpinLock(KIRQL Irql) { - { - return; -} + { return; } } - NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , - BOOLEAN Enable ) ; -NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , BOOLEAN Enable ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable); +NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName, + BOOLEAN Enable) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_338_0; - } else { - { - goto switch_338_default; - if (0) { - switch_338_0: /* CIL Label */ ; - return (0L); - switch_338_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_338_0; } else { - switch_338_break: /* CIL Label */ ; - } + { + goto switch_338_default; + if (0) { + switch_338_0: /* CIL Label */; + return (0L); + switch_338_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_338_break: /* CIL Label */; + } + } } } } -} - void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ; -void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) -{ +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject); +void IoSetHardErrorOrVerifyDevice(PIRP Irp, PDEVICE_OBJECT DeviceObject) { - { - return; + { return; } } -} -void stubMoreProcessingRequired(void) -{ +void stubMoreProcessingRequired(void) { { - if (s == NP) { - s = MPR1; - } else { - { - errorFn(); + if (s == NP) { + s = MPR1; + } else { + { errorFn(); } } + return; } - return; -} } - NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - NTSTATUS returnVal2 ; - int compRetStatus ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; - NTSTATUS tmp___0 ; +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + NTSTATUS returnVal2; + int compRetStatus; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; + NTSTATUS tmp___0; { - if (compRegistered) { - if (routine == 0) { - { - tmp = PptSynchCompletionRoutine(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - } else { - if (routine == 1) { + if (compRegistered) { + if (routine == 0) { { - tmp___0 = PptPowerComplete(DeviceObject, Irp, lcontext); - compRetStatus = tmp___0; + tmp = PptSynchCompletionRoutine(DeviceObject, Irp, lcontext); + compRetStatus = tmp; } } else { - + if (routine == 1) { + { + tmp___0 = PptPowerComplete(DeviceObject, Irp, lcontext); + compRetStatus = tmp___0; + } + } else { + } } - } - if ((long )compRetStatus == -1073741802L) { - { - stubMoreProcessingRequired(); + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET == 0) { - goto switch_339_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_339_1; + if (__BLAST_NONDET == 0) { + goto switch_339_0; } else { - { - goto switch_339_default; - if (0) { - switch_339_0: /* CIL Label */ - returnVal2 = 0L; - goto switch_339_break; - switch_339_1: /* CIL Label */ - returnVal2 = -1073741823L; - goto switch_339_break; - switch_339_default: /* CIL Label */ - returnVal2 = 259L; - goto switch_339_break; + if (__BLAST_NONDET == 1) { + goto switch_339_1; } else { - switch_339_break: /* CIL Label */ ; - } + { + goto switch_339_default; + if (0) { + switch_339_0: /* CIL Label */ + returnVal2 = 0L; + goto switch_339_break; + switch_339_1: /* CIL Label */ + returnVal2 = -1073741823L; + goto switch_339_break; + switch_339_default: /* CIL Label */ + returnVal2 = 259L; + goto switch_339_break; + } else { + switch_339_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal2; - } else { - if (s == MPR1) { - if (returnVal2 == 259L) { - s = MPR3; - lowerDriverReturn = returnVal2; - } else { - s = NP; - lowerDriverReturn = returnVal2; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal2; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal2; + if (s == MPR1) { + if (returnVal2 == 259L) { + s = MPR3; + lowerDriverReturn = returnVal2; + } else { + s = NP; + lowerDriverReturn = returnVal2; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal2; + } else { + { errorFn(); } } } } + return (returnVal2); } - return (returnVal2); } -} - void IofCompleteRequest(PIRP Irp , - CCHAR PriorityBoost ) ; -void IofCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) -{ +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost); +void IofCompleteRequest(PIRP Irp, CCHAR PriorityBoost) { { - if (s == NP) { - s = DC; - } else { - { - errorFn(); + if (s == NP) { + s = DC; + } else { + { errorFn(); } } + return; } - return; -} } - KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ; -KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) -{ +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock); +KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock) { - { - return ((unsigned char)0); -} + { return ((unsigned char)0); } } - NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Interval ) ; -NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , BOOLEAN Alertable , PLARGE_INTEGER Interval ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval); +NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Interval) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_340_0; - } else { - { - goto switch_340_default; - if (0) { - switch_340_0: /* CIL Label */ ; - return (0L); - switch_340_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_340_0; } else { - switch_340_break: /* CIL Label */ ; - } + { + goto switch_340_default; + if (0) { + switch_340_0: /* CIL Label */; + return (0L); + switch_340_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_340_break: /* CIL Label */; + } + } } } } -} - void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , - BOOLEAN State ) ; -void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , BOOLEAN State ) -{ +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State); +void KeInitializeEvent(PRKEVENT Event, EVENT_TYPE Type, BOOLEAN State) { - { - return; + { return; } } -} - void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , - LONG Count , LONG Limit ) ; -void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , LONG Count , LONG Limit ) -{ +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit); +void KeInitializeSemaphore(PRKSEMAPHORE Semaphore, LONG Count, LONG Limit) { - { - return; + { return; } } -} - void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ; -void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) -{ +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock); +void KeInitializeSpinLock(PKSPIN_LOCK SpinLock) { - { - return; + { return; } } -} - LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , - LONG Adjustment , BOOLEAN Wait ) ; -LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , LONG Adjustment , - BOOLEAN Wait ) -{ LONG r = __VERIFIER_nondet_long() ; +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait); +LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore, KPRIORITY Increment, + LONG Adjustment, BOOLEAN Wait) { + LONG r = __VERIFIER_nondet_long(); - { - return (r); + { return (r); } } -} - void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , - KIRQL NewIrql ) ; -void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , KIRQL NewIrql ) -{ +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql); +void KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql) { - { - return; + { return; } } -} - LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , - BOOLEAN Wait ) ; -LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , BOOLEAN Wait ) -{ LONG l = __VERIFIER_nondet_long() ; +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait); +LONG KeSetEvent(PRKEVENT Event, KPRIORITY Increment, BOOLEAN Wait) { + LONG l = __VERIFIER_nondet_long(); { - setEventCalled = 1; - return (l); -} + setEventCalled = 1; + return (l); + } } - NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , - KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , - PLARGE_INTEGER Timeout ) ; -NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , KPROCESSOR_MODE WaitMode , - BOOLEAN Alertable , PLARGE_INTEGER Timeout ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout); +NTSTATUS KeWaitForSingleObject(PVOID Object, KWAIT_REASON WaitReason, + KPROCESSOR_MODE WaitMode, BOOLEAN Alertable, + PLARGE_INTEGER Timeout) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (s == MPR3) { - if (setEventCalled == 1) { - s = NP; - setEventCalled = 0; - } else { - goto _L; - } - } else { - _L: /* CIL Label */ - if (customIrp == 1) { - s = NP; - customIrp = 0; + if (s == MPR3) { + if (setEventCalled == 1) { + s = NP; + setEventCalled = 0; + } else { + goto _L; + } } else { - if (s == MPR3) { - { - errorFn(); - } + _L: /* CIL Label */ + if (customIrp == 1) { + s = NP; + customIrp = 0; } else { - + if (s == MPR3) { + { errorFn(); } + } else { + } } } - } - if (__BLAST_NONDET == 0) { - goto switch_341_0; - } else { - { - goto switch_341_default; - if (0) { - switch_341_0: /* CIL Label */ ; - return (0L); - switch_341_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_341_0; } else { - switch_341_break: /* CIL Label */ ; - } + { + goto switch_341_default; + if (0) { + switch_341_0: /* CIL Label */; + return (0L); + switch_341_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_341_break: /* CIL Label */; + } + } } } } -} - PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , - PHYSICAL_ADDRESS HighestAcceptableAddress ) ; -PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , PHYSICAL_ADDRESS HighestAcceptableAddress ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - char *tmp ; +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress); +PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes, + PHYSICAL_ADDRESS HighestAcceptableAddress) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + char *tmp; { - if (__BLAST_NONDET == 0) { - goto switch_342_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_342_1; + if (__BLAST_NONDET == 0) { + goto switch_342_0; } else { - if (0) { - switch_342_0: /* CIL Label */ + if (__BLAST_NONDET == 1) { + goto switch_342_1; + } else { + if (0) { + switch_342_0 : /* CIL Label */ { - tmp = malloc(NumberOfBytes); + tmp = malloc(NumberOfBytes); + } + return (tmp); + switch_342_1: /* CIL Label */; + return ((void *)0); + } else { + switch_342_break: /* CIL Label */; } - return (tmp); - switch_342_1: /* CIL Label */ ; - return ((void *)0); - } else { - switch_342_break: /* CIL Label */ ; } } + return ((void *)0); } - return ((void *)0); -} } - void MmFreeContiguousMemory(PVOID BaseAddress ) ; -void MmFreeContiguousMemory(PVOID BaseAddress ) -{ +void MmFreeContiguousMemory(PVOID BaseAddress); +void MmFreeContiguousMemory(PVOID BaseAddress) { - { - return; -} + { return; } } - PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , - KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , - PVOID BaseAddress , - ULONG BugCheckOnFailure , - MM_PAGE_PRIORITY Priority ) ; -PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , KPROCESSOR_MODE AccessMode , - MEMORY_CACHING_TYPE CacheType , PVOID BaseAddress , - ULONG BugCheckOnFailure , MM_PAGE_PRIORITY Priority ) -{ +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority); +PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList, + KPROCESSOR_MODE AccessMode, + MEMORY_CACHING_TYPE CacheType, + PVOID BaseAddress, ULONG BugCheckOnFailure, + MM_PAGE_PRIORITY Priority) { - { - return ((void *)0); -} + { return ((void *)0); } } - PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ; -PVOID MmPageEntireDriver(PVOID AddressWithinSection ) -{ +PVOID MmPageEntireDriver(PVOID AddressWithinSection); +PVOID MmPageEntireDriver(PVOID AddressWithinSection) { - { - return ((void *)0); -} + { return ((void *)0); } } - void MmResetDriverPaging(PVOID AddressWithinSection ) ; -void MmResetDriverPaging(PVOID AddressWithinSection ) -{ +void MmResetDriverPaging(PVOID AddressWithinSection); +void MmResetDriverPaging(PVOID AddressWithinSection) { - { - return; -} + { return; } } - void MmUnlockPages(PMDL MemoryDescriptorList ) ; -void MmUnlockPages(PMDL MemoryDescriptorList ) -{ +void MmUnlockPages(PMDL MemoryDescriptorList); +void MmUnlockPages(PMDL MemoryDescriptorList) { - { - return; -} + { return; } } - NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , - ACCESS_MASK DesiredAccess , - POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , - PVOID *Object , - POBJECT_HANDLE_INFORMATION HandleInformation ) ; -NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , ACCESS_MASK DesiredAccess , POBJECT_TYPE ObjectType , - KPROCESSOR_MODE AccessMode , PVOID *Object , POBJECT_HANDLE_INFORMATION HandleInformation ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation); +NTSTATUS +ObReferenceObjectByHandle(HANDLE Handle, ACCESS_MASK DesiredAccess, + POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, + PVOID *Object, + POBJECT_HANDLE_INFORMATION HandleInformation) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_343_0; - } else { - { - goto switch_343_default; - if (0) { - switch_343_0: /* CIL Label */ ; - return (0L); - switch_343_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_343_0; } else { - switch_343_break: /* CIL Label */ ; - } + { + goto switch_343_default; + if (0) { + switch_343_0: /* CIL Label */; + return (0L); + switch_343_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_343_break: /* CIL Label */; + } + } } } } -} - void ObfDereferenceObject(PVOID Object ) ; -void ObfDereferenceObject(PVOID Object ) -{ +void ObfDereferenceObject(PVOID Object); +void ObfDereferenceObject(PVOID Object) { - { - return; + { return; } } -} - NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , - PIRP Irp ) ; -NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; - int compRetStatus ; - NTSTATUS returnVal ; - PVOID lcontext = __VERIFIER_nondet_pointer() ; - NTSTATUS tmp ; - NTSTATUS tmp___0 ; +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); + int compRetStatus; + NTSTATUS returnVal; + PVOID lcontext = __VERIFIER_nondet_pointer(); + NTSTATUS tmp; + NTSTATUS tmp___0; { - if (compRegistered) { - if (routine == 0) { - { - tmp = PptSynchCompletionRoutine(DeviceObject, Irp, lcontext); - compRetStatus = tmp; - } - } else { - if (routine == 1) { + if (compRegistered) { + if (routine == 0) { { - tmp___0 = PptPowerComplete(DeviceObject, Irp, lcontext); - compRetStatus = tmp___0; + tmp = PptSynchCompletionRoutine(DeviceObject, Irp, lcontext); + compRetStatus = tmp; } } else { - + if (routine == 1) { + { + tmp___0 = PptPowerComplete(DeviceObject, Irp, lcontext); + compRetStatus = tmp___0; + } + } else { + } } - } - if ((long )compRetStatus == -1073741802L) { - { - stubMoreProcessingRequired(); + if ((long)compRetStatus == -1073741802L) { + { stubMoreProcessingRequired(); } + } else { } } else { - } - } else { - - } - if (__BLAST_NONDET == 0) { - goto switch_344_0; - } else { - if (__BLAST_NONDET == 1) { - goto switch_344_1; + if (__BLAST_NONDET == 0) { + goto switch_344_0; } else { - { - goto switch_344_default; - if (0) { - switch_344_0: /* CIL Label */ - returnVal = 0L; - goto switch_344_break; - switch_344_1: /* CIL Label */ - returnVal = -1073741823L; - goto switch_344_break; - switch_344_default: /* CIL Label */ - returnVal = 259L; - goto switch_344_break; + if (__BLAST_NONDET == 1) { + goto switch_344_1; } else { - switch_344_break: /* CIL Label */ ; - } + { + goto switch_344_default; + if (0) { + switch_344_0: /* CIL Label */ + returnVal = 0L; + goto switch_344_break; + switch_344_1: /* CIL Label */ + returnVal = -1073741823L; + goto switch_344_break; + switch_344_default: /* CIL Label */ + returnVal = 259L; + goto switch_344_break; + } else { + switch_344_break: /* CIL Label */; + } + } } } - } - if (s == NP) { - s = IPC; - lowerDriverReturn = returnVal; - } else { - if (s == MPR1) { - if (returnVal == 259L) { - s = MPR3; - lowerDriverReturn = returnVal; - } else { - s = NP; - lowerDriverReturn = returnVal; - } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal; } else { - if (s == SKIP1) { - s = SKIP2; - lowerDriverReturn = returnVal; + if (s == MPR1) { + if (returnVal == 259L) { + s = MPR3; + lowerDriverReturn = returnVal; + } else { + s = NP; + lowerDriverReturn = returnVal; + } } else { - { - errorFn(); + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal; + } else { + { errorFn(); } } } } + return (returnVal); } - return (returnVal); -} } - void PoStartNextPowerIrp(PIRP Irp ) ; -void PoStartNextPowerIrp(PIRP Irp ) -{ +void PoStartNextPowerIrp(PIRP Irp); +void PoStartNextPowerIrp(PIRP Irp) { - { - return; -} + { return; } } - NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , - ULONG DesiredAccess , - POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , - PCLIENT_ID ClientId , - void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) ; -NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , ULONG DesiredAccess , POBJECT_ATTRIBUTES ObjectAttributes , - HANDLE ProcessHandle , PCLIENT_ID ClientId , void (*StartRoutine)(PVOID StartContext ) , - PVOID StartContext ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext); +NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + HANDLE ProcessHandle, PCLIENT_ID ClientId, + void (*StartRoutine)(PVOID StartContext), + PVOID StartContext) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_345_0; - } else { - { - goto switch_345_default; - if (0) { - switch_345_0: /* CIL Label */ ; - return (0L); - switch_345_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_345_0; } else { - switch_345_break: /* CIL Label */ ; - } + { + goto switch_345_default; + if (0) { + switch_345_0: /* CIL Label */; + return (0L); + switch_345_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_345_break: /* CIL Label */; + } + } } } } -} - NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ; -NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus); +NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_346_0; - } else { - { - goto switch_346_default; - if (0) { - switch_346_0: /* CIL Label */ ; - return (0L); - switch_346_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_346_0; } else { - switch_346_break: /* CIL Label */ ; - } + { + goto switch_346_default; + if (0) { + switch_346_0: /* CIL Label */; + return (0L); + switch_346_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_346_break: /* CIL Label */; + } + } } } } -} - NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) ; -NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString , - PANSI_STRING SourceString , - BOOLEAN AllocateDestinationString ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString); +NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, + PANSI_STRING SourceString, + BOOLEAN AllocateDestinationString) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_347_0; - } else { - { - goto switch_347_default; - if (0) { - switch_347_0: /* CIL Label */ ; - return (0L); - switch_347_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_347_0; } else { - switch_347_break: /* CIL Label */ ; - } + { + goto switch_347_default; + if (0) { + switch_347_0: /* CIL Label */; + return (0L); + switch_347_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_347_break: /* CIL Label */; + } + } } } } -} - SIZE_T RtlCompareMemory(void const *Source1 , - void const *Source2 , - SIZE_T Length ) ; -SIZE_T RtlCompareMemory(void const *Source1 , void const *Source2 , - SIZE_T Length ) -{ SIZE_T r = __VERIFIER_nondet_long() ; +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length); +SIZE_T RtlCompareMemory(void const *Source1, void const *Source2, + SIZE_T Length) { + SIZE_T r = __VERIFIER_nondet_long(); - { - return (r); + { return (r); } } -} - void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) ; -void RtlCopyUnicodeString(PUNICODE_STRING DestinationString , - PUNICODE_STRING SourceString ) -{ +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString); +void RtlCopyUnicodeString(PUNICODE_STRING DestinationString, + PUNICODE_STRING SourceString) { - { - return; + { return; } } -} - NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , - PCWSTR ValueName ) ; -NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo , - PCWSTR Path , PCWSTR ValueName ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName); +NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo, PCWSTR Path, + PCWSTR ValueName) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_348_0; - } else { - { - goto switch_348_default; - if (0) { - switch_348_0: /* CIL Label */ ; - return (0L); - switch_348_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_348_0; } else { - switch_348_break: /* CIL Label */ ; - } + { + goto switch_348_default; + if (0) { + switch_348_0: /* CIL Label */; + return (0L); + switch_348_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_348_break: /* CIL Label */; + } + } } } } -} - void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ; -void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) -{ +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString); +void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString) { - { - return; -} + { return; } } - void RtlInitString(PSTRING DestinationString , - PCSZ SourceString ) ; -void RtlInitString(PSTRING DestinationString , PCSZ SourceString ) -{ +void RtlInitString(PSTRING DestinationString, PCSZ SourceString); +void RtlInitString(PSTRING DestinationString, PCSZ SourceString) { - { - return; -} + { return; } } - void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) ; -void RtlInitUnicodeString(PUNICODE_STRING DestinationString , - PCWSTR SourceString ) -{ +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString); +void RtlInitUnicodeString(PUNICODE_STRING DestinationString, + PCWSTR SourceString) { - { - return; -} + { return; } } - NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , - PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , - PVOID Environment ) ; -NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo , - PCWSTR Path , PRTL_QUERY_REGISTRY_TABLE QueryTable , - PVOID Context , PVOID Environment ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment); +NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo, PCWSTR Path, + PRTL_QUERY_REGISTRY_TABLE QueryTable, + PVOID Context, PVOID Environment) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_349_0; - } else { - { - goto switch_349_default; - if (0) { - switch_349_0: /* CIL Label */ ; - return (0L); - switch_349_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_349_0; } else { - switch_349_break: /* CIL Label */ ; - } + { + goto switch_349_default; + if (0) { + switch_349_0: /* CIL Label */; + return (0L); + switch_349_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_349_break: /* CIL Label */; + } + } } } } -} - NTSTATUS ZwClose(HANDLE Handle ) ; -NTSTATUS ZwClose(HANDLE Handle ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS ZwClose(HANDLE Handle); +NTSTATUS ZwClose(HANDLE Handle) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_350_0; - } else { - { - goto switch_350_default; - if (0) { - switch_350_0: /* CIL Label */ ; - return (0L); - switch_350_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_350_0; } else { - switch_350_break: /* CIL Label */ ; - } + { + goto switch_350_default; + if (0) { + switch_350_0: /* CIL Label */; + return (0L); + switch_350_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_350_break: /* CIL Label */; + } + } } } } -} -NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo , PDEVICE_OBJECT DeviceObject , - PIRP Irp , PSYSCTL_IRP_DISPOSITION IrpDisposition ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo, + PDEVICE_OBJECT DeviceObject, PIRP Irp, + PSYSCTL_IRP_DISPOSITION IrpDisposition) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET == 0) { - goto switch_351_0; - } else { - { - goto switch_351_default; - if (0) { - switch_351_0: /* CIL Label */ - return (0L); - switch_351_default: /* CIL Label */ ; - return (-1073741823L); + if (__BLAST_NONDET == 0) { + goto switch_351_0; } else { - switch_351_break: /* CIL Label */ ; - } + { + goto switch_351_default; + if (0) { + switch_351_0: /* CIL Label */ + return (0L); + switch_351_default: /* CIL Label */; + return (-1073741823L); + } else { + switch_351_break: /* CIL Label */; + } + } } } } -} - NTSTATUS IoAcquireRemoveLockEx(PIO_REMOVE_LOCK RemoveLock , - PVOID Tag , - PCSTR File , - ULONG Line , - ULONG RemlockSize ) ; -NTSTATUS IoAcquireRemoveLockEx(PIO_REMOVE_LOCK RemoveLock , - PVOID Tag , PCSTR File , - ULONG Line , ULONG RemlockSize ) -{ int __BLAST_NONDET = __VERIFIER_nondet_int() ; +NTSTATUS IoAcquireRemoveLockEx(PIO_REMOVE_LOCK RemoveLock, PVOID Tag, + PCSTR File, ULONG Line, ULONG RemlockSize); +NTSTATUS IoAcquireRemoveLockEx(PIO_REMOVE_LOCK RemoveLock, PVOID Tag, + PCSTR File, ULONG Line, ULONG RemlockSize) { + int __BLAST_NONDET = __VERIFIER_nondet_int(); { - if (__BLAST_NONDET) { - return (0L); - } else { - return (-1073741738L); + if (__BLAST_NONDET) { + return (0L); + } else { + return (-1073741738L); + } } } -} diff --git a/test/pthread/account.c b/test/pthread/account.c index cdc2f414d..6e0fa67dc 100644 --- a/test/pthread/account.c +++ b/test/pthread/account.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -21,7 +21,7 @@ PACCOUNT acc; // Create and initialize account PACCOUNT create(int b) { - PACCOUNT acc = (PACCOUNT) malloc(sizeof(ACCOUNT)); + PACCOUNT acc = (PACCOUNT)malloc(sizeof(ACCOUNT)); acc->balance = b; acc->withdrawn = FALSE; pthread_mutex_init(&acc->lock, 0); @@ -29,12 +29,10 @@ PACCOUNT create(int b) { } // Read account balance -int read() { - return acc->balance; -} +int read() { return acc->balance; } void *deposit(void *arg) { - int *n = (int*)arg; + int *n = (int *)arg; pthread_mutex_lock(&acc->lock); acc->balance = acc->balance + *n; pthread_mutex_unlock(&acc->lock); @@ -43,7 +41,7 @@ void *deposit(void *arg) { // Withdraw if there is enough funds in the account void *withdraw(void *arg) { - int *n = (int*)arg; + int *n = (int *)arg; int r; pthread_mutex_lock(&acc->lock); r = read(); @@ -78,4 +76,3 @@ int main(void) { assert(!acc->withdrawn || read() == x + y - z); return 0; } - diff --git a/test/pthread/account_fail.c b/test/pthread/account_fail.c index fc1e41821..769916b3a 100644 --- a/test/pthread/account_fail.c +++ b/test/pthread/account_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error @@ -21,7 +21,7 @@ PACCOUNT acc; // Create and initialize account PACCOUNT create(int b) { - PACCOUNT acc = (PACCOUNT) malloc(sizeof(ACCOUNT)); + PACCOUNT acc = (PACCOUNT)malloc(sizeof(ACCOUNT)); acc->balance = b; acc->withdrawn = FALSE; pthread_mutex_init(&acc->lock, 0); @@ -29,12 +29,10 @@ PACCOUNT create(int b) { } // Read account balance -int read() { - return acc->balance; -} +int read() { return acc->balance; } void *deposit(void *arg) { - int *n = (int*)arg; + int *n = (int *)arg; pthread_mutex_lock(&acc->lock); acc->balance = acc->balance + *n; pthread_mutex_unlock(&acc->lock); @@ -43,7 +41,7 @@ void *deposit(void *arg) { // Withdraw if there is enough funds in the account void *withdraw(void *arg) { - int *n = (int*)arg; + int *n = (int *)arg; int r; r = read(); if (r >= *n) { @@ -77,4 +75,3 @@ int main(void) { assert(!acc->withdrawn || read() == x + y - z); return 0; } - diff --git a/test/pthread/cond.c b/test/pthread/cond.c index 2e0f73d77..6999b9080 100644 --- a/test/pthread/cond.c +++ b/test/pthread/cond.c @@ -23,7 +23,7 @@ void *j1(void *arg) { void *j2(void *arg) { pthread_mutex_lock(&lock); - while(!thread1Done) + while (!thread1Done) pthread_cond_wait(&cond, &lock); assert(count == 1); pthread_mutex_unlock(&lock); @@ -42,4 +42,3 @@ int main(void) { pthread_join(t2, 0); return 0; } - diff --git a/test/pthread/cond_fail.c b/test/pthread/cond_fail.c index ca5c82941..8fded9f16 100644 --- a/test/pthread/cond_fail.c +++ b/test/pthread/cond_fail.c @@ -41,4 +41,3 @@ int main(void) { pthread_join(t2, 0); return 0; } - diff --git a/test/pthread/equal.c b/test/pthread/equal.c index 159f23884..67054d430 100644 --- a/test/pthread/equal.c +++ b/test/pthread/equal.c @@ -6,15 +6,14 @@ pthread_t worker; -void *t1(void *arg){ - assert(pthread_equal(pthread_self(),worker)); +void *t1(void *arg) { + assert(pthread_equal(pthread_self(), worker)); return 0; } int main(void) { - pthread_create(&worker,0,0,0); - pthread_join(worker,0); - assert(!pthread_equal(pthread_self(),worker)); + pthread_create(&worker, 0, 0, 0); + pthread_join(worker, 0); + assert(!pthread_equal(pthread_self(), worker)); return 0; } - diff --git a/test/pthread/equal2.c b/test/pthread/equal2.c index c93aaf8e2..810075654 100644 --- a/test/pthread/equal2.c +++ b/test/pthread/equal2.c @@ -34,4 +34,3 @@ int main(void) { pthread_join(tid2, 0); assert(x == 4); } - diff --git a/test/pthread/join.c b/test/pthread/join.c index e3f039333..a0ad6f507 100644 --- a/test/pthread/join.c +++ b/test/pthread/join.c @@ -21,4 +21,3 @@ int main(void) { assert(x == 3); return 0; } - diff --git a/test/pthread/join_fail.c b/test/pthread/join_fail.c index abc1bc751..8fc7f4652 100644 --- a/test/pthread/join_fail.c +++ b/test/pthread/join_fail.c @@ -21,4 +21,3 @@ int main(void) { assert(x == 3); return 0; } - diff --git a/test/pthread/join_return.c b/test/pthread/join_return.c index e136b00d7..d5c7b812b 100644 --- a/test/pthread/join_return.c +++ b/test/pthread/join_return.c @@ -10,14 +10,14 @@ int x = 1; -typedef struct pair{ +typedef struct pair { int x; int y; } pair; void *t1(void *arg) { x++; - pair* retptr = (pair*)malloc(sizeof(pair)); + pair *retptr = (pair *)malloc(sizeof(pair)); retptr->x = 3; retptr->y = 4; pthread_exit(retptr); @@ -26,7 +26,7 @@ void *t1(void *arg) { int main(void) { pthread_t t; - pair* ret; + pair *ret; pthread_create(&t, 0, t1, 0); pthread_join(t, &ret); @@ -36,4 +36,3 @@ int main(void) { free(ret); return 0; } - diff --git a/test/pthread/join_return2.c b/test/pthread/join_return2.c index 7cf371778..6e9e980c8 100644 --- a/test/pthread/join_return2.c +++ b/test/pthread/join_return2.c @@ -1,7 +1,7 @@ #include #include -// Ensures return values from multiple threads can be +// Ensures return values from multiple threads can be // held simultaneously. // @expect verified @@ -9,13 +9,13 @@ int x = 1; void *t1(void *arg) { x++; - pthread_exit((void*)5); + pthread_exit((void *)5); return 0; } void *t2(void *arg) { x++; - pthread_exit((void*)6); + pthread_exit((void *)6); return 0; } @@ -32,4 +32,3 @@ int main(void) { assert((int)ret2 == 6); return 0; } - diff --git a/test/pthread/join_return2_fail.c b/test/pthread/join_return2_fail.c index 8e28fcd6b..8742c7998 100644 --- a/test/pthread/join_return2_fail.c +++ b/test/pthread/join_return2_fail.c @@ -1,7 +1,7 @@ #include #include -// Ensures return values from multiple threads can be +// Ensures return values from multiple threads can be // held simultaneously. // @expect error @@ -9,13 +9,13 @@ int x = 1; void *t1(void *arg) { x++; - pthread_exit((void*)5); + pthread_exit((void *)5); return 0; } void *t2(void *arg) { x++; - pthread_exit((void*)6); + pthread_exit((void *)6); return 0; } @@ -32,4 +32,3 @@ int main(void) { assert((int)ret2 == (int)ret1); return 0; } - diff --git a/test/pthread/join_return_fail.c b/test/pthread/join_return_fail.c index e6d7b4d0c..9ac55cb23 100644 --- a/test/pthread/join_return_fail.c +++ b/test/pthread/join_return_fail.c @@ -10,14 +10,14 @@ int x = 1; -typedef struct pair{ +typedef struct pair { int x; int y; } pair; void *t1(void *arg) { x++; - pair* retptr = (pair*)malloc(sizeof(pair)); + pair *retptr = (pair *)malloc(sizeof(pair)); retptr->x = 2; retptr->y = 4; pthread_exit(&retptr); @@ -26,7 +26,7 @@ void *t1(void *arg) { int main(void) { pthread_t t; - pair* ret; + pair *ret; pthread_create(&t, 0, t1, 0); pthread_join(t, &ret); @@ -36,4 +36,3 @@ int main(void) { free(ret); return 0; } - diff --git a/test/pthread/join_self.c b/test/pthread/join_self.c index 51637a7a3..187ad0cf1 100644 --- a/test/pthread/join_self.c +++ b/test/pthread/join_self.c @@ -6,14 +6,14 @@ pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; -void* t1(void* arg) { - pthread_t* selfptr = (pthread_t*)arg; +void *t1(void *arg) { + pthread_t *selfptr = (pthread_t *)arg; pthread_t self = *selfptr; int ret; - int err = pthread_join(self, (void*)&ret); + int err = pthread_join(self, (void *)&ret); // Should be an EDEADLK error assert(err == 35); - pthread_exit((void*)1); + pthread_exit((void *)1); return 0; } @@ -23,4 +23,3 @@ int main(void) { pthread_create(&tid1, 0, t1, &tid1); return 0; } - diff --git a/test/pthread/join_self_fail.c b/test/pthread/join_self_fail.c index 016d70d39..19aec8201 100644 --- a/test/pthread/join_self_fail.c +++ b/test/pthread/join_self_fail.c @@ -5,7 +5,7 @@ // @expect error //////////////////////////////////////////////////////////////// -// +// // Declare alternate functions for pthread_join(), // __call_wrapper(), and pthread_create(), to illustrate // failure when `assume(ctid == *__newthread)` is not present @@ -16,26 +16,24 @@ //////////////////////////////////////////////////////////////// int pthread_join2(pthread_t __th, void **__thread_return); void __call_wrapper2(pthread_t *__restrict __newthread, - void *(*__start_routine) (void *), - void *__restrict __arg); + void *(*__start_routine)(void *), void *__restrict __arg); int pthread_create2(pthread_t *__restrict __newthread, __const pthread_attr_t *__restrict __attr, - void *(*__start_routine) (void *), - void *__restrict __arg); + void *(*__start_routine)(void *), void *__restrict __arg); //////////////////////////////////////////////////////////////// // Begin benchmark: //////////////////////////////////////////////////////////////// pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; -void* t1(void* arg) { - pthread_t* selfptr = (pthread_t*)arg; +void *t1(void *arg) { + pthread_t *selfptr = (pthread_t *)arg; pthread_t self = *selfptr; int ret; - int err = pthread_join2(self, (void*)&ret); + int err = pthread_join2(self, (void *)&ret); // Should be an EDEADLK error assert(err == 35); - pthread_exit((void*)1); + pthread_exit((void *)1); return 0; } @@ -65,19 +63,19 @@ int pthread_join2(pthread_t __th, void **__thread_return) { int joining_tid = __th; // Check for self-joining deadlock - if(calling_tid == __th) - return 35; // This is EDEADLK + if (calling_tid == __th) + return 35; // This is EDEADLK // When verifying join_self.c, this next `assert(0)` should never be // reached if the pthread model is correct beacuse calling_tid should // be equal to __th in this function, so the if branch should always // be taken, returning 35. // - // However, when `assume(ctid == *__newthread)` is not present in + // However, when `assume(ctid == *__newthread)` is not present in // __call_wrapper(), then it is possible that parent thread hasn't set // the child thread ID in the original pthread_t struct, so calling_tid - // won't match the passed in argument, __th, and so this assert(0) is - // reachable in this case (of course, this is all specifically for + // won't match the passed in argument, __th, and so this assert(0) is + // reachable in this case (of course, this is all specifically for // join_self()). assert(0); @@ -85,27 +83,26 @@ int pthread_join2(pthread_t __th, void **__thread_return) { __SMACK_code("assume $pthreadStatus[@][0] == $pthread_stopped;", __th); // Get the thread's return value - void* tmp_thread_return_pointer = __VERIFIER_nondet_pointer(); + void *tmp_thread_return_pointer = __VERIFIER_nondet_pointer(); __SMACK_code("@ := $pthreadStatus[@][1];", tmp_thread_return_pointer, __th); *__thread_return = tmp_thread_return_pointer; // Print return pointer value to SMACK traces - void* actual_thread_return_pointer = *__thread_return; + void *actual_thread_return_pointer = *__thread_return; return 0; } void __call_wrapper2(pthread_t *__restrict __newthread, - void *(*__start_routine) (void *), - void *__restrict __arg) { + void *(*__start_routine)(void *), void *__restrict __arg) { pthread_t ctid = pthread_self(); // This next line is commented to demonstrate failure of pthread_join() // to detect a self-join deadlock when child thread does not wait for // parent thread to properly record the child thread's ID in the original // pthread_t struct. - //assume(ctid == *__newthread); - + // assume(ctid == *__newthread); + // I think Zvonimir proposed to just use ctid to index into $pthreadStatus // This would work in most situations, HOWEVER, what if the parameter __arg // points to __newthread? Then, __start_routine() could modify this @@ -118,9 +115,8 @@ void __call_wrapper2(pthread_t *__restrict __newthread, } int pthread_create2(pthread_t *__restrict __newthread, - __const pthread_attr_t *__restrict __attr, - void *(*__start_routine) (void *), - void *__restrict __arg) { + __const pthread_attr_t *__restrict __attr, + void *(*__start_routine)(void *), void *__restrict __arg) { pthread_t tmp = __VERIFIER_nondet_int(); @@ -128,14 +124,13 @@ int pthread_create2(pthread_t *__restrict __newthread, // the call to __call_wrapper and performs DSA on it. int x = __VERIFIER_nondet_int(); assume(x == 0); - if(x) __call_wrapper2(__newthread, __start_routine, __arg); + if (x) + __call_wrapper2(__newthread, __start_routine, __arg); - __SMACK_code("async call @(@, @, @);", - __call_wrapper2, __newthread, + __SMACK_code("async call @(@, @, @);", __call_wrapper2, __newthread, __start_routine, __arg); __SMACK_code("call @ := corral_getChildThreadID();", tmp); *__newthread = tmp; return 0; } - diff --git a/test/pthread/lock.c b/test/pthread/lock.c index 3d7a996a5..d0bbff1b5 100644 --- a/test/pthread/lock.c +++ b/test/pthread/lock.c @@ -7,7 +7,7 @@ int z = 1; void *t1(void *arg) { - pthread_mutex_t* lock = arg; + pthread_mutex_t *lock = arg; pthread_mutex_lock(lock); z++; pthread_mutex_unlock(lock); @@ -30,4 +30,3 @@ int main(void) { assert(z == 3); return 0; } - diff --git a/test/pthread/lock2.c b/test/pthread/lock2.c index f9b7851c3..b6b146f7a 100644 --- a/test/pthread/lock2.c +++ b/test/pthread/lock2.c @@ -30,4 +30,3 @@ int main(void) { assert(x == 4); return 0; } - diff --git a/test/pthread/lock2_fail.c b/test/pthread/lock2_fail.c index 10ee05451..c8fb51396 100644 --- a/test/pthread/lock2_fail.c +++ b/test/pthread/lock2_fail.c @@ -29,4 +29,3 @@ int main(void) { assert(x == 4); return 0; } - diff --git a/test/pthread/lock3.c b/test/pthread/lock3.c index c43694a8c..afa69f232 100644 --- a/test/pthread/lock3.c +++ b/test/pthread/lock3.c @@ -37,4 +37,3 @@ int main(void) { assert(x == 4); return 0; } - diff --git a/test/pthread/lock3_fail.c b/test/pthread/lock3_fail.c index 6d0c56306..dbdf2b67f 100644 --- a/test/pthread/lock3_fail.c +++ b/test/pthread/lock3_fail.c @@ -33,4 +33,3 @@ int main(void) { assert(x == 4); return 0; } - diff --git a/test/pthread/lock4.c b/test/pthread/lock4.c index f5eab4aaa..d590b6cdd 100644 --- a/test/pthread/lock4.c +++ b/test/pthread/lock4.c @@ -28,4 +28,3 @@ int main(void) { assert(x == 3); return 0; } - diff --git a/test/pthread/lock4_fail.c b/test/pthread/lock4_fail.c index e30ffec73..2cfce82d4 100644 --- a/test/pthread/lock4_fail.c +++ b/test/pthread/lock4_fail.c @@ -26,4 +26,3 @@ int main(void) { pthread_join(tid1, 0); assert(x == 3); } - diff --git a/test/pthread/lock5.c b/test/pthread/lock5.c index 9a3834a12..15e212492 100644 --- a/test/pthread/lock5.c +++ b/test/pthread/lock5.c @@ -11,4 +11,3 @@ int main(void) { pthread_mutex_unlock(&lock); return 0; } - diff --git a/test/pthread/lock5_fail.c b/test/pthread/lock5_fail.c index bc18dda54..2936fc2f8 100644 --- a/test/pthread/lock5_fail.c +++ b/test/pthread/lock5_fail.c @@ -10,4 +10,3 @@ int main(void) { pthread_mutex_unlock(&lock); return 0; } - diff --git a/test/pthread/lock_fail.c b/test/pthread/lock_fail.c index 46523b6ad..2851ccabe 100644 --- a/test/pthread/lock_fail.c +++ b/test/pthread/lock_fail.c @@ -7,7 +7,7 @@ int z = 1; void *t1(void *arg) { - pthread_mutex_t* lock = arg; + pthread_mutex_t *lock = arg; pthread_mutex_lock(lock); z++; pthread_mutex_unlock(lock); @@ -26,4 +26,3 @@ int main(void) { assert(z == 3); return 0; } - diff --git a/test/pthread/lockattr.c b/test/pthread/lockattr.c index 40c5f2e5c..3d79dc382 100644 --- a/test/pthread/lockattr.c +++ b/test/pthread/lockattr.c @@ -10,7 +10,7 @@ pthread_mutex_t lock; pthread_mutexattr_t lockattr; int x; -void* t1(void *arg) { +void *t1(void *arg) { int err = __VERIFIER_nondet_int(); pthread_mutex_lock(&lock); err = pthread_mutex_lock(&lock); @@ -42,4 +42,3 @@ int main(void) { assert(x == 1); return 0; } - diff --git a/test/pthread_extras/dekker_true-unreach-call.c b/test/pthread_extras/dekker_true-unreach-call.c index 47a4f775a..b26f12292 100644 --- a/test/pthread_extras/dekker_true-unreach-call.c +++ b/test/pthread_extras/dekker_true-unreach-call.c @@ -10,20 +10,21 @@ int flag1 = 0, flag2 = 0; // boolean flags int turn; // integer variable to hold the ID of the thread whose turn is it -int x; // boolean variable to test mutual exclusion +int x; // boolean variable to test mutual exclusion void *thr1(void *arg) { flag1 = 1; while (flag2 >= 1) { if (turn != 0) { flag1 = 0; - while (turn != 0) {}; + while (turn != 0) { + }; flag1 = 1; } } // begin: critical section x = 0; - assert(x<=0); + assert(x <= 0); // end: critical section turn = 1; flag1 = 0; @@ -34,13 +35,14 @@ void *thr2(void *arg) { while (flag1 >= 1) { if (turn != 1) { flag2 = 0; - while (turn != 1) {}; + while (turn != 1) { + }; flag2 = 1; } } // begin: critical section x = 1; - assert(x>=1); + assert(x >= 1); // end: critical section turn = 1; flag2 = 0; @@ -48,11 +50,10 @@ void *thr2(void *arg) { int main() { pthread_t t1, t2; - __VERIFIER_assume(0<=turn && turn<=1); + __VERIFIER_assume(0 <= turn && turn <= 1); pthread_create(&t1, 0, thr1, 0); pthread_create(&t2, 0, thr2, 0); pthread_join(t1, 0); pthread_join(t2, 0); return 0; } - diff --git a/test/pthread_extras/lamport_true-unreach-call.c b/test/pthread_extras/lamport_true-unreach-call.c index 1801ef1d7..42f359ea2 100644 --- a/test/pthread_extras/lamport_true-unreach-call.c +++ b/test/pthread_extras/lamport_true-unreach-call.c @@ -10,7 +10,7 @@ int x, y; int b1, b2; // boolean flags -int X; // boolean variable to test mutual exclusion +int X; // boolean variable to test mutual exclusion void *thr1(void *arg) { while (1) { @@ -18,16 +18,19 @@ void *thr1(void *arg) { x = 1; if (y != 0) { b1 = 0; - while (y != 0) {}; + while (y != 0) { + }; continue; } y = 1; if (x != 1) { b1 = 0; - while (b2 >= 1) {}; + while (b2 >= 1) { + }; if (y != 1) { - while (y != 0) {}; - continue; + while (y != 0) { + }; + continue; } } break; @@ -46,16 +49,19 @@ void *thr2(void *arg) { x = 2; if (y != 0) { b2 = 0; - while (y != 0) {}; + while (y != 0) { + }; continue; } y = 2; if (x != 2) { b2 = 0; - while (b1 >= 1) {}; + while (b1 >= 1) { + }; if (y != 2) { - while (y != 0) {}; - continue; + while (y != 0) { + }; + continue; } } break; @@ -76,4 +82,3 @@ int main() { pthread_join(t2, 0); return 0; } - diff --git a/test/pthread_extras/lazy01_false-unreach-call.c b/test/pthread_extras/lazy01_false-unreach-call.c index f1fb21cce..8367ed2b6 100644 --- a/test/pthread_extras/lazy01_false-unreach-call.c +++ b/test/pthread_extras/lazy01_false-unreach-call.c @@ -3,35 +3,28 @@ // @expect error -pthread_mutex_t mutex; +pthread_mutex_t mutex; int data = 0; -void *thread1(void *arg) -{ +void *thread1(void *arg) { pthread_mutex_lock(&mutex); data++; pthread_mutex_unlock(&mutex); } - -void *thread2(void *arg) -{ +void *thread2(void *arg) { pthread_mutex_lock(&mutex); - data+=2; + data += 2; pthread_mutex_unlock(&mutex); } - -void *thread3(void *arg) -{ +void *thread3(void *arg) { pthread_mutex_lock(&mutex); assert(data < 3); - pthread_mutex_unlock(&mutex); + pthread_mutex_unlock(&mutex); } - -int main() -{ +int main() { pthread_mutex_init(&mutex, 0); pthread_t t1, t2, t3; @@ -43,7 +36,6 @@ int main() pthread_join(t1, 0); pthread_join(t2, 0); pthread_join(t3, 0); - + return 0; } - diff --git a/test/pthread_extras/peterson_true-unreach-call.c b/test/pthread_extras/peterson_true-unreach-call.c index 5c663f91c..cf15ebcd4 100644 --- a/test/pthread_extras/peterson_true-unreach-call.c +++ b/test/pthread_extras/peterson_true-unreach-call.c @@ -10,15 +10,16 @@ int flag1 = 0, flag2 = 0; // boolean flags int turn; // integer variable to hold the ID of the thread whose turn is it -int x; // boolean variable to test mutual exclusion +int x; // boolean variable to test mutual exclusion void *thr1(void *arg) { flag1 = 1; turn = 1; - while (flag2==1 && turn==1) {}; + while (flag2 == 1 && turn == 1) { + }; // begin: critical section x = 0; - assert(x<=0); + assert(x <= 0); // end: critical section flag1 = 0; } @@ -26,14 +27,15 @@ void *thr1(void *arg) { void *thr2(void *arg) { flag2 = 1; turn = 0; - while (flag1==1 && turn==0) {}; + while (flag1 == 1 && turn == 0) { + }; // begin: critical section x = 1; - assert(x>=1); + assert(x >= 1); // end: critical section flag2 = 0; } - + int main() { pthread_t t1, t2; @@ -43,4 +45,3 @@ int main() { pthread_join(t2, 0); return 0; } - diff --git a/test/pthread_extras/queue_false-unreach-call.c b/test/pthread_extras/queue_false-unreach-call.c index 17dbe5387..f08add154 100644 --- a/test/pthread_extras/queue_false-unreach-call.c +++ b/test/pthread_extras/queue_false-unreach-call.c @@ -5,17 +5,17 @@ // @expect error // @flag --unroll=6 -#define SIZE (10) -#define EMPTY (-1) -#define FULL (-2) -#define FALSE (0) -#define TRUE (1) +#define SIZE (10) +#define EMPTY (-1) +#define FULL (-2) +#define FALSE (0) +#define TRUE (1) typedef struct { - int element[SIZE]; - int head; - int tail; - int amount; + int element[SIZE]; + int head; + int tail; + int amount; } QType; pthread_mutex_t m; @@ -24,115 +24,96 @@ int stored_elements[SIZE]; _Bool enqueue_flag, dequeue_flag; QType queue; -int init(QType *q) -{ - q->head=0; - q->tail=0; - q->amount=0; +int init(QType *q) { + q->head = 0; + q->tail = 0; + q->amount = 0; } -int empty(QType * q) -{ - if (q->head == q->tail) - { +int empty(QType *q) { + if (q->head == q->tail) { printf("queue is empty\n"); return EMPTY; - } - else + } else return 0; } -int full(QType * q) -{ - if (q->amount == SIZE) - { - printf("queue is full\n"); - return FULL; - } - else +int full(QType *q) { + if (q->amount == SIZE) { + printf("queue is full\n"); + return FULL; + } else return 0; } -int enqueue(QType *q, int x) -{ +int enqueue(QType *q, int x) { q->element[q->tail] = x; q->amount++; - if (q->tail == SIZE) - { + if (q->tail == SIZE) { q->tail = 1; - } - else - { + } else { q->tail++; } return 0; } -int dequeue(QType *q) -{ +int dequeue(QType *q) { int x; x = q->element[q->head]; q->amount--; - if (q->head == SIZE) - { + if (q->head == SIZE) { q->head = 1; - } - else + } else q->head++; return x; } -void *t1(void *arg) -{ +void *t1(void *arg) { int value, i; pthread_mutex_lock(&m); value = __VERIFIER_nondet_int(); - if (enqueue(&queue,value)) { + if (enqueue(&queue, value)) { goto ERROR; } - stored_elements[0]=value; + stored_elements[0] = value; if (empty(&queue)) { goto ERROR; } pthread_mutex_unlock(&m); - for(i=0; i<(SIZE-1); i++) - { + for (i = 0; i < (SIZE - 1); i++) { pthread_mutex_lock(&m); - if (enqueue_flag) - { + if (enqueue_flag) { value = __VERIFIER_nondet_int(); - enqueue(&queue,value); - stored_elements[i+1]=value; - enqueue_flag=FALSE; - dequeue_flag=TRUE; + enqueue(&queue, value); + stored_elements[i + 1] = value; + enqueue_flag = FALSE; + dequeue_flag = TRUE; } pthread_mutex_unlock(&m); - } + } return NULL; - ERROR: assert(0 != 0); +ERROR: + assert(0 != 0); } -void *t2(void *arg) -{ +void *t2(void *arg) { int i; - for(i=0; ihead=0; - q->tail=0; - q->amount=0; +int init(QType *q) { + q->head = 0; + q->tail = 0; + q->amount = 0; } -int empty(QType * q) -{ - if (q->head == q->tail) - { +int empty(QType *q) { + if (q->head == q->tail) { printf("queue is empty\n"); return EMPTY; - } - else + } else return 0; } -int full(QType * q) -{ - if (q->amount == SIZE) - { +int full(QType *q) { + if (q->amount == SIZE) { printf("queue is full\n"); return FULL; - } - else + } else return 0; } -int enqueue(QType *q, int x) -{ +int enqueue(QType *q, int x) { q->element[q->tail] = x; q->amount++; - if (q->tail == SIZE) - { + if (q->tail == SIZE) { q->tail = 1; - } - else - { + } else { q->tail++; } return 0; } -int dequeue(QType *q) -{ +int dequeue(QType *q) { int x; x = q->element[q->head]; q->amount--; - if (q->head == SIZE) - { + if (q->head == SIZE) { q->head = 1; - } - else + } else q->head++; return x; } -void *t1(void *arg) -{ +void *t1(void *arg) { int value, i; pthread_mutex_lock(&m); - if (enqueue_flag) - { - for(i=0; i #include +#include // @expect error // @flag --unroll=3 @@ -20,64 +20,62 @@ void set(); int check(); int main(int argc, char *argv[]) { - int i, err; - - if (argc != 1) { - if (argc != 3) { - fprintf(stderr, USAGE); - exit(-1); - } else { - sscanf(argv[1], "%d", &iSet); - sscanf(argv[2], "%d", &iCheck); - } + int i, err; + + if (argc != 1) { + if (argc != 3) { + fprintf(stderr, USAGE); + exit(-1); + } else { + sscanf(argv[1], "%d", &iSet); + sscanf(argv[2], "%d", &iCheck); } + } - //printf("iSet = %d\niCheck = %d\n", iSet, iCheck); + // printf("iSet = %d\niCheck = %d\n", iSet, iCheck); - pthread_t setPool[iSet]; - pthread_t checkPool[iCheck]; + pthread_t setPool[iSet]; + pthread_t checkPool[iCheck]; - for (i = 0; i < iSet; i++) { - if (0 != (err = pthread_create(&setPool[i], NULL, &setThread, NULL))) { - fprintf(stderr, "Error [%d] found creating set thread.\n", err); - exit(-1); - } + for (i = 0; i < iSet; i++) { + if (0 != (err = pthread_create(&setPool[i], NULL, &setThread, NULL))) { + fprintf(stderr, "Error [%d] found creating set thread.\n", err); + exit(-1); } + } - for (i = 0; i < iCheck; i++) { - if (0 != (err = pthread_create(&checkPool[i], NULL, &checkThread, - NULL))) { - fprintf(stderr, "Error [%d] found creating check thread.\n", err); - exit(-1); - } + for (i = 0; i < iCheck; i++) { + if (0 != (err = pthread_create(&checkPool[i], NULL, &checkThread, NULL))) { + fprintf(stderr, "Error [%d] found creating check thread.\n", err); + exit(-1); } + } - for (i = 0; i < iSet; i++) { - if (0 != (err = pthread_join(setPool[i], NULL))) { - fprintf(stderr, "pthread join error: %d\n", err); - exit(-1); - } + for (i = 0; i < iSet; i++) { + if (0 != (err = pthread_join(setPool[i], NULL))) { + fprintf(stderr, "pthread join error: %d\n", err); + exit(-1); } + } - for (i = 0; i < iCheck; i++) { - if (0 != (err = pthread_join(checkPool[i], NULL))) { - fprintf(stderr, "pthread join error: %d\n", err); - exit(-1); - } + for (i = 0; i < iCheck; i++) { + if (0 != (err = pthread_join(checkPool[i], NULL))) { + fprintf(stderr, "pthread join error: %d\n", err); + exit(-1); } + } - return 0; + return 0; } - + void *setThread(void *param) { - a = 1; - b = -1; + a = 1; + b = -1; - return NULL; + return NULL; } void *checkThread(void *param) { - assert((a == 0 && b == 0) || (a == 1 && b == -1)); - return NULL; + assert((a == 0 && b == 0) || (a == 1 && b == -1)); + return NULL; } - diff --git a/test/pthread_extras/reorder_5_false-unreach-call.c b/test/pthread_extras/reorder_5_false-unreach-call.c index e2925922c..8f193a0f0 100644 --- a/test/pthread_extras/reorder_5_false-unreach-call.c +++ b/test/pthread_extras/reorder_5_false-unreach-call.c @@ -20,64 +20,62 @@ void set(); int check(); int main(int argc, char *argv[]) { - int i, err; - - if (argc != 1) { - if (argc != 3) { - fprintf(stderr, "./reorder \n"); - exit(-1); - } else { - sscanf(argv[1], "%d", &iSet); - sscanf(argv[2], "%d", &iCheck); - } + int i, err; + + if (argc != 1) { + if (argc != 3) { + fprintf(stderr, "./reorder \n"); + exit(-1); + } else { + sscanf(argv[1], "%d", &iSet); + sscanf(argv[2], "%d", &iCheck); } + } + pthread_t setPool[iSet]; + pthread_t checkPool[iCheck]; - - pthread_t setPool[iSet]; - pthread_t checkPool[iCheck]; - - for (i = 0; i < iSet; i++) { - if (0 != (err = pthread_create(&setPool[i], ((void *)0), &setThread, ((void *)0)))) { - fprintf(stderr, "Error [%d] found creating set thread.\n", err); - exit(-1); - } + for (i = 0; i < iSet; i++) { + if (0 != (err = pthread_create(&setPool[i], ((void *)0), &setThread, + ((void *)0)))) { + fprintf(stderr, "Error [%d] found creating set thread.\n", err); + exit(-1); } + } - for (i = 0; i < iCheck; i++) { - if (0 != (err = pthread_create(&checkPool[i], ((void *)0), &checkThread, - ((void *)0)))) { - fprintf(stderr, "Error [%d] found creating check thread.\n", err); - exit(-1); - } + for (i = 0; i < iCheck; i++) { + if (0 != (err = pthread_create(&checkPool[i], ((void *)0), &checkThread, + ((void *)0)))) { + fprintf(stderr, "Error [%d] found creating check thread.\n", err); + exit(-1); } + } - for (i = 0; i < iSet; i++) { - if (0 != (err = pthread_join(setPool[i], ((void *)0)))) { - fprintf(stderr, "pthread join error: %d\n", err); - exit(-1); - } + for (i = 0; i < iSet; i++) { + if (0 != (err = pthread_join(setPool[i], ((void *)0)))) { + fprintf(stderr, "pthread join error: %d\n", err); + exit(-1); } + } - for (i = 0; i < iCheck; i++) { - if (0 != (err = pthread_join(checkPool[i], ((void *)0)))) { - fprintf(stderr, "pthread join error: %d\n", err); - exit(-1); - } + for (i = 0; i < iCheck; i++) { + if (0 != (err = pthread_join(checkPool[i], ((void *)0)))) { + fprintf(stderr, "pthread join error: %d\n", err); + exit(-1); } + } - return 0; + return 0; } void *setThread(void *param) { - a = 1; - b = -1; + a = 1; + b = -1; - return ((void *)0); + return ((void *)0); } void *checkThread(void *param) { - assert((a == 0 && b == 0) || (a == 1 && b == -1)); - return ((void *)0); + assert((a == 0 && b == 0) || (a == 1 && b == -1)); + return ((void *)0); } - diff --git a/test/pthread_extras/scull_true-unreach-call.c b/test/pthread_extras/scull_true-unreach-call.c index 544cb1a22..f1b42d822 100644 --- a/test/pthread_extras/scull_true-unreach-call.c +++ b/test/pthread_extras/scull_true-unreach-call.c @@ -9,7 +9,7 @@ #define inode int // the lock #define file int -#define scull_dev int +#define scull_dev int #define scull_qset_type int #define loff_t int #define ssize_t int @@ -19,7 +19,7 @@ #define char int #define void_ptr int -#define tid1 1 +#define tid1 1 #define tid2 2 #define FILE_WITH_LOCK_UNLOCKED 0 @@ -42,10 +42,10 @@ */ /* Use 'k' as magic number */ -#define SCULL_IOC_MAGIC 'k' +#define SCULL_IOC_MAGIC 'k' /* Please use a different 8-bit number in your code */ -#define SCULL_IOCRESET _IO(SCULL_IOC_MAGIC, 0) +#define SCULL_IOCRESET _IO(SCULL_IOC_MAGIC, 0) /* * S means "Set" through a ptr, @@ -55,31 +55,30 @@ * X means "eXchange": switch G and S atomically * H means "sHift": switch T and Q atomically */ -#define SCULL_IOCSQUANTUM _IOW(SCULL_IOC_MAGIC, 1, int) -#define SCULL_IOCSQSET _IOW(SCULL_IOC_MAGIC, 2, int) -#define SCULL_IOCTQUANTUM _IO(SCULL_IOC_MAGIC, 3) -#define SCULL_IOCTQSET _IO(SCULL_IOC_MAGIC, 4) -#define SCULL_IOCGQUANTUM _IOR(SCULL_IOC_MAGIC, 5, int) -#define SCULL_IOCGQSET _IOR(SCULL_IOC_MAGIC, 6, int) -#define SCULL_IOCQQUANTUM _IO(SCULL_IOC_MAGIC, 7) -#define SCULL_IOCQQSET _IO(SCULL_IOC_MAGIC, 8) +#define SCULL_IOCSQUANTUM _IOW(SCULL_IOC_MAGIC, 1, int) +#define SCULL_IOCSQSET _IOW(SCULL_IOC_MAGIC, 2, int) +#define SCULL_IOCTQUANTUM _IO(SCULL_IOC_MAGIC, 3) +#define SCULL_IOCTQSET _IO(SCULL_IOC_MAGIC, 4) +#define SCULL_IOCGQUANTUM _IOR(SCULL_IOC_MAGIC, 5, int) +#define SCULL_IOCGQSET _IOR(SCULL_IOC_MAGIC, 6, int) +#define SCULL_IOCQQUANTUM _IO(SCULL_IOC_MAGIC, 7) +#define SCULL_IOCQQSET _IO(SCULL_IOC_MAGIC, 8) #define SCULL_IOCXQUANTUM _IOWR(SCULL_IOC_MAGIC, 9, int) -#define SCULL_IOCXQSET _IOWR(SCULL_IOC_MAGIC,10, int) -#define SCULL_IOCHQUANTUM _IO(SCULL_IOC_MAGIC, 11) -#define SCULL_IOCHQSET _IO(SCULL_IOC_MAGIC, 12) +#define SCULL_IOCXQSET _IOWR(SCULL_IOC_MAGIC, 10, int) +#define SCULL_IOCHQUANTUM _IO(SCULL_IOC_MAGIC, 11) +#define SCULL_IOCHQSET _IO(SCULL_IOC_MAGIC, 12) /* * The other entities only have "Tell" and "Query", because they're * not printed in the book, and there's no need to have all six. * (The previous stuff was only there to show different ways to do it. */ -#define SCULL_P_IOCTSIZE _IO(SCULL_IOC_MAGIC, 13) -#define SCULL_P_IOCQSIZE _IO(SCULL_IOC_MAGIC, 14) +#define SCULL_P_IOCTSIZE _IO(SCULL_IOC_MAGIC, 13) +#define SCULL_P_IOCQSIZE _IO(SCULL_IOC_MAGIC, 14) /* ... more to come */ #define SCULL_IOC_MAXNR 14 - inode i; pthread_mutex_t lock; @@ -108,16 +107,13 @@ inline unsigned_long copy_from_user(char to, char from, unsigned_long n) { return __VERIFIER_nondet_int(); } -inline int __get_user(int size, void_ptr ptr) -{ +inline int __get_user(int size, void_ptr ptr) { return __VERIFIER_nondet_int(); } -inline int __put_user(int size, void_ptr ptr) -{ - return __VERIFIER_nondet_int(); -} - +inline int __put_user(int size, void_ptr ptr) { + return __VERIFIER_nondet_int(); +} /* ===================================================== A model for the device-driver functions @@ -144,15 +140,14 @@ int scull_qset = SCULL_QSET; int dev_data; int dev_quantum; int dev_qset; -unsigned_long dev_size; -int __X__; //variable to test mutual exclusion +unsigned_long dev_size; +int __X__; // variable to test mutual exclusion /* * Empty out the scull device; must be called with the device * semaphore held. */ -int scull_trim(scull_dev dev) -{ +int scull_trim(scull_dev dev) { int qset = dev_qset; dev_size = 0; @@ -162,13 +157,11 @@ int scull_trim(scull_dev dev) return 0; } - /* * Open and close */ -inline int scull_open(int tid, inode i, file filp) -{ +inline int scull_open(int tid, inode i, file filp) { scull_dev dev; dev = container_of(i); @@ -178,10 +171,10 @@ inline int scull_open(int tid, inode i, file filp) return -ERESTARTSYS; __X__ = 2; /* check mutual exclusion */ - scull_trim(dev); /* ignore errors */ + scull_trim(dev); /* ignore errors */ assert(__X__ >= 2); /* check mutual exclusion */ up(); - return 0; /* success */ + return 0; /* success */ } #define scull_release(i, filp) 0 @@ -197,9 +190,8 @@ inline scull_qset_type scull_follow(scull_dev dev, int n) { * Data management: read and write */ -inline ssize_t scull_read(int tid, file filp, char buf, size_t count, - loff_t f_pos) -{ +inline ssize_t scull_read(int tid, file filp, char buf, size_t count, + loff_t f_pos) { scull_dev dev = filp; scull_qset_type dptr; /* the first listitem */ int quantum = dev_quantum, qset = dev_qset; @@ -210,25 +202,26 @@ inline ssize_t scull_read(int tid, file filp, char buf, size_t count, if (down_interruptible()) return -ERESTARTSYS; - __X__ = 0; /* check mutual exclusion */ + __X__ = 0; /* check mutual exclusion */ - if (f_pos >= dev_size) + if (f_pos >= dev_size) goto out; - if (f_pos+count >= dev_size) + if (f_pos + count >= dev_size) count = dev_size - f_pos; /* find listitem, qset index, and offset in the quantum */ - item = f_pos / itemsize; - rest = f_pos; - s_pos = rest / quantum; q_pos = rest; + item = f_pos / itemsize; + rest = f_pos; + s_pos = rest / quantum; + q_pos = rest; + + /* follow the list up to the right position (defined elsewhere) */ + dptr = scull_follow(dev, item); - /* follow the list up to the right position (defined elsewhere) */ - dptr = scull_follow(dev, item); + /* read only up to the end of this quantum */ + if (count > quantum - q_pos) + count = quantum - q_pos; - /* read only up to the end of this quantum */ - if (count > quantum - q_pos) - count = quantum - q_pos; - if (copy_to_user(buf, dev_data + s_pos + q_pos, count)) { retval = -EFAULT; goto out; @@ -238,14 +231,13 @@ inline ssize_t scull_read(int tid, file filp, char buf, size_t count, assert(__X__ <= 0); /* check mutual exclusion */ - out: +out: up(); return retval; } -inline ssize_t scull_write(int tid, file filp, char buf, size_t count, - loff_t f_pos) -{ +inline ssize_t scull_write(int tid, file filp, char buf, size_t count, + loff_t f_pos) { scull_dev dev = filp; scull_qset_type dptr; int quantum = dev_quantum, qset = dev_qset; @@ -255,11 +247,12 @@ inline ssize_t scull_write(int tid, file filp, char buf, size_t count, if (down_interruptible()) return -ERESTARTSYS; - + /* find listitem, qset index and offset in the quantum */ item = f_pos / itemsize; rest = f_pos; - s_pos = rest / quantum; q_pos = rest; + s_pos = rest / quantum; + q_pos = rest; /* follow the list up to the right position */ dptr = scull_follow(dev, item); @@ -270,9 +263,9 @@ inline ssize_t scull_write(int tid, file filp, char buf, size_t count, if (count > quantum - q_pos) count = quantum - q_pos; - __X__ = 1; /* check mutual exclusion */ + __X__ = 1; /* check mutual exclusion */ - if (copy_from_user(dev_data+s_pos+q_pos, buf, count)) { + if (copy_from_user(dev_data + s_pos + q_pos, buf, count)) { retval = -EFAULT; goto out; } @@ -285,7 +278,7 @@ inline ssize_t scull_write(int tid, file filp, char buf, size_t count, assert(__X__ == 1); /* check mutual exclusion */ - out: +out: up(); return retval; } @@ -294,93 +287,88 @@ inline ssize_t scull_write(int tid, file filp, char buf, size_t count, * The ioctl() implementation */ -inline int scull_ioctl(inode i, file filp, - unsigned_int cmd, unsigned_long arg) -{ - - int err = 0, tmp; - int retval = 0; - - switch(cmd) { - - case SCULL_IOCRESET: - scull_quantum = SCULL_QUANTUM; - scull_qset = SCULL_QSET; - break; - - case SCULL_IOCSQUANTUM: /* Set: arg points to the value */ - retval = __get_user(scull_quantum, arg); - break; - - case SCULL_IOCTQUANTUM: /* Tell: arg is the value */ - scull_quantum = arg; - break; - - case SCULL_IOCGQUANTUM: /* Get: arg is pointer to result */ - retval = __put_user(scull_quantum, arg); - break; - - case SCULL_IOCQQUANTUM: /* Query: return it (it's positive) */ - return scull_quantum; - - case SCULL_IOCXQUANTUM: /* eXchange: use arg as pointer */ - tmp = scull_quantum; - retval = __get_user(scull_quantum, arg); - if (retval == 0) - retval = __put_user(tmp, arg); - break; - - case SCULL_IOCHQUANTUM: /* sHift: like Tell + Query */ - tmp = scull_quantum; - scull_quantum = arg; - return tmp; - - case SCULL_IOCSQSET: - retval = __get_user(scull_qset, arg); - break; - - case SCULL_IOCTQSET: - scull_qset = arg; - break; - - case SCULL_IOCGQSET: - retval = __put_user(scull_qset, arg); - break; - - case SCULL_IOCQQSET: - return scull_qset; - - case SCULL_IOCXQSET: - tmp = scull_qset; - retval = __get_user(scull_qset, arg); - if (retval == 0) - retval = __put_user(tmp, arg); - break; - - case SCULL_IOCHQSET: - tmp = scull_qset; - scull_qset = arg; - return tmp; - - - default: /* redundant, as cmd was checked against MAXNR */ - return -ENOTTY; - } - return retval; +inline int scull_ioctl(inode i, file filp, unsigned_int cmd, + unsigned_long arg) { -} + int err = 0, tmp; + int retval = 0; + + switch (cmd) { + + case SCULL_IOCRESET: + scull_quantum = SCULL_QUANTUM; + scull_qset = SCULL_QSET; + break; + + case SCULL_IOCSQUANTUM: /* Set: arg points to the value */ + retval = __get_user(scull_quantum, arg); + break; + + case SCULL_IOCTQUANTUM: /* Tell: arg is the value */ + scull_quantum = arg; + break; + + case SCULL_IOCGQUANTUM: /* Get: arg is pointer to result */ + retval = __put_user(scull_quantum, arg); + break; + case SCULL_IOCQQUANTUM: /* Query: return it (it's positive) */ + return scull_quantum; + + case SCULL_IOCXQUANTUM: /* eXchange: use arg as pointer */ + tmp = scull_quantum; + retval = __get_user(scull_quantum, arg); + if (retval == 0) + retval = __put_user(tmp, arg); + break; + + case SCULL_IOCHQUANTUM: /* sHift: like Tell + Query */ + tmp = scull_quantum; + scull_quantum = arg; + return tmp; + + case SCULL_IOCSQSET: + retval = __get_user(scull_qset, arg); + break; + + case SCULL_IOCTQSET: + scull_qset = arg; + break; + + case SCULL_IOCGQSET: + retval = __put_user(scull_qset, arg); + break; + + case SCULL_IOCQQSET: + return scull_qset; + + case SCULL_IOCXQSET: + tmp = scull_qset; + retval = __get_user(scull_qset, arg); + if (retval == 0) + retval = __put_user(tmp, arg); + break; + + case SCULL_IOCHQSET: + tmp = scull_qset; + scull_qset = arg; + return tmp; + + default: /* redundant, as cmd was checked against MAXNR */ + return -ENOTTY; + } + return retval; +} /* * The "extended" operations -- only seek */ -inline loff_t scull_llseek(file filp, loff_t off, int whence, loff_t f_pos) -{ +inline loff_t scull_llseek(file filp, loff_t off, int whence, loff_t f_pos) { scull_dev dev = filp; loff_t newpos; - switch(whence) { + switch (whence) { case 0: /* SEEK_SET */ newpos = off; break; @@ -396,7 +384,8 @@ inline loff_t scull_llseek(file filp, loff_t off, int whence, loff_t f_pos) default: /* can't happen */ return -EINVAL; } - if (newpos < 0) return -EINVAL; + if (newpos < 0) + return -EINVAL; filp = newpos; return newpos; } @@ -410,24 +399,20 @@ inline loff_t scull_llseek(file filp, loff_t off, int whence, loff_t f_pos) * Thefore, it must be careful to work correctly even if some of the items * have not been initialized */ -inline void scull_cleanup_module(void) -{ +inline void scull_cleanup_module(void) { scull_dev dev; scull_trim(dev); - } -inline int scull_init_module() -{ +inline int scull_init_module() { int result = 0; return 0; - fail: +fail: scull_cleanup_module(); return result; } - /* ===================================================== User program calling functions from the device driver ===================================================== */ @@ -468,4 +453,3 @@ int main() { pthread_mutex_destroy(&lock); return 0; } - diff --git a/test/pthread_extras/sigma_false-unreach-call.c b/test/pthread_extras/sigma_false-unreach-call.c index 0387813bd..de1a09643 100644 --- a/test/pthread_extras/sigma_false-unreach-call.c +++ b/test/pthread_extras/sigma_false-unreach-call.c @@ -11,40 +11,36 @@ const int SIGMA = 5; int *array; int array_index = 0; - -void *thread(void * arg) -{ - array[array_index] = 1; - return 0; +void *thread(void *arg) { + array[array_index] = 1; + return 0; } +int main() { + int tid, sum; + pthread_t *t; -int main() -{ - int tid, sum; - pthread_t *t; - - t = (pthread_t *)malloc(sizeof(pthread_t) * SIGMA); - array = (int *)malloc(sizeof(int) * SIGMA); + t = (pthread_t *)malloc(sizeof(pthread_t) * SIGMA); + array = (int *)malloc(sizeof(int) * SIGMA); - //__VERIFIER_assume(t); - //__VERIFIER_assume(array); + //__VERIFIER_assume(t); + //__VERIFIER_assume(array); - for (tid=0; tid 0); - data = malloc(sizeof(int) * len); - while(1) { - pthread_create(&t, 0, thr, 0); - } + pthread_t t; + next = 0; + len = __VERIFIER_nondet_int(); + __VERIFIER_assume(len > 0); + data = malloc(sizeof(int) * len); + while (1) { + pthread_create(&t, 0, thr, 0); + } } - diff --git a/test/pthread_extras/stack_false-unreach-call.c b/test/pthread_extras/stack_false-unreach-call.c index 6f7d5ef45..76ad08187 100644 --- a/test/pthread_extras/stack_false-unreach-call.c +++ b/test/pthread_extras/stack_false-unreach-call.c @@ -5,100 +5,73 @@ // @expect error // @flag --unroll=6 -#define TRUE (1) -#define FALSE (0) -#define SIZE (5) -#define OVERFLOW (-1) +#define TRUE (1) +#define FALSE (0) +#define SIZE (5) +#define OVERFLOW (-1) #define UNDERFLOW (-2) -static int top=0; +static int top = 0; static unsigned int arr[SIZE]; pthread_mutex_t m; -_Bool flag=FALSE; +_Bool flag = FALSE; -void inc_top(void) -{ - top++; -} +void inc_top(void) { top++; } -void dec_top(void) -{ - top--; -} +void dec_top(void) { top--; } -int get_top(void) -{ - return top; -} +int get_top(void) { return top; } -int stack_empty(void) -{ - (top==0) ? TRUE : FALSE; -} +int stack_empty(void) { (top == 0) ? TRUE : FALSE; } -int push(unsigned int *stack, int x) -{ - if (top==SIZE) - { +int push(unsigned int *stack, int x) { + if (top == SIZE) { printf("stack overflow\n"); return OVERFLOW; - } - else - { + } else { stack[get_top()] = x; inc_top(); } return 0; } -int pop(unsigned int *stack) -{ - if (get_top()==0) - { - printf("stack underflow\n"); +int pop(unsigned int *stack) { + if (get_top() == 0) { + printf("stack underflow\n"); return UNDERFLOW; - } - else - { + } else { dec_top(); - return stack[get_top()]; + return stack[get_top()]; } return 0; } -void *t1(void *arg) -{ +void *t1(void *arg) { int i; unsigned int tmp; - for(i=0; i0) - { - assert(pop(arr)!=UNDERFLOW); - } + if (top > 0) { + assert(pop(arr) != UNDERFLOW); + } pthread_mutex_unlock(&m); } } - -int main(void) -{ +int main(void) { pthread_t id1, id2; pthread_mutex_init(&m, 0); @@ -115,4 +88,3 @@ int main(void) return 0; } - diff --git a/test/pthread_extras/stateful01_false-unreach-call.c b/test/pthread_extras/stateful01_false-unreach-call.c index a801ff8b6..c86a47141 100644 --- a/test/pthread_extras/stateful01_false-unreach-call.c +++ b/test/pthread_extras/stateful01_false-unreach-call.c @@ -3,11 +3,10 @@ // @expect error -pthread_mutex_t ma, mb; +pthread_mutex_t ma, mb; int data1, data2; -void * thread1(void * arg) -{ +void *thread1(void *arg) { pthread_mutex_lock(&ma); data1++; pthread_mutex_unlock(&ma); @@ -17,22 +16,18 @@ void * thread1(void * arg) pthread_mutex_unlock(&ma); } - -void * thread2(void * arg) -{ +void *thread2(void *arg) { pthread_mutex_lock(&ma); - data1+=5; + data1 += 5; pthread_mutex_unlock(&ma); pthread_mutex_lock(&ma); - data2-=6; + data2 -= 6; pthread_mutex_unlock(&ma); } - -int main() -{ - pthread_t t1, t2; +int main() { + pthread_t t1, t2; pthread_mutex_init(&ma, 0); pthread_mutex_init(&mb, 0); @@ -42,11 +37,10 @@ int main() pthread_create(&t1, 0, thread1, 0); pthread_create(&t2, 0, thread2, 0); - + pthread_join(t1, 0); pthread_join(t2, 0); - assert(!(data1==16 && data2==5)); + assert(!(data1 == 16 && data2 == 5)); return 0; } - diff --git a/test/pthread_extras/stateful01_true-unreach-call.c b/test/pthread_extras/stateful01_true-unreach-call.c index efb121651..028ea64f0 100644 --- a/test/pthread_extras/stateful01_true-unreach-call.c +++ b/test/pthread_extras/stateful01_true-unreach-call.c @@ -3,11 +3,10 @@ // @expect verified -pthread_mutex_t ma, mb; +pthread_mutex_t ma, mb; int data1, data2; -void * thread1(void * arg) -{ +void *thread1(void *arg) { pthread_mutex_lock(&ma); data1++; pthread_mutex_unlock(&ma); @@ -17,22 +16,18 @@ void * thread1(void * arg) pthread_mutex_unlock(&ma); } - -void * thread2(void * arg) -{ +void *thread2(void *arg) { pthread_mutex_lock(&ma); - data1+=5; + data1 += 5; pthread_mutex_unlock(&ma); pthread_mutex_lock(&ma); - data2-=6; + data2 -= 6; pthread_mutex_unlock(&ma); } - -int main() -{ - pthread_t t1, t2; +int main() { + pthread_t t1, t2; pthread_mutex_init(&ma, 0); pthread_mutex_init(&mb, 0); @@ -42,12 +37,11 @@ int main() pthread_create(&t1, 0, thread1, 0); pthread_create(&t2, 0, thread2, 0); - + pthread_join(t1, 0); pthread_join(t2, 0); - assert(data1==16 || data2==5); + assert(data1 == 16 || data2 == 5); return 0; } - diff --git a/test/pthread_extras/sync01_true-unreach-call.c b/test/pthread_extras/sync01_true-unreach-call.c index 6f45be564..0fdbfa01d 100644 --- a/test/pthread_extras/sync01_true-unreach-call.c +++ b/test/pthread_extras/sync01_true-unreach-call.c @@ -1,62 +1,56 @@ #include "pthread.h" #include "smack.h" -#include +#include // @expect verified // @flag --unroll=3 -int num; +int num; -pthread_mutex_t m; -pthread_cond_t empty, full; +pthread_mutex_t m; +pthread_cond_t empty, full; -void * thread1(void * arg) -{ +void *thread1(void *arg) { pthread_mutex_lock(&m); - while (num > 0) + while (num > 0) pthread_cond_wait(&empty, &m); - + num++; pthread_mutex_unlock(&m); pthread_cond_signal(&full); } - -void * thread2(void * arg) -{ +void *thread2(void *arg) { pthread_mutex_lock(&m); - while (num == 0) + while (num == 0) pthread_cond_wait(&full, &m); num--; - + pthread_mutex_unlock(&m); pthread_cond_signal(&empty); } - -int main() -{ - pthread_t t1, t2; +int main() { + pthread_t t1, t2; num = 1; pthread_mutex_init(&m, 0); pthread_cond_init(&empty, 0); pthread_cond_init(&full, 0); - + pthread_create(&t1, 0, thread1, 0); pthread_create(&t2, 0, thread2, 0); - + pthread_join(t1, 0); pthread_join(t2, 0); - assert(num==1); + assert(num == 1); return 0; } - diff --git a/test/pthread_extras/szymanski_true-unreach-call.c b/test/pthread_extras/szymanski_true-unreach-call.c index 692fa38f8..9fe576522 100644 --- a/test/pthread_extras/szymanski_true-unreach-call.c +++ b/test/pthread_extras/szymanski_true-unreach-call.c @@ -7,42 +7,50 @@ // @expect verified -int flag1 = 0, flag2 = 0; // integer flags -int x; // boolean variable to test mutual exclusion +int flag1 = 0, flag2 = 0; // integer flags +int x; // boolean variable to test mutual exclusion void *thr1(void *arg) { flag1 = 1; - while (flag2 >= 3); + while (flag2 >= 3) + ; flag1 = 3; if (flag2 == 1) { flag1 = 2; - while (flag2 != 4); + while (flag2 != 4) + ; } flag1 = 4; - while (flag2 >= 2); + while (flag2 >= 2) + ; // begin critical section x = 0; - assert(x<=0); + assert(x <= 0); // end critical section - while (2 <= flag2 && flag2 <= 3); + while (2 <= flag2 && flag2 <= 3) + ; flag1 = 0; } void *thr2(void *arg) { flag2 = 1; - while (flag1 >= 3); + while (flag1 >= 3) + ; flag2 = 3; if (flag1 == 1) { flag2 = 2; - while (flag1 != 4); + while (flag1 != 4) + ; } flag2 = 4; - while (flag1 >= 2); + while (flag1 >= 2) + ; // begin critical section x = 1; - assert(x>=1); + assert(x >= 1); // end critical section - while (2 <= flag1 && flag1 <= 3); + while (2 <= flag1 && flag1 <= 3) + ; flag2 = 0; } @@ -54,4 +62,3 @@ int main() { pthread_join(t2, 0); return 0; } - diff --git a/test/pthread_extras/time_var_mutex_true-unreach-call.c b/test/pthread_extras/time_var_mutex_true-unreach-call.c index 68ad83801..2e6237be5 100644 --- a/test/pthread_extras/time_var_mutex_true-unreach-call.c +++ b/test/pthread_extras/time_var_mutex_true-unreach-call.c @@ -2,7 +2,7 @@ http://www.model.in.tum.de/~popeea/research/threader This file is adapted from the example introduced in the paper: - Thread-Modular Verification for Shared-Memory Programs + Thread-Modular Verification for Shared-Memory Programs by Cormac Flanagan, Stephen Freund, Shaz Qadeer. */ @@ -12,14 +12,15 @@ // @expect verified int block; -int busy; // boolean flag indicating whether the block has been allocated to an inode +int busy; // boolean flag indicating whether the block has been allocated to an + // inode int inode; pthread_mutex_t m_inode; // protects the inode -pthread_mutex_t m_busy; // protects the busy flag +pthread_mutex_t m_busy; // protects the busy flag -void *allocator(void *arg){ +void *allocator(void *arg) { pthread_mutex_lock(&m_inode); - if(inode == 0){ + if (inode == 0) { pthread_mutex_lock(&m_busy); busy = 1; pthread_mutex_unlock(&m_busy); @@ -31,16 +32,16 @@ void *allocator(void *arg){ return 0; } -void *de_allocator(void *arg){ +void *de_allocator(void *arg) { pthread_mutex_lock(&m_busy); - if(busy == 0){ + if (busy == 0) { block = 0; assert(block == 0); } pthread_mutex_unlock(&m_busy); return ((void *)0); } - + int main() { pthread_t t1, t2; __VERIFIER_assume(inode == busy); @@ -54,4 +55,3 @@ int main() { pthread_mutex_destroy(&m_busy); return 0; } - diff --git a/test/pthread_extras/twostage_3_false-unreach-call.c b/test/pthread_extras/twostage_3_false-unreach-call.c index 8e0a723c4..1257ced93 100644 --- a/test/pthread_extras/twostage_3_false-unreach-call.c +++ b/test/pthread_extras/twostage_3_false-unreach-call.c @@ -19,109 +19,108 @@ void lock(pthread_mutex_t *); void unlock(pthread_mutex_t *); void *funcA(void *param) { - pthread_mutex_lock(data1Lock); - data1Value = 1; - pthread_mutex_unlock(data1Lock); + pthread_mutex_lock(data1Lock); + data1Value = 1; + pthread_mutex_unlock(data1Lock); - pthread_mutex_lock(data2Lock); - data2Value = data1Value + 1; - pthread_mutex_unlock(data2Lock); + pthread_mutex_lock(data2Lock); + data2Value = data1Value + 1; + pthread_mutex_unlock(data2Lock); - return NULL; + return NULL; } void *funcB(void *param) { - int t1 = -1; - int t2 = -1; + int t1 = -1; + int t2 = -1; - pthread_mutex_lock(data1Lock); - if (data1Value == 0) { - pthread_mutex_unlock(data1Lock); - return NULL; - } - t1 = data1Value; + pthread_mutex_lock(data1Lock); + if (data1Value == 0) { pthread_mutex_unlock(data1Lock); + return NULL; + } + t1 = data1Value; + pthread_mutex_unlock(data1Lock); - pthread_mutex_lock(data2Lock); - t2 = data2Value; - pthread_mutex_unlock(data2Lock); + pthread_mutex_lock(data2Lock); + t2 = data2Value; + pthread_mutex_unlock(data2Lock); - assert(t2 == (t1 + 1)); + assert(t2 == (t1 + 1)); - return NULL; + return NULL; } int main(int argc, char *argv[]) { - int i,err; - - if (argc != 1) { - if (argc != 3) { - fprintf(stderr, USAGE); - exit(-1); - } else { - sscanf(argv[1], "%d", &iTThreads); - sscanf(argv[2], "%d", &iRThreads); - } - } - - data1Lock = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t)); - data2Lock = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t)); - if (0 != (err = pthread_mutex_init(data1Lock, NULL))) { - fprintf(stderr, "pthread_mutex_init error: %d\n", err); - exit(-1); - } - if (0 != (err = pthread_mutex_init(data2Lock, NULL))) { - fprintf(stderr, "pthread_mutex_init error: %d\n", err); - exit(-1); + int i, err; + + if (argc != 1) { + if (argc != 3) { + fprintf(stderr, USAGE); + exit(-1); + } else { + sscanf(argv[1], "%d", &iTThreads); + sscanf(argv[2], "%d", &iRThreads); } - - pthread_t tPool[iTThreads]; - pthread_t rPool[iRThreads]; - - for (i = 0; i < iTThreads; i++) { - if (0 != (err = pthread_create(&tPool[i], NULL, &funcA, NULL))) { - fprintf(stderr, "Error [%d] found creating 2stage thread.\n", err); - exit(-1); - } + } + + data1Lock = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); + data2Lock = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); + if (0 != (err = pthread_mutex_init(data1Lock, NULL))) { + fprintf(stderr, "pthread_mutex_init error: %d\n", err); + exit(-1); + } + if (0 != (err = pthread_mutex_init(data2Lock, NULL))) { + fprintf(stderr, "pthread_mutex_init error: %d\n", err); + exit(-1); + } + + pthread_t tPool[iTThreads]; + pthread_t rPool[iRThreads]; + + for (i = 0; i < iTThreads; i++) { + if (0 != (err = pthread_create(&tPool[i], NULL, &funcA, NULL))) { + fprintf(stderr, "Error [%d] found creating 2stage thread.\n", err); + exit(-1); } + } - for (i = 0; i < iRThreads; i++) { - if (0 != (err = pthread_create(&rPool[i], NULL, &funcB, NULL))) { - fprintf(stderr, "Error [%d] found creating read thread.\n", err); - exit(-1); - } + for (i = 0; i < iRThreads; i++) { + if (0 != (err = pthread_create(&rPool[i], NULL, &funcB, NULL))) { + fprintf(stderr, "Error [%d] found creating read thread.\n", err); + exit(-1); } + } - for (i = 0; i < iTThreads; i++) { - if (0 != (err = pthread_join(tPool[i], NULL))) { - fprintf(stderr, "pthread join error: %d\n", err); - exit(-1); - } + for (i = 0; i < iTThreads; i++) { + if (0 != (err = pthread_join(tPool[i], NULL))) { + fprintf(stderr, "pthread join error: %d\n", err); + exit(-1); } + } - for (i = 0; i < iRThreads; i++) { - if (0 != (err = pthread_join(rPool[i], NULL))) { - fprintf(stderr, "pthread join error: %d\n", err); - exit(-1); - } + for (i = 0; i < iRThreads; i++) { + if (0 != (err = pthread_join(rPool[i], NULL))) { + fprintf(stderr, "pthread join error: %d\n", err); + exit(-1); } + } - return 0; + return 0; } void lock(pthread_mutex_t *lock) { - int err; - if (0 != (err = pthread_mutex_lock(lock))) { - fprintf(stderr, "Got error %d from pthread_mutex_lock.\n", err); - exit(-1); - } + int err; + if (0 != (err = pthread_mutex_lock(lock))) { + fprintf(stderr, "Got error %d from pthread_mutex_lock.\n", err); + exit(-1); + } } void unlock(pthread_mutex_t *lock) { - int err; - if (0 != (err = pthread_mutex_unlock(lock))) { - fprintf(stderr, "Got error %d from pthread_mutex_unlock.\n", err); - exit(-1); - } + int err; + if (0 != (err = pthread_mutex_unlock(lock))) { + fprintf(stderr, "Got error %d from pthread_mutex_unlock.\n", err); + exit(-1); + } } - diff --git a/test/reach/break.c b/test/reach/break.c index 94cc7a377..347f822a1 100644 --- a/test/reach/break.c +++ b/test/reach/break.c @@ -2,7 +2,7 @@ int main() { int a = 1; - while(a != 5) { + while (a != 5) { a++; break; a = 0; diff --git a/test/reach/continue.c b/test/reach/continue.c index d47fd28a4..4e31ec9e6 100644 --- a/test/reach/continue.c +++ b/test/reach/continue.c @@ -2,7 +2,7 @@ int main() { int a = 1; - while(a != 5) { + while (a != 5) { a++; continue; a = 0; diff --git a/test/reach/do.c b/test/reach/do.c index d4a20fcb6..6f5415844 100644 --- a/test/reach/do.c +++ b/test/reach/do.c @@ -2,6 +2,8 @@ int main() { int a = 1; - do a=2; while(a==1); + do + a = 2; + while (a == 1); return a; } diff --git a/test/reach/for.c b/test/reach/for.c index 280189fcb..5a7e2dd4d 100644 --- a/test/reach/for.c +++ b/test/reach/for.c @@ -3,6 +3,7 @@ int main() { int a = 1; int b = 0; - for(a = 0; a < -1; a++) b++; + for (a = 0; a < -1; a++) + b++; return b; } diff --git a/test/reach/for2.c b/test/reach/for2.c index 1c27c22aa..93defa0fc 100644 --- a/test/reach/for2.c +++ b/test/reach/for2.c @@ -3,6 +3,7 @@ int main() { int a = 2; int b = 0; - for(a = 0; a < 1; a++) b++; + for (a = 0; a < 1; a++) + b++; return b; } diff --git a/test/reach/func.c b/test/reach/func.c index c060caf5c..224370e8f 100644 --- a/test/reach/func.c +++ b/test/reach/func.c @@ -1,8 +1,6 @@ #include "smack.h" -int func() { - return 1; -} +int func() { return 1; } int main() { int a; diff --git a/test/reach/func2.c b/test/reach/func2.c index b913dd678..235efe09e 100644 --- a/test/reach/func2.c +++ b/test/reach/func2.c @@ -1,12 +1,8 @@ #include "smack.h" -int func() { - return 1; -} +int func() { return 1; } -int func2() { - return func(); -} +int func2() { return func(); } int main() { int a; diff --git a/test/reach/func3.c b/test/reach/func3.c index d9dac6140..2a14fafb1 100644 --- a/test/reach/func3.c +++ b/test/reach/func3.c @@ -1,12 +1,8 @@ #include "smack.h" -int func() { - return 1; -} +int func() { return 1; } -int func2() { - return func(); -} +int func2() { return func(); } int main() { int a; diff --git a/test/reach/if.c b/test/reach/if.c index 3d4975197..0bfd6dadd 100644 --- a/test/reach/if.c +++ b/test/reach/if.c @@ -2,9 +2,9 @@ int main() { int x; - x=3; - if(x == 4) + x = 3; + if (x == 4) x = 5; - + return 0; } diff --git a/test/reach/if2.c b/test/reach/if2.c index 7e1cc718d..0bfd6dadd 100644 --- a/test/reach/if2.c +++ b/test/reach/if2.c @@ -2,8 +2,9 @@ int main() { int x; - x=3; - if(x == 4) x = 5; - + x = 3; + if (x == 4) + x = 5; + return 0; } diff --git a/test/reach/if3.c b/test/reach/if3.c index c47f7d526..1ed86389b 100644 --- a/test/reach/if3.c +++ b/test/reach/if3.c @@ -2,10 +2,10 @@ int main() { int x; - x=3; - if(x == 4) { + x = 3; + if (x == 4) { x = 5; } - + return 0; } diff --git a/test/reach/if4.c b/test/reach/if4.c index 1fb7a9752..d1ec85f43 100644 --- a/test/reach/if4.c +++ b/test/reach/if4.c @@ -2,8 +2,10 @@ int main() { int x; - x=3; - if(x == 4) x = 5; x=4; - + x = 3; + if (x == 4) + x = 5; + x = 4; + return x; } diff --git a/test/reach/libs.c b/test/reach/libs.c index c420610a7..864b73e28 100644 --- a/test/reach/libs.c +++ b/test/reach/libs.c @@ -1,6 +1,4 @@ -#include #include "smack.h" +#include -int main() { - printf("testLibs\n"); -} +int main() { printf("testLibs\n"); } diff --git a/test/reach/return.c b/test/reach/return.c index ebb82617a..c5eaee263 100644 --- a/test/reach/return.c +++ b/test/reach/return.c @@ -1,7 +1,7 @@ #include "smack.h" int main() { - int a=1; + int a = 1; return a; a = 2; } diff --git a/test/reach/switch.c b/test/reach/switch.c index bc55b5171..f6f4aa932 100644 --- a/test/reach/switch.c +++ b/test/reach/switch.c @@ -2,18 +2,18 @@ int main() { int a = 1; - - switch(a){ - case 0: - a++; - break; - case 1: - a--; - break; - default: - a = a*2; - break; + + switch (a) { + case 0: + a++; + break; + case 1: + a--; + break; + default: + a = a * 2; + break; } - + return a; } diff --git a/test/reach/switch2.c b/test/reach/switch2.c index 3b460b2d0..bd6e29b0f 100644 --- a/test/reach/switch2.c +++ b/test/reach/switch2.c @@ -2,18 +2,18 @@ int main() { int a = 2; - - switch(a){ - case 0: - a++; - break; - case 1: - a--; - break; - default: - a *= 2; - break; + + switch (a) { + case 0: + a++; + break; + case 1: + a--; + break; + default: + a *= 2; + break; } - + return a; } diff --git a/test/reach/switch3.c b/test/reach/switch3.c index 93144c87b..3d9253eb0 100644 --- a/test/reach/switch3.c +++ b/test/reach/switch3.c @@ -2,15 +2,15 @@ int main() { int a = 2; - - switch(a){ - case 0: - a++; - case 1: - a--; - default: - a *= 2; + + switch (a) { + case 0: + a++; + case 1: + a--; + default: + a *= 2; } - + return a; } diff --git a/test/reach/switch4.c b/test/reach/switch4.c index 5ebf7f275..f13bca52c 100644 --- a/test/reach/switch4.c +++ b/test/reach/switch4.c @@ -2,15 +2,15 @@ int main() { int a = 0; - - switch(a){ - case 0: - a++; - case 1: - a--; - default: - a *= 2; + + switch (a) { + case 0: + a++; + case 1: + a--; + default: + a *= 2; } - + return a; } diff --git a/test/reach/while.c b/test/reach/while.c index 9fdb6adf7..5cb5d77c3 100644 --- a/test/reach/while.c +++ b/test/reach/while.c @@ -2,6 +2,7 @@ int main() { int a = 1; - while(a > 1) a--; + while (a > 1) + a--; return a; } diff --git a/test/reach/while2.c b/test/reach/while2.c index 3318a33f4..0cddb425a 100644 --- a/test/reach/while2.c +++ b/test/reach/while2.c @@ -2,6 +2,11 @@ int main() { int a = 3; - while(a > 1) a--; if(a==1) a=-1; else a=-2; + while (a > 1) + a--; + if (a == 1) + a = -1; + else + a = -2; return a; } diff --git a/test/reach/while3.c b/test/reach/while3.c index 04cc34f69..36a205e23 100644 --- a/test/reach/while3.c +++ b/test/reach/while3.c @@ -2,6 +2,11 @@ int main() { int a = 0; - while(a > 1) a--; if(a==1) a=-1; else a=-2; + while (a > 1) + a--; + if (a == 1) + a = -1; + else + a = -2; return a; } diff --git a/test/simd/add.c b/test/simd/add.c index e7fc77b06..b0684baf7 100644 --- a/test/simd/add.c +++ b/test/simd/add.c @@ -1,12 +1,12 @@ -#include #include +#include // @expect verified int main(void) { - __m128i a = _mm_set_epi64x(1,2); - __m128i b = _mm_set_epi64x(10,10); - __m128i c = _mm_add_epi64(a,b); + __m128i a = _mm_set_epi64x(1, 2); + __m128i b = _mm_set_epi64x(10, 10); + __m128i c = _mm_add_epi64(a, b); assert(c[0] == 12); assert(c[1] == 11); return 0; diff --git a/test/simd/add_fail.c b/test/simd/add_fail.c index 7da0fdd73..35767a321 100644 --- a/test/simd/add_fail.c +++ b/test/simd/add_fail.c @@ -1,12 +1,12 @@ -#include #include +#include // @expect error int main(void) { - __m128i a = _mm_set_epi64x(1,2); - __m128i b = _mm_set_epi64x(10,10); - __m128i c = _mm_add_epi64(a,b); + __m128i a = _mm_set_epi64x(1, 2); + __m128i b = _mm_set_epi64x(10, 10); + __m128i c = _mm_add_epi64(a, b); assert(c[0] != 12); return 0; } diff --git a/test/simd/cast.c b/test/simd/cast.c index 036df0a61..7b0e0df2d 100644 --- a/test/simd/cast.c +++ b/test/simd/cast.c @@ -1,11 +1,11 @@ -#include #include +#include // @expect verified int main(void) { long long a = 42; - __m64 b = (__m64) a; + __m64 b = (__m64)a; assert(b[0] == 42); return 0; } diff --git a/test/simd/cast_fail.c b/test/simd/cast_fail.c index f2544019e..39444e3da 100644 --- a/test/simd/cast_fail.c +++ b/test/simd/cast_fail.c @@ -1,11 +1,11 @@ -#include #include +#include // @expect error int main(void) { long long a = 42; - __m64 b = (__m64) a; + __m64 b = (__m64)a; assert(b[0] == 41); return 0; } diff --git a/test/simd/constant.c b/test/simd/constant.c index 03477a5d8..2a45a19e1 100644 --- a/test/simd/constant.c +++ b/test/simd/constant.c @@ -1,10 +1,10 @@ -#include #include +#include // @expect verified int main(void) { - __m128i v = {0xff,0xff}; + __m128i v = {0xff, 0xff}; assert(v[0] == 0xff); return 0; } diff --git a/test/simd/constant_fail.c b/test/simd/constant_fail.c index 1b6cdee6e..1019f02bf 100644 --- a/test/simd/constant_fail.c +++ b/test/simd/constant_fail.c @@ -1,10 +1,10 @@ -#include #include +#include // @expect error int main(void) { - __m128i v = {0xff,0xff}; + __m128i v = {0xff, 0xff}; assert(v[0] == 0xfe); return 0; } diff --git a/test/simd/shuffle.c b/test/simd/shuffle.c index 2cf4187f8..71fa520b2 100644 --- a/test/simd/shuffle.c +++ b/test/simd/shuffle.c @@ -1,17 +1,17 @@ -#include #include +#include // @expect verified int main() { - __m128i A = _mm_set_epi32(13,12,11,10); - __m128i B = _mm_set_epi32(23,22,21,20); + __m128i A = _mm_set_epi32(13, 12, 11, 10); + __m128i B = _mm_set_epi32(23, 22, 21, 20); - A = _mm_shuffle_epi32(A,2*1 + 3*4 + 2*16 + 3*64); - B = _mm_shuffle_epi32(B,2*1 + 3*4 + 2*16 + 3*64); + A = _mm_shuffle_epi32(A, 2 * 1 + 3 * 4 + 2 * 16 + 3 * 64); + B = _mm_shuffle_epi32(B, 2 * 1 + 3 * 4 + 2 * 16 + 3 * 64); - __m128i C = _mm_blend_epi32(A,B,0xf0); + __m128i C = _mm_blend_epi32(A, B, 0xf0); - assert(_mm_extract_epi32(C,0) != 0); + assert(_mm_extract_epi32(C, 0) != 0); return 0; } diff --git a/test/simd/shuffle_fail.c b/test/simd/shuffle_fail.c index 0bfb9d913..c33c175f9 100644 --- a/test/simd/shuffle_fail.c +++ b/test/simd/shuffle_fail.c @@ -1,17 +1,17 @@ -#include #include +#include // @expect error int main() { - __m128i A = _mm_set_epi32(13,12,11,10); - __m128i B = _mm_set_epi32(23,22,21,20); + __m128i A = _mm_set_epi32(13, 12, 11, 10); + __m128i B = _mm_set_epi32(23, 22, 21, 20); - A = _mm_shuffle_epi32(A,2*1 + 3*4 + 2*16 + 3*64); - B = _mm_shuffle_epi32(B,2*1 + 3*4 + 2*16 + 3*64); + A = _mm_shuffle_epi32(A, 2 * 1 + 3 * 4 + 2 * 16 + 3 * 64); + B = _mm_shuffle_epi32(B, 2 * 1 + 3 * 4 + 2 * 16 + 3 * 64); - __m128i C = _mm_blend_epi32(A,B,0xf0); + __m128i C = _mm_blend_epi32(A, B, 0xf0); - assert(_mm_extract_epi32(C,0) == 0); + assert(_mm_extract_epi32(C, 0) == 0); return 0; } diff --git a/test/strings/strcat.c b/test/strings/strcat.c index 31d5b53e0..5c7f3bded 100644 --- a/test/strings/strcat.c +++ b/test/strings/strcat.c @@ -1,14 +1,14 @@ -#include #include "smack.h" +#include // @expect verified int main(void) { char brick[10]; - strcpy(brick,"bl"); + strcpy(brick, "bl"); char *glue = "ue"; - char *modernart = strcat(brick,glue); + char *modernart = strcat(brick, glue); - assert(strcmp(modernart,"blue") == 0); + assert(strcmp(modernart, "blue") == 0); return 0; } diff --git a/test/strings/strcat_fail.c b/test/strings/strcat_fail.c index 47a2fcf85..c37de53c9 100644 --- a/test/strings/strcat_fail.c +++ b/test/strings/strcat_fail.c @@ -1,14 +1,14 @@ -#include #include "smack.h" +#include -// @expect error +// @expect error int main(void) { char brick[4]; - strcpy(brick,"bl"); + strcpy(brick, "bl"); char *glue = "u!"; - char *modernart = strcat(brick,glue); + char *modernart = strcat(brick, glue); - assert(strcmp(modernart,"blue") == 0); + assert(strcmp(modernart, "blue") == 0); return 0; } diff --git a/test/strings/strcat_overflow.c b/test/strings/strcat_overflow.c index 41f9689d0..82b722cdd 100644 --- a/test/strings/strcat_overflow.c +++ b/test/strings/strcat_overflow.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @flag --memory-safety // @expect error @@ -7,9 +7,8 @@ int main(void) { char notLong[3] = "So"; char *moreText = ".."; - char *overflowed = strcat(notLong,moreText); + char *overflowed = strcat(notLong, moreText); - assert(strcmp(overflowed,"So..") == 0); - return 0; + assert(strcmp(overflowed, "So..") == 0); + return 0; } - diff --git a/test/strings/strchr.c b/test/strings/strchr.c index 9026bd9c8..3fedb3255 100644 --- a/test/strings/strchr.c +++ b/test/strings/strchr.c @@ -1,12 +1,12 @@ -#include #include "smack.h" +#include // @expect verified int main(void) { char *sentence = "a..b"; - char *withoutFirstWord = strchr(sentence,'.'); + char *withoutFirstWord = strchr(sentence, '.'); - assert(strcmp(withoutFirstWord,"..b") == 0); + assert(strcmp(withoutFirstWord, "..b") == 0); return 0; } diff --git a/test/strings/strchr_fail.c b/test/strings/strchr_fail.c index 92e8a4e58..a09beb534 100644 --- a/test/strings/strchr_fail.c +++ b/test/strings/strchr_fail.c @@ -1,11 +1,11 @@ -#include #include "smack.h" +#include // @expect error int main(void) { char *notAWebAddress = "word"; - char *dotToEnd = strchr(notAWebAddress,'.'); + char *dotToEnd = strchr(notAWebAddress, '.'); assert(dotToEnd != 0); return 0; diff --git a/test/strings/strcmp.c b/test/strings/strcmp.c index aec6302f6..291329eb0 100644 --- a/test/strings/strcmp.c +++ b/test/strings/strcmp.c @@ -1,12 +1,12 @@ -#include #include "smack.h" +#include // @expect verified int main(void) { char *smaller = "AAAA"; char *bigger = "aaaa"; - int comparison = strcmp(smaller,bigger); + int comparison = strcmp(smaller, bigger); assert(comparison < 0); return 0; diff --git a/test/strings/strcmp_fail.c b/test/strings/strcmp_fail.c index adfc67818..e1b467a66 100644 --- a/test/strings/strcmp_fail.c +++ b/test/strings/strcmp_fail.c @@ -1,12 +1,12 @@ -#include #include "smack.h" +#include // @expect error int main(void) { char *alpha = "alph"; char *zeta = "zeta"; - int comparison = strcmp(alpha,zeta); + int comparison = strcmp(alpha, zeta); assert(comparison == 0); return 0; diff --git a/test/strings/strcpy.c b/test/strings/strcpy.c index e9357eb82..ee7abd0bf 100644 --- a/test/strings/strcpy.c +++ b/test/strings/strcpy.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect verified @@ -7,9 +7,8 @@ int main(void) { const char *word = "Roof"; char container[5]; - strcpy(container,word); + strcpy(container, word); assert(strlen(container) == 4); - assert(strcmp(container,word) == 0); + assert(strcmp(container, word) == 0); return 0; } - diff --git a/test/strings/strcpy_fail.c b/test/strings/strcpy_fail.c index 335080964..1db27f451 100644 --- a/test/strings/strcpy_fail.c +++ b/test/strings/strcpy_fail.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect error @@ -7,8 +7,7 @@ int main(void) { const char *word = "made"; char container[5]; - strcpy(container,word); - assert(strcmp(container,"made") != 0); + strcpy(container, word); + assert(strcmp(container, "made") != 0); return 0; } - diff --git a/test/strings/strcpy_overflow.c b/test/strings/strcpy_overflow.c index a2cd28d26..284340248 100644 --- a/test/strings/strcpy_overflow.c +++ b/test/strings/strcpy_overflow.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @flag --memory-safety // @expect error @@ -7,7 +7,6 @@ int main(void) { const char *sentence = "long"; char container[2]; - strcpy(container,sentence); // buffer overflow! + strcpy(container, sentence); // buffer overflow! return 0; } - diff --git a/test/strings/strcspn.c b/test/strings/strcspn.c index 41beb6d89..0765f135b 100644 --- a/test/strings/strcspn.c +++ b/test/strings/strcspn.c @@ -1,11 +1,11 @@ -#include #include "smack.h" +#include -// @expect verified +// @expect verified int main(void) { char *string = "ffef"; - size_t firstE = strcspn(string,"e"); + size_t firstE = strcspn(string, "e"); assert(firstE == 2); return 0; diff --git a/test/strings/strcspn_fail.c b/test/strings/strcspn_fail.c index 2e3d2e593..4db6da711 100644 --- a/test/strings/strcspn_fail.c +++ b/test/strings/strcspn_fail.c @@ -1,11 +1,11 @@ -#include #include "smack.h" +#include // @expect error int main(void) { char *string = "ffff"; - size_t firstE = strcspn(string,"f"); + size_t firstE = strcspn(string, "f"); assert(firstE == 5); return 0; diff --git a/test/strings/strlen.c b/test/strings/strlen.c index 4a80029cf..98933631f 100644 --- a/test/strings/strlen.c +++ b/test/strings/strlen.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect verified @@ -8,5 +8,5 @@ int main(void) { char word[] = "Hi!!"; assert(strlen(word) == 4); - return 0; + return 0; } diff --git a/test/strings/strlen_fail.c b/test/strings/strlen_fail.c index bb2579876..56b3ad285 100644 --- a/test/strings/strlen_fail.c +++ b/test/strings/strlen_fail.c @@ -1,6 +1,6 @@ +#include "smack.h" #include #include -#include "smack.h" // @expect error diff --git a/test/strings/strncat.c b/test/strings/strncat.c index 6a8bedbc2..80c52874d 100644 --- a/test/strings/strncat.c +++ b/test/strings/strncat.c @@ -1,15 +1,15 @@ -#include #include "smack.h" +#include // @expect verified int main(void) { char dish[40]; - strcpy(dish,"R"); + strcpy(dish, "R"); char *milk = "ice"; - strncat(dish,milk,2); + strncat(dish, milk, 2); - assert(strcmp(dish,"Ric") == 0); + assert(strcmp(dish, "Ric") == 0); return 0; } diff --git a/test/strings/strncat_fail.c b/test/strings/strncat_fail.c index f94228d9f..5c8238074 100644 --- a/test/strings/strncat_fail.c +++ b/test/strings/strncat_fail.c @@ -1,15 +1,15 @@ -#include #include "smack.h" +#include // @expect error int main(void) { char dish[30]; - strcpy(dish,"R"); + strcpy(dish, "R"); char *milk = "ice"; - strncat(dish,milk,2); + strncat(dish, milk, 2); - assert(strcmp(dish,"Rice") == 0); + assert(strcmp(dish, "Rice") == 0); return 0; } diff --git a/test/strings/strncmp.c b/test/strings/strncmp.c index d8ab49225..03f229a86 100644 --- a/test/strings/strncmp.c +++ b/test/strings/strncmp.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect verified @@ -7,7 +7,7 @@ int main(void) { char *str1 = "aaAA"; char *str2 = "aaBB"; - assert(strncmp(str1,str2,2) == 0); - assert(strncmp(str1,str2,3) < 0); + assert(strncmp(str1, str2, 2) == 0); + assert(strncmp(str1, str2, 3) < 0); return 0; } diff --git a/test/strings/strncmp_fail.c b/test/strings/strncmp_fail.c index 962fbc4b0..88690b9c2 100644 --- a/test/strings/strncmp_fail.c +++ b/test/strings/strncmp_fail.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect error @@ -7,6 +7,6 @@ int main(void) { char *str1 = "aaAA"; char *str2 = "aBBB"; - assert(strncmp(str1,str2,2) == 0); + assert(strncmp(str1, str2, 2) == 0); return 0; } diff --git a/test/strings/strncmp_toolong.c b/test/strings/strncmp_toolong.c index eaa0046ce..893e20542 100644 --- a/test/strings/strncmp_toolong.c +++ b/test/strings/strncmp_toolong.c @@ -1,5 +1,5 @@ -#include #include "smack.h" +#include // @expect verified @@ -8,6 +8,6 @@ int main(void) { char *otherShorty = "go"; int comparison = strncmp(shorty, otherShorty, 5); - assert(comparison == 0); + assert(comparison == 0); return 0; } diff --git a/test/strings/strpbrk.c b/test/strings/strpbrk.c index 699dd2e97..5e77533ec 100644 --- a/test/strings/strpbrk.c +++ b/test/strings/strpbrk.c @@ -1,12 +1,12 @@ -#include #include "smack.h" +#include // @expect verified int main(void) { char *letters = "abcd"; - char *fromFirstBorC = strpbrk(letters,"cb"); + char *fromFirstBorC = strpbrk(letters, "cb"); - assert(strcmp(fromFirstBorC,"bcd") == 0); + assert(strcmp(fromFirstBorC, "bcd") == 0); return 0; } diff --git a/test/strings/strpbrk_fail.c b/test/strings/strpbrk_fail.c index b029e0c59..0f1473b66 100644 --- a/test/strings/strpbrk_fail.c +++ b/test/strings/strpbrk_fail.c @@ -1,11 +1,11 @@ -#include #include "smack.h" +#include -// @expect error +// @expect error int main(void) { char *letters = "efgh"; - char *fromFirstBorC = strpbrk(letters,"bc"); + char *fromFirstBorC = strpbrk(letters, "bc"); assert(fromFirstBorC != 0); return 0; diff --git a/test/strings/strrchr.c b/test/strings/strrchr.c index edfad22e3..5cd6931a3 100644 --- a/test/strings/strrchr.c +++ b/test/strings/strrchr.c @@ -1,12 +1,12 @@ -#include #include "smack.h" +#include // @expect verified int main(void) { char *website = "a..b"; - char *dotCom = strrchr(website,'.'); + char *dotCom = strrchr(website, '.'); - assert(strcmp(dotCom,".b") == 0); + assert(strcmp(dotCom, ".b") == 0); return 0; } diff --git a/test/strings/strrchr_fail.c b/test/strings/strrchr_fail.c index 9e6b9bac9..5d677b63f 100644 --- a/test/strings/strrchr_fail.c +++ b/test/strings/strrchr_fail.c @@ -1,12 +1,12 @@ -#include #include "smack.h" +#include // @expect error int main(void) { char *website = "a..b"; - char dotCom = strrchr(website,'.'); + char dotCom = strrchr(website, '.'); - assert(strcmp(dotCom,"..b") == 0); + assert(strcmp(dotCom, "..b") == 0); return 0; } diff --git a/test/strings/strspn.c b/test/strings/strspn.c index 4a5d5ffcd..a03ce076c 100644 --- a/test/strings/strspn.c +++ b/test/strings/strspn.c @@ -1,12 +1,12 @@ -#include #include "smack.h" +#include // @expect verified int main(void) { char *field = "bbab"; - size_t firstNonB = strspn(field,"b"); - size_t end = strspn(field,"ab"); + size_t firstNonB = strspn(field, "b"); + size_t end = strspn(field, "ab"); assert(firstNonB == 2); assert(end == strlen(field)); diff --git a/test/strings/strspn_fail.c b/test/strings/strspn_fail.c index 0a1bdad33..3262c6975 100644 --- a/test/strings/strspn_fail.c +++ b/test/strings/strspn_fail.c @@ -1,11 +1,11 @@ -#include #include "smack.h" +#include -// @expect error +// @expect error int main(void) { char *field = "bbcb"; - size_t end = strspn(field,"ab"); + size_t end = strspn(field, "ab"); assert(end == strlen(field)); return 0; diff --git a/test/strings/strstr.c b/test/strings/strstr.c index 373f486c5..edf20a795 100644 --- a/test/strings/strstr.c +++ b/test/strings/strstr.c @@ -1,13 +1,13 @@ -#include #include "smack.h" +#include // @expect verified int main(void) { char *large = "wxyz"; char *small = "xy"; - char *firstOccurrenceOfXY = strstr(large,small); + char *firstOccurrenceOfXY = strstr(large, small); - assert(strcmp(firstOccurrenceOfXY,"xyz") == 0); + assert(strcmp(firstOccurrenceOfXY, "xyz") == 0); return 0; } diff --git a/test/strings/strstr_fail.c b/test/strings/strstr_fail.c index 85c42a6f4..55124ab97 100644 --- a/test/strings/strstr_fail.c +++ b/test/strings/strstr_fail.c @@ -1,12 +1,12 @@ -#include #include "smack.h" +#include // @expect error int main(void) { char *large = "lmno"; char *small = "xy"; - char *firstOccurrenceOfXY = strstr(large,small); + char *firstOccurrenceOfXY = strstr(large, small); assert(firstOccurrenceOfXY != 0); return 0; diff --git a/test/strings/strtok.c b/test/strings/strtok.c index 18c844645..9184c2e59 100644 --- a/test/strings/strtok.c +++ b/test/strings/strtok.c @@ -1,16 +1,15 @@ -#include #include "smack.h" +#include // @expect verified int main(void) { char *string = "a-b"; char *delim = "-"; - char *firstTok = strtok(string,delim); - char *nextTok = strtok(NULL,delim); + char *firstTok = strtok(string, delim); + char *nextTok = strtok(NULL, delim); - assert(strcmp(firstTok,"a") == 0); - assert(strcmp(nextTok,"b") == 0); + assert(strcmp(firstTok, "a") == 0); + assert(strcmp(nextTok, "b") == 0); return 0; - } diff --git a/test/strings/strtok_fail.c b/test/strings/strtok_fail.c index 42ec58e98..bc3a6dbfd 100644 --- a/test/strings/strtok_fail.c +++ b/test/strings/strtok_fail.c @@ -1,15 +1,15 @@ -#include #include "smack.h" +#include // @expect error int main(void) { char *string = "a--"; char *delim = "-"; - char *firstTok = strtok(string,delim); - char *nextTok = strtok(NULL,delim); + char *firstTok = strtok(string, delim); + char *nextTok = strtok(NULL, delim); - assert(strcmp(firstTok,"a") == 0); - assert(strcmp(nextTok,"b") == 0); + assert(strcmp(firstTok, "a") == 0); + assert(strcmp(nextTok, "b") == 0); return 0; } diff --git a/tools/llvm2bpl/llvm2bpl.cpp b/tools/llvm2bpl/llvm2bpl.cpp index c169a7590..f3f165c44 100644 --- a/tools/llvm2bpl/llvm2bpl.cpp +++ b/tools/llvm2bpl/llvm2bpl.cpp @@ -5,67 +5,71 @@ #include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/Analysis/TargetTransformInfo.h" -#include "llvm/LinkAllPasses.h" -#include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/LLVMContext.h" +#include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/Module.h" #include "llvm/IRReader/IRReader.h" +#include "llvm/LinkAllPasses.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/FileSystem.h" +#include "llvm/Support/FormattedStream.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/Signals.h" #include "llvm/Support/SourceMgr.h" -#include "llvm/Support/FileSystem.h" #include "llvm/Support/TargetRegistry.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Support/ToolOutputFile.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/Support/FormattedStream.h" #include "llvm/Target/TargetMachine.h" -#include "smack/SmackOptions.h" -#include "smack/BplFilePrinter.h" -#include "smack/SmackModuleGenerator.h" -#include "assistDS/StructReturnToPointer.h" +#include "assistDS/Devirt.h" +#include "assistDS/MergeGEP.h" #include "assistDS/SimplifyExtractValue.h" #include "assistDS/SimplifyInsertValue.h" -#include "assistDS/MergeGEP.h" -#include "assistDS/Devirt.h" +#include "assistDS/StructReturnToPointer.h" #include "smack/AddTiming.h" +#include "smack/BplFilePrinter.h" #include "smack/CodifyStaticInits.h" -#include "smack/RemoveDeadDefs.h" #include "smack/ExtractContracts.h" -#include "smack/VerifierCodeMetadata.h" -#include "smack/SimplifyLibCalls.h" -#include "smack/MemorySafetyChecker.h" #include "smack/IntegerOverflowChecker.h" -#include "smack/SplitAggregateValue.h" +#include "smack/MemorySafetyChecker.h" #include "smack/NormalizeLoops.h" +#include "smack/RemoveDeadDefs.h" +#include "smack/SimplifyLibCalls.h" +#include "smack/SmackModuleGenerator.h" +#include "smack/SmackOptions.h" +#include "smack/SplitAggregateValue.h" +#include "smack/VerifierCodeMetadata.h" static llvm::cl::opt -InputFilename(llvm::cl::Positional, llvm::cl::desc(""), - llvm::cl::Required, llvm::cl::value_desc("filename")); + InputFilename(llvm::cl::Positional, + llvm::cl::desc(""), + llvm::cl::Required, llvm::cl::value_desc("filename")); static llvm::cl::opt -OutputFilename("bpl", llvm::cl::desc("Output Boogie filename"), - llvm::cl::init(""), llvm::cl::value_desc("filename")); + OutputFilename("bpl", llvm::cl::desc("Output Boogie filename"), + llvm::cl::init(""), llvm::cl::value_desc("filename")); static llvm::cl::opt -FinalIrFilename("ll", llvm::cl::desc("Output the finally-used LLVM IR"), - llvm::cl::init(""), llvm::cl::value_desc("filename")); + FinalIrFilename("ll", llvm::cl::desc("Output the finally-used LLVM IR"), + llvm::cl::init(""), llvm::cl::value_desc("filename")); -static llvm::cl::opt -StaticUnroll("static-unroll", llvm::cl::desc("Use LLVM to statically unroll loops when possible"), - llvm::cl::init(false)); +static llvm::cl::opt StaticUnroll( + "static-unroll", + llvm::cl::desc("Use LLVM to statically unroll loops when possible"), + llvm::cl::init(false)); -static llvm::cl::opt -DefaultDataLayout("default-data-layout", llvm::cl::desc("data layout string to use if not specified by module"), - llvm::cl::init(""), llvm::cl::value_desc("layout-string")); +static llvm::cl::opt DefaultDataLayout( + "default-data-layout", + llvm::cl::desc("data layout string to use if not specified by module"), + llvm::cl::init(""), llvm::cl::value_desc("layout-string")); -static llvm::cl::opt -Modular("modular", llvm::cl::desc("Enable contracts-based modular deductive verification"), - llvm::cl::init(false)); +static llvm::cl::opt Modular( + "modular", + llvm::cl::desc("Enable contracts-based modular deductive verification"), + llvm::cl::init(false)); std::string filenamePrefix(const std::string &str) { return str.substr(0, str.find_last_of(".")); @@ -73,49 +77,49 @@ std::string filenamePrefix(const std::string &str) { #define DEBUG_TYPE "llvm2bpl" - - namespace { - static void check(std::string E) { - if (!E.empty()) { - if (errs().has_colors()) - errs().changeColor(raw_ostream::RED); - errs () << E << "\n"; - if (errs().has_colors()) - errs().resetColor(); - exit(1); - } +static void check(std::string E) { + if (!E.empty()) { + if (errs().has_colors()) + errs().changeColor(raw_ostream::RED); + errs() << E << "\n"; + if (errs().has_colors()) + errs().resetColor(); + exit(1); } +} - // Returns the TargetMachine instance or zero if no triple is provided. - static TargetMachine* GetTargetMachine(Triple TheTriple, StringRef CPUStr, - StringRef FeaturesStr, - const TargetOptions &Options) { - std::string Error; - - StringRef MArch; +// Returns the TargetMachine instance or zero if no triple is provided. +static TargetMachine *GetTargetMachine(Triple TheTriple, StringRef CPUStr, + StringRef FeaturesStr, + const TargetOptions &Options) { + std::string Error; - const Target *TheTarget = TargetRegistry::lookupTarget(MArch, TheTriple, - Error); + StringRef MArch; - assert(TheTarget && "If we don't have a target machine, can't do timing analysis"); + const Target *TheTarget = + TargetRegistry::lookupTarget(MArch, TheTriple, Error); - return TheTarget-> - createTargetMachine(TheTriple.getTriple(), - CPUStr, - FeaturesStr, - Options, - Reloc::Static, /* was getRelocModel(),*/ - CodeModel::Default, /* was CMModel,*/ - CodeGenOpt::None /*GetCodeGenOptLevel())*/ - ); + assert(TheTarget && + "If we don't have a target machine, can't do timing analysis"); - } + return TheTarget->createTargetMachine( + TheTriple.getTriple(), CPUStr, FeaturesStr, Options, + Reloc::Static, /* was getRelocModel(),*/ + CodeModel::Default, /* was CMModel,*/ + CodeGenOpt::None /*GetCodeGenOptLevel())*/ + ); +} } int main(int argc, char **argv) { - llvm::llvm_shutdown_obj shutdown; // calls llvm_shutdown() on exit - llvm::cl::ParseCommandLineOptions(argc, argv, "llvm2bpl - LLVM bitcode to Boogie transformation\n"); + llvm::llvm_shutdown_obj shutdown; // calls llvm_shutdown() on exit + llvm::cl::ParseCommandLineOptions( + argc, argv, "llvm2bpl - LLVM bitcode to Boogie transformation\n"); + + if (smack::SmackOptions::BitPrecisePointers) { + smack::SmackOptions::BitPrecise = true; + } llvm::sys::PrintStackTraceOnErrorSignal(argv[0]); llvm::PrettyStackTraceProgram PSTP(argc, argv); @@ -129,7 +133,8 @@ int main(int argc, char **argv) { InitializeAllAsmPrinters(); InitializeAllAsmParsers(); - std::unique_ptr module = llvm::parseIRFile(InputFilename, err, Context); + std::unique_ptr module = + llvm::parseIRFile(InputFilename, err, Context); if (!err.getMessage().empty()) check("Problem reading input bitcode/IR: " + err.getMessage().str()); @@ -147,18 +152,18 @@ int main(int argc, char **argv) { llvm::legacy::PassManager pass_manager; pass_manager.add(llvm::createLowerSwitchPass()); - //pass_manager.add(llvm::createCFGSimplificationPass()); + // pass_manager.add(llvm::createCFGSimplificationPass()); pass_manager.add(llvm::createInternalizePass()); pass_manager.add(llvm::createPromoteMemoryToRegisterPass()); if (StaticUnroll) { pass_manager.add(llvm::createLoopSimplifyPass()); pass_manager.add(llvm::createLoopRotatePass()); - //pass_manager.add(llvm::createIndVarSimplifyPass()); + // pass_manager.add(llvm::createIndVarSimplifyPass()); pass_manager.add(llvm::createLoopUnrollPass(32767)); } - //pass_manager.add(new llvm::StructRet()); + // pass_manager.add(new llvm::StructRet()); pass_manager.add(new smack::NormalizeLoops()); pass_manager.add(new llvm::SimplifyEV()); pass_manager.add(new llvm::SimplifyIV()); @@ -180,32 +185,37 @@ int main(int argc, char **argv) { pass_manager.add(new smack::IntegerOverflowChecker()); - - if(smack::SmackOptions::AddTiming){ + if (smack::SmackOptions::AddTiming) { Triple ModuleTriple(module->getTargetTriple()); - assert (ModuleTriple.getArch() && "Module has no defined architecture: unable to add timing annotations"); + assert( + ModuleTriple.getArch() && + "Module has no defined architecture: unable to add timing annotations"); - const TargetOptions Options; /* = InitTargetOptionsFromCodeGenFlags();*/ - std::string CPUStr = ""; /*getCPUStr();*/ + const TargetOptions Options; /* = InitTargetOptionsFromCodeGenFlags();*/ + std::string CPUStr = ""; /*getCPUStr();*/ std::string FeaturesStr = ""; /*getFeaturesStr();*/ - TargetMachine *Machine = GetTargetMachine(ModuleTriple, CPUStr, FeaturesStr, Options); + TargetMachine *Machine = + GetTargetMachine(ModuleTriple, CPUStr, FeaturesStr, Options); - assert(Machine && "Module did not have a Target Machine: Cannot set up timing pass"); + assert(Machine && + "Module did not have a Target Machine: Cannot set up timing pass"); // Add an appropriate TargetLibraryInfo pass for the module's triple. TargetLibraryInfoImpl TLII(ModuleTriple); pass_manager.add(new TargetLibraryInfoWrapperPass(TLII)); // Add internal analysis passes from the target machine. - pass_manager.add(createTargetTransformInfoWrapperPass(Machine->getTargetIRAnalysis())); + pass_manager.add( + createTargetTransformInfoWrapperPass(Machine->getTargetIRAnalysis())); pass_manager.add(new smack::AddTiming()); } - std::vector files; + std::vector files; if (!FinalIrFilename.empty()) { std::error_code EC; auto F = new tool_output_file(FinalIrFilename.c_str(), EC, sys::fs::F_None); - if (EC) check(EC.message()); + if (EC) + check(EC.message()); F->keep(); files.push_back(F); pass_manager.add(llvm::createPrintModulePass(F->os())); @@ -214,7 +224,8 @@ int main(int argc, char **argv) { if (!OutputFilename.empty()) { std::error_code EC; auto F = new tool_output_file(OutputFilename.c_str(), EC, sys::fs::F_None); - if (EC) check(EC.message()); + if (EC) + check(EC.message()); F->keep(); files.push_back(F); pass_manager.add(new smack::SmackModuleGenerator());